@fuzdev/fuz_app 0.97.0 → 0.98.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/actions/CLAUDE.md +57 -23
  2. package/dist/actions/action_bridge.d.ts.map +1 -1
  3. package/dist/actions/action_codegen.d.ts +17 -1
  4. package/dist/actions/action_codegen.d.ts.map +1 -1
  5. package/dist/actions/action_codegen.js +38 -14
  6. package/dist/actions/{action_peer.d.ts → action_dispatcher.d.ts} +12 -12
  7. package/dist/actions/action_dispatcher.d.ts.map +1 -0
  8. package/dist/actions/{action_peer.js → action_dispatcher.js} +2 -2
  9. package/dist/actions/action_event.d.ts.map +1 -1
  10. package/dist/actions/action_rpc.d.ts +9 -0
  11. package/dist/actions/action_rpc.d.ts.map +1 -1
  12. package/dist/actions/broadcast_api.d.ts +2 -2
  13. package/dist/actions/broadcast_api.d.ts.map +1 -1
  14. package/dist/actions/compile_action_registry.d.ts.map +1 -1
  15. package/dist/actions/frontend_rpc_client.d.ts +3 -3
  16. package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
  17. package/dist/actions/frontend_rpc_client.js +3 -3
  18. package/dist/actions/peer_ping.d.ts +147 -0
  19. package/dist/actions/peer_ping.d.ts.map +1 -0
  20. package/dist/actions/peer_ping.js +189 -0
  21. package/dist/actions/peer_request.d.ts +158 -0
  22. package/dist/actions/peer_request.d.ts.map +1 -0
  23. package/dist/actions/peer_request.js +167 -0
  24. package/dist/actions/perform_action.d.ts +8 -0
  25. package/dist/actions/perform_action.d.ts.map +1 -1
  26. package/dist/actions/perform_action.js +2 -1
  27. package/dist/actions/protocol.d.ts +3 -3
  28. package/dist/actions/protocol.d.ts.map +1 -1
  29. package/dist/actions/protocol.js +9 -4
  30. package/dist/actions/register_action_ws.d.ts.map +1 -1
  31. package/dist/actions/register_action_ws.js +28 -1
  32. package/dist/actions/rpc_client.d.ts +4 -4
  33. package/dist/actions/rpc_client.d.ts.map +1 -1
  34. package/dist/actions/socket.svelte.d.ts.map +1 -1
  35. package/dist/actions/transports.d.ts +1 -1
  36. package/dist/actions/transports_http.d.ts.map +1 -1
  37. package/dist/actions/transports_ws.d.ts +12 -5
  38. package/dist/actions/transports_ws.d.ts.map +1 -1
  39. package/dist/actions/transports_ws.js +36 -6
  40. package/dist/actions/transports_ws_backend.d.ts +34 -1
  41. package/dist/actions/transports_ws_backend.d.ts.map +1 -1
  42. package/dist/actions/transports_ws_backend.js +62 -5
  43. package/dist/auth/CLAUDE.md +12 -12
  44. package/dist/auth/actor_lookup_action_specs.d.ts.map +1 -1
  45. package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
  46. package/dist/auth/admin_action_specs.d.ts.map +1 -1
  47. package/dist/auth/admin_actions.d.ts.map +1 -1
  48. package/dist/auth/audit_log_queries.d.ts.map +1 -1
  49. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  50. package/dist/auth/bootstrap_routes.d.ts.map +1 -1
  51. package/dist/auth/role_grant_queries.d.ts +31 -12
  52. package/dist/auth/role_grant_queries.d.ts.map +1 -1
  53. package/dist/auth/role_grant_queries.js +36 -12
  54. package/dist/auth/role_schema.d.ts.map +1 -1
  55. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  56. package/dist/db/create_db.d.ts.map +1 -1
  57. package/dist/db/fact_store.d.ts.map +1 -1
  58. package/dist/db/status.d.ts.map +1 -1
  59. package/dist/http/auth_shape.d.ts.map +1 -1
  60. package/dist/http/db_routes.d.ts.map +1 -1
  61. package/dist/http/jsonrpc_helpers.d.ts +1 -1
  62. package/dist/http/jsonrpc_helpers.js +1 -1
  63. package/dist/rate_limiter.d.ts.map +1 -1
  64. package/dist/rate_limiter.js +11 -0
  65. package/dist/server/app_backend.d.ts.map +1 -1
  66. package/dist/server/app_server.d.ts.map +1 -1
  67. package/dist/server/serve_fact_route.d.ts.map +1 -1
  68. package/dist/server/serve_fact_route.js +7 -4
  69. package/dist/testing/CLAUDE.md +18 -15
  70. package/dist/testing/admin_integration.d.ts.map +1 -1
  71. package/dist/testing/adversarial_input.d.ts.map +1 -1
  72. package/dist/testing/adversarial_input.js +3 -1
  73. package/dist/testing/attack_surface.d.ts.map +1 -1
  74. package/dist/testing/audit_completeness.d.ts.map +1 -1
  75. package/dist/testing/cross_backend/action_manifest.d.ts +7 -7
  76. package/dist/testing/cross_backend/action_manifest.js +7 -7
  77. package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
  78. package/dist/testing/cross_backend/capabilities.d.ts +15 -12
  79. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  80. package/dist/testing/cross_backend/capabilities.js +4 -4
  81. package/dist/testing/cross_backend/cell_cross_helpers.d.ts.map +1 -1
  82. package/dist/testing/cross_backend/conformance_case.d.ts +2 -0
  83. package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
  84. package/dist/testing/cross_backend/conformance_case.js +13 -0
  85. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  86. package/dist/testing/cross_backend/conformance_table.js +32 -3
  87. package/dist/testing/cross_backend/cookie_attributes.d.ts +20 -0
  88. package/dist/testing/cross_backend/cookie_attributes.d.ts.map +1 -0
  89. package/dist/testing/cross_backend/cookie_attributes.js +158 -0
  90. package/dist/testing/cross_backend/credential_header_robustness.d.ts +12 -0
  91. package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -0
  92. package/dist/testing/cross_backend/credential_header_robustness.js +179 -0
  93. package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
  94. package/dist/testing/cross_backend/default_backend_configs.js +5 -3
  95. package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
  96. package/dist/testing/cross_backend/full_spine_mount.js +7 -0
  97. package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
  98. package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
  99. package/dist/testing/cross_backend/method_coverage.d.ts +3 -7
  100. package/dist/testing/cross_backend/method_coverage.d.ts.map +1 -1
  101. package/dist/testing/cross_backend/method_coverage.js +1 -2
  102. package/dist/testing/cross_backend/peer_ping_ws.js +1 -1
  103. package/dist/testing/cross_backend/role_grant_offer_enumeration.d.ts +26 -0
  104. package/dist/testing/cross_backend/role_grant_offer_enumeration.d.ts.map +1 -0
  105. package/dist/testing/cross_backend/role_grant_offer_enumeration.js +108 -0
  106. package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
  107. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  108. package/dist/testing/cross_backend/setup.js +2 -4
  109. package/dist/testing/cross_backend/testing_reset_actions.d.ts +0 -13
  110. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  111. package/dist/testing/cross_backend/testing_reset_actions.js +12 -4
  112. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
  113. package/dist/testing/cross_backend/ts_spine_backend_config.js +9 -3
  114. package/dist/testing/data_exposure.d.ts.map +1 -1
  115. package/dist/testing/db.d.ts.map +1 -1
  116. package/dist/testing/db_entities.d.ts +15 -0
  117. package/dist/testing/db_entities.d.ts.map +1 -1
  118. package/dist/testing/db_entities.js +16 -1
  119. package/dist/testing/error_coverage.d.ts.map +1 -1
  120. package/dist/testing/error_coverage.js +1 -2
  121. package/dist/testing/integration_helpers.d.ts.map +1 -1
  122. package/dist/testing/rate_limiting.d.ts.map +1 -1
  123. package/dist/testing/round_trip.d.ts.map +1 -1
  124. package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
  125. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  126. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  127. package/dist/testing/schema_generators.d.ts.map +1 -1
  128. package/dist/testing/schema_generators.js +3 -1
  129. package/dist/testing/schema_parity.d.ts.map +1 -1
  130. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  131. package/dist/testing/surface_invariants.d.ts.map +1 -1
  132. package/dist/testing/transports/bootstrap.d.ts.map +1 -1
  133. package/dist/testing/transports/ws_client.d.ts +1 -1
  134. package/dist/testing/transports/ws_transport.d.ts +1 -1
  135. package/dist/testing/ws_round_trip.d.ts +1 -1
  136. package/dist/testing/ws_round_trip.d.ts.map +1 -1
  137. package/dist/testing/ws_round_trip.js +3 -3
  138. package/dist/ui/CLAUDE.md +6 -3
  139. package/dist/ui/auth_state.svelte.d.ts.map +1 -1
  140. package/dist/ui/form_state.svelte.d.ts.map +1 -1
  141. package/dist/ui/role_grant_offers_state.svelte.d.ts +1 -1
  142. package/dist/ui/role_grant_offers_state.svelte.js +1 -1
  143. package/dist/ui/ui_format.d.ts.map +1 -1
  144. package/package.json +2 -2
  145. package/dist/actions/action_peer.d.ts.map +0 -1
