@fuzdev/fuz_app 0.178.0 → 0.179.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.
- package/dist/actions/CLAUDE.md +106 -0
- package/dist/actions/connection_registry.d.ts +18 -0
- package/dist/actions/connection_registry.d.ts.map +1 -1
- package/dist/actions/connection_registry.js +23 -0
- package/dist/actions/room_action_specs.d.ts +733 -0
- package/dist/actions/room_action_specs.d.ts.map +1 -0
- package/dist/actions/room_action_specs.js +506 -0
- package/dist/actions/room_actions.d.ts +276 -0
- package/dist/actions/room_actions.d.ts.map +1 -0
- package/dist/actions/room_actions.js +394 -0
- package/dist/actions/room_client.svelte.d.ts +399 -0
- package/dist/actions/room_client.svelte.d.ts.map +1 -0
- package/dist/actions/room_client.svelte.js +942 -0
- package/dist/actions/room_registry.d.ts +454 -0
- package/dist/actions/room_registry.d.ts.map +1 -0
- package/dist/actions/room_registry.js +927 -0
- package/dist/auth/role_grant_offer_action_specs.d.ts +1 -1
- package/dist/auth/role_grant_queries.d.ts +17 -0
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +30 -0
- package/dist/rtc/rtc_mesh.svelte.d.ts +102 -0
- package/dist/rtc/rtc_mesh.svelte.d.ts.map +1 -0
- package/dist/rtc/rtc_mesh.svelte.js +232 -0
- package/dist/rtc/rtc_peer.svelte.d.ts +180 -0
- package/dist/rtc/rtc_peer.svelte.d.ts.map +1 -0
- package/dist/rtc/rtc_peer.svelte.js +397 -0
- package/dist/rtc/rtc_signal.d.ts +74 -0
- package/dist/rtc/rtc_signal.d.ts.map +1 -0
- package/dist/rtc/rtc_signal.js +87 -0
- package/dist/testing/CLAUDE.md +67 -13
- package/dist/testing/cross_backend/action_manifest.d.ts +34 -2
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +33 -6
- package/dist/testing/cross_backend/capabilities.d.ts +22 -4
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +4 -1
- package/dist/testing/cross_backend/full_spine_mount.d.ts +31 -6
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +45 -13
- package/dist/testing/cross_backend/rooms_ws.d.ts +20 -0
- package/dist/testing/cross_backend/rooms_ws.d.ts.map +1 -0
- package/dist/testing/cross_backend/rooms_ws.js +534 -0
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +4 -1
- package/dist/testing/cross_backend/spine_suites.d.ts +5 -2
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +24 -5
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +2 -1
- package/dist/testing/cross_backend/test_room_authorize.d.ts +47 -0
- package/dist/testing/cross_backend/test_room_authorize.d.ts.map +1 -0
- package/dist/testing/cross_backend/test_room_authorize.js +58 -0
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +10 -4
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +85 -1
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +57 -3
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +5 -2
- package/dist/ui/AccountSessions.svelte.d.ts.map +1 -1
- package/dist/ui/AdminAccounts.svelte.d.ts.map +1 -1
- package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -1
- package/dist/ui/AdminInvites.svelte.d.ts.map +1 -1
- package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
- package/dist/ui/AdminRoleGrantHistory.svelte.d.ts.map +1 -1
- package/dist/ui/AdminSessions.svelte.d.ts.map +1 -1
- package/dist/ui/AdminSettings.svelte.d.ts.map +1 -1
- package/dist/ui/AdminSurface.svelte.d.ts.map +1 -1
- package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
- package/dist/ui/ConfirmButton.svelte.d.ts.map +1 -1
- package/dist/ui/Datatable.svelte.d.ts.map +1 -1
- package/dist/ui/LoginForm.svelte.d.ts.map +1 -1
- package/dist/ui/LogoutButton.svelte.d.ts.map +1 -1
- package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
- package/dist/ui/PopoverButton.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferHistory.svelte.d.ts.map +1 -1
- package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -1
- package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
- package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
- package/package.json +18 -18
package/dist/testing/CLAUDE.md
CHANGED
|
@@ -283,7 +283,11 @@ per-method auth shape.
|
|
|
283
283
|
`InputShape`; auth axes pass through; `roles` /
|
|
284
284
|
`credential_types` flatten to sorted arrays; `rate_limit` is the declared
|
|
285
285
|
class or an explicit `null`, so a missing key reads as drift rather than a
|
|
286
|
-
default)
|
|
286
|
+
default), plus `transport: 'ws'` on a method served on the WebSocket
|
|
287
|
+
endpoint alone (`build_action_manifest(specs, ws_only_specs)` — the room
|
|
288
|
+
verbs; the Rust stub's `ws_only` specs) and no `transport` key on every other,
|
|
289
|
+
so a mount with no WebSocket-only domain method dumps the entries it always
|
|
290
|
+
has. Twin of `schema_introspect.ts`. Excludes the protocol actions
|
|
287
291
|
(`heartbeat` / `cancel` / `peer/ping`) — `create_testing_action_manifest_action`
|
|
288
292
|
filters them via the `protocol_action_specs` method set (Rust drops
|
|
289
293
|
`PROTOCOL_ACTION_SPECS`); the two impls organize them differently (`peer/ping`
|
|
@@ -1148,7 +1152,7 @@ file; the dual-spawn and limiter-enabled suites name their own files.
|
|
|
1148
1152
|
`fact_serving_admin_hash` / `ready` /
|
|
1149
1153
|
`account_status` / `peer_request` /
|
|
1150
1154
|
`ws_handshake_pipelining` / `ws_account_actions` /
|
|
1151
|
-
`ws_role_gated` / `ws_refusal_body` — each has a `test_if`
|
|
1155
|
+
`ws_role_gated` / `rooms` / `ws_refusal_body` — each has a `test_if`
|
|
1152
1156
|
reader (`ws_refusal_body` picks how the front-door table reads a WS
|
|
1153
1157
|
refusal instead); `peer_request` (server-initiated requests — the ActionPeer
|
|
1154
1158
|
`peer/ping` round-trip) is `true` on fuz_app's Rust and TS spine presets
|
|
@@ -1160,7 +1164,7 @@ file; the dual-spawn and limiter-enabled suites name their own files.
|
|
|
1160
1164
|
flags that describe a backend's own mounts (`ws`, `sse`, `cell_crud`,
|
|
1161
1165
|
`cell_relations`, `cell_gated_create`, `fact_serving`,
|
|
1162
1166
|
`fact_serving_admin_hash`, `ready`,
|
|
1163
|
-
`peer_request`, `ws_account_actions`, `ws_role_gated`), and the family
|
|
1167
|
+
`peer_request`, `ws_account_actions`, `ws_role_gated`, `rooms`), and the family
|
|
1164
1168
|
defaults (`ts_default_capabilities` / `rust_default_capabilities`, typed
|
|
1165
1169
|
`FamilyDefaultCapabilities`) omit them and the `testing_backdoors` list (the
|
|
1166
1170
|
`_testing_*` backdoors the backend mounts, from `TESTING_BACKDOOR_METHODS` —
|
|
@@ -1189,6 +1193,11 @@ file; the dual-spawn and limiter-enabled suites name their own files.
|
|
|
1189
1193
|
authorizer _behavior_ adds no method/wire shape and so the schema + manifest
|
|
1190
1194
|
parity gates are blind to an authorizer divergence (the `cell_moderate`
|
|
1191
1195
|
_verb_ it pairs with is on the manifest, separately gated).
|
|
1196
|
+
`rooms` gates `describe_rooms_ws_cross_tests` — **cross-only** too, and for
|
|
1197
|
+
the same reason: its rooms run on the `test_room_authorize` policy, so it is
|
|
1198
|
+
`true` only on a backend mounting the room verbs over that policy and an
|
|
1199
|
+
exclusive registry (the reference spine binaries); a consumer mounting rooms
|
|
1200
|
+
over its own authorizer states `false`.
|
|
1192
1201
|
`account_lifecycle` gates `describe_account_lifecycle_cross_tests` (the
|
|
1193
1202
|
`account_delete` / `account_undelete` / `account_purge` parity suite); unlike
|
|
1194
1203
|
cells those verbs **are** on the declared surface (in `create_admin_actions`,
|
|
@@ -1329,20 +1338,21 @@ here never reaches it.
|
|
|
1329
1338
|
undeclared backdoor throws before anything registers.
|
|
1330
1339
|
- **Backdoors.** `capabilities.testing_backdoors` must declare
|
|
1331
1340
|
`SPINE_SUITES_REQUIRED_BACKDOORS` (`_testing_reset`, every setup's per-test
|
|
1332
|
-
reset, and `_testing_drain_effects`, the audit-read barrier),
|
|
1333
|
-
`_testing_put_fact` when `fact_serving` is declared
|
|
1334
|
-
|
|
1335
|
-
(`SuiteEntry.backdoors`:
|
|
1336
|
-
`
|
|
1337
|
-
`_testing_origin_check`, `ws_outbound_overflow` →
|
|
1341
|
+
reset, and `_testing_drain_effects`, the audit-read barrier),
|
|
1342
|
+
`_testing_put_fact` when `fact_serving` is declared, and
|
|
1343
|
+
`_testing_room_evict` when `rooms` is; the call throws otherwise. A suite
|
|
1344
|
+
every case of which drives another backdoor (`SuiteEntry.backdoors`:
|
|
1345
|
+
`credential_deadline` → `_testing_shorten_credential_expiry`,
|
|
1346
|
+
`origin_conformance` → `_testing_origin_check`, `ws_outbound_overflow` →
|
|
1338
1347
|
`_testing_flood_notifications`) skips itself on a backend not declaring it,
|
|
1339
1348
|
as a skipped test beside the excludes whose reason names the backdoor; an
|
|
1340
1349
|
exclude, override or `exclude_cases` entry for it throws as dead.
|
|
1341
1350
|
`spine_suites.test.ts` holds the backdoors each suite module names — quoted
|
|
1342
1351
|
`_testing_*` names, `testing_*_action_spec` references, and the
|
|
1343
1352
|
`cross_put_fact` / `cross_drain_effects` seeders — to its entry's
|
|
1344
|
-
`backdoors`, the required pair,
|
|
1345
|
-
`capabilities.fact_serving
|
|
1353
|
+
`backdoors`, the required pair, `_testing_put_fact` under
|
|
1354
|
+
`capabilities.fact_serving`, or `_testing_room_evict` under
|
|
1355
|
+
`capabilities.rooms`; a helper module the suite calls isn't read.
|
|
1346
1356
|
- **`exclude_cases`** — `SuiteCaseExclusions`, `{[suite]: {[name path]:
|
|
1347
1357
|
reason}}`: single tests of a suite that runs, each by its name path (the
|
|
1348
1358
|
describe titles and the test name joined with `' > '` — what the reporter
|
|
@@ -1756,6 +1766,42 @@ fuz_app's spine binaries mount `SPINE_ROLE_GATED_WS_PATH` gated on
|
|
|
1756
1766
|
`SPINE_ROLE_GATED_WS_ROLES` (`admin` + `participant`). Gated on
|
|
1757
1767
|
`capabilities.ws` and `capabilities.ws_role_gated`; cross-process only.
|
|
1758
1768
|
|
|
1769
|
+
### `cross_backend/rooms_ws.ts` — `describe_rooms_ws_cross_tests`
|
|
1770
|
+
|
|
1771
|
+
Real-upgrade parity for the **room verbs** (`actions/room_actions.ts`) and the
|
|
1772
|
+
notifications their registry fans out: join, leave, send, state, and watch
|
|
1773
|
+
round trips with each event's shape and its room's `seq` in order, and an
|
|
1774
|
+
event never reaching the seat that caused it; the refusals' codes and reasons
|
|
1775
|
+
(`room_not_found` for a denied and a missing room alike, a malformed room id
|
|
1776
|
+
as the input schema's reasonless `invalid_params`, `room_not_joined`,
|
|
1777
|
+
`room_member_not_found` — a seat addressing itself included — the payload and
|
|
1778
|
+
state bounds in UTF-8 bytes, `room_full`, `room_watch_limit`, and
|
|
1779
|
+
`method_not_found` over HTTP); exclusivity (one seat per actor, the newest
|
|
1780
|
+
admitted winning, the displaced seat told `room_seat_lost` with `moved_to`,
|
|
1781
|
+
a same-connection rejoin moving its own seat) and the rejoin tombstone
|
|
1782
|
+
(`room_seat_moved` for a moved seat, a seat released by its disconnect
|
|
1783
|
+
rejoined); eviction through `_testing_room_evict` by scope, actor in scope,
|
|
1784
|
+
room, and actor, ending seats and watches alike; a closed socket's seat
|
|
1785
|
+
leaving as `disconnected`; and the per-connection limiter's `rate_limited`
|
|
1786
|
+
(`data.retry_after`), charged by escaped bytes, with a watch and a leave
|
|
1787
|
+
still answered past the byte budget and another socket of the account holding
|
|
1788
|
+
its own budget.
|
|
1789
|
+
Codes and `data.reason` are compared, not messages; the room verbs'
|
|
1790
|
+
action-manifest entries are the manifest parity gate's.
|
|
1791
|
+
`describe_rooms_ws_cross_tests({setup_test, capabilities, base_url, ws_path,
|
|
1792
|
+
rpc_path?})` — runs against a backend mounting the room verbs on `ws_path` over
|
|
1793
|
+
an exclusive registry with `test_room_authorize` (`test_room_authorize.ts`, the
|
|
1794
|
+
twin of the Rust stub's `TestRoomAuthorize`: the room id's prefix — `open:`,
|
|
1795
|
+
`scoped:<scope>:`, `pair:`, `watch:`, `admin:` — picks the rule, `admin:`
|
|
1796
|
+
reading the global grant live through the request's database) and the room
|
|
1797
|
+
limiter at `DEFAULT_ROOM_RATE_LIMIT`, which `capabilities.rooms` declares.
|
|
1798
|
+
Gated on `capabilities.ws` and `capabilities.rooms`; a backend declaring
|
|
1799
|
+
`rooms` declares `_testing_room_evict` too, which the eviction case drives and
|
|
1800
|
+
`describe_spine_cross_suites` requires; cross-process only. fuz_app's spine binaries mount it all
|
|
1801
|
+
(`full_spine_mount.ts`: `create_spine_room_registry`, the verbs on both WS
|
|
1802
|
+
endpoints, `_testing_room_evict` on RPC, and `_testing_reset` clearing the
|
|
1803
|
+
rooms).
|
|
1804
|
+
|
|
1759
1805
|
### `cross_backend/peer_ping_ws.ts` — `describe_peer_ping_ws_tests`
|
|
1760
1806
|
|
|
1761
1807
|
The server→client **request/response** sibling of the notification suite above —
|
|
@@ -2342,8 +2388,16 @@ are `src/test/auth/cell_crud_parity.db.test.ts`
|
|
|
2342
2388
|
`_testing_origin_check`. The Rust mirror is
|
|
2343
2389
|
`fuz_testing::create_testing_shorten_credential_expiry_action_spec`.
|
|
2344
2390
|
|
|
2391
|
+
Also not bundled: `_testing_room_evict`
|
|
2392
|
+
(`create_testing_room_evict_action(registry)`, input
|
|
2393
|
+
`{target: TestingRoomEvictTarget, reason}`) — calls the room registry's
|
|
2394
|
+
`evict` and answers its `{seats, watches, pending}` count, so the rooms suite
|
|
2395
|
+
pins eviction without a consumer's domain. It needs the registry the room
|
|
2396
|
+
verbs run on, so the full-mount layer appends it beside them. The Rust mirror
|
|
2397
|
+
is `fuz_testing::create_testing_room_evict_action_spec`.
|
|
2398
|
+
|
|
2345
2399
|
Also in `testing_reset_actions.ts` — but **not** bundled by
|
|
2346
|
-
`create_testing_actions` — `_testing_action_manifest` (+ `create_testing_action_manifest_action(mounted)`):
|
|
2400
|
+
`create_testing_actions` — `_testing_action_manifest` (+ `create_testing_action_manifest_action(mounted, ws_only?)`, `ws_only` the WebSocket-only actions it lists as `transport: 'ws'`):
|
|
2347
2401
|
dumps the live RPC registry as a normalized `ActionManifest` for the
|
|
2348
2402
|
cross-impl manifest-parity gate (see §Cross-impl RPC-manifest parity). It must
|
|
2349
2403
|
enumerate _every_ mounted method, which `create_testing_actions` (one
|
|
@@ -3011,7 +3065,7 @@ re-roll the serve / daemon-info / drain boilerplate:
|
|
|
3011
3065
|
- `testing/cross_backend/testing_server_node.ts` — `create_node_testing_adapter()` (`@hono/node-server`'s `serve` and module-level `upgradeWebSocket`, over a `ws` `WebSocketServer`). Optional peer deps; only test binaries import them. `prepare_websocket` builds the `ws` server (`noServer: true`) with `maxPayload` at twice `max_message_bytes` (default `DEFAULT_WS_MAX_MESSAGE_BYTES`; `ws`'s own default is 100 MiB), and `serve` hands it to `@hono/node-server`, so a grossly oversized message is refused at the frame layer (`WS_CLOSE_MESSAGE_TOO_BIG` with no reason) before it is buffered whole, while one just over the limit reaches the per-message check, which sends `WS_CLOSE_MESSAGE_TOO_BIG_REASON` as every other backend does. Bun's adapter sets the same multiple as its frame cap (see below).
|
|
3012
3066
|
- `testing/cross_backend/testing_server_bun.ts` — `create_bun_testing_adapter()` (`Bun.serve` + `@hono/bun`'s module-level `getConnInfo`, `upgradeWebSocket`, and `websocket`; `Bun.serve` declared locally so it typechecks under the Node toolchain). Needs the optional `@hono/bun` peer dep (the counterpart to Node's `@hono/node-server` + `ws`; `Bun.serve` is built in). Reuses `create_node_runtime` (Bun implements the `node:fs`/`node:process` surface). WS is module-level + stateless — the `websocket` handler is threaded into `serve`, where `Bun.serve` wants it. It carries `maxPayloadLength` at twice `max_message_bytes` rather than Bun's 16 MiB default: past its cap Bun drops the socket without a close frame (1006), so the headroom leaves a message just over the limit to the per-message check (`WS_CLOSE_MESSAGE_TOO_BIG`, as on Node), while a grossly oversized one is refused before Bun buffers it whole.
|
|
3013
3067
|
- `testing/cross_backend/default_spine_surface.ts` — the canonical no-domain spine surface (account/admin/audit/signup + bootstrap): `spine_session_options`, `spine_roles`, `create_spine_route_specs`, `spine_rpc_endpoints`, `create_spine_surface_spec`. This is the **declared** surface — the `create_standard_rpc_actions` bundle the spec-derived suites auto-enumerate. It passes `daemon_token: true` (both spine binaries mount the daemon-token layer) and leaves `GET /api/surface` at its default, off — the TS spine binary does too, and the Rust `testing_spine_stub` serves none. Shared by the spine_stub cross test, the TS cross tests, and the binary.
|
|
3014
|
-
- `testing/cross_backend/full_spine_mount.ts` — `build_full_spine_rpc_actions(deps, options)` — the **full** live RPC mount: the declared bundle **plus** the off-declared-surface families the binary live-mounts (`_testing_*` backdoors, the cell verb set, the opt-in `actor_lookup` / `actor_search` resolvers). `build_full_spine_mount(deps, options)` builds it once for both of the binary's endpoints, returning `FullSpineMount` (`{rpc_actions, ws_actions}`): the WS list is `protocol_actions` plus every RPC action not already among them, twinning the Rust `testing_spine_stub`, which serves one registry on RPC and WS (the one difference is `cancel` — a registered protocol action on TS, owned by the read loop on Rust). Single-sources the mount so the binary and the `spine_method_coverage` reconciliation test build the same list. `create_spine_live_rpc_endpoints()` wraps the list, built on stub deps, as one endpoint at `SPINE_RPC_PATH` — the `live_rpc_endpoints` value the conformance table, the differential and the auth-row generator resolve off-surface methods from (no handler built there runs).
|
|
3068
|
+
- `testing/cross_backend/full_spine_mount.ts` — `build_full_spine_rpc_actions(deps, options)` — the **full** live RPC mount: the declared bundle **plus** the off-declared-surface families the binary live-mounts (`_testing_*` backdoors, the cell verb set, the opt-in `actor_lookup` / `actor_search` resolvers). `build_full_spine_mount(deps, options)` builds it once for both of the binary's endpoints, returning `FullSpineMount` (`{rpc_actions, ws_actions}`): the WS list is `protocol_actions` plus every RPC action not already among them, then the WS-only room verbs and `room_notification_actions`, twinning the Rust `testing_spine_stub`, which serves one registry on RPC and WS (the one difference is `cancel` — a registered protocol action on TS, owned by the read loop on Rust — and the stub's RPC dispatcher refuses its `ws_only` room verbs). `options.room_registry` is the registry the room verbs, `_testing_room_evict`, and `_testing_reset` (which clears it) share — the binary builds it with `create_spine_room_registry(connections)` (exclusive, the default bounds; the twin of the stub's `stub_room_registry`) over its WS endpoints' connection registry; omitted, one over a fresh connection registry serves enumeration. Single-sources the mount so the binary and the `spine_method_coverage` reconciliation test build the same list. `create_spine_live_rpc_endpoints()` wraps the list, built on stub deps, as one endpoint at `SPINE_RPC_PATH` — the `live_rpc_endpoints` value the conformance table, the differential and the auth-row generator resolve off-surface methods from (no handler built there runs).
|
|
3015
3069
|
- `testing/cross_backend/ts_spine_backend_config.ts` — `ts_spine_node_backend_config()` / `ts_spine_bun_backend_config()` presets (in-memory pglet, no external infra), the TS analog of `rust_spine_stub_backend_config()`.
|
|
3016
3070
|
|
|
3017
3071
|
fuz_app's own binary wiring (`src/test/cross_backend/testing_spine_server{,_node,_bun}.ts`) is the worked example: ~one `build_app` over `create_app_backend` + `create_app_server` (`rate_limiters: 'disabled_for_testing'` plus whichever login / action limiters its env toggles built, `build_full_spine_mount`'s two lists on one `rpc_endpoints` entry and two `ws_endpoints` entries — `/api/ws` and the role-gated `SPINE_ROLE_GATED_WS_PATH` — sharing one `registry`, which is also the role-grant-offer `notification_sender`), reusing `default_spine_surface`. `src/test/cross_backend/testing_spine_server.db.test.ts` builds it with the Node adapter in-process and asserts its surface lists both WS endpoints (the gated one with its `required_roles`) and passes the surface invariants. The `_node`/`_bun` entries differ only in which adapter they wire — `build_spine_app` is runtime-agnostic. It leaves `create_app_server`'s `auth_cleanup` off, as the Rust `testing_spine_stub` leaves its twin unscheduled: a background pass would delete rows and write audit rows under a running suite. A consumer's cross-process test binary may schedule it when nothing its suites seed is already expired (the conformance table's `expired_session` principal seeds a backdated session row); an in-process harness leaves it off.
|
|
@@ -26,6 +26,14 @@ import '../assert_dev_env.js';
|
|
|
26
26
|
* spurious cross-impl diff. This matches the scope of the in-repo
|
|
27
27
|
* `spine_method_coverage` gate (also over `build_full_spine_rpc_actions`).
|
|
28
28
|
*
|
|
29
|
+
* **WebSocket-only domain methods are listed, with `transport: 'ws'`.** A
|
|
30
|
+
* domain method a backend serves on its WebSocket endpoint alone (the room
|
|
31
|
+
* verbs — the Rust stub's `ws_only` specs) is part of the surface both twins
|
|
32
|
+
* must mount alike, so it stays in the manifest, and its entry says where it
|
|
33
|
+
* is served. A method served on both transports carries no `transport` key,
|
|
34
|
+
* so a mount with no WebSocket-only domain method dumps the same entries it
|
|
35
|
+
* always has.
|
|
36
|
+
*
|
|
29
37
|
* Paired with `action_manifest_parity.ts` for the diff + assertion helpers.
|
|
30
38
|
*
|
|
31
39
|
* @module
|
|
@@ -65,6 +73,13 @@ export declare const ActionManifestEntry: import("@fuzdev/fuz_schema/schema.ts")
|
|
|
65
73
|
credential_types: import("@fuzdev/fuz_schema/schema.ts").ArraySchema<import("@fuzdev/fuz_schema/schema.ts").StringSchema>;
|
|
66
74
|
/** Per-action rate-limit class, or `null` when the action declares none. */
|
|
67
75
|
rate_limit: import("@fuzdev/fuz_schema/schema.ts").NullableSchema<import("@fuzdev/fuz_schema/schema.ts").OneOfSchema<readonly ["ip", "account", "both"]>>;
|
|
76
|
+
/**
|
|
77
|
+
* `'ws'` for a method served on the WebSocket transport only (the room
|
|
78
|
+
* verbs); absent for one served on both. Absent rather than `'both'` so a
|
|
79
|
+
* mount with no WebSocket-only method dumps exactly the keys it always has,
|
|
80
|
+
* on both spines (the Rust stub marks its `ws_only` specs the same way).
|
|
81
|
+
*/
|
|
82
|
+
transport: import("@fuzdev/fuz_schema/schema.ts").OptionalSchema<import("@fuzdev/fuz_schema/schema.ts").LiteralSchema<"ws">>;
|
|
68
83
|
}>;
|
|
69
84
|
export type ActionManifestEntry = Infer<typeof ActionManifestEntry>;
|
|
70
85
|
/** The full action manifest — every entry, sorted by `method`. */
|
|
@@ -91,14 +106,27 @@ export declare const ActionManifest: import("@fuzdev/fuz_schema/schema.ts").Obje
|
|
|
91
106
|
credential_types: import("@fuzdev/fuz_schema/schema.ts").ArraySchema<import("@fuzdev/fuz_schema/schema.ts").StringSchema>;
|
|
92
107
|
/** Per-action rate-limit class, or `null` when the action declares none. */
|
|
93
108
|
rate_limit: import("@fuzdev/fuz_schema/schema.ts").NullableSchema<import("@fuzdev/fuz_schema/schema.ts").OneOfSchema<readonly ["ip", "account", "both"]>>;
|
|
109
|
+
/**
|
|
110
|
+
* `'ws'` for a method served on the WebSocket transport only (the room
|
|
111
|
+
* verbs); absent for one served on both. Absent rather than `'both'` so a
|
|
112
|
+
* mount with no WebSocket-only method dumps exactly the keys it always has,
|
|
113
|
+
* on both spines (the Rust stub marks its `ws_only` specs the same way).
|
|
114
|
+
*/
|
|
115
|
+
transport: import("@fuzdev/fuz_schema/schema.ts").OptionalSchema<import("@fuzdev/fuz_schema/schema.ts").LiteralSchema<"ws">>;
|
|
94
116
|
}>>;
|
|
95
117
|
}>;
|
|
96
118
|
export type ActionManifest = Infer<typeof ActionManifest>;
|
|
119
|
+
/** The spec fields a manifest entry reads. */
|
|
120
|
+
export type ActionManifestSpec = Pick<RequestResponseActionSpec, 'method' | 'input' | 'auth' | 'side_effects' | 'rate_limit'>;
|
|
97
121
|
/**
|
|
98
122
|
* Normalize one spec's input shape + auth + side-effects into a manifest
|
|
99
123
|
* entry. Reads the input shape off `is_void_schema(spec.input)`, pulls the
|
|
100
124
|
* four auth axes off `RouteAuth` (the same shape the Rust `AuthSpec` mirrors),
|
|
101
125
|
* and flattens optional `roles` / `credential_types` to sorted arrays.
|
|
126
|
+
*
|
|
127
|
+
* @param spec - the method's spec
|
|
128
|
+
* @param ws_only - whether the method is served on the WebSocket transport
|
|
129
|
+
* only, which the entry says as `transport: 'ws'`
|
|
102
130
|
*/
|
|
103
131
|
export declare const action_manifest_entry: (spec: {
|
|
104
132
|
readonly method: string;
|
|
@@ -106,13 +134,17 @@ export declare const action_manifest_entry: (spec: {
|
|
|
106
134
|
readonly auth: RouteAuth;
|
|
107
135
|
readonly side_effects: boolean;
|
|
108
136
|
readonly rate_limit?: RateLimitKey;
|
|
109
|
-
}) => ActionManifestEntry;
|
|
137
|
+
}, ws_only?: boolean) => ActionManifestEntry;
|
|
110
138
|
/**
|
|
111
139
|
* Build the normalized `ActionManifest` from a list of request-response
|
|
112
140
|
* specs. Entries are sorted by `method` so two impls producing the same set
|
|
113
141
|
* serialize identically regardless of mount order. The caller owns the scope
|
|
114
142
|
* it passes (the TS spine passes its full mount; the Rust stub filters
|
|
115
143
|
* `PROTOCOL_ACTION_SPECS` first) — see the module doc.
|
|
144
|
+
*
|
|
145
|
+
* @param specs - the methods served on every transport the backend mounts
|
|
146
|
+
* @param ws_only_specs - the methods served on its WebSocket endpoint only
|
|
147
|
+
* (`transport: 'ws'`), e.g. the room verbs
|
|
116
148
|
*/
|
|
117
|
-
export declare const build_action_manifest: (specs: ReadonlyArray<
|
|
149
|
+
export declare const build_action_manifest: (specs: ReadonlyArray<ActionManifestSpec>, ws_only_specs?: ReadonlyArray<ActionManifestSpec>) => ActionManifest;
|
|
118
150
|
//# sourceMappingURL=action_manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action_manifest.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/action_manifest.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B
|
|
1
|
+
{"version":3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K,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC;CACnC,EACD,iBAAe,KACb,mBAUD,CAAC;AAMH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,GACjC,OAAO,aAAa,CAAC,kBAAkB,CAAC,EACxC,gBAAe,aAAa,CAAC,kBAAkB,CAAM,KACnD,cAKD,CAAC"}
|
|
@@ -26,11 +26,19 @@ import '../assert_dev_env.js';
|
|
|
26
26
|
* spurious cross-impl diff. This matches the scope of the in-repo
|
|
27
27
|
* `spine_method_coverage` gate (also over `build_full_spine_rpc_actions`).
|
|
28
28
|
*
|
|
29
|
+
* **WebSocket-only domain methods are listed, with `transport: 'ws'`.** A
|
|
30
|
+
* domain method a backend serves on its WebSocket endpoint alone (the room
|
|
31
|
+
* verbs — the Rust stub's `ws_only` specs) is part of the surface both twins
|
|
32
|
+
* must mount alike, so it stays in the manifest, and its entry says where it
|
|
33
|
+
* is served. A method served on both transports carries no `transport` key,
|
|
34
|
+
* so a mount with no WebSocket-only domain method dumps the same entries it
|
|
35
|
+
* always has.
|
|
36
|
+
*
|
|
29
37
|
* Paired with `action_manifest_parity.ts` for the diff + assertion helpers.
|
|
30
38
|
*
|
|
31
39
|
* @module
|
|
32
40
|
*/
|
|
33
|
-
import { array, boolean, nullable, object, one_of, string } from '@fuzdev/fuz_schema/schema.ts';
|
|
41
|
+
import { array, boolean, literal, nullable, object, one_of, optional, string } from '@fuzdev/fuz_schema/schema.ts';
|
|
34
42
|
import { AuthAxisState } from '../../http/auth_shape.js';
|
|
35
43
|
import { RateLimitKey } from '../../rate_limiter.js';
|
|
36
44
|
import { is_void_schema } from '../../http/schema_helpers.js';
|
|
@@ -64,7 +72,14 @@ export const ActionManifestEntry = object({
|
|
|
64
72
|
/** Permitted credential channels, sorted; `[]` when ungated (any credential). */
|
|
65
73
|
credential_types: array(string),
|
|
66
74
|
/** Per-action rate-limit class, or `null` when the action declares none. */
|
|
67
|
-
rate_limit: nullable(RateLimitKey)
|
|
75
|
+
rate_limit: nullable(RateLimitKey),
|
|
76
|
+
/**
|
|
77
|
+
* `'ws'` for a method served on the WebSocket transport only (the room
|
|
78
|
+
* verbs); absent for one served on both. Absent rather than `'both'` so a
|
|
79
|
+
* mount with no WebSocket-only method dumps exactly the keys it always has,
|
|
80
|
+
* on both spines (the Rust stub marks its `ws_only` specs the same way).
|
|
81
|
+
*/
|
|
82
|
+
transport: optional(literal('ws'))
|
|
68
83
|
});
|
|
69
84
|
/** The full action manifest — every entry, sorted by `method`. */
|
|
70
85
|
export const ActionManifest = object({
|
|
@@ -77,8 +92,12 @@ const sorted_strings = (xs) => [...(xs ?? [])].sort();
|
|
|
77
92
|
* entry. Reads the input shape off `is_void_schema(spec.input)`, pulls the
|
|
78
93
|
* four auth axes off `RouteAuth` (the same shape the Rust `AuthSpec` mirrors),
|
|
79
94
|
* and flattens optional `roles` / `credential_types` to sorted arrays.
|
|
95
|
+
*
|
|
96
|
+
* @param spec - the method's spec
|
|
97
|
+
* @param ws_only - whether the method is served on the WebSocket transport
|
|
98
|
+
* only, which the entry says as `transport: 'ws'`
|
|
80
99
|
*/
|
|
81
|
-
export const action_manifest_entry = (spec) => ({
|
|
100
|
+
export const action_manifest_entry = (spec, ws_only = false) => ({
|
|
82
101
|
method: spec.method,
|
|
83
102
|
input: is_void_schema(spec.input) ? 'void' : 'object',
|
|
84
103
|
side_effects: spec.side_effects,
|
|
@@ -86,7 +105,8 @@ export const action_manifest_entry = (spec) => ({
|
|
|
86
105
|
actor: spec.auth.actor,
|
|
87
106
|
roles: sorted_strings(spec.auth.roles),
|
|
88
107
|
credential_types: sorted_strings(spec.auth.credential_types),
|
|
89
|
-
rate_limit: spec.rate_limit ?? null
|
|
108
|
+
rate_limit: spec.rate_limit ?? null,
|
|
109
|
+
...(ws_only && { transport: 'ws' })
|
|
90
110
|
});
|
|
91
111
|
/** Deterministic byte-lexicographic method order — matches the Rust `str::cmp` the stub sorts by. */
|
|
92
112
|
const compare_method = (a, b) => a.method < b.method ? -1 : a.method > b.method ? 1 : 0;
|
|
@@ -96,7 +116,14 @@ const compare_method = (a, b) => a.method < b.method ? -1 : a.method > b.method
|
|
|
96
116
|
* serialize identically regardless of mount order. The caller owns the scope
|
|
97
117
|
* it passes (the TS spine passes its full mount; the Rust stub filters
|
|
98
118
|
* `PROTOCOL_ACTION_SPECS` first) — see the module doc.
|
|
119
|
+
*
|
|
120
|
+
* @param specs - the methods served on every transport the backend mounts
|
|
121
|
+
* @param ws_only_specs - the methods served on its WebSocket endpoint only
|
|
122
|
+
* (`transport: 'ws'`), e.g. the room verbs
|
|
99
123
|
*/
|
|
100
|
-
export const build_action_manifest = (specs) => ({
|
|
101
|
-
methods:
|
|
124
|
+
export const build_action_manifest = (specs, ws_only_specs = []) => ({
|
|
125
|
+
methods: [
|
|
126
|
+
...specs.map((spec) => action_manifest_entry(spec)),
|
|
127
|
+
...ws_only_specs.map((spec) => action_manifest_entry(spec, true))
|
|
128
|
+
].sort(compare_method)
|
|
102
129
|
});
|
|
@@ -187,6 +187,23 @@ export interface BackendCapabilities {
|
|
|
187
187
|
* mount that endpoint (the TS spine binary + the Rust `testing_spine_stub`).
|
|
188
188
|
*/
|
|
189
189
|
readonly ws_role_gated: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* The room verbs (`create_room_actions` — `room_join`, `room_leave`,
|
|
192
|
+
* `room_send`, `room_state_set`, `room_watch`, `room_unwatch`) are mounted
|
|
193
|
+
* on the backend's ungated `ws_path`, over an **exclusive** room registry on
|
|
194
|
+
* that endpoint's connection registry, with the test room authorizer
|
|
195
|
+
* (`test_room_authorize`, the twin of the Rust stub's `TestRoomAuthorize`:
|
|
196
|
+
* the room id's prefix picks the rule), the per-connection room limiter at
|
|
197
|
+
* `DEFAULT_ROOM_RATE_LIMIT`, and the default registry bounds. Gates
|
|
198
|
+
* `describe_rooms_ws_cross_tests`. A backend declaring it also mounts
|
|
199
|
+
* `_testing_room_evict`, which the eviction case drives, and declares it in
|
|
200
|
+
* `testing_backdoors`, as `describe_spine_cross_suites` requires. Like `cell_gated_create`,
|
|
201
|
+
* the authorizer is a test policy, so `true` only on the reference spine
|
|
202
|
+
* binaries (the TS spine binary + the Rust `testing_spine_stub`) and on a
|
|
203
|
+
* consumer's test binary that mounts the same; a consumer mounting rooms
|
|
204
|
+
* over its own authorizer states `false`.
|
|
205
|
+
*/
|
|
206
|
+
readonly rooms: boolean;
|
|
190
207
|
/**
|
|
191
208
|
* A refused WebSocket upgrade carries its refusal body — the flat
|
|
192
209
|
* `{error, ...}` the same refusal answers over plain HTTP. Not a gate: it
|
|
@@ -213,7 +230,8 @@ export interface BackendCapabilities {
|
|
|
213
230
|
* (`_testing_shorten_credential_expiry`), `origin_conformance`
|
|
214
231
|
* (`_testing_origin_check`), `ws_outbound_overflow`
|
|
215
232
|
* (`_testing_flood_notifications`) — and requires `_testing_put_fact` of a
|
|
216
|
-
* backend declaring `fact_serving
|
|
233
|
+
* backend declaring `fact_serving` and `_testing_room_evict` of one
|
|
234
|
+
* declaring `rooms`.
|
|
217
235
|
*
|
|
218
236
|
* fuz_app's spine presets declare every one; the in-process transport none
|
|
219
237
|
* (the backdoor suites are cross-process only).
|
|
@@ -229,7 +247,7 @@ export interface BackendCapabilities {
|
|
|
229
247
|
* `Pick` keeps the list honest: a name that is not a `BackendCapabilities`
|
|
230
248
|
* flag fails to compile.
|
|
231
249
|
*/
|
|
232
|
-
export type MountFlag = keyof Pick<BackendCapabilities, 'ws' | 'sse' | 'cell_crud' | 'cell_relations' | 'cell_gated_create' | 'fact_serving' | 'fact_serving_admin_hash' | 'ready' | 'peer_request' | 'ws_account_actions' | 'ws_role_gated'>;
|
|
250
|
+
export type MountFlag = keyof Pick<BackendCapabilities, 'ws' | 'sse' | 'cell_crud' | 'cell_relations' | 'cell_gated_create' | 'fact_serving' | 'fact_serving_admin_hash' | 'ready' | 'peer_request' | 'ws_account_actions' | 'ws_role_gated' | 'rooms'>;
|
|
233
251
|
/**
|
|
234
252
|
* A family's default capabilities: every flag but the `MountFlag`s and the
|
|
235
253
|
* `testing_backdoors` list, which each backend config states itself. Spread
|
|
@@ -241,7 +259,7 @@ export type MountFlag = keyof Pick<BackendCapabilities, 'ws' | 'sse' | 'cell_cru
|
|
|
241
259
|
* ws: true, sse: true, ready: true, peer_request: true,
|
|
242
260
|
* cell_crud: false, cell_relations: false, cell_gated_create: false,
|
|
243
261
|
* fact_serving: false, fact_serving_admin_hash: false,
|
|
244
|
-
* ws_account_actions: false, ws_role_gated: false,
|
|
262
|
+
* ws_account_actions: false, ws_role_gated: false, rooms: false,
|
|
245
263
|
* testing_backdoors: ['_testing_reset', '_testing_drain_effects'],
|
|
246
264
|
* }
|
|
247
265
|
* ```
|
|
@@ -257,7 +275,7 @@ export type FamilyDefaultCapabilities = Omit<BackendCapabilities, MountFlag | 't
|
|
|
257
275
|
* transport itself supports server-initiated requests),
|
|
258
276
|
* `ws_handshake_pipelining` (raw bytes on a real socket),
|
|
259
277
|
* `ws_account_actions` (a real socket's reply-then-close ordering),
|
|
260
|
-
* `cell_gated_create`, and `
|
|
278
|
+
* `cell_gated_create`, `ws_role_gated`, and `rooms`. Cross-process consumers declare each flag explicitly
|
|
261
279
|
* per backend.
|
|
262
280
|
*/
|
|
263
281
|
export declare const in_process_capabilities: BackendCapabilities;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAkD9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IAC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L,WAAW,GACX,gBAAgB,GAChB,mBAAmB,GACnB,cAAc,GACd,yBAAyB,GACzB,OAAO,GACP,cAAc,GACd,oBAAoB,GACpB,eAAe,GACf,OAAO,CACT,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,mBAAmB,CAAC,CAAC;AAEnG;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,EAAE,mBA+BpC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,OAAO,EAAE,MAAM,MAAM,EAAE,IAAI,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAG,IAMrF,CAAC"}
|
|
@@ -55,7 +55,7 @@ import { test } from 'vitest';
|
|
|
55
55
|
* transport itself supports server-initiated requests),
|
|
56
56
|
* `ws_handshake_pipelining` (raw bytes on a real socket),
|
|
57
57
|
* `ws_account_actions` (a real socket's reply-then-close ordering),
|
|
58
|
-
* `cell_gated_create`, and `
|
|
58
|
+
* `cell_gated_create`, `ws_role_gated`, and `rooms`. Cross-process consumers declare each flag explicitly
|
|
59
59
|
* per backend.
|
|
60
60
|
*/
|
|
61
61
|
export const in_process_capabilities = Object.freeze({
|
|
@@ -80,6 +80,9 @@ export const in_process_capabilities = Object.freeze({
|
|
|
80
80
|
// Cross-process-only: the gated endpoint is a spine-binary mount, and the
|
|
81
81
|
// case reads a real socket's close.
|
|
82
82
|
ws_role_gated: false,
|
|
83
|
+
// Cross-process-only: the room verbs are a spine-binary WS mount, and the
|
|
84
|
+
// suite reads real sockets' pushes.
|
|
85
|
+
rooms: false,
|
|
83
86
|
// Read only by the front-door table's WS rows, which skip in-process (no
|
|
84
87
|
// socket to upgrade); Hono's own refusals carry their bodies.
|
|
85
88
|
ws_refusal_body: true,
|
|
@@ -17,9 +17,11 @@ import '../assert_dev_env.js';
|
|
|
17
17
|
* - the `_testing_origin_check` probe the origin conformance table drives,
|
|
18
18
|
* - the `_testing_shorten_credential_expiry` seam the credential-deadline
|
|
19
19
|
* suite drives,
|
|
20
|
+
* - the `_testing_room_evict` seam the rooms suite drives, over the room
|
|
21
|
+
* registry the WebSocket-only room verbs run on,
|
|
20
22
|
* - the `_testing_action_manifest` backdoor, appended last (it dumps the live
|
|
21
23
|
* method set for the cross-impl manifest-parity gate, so it must enumerate
|
|
22
|
-
* every method above it).
|
|
24
|
+
* every method above it — and the room verbs, as `transport: 'ws'`).
|
|
23
25
|
*
|
|
24
26
|
* Single-sourcing the mount here lets the binary, the in-process parity
|
|
25
27
|
* setup, and the `spine_method_coverage` reconciliation test all build the
|
|
@@ -29,17 +31,30 @@ import '../assert_dev_env.js';
|
|
|
29
31
|
* The binary's WS endpoint serves the same list: `build_full_spine_mount`
|
|
30
32
|
* builds it once and hands the WS mount the protocol actions plus every RPC
|
|
31
33
|
* action, twinning the Rust `testing_spine_stub`, which compiles one action
|
|
32
|
-
* registry and serves it on both transports
|
|
34
|
+
* registry and serves it on both transports — plus the room verbs and their
|
|
35
|
+
* notifications, which only the WS endpoint serves (the stub's `ws_only`
|
|
36
|
+
* specs, which its RPC dispatcher refuses). The reconciliation test
|
|
33
37
|
* enumerates `build_full_spine_rpc_actions` with stub deps and asserts the live method set equals the tagged coverage
|
|
34
38
|
* manifest; see `src/test/cross_backend/spine_method_coverage.ts`.
|
|
35
39
|
*
|
|
36
40
|
* @module
|
|
37
41
|
*/
|
|
38
42
|
import type { Action, RpcAction } from '../../actions/action_types.js';
|
|
43
|
+
import { ConnectionRegistry } from '../../actions/connection_registry.js';
|
|
44
|
+
import { RoomRegistry } from '../../actions/room_registry.js';
|
|
39
45
|
import type { AppDeps } from '../../auth/deps.js';
|
|
40
46
|
import type { DaemonTokenState } from '../../auth/daemon_token.js';
|
|
41
47
|
import type { NotificationSender } from '../../auth/role_grant_offer_notifications.js';
|
|
42
48
|
import type { RpcEndpointSpec } from '../../http/surface.js';
|
|
49
|
+
/**
|
|
50
|
+
* The spine binary's room registry over `connections`: exclusive — one seat
|
|
51
|
+
* per actor, the newest admitted winning, with the rejoin guard — at the
|
|
52
|
+
* default bounds. Twin of the Rust stub's `stub_room_registry`.
|
|
53
|
+
*
|
|
54
|
+
* @param connections - the connection registry the binary's WS endpoints share
|
|
55
|
+
* @returns the registry its room verbs and `_testing_room_evict` run on
|
|
56
|
+
*/
|
|
57
|
+
export declare const create_spine_room_registry: (connections: ConnectionRegistry) => RoomRegistry;
|
|
43
58
|
/** Options for `build_full_spine_rpc_actions` / `build_full_spine_mount`. */
|
|
44
59
|
export interface FullSpineMountOptions {
|
|
45
60
|
/**
|
|
@@ -56,6 +71,15 @@ export interface FullSpineMountOptions {
|
|
|
56
71
|
* (the registry is the fan-out target). Omitted for enumeration.
|
|
57
72
|
*/
|
|
58
73
|
readonly notification_sender?: NotificationSender | null;
|
|
74
|
+
/**
|
|
75
|
+
* The room registry the room verbs and `_testing_room_evict` run on — built
|
|
76
|
+
* by `create_spine_room_registry` over the SAME `ConnectionRegistry` the WS
|
|
77
|
+
* endpoints register connections against (a room registry over another
|
|
78
|
+
* names no socket, and refuses every join). Omitted for enumeration: a
|
|
79
|
+
* registry over a fresh connection registry, which no handler built here
|
|
80
|
+
* ever reaches.
|
|
81
|
+
*/
|
|
82
|
+
readonly room_registry?: RoomRegistry;
|
|
59
83
|
}
|
|
60
84
|
/**
|
|
61
85
|
* Build the complete live RPC action list the spine test binary mounts on
|
|
@@ -68,7 +92,7 @@ export interface FullSpineMountOptions {
|
|
|
68
92
|
* runtime-varying inputs are the daemon-token state + notification sender.
|
|
69
93
|
*
|
|
70
94
|
* @param deps - the backend `AppDeps` (stub deps suffice for method enumeration)
|
|
71
|
-
* @param options - daemon-token state + optional WS notification sender
|
|
95
|
+
* @param options - daemon-token state + optional WS notification sender and room registry
|
|
72
96
|
* @returns every `RpcAction` the binary exposes, in mount order
|
|
73
97
|
*/
|
|
74
98
|
export declare const build_full_spine_rpc_actions: (deps: AppDeps, options: FullSpineMountOptions) => Array<RpcAction>;
|
|
@@ -78,8 +102,9 @@ export interface FullSpineMount {
|
|
|
78
102
|
readonly rpc_actions: Array<RpcAction>;
|
|
79
103
|
/**
|
|
80
104
|
* The WS endpoint's actions: `protocol_actions` first, then every RPC
|
|
81
|
-
* action not already among them (`peer/ping` is on both lists)
|
|
82
|
-
* handler instances as
|
|
105
|
+
* action not already among them (`peer/ping` is on both lists), then the
|
|
106
|
+
* WS-only room verbs and their notifications. The same handler instances as
|
|
107
|
+
* `rpc_actions`.
|
|
83
108
|
*/
|
|
84
109
|
readonly ws_actions: Array<Action>;
|
|
85
110
|
}
|
|
@@ -96,7 +121,7 @@ export interface FullSpineMount {
|
|
|
96
121
|
* (never dispatched) on Rust.
|
|
97
122
|
*
|
|
98
123
|
* @param deps - the backend `AppDeps`
|
|
99
|
-
* @param options - daemon-token state + optional WS notification sender
|
|
124
|
+
* @param options - daemon-token state + optional WS notification sender and room registry
|
|
100
125
|
* @returns the RPC and WS action lists, built once and sharing handler instances
|
|
101
126
|
*/
|
|
102
127
|
export declare const build_full_spine_mount: (deps: AppDeps, options: FullSpineMountOptions) => FullSpineMount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full_spine_mount.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/full_spine_mount.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"full_spine_mount.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/full_spine_mount.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAS1E,OAAO,EAAE,YAAY,EAAE,MA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