@fuzdev/fuz_app 0.167.0 → 0.168.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.
- package/dist/actions/CLAUDE.md +9 -8
- package/dist/actions/action_dispatcher.d.ts +1 -1
- package/dist/actions/action_dispatcher.d.ts.map +1 -1
- package/dist/actions/action_dispatcher.js +1 -1
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +1 -1
- package/dist/actions/action_event_data.d.ts +260 -65
- package/dist/actions/action_event_data.d.ts.map +1 -1
- package/dist/actions/action_event_data.js +11 -11
- package/dist/actions/action_event_types.d.ts +5 -14
- package/dist/actions/action_event_types.d.ts.map +1 -1
- package/dist/actions/action_event_types.js +3 -3
- package/dist/actions/action_rpc.js +5 -5
- package/dist/actions/action_spec.d.ts +8 -26
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +4 -4
- package/dist/actions/broadcast_api.d.ts +1 -1
- package/dist/actions/broadcast_api.js +1 -1
- package/dist/actions/cancel.d.ts +17 -9
- package/dist/actions/cancel.d.ts.map +1 -1
- package/dist/actions/cancel.js +3 -3
- package/dist/actions/heartbeat.d.ts +3 -4
- package/dist/actions/heartbeat.d.ts.map +1 -1
- package/dist/actions/heartbeat.js +4 -4
- package/dist/actions/peer_ping.d.ts +63 -23
- package/dist/actions/peer_ping.d.ts.map +1 -1
- package/dist/actions/peer_ping.js +20 -19
- package/dist/actions/peer_request.d.ts +6 -3
- package/dist/actions/peer_request.d.ts.map +1 -1
- package/dist/actions/peer_request.js +8 -2
- package/dist/actions/perform_action.d.ts +1 -1
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/transports.d.ts +2 -3
- package/dist/actions/transports.d.ts.map +1 -1
- package/dist/actions/transports.js +0 -4
- package/dist/actions/transports_http.d.ts.map +1 -1
- package/dist/actions/transports_http.js +4 -3
- package/dist/actions/transports_ws.d.ts.map +1 -1
- package/dist/actions/ws_socket_session.d.ts.map +1 -1
- package/dist/actions/ws_socket_session.js +6 -5
- package/dist/http/CLAUDE.md +9 -8
- package/dist/http/jsonrpc.d.ts +231 -152
- package/dist/http/jsonrpc.d.ts.map +1 -1
- package/dist/http/jsonrpc.js +55 -85
- package/dist/http/jsonrpc_errors.d.ts +22 -4
- package/dist/http/jsonrpc_errors.d.ts.map +1 -1
- package/dist/http/jsonrpc_errors.js +37 -4
- package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
- package/dist/http/jsonrpc_helpers.js +13 -12
- package/dist/testing/CLAUDE.md +6 -3
- package/dist/testing/cross_backend/peer_ping_ws.d.ts +3 -2
- package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/peer_ping_ws.js +49 -2
- package/dist/testing/rpc_helpers.d.ts +1 -1
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +13 -14
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +11 -11
- package/dist/testing/transports/ws_client.js +1 -1
- package/dist/ui/SurfaceExplorer.svelte +2 -2
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perform_action.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/perform_action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGN,KAAK,YAAY,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAGtC,OAAO,EAGN,KAAK,QAAQ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AA;CAAE,CAAC;AAEhG;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAC1B,OAAO,kBAAkB,EACzB,MAAM,iBAAiB,KACrB,OAAO,CAAC,mBAAmB,CAuL7B,CAAC;AA8BF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,GACnC,OAAO,gBAAgB,EACvB,QAAQ,aAAa,CAAC,QAAQ,CAAC,EAC/B,QAAQ,OAAO,KACb,kBAOF,CAAC;AA6DF;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,GAC1C,2BAA2B,aAAa,CAAC,MAAM,CAAC,KAC9C,kBAIA,CAAC;AAqEJ,0FAA0F;AAC1F,MAAM,WAAW,sBAAsB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,uBAAuB,GACnC,IAAI,gBAAgB,EACpB,QAAQ,mBAAmB,EAC3B,QAAQ,MAAM,EACd,KAAK,MAAM,KACT,sBAkBF,CAAC"}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
-
import { z } from 'zod';
|
|
10
9
|
import type { JsonrpcMessageFromClientToServer, JsonrpcMessageFromServerToClient, JsonrpcNotification, JsonrpcRequest, JsonrpcResponseOrError, JsonrpcErrorResponse } from '../http/jsonrpc.js';
|
|
11
10
|
/**
|
|
12
11
|
* WebSocket close code for session revocation — and for a credential that
|
|
@@ -199,8 +198,8 @@ export declare const utf8_length_over: (text: string, max_bytes: number) => numb
|
|
|
199
198
|
* @returns its length in UTF-8 bytes
|
|
200
199
|
*/
|
|
201
200
|
export declare const utf8_length: (text: string) => number;
|
|
202
|
-
|
|
203
|
-
export type TransportName =
|
|
201
|
+
/** A transport's name — not branded, for convenience: an unknown one fails at runtime. */
|
|
202
|
+
export type TransportName = string;
|
|
204
203
|
/**
|
|
205
204
|
* Per-call options accepted by every transport's `send`. Optional and
|
|
206
205
|
* extensible — adding a field is non-breaking. Source of truth for the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"transports.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACX,gCAAgC,EAChC,gCAAgC,EAChC,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAC7C;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,oBAAoB,CAAC;AACjE;;;;;;;GAOG;AACH,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,sEAAsE;AACtE,eAAO,MAAM,iCAAiC,OAAO,CAAC;AACtD;;;;GAIG;AACH,eAAO,MAAM,wCAAwC,6BAA6B,CAAC;AACnF,yEAAyE;AACzE,eAAO,MAAM,iCAAiC,OAAO,CAAC;AACtD;;;GAGG;AACH,eAAO,MAAM,wCAAwC,6BAA6B,CAAC;AACnF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C;;;GAGG;AACH,eAAO,MAAM,gCAAgC,qBAAqB,CAAC;AACnE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAC/C;;;GAGG;AACH,eAAO,MAAM,iCAAiC,4BAA4B,CAAC;AAC3E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAChD;;;GAGG;AACH,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE;;;;;;GAMG;AACH,eAAO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AAoB,GAC5B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IACxC,IAAI,CACH,OAAO,EAAE,gCAAgC,EACzC,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,gCAAgC,GAAG,IAAI,CAAC,CAAC;IACpD,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IACnC;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;GAGG;AACH,qBAAa,UAAU;;IAItB;;;;;OAKG;IACH,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAQ9C;;;;;;;;;OASG;IACH,aAAa,CAAC,cAAc,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,SAAS,GAAG,IAAI;CAa9F"}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
-
import { z } from 'zod';
|
|
10
9
|
/**
|
|
11
10
|
* WebSocket close code for session revocation — and for a credential that
|
|
12
11
|
* expired while the socket was open (`WS_CLOSE_CREDENTIAL_EXPIRED_REASON`).
|
|
@@ -204,9 +203,6 @@ export const utf8_length_over = (text, max_bytes) => {
|
|
|
204
203
|
* @returns its length in UTF-8 bytes
|
|
205
204
|
*/
|
|
206
205
|
export const utf8_length = (text) => text_encoder.encode(text).byteLength;
|
|
207
|
-
// TODO figure out the symmetry of frontend and backend transports (none/partial/full?) --
|
|
208
|
-
// we may also need orthogonal abstractions to clarify the transport role
|
|
209
|
-
export const TransportName = z.string(); // not branded for convenience, will just error at runtime, the schema is just for docs atm
|
|
210
206
|
/**
|
|
211
207
|
* The transports a peer sends through, by name. The first registered is the
|
|
212
208
|
* default a call that names none prefers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports_http.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"transports_http.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH,OAAO,EACN,oBAAoB,EAGpB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EAEnB,KAAK,sBAAsB,EAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASxD;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,2CAA2C;AAC3C,MAAM,WAAW,4BAA4B;IAC5C,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;;;;;;;OASG;IACH,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAC;IACpE;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,qBAAsB,YAAW,SAAS;;IACtD,QAAQ,CAAC,cAAc,EAAG,mBAAmB,CAAU;gBAU3C,OAAO,EAAE,4BAA4B;IAgD3C,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;IA4EvC,QAAQ,IAAI,OAAO;CAGnB"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import { DEV } from 'esm-env';
|
|
8
|
+
import { parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
8
9
|
import { to_thrown_jsonrpc_error, jsonrpc_error_messages, http_status_to_jsonrpc_error_code, jsonrpc_error_code_to_http_status, UNKNOWN_ERROR_MESSAGE } from '../http/jsonrpc_errors.js';
|
|
9
10
|
import { create_jsonrpc_error_response, to_jsonrpc_message_id, is_jsonrpc_error_response, is_jsonrpc_response } from '../http/jsonrpc_helpers.js';
|
|
10
11
|
import { JsonrpcErrorResponse } from '../http/jsonrpc.js';
|
|
@@ -172,10 +173,10 @@ const read_json_body = async (response) => {
|
|
|
172
173
|
* so a numeric id comes back as its string form.
|
|
173
174
|
*/
|
|
174
175
|
const to_error_response_for = (body, id) => {
|
|
175
|
-
const parsed = JsonrpcErrorResponse
|
|
176
|
-
if (!parsed.
|
|
176
|
+
const parsed = parse(JsonrpcErrorResponse, body);
|
|
177
|
+
if (!parsed.ok)
|
|
177
178
|
return null;
|
|
178
|
-
const response = parsed.
|
|
179
|
+
const response = parsed.value;
|
|
179
180
|
if (response.id !== null && String(response.id) !== String(id))
|
|
180
181
|
return null;
|
|
181
182
|
return response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAiBH,OAAO,KAAK,EAGX,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"transports_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/transports_ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiB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H;;;;;;;;;;GAUG;AACH,qBAAa,0BAA2B,YAAW,SAAS;;IAC3D,QAAQ,CAAC,cAAc,EAAG,wBAAwB,CAAU;IAE5D;;;;;;;OAOG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;gBASA,UAAU,EAAE,sBAAsB,EAClC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,EAC5C,OAAO,CAAC,EAAE,iCAAiC;IAsDtC,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;IAkEvC,QAAQ,IAAI,OAAO;IAInB;;;;;;OAMG;IACH,OAAO,IAAI,IAAI;CAUf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws_socket_session.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/ws_socket_session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4GG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"ws_socket_session.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/ws_socket_session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4G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;IAC7F,eAAe,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACrF,+EAA+E;IAC/E,cAAc,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;CACxC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC/B,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,mGAAmG;IACnG,cAAc,EAAE;QAAE,eAAe,EAAE,cAAc,GAAG,IAAI,CAAA;KAAE,GAAG,SAAS,CAAC;IACvE;;;;OAIG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB,gGAAgG;IAChG,eAAe,EAAE,cAAc,CAAC;CAChC;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,GACnC,UAAU,gBAAgB,EAC1B,SAAS,eAAe,KACtB,QA6oBF,CAAC"}
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
* @module
|
|
109
109
|
*/
|
|
110
110
|
import { UnreachableError } from '@fuzdev/fuz_util/error.ts';
|
|
111
|
+
import { parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
111
112
|
import { recheck_admission, resolved_auth_api_token_id, resolved_auth_session_hash } from '../auth/resolved_auth.js';
|
|
112
113
|
import { schedule_credential_deadline } from '../auth/credential_deadline.js';
|
|
113
114
|
import { flush_request_effects } from '../http/pending_effects.js';
|
|
@@ -538,17 +539,17 @@ export const create_ws_socket_events = (endpoint, upgrade) => {
|
|
|
538
539
|
// notification handlers are not a feature yet). Notifications
|
|
539
540
|
// stay unvalidated — they carry no id to answer an error on.
|
|
540
541
|
if (classified.method === cancel_action_spec.method) {
|
|
541
|
-
const parsed = CancelNotificationParams
|
|
542
|
-
if (!parsed.
|
|
543
|
-
log.debug('cancel: invalid params, ignoring', parsed.
|
|
542
|
+
const parsed = parse(CancelNotificationParams, classified.params);
|
|
543
|
+
if (!parsed.ok) {
|
|
544
|
+
log.debug('cancel: invalid params, ignoring', parsed.issues);
|
|
544
545
|
return;
|
|
545
546
|
}
|
|
546
|
-
const controller = pending_controllers.get(parsed.
|
|
547
|
+
const controller = pending_controllers.get(parsed.value.request_id);
|
|
547
548
|
if (controller) {
|
|
548
549
|
controller.abort();
|
|
549
550
|
}
|
|
550
551
|
else {
|
|
551
|
-
log.debug('cancel: no pending request for id', parsed.
|
|
552
|
+
log.debug('cancel: no pending request for id', parsed.value.request_id);
|
|
552
553
|
}
|
|
553
554
|
}
|
|
554
555
|
return;
|
package/dist/http/CLAUDE.md
CHANGED
|
@@ -30,7 +30,7 @@ effects, see ../../../docs/architecture.md.
|
|
|
30
30
|
- `http/client_ip.ts` — `get_client_ip(c)` — reads the resolved IP off the context (set by `proxy.ts`'s middleware). Split out of `proxy.ts` so it's hono-free: dispatch + route modules that only _read_ the IP don't pull `hono/utils/ipaddr`, keeping cross-process test surfaces free of the optional `hono` peer.
|
|
31
31
|
- `http/ip_canonical.ts` — RFC 5952 IPv6 canonicalization + IPv4-mapped collapse, `rate_limit_ip_key` (an IPv6 client's `/64`), and its own `parse_ipv4_bits` / `parse_ipv6_bits` (the grammar of Rust's `IpAddr::from_str`); `IP_LITERAL_CHARS` regex. Imports nothing — the dispatcher keys its IP limiter through it, so it must stay hono-free (`src/test/hono_free_modules.test.ts` walks every `src/lib` module's graph).
|
|
32
32
|
- `http/origin.ts` — origin allowlist: the strict pattern grammar shared with the Rust spine, typed refusals, and the Origin-only middleware.
|
|
33
|
-
- `http/jsonrpc.ts` — JSON-RPC 2.0 envelope schemas (MCP superset), `JsonrpcErrorCode
|
|
33
|
+
- `http/jsonrpc.ts` — JSON-RPC 2.0 envelope schemas (MCP superset, fuz_schema), `JsonrpcErrorCode`.
|
|
34
34
|
- `http/jsonrpc_errors.ts` — `ThrownJsonrpcError`, `jsonrpc_errors` throwers, HTTP-status mappings.
|
|
35
35
|
- `http/jsonrpc_helpers.ts` — message builders, type guards, input/result normalizers, and `classify_jsonrpc_message`, the one envelope classifier both transports run.
|
|
36
36
|
- `http/health_schema.ts` — `HEALTH_PATH` + the `HealthResponse` schema (a fuz_schema `object`), browser-safe, shared by the health route spec and the client probe (`ui/backend_probe.svelte.ts`).
|
|
@@ -490,12 +490,12 @@ schemas), `http/jsonrpc_errors.ts` runtime (throwable + map),
|
|
|
490
490
|
`http/jsonrpc_helpers.ts` plumbing (builders, guards, converters).
|
|
491
491
|
|
|
492
492
|
Follows JSON-RPC 2.0 spec with a partial **MCP superset** posture — params
|
|
493
|
-
are object-only (no positional arrays) and
|
|
494
|
-
|
|
495
|
-
|
|
493
|
+
are object-only (no positional arrays), and the envelopes are fuz_schema
|
|
494
|
+
`loose_object`s that keep members a reader passes over; result is any value
|
|
495
|
+
(`unknown`, which needs its key) since the per-action `spec.output` is the
|
|
496
496
|
actual contract and the MCP object-only result constraint would reject any
|
|
497
|
-
spec declaring
|
|
498
|
-
|
|
497
|
+
spec declaring a null or primitive output on the wire. A parse returns the
|
|
498
|
+
frame itself, not a copy.
|
|
499
499
|
|
|
500
500
|
`_meta` is intentionally **not** envelope-validated — that lives in
|
|
501
501
|
per-action schemas so mismatches surface as `invalid_params` rather than
|
|
@@ -551,11 +551,12 @@ which holds a declaration to the same rules.
|
|
|
551
551
|
- `to_thrown_jsonrpc_error(err)` — the one thrown → wire conversion: the `JsonrpcErrorObject` a `ThrownJsonrpcError` carries, recognized by a realm-global `Symbol.for` brand on its prototype (so one from a second fuz_app copy is read too), when its `code` is a JSON-RPC error code; else `null` — a foreign error class with a JSON-RPC-shaped `code` (another library's RPC error) or a `DOMException` included. Read by the REST catch layer, `perform_action`, `create_jsonrpc_error_response_from_thrown`, the frontend HTTP and WS transports, and `ActionEvent`'s handler-throw normalization, each masking everything else its own way
|
|
552
552
|
- `jsonrpc_error_code_to_http_status` / `http_status_to_jsonrpc_error_code` (fall back to 500 / `internal_error`) — the code → status table is module-private; `HTTP_STATUS_TO_JSONRPC_ERROR_CODE` (frozen) is the reverse over the base set
|
|
553
553
|
- `register_jsonrpc_error_code(code, http_status)` — declares a consumer code's status (see **Consumer codes** above)
|
|
554
|
-
- Envelope schemas in `http/jsonrpc.ts
|
|
554
|
+
- Envelope schemas in `http/jsonrpc.ts` (fuz_schema): `JsonrpcRequest`, `JsonrpcNotification`, `JsonrpcResponse`, `JsonrpcErrorResponse`, `JsonrpcResponseOrError`, `JsonrpcErrorObject`, `JsonrpcErrorCode` (`JsonrpcServerErrorCode` an integer in the server range, as `is_jsonrpc_error_code` reads it). Also `JsonrpcRequestId`, `JsonrpcMethod`, `JsonrpcResult`, and the params. `JsonrpcMessage`, `JsonrpcMessageFromClientToServer`, and `JsonrpcMessageFromServerToClient` are types only
|
|
555
|
+
- `parse_inbound_jsonrpc_error(error)` — a peer's error reply read as the Rust `parse_inbound_error` reads it: a code off the base set (a consumer's code included) is `internal_error`, a non-string message `'peer error'`, an own `data` kept as sent; what `PendingPeerRequests.resolve` hands the caller
|
|
555
556
|
- Builders in `http/jsonrpc_helpers.ts`: `create_jsonrpc_request`, `create_jsonrpc_notification`, `create_jsonrpc_response`, `create_jsonrpc_error_response`, `create_jsonrpc_error_response_from_thrown` (preserves code/message/data on a thrown JSON-RPC error, via `to_thrown_jsonrpc_error`; plain `Error` → `internal_error` with `{stack}` in DEV)
|
|
556
557
|
- Type guards: `is_jsonrpc_request_id` (rejects NaN/Infinity), `is_jsonrpc_object`, `is_jsonrpc_request` / `_notification` / `_response` / `_error_response`
|
|
557
558
|
- Converters: `to_jsonrpc_message_id`, `to_jsonrpc_params` (normalizes primitives to `{value}`)
|
|
558
|
-
- Classifier: `classify_jsonrpc_message(json)` → `ClassifiedJsonrpcMessage` (`request` / `notification` / `response` / `invalid`, the last carrying the error and the id to answer it on), twin of the Rust `fuz_http::classify` in order and answers. The WS frame handler and the HTTP POST handler switch on it, each keeping its transport's arms: WS refuses batches before it, routes `cancel` and peer responses, and checks duplicate ids and the in-flight ceiling after; POST answers a notification or a response `invalid_request` on `id: null`. Only a refused request envelope carries data — the schema's issues, DEV-only. A `request` carries the frame as parsed, validated but not rebuilt, so an own `__proto__` key in `params` reaches the dispatcher, which refuses it (`ERROR_PARAMS_PROTO_KEY`) as on GET and the Rust spine (a
|
|
559
|
+
- Classifier: `classify_jsonrpc_message(json)` → `ClassifiedJsonrpcMessage` (`request` / `notification` / `response` / `invalid`, the last carrying the error and the id to answer it on), twin of the Rust `fuz_http::classify` in order and answers. The WS frame handler and the HTTP POST handler switch on it, each keeping its transport's arms: WS refuses batches before it, routes `cancel` and peer responses, and checks duplicate ids and the in-flight ceiling after; POST answers a notification or a response `invalid_request` on `id: null`. Only a refused request envelope carries data — the schema's issues, DEV-only. A `request` carries the frame as parsed, validated but not rebuilt, so an own `__proto__` key in `params` reaches the dispatcher, which refuses it (`ERROR_PARAMS_PROTO_KEY`) as on GET and the Rust spine (a rebuilt copy would drop it).
|
|
559
560
|
|
|
560
561
|
Handlers can `throw jsonrpc_errors.*` — `apply_route_specs`' error-catch
|
|
561
562
|
layer converts to the flat REST body (`{error: <reason>, message?, ...rest_data}`)
|