@@ -45,6 +45,7 @@ import type { Db } from '../db/db.js';
45
45
  import { type JsonrpcRequestId, type JsonrpcErrorObject } from '../http/jsonrpc.js';
46
46
  import type { RateLimiter } from '../rate_limiter.js';
47
47
  import type { RpcAction } from './action_rpc.js';
48
+ import type { RequestClient } from './peer_request.js';
48
49
  /**
49
50
  * Per-call inputs to `perform_action`. Each transport assembles this from
50
51
  * its wire envelope + connection identity.
@@ -68,6 +69,13 @@ export interface PerformActionInput {
68
69
  notify: (method: string, params: unknown) => void;
69
70
  /** Stable per-socket id on WS; `undefined` on HTTP. */
70
71
  connection_id?: Uuid;
72
+ /**
73
+ * Initiate a server→client request on the originating WS socket and await
74
+ * the typed reply (ActionPeer). Present only on WebSocket dispatch;
75
+ * `undefined` on HTTP RPC (no return socket). Handlers must handle its
76
+ * absence — e.g. `peer/ping` surfaces `peer_no_transport`.
77
+ */
78
+ request_client?: RequestClient;
71
79
  /**
72
80
  * Test-harness escape hatch. When set, the live authorization phase is
73
81
  * skipped and `request_context` is used directly for post-authorization
@@ -1 +1 @@
1
- {"version":3,"file":"perform_action.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/perform_action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAGH,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;OAGG;IACH,mBAAmB,EAAE,KAAK,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,sBAAsB,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3C,uEAAuE;IACvE,2BAA2B,EAAE,WAAW,GAAG,IAAI,CAAC;CAChD;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC5B;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAC,GAC7B;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,kBAAkB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAAC;AAE9D;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAC1B,OAAO,kBAAkB,EACzB,MAAM,iBAAiB,KACrB,OAAO,CAAC,mBAAmB,CAsK7B,CAAC;AAoFF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAC7C,IAAI,gBAAgB,EACpB,QAAQ,mBAAmB,KACzB;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,gBAAgB,CAAA;CAAC,GAAG,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAC,GAAG;IAAC,KAAK,EAAE,kBAAkB,CAAA;CAAC,CAK5F,CAAC"}
@@ -57,7 +57,7 @@ import { is_public_auth } from '../http/auth_shape.js';
57
57
  * still fires when the harness omits `account_id`.
58
58
  */
