@fuzdev/fuz_app 0.169.0 → 0.171.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 +19 -21
- package/dist/actions/action_codegen.d.ts +27 -18
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +90 -90
- package/dist/actions/action_event.d.ts +0 -8
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_event.js +7 -6
- package/dist/actions/action_event_data.d.ts +4 -4
- package/dist/actions/action_rpc.d.ts +1 -1
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +6 -7
- package/dist/actions/action_spec.d.ts +8 -10
- package/dist/actions/action_spec.d.ts.map +1 -1
- package/dist/actions/action_spec.js +1 -1
- package/dist/actions/action_types.d.ts +4 -4
- package/dist/actions/action_types.d.ts.map +1 -1
- package/dist/actions/action_types.js +2 -2
- package/dist/actions/broadcast_api.d.ts +2 -2
- package/dist/actions/broadcast_api.js +4 -4
- package/dist/actions/compile_action_registry.d.ts +6 -7
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/compile_action_registry.js +8 -9
- package/dist/actions/peer_ping.d.ts.map +1 -1
- package/dist/actions/peer_ping.js +3 -2
- package/dist/actions/perform_action.d.ts +6 -6
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +11 -10
- package/dist/actions/socket.svelte.d.ts +1 -1
- package/dist/actions/socket.svelte.js +2 -2
- package/dist/actions/ws_socket_session.d.ts.map +1 -1
- package/dist/actions/ws_socket_session.js +2 -1
- package/dist/auth/CLAUDE.md +11 -11
- package/dist/auth/admin_action_specs.d.ts +24 -24
- package/dist/auth/audit_emitter.d.ts +6 -7
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +11 -22
- package/dist/auth/audit_log_ddl.d.ts +1 -1
- package/dist/auth/audit_log_ddl.js +1 -1
- package/dist/auth/audit_log_queries.d.ts +0 -13
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +3 -3
- package/dist/auth/audit_log_schema.d.ts +14 -15
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +1 -1
- package/dist/auth/auth_ddl.d.ts +1 -1
- package/dist/auth/auth_ddl.js +1 -1
- package/dist/auth/cell_action_specs.d.ts +54 -54
- package/dist/auth/cell_actions.d.ts +2 -2
- package/dist/auth/cell_actions.js +5 -5
- package/dist/auth/middleware.d.ts +6 -2
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +14 -2
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +7 -9
- package/dist/auth/role_grant_offer_action_specs.d.ts +6 -6
- package/dist/auth/role_grant_offer_ddl.d.ts +1 -1
- package/dist/auth/role_grant_offer_ddl.js +1 -1
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +2 -3
- package/dist/auth/self_service_role_actions.d.ts +1 -1
- package/dist/auth/self_service_role_actions.js +1 -1
- package/dist/env/env_schemas.d.ts +1 -2
- package/dist/env/env_schemas.d.ts.map +1 -1
- package/dist/env/env_schemas.js +3 -4
- package/dist/http/CLAUDE.md +30 -31
- package/dist/http/auth_shape.d.ts +14 -32
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +14 -49
- package/dist/http/error_schemas.d.ts +18 -18
- package/dist/http/json_text.d.ts +53 -0
- package/dist/http/json_text.d.ts.map +1 -0
- package/dist/http/json_text.js +152 -0
- package/dist/http/jsonrpc_helpers.js +1 -1
- package/dist/http/route_error_check.d.ts +2 -2
- package/dist/http/route_error_check.d.ts.map +1 -1
- package/dist/http/route_error_check.js +2 -3
- package/dist/http/route_errors.d.ts +4 -4
- package/dist/http/route_errors.d.ts.map +1 -1
- package/dist/http/route_errors.js +0 -13
- package/dist/http/route_result.d.ts +2 -1
- package/dist/http/route_result.d.ts.map +1 -1
- package/dist/http/route_spec.d.ts +34 -37
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +31 -31
- package/dist/http/schema_helpers.d.ts +77 -68
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +54 -77
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +6 -8
- package/dist/primitive_schemas.d.ts +9 -17
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +9 -17
- package/dist/realtime/sse.d.ts +3 -3
- package/dist/realtime/sse.d.ts.map +1 -1
- package/dist/realtime/sse.js +2 -2
- package/dist/schema_issues.d.ts +39 -147
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +39 -352
- package/dist/schema_meta.d.ts +63 -136
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +37 -184
- package/dist/sensitivity.d.ts +3 -5
- package/dist/sensitivity.d.ts.map +1 -1
- package/dist/sensitivity.js +3 -5
- package/dist/testing/CLAUDE.md +20 -22
- package/dist/testing/adversarial_headers.js +2 -2
- package/dist/testing/adversarial_input_cases.d.ts +19 -18
- package/dist/testing/adversarial_input_cases.d.ts.map +1 -1
- package/dist/testing/adversarial_input_cases.js +31 -46
- package/dist/testing/assertions.d.ts +2 -2
- package/dist/testing/assertions.d.ts.map +1 -1
- package/dist/testing/assertions.js +3 -3
- package/dist/testing/cross_backend/account_lifecycle.js +2 -2
- package/dist/testing/cross_backend/action_manifest.d.ts +10 -9
- package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
- package/dist/testing/cross_backend/action_manifest.js +4 -3
- package/dist/testing/cross_backend/cell_crud.js +1 -1
- package/dist/testing/cross_backend/conformance_rpc_auth.d.ts +0 -62
- package/dist/testing/cross_backend/conformance_rpc_auth.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +3 -3
- package/dist/testing/cross_backend/cross_rpc.d.ts +3 -4
- package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -1
- package/dist/testing/cross_backend/cross_rpc.js +4 -4
- package/dist/testing/cross_backend/differential.js +2 -2
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +16 -11
- package/dist/testing/cross_backend/origin_conformance.d.ts +9 -9
- package/dist/testing/cross_backend/query_shape.js +1 -1
- package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts +1 -1
- package/dist/testing/cross_backend/setup.d.ts +25 -3
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +4 -4
- package/dist/testing/cross_backend/sse_round_trip.js +2 -2
- package/dist/testing/cross_backend/testing_origin_check.d.ts +4 -4
- package/dist/testing/cross_backend/token_lifetime.js +3 -3
- package/dist/testing/cross_backend/wire_shapes.js +1 -1
- package/dist/testing/cross_backend/ws_envelope.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_envelope.js +8 -0
- package/dist/testing/cross_backend/ws_round_trip.js +1 -1
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +1 -1
- package/dist/testing/integration.js +2 -2
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/integration_helpers.js +2 -2
- package/dist/testing/middleware.d.ts.map +1 -1
- package/dist/testing/middleware.js +2 -2
- package/dist/testing/rpc_attack_surface.js +1 -1
- package/dist/testing/rpc_envelope_cases.d.ts +10 -3
- package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
- package/dist/testing/rpc_envelope_cases.js +22 -1
- package/dist/testing/rpc_helpers.d.ts +12 -14
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +9 -10
- package/dist/testing/schema_generators.d.ts +67 -60
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +154 -159
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +2 -2
- package/dist/testing/surface_invariants.d.ts +1 -1
- package/dist/testing/surface_invariants.js +1 -1
- package/dist/ui/form_state.svelte.d.ts +1 -1
- package/dist/ui/form_state.svelte.js +1 -1
- package/package.json +5 -7
- package/dist/zod.d.ts +0 -116
- package/dist/zod.d.ts.map +0 -1
- package/dist/zod.js +0 -218
- package/dist/zod_schemas.d.ts +0 -100
- package/dist/zod_schemas.d.ts.map +0 -1
- package/dist/zod_schemas.js +0 -157
package/dist/actions/CLAUDE.md
CHANGED
|
@@ -17,9 +17,8 @@ ordering see the root ../../../CLAUDE.md §Action Spec System (SAES) and
|
|
|
17
17
|
to the code. This file documents the cross-cutting invariants and the
|
|
18
18
|
shapes that span multiple files.
|
|
19
19
|
|
|
20
|
-
Every exported
|
|
21
|
-
|
|
22
|
-
the pair invariant.
|
|
20
|
+
Every exported schema is a `@fuzdev/fuz_schema` schema paired with a
|
|
21
|
+
same-named `Infer` type export. New schemas keep the pair invariant.
|
|
23
22
|
|
|
24
23
|
## Action specs (`actions/action_spec.ts`)
|
|
25
24
|
|
|
@@ -27,14 +26,14 @@ Canonical source of truth. Specs are plain objects typed by TS interfaces
|
|
|
27
26
|
(`ActionSpec` and its three kinds, `ActionSpecUnion`), written with
|
|
28
27
|
`satisfies` so their literals survive; nothing parses a spec at runtime, so
|
|
29
28
|
every required field is spelled — no defaults. `input` / `output` are a
|
|
30
|
-
|
|
29
|
+
`@fuzdev/fuz_schema` schema (`AnySchema`). `ActionKind`,
|
|
31
30
|
`ActionInitiator` and `ActionEventPhase` are fuz_schema `one_of`s
|
|
32
31
|
(`ActionEventData` validates with them), built from the const lists `ACTION_KINDS`,
|
|
33
32
|
`ACTION_INITIATORS` and `ACTION_EVENT_PHASES`; `is_action_spec` reads
|
|
34
33
|
`ACTION_KINDS`. Three concrete kinds discriminate on `kind`:
|
|
35
34
|
|
|
36
35
|
- `request_response` — `auth: RouteAuth` (non-null), `side_effects` arbitrary, `output` arbitrary, `async: true`.
|
|
37
|
-
- `remote_notification` — `auth: null`, `side_effects: true`, `output`
|
|
36
|
+
- `remote_notification` — `auth: null`, `side_effects: true`, `output` fuz_schema's void schema, `s.void`, `async: true`.
|
|
38
37
|
- `local_call` — `auth: null`, `side_effects` arbitrary, `output` arbitrary, `async` boolean.
|
|
39
38
|
|
|
40
39
|
`RouteAuth` is the flat record
|
|
@@ -88,12 +87,12 @@ non-`remote_notification` kind.
|
|
|
88
87
|
`create_rpc_endpoint` and `register_action_ws`. Validates these checks in
|
|
89
88
|
order and returns the `Map<method, RpcAction>` the dispatchers use:
|
|
90
89
|
|
|
91
|
-
- **Schema slots** — `input` and `output` each hold a
|
|
90
|
+
- **Schema slots** — `input` and `output` each hold a fuz_schema schema (via `assert_validation_schema`, `schema_issues.ts`), on every spec; a value that is no schema throws naming the action and the slot.
|
|
92
91
|
- **Auth-shape cross-axis invariants** — roles imply a required actor, no accountless actor, nothing to gate on unrestricted auth (via `assert_route_auth_invariants`).
|
|
93
92
|
- **Auth-shape biconditional** — `actor !== 'none' ⟺ input declares acting?: ActingActor` (via `assert_route_auth_acting_biconditional`).
|
|
94
93
|
- **No `auth.required_scope`** — the slot is route-spec-only; nothing mounts a guard from it on an action, so declaring it would be a control that silently does nothing. Narrowed tokens are gated per method by the scope check in `perform_action`, which derives the `rpc:<method>` capability from `spec.method` rather than trusting a hand-written one.
|
|
95
94
|
- **Rate-limit account axis** — `rate_limit: 'account' | 'both'` requires `auth.account === 'required'`.
|
|
96
|
-
- **JSON-RPC §4.2 wire validity** — `request_response` specs with a handler may not use a null schema (`
|
|
95
|
+
- **JSON-RPC §4.2 wire validity** — `request_response` specs with a handler may not use a null schema (`literal(null)`) for input (use a void schema, `s.void`, for nullary), nor a void schema for output (a response always carries a `result`, which clients validate against `spec.output`; use a null schema when there's nothing to return). Both are detected by shape (`is_null_schema` / `is_void_schema`), so a `meta` copy counts.
|
|
97
96
|
- **Unique method names** across the array.
|
|
98
97
|
|
|
99
98
|
Only `request_response` specs with a handler reach the dispatch map;
|
|
@@ -138,11 +137,11 @@ and options on each function's TSDoc.
|
|
|
138
137
|
- `get_executor_phases(spec, executor)` — phases an executor participates in for the spec.
|
|
139
138
|
- `get_handler_return_type` — TS type a phase handler must return; side-effect imports `ActionOutputs`.
|
|
140
139
|
- `generate_phase_handlers` — per-action typed handler-map fragment.
|
|
141
|
-
- `generate_frontend_actions_api` — typed `FrontendActionsApi` interface. A void or null input
|
|
142
|
-
- `generate_action_method_enums` — up to nine `@fuzdev/fuz_schema` `one_of` + `Infer` pairs, importing `{one_of, type Infer}` from `@fuzdev/fuz_schema/schema.ts`; a const's `def` is its method array
|
|
140
|
+
- `generate_frontend_actions_api` — typed `FrontendActionsApi` interface. A void or null input (`is_void_schema`, `is_null_schema`) emits `input?: void`; otherwise each method's `input?:` follows `action_input_is_optional` (by `parse`) — the schema accepts `undefined`, or accepts `{}` and is not marked `meta(…, {empty_input_handler_guarded: true})` (read by `is_empty_input_handler_guarded` in `schema_meta.ts` — set on `cell_get`, `cell_field_list` and `cell_item_list`, whose `{}` reaches a handler guard that refuses it with a declared reason, so their input stays required; a consumer marks its own the same way); an input-shape invariant test reads the same rule. Each input is typed `ActionCallInputs[method]`, the schema's input type — what a caller passes before the parse, so a `with_default` field is optional at the call.
|
|
141
|
+
- `generate_action_method_enums` — up to nine `@fuzdev/fuz_schema` `one_of` + `Infer` pairs, importing `{one_of, type Infer}` from `@fuzdev/fuz_schema/schema.ts`; a const's `def` is its method array.
|
|
143
142
|
- `generate_typed_action_event_alias` — fixed-shape `TypedActionEvent<TMethod, TPhase, TStep>` alias.
|
|
144
143
|
- `generate_action_specs_record` — `ActionSpecs` runtime const + type + `action_specs` array. The const is annotated with the type (`readonly` members), so a consumer's declaration emit names the type instead of writing every spec's schema types out, which past enough specs is TS7056. The type is an alias, not an interface: an alias has an implicit index signature, so `Object.values(ActionSpecs)` stays typed and `action_specs` checks each spec against `ActionSpecUnion` (over an interface it is `any[]`).
|
|
145
|
-
- `generate_action_inputs_outputs` — `ActionInputs`
|
|
144
|
+
- `generate_action_inputs_outputs` — the `ActionInputs`, `ActionCallInputs` and `ActionOutputs` interfaces, types only (a const's inferred type would be written out whole in a declaration file, TS7056 past enough specs; the schemas are read off `ActionSpecs`), importing `Infer` and `InferInput`; a value that is no schema throws naming the method. The two sides of a call see one input schema differently, so its types split by side: `ActionInputs` is each input's output type (`Infer<typeof …>`) — the parsed value a handler, an action event (`ActionEventDatas`) or a notification receiver reads, defaults filled and transforms applied; `ActionCallInputs` is its input type (`InferInput<typeof …>`) — what a caller passes, which the call surfaces (`FrontendActionsApi`, `BackendActionsApi`) take, so a `with_default` field is optional there and required in `ActionInputs`. `ActionOutputs` is each output's output type, what a caller receives.
|
|
146
145
|
- `generate_action_event_datas` — `ActionEventDatas` interface; per-spec variants.
|
|
147
146
|
- `generate_frontend_action_handlers` — `FrontendActionHandlers` interface (Tier 2 only).
|
|
148
147
|
- `generate_backend_actions_api` — `BackendActionsApi` interface + `broadcast_action_specs` array.
|
|
@@ -206,7 +205,7 @@ spines, and an authorized one is `invalid_params`.
|
|
|
206
205
|
|
|
207
206
|
Shim responsibilities (per-request):
|
|
208
207
|
|
|
209
|
-
1. Parse envelope (POST body / GET query string); parse errors → `parse_error` 400
|
|
208
|
+
1. Parse envelope (POST body / GET query string, each through `parse_json_text`, `http/json_text.ts`, so JSON the Rust spine refuses is refused here too); parse errors → `parse_error` 400, a `GET` `params` that is no JSON `invalid_params`. GET reads `method` / `id` / `params` via Hono's `c.req.query()` — first occurrence wins on a duplicated key, unknown keys are ignored, and an empty value counts as missing. This is the cross-impl contract (the Rust GET dispatch mirrors it via `fuz_http`'s `query_first`, including the id numeric-vs-string normalization), pinned by the `query_shape` cross suite.
|
|
210
209
|
2. Lookup method in the `compile_action_registry`-built map; unknown → `method_not_found`.
|
|
211
210
|
3. GET read restriction — GET rejected for `side_effects: true` actions. Every response the GET handler writes, its refusals included, carries `Cache-Control: no-store` (`RPC_GET_CACHE_CONTROL`; a pre-handler middleware refusal, like the origin 403, does not): a read answers one caller at one moment.
|
|
212
211
|
4. Build `PerformActionInput` from `get_resolved_auth(c)` + `get_client_ip` + `c.req.raw.signal`. Test-preset escape hatch reads `has_test_context_preset(c)` + `REQUEST_CONTEXT_KEY`.
|
|
@@ -260,9 +259,8 @@ interface RpcAction {
|
|
|
260
259
|
### `rpc_action(spec, handler)` — typed binder
|
|
261
260
|
|
|
262
261
|
`rpc_action<TSpec extends RequestResponseActionSpec>(spec, handler)` pins
|
|
263
|
-
the handler's input / output types to `
|
|
264
|
-
`
|
|
265
|
-
or Zod's `z.output`, per spec) and tightens `ctx.auth` per the conditional
|
|
262
|
+
the handler's input / output types to `Infer<TSpec['input']>` /
|
|
263
|
+
`Infer<TSpec['output']>` and tightens `ctx.auth` per the conditional
|
|
266
264
|
`HandlerForSpec<TSpec>`:
|
|
267
265
|
|
|
268
266
|
- `auth.actor === 'required'` → `ctx.auth: RequestActorContext`.
|
|
@@ -294,7 +292,7 @@ Pipeline (401 → authz → 403 → 429 → 400 → handler):
|
|
|
294
292
|
2. Authorization phase — `apply_authorization_phase` against `account_id` + `read_acting(auth, raw_params)`, which takes the selector off the raw params (malformed reads as omitted) since validation runs later. Test escape hatch via `preset.request_context`
|
|
295
293
|
3. Post-authorization auth (403) — credential-type gate, then token scope, then role
|
|
296
294
|
4. Rate limit (429) — throttle-requests semantics, ahead of validation so malformed params charge the budget and a throttled caller pays no schema work
|
|
297
|
-
5. Validate params (400) — first, object params holding an own `__proto__` key at any depth are refused on every input with `data.reason` `params_proto_key` (`json_has_own_proto_key` in `http/schema_helpers.ts`, an iterative walk; `ERROR_PARAMS_PROTO_KEY`; the Rust twin walks after its params-shape check, so a non-object `params` stays the schema's reasonless refusal); then `spec.input` parses them (`
|
|
295
|
+
5. Validate params (400) — first, object params holding an own `__proto__` key at any depth are refused on every input with `data.reason` `params_proto_key` (`json_has_own_proto_key` in `http/schema_helpers.ts`, an iterative walk; `ERROR_PARAMS_PROTO_KEY`; the Rust twin walks after its params-shape check, so a non-object `params` stays the schema's reasonless refusal); then `spec.input` parses them (`parse`) with void / `?? {}` rules; a void input (`is_void_schema`: `s.void`) reads absent, `null` (GET `?params=null`), and `{}` alike as the no-arg call (`to_input_params` in `http/schema_helpers.ts`, via `to_void_params`, the twin of the Rust `require_void_params`; the peer receive path in `ActionDispatcher` runs the same normalizer) and refuses any other shape. A refusal is `to_invalid_params_error`: the generic `invalid params`, `data.reason` when the first issue's field declares an `invalid_reason` in its `meta` and no issue sits on the input itself, such as an unknown key (`resolve_issues_invalid_reason`, `schema_meta.ts` — see ../../../docs/architecture.md §Error Schema System), and the issues DEV-only, as `WireIssue`s (`to_wire_issues`)
|
|
298
296
|
6. Dispatch + DEV output validation + error normalization — `spec.side_effects` picks transaction vs pool. `ThrownJsonrpcError` preserves code + data; generic throws become `internal_error`
|
|
299
297
|
|
|
300
298
|
`PerformActionInput` carries `auth` (the request's `ResolvedAuth`, `null` for
|
|
@@ -320,7 +318,7 @@ validation and produces the **same failure mode** as REST routes'
|
|
|
320
318
|
`wrap_output_validation` (`http/route_spec.ts`) — log an error, return
|
|
321
319
|
the response unchanged, do not throw, do not mutate status.
|
|
322
320
|
|
|
323
|
-
- HTTP RPC + WebSocket dispatch — `actions/perform_action.ts` `if (DEV) spec.output
|
|
321
|
+
- HTTP RPC + WebSocket dispatch — `actions/perform_action.ts` `if (DEV) parse(spec.output, output)` inside the shared dispatch core. Production hot path short-circuits (no parse).
|
|
324
322
|
|
|
325
323
|
Caller-facing `input` schemas are validated **always** (DEV + production)
|
|
326
324
|
— they're the contract with external callers. Server-authored `output`
|
|
@@ -870,7 +868,7 @@ the duplicate-id and overflow wire strings, and the `on_socket_open` /
|
|
|
870
868
|
Per-message dispatch delegates to `perform_action` — the shared core that
|
|
871
869
|
HTTP RPC also calls. The socket session owns only WS-specific concerns:
|
|
872
870
|
|
|
873
|
-
- **Wire envelope parsing** —
|
|
871
|
+
- **Wire envelope parsing** — `parse_json_text` (`http/json_text.ts`: what the Rust spine's `serde_json` refuses is a `parse_error` here too) → batch rejection → `classify_jsonrpc_message` (`http/jsonrpc_helpers.ts`, the twin of the Rust `fuz_http::classify`, the same classifier the HTTP POST path runs) → per-arm handling: an `invalid` answers its error on its id; a `response` routes to the socket's pending peer request; a `notification` routes `cancel` and is otherwise dropped; a `request` goes on to the duplicate-id and in-flight checks and dispatch. The classifier runs the twin's order — version, then the `method` axis, then `id`, then the `JsonrpcRequest` envelope — so `{method: 'x'}` and `{jsonrpc: '1.0', method: 'x'}` answer `invalid_request` rather than being dropped as notifications; a response is the twin's shape exactly (no string `method`, a string/number `id`, exactly one of `result` / `error`), so a hybrid like `{method, id, result}` stays a dispatchable request; and `params: null`, an array `params`, or a non-string/number `id` answers `invalid_request` (-32600) on both transports rather than reaching the dispatcher as `invalid_params`. Notifications stay unvalidated (they carry no id to echo). A non-object frame answers `id: null`. POST answers a notification or a response `invalid_request` on `id: null`, as the Rust spine does.
|
|
874
872
|
- **Cancel-notification interception** — `{request_id → AbortController}` map; aborts the matching pending controller before the cancel bubbles past the dispatcher
|
|
875
873
|
- **Duplicate live ids refused** — a request whose id names a request still running on the socket is answered `invalid_request` with `data.reason` `ERROR_DUPLICATE_REQUEST_ID` and not dispatched; the running request keeps its controller, its cancel entry, and its reply id. An id is free again once its request is answered. Same refusal on the Rust spine
|
|
876
874
|
- **In-flight ceiling** — at most `MAX_INBOUND_DISPATCHES_PER_CONNECTION` (128) requests run at once per socket (`@hono/node-ws` does not await `onMessage`, so nothing else bounds them); one more is answered `queue_overflow` (`WS_INBOUND_DISPATCH_OVERFLOW_MESSAGE`) and not dispatched, and the socket stays open and keeps reading — a reply to a server-initiated request still gets through. The duplicate check runs first; neither refusal reaches `perform_action`, so neither charges the action rate limiters. Same cap, message, and order as the Rust spine's `MAX_INBOUND_DISPATCHES_PER_CONNECTION`
|
|
@@ -1091,7 +1089,7 @@ high-level shapes that span modules:
|
|
|
1091
1089
|
- **Discriminated union** — `ActionEventDataUnion<TMethod, TInput, TOutput>` across `kind` + `phase` + `step`, a variant per lifecycle point of each kind. Narrows `input` / `output` / `error` / `request` / `response` / `notification` / `progress` at each lifecycle point.
|
|
1092
1090
|
- **Step transitions** — `initial → parsed | failed`, `parsed → handling | failed`, `handling → handled | failed`, `handled`/`failed` terminal. `validate_step_transition(from, to)` throws on illegal moves.
|
|
1093
1091
|
- **Phase transitions** — chained: `send_request → receive_response`, `receive_request → send_response`; everything else terminal. `validate_phase_transition` enforces.
|
|
1094
|
-
- **`ActionEvent.parse()`** — `initial → parsed` via `
|
|
1092
|
+
- **`ActionEvent.parse()`** — `initial → parsed` via `parse(spec.input, …)`. Input validation failures **fail immediately** without routing through an error phase (client-side programming errors, not runtime conditions with handlers); their `invalid_params` `data` is `{validation_errors, reason?}`, `reason` the declared `invalid_reason` the server would answer. Handler errors DO route through `send_error` / `receive_error`. On `receive_response` with error response, transitions to `receive_error` instead of failing; a success response's `result` is validated against `spec.output` (always, not DEV-only — it's inbound data; undeclared keys are dropped rather than refused, so an older client survives an added response field) and `output` becomes the parsed value, or the event moves to `receive_error` with an `internal_error` carrying `data: {reason: ERROR_RESPONSE_OUTPUT_INVALID, validation_errors}` — a remote contract break, deliberately distinct from the `invalid_params` / `validation_error` of bad caller input.
|
|
1095
1093
|
- **Handler throws** — `ThrownJsonrpcError` keeps code/message/data; any other throw becomes `internal_error` carrying the thrown message. When the error answers a remote caller (`receive_request` / `send_response`), the raw message goes through `dev_only` like the server dispatch core.
|
|
1096
1094
|
- **Protocol message creation is automatic** — transitioning `parsed → handling` on `send_request` materializes the outgoing `JsonrpcRequest` with a fresh `create_uuid()` id; on `send` (notification) it materializes the `JsonrpcNotification`.
|
|
1097
1095
|
|
|
@@ -1105,7 +1103,7 @@ methods) go to `environment.log`; unset falls back to `console_action_log`
|
|
|
1105
1103
|
(warn/error to `console`, debug dropped) so failures are never silent, and
|
|
1106
1104
|
`log: null` opts out (`resolve_action_log`). An inbound request or notification
|
|
1107
1105
|
reads its params through the server dispatch core's normalizer
|
|
1108
|
-
(`to_input_params`): for a void input (`
|
|
1106
|
+
(`to_input_params`): for a void input (`s.void`),
|
|
1109
1107
|
absent, `null`, and `{}` alike are the no-arg call; for any other input,
|
|
1110
1108
|
absent or `null` params are `{}` (so an all-optional object input accepts a
|
|
1111
1109
|
call that omits them).
|
|
@@ -1258,8 +1256,8 @@ specs. Counterpart to `register_action_ws`: that handles frontend-initiated
|
|
|
1258
1256
|
request-scoped dispatch, this handles backend-initiated broadcast.
|
|
1259
1257
|
Request-scoped streaming stays on `ctx.notify` inside a handler.
|
|
1260
1258
|
|
|
1261
|
-
Per-method call: validates input against `spec.input
|
|
1262
|
-
(`
|
|
1259
|
+
Per-method call: validates input against `spec.input`
|
|
1260
|
+
(`parse`; logs + returns on failure), wraps in `JsonrpcNotification`, and sends it on `registry` — a
|
|
1263
1261
|
`BroadcastTarget`, `Pick<ConnectionRegistry, 'broadcast' |
|
|
1264
1262
|
'broadcast_filtered'>`, typically `app_server.ws_endpoints[path]` or the
|
|
1265
1263
|
registry a `WsEndpointSpec` supplies. No `Transports` collection and no fallback:
|
|
@@ -120,14 +120,12 @@ export declare const generate_phase_handlers: (spec: ActionSpecUnion, executor:
|
|
|
120
120
|
/**
|
|
121
121
|
* Whether a caller may omit an action's input: its schema accepts `undefined`,
|
|
122
122
|
* or accepts `{}` (what an omitted input is validated as) and is not marked
|
|
123
|
-
* `empty_input_handler_guarded` (
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* `@fuzdev/fuz_schema` schema, parsed with `parse_any`.
|
|
123
|
+
* `empty_input_handler_guarded` (read by `is_empty_input_handler_guarded`).
|
|
124
|
+
* The rule codegen emits `input?:` by and the input-shape invariant tests
|
|
125
|
+
* read, parsed with `parse`.
|
|
127
126
|
*
|
|
128
127
|
* @param spec - the action spec
|
|
129
128
|
* @returns whether the typed surface makes the input optional
|
|
130
|
-
* @throws Error when the input is neither a Zod nor a fuz_schema schema
|
|
131
129
|
*/
|
|
132
130
|
export declare const action_input_is_optional: (spec: Pick<ActionSpecUnion, "input">) => boolean;
|
|
133
131
|
/** Discriminator for `generate_action_method_enums` — which method-set enums to emit. */
|
|
@@ -139,8 +137,7 @@ export type ActionMethodEnumKind = 'all' | 'request_response' | 'remote_notifica
|
|
|
139
137
|
* `LocalCallActionMethod`, `FrontendActionMethod`, `BackendActionMethod`,
|
|
140
138
|
* `FrontendRequestResponseMethod`, `BackendRequestResponseMethod`,
|
|
141
139
|
* `BroadcastActionMethod`. Pairs each runtime const with an `Infer` type
|
|
142
|
-
* alias under the same identifier. A const's `def` is its array of methods
|
|
143
|
-
* a Zod schema that holds one takes `z.enum(ActionMethod.def)`.
|
|
140
|
+
* alias under the same identifier. A const's `def` is its array of methods.
|
|
144
141
|
*
|
|
145
142
|
* Protocol-action methods (`heartbeat`, `cancel`) are filtered out by
|
|
146
143
|
* default — pass `include_protocol_actions: true` if a consumer genuinely
|
|
@@ -201,22 +198,34 @@ export declare const generate_action_specs_record: (specs: ReadonlyArray<ActionS
|
|
|
201
198
|
include_protocol_actions?: boolean;
|
|
202
199
|
}) => string;
|
|
203
200
|
/**
|
|
204
|
-
* Emit `ActionInputs`
|
|
205
|
-
*
|
|
206
|
-
* `.output
|
|
207
|
-
*
|
|
201
|
+
* Emit the `ActionInputs`, `ActionCallInputs` and `ActionOutputs`
|
|
202
|
+
* interfaces, each member a type over `specs.{method}_action_spec.input` /
|
|
203
|
+
* `.output`. Types only: the schemas are read off the specs themselves
|
|
204
|
+
* (`ActionSpecs`), and a type reference stays a reference in a declaration
|
|
205
|
+
* file, where an unannotated const's inferred type is written out whole.
|
|
208
206
|
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
207
|
+
* The two sides of a call see different types for one input schema, so the
|
|
208
|
+
* interfaces split by side:
|
|
209
|
+
*
|
|
210
|
+
* - `ActionInputs` types each input as its schema's output (`Infer`) — the
|
|
211
|
+
* parsed value a handler, an action event, or a notification receiver reads,
|
|
212
|
+
* with defaults filled and transforms applied.
|
|
213
|
+
* - `ActionCallInputs` types each input as its schema's input (`InferInput`)
|
|
214
|
+
* — what a caller passes, before the parse: a `with_default` field is
|
|
215
|
+
* optional there and required in `ActionInputs`. The call surfaces
|
|
216
|
+
* (`FrontendActionsApi`, `BackendActionsApi`) read it.
|
|
217
|
+
* - `ActionOutputs` types each output as its schema's output, what a caller
|
|
218
|
+
* receives.
|
|
219
|
+
*
|
|
220
|
+
* Adds `import type {Infer, InferInput} from '@fuzdev/fuz_schema/schema.ts';`
|
|
221
|
+
* and the `* as specs` namespace import.
|
|
212
222
|
*
|
|
213
223
|
* @param options.qualify_spec - per-spec qualified identifier callback for
|
|
214
224
|
* multi-source consumers. The helper appends `.input` / `.output` to the
|
|
215
225
|
* callback's return value. When set, the helper skips the default
|
|
216
226
|
* `* as specs` import — the consumer manages its own namespace imports —
|
|
217
227
|
* and `specs_module` is ignored. Single-source consumers omit it.
|
|
218
|
-
* @throws Error naming the method when an input or output is
|
|
219
|
-
* nor a fuz_schema schema
|
|
228
|
+
* @throws Error naming the method when an input or output is no schema
|
|
220
229
|
*/
|
|
221
230
|
export declare const generate_action_inputs_outputs: (specs: ReadonlyArray<ActionSpecUnion>, imports: ImportBuilder, options?: {
|
|
222
231
|
specs_module?: string;
|
|
@@ -256,7 +265,7 @@ export declare const generate_action_event_datas: (specs: ReadonlyArray<ActionSp
|
|
|
256
265
|
*
|
|
257
266
|
* Imports are registered per emitted line — only what the spec set actually references shows up on
|
|
258
267
|
* `imports`. A spec set with no async methods skips `RpcClientCallOptions`;
|
|
259
|
-
* one with no inputs skips `
|
|
268
|
+
* one with no inputs skips `ActionCallInputs`; sync `local_call` methods with
|
|
260
269
|
* `sync_returns_value: true` (the default) skip `Result` / `JsonrpcErrorObject`.
|
|
261
270
|
*
|
|
262
271
|
* The interface name is fixed at `FrontendActionsApi` — the symmetric counterpart
|
|
@@ -297,7 +306,7 @@ export declare const generate_frontend_action_handlers: (specs: ReadonlyArray<Ac
|
|
|
297
306
|
* exclusion list.
|
|
298
307
|
*
|
|
299
308
|
* Adds the `* as specs` namespace import (from `specs_module`), the
|
|
300
|
-
* `
|
|
309
|
+
* `ActionCallInputs` type import (from `collections_path`), and the
|
|
301
310
|
* `ActionSpecUnion` type import.
|
|
302
311
|
*
|
|
303
312
|
* Method signature shape today is `(input) => Promise<void>` — matches the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action_codegen.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/action_codegen.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAG1E;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,+CAAgD,CAAC;AAErF,8FAA8F;AAC9F,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAI5E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,GAAI,QAAQ,MAAM,KAAG,MAAM,IAAI,oBACrC,CAAC;AAEjC,UAAU,UAAU;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,aAAa;;IACzB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAa;IAE1D;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAQrC;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAI1C,QAAQ,CAAC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YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,MAAM,CAAC;IACjD,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACnC,KACC,MA2CF,CAAC;AAMF;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,0BAA0B,GACtC,SAAS,aAAa,CAAC,UAAU,CAAC,EAClC,SAAS,aAAa,KACpB;IACF,YAAY,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,MAAM,CAAC;IAChD,SAAS,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CAiC1C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC9B,KAAG,MAYH,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UnreachableError } from '@fuzdev/fuz_util/error.ts';
|
|
2
|
-
import {
|
|
2
|
+
import { parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
3
3
|
import { is_empty_input_handler_guarded } from '../schema_meta.js';
|
|
4
4
|
import { is_null_schema, is_void_schema } from '../http/schema_helpers.js';
|
|
5
|
-
import {
|
|
5
|
+
import { assert_validation_schema } from '../schema_issues.js';
|
|
6
6
|
import { ActionRegistry } from './action_registry.js';
|
|
7
7
|
/**
|
|
8
8
|
* Method names of fuz_app's protocol actions — `heartbeat` (auth-aware client
|
|
@@ -323,35 +323,29 @@ const to_action_property_key = (method) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(met
|
|
|
323
323
|
/**
|
|
324
324
|
* Whether a caller may omit an action's input: its schema accepts `undefined`,
|
|
325
325
|
* or accepts `{}` (what an omitted input is validated as) and is not marked
|
|
326
|
-
* `empty_input_handler_guarded` (
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
* `@fuzdev/fuz_schema` schema, parsed with `parse_any`.
|
|
326
|
+
* `empty_input_handler_guarded` (read by `is_empty_input_handler_guarded`).
|
|
327
|
+
* The rule codegen emits `input?:` by and the input-shape invariant tests
|
|
328
|
+
* read, parsed with `parse`.
|
|
330
329
|
*
|
|
331
330
|
* @param spec - the action spec
|
|
332
331
|
* @returns whether the typed surface makes the input optional
|
|
333
|
-
* @throws Error when the input is neither a Zod nor a fuz_schema schema
|
|
334
332
|
*/
|
|
335
333
|
export const action_input_is_optional = (spec) => {
|
|
336
|
-
if (
|
|
334
|
+
if (parse(spec.input, undefined).ok)
|
|
337
335
|
return true;
|
|
338
336
|
if (is_empty_input_handler_guarded(spec.input))
|
|
339
337
|
return false;
|
|
340
|
-
return
|
|
338
|
+
return parse(spec.input, {}).ok;
|
|
341
339
|
};
|
|
342
340
|
/**
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
341
|
+
* Throw unless a spec's input or output is a `@fuzdev/fuz_schema` schema,
|
|
342
|
+
* naming the method and the slot — codegen reads specs nothing has
|
|
343
|
+
* registered, so it checks them itself.
|
|
346
344
|
*
|
|
347
|
-
* @throws Error naming the method and the
|
|
345
|
+
* @throws Error naming the method and the slot when it is no schema
|
|
348
346
|
*/
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
if (is_schema(schema))
|
|
352
|
-
return 'fuz_schema';
|
|
353
|
-
assert_zod_schema(schema, `action '${spec.method}' ${which}`);
|
|
354
|
-
return 'zod';
|
|
347
|
+
const assert_spec_schema = (spec, which) => {
|
|
348
|
+
assert_validation_schema(spec[which], `action '${spec.method}' ${which}`);
|
|
355
349
|
};
|
|
356
350
|
/**
|
|
357
351
|
* Generates one method line of the typed `FrontendActionsApi` interface for a
|
|
@@ -370,8 +364,12 @@ const to_spec_schema_library = (spec, which) => {
|
|
|
370
364
|
* failure). Earlier emit shapes declared notifications as `=> void` —
|
|
371
365
|
* regenerate consumer typed clients to pick up the corrected return.
|
|
372
366
|
*
|
|
367
|
+
* The input is typed by `ActionCallInputs` — the schema's input type, what
|
|
368
|
+
* the caller passes before the parse — so a defaulted field is optional at the
|
|
369
|
+
* call while the handler reads it filled in (`ActionInputs`).
|
|
370
|
+
*
|
|
373
371
|
* Registers exactly the imports the emitted line references on `imports`:
|
|
374
|
-
* `
|
|
372
|
+
* `ActionCallInputs` (when the spec has input), `ActionOutputs` (always),
|
|
375
373
|
* `RpcClientCallOptions` (async only), and `Result` + `JsonrpcErrorObject`
|
|
376
374
|
* (any return shape that wraps the value in `Result<{value}, {error}>` —
|
|
377
375
|
* every async method, plus sync `local_call` when `sync_returns_value:
|
|
@@ -381,46 +379,43 @@ const to_spec_schema_library = (spec, which) => {
|
|
|
381
379
|
*
|
|
382
380
|
* **Optional-input detection.** The emitted parameter is `input?:` (caller
|
|
383
381
|
* may omit the argument) when either (a) the schema accepts `undefined` —
|
|
384
|
-
* `
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
* non-`z.void()` schemas in `actions/action_rpc.ts` / `http/route_spec.ts`):
|
|
382
|
+
* `optional(object(...))` and similar wrappers — or (b) the schema accepts
|
|
383
|
+
* the empty object `{}` — `object({acting: ActingActor})` and other
|
|
384
|
+
* all-optional-fields strict objects. The second probe mirrors the
|
|
385
|
+
* dispatcher's HTTP convention (`raw_params ?? {}` for non-void schemas in `actions/action_rpc.ts` / `http/route_spec.ts`):
|
|
389
386
|
* if a request with no params reaches the handler, this is the value the
|
|
390
387
|
* schema is asked to validate. A schema with required fields fails both
|
|
391
|
-
* probes and stays `input:` (required at the typed surface).
|
|
392
|
-
*
|
|
388
|
+
* probes and stays `input:` (required at the typed surface). Checks and
|
|
389
|
+
* transforms run as part of the parse (`parse`), so their accept/reject
|
|
393
390
|
* decisions feed into the optional/required choice naturally. An input
|
|
394
391
|
* marked `empty_input_handler_guarded` is the exception: its schema accepts
|
|
395
392
|
* `{}` but the handler refuses it, so it stays `input:`
|
|
396
393
|
* (`action_input_is_optional` is the one rule).
|
|
397
394
|
*
|
|
398
|
-
* **No-input detection.** A void or null input — `
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
* and no `ActionInputs` import.
|
|
395
|
+
* **No-input detection.** A void or null input — `literal(undefined)`
|
|
396
|
+
* (`s.void`) or `literal(null)`, read by shape (`is_void_schema`, `is_null_schema`) — emits `input?: void`
|
|
397
|
+
* and no `ActionCallInputs` import.
|
|
402
398
|
*
|
|
403
399
|
* @param options.sync_returns_value - When true (default), sync `local_call`
|
|
404
400
|
* methods return the output value directly; when false they're wrapped in
|
|
405
401
|
* `Result<{value, error}>` like async methods. Set to `false` if your
|
|
406
402
|
* `FrontendActionsApi` treats every method uniformly.
|
|
407
|
-
* @param options.collections_path - Import path that `
|
|
403
|
+
* @param options.collections_path - Import path that `ActionCallInputs` /
|
|
408
404
|
* `ActionOutputs` resolve to. Defaults to `'./action_collections.ts'`.
|
|
409
|
-
* @returns one line like `foo: (input:
|
|
410
|
-
* @throws Error naming the method when the input is
|
|
411
|
-
* fuz_schema schema
|
|
405
|
+
* @returns one line like `foo: (input: ActionCallInputs['foo'], options?: RpcClientCallOptions) => Promise<Result<...>>;`
|
|
406
|
+
* @throws Error naming the method when the input is no schema
|
|
412
407
|
*/
|
|
413
408
|
const generate_actions_api_method_signature = (spec, imports, options) => {
|
|
414
409
|
const sync_returns_value = options?.sync_returns_value ?? true;
|
|
415
410
|
const collections_path = options?.collections_path ?? DEFAULT_COLLECTIONS_PATH;
|
|
416
|
-
|
|
411
|
+
assert_spec_schema(spec, 'input');
|
|
417
412
|
const has_input = !is_null_schema(spec.input) && !is_void_schema(spec.input);
|
|
418
413
|
const input_optional = has_input && action_input_is_optional(spec);
|
|
419
414
|
const input_param = has_input
|
|
420
|
-
? `input${input_optional ? '?' : ''}:
|
|
415
|
+
? `input${input_optional ? '?' : ''}: ActionCallInputs['${spec.method}']`
|
|
421
416
|
: 'input?: void';
|
|
422
417
|
if (has_input)
|
|
423
|
-
imports.add_type(collections_path, '
|
|
418
|
+
imports.add_type(collections_path, 'ActionCallInputs');
|
|
424
419
|
imports.add_type(collections_path, 'ActionOutputs');
|
|
425
420
|
const is_async = spec.kind === 'request_response' || spec.kind === 'remote_notification' || spec.async;
|
|
426
421
|
const options_param = is_async ? ', options?: RpcClientCallOptions' : '';
|
|
@@ -523,8 +518,7 @@ const resolve_spec_qualifier = (imports, options) => {
|
|
|
523
518
|
* `LocalCallActionMethod`, `FrontendActionMethod`, `BackendActionMethod`,
|
|
524
519
|
* `FrontendRequestResponseMethod`, `BackendRequestResponseMethod`,
|
|
525
520
|
* `BroadcastActionMethod`. Pairs each runtime const with an `Infer` type
|
|
526
|
-
* alias under the same identifier. A const's `def` is its array of methods
|
|
527
|
-
* a Zod schema that holds one takes `z.enum(ActionMethod.def)`.
|
|
521
|
+
* alias under the same identifier. A const's `def` is its array of methods.
|
|
528
522
|
*
|
|
529
523
|
* Protocol-action methods (`heartbeat`, `cancel`) are filtered out by
|
|
530
524
|
* default — pass `include_protocol_actions: true` if a consumer genuinely
|
|
@@ -656,87 +650,93 @@ ${type_lines}
|
|
|
656
650
|
export const action_specs: Array<ActionSpecUnion> = Object.values(ActionSpecs);`;
|
|
657
651
|
};
|
|
658
652
|
/**
|
|
659
|
-
* Emit `ActionInputs`
|
|
660
|
-
*
|
|
661
|
-
* `.output
|
|
662
|
-
*
|
|
653
|
+
* Emit the `ActionInputs`, `ActionCallInputs` and `ActionOutputs`
|
|
654
|
+
* interfaces, each member a type over `specs.{method}_action_spec.input` /
|
|
655
|
+
* `.output`. Types only: the schemas are read off the specs themselves
|
|
656
|
+
* (`ActionSpecs`), and a type reference stays a reference in a declaration
|
|
657
|
+
* file, where an unannotated const's inferred type is written out whole.
|
|
658
|
+
*
|
|
659
|
+
* The two sides of a call see different types for one input schema, so the
|
|
660
|
+
* interfaces split by side:
|
|
661
|
+
*
|
|
662
|
+
* - `ActionInputs` types each input as its schema's output (`Infer`) — the
|
|
663
|
+
* parsed value a handler, an action event, or a notification receiver reads,
|
|
664
|
+
* with defaults filled and transforms applied.
|
|
665
|
+
* - `ActionCallInputs` types each input as its schema's input (`InferInput`)
|
|
666
|
+
* — what a caller passes, before the parse: a `with_default` field is
|
|
667
|
+
* optional there and required in `ActionInputs`. The call surfaces
|
|
668
|
+
* (`FrontendActionsApi`, `BackendActionsApi`) read it.
|
|
669
|
+
* - `ActionOutputs` types each output as its schema's output, what a caller
|
|
670
|
+
* receives.
|
|
663
671
|
*
|
|
664
|
-
* Adds `import {
|
|
665
|
-
*
|
|
666
|
-
* fuz_schema's, and the `* as specs` namespace import.
|
|
672
|
+
* Adds `import type {Infer, InferInput} from '@fuzdev/fuz_schema/schema.ts';`
|
|
673
|
+
* and the `* as specs` namespace import.
|
|
667
674
|
*
|
|
668
675
|
* @param options.qualify_spec - per-spec qualified identifier callback for
|
|
669
676
|
* multi-source consumers. The helper appends `.input` / `.output` to the
|
|
670
677
|
* callback's return value. When set, the helper skips the default
|
|
671
678
|
* `* as specs` import — the consumer manages its own namespace imports —
|
|
672
679
|
* and `specs_module` is ignored. Single-source consumers omit it.
|
|
673
|
-
* @throws Error naming the method when an input or output is
|
|
674
|
-
* nor a fuz_schema schema
|
|
680
|
+
* @throws Error naming the method when an input or output is no schema
|
|
675
681
|
*/
|
|
676
682
|
export const generate_action_inputs_outputs = (specs, imports, options) => {
|
|
677
683
|
const filtered = filter_protocol_actions(specs, options?.include_protocol_actions);
|
|
678
684
|
if (filtered.length === 0) {
|
|
679
|
-
// Empty spec list — emit minimal valid output and skip the `
|
|
685
|
+
// Empty spec list — emit minimal valid output and skip the `Infer` /
|
|
680
686
|
// `* as specs` imports that would have nothing to reference.
|
|
681
687
|
return `/**
|
|
682
|
-
* Action
|
|
683
|
-
*
|
|
684
|
-
* e.g. JSON-RPC request/notification params and local call arguments.
|
|
688
|
+
* Action inputs indexed by method name, as parsed: each input schema's output
|
|
689
|
+
* type, e.g. JSON-RPC request/notification params and local call arguments.
|
|
685
690
|
*/
|
|
686
|
-
export const ActionInputs = {} as const;
|
|
687
691
|
export interface ActionInputs {}
|
|
688
692
|
|
|
689
693
|
/**
|
|
690
|
-
* Action
|
|
691
|
-
*
|
|
694
|
+
* Action inputs as a caller passes them, indexed by method name:
|
|
695
|
+
* each input schema's input type, before the parse.
|
|
696
|
+
*/
|
|
697
|
+
export interface ActionCallInputs {}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Action outputs indexed by method name: each output schema's output type,
|
|
692
701
|
* e.g. JSON-RPC response results and local call return values.
|
|
693
702
|
*/
|
|
694
|
-
export const ActionOutputs = {} as const;
|
|
695
703
|
export interface ActionOutputs {}`;
|
|
696
704
|
}
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
if (uses('zod'))
|
|
703
|
-
imports.add('zod', 'z');
|
|
704
|
-
if (uses('fuz_schema'))
|
|
705
|
-
imports.add_type('@fuzdev/fuz_schema/schema.ts', 'Infer');
|
|
705
|
+
for (const s of filtered) {
|
|
706
|
+
assert_spec_schema(s, 'input');
|
|
707
|
+
assert_spec_schema(s, 'output');
|
|
708
|
+
}
|
|
709
|
+
imports.add_types('@fuzdev/fuz_schema/schema.ts', 'Infer', 'InferInput');
|
|
706
710
|
const qualify = resolve_spec_qualifier(imports, options);
|
|
707
|
-
const infer = (library) => library === 'zod' ? 'z.infer' : 'Infer';
|
|
708
|
-
const inputs_value = filtered
|
|
709
|
-
.map((s) => `\t${to_action_property_key(s.method)}: ${qualify(s)}.input,`)
|
|
710
|
-
.join('\n');
|
|
711
711
|
const inputs_type = filtered
|
|
712
|
-
.map((s
|
|
712
|
+
.map((s) => `\t${to_action_property_key(s.method)}: Infer<typeof ${qualify(s)}.input>;`)
|
|
713
713
|
.join('\n');
|
|
714
|
-
const
|
|
715
|
-
.map((s) => `\t${to_action_property_key(s.method)}: ${qualify(s)}.
|
|
714
|
+
const call_inputs_type = filtered
|
|
715
|
+
.map((s) => `\t${to_action_property_key(s.method)}: InferInput<typeof ${qualify(s)}.input>;`)
|
|
716
716
|
.join('\n');
|
|
717
717
|
const outputs_type = filtered
|
|
718
|
-
.map((s
|
|
718
|
+
.map((s) => `\t${to_action_property_key(s.method)}: Infer<typeof ${qualify(s)}.output>;`)
|
|
719
719
|
.join('\n');
|
|
720
720
|
return `/**
|
|
721
|
-
* Action
|
|
722
|
-
*
|
|
723
|
-
* e.g. JSON-RPC request/notification params and local call arguments.
|
|
721
|
+
* Action inputs indexed by method name, as parsed: each input schema's output
|
|
722
|
+
* type, e.g. JSON-RPC request/notification params and local call arguments.
|
|
724
723
|
*/
|
|
725
|
-
export const ActionInputs = {
|
|
726
|
-
${inputs_value}
|
|
727
|
-
} as const;
|
|
728
724
|
export interface ActionInputs {
|
|
729
725
|
${inputs_type}
|
|
730
726
|
}
|
|
731
727
|
|
|
732
728
|
/**
|
|
733
|
-
* Action
|
|
734
|
-
*
|
|
729
|
+
* Action inputs as a caller passes them, indexed by method name:
|
|
730
|
+
* each input schema's input type, before the parse.
|
|
731
|
+
*/
|
|
732
|
+
export interface ActionCallInputs {
|
|
733
|
+
${call_inputs_type}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Action outputs indexed by method name: each output schema's output type,
|
|
735
738
|
* e.g. JSON-RPC response results and local call return values.
|
|
736
739
|
*/
|
|
737
|
-
export const ActionOutputs = {
|
|
738
|
-
${outputs_value}
|
|
739
|
-
} as const;
|
|
740
740
|
export interface ActionOutputs {
|
|
741
741
|
${outputs_type}
|
|
742
742
|
}`;
|
|
@@ -807,7 +807,7 @@ ${lines.join('\n')}
|
|
|
807
807
|
*
|
|
808
808
|
* Imports are registered per emitted line — only what the spec set actually references shows up on
|
|
809
809
|
* `imports`. A spec set with no async methods skips `RpcClientCallOptions`;
|
|
810
|
-
* one with no inputs skips `
|
|
810
|
+
* one with no inputs skips `ActionCallInputs`; sync `local_call` methods with
|
|
811
811
|
* `sync_returns_value: true` (the default) skip `Result` / `JsonrpcErrorObject`.
|
|
812
812
|
*
|
|
813
813
|
* The interface name is fixed at `FrontendActionsApi` — the symmetric counterpart
|
|
@@ -897,7 +897,7 @@ ${lines};
|
|
|
897
897
|
* exclusion list.
|
|
898
898
|
*
|
|
899
899
|
* Adds the `* as specs` namespace import (from `specs_module`), the
|
|
900
|
-
* `
|
|
900
|
+
* `ActionCallInputs` type import (from `collections_path`), and the
|
|
901
901
|
* `ActionSpecUnion` type import.
|
|
902
902
|
*
|
|
903
903
|
* Method signature shape today is `(input) => Promise<void>` — matches the
|
|
@@ -927,18 +927,18 @@ export const generate_backend_actions_api = (specs, imports, options) => {
|
|
|
927
927
|
*/`;
|
|
928
928
|
if (broadcast.length === 0) {
|
|
929
929
|
// No backend-initiated remote_notifications — skip `* as specs` and
|
|
930
|
-
// `
|
|
930
|
+
// `ActionCallInputs` imports that would have nothing to reference.
|
|
931
931
|
return `${interface_doc}
|
|
932
932
|
export interface BackendActionsApi {}
|
|
933
933
|
|
|
934
934
|
export const broadcast_action_specs: ReadonlyArray<ActionSpecUnion> = [];`;
|
|
935
935
|
}
|
|
936
936
|
const collections_path = options?.collections_path ?? DEFAULT_COLLECTIONS_PATH;
|
|
937
|
-
imports.add_type(collections_path, '
|
|
937
|
+
imports.add_type(collections_path, 'ActionCallInputs');
|
|
938
938
|
const qualify = resolve_spec_qualifier(imports, options);
|
|
939
939
|
const interface_body = '\n' +
|
|
940
940
|
broadcast
|
|
941
|
-
.map((s) => `\t${to_action_property_key(s.method)}: (input:
|
|
941
|
+
.map((s) => `\t${to_action_property_key(s.method)}: (input: ActionCallInputs['${s.method}']) => Promise<void>;`)
|
|
942
942
|
.join('\n') +
|
|
943
943
|
'\n';
|
|
944
944
|
const array_body = '\n' + broadcast.map((s) => `\t${qualify(s)},`).join('\n') + '\n';
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ActionEvent — state machine for action lifecycle management.
|
|
3
|
-
*
|
|
4
|
-
* Manages an action through its phases (send_request → receive_response, etc.)
|
|
5
|
-
* and steps (initial → parsed → handling → handled/failed).
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
1
|
import type { ActionEventPhase, ActionSpecUnion } from './action_spec.js';
|
|
10
2
|
import type { JsonrpcRequest, JsonrpcResponseOrError, JsonrpcNotification } from '../http/jsonrpc.js';
|
|
11
3
|
import type { ActionEventEnvironment, ActionEventStep } from './action_event_types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action_event.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/action_event.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"action_event.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/action_event.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAc,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAkBtF,OAAO,KAAK,EACX,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,KAAK,EAAmB,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAapF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAG,yBAAkC,CAAC;AAmBhF,MAAM,MAAM,yBAAyB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,IAAI,CACxE,QAAQ,EAAE,oBAAoB,CAAC,OAAO,CAAC,EACvC,QAAQ,EAAE,oB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