59
59
  export const perform_action = async (input, deps) => {
60
- const { action, raw_params, request_id: id, account_id, credential_type, client_ip, signal, notify, connection_id, preset, } = input;
60
+ const { action, raw_params, request_id: id, account_id, credential_type, client_ip, signal, notify, connection_id, request_client, preset, } = input;
61
61
  const { db, pending_effects, post_commit_effects, log, action_ip_rate_limiter, action_account_rate_limiter, } = deps;
62
62
  const { spec, handler } = action;
63
63
  const action_auth = spec.auth;
@@ -139,6 +139,7 @@ export const perform_action = async (input, deps) => {
139
139
  auth: request_context,
140
140
  request_id: id,
141
141
  connection_id,
142
+ request_client,
142
143
  db: effective_db,
143
144
  pending_effects,
144
145
  post_commit_effects,
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Canonical bundles of fuz_app's protocol actions — `heartbeat` and
3
- * `cancel`. Spread these into consumer registrations on both sides of the
4
- * wire so the registries stay symmetric without per-consumer plumbing.
2
+ * Canonical bundles of fuz_app's protocol actions — `heartbeat`, `cancel`,
3
+ * and `peer/ping`. Spread these into consumer registrations on both sides of
4
+ * the wire so the registries stay symmetric without per-consumer plumbing.
5
5
  *
6
6
  * Protocol actions are wire-protocol concerns (liveness, abort) shipped by
7
7
  * fuz_app, not consumer domain logic. The split is intentional: the server
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAI9C;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAqC,CAAC;AAEzF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,eAAe,CAEhE,CAAC"}
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAK9C;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAIlD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,eAAe,CAEhE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Canonical bundles of fuz_app's protocol actions — `heartbeat` and
3
- * `cancel`. Spread these into consumer registrations on both sides of the
4
- * wire so the registries stay symmetric without per-consumer plumbing.
2
+ * Canonical bundles of fuz_app's protocol actions — `heartbeat`, `cancel`,
3
+ * and `peer/ping`. Spread these into consumer registrations on both sides of
4
+ * the wire so the registries stay symmetric without per-consumer plumbing.
5
5
  *
6
6
  * Protocol actions are wire-protocol concerns (liveness, abort) shipped by
7
7
  * fuz_app, not consumer domain logic. The split is intentional: the server
@@ -20,6 +20,7 @@
20
20
  */
21
21
  import { cancel_action } from './cancel.js';
22
22
  import { heartbeat_action } from './heartbeat.js';
23
+ import { peer_ping_action } from './peer_ping.js';
23
24
  /**
24
25
  * Canonical protocol `{spec, handler}` tuples for the server's
25
26
  * `register_action_ws` `actions` array. Spread before consumer-owned actions
@@ -29,7 +30,11 @@ import { heartbeat_action } from './heartbeat.js';
29
30
  * register_action_ws({actions: [...protocol_actions, ...consumer_actions], ...})
30
31
  * ```
31
32
  */
32
- export const protocol_actions = [heartbeat_action, cancel_action];
33
+ export const protocol_actions = [
34
+ heartbeat_action,
35
+ cancel_action,
36
+ peer_ping_action,
37
+ ];
33
38
  /**
34
39
  * Canonical protocol specs for `ActionRegistry` construction on the
35
40
  * frontend. Spread before consumer-owned specs so dispatcher-owned methods
@@ -1 +1 @@
1
- {"version":3,"file":"register_action_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/register_action_ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC/B,OAAO,KAAK,EAAC,gBAAgB,EAAE,SAAS,EAAC,MAAM,SAAS,CAAC;AAEzD,OAAO,EAAS,KAAK,MAAM,I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ACH,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B;;;;;;;;;OASG;IACH,EAAE,EAAE,EAAE,CAAC;IACP;;;;OAIG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,sBAAsB,CAAC;IAC7C,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qDAAqD;IACrD,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5C;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACjD;AAED,sCAAsC;AACtC,MAAM,WAAW,sBAAsB;IACtC,yEAAyE;IACzE,SAAS,EAAE,yBAAyB,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,uBAAuB,KAAG,sBA4VrE,CAAC"}
1
+ {"version":3,"file":"register_action_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/register_action_ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC/B,OAAO,KAAK,EAAC,gBAAgB,EAAE,SAAS,EAAC,MAAM,SAAS,CAAC;AAEzD,OAAO,EAAS,KAAK,MAAM,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC1E,OA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AC/B;;;;;;;;;OASG;IACH,EAAE,EAAE,EAAE,CAAC;IACP;;;;OAIG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,sBAAsB,CAAC;IAC7C,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qDAAqD;IACrD,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5C;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACjD;AAED,sCAAsC;AACtC,MAAM,WAAW,sBAAsB;IACtC,yEAAyE;IACzE,SAAS,EAAE,yBAAyB,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,uBAAuB,KAAG,sBA6XrE,CAAC"}
@@ -33,13 +33,14 @@ import { hash_session_token } from '../auth/session_queries.js';
33
33
  import { get_client_ip } from '../http/client_ip.js';
34
34
  import { flush_pending_effects, flush_post_commit_effects } from '../http/pending_effects.js';
35
35
  import { jsonrpc_error_messages } from '../http/jsonrpc_errors.js';
36
- import { create_jsonrpc_error_response, create_jsonrpc_notification, to_jsonrpc_message_id, to_jsonrpc_params, is_jsonrpc_request, } from '../http/jsonrpc_helpers.js';
36
+ import { create_jsonrpc_error_response, create_jsonrpc_notification, to_jsonrpc_message_id, to_jsonrpc_params, is_jsonrpc_request, is_jsonrpc_response, is_jsonrpc_error_response, } from '../http/jsonrpc_helpers.js';
37
37
  import { CREDENTIAL_TYPE_KEY, AUTH_API_TOKEN_ID_KEY, TEST_CONTEXT_PRESET_KEY, } from '../hono_context.js';
38
38
  import {} from './action_types.js';
39
39
  import { compile_action_registry } from './compile_action_registry.js';
40
40
  import { cancel_action_spec, CancelNotificationParams } from './cancel.js';
41
41
  import { WS_CLOSE_SERVER_HEARTBEAT_TIMEOUT } from './transports.js';
42
42
  import { BackendWebsocketTransport } from './transports_ws_backend.js';
43
+ import { audit_unmatched_peer_response } from './peer_request.js';
43
44
  import { perform_action, perform_action_result_to_envelope } from './perform_action.js';
44
45
  /** Default inactivity window before the server closes a silent socket. */
45
46
  export const DEFAULT_SERVER_HEARTBEAT_TIMEOUT = 60_000;
@@ -220,6 +221,21 @@ export const register_action_ws = (options) => {
220
221
  ws.send(JSON.stringify(create_jsonrpc_error_response(null, jsonrpc_error_messages.invalid_request('batch JSON-RPC requests are not supported on WebSocket'))));
221
222
  return;
222
223
  }
224
+ // Inbound responses to server-initiated requests (`peer/ping`,
225
+ // etc.) — route to the pending-request registry scoped to THIS
226
+ // socket. A response carries `result`/`error` + `id` and no
227
+ // `method`, so it precedes the request/notification split below.
228
+ // An unmatched id (unsolicited, cross-connection, or already
229
+ // settled) resolves nothing and is dropped, so the read loop
230
+ // survives a junk frame.
231
+ if (is_jsonrpc_response(json) || is_jsonrpc_error_response(json)) {
232
+ if (captured_connection_id !== undefined) {
233
+ const matched = transport.resolve_peer_response(captured_connection_id, json);
234
+ if (!matched)
235
+ audit_unmatched_peer_response(log, captured_connection_id, json.id);
236
+ }
237
+ return;
238
+ }
223
239
  // Notifications (method + no id) — `cancel` is intercepted
224
240
  // for request-scoped cancellation; other notifications are
225
241
  // silenced per JSON-RPC spec (consumer notification handlers
@@ -289,6 +305,16 @@ export const register_action_ws = (options) => {
289
305
  const pending_effects = [];
290
306
  const post_commit_effects = [];
291
307
  const notify = notify_socket(ws);
308
+ // Server→client request seam (ActionPeer) — closes over this
309
+ // socket's connection_id so a handler can initiate a request to
310
+ // the originating client and await the reply. `const` capture so
311
+ // the narrowed (non-undefined) type holds inside the closure;
312
+ // `undefined` only in the degenerate case where a message
313
+ // dispatches before onOpen assigned the id.
314
+ const conn_id = captured_connection_id;
315
+ const request_client = conn_id === undefined
316
+ ? undefined
317
+ : (request_method, request_params, request_options) => transport.request_connection(conn_id, request_method, request_params, request_options);
292
318
  const signal = AbortSignal.any([
293
319
  socket_abort_controller.signal,
294
320
  request_controller.signal,
@@ -304,6 +330,7 @@ export const register_action_ws = (options) => {
304
330
  signal,
305
331
  notify,
306
332
  connection_id: captured_connection_id,
333
+ request_client,
307
334
  preset: upgrade_preset,
308
335
  }, {
309
336
  db,
@@ -13,7 +13,7 @@
13
13
  import type { Result } from '@fuzdev/fuz_util/result.ts';
14
14
  import type { ActionEventEnvironment } from './action_event_types.js';
15
15
  import { type ActionEvent } from './action_event.js';
16
- import type { ActionPeer, ActionPeerSendOptions } from './action_peer.js';
16
+ import type { ActionDispatcher, ActionDispatcherSendOptions } from './action_dispatcher.js';
17
17
  import type { TransportName } from './transports.js';
18
18
  import type { JsonrpcErrorObject } from '../http/jsonrpc.js';
19
19
  /**
@@ -27,7 +27,7 @@ import type { JsonrpcErrorObject } from '../http/jsonrpc.js';
27
27
  export type TransportForMethod = (method: string) => TransportName | undefined;
28
28
  /** Options for `create_rpc_client`. */
29
29
  export interface CreateRpcClientOptions<TApi extends object = object> {
30
- peer: ActionPeer;
30
+ peer: ActionDispatcher;
31
31
  environment: ActionEventEnvironment;
32
32
  /**
33
33
  * Optional callback fired once per dispatched action with the live
@@ -73,11 +73,11 @@ export interface CreateRpcClientOptions<TApi extends object = object> {
73
73
  export declare const create_rpc_client: <TApi extends object>(options: CreateRpcClientOptions<TApi>) => TApi;
74
74
  /**
75
75
  * Per-call options accepted by every typed Proxy method. Same shape as
76
- * `ActionPeerSendOptions` — the client threads these through unchanged
76
+ * `ActionDispatcherSendOptions` — the client threads these through unchanged
77
77
  * to the underlying peer. `transport_name` overrides the per-method
78
78
  * `transport_for_method` selector for this call.
79
79
  */
80
- export interface RpcClientCallOptions extends ActionPeerSendOptions {
80
+ export interface RpcClientCallOptions extends ActionDispatcherSendOptions {
81
81
  }
82
82
  /**
83
83
  * Maps a typed `ActionsApi` to a throwing variant.
@@ -1 +1 @@
1
- {"version":3,"file":"rpc_client.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/rpc_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAQvD,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAsB,KAAK,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAMxE,OAAO,KAAK,EAAC,UAAU,EAAE,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;AAM/E,uCAAuC;AACvC,MAAM,WAAW,sBAAsB,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IACnE,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,sBAAsB,CAAC;IACpC;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC;IACpE;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,kBAAkB,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,iBAAiB,GAAI,IAAI,SAAS,MAAM,EACpD,SAAS,sBAAsB,CAAC,IAAI,CAA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AU,CAAC,IAAI,GAAE,MAA2B,GAAG,IAAI;IASnD,sGAAsG;IACtG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;IAIxB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAc3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,OAAO,CAAC,CAAC,GAAG,OAAO,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,OAAY,EACpB,OAAO,GAAE;QAAC,MAAM,CAAC,EAAE,WAAW,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,EAAE,CAAC,EAAE,gBAAgB,CAAA;KAAM,GAC1E,OAAO,CAAC,CAAC,CAAC;IA2Eb,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,IAAI;IAK9D,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,IAAI;CA2U1D;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,GACzC,QAAQ,YAAY,EACpB,SAAS,OAAO,KACd,WAaF,CAAC"}
@@ -19,7 +19,7 @@ export type TransportName = z.infer<typeof TransportName>;
19
19
  /**
20
20
  * Per-call options accepted by every transport's `send`. Optional and
21
21
  * extensible — adding a field is non-breaking. Source of truth for the
22
- * shared option shape; `ActionPeerSendOptions` and `RpcClientCallOptions`
22
+ * shared option shape; `ActionDispatcherSendOptions` and `RpcClientCallOptions`
23
23
  * extend it.
24
24
  */
25
25
  export interface TransportSendOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"transports_http.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,OAAO,KAAK,EAGX,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,SAAS,EAAE,oBAAoB,EAAC,MAAM,iBAAiB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GAAG,IAAI,CAAC;IA2EvC,QAAQ,IAAI,OAAO;CAGnB"}
@@ -5,9 +5,14 @@
5
5
  * and `AbortSignal`-driven cancel to the underlying connection (the
6
6
  * canonical implementation is `FrontendWebsocketClient`). The transport's
7
7
  * own job is the `Transport` contract: route inbound server-pushed
8
- * messages into `peer.receive` and translate the connection's
9
- * `Promise<R>`/`ThrownJsonrpcError` shape into `JsonrpcResponseOrError`
10
- * envelopes. No parallel pending-request map.
8
+ * messages into `peer.receive`, send the resulting response back over the
9
+ * socket (the server→client ActionPeer receive loop), and translate the
10
+ * connection's `Promise<R>`/`ThrownJsonrpcError` shape into
11
+ * `JsonrpcResponseOrError` envelopes. No parallel pending-request map.
12
+ *
13
+ * Inbound `peer/ping` requests are answered directly via the built-in
14
+ * `peer_ping_responder` — a protocol-liveness concern that works with zero
15
+ * consumer wiring, the same way the server runs the `heartbeat` echo.
11
16
  *
12
17
  * @module
13
18
  */
@@ -44,8 +49,10 @@ export interface WebsocketRpcConnection extends WebsocketConnection {
44
49
  /**
45
50
  * Thin adapter over `WebsocketRpcConnection` (canonical implementation:
46
51
  * `FrontendWebsocketClient`). Routes inbound server-pushed requests and
47
- * notifications into the supplied `receive` callback; responses are owned
48
- * by the connection's own `request()` pending map and are ignored here.
52
+ * notifications into the supplied `receive` callback and sends the request
53
+ * response back over the socket; an inbound `peer/ping` is answered by the
54
+ * built-in responder before `receive`. Responses to requests *we* sent are
55
+ * owned by the connection's own `request()` pending map and are ignored here.
49
56
  */
50
57
  export declare class FrontendWebsocketTransport implements Transport {
51
58
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"transports_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAaH,OAAO,KAAK,EAGX,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK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BAAsB,CAAC;IAC5B,IAAI,CACT,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA0DvC,QAAQ,IAAI,OAAO;IAInB;;;;;;OAMG;IACH,OAAO,IAAI,IAAI;CAUf"}
@@ -5,20 +5,28 @@
5
5
  * and `AbortSignal`-driven cancel to the underlying connection (the
6
6
  * canonical implementation is `FrontendWebsocketClient`). The transport's
7
7
  * own job is the `Transport` contract: route inbound server-pushed
8
- * messages into `peer.receive` and translate the connection's
9
- * `Promise<R>`/`ThrownJsonrpcError` shape into `JsonrpcResponseOrError`
10
- * envelopes. No parallel pending-request map.
8
+ * messages into `peer.receive`, send the resulting response back over the
9
+ * socket (the server→client ActionPeer receive loop), and translate the
10
+ * connection's `Promise<R>`/`ThrownJsonrpcError` shape into
11
+ * `JsonrpcResponseOrError` envelopes. No parallel pending-request map.
12
+ *
13
+ * Inbound `peer/ping` requests are answered directly via the built-in
14
+ * `peer_ping_responder` — a protocol-liveness concern that works with zero
15
+ * consumer wiring, the same way the server runs the `heartbeat` echo.
11
16
  *
12
17
  * @module
13
18
  */
14
19
  import { to_error_message } from '@fuzdev/fuz_util/error.ts';
15
20
  import { ThrownJsonrpcError, jsonrpc_error_messages } from '../http/jsonrpc_errors.js';
16
21
  import { is_jsonrpc_notification, is_jsonrpc_request, to_jsonrpc_message_id, to_jsonrpc_result, create_jsonrpc_response, create_jsonrpc_error_response, } from '../http/jsonrpc_helpers.js';
22
+ import { PEER_PING_METHOD, peer_ping_responder } from './peer_ping.js';
17
23
  /**
18
24
  * Thin adapter over `WebsocketRpcConnection` (canonical implementation:
19
25
  * `FrontendWebsocketClient`). Routes inbound server-pushed requests and
20
- * notifications into the supplied `receive` callback; responses are owned
21
- * by the connection's own `request()` pending map and are ignored here.
26
+ * notifications into the supplied `receive` callback and sends the request
27
+ * response back over the socket; an inbound `peer/ping` is answered by the
28
+ * built-in responder before `receive`. Responses to requests *we* sent are
29
+ * owned by the connection's own `request()` pending map and are ignored here.
22
30
  */
23
31
  export class FrontendWebsocketTransport {
24
32
  transport_name = 'frontend_websocket_rpc';
@@ -35,7 +43,29 @@ export class FrontendWebsocketTransport {
35
43
  this.#remove_message_handler = connection.add_message_handler(async (event) => {
36
44
  try {
37
45
  const data = JSON.parse(event.data);
38
- if (is_jsonrpc_request(data) || is_jsonrpc_notification(data)) {
46
+ if (is_jsonrpc_request(data)) {
47
+ // Built-in protocol responder — answer a server-initiated
48
+ // `peer/ping` liveness probe over the same socket with zero
49
+ // consumer wiring (the production twin of the cross-process
50
+ // test transport's echo responder). Without this the server's
51
+ // server→client `peer/ping` round-trip would always time out
52
+ // against a real frontend.
53
+ if (data.method === PEER_PING_METHOD) {
54
+ this.#connection.send(create_jsonrpc_response(data.id, peer_ping_responder(data.params)));
55
+ return;
56
+ }
57
+ // Any other server-initiated request: dispatch through the peer
58
+ // and send its response back over the socket — completing the
59
+ // server→client receive loop. (Previously the response was
60
+ // computed and dropped, so a consumer-handled server request
61
+ // never got a reply.)
62
+ const response = await this.#receive(data);
63
+ if (response !== null && typeof response === 'object') {
64
+ this.#connection.send(response);
65
+ }
66
+ return;
67
+ }
68
+ if (is_jsonrpc_notification(data)) {
39
69
  await this.#receive(data);
40
70
  }
41
71
  // Responses are owned by `connection.request()` — ignore here.
@@ -6,8 +6,9 @@
6
6
  */
7
7
  import type { WSContext } from 'hono/ws';
8
8
  import { type Uuid } from '@fuzdev/fuz_util/id.ts';
9
- import type { JsonrpcMessageFromServerToClient, JsonrpcNotification, JsonrpcRequest, JsonrpcResponseOrError, JsonrpcErrorResponse } from '../http/jsonrpc.js';
9
+ import type { JsonrpcMessageFromServerToClient, JsonrpcNotification, JsonrpcRequest, JsonrpcRequestParams, JsonrpcResponse, JsonrpcResponseOrError, JsonrpcErrorResponse } from '../http/jsonrpc.js';
10
10
  import { type Transport, type TransportSendOptions } from './transports.js';
11
+ import { type PeerRequestOptions, type PeerRequestOutcome } from './peer_request.js';
11
12
  /**
12
13
  * Auth identity attached to a single WebSocket connection.
13
14
  *
@@ -119,6 +120,38 @@ export declare class BackendWebsocketTransport implements FilterableBroadcastTra
119
120
  * @returns the number of sockets the message was sent to
120
121
  */
121
122
  send_to_account(account_id: Uuid, message: JsonrpcMessageFromServerToClient): number;
123
+ /**
124
+ * Initiate a JSON-RPC request to a single connected client and await its
125
+ * reply — the server→client request/response direction (ActionPeer).
126
+ *
127
+ * Sends `{jsonrpc, method, params, id}` to exactly the `connection_id`
128
+ * socket (never a broadcast) and registers a pending entry scoped to that
129
+ * connection. Resolves when the client's matching reply arrives (routed in
130
+ * via `resolve_peer_response`), the deadline elapses (`timeout`), the
131
+ * per-connection cap is hit (`too_many_in_flight`), or the socket closes
132
+ * (`connection_gone`). Never throws — every failure is a `PeerRequestError`.
133
+ *
134
+ * Delegates correlation to `#pending` (id allocation, deadline, cap, drain);
135
+ * this method owns only the socket lookup + the send. Server-issued ids are
136
+ * `s`-prefixed so a malicious client echoing a non-`s` id (or an id it chose
137
+ * for its own request) matches nothing.
138
+ *
139
+ * @returns the client's success `result`, or a `PeerRequestError`
140
+ * @mutates this - registers then clears an entry in `#pending`
141
+ */
142
+ request_connection(connection_id: Uuid, method: string, params: JsonrpcRequestParams | undefined, options?: PeerRequestOptions): Promise<PeerRequestOutcome>;
143
+ /**
144
+ * Route an inbound client reply to the matching pending server→client
145
+ * request on `connection_id` (delegates to `#pending.resolve`).
146
+ *
147
+ * Returns `false` when no entry matches — an unsolicited, cross-connection,
148
+ * or already-settled reply — so the caller drops it. Per-connection scoping
149
+ * means a reply arriving on the wrong socket resolves nothing.
150
+ *
151
+ * @returns whether a pending request was resolved
152
+ * @mutates this - clears the matched entry from `#pending`
153
+ */
154
+ resolve_peer_response(connection_id: Uuid, response: JsonrpcResponse | JsonrpcErrorResponse): boolean;
122
155
  is_ready(): boolean;
123
156
  /**
124
157
  * Number of currently tracked WebSocket connections.
@@ -1 +1 @@
1
- {"version":3,"file":"transports_ws_backend.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws_backend.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAc,KAAK,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAEX,gCAAgC,EAChC,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EAA2B,KAAK,SAAS,EAAE,KAAK,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AAIpG;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IAClC,sEAAsE;IACtE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,4CAA4C;IAC5C,UAAU,EAAE,IAAI,CAAC;IACjB,sEAAsE;IACtE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,4BAA6B,SAAQ,SAAS;IAC9D,kBAAkB,EAAE,CACnB,OAAO,EAAE,gCAAgC,EACzC,SAAS,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,OAAO,KAChD,MAAM,CAAC;CACZ;AAED,qDAAqD;AACrD,eAAO,MAAM,iCAAiC,GAC7C,WAAW,SAAS,KAClB,SAAS,IAAI,4BAEqE,CAAC;AAEtF,qBAAa,yBAA0B,YAAW,4BAA4B;;IAC7E,QAAQ,CAAC,cAAc,EAAG,uBAAuB,CAAU;IAY3D;;;;;;;;;;;;OAYG;IACH,cAAc,CACb,EAAE,EAAE,SAAS,EACb,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,UAAU,EAAE,IAAI,EAChB,YAAY,GAAE,MAAM,GAAG,IAAW,GAChC,IAAI;IAQP;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI;IA0BtC;;;;;;OAMG;IACH,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAIrD;;;;;;OAMG;IACH,yBAAyB,CAAC,UAAU,EAAE,IAAI,GAAG,MAAM;IAInD;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAgB/C,IAAI,CACT,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,sBAAsB,CAAC;IAC5B,IAAI,CACT,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA0CvC;;;;;;;;;OASG;IACH,kBAAkB,CACjB,OAAO,EAAE,gCAAgC,EACzC,SAAS,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,OAAO,GAClD,MAAM;IAoBT;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,gCAAgC,GAAG,MAAM;IAIpF,QAAQ,IAAI,OAAO;IAInB;;;;;;;OAOG;IACH,oBAAoB,IAAI,MAAM;CAG9B"}
1
+ {"version":3,"file":"transports_ws_backend.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws_backend.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAc,KAAK,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAEX,gCAAgC,EAChC,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAA2B,KAAK,SAAS,EAAE,KAAK,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAEN,KAAK,kBAAkB,EACvB,KAAK,k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,GAC5B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAyCvC;;;;;;;;;OASG;IACH,kBAAkB,CACjB,OAAO,EAAE,gCAAgC,EACzC,SAAS,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,OAAO,GAClD,MAAM;IAoBT;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,gCAAgC,GAAG,MAAM;IAIpF;;;;;;;;;;;;;;;;;;OAkBG;IACH,kBAAkB,CACjB,aAAa,EAAE,IAAI,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,oBAAoB,GAAG,SAAS,EACxC,OAAO,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;IAkB9B;;;;;;;;;;OAUG;IACH,qBAAqB,CACpB,aAAa,EAAE,IAAI,EACnB,QAAQ,EAAE,eAAe,GAAG,oBAAoB,GAC9C,OAAO;IAIV,QAAQ,IAAI,OAAO;IAInB;;;;;;;OAOG;IACH,oBAAoB,IAAI,MAAM;CAG9B"}
@@ -7,8 +7,9 @@
7
7
  import { to_error_message } from '@fuzdev/fuz_util/error.ts';
8
8
  import { create_uuid } from '@fuzdev/fuz_util/id.ts';
9
9
  import { jsonrpc_error_messages } from '../http/jsonrpc_errors.js';
10
- import { create_jsonrpc_error_response, to_jsonrpc_message_id, is_jsonrpc_request, } from '../http/jsonrpc_helpers.js';
10
+ import { create_jsonrpc_error_response, create_jsonrpc_request, to_jsonrpc_message_id, is_jsonrpc_request, } from '../http/jsonrpc_helpers.js';
11
11
  import { WS_CLOSE_SESSION_REVOKED } from './transports.js';
12
+ import { PendingPeerRequests, } from './peer_request.js';
12
13
  /** Type guard for `FilterableBroadcastTransport`. */
13
14
  export const is_filterable_broadcast_transport = (transport) => 'broadcast_filtered' in transport &&
14
15
  typeof transport.broadcast_filtered === 'function';
@@ -21,6 +22,10 @@ export class BackendWebsocketTransport {
21
22
  // Auth identity per connection. Adding a new identity scope (e.g.
22
23
  // `device_id`) means adding a field here, not a new parallel map.
23
24
  #connection_identities = new Map();
25
+ // Server→client request correlation (ActionPeer). The transport owns the
26
+ // sockets + the send; the registry owns the pending map, id allocation,
27
+ // deadlines, and the per-connection in-flight cap (see `peer_request.ts`).
28
+ #pending = new PendingPeerRequests();
24
29
  /**
25
30
  * Add a new WebSocket connection with auth info.
26
31
  * Session connections pass a token hash for targeted revocation.
@@ -110,17 +115,18 @@ export class BackendWebsocketTransport {
110
115
  this.#connections.delete(connection_id);
111
116
  this.#connection_ids.delete(ws);
112
117
  this.#connection_identities.delete(connection_id);
118
+ // Wake any handler still awaiting a reply on this socket — the peer is
119
+ // gone, so the request can never complete.
120
+ this.#pending.drain(connection_id);
113
121
  }
114
122
  #revoke_connection(connection_id, ws) {
115
123
  this.#cleanup_connection(connection_id, ws);
116
124
  ws.close(WS_CLOSE_SESSION_REVOKED, 'Session revoked');
117
125
  }
118
126
  async send(message, _options) {
119
- // TODO currently just broadcasts all messages to all clients, the transport abstraction is still a WIP
120
127
  if (is_jsonrpc_request(message)) {
121
- return create_jsonrpc_error_response(message.id,
122
- // TODO maybe use a not yet implemented error message?
123
- jsonrpc_error_messages.internal_error('TODO not yet implemented - backend WebSocket transport cannot send requests expecting responses yet'));
128
+ return create_jsonrpc_error_response(message.id, jsonrpc_error_messages.internal_error('backend WebSocket transport cannot broadcast a request expecting a response; ' +
129
+ 'use request_connection(connection_id, ...) to target a single socket'));
124
130
  }
125
131
  try {
126
132
  await this.#broadcast(message);
@@ -189,6 +195,57 @@ export class BackendWebsocketTransport {
189
195
  send_to_account(account_id, message) {
190
196
  return this.broadcast_filtered(message, (id) => id.account_id === account_id);
191
197
  }
198
+ /**
199
+ * Initiate a JSON-RPC request to a single connected client and await its
200
+ * reply — the server→client request/response direction (ActionPeer).
201
+ *
202
+ * Sends `{jsonrpc, method, params, id}` to exactly the `connection_id`
203
+ * socket (never a broadcast) and registers a pending entry scoped to that
204
+ * connection. Resolves when the client's matching reply arrives (routed in
205
+ * via `resolve_peer_response`), the deadline elapses (`timeout`), the
206
+ * per-connection cap is hit (`too_many_in_flight`), or the socket closes
207
+ * (`connection_gone`). Never throws — every failure is a `PeerRequestError`.
208
+ *
209
+ * Delegates correlation to `#pending` (id allocation, deadline, cap, drain);
210
+ * this method owns only the socket lookup + the send. Server-issued ids are
211
+ * `s`-prefixed so a malicious client echoing a non-`s` id (or an id it chose
212
+ * for its own request) matches nothing.
213
+ *
214
+ * @returns the client's success `result`, or a `PeerRequestError`
215
+ * @mutates this - registers then clears an entry in `#pending`
216
+ */
217
+ request_connection(connection_id, method, params, options) {
218
+ const ws = this.#connections.get(connection_id);
219
+ if (!ws)
220
+ return Promise.resolve({ ok: false, error: { kind: 'connection_gone' } });
221
+ const registered = this.#pending.register(connection_id, options?.timeout_ms);
222
+ if (!registered)
223
+ return Promise.resolve({ ok: false, error: { kind: 'too_many_in_flight' } });
224
+ const { id, outcome } = registered;
225
+ try {
226
+ ws.send(JSON.stringify(create_jsonrpc_request(method, params, id)));
227
+ }
228
+ catch {
229
+ // Send failed — the socket is gone; settle now so the caller isn't
230
+ // left awaiting until the deadline.
231
+ this.#pending.settle(connection_id, id, { ok: false, error: { kind: 'connection_gone' } });
232
+ }
233
+ return outcome;
234
+ }
235
+ /**
236
+ * Route an inbound client reply to the matching pending server→client
237
+ * request on `connection_id` (delegates to `#pending.resolve`).
238
+ *
239
+ * Returns `false` when no entry matches — an unsolicited, cross-connection,
240
+ * or already-settled reply — so the caller drops it. Per-connection scoping
241
+ * means a reply arriving on the wrong socket resolves nothing.
242
+ *
243
+ * @returns whether a pending request was resolved
244
+ * @mutates this - clears the matched entry from `#pending`
245
+ */
246
+ resolve_peer_response(connection_id, response) {
247
+ return this.#pending.resolve(connection_id, response);
248
+ }
192
249
  is_ready() {
193
250
  return this.#connections.size > 0;
194
251
  }
@@ -20,7 +20,7 @@ documents the cross-cutting invariants that don't fit on any single symbol.
20
20
  - **Route caps** — `RouteFactoryDeps` — `Omit<AppDeps, 'db'>`; handlers get `db` via `RouteContext`.
21
21
  - **Action caps** — inline — action factories take `Pick<RouteFactoryDeps, 'log' | 'audit'>` (role-grant-offer adds `notification_sender?`).
22
22
  - **Parameters** — `*Options` — static startup values, per-factory.
23
- - **Runtime state** — inline ref — mutable values: `bootstrap_status`, `app_settings` ref, `DaemonTokenState`. NOT in deps or options.
23
+ - **Runtime state** — inline ref — mutable values: `bootstrap_status`, `DaemonTokenState`. NOT in deps or options.
24
24
 
25
25
  `audit: AuditEmitter` is the bound emitter built once at backend assembly by
26
26
  the consumer's `audit_factory` callback over `create_audit_emitter`; closes
@@ -375,8 +375,8 @@ in the HTTP RPC dispatcher (`actions/action_rpc.ts`), the WS dispatcher
375
375
 
376
376
  ### Migrations
377
377
 
378
- Schema migrations live in `auth/migrations.ts` — two namespaces today (`full_auth_schema`,
379
- `role_grant_offer_and_scoped_role_grants`) under the reserved
378
+ Schema migrations live in `auth/migrations.ts` — two migrations today (`full_auth_schema`,
379
+ `role_grant_offer_and_scoped_role_grants`) under the single reserved namespace
380
380
  `AUTH_MIGRATION_NAMESPACE = 'fuz_auth'`. Consumer namespaces must avoid
381
381
  `reserved_migration_namespaces`. Runner contract, error vocabulary, and
382
382
  operator recipes (rename, mark applied, reset, baseline) are in
@@ -485,10 +485,10 @@ Closure state:
485
485
 
486
486
  - `grantable_roles` derived once from `options.roles?.role_specs ?? builtin_role_specs_by_name`
487
487
  via `list_roles_with_grant_path(_, GRANT_PATH_ADMIN)`.
488
- - `options.app_settings` mutable ref — `app_settings_update` mutates so
489
- `auth/signup_routes.ts` reads the new value without a DB round trip. When
490
- absent, the two app-settings specs are still in the registry but unwired
491
- (dispatch returns `method_not_found`).
488
+ - `app_settings_get`/`_update` handlers are always wired and read/write the DB
489
+ directly (`query_app_settings_load`/`query_app_settings_update`);
490
+ `auth/signup_routes.ts` reads the current value fresh per request. There is no
491
+ `options.app_settings` ref.
492
492
  - `options.connection_closer?` — handler-side eager WS close on
493
493
  `admin_session_revoke_all` / `admin_token_revoke_all` BEFORE the audit
494
494
  emit so revocation lands even on audit INSERT failure. Listener-based
@@ -625,18 +625,18 @@ arbitrary sockets.
625
625
  `create_standard_rpc_actions(deps, options)` in `auth/standard_rpc_actions.ts`
626
626
  spreads `create_admin_actions`, `create_role_grant_offer_actions`, and
627
627
  `create_account_actions` into a single `Array<RpcAction>` — the canonical
628
- fuz_app "standard" surface (25 actions with `app_settings` wired, 23
629
- without). Frontend mirror is `all_standard_action_specs` in
630
- `auth/standard_action_specs.ts`.
628
+ fuz_app "standard" surface (28 actions: 14 admin + 7 role-grant-offer + 7
629
+ account; the two app-settings methods are always wired). Frontend mirror is
630
+ `all_standard_action_specs` in `auth/standard_action_specs.ts`.
631
631
 
632
632
  Option routing — `roles` is shared between admin + role-grant-offer;
633
- `app_settings` → admin only; `default_ttl_ms` + `authorize` → role-grant-offer
633
+ `default_ttl_ms` + `authorize` → role-grant-offer
634
634
  only; `max_tokens` → account only; `connection_closer` → admin + account;
635
635
  `notification_sender` → role-grant-offer only.
636
636
 
637
637
  Pair with `create_app_server`'s `rpc_endpoints` factory form
638
638
  `(ctx) => Array<RpcEndpointSpec>` so the combined action list gets
639
- `ctx.deps` + `ctx.app_settings`. `create_app_server` auto-mounts the
639
+ `ctx.deps`. `create_app_server` auto-mounts the
640
640
  endpoint via `create_rpc_endpoint`. To expose the standard surface over
641
641
  WebSocket as well, spread `protocol_actions` and the same factory into
642
642
  `ws_endpoints` — per-message authorization and rate limiting fire
@@ -1 +1 @@
1
- {"version":3,"file":"actor_lookup_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/actor_lookup_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAKtB;;;GAGG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC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AwB;;;;;;;;;;;;;;;;;;;;;;CAaA,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"actor_search_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/actor_search_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAMtB;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,gDAAgD;AAChD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAG,6BAAsC,CAAC;AAExF,eAAO,MAAM,gBAAgB;;;;kBAqB3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,eAAO,MAAM,iBAAiB;;;;;;kBAE5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;CAYA,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC"}
1
+ {"version":3,"file":"actor_search_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/actor_search_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH,OAAO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