@fuzdev/fuz_app 0.48.0 → 0.50.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 +128 -50
- package/dist/actions/action_codegen.d.ts +196 -37
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +297 -59
- package/dist/actions/action_registry.d.ts +41 -9
- package/dist/actions/action_registry.d.ts.map +1 -1
- package/dist/actions/action_registry.js +109 -32
- package/dist/actions/action_types.d.ts +2 -2
- package/dist/actions/action_types.js +2 -2
- package/dist/actions/cancel.d.ts +13 -11
- package/dist/actions/cancel.d.ts.map +1 -1
- package/dist/actions/cancel.js +13 -11
- package/dist/actions/frontend_rpc_client.d.ts +9 -0
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/heartbeat.d.ts +11 -8
- package/dist/actions/heartbeat.d.ts.map +1 -1
- package/dist/actions/heartbeat.js +11 -8
- package/dist/actions/protocol.d.ts +47 -0
- package/dist/actions/protocol.d.ts.map +1 -0
- package/dist/actions/protocol.js +46 -0
- package/dist/actions/register_action_ws.d.ts +4 -3
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +1 -1
- package/dist/auth/account_action_specs.d.ts +1 -1
- package/dist/auth/account_action_specs.js +1 -1
- package/dist/auth/account_actions.d.ts +2 -2
- package/dist/auth/account_actions.js +2 -2
- package/dist/auth/admin_action_specs.d.ts +1 -1
- package/dist/auth/admin_action_specs.js +1 -1
- package/dist/auth/admin_actions.d.ts +2 -2
- package/dist/auth/admin_actions.js +2 -2
- package/dist/auth/permit_offer_action_specs.d.ts +1 -1
- package/dist/auth/permit_offer_action_specs.js +1 -1
- package/dist/auth/permit_offer_actions.d.ts +1 -1
- package/dist/auth/permit_offer_actions.js +1 -1
- package/dist/auth/standard_action_specs.d.ts +1 -1
- package/dist/auth/standard_action_specs.js +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `ActionRegistry` — query and filter utility over `ActionSpecUnion[]`.
|
|
3
3
|
*
|
|
4
|
+
* Vocabulary (set in API review III, see the `docs/` directory and the SAES quest):
|
|
5
|
+
* - `*_handled_*` — request_response specs the named side **receives**
|
|
6
|
+
* (so the named side owns the handler). Used by codegen to emit typed
|
|
7
|
+
* handler maps.
|
|
8
|
+
* - `*_relevant_to_*` — the loose "everything this side might encounter"
|
|
9
|
+
* set, used by the typed-Proxy method enums (`FrontendActionMethod`,
|
|
10
|
+
* `BackendActionMethod`).
|
|
11
|
+
* - `broadcast_*` — kind-narrow `remote_notification` set with the
|
|
12
|
+
* `streams`-target exclusion. Today this matches what the broadcast
|
|
13
|
+
* API exposes.
|
|
14
|
+
* - `backend_initiated_*` — forward-looking kind-agnostic version of the
|
|
15
|
+
* broadcast set. Same content today; will diverge when local_calls or
|
|
16
|
+
* backend `request_response` join the backend's typed surface.
|
|
17
|
+
*
|
|
18
|
+
* Cache discipline: `spec_by_method` (Map) and the internal streams-target
|
|
19
|
+
* set lazy-memoize because the Map is consulted per-RPC dispatch
|
|
20
|
+
* (`frontend_rpc_client.ts` wires it into `lookup_action_spec`) and the
|
|
21
|
+
* streams set is rebuilt by two public getters. Array-returning getters
|
|
22
|
+
* recompute on each call so callers can mutate the result freely
|
|
23
|
+
* (`.sort()`, `.push(injected)` on a copy, etc.) without affecting the
|
|
24
|
+
* registry — codegen is a build-time path where the extra `.filter` /
|
|
25
|
+
* `.map` work is negligible.
|
|
26
|
+
*
|
|
4
27
|
* @module
|
|
5
28
|
*/
|
|
6
|
-
// TODO @action-system-review Many getters below are stub API surface — only
|
|
7
|
-
// `
|
|
8
|
-
// `
|
|
9
|
-
//
|
|
10
|
-
//
|
|
29
|
+
// TODO @action-system-review Many getters below are stub API surface — only
|
|
30
|
+
// `spec_by_method`, `methods`, the kind-narrow `*_specs` (`request_response_specs`,
|
|
31
|
+
// `remote_notification_specs`, `local_call_specs`), the `*_handled_*` pair,
|
|
32
|
+
// the `*_relevant_to_*` pair, and `broadcast_*` / `backend_initiated_*` are
|
|
33
|
+
// used by codegen. The auth + initiator-direction getters are pre-built for
|
|
34
|
+
// future use. Revisit which getters to keep when the action system matures.
|
|
11
35
|
/**
|
|
12
36
|
* Utility class to manage and query action specifications.
|
|
13
37
|
* Provides helper methods to get actions by various criteria.
|
|
@@ -17,9 +41,14 @@ export class ActionRegistry {
|
|
|
17
41
|
constructor(specs) {
|
|
18
42
|
this.specs = specs;
|
|
19
43
|
}
|
|
44
|
+
#spec_by_method;
|
|
20
45
|
get spec_by_method() {
|
|
21
|
-
return new Map(this.specs.map((spec) => [spec.method, spec]));
|
|
46
|
+
return (this.#spec_by_method ??= new Map(this.specs.map((spec) => [spec.method, spec])));
|
|
47
|
+
}
|
|
48
|
+
get methods() {
|
|
49
|
+
return this.specs.map((spec) => spec.method);
|
|
22
50
|
}
|
|
51
|
+
// --- Kind-narrow getters ---
|
|
23
52
|
get request_response_specs() {
|
|
24
53
|
return this.specs.filter((spec) => spec.kind === 'request_response');
|
|
25
54
|
}
|
|
@@ -29,44 +58,73 @@ export class ActionRegistry {
|
|
|
29
58
|
get local_call_specs() {
|
|
30
59
|
return this.specs.filter((spec) => spec.kind === 'local_call');
|
|
31
60
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
get
|
|
61
|
+
get request_response_methods() {
|
|
62
|
+
return this.request_response_specs.map((spec) => spec.method);
|
|
63
|
+
}
|
|
64
|
+
get remote_notification_methods() {
|
|
65
|
+
return this.remote_notification_specs.map((spec) => spec.method);
|
|
66
|
+
}
|
|
67
|
+
get local_call_methods() {
|
|
68
|
+
return this.local_call_specs.map((spec) => spec.method);
|
|
69
|
+
}
|
|
70
|
+
// --- Loose "relevant to side" getters ---
|
|
71
|
+
// Backs the `FrontendActionMethod` / `BackendActionMethod` enums — the
|
|
72
|
+
// typed-Proxy method enums where every spec the side might encounter
|
|
73
|
+
// (call, receive, or execute) belongs in the union.
|
|
74
|
+
get specs_relevant_to_frontend() {
|
|
75
|
+
return this.specs.slice();
|
|
76
|
+
}
|
|
77
|
+
get specs_relevant_to_backend() {
|
|
36
78
|
return this.specs.filter((spec) => spec.kind !== 'local_call');
|
|
37
79
|
}
|
|
38
|
-
get
|
|
39
|
-
return this.
|
|
80
|
+
get methods_relevant_to_frontend() {
|
|
81
|
+
return this.specs_relevant_to_frontend.map((spec) => spec.method);
|
|
40
82
|
}
|
|
41
|
-
get
|
|
42
|
-
return this.
|
|
83
|
+
get methods_relevant_to_backend() {
|
|
84
|
+
return this.specs_relevant_to_backend.map((spec) => spec.method);
|
|
43
85
|
}
|
|
44
|
-
|
|
45
|
-
|
|
86
|
+
// --- Narrow handler-side getters (request_response only) ---
|
|
87
|
+
// "Handled" = this side **receives** (initiator excludes own side).
|
|
88
|
+
// Drives `FrontendRequestResponseMethod` / `BackendRequestResponseMethod`
|
|
89
|
+
// enums and the typed `BackendActionHandlers` mapped type.
|
|
90
|
+
get frontend_handled_specs() {
|
|
91
|
+
return this.request_response_specs.filter((spec) => spec.initiator !== 'frontend');
|
|
46
92
|
}
|
|
47
|
-
get
|
|
48
|
-
return this.
|
|
93
|
+
get backend_handled_specs() {
|
|
94
|
+
return this.request_response_specs.filter((spec) => spec.initiator !== 'backend');
|
|
49
95
|
}
|
|
50
|
-
get
|
|
51
|
-
return this.
|
|
96
|
+
get frontend_handled_methods() {
|
|
97
|
+
return this.frontend_handled_specs.map((spec) => spec.method);
|
|
52
98
|
}
|
|
53
|
-
get
|
|
54
|
-
return this.
|
|
99
|
+
get backend_handled_methods() {
|
|
100
|
+
return this.backend_handled_specs.map((spec) => spec.method);
|
|
55
101
|
}
|
|
56
|
-
|
|
57
|
-
|
|
102
|
+
// --- Broadcast / backend-initiated getters ---
|
|
103
|
+
// Excludes `streams` targets (request-scoped progress notifications
|
|
104
|
+
// invoked via `ctx.notify` inside the parent handler). Today
|
|
105
|
+
// `broadcast_*` and `backend_initiated_*` return the same set;
|
|
106
|
+
// `backend_initiated_*` is the forward-looking name that will widen
|
|
107
|
+
// when local_calls or backend-initiated `request_response` join.
|
|
108
|
+
get broadcast_specs() {
|
|
109
|
+
const streams_targets = this.#get_streams_target_methods();
|
|
110
|
+
return this.remote_notification_specs.filter((spec) => spec.initiator !== 'frontend' && !streams_targets.has(spec.method));
|
|
58
111
|
}
|
|
59
|
-
get
|
|
60
|
-
return this.
|
|
112
|
+
get broadcast_methods() {
|
|
113
|
+
return this.broadcast_specs.map((spec) => spec.method);
|
|
61
114
|
}
|
|
62
|
-
get
|
|
63
|
-
|
|
115
|
+
get backend_initiated_specs() {
|
|
116
|
+
const streams_targets = this.#get_streams_target_methods();
|
|
117
|
+
return this.specs.filter((spec) => spec.initiator !== 'frontend' && !streams_targets.has(spec.method));
|
|
64
118
|
}
|
|
65
|
-
get
|
|
66
|
-
return this.
|
|
119
|
+
get backend_initiated_methods() {
|
|
120
|
+
return this.backend_initiated_specs.map((spec) => spec.method);
|
|
67
121
|
}
|
|
68
|
-
|
|
69
|
-
|
|
122
|
+
// --- Initiator-direction (pre-built, unused by codegen today) ---
|
|
123
|
+
get backend_to_frontend_specs() {
|
|
124
|
+
return this.specs.filter((spec) => spec.initiator === 'backend' || spec.initiator === 'both');
|
|
125
|
+
}
|
|
126
|
+
get frontend_to_backend_specs() {
|
|
127
|
+
return this.specs.filter((spec) => spec.initiator === 'frontend' || spec.initiator === 'both');
|
|
70
128
|
}
|
|
71
129
|
get frontend_to_backend_methods() {
|
|
72
130
|
return this.frontend_to_backend_specs.map((spec) => spec.method);
|
|
@@ -74,10 +132,29 @@ export class ActionRegistry {
|
|
|
74
132
|
get backend_to_frontend_methods() {
|
|
75
133
|
return this.backend_to_frontend_specs.map((spec) => spec.method);
|
|
76
134
|
}
|
|
135
|
+
// --- Auth (pre-built, unused by codegen today) ---
|
|
136
|
+
get public_specs() {
|
|
137
|
+
return this.specs.filter((spec) => spec.auth === 'public');
|
|
138
|
+
}
|
|
139
|
+
get authenticated_specs() {
|
|
140
|
+
return this.specs.filter((spec) => spec.auth === 'authenticated');
|
|
141
|
+
}
|
|
77
142
|
get public_methods() {
|
|
78
143
|
return this.public_specs.map((spec) => spec.method);
|
|
79
144
|
}
|
|
80
145
|
get authenticated_methods() {
|
|
81
146
|
return this.authenticated_specs.map((spec) => spec.method);
|
|
82
147
|
}
|
|
148
|
+
// --- Internal ---
|
|
149
|
+
#streams_target_methods;
|
|
150
|
+
#get_streams_target_methods() {
|
|
151
|
+
if (this.#streams_target_methods)
|
|
152
|
+
return this.#streams_target_methods;
|
|
153
|
+
const targets = new Set();
|
|
154
|
+
for (const spec of this.specs) {
|
|
155
|
+
if (spec.streams)
|
|
156
|
+
targets.add(spec.streams);
|
|
157
|
+
}
|
|
158
|
+
return (this.#streams_target_methods = targets);
|
|
159
|
+
}
|
|
83
160
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These types sit above `action_spec.ts` (pure Zod schemas) and below the
|
|
5
5
|
* dispatchers (`register_action_ws.ts`, `action_rpc.ts`). Extracted so the
|
|
6
|
-
* shared
|
|
7
|
-
*
|
|
6
|
+
* shared protocol actions (e.g. `heartbeat_action`) can name them without
|
|
7
|
+
* pulling in server-only modules.
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These types sit above `action_spec.ts` (pure Zod schemas) and below the
|
|
5
5
|
* dispatchers (`register_action_ws.ts`, `action_rpc.ts`). Extracted so the
|
|
6
|
-
* shared
|
|
7
|
-
*
|
|
6
|
+
* shared protocol actions (e.g. `heartbeat_action`) can name them without
|
|
7
|
+
* pulling in server-only modules.
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
package/dist/actions/cancel.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared cancel action —
|
|
3
|
-
*
|
|
2
|
+
* Shared cancel action — a fuz_app protocol action validating the
|
|
3
|
+
* spec+handler tuple pattern on a notification-kind action.
|
|
4
4
|
*
|
|
5
5
|
* Semantics: the client sends `{jsonrpc, method: 'cancel', params:
|
|
6
6
|
* {request_id}}` to abort an in-flight request on the same socket.
|
|
@@ -11,13 +11,14 @@
|
|
|
11
11
|
*
|
|
12
12
|
* The handler field is an empty stub: cancel semantics are dispatcher-owned
|
|
13
13
|
* (the dispatcher has the `{request_id → AbortController}` map, not the
|
|
14
|
-
* handler). The handler exists for symmetry with other
|
|
14
|
+
* handler). The handler exists for symmetry with other protocol actions
|
|
15
15
|
* like `heartbeat_action`; the dispatcher never calls it. Consumers
|
|
16
|
-
* spread `cancel_action`
|
|
17
|
-
* `
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* spread `cancel_action` (or the `protocol_actions` bundle from
|
|
17
|
+
* `./protocol.js`) into their server's `actions` array so `spec_by_method`
|
|
18
|
+
* knows about it (enabling input validation on incoming cancels) and so
|
|
19
|
+
* `create_rpc_client` codegen produces `app.api.cancel()` when desired —
|
|
20
|
+
* though `FrontendWebsocketClient.request({signal})` sends the cancel on
|
|
21
|
+
* abort without needing the typed API.
|
|
21
22
|
*
|
|
22
23
|
* Wire format is snake_case `cancel` with `{request_id}`, not MCP's
|
|
23
24
|
* `$/cancelRequest` with `{requestId}` — fuz_app's WS transport isn't MCP,
|
|
@@ -67,9 +68,10 @@ export declare const cancel_action_spec: {
|
|
|
67
68
|
*/
|
|
68
69
|
export declare const cancel_handler: () => void;
|
|
69
70
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
71
|
+
* Protocol-action tuple — spread into the server's `actions` array (or via
|
|
72
|
+
* `protocol_actions` from `./protocol.js`) so the dispatcher registers the
|
|
73
|
+
* spec for input validation and so `create_rpc_client` codegen sees the
|
|
74
|
+
* method. The client doesn't need to call it directly;
|
|
73
75
|
* `FrontendWebsocketClient.request({signal})` sends the cancel notification
|
|
74
76
|
* automatically when the signal fires.
|
|
75
77
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancel.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/cancel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cancel.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/cancel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;kBAEnC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;CAWS,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,QAAO,IAAU,CAAC;AAE7C;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,MAG3B,CAAC"}
|
package/dist/actions/cancel.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared cancel action —
|
|
3
|
-
*
|
|
2
|
+
* Shared cancel action — a fuz_app protocol action validating the
|
|
3
|
+
* spec+handler tuple pattern on a notification-kind action.
|
|
4
4
|
*
|
|
5
5
|
* Semantics: the client sends `{jsonrpc, method: 'cancel', params:
|
|
6
6
|
* {request_id}}` to abort an in-flight request on the same socket.
|
|
@@ -11,13 +11,14 @@
|
|
|
11
11
|
*
|
|
12
12
|
* The handler field is an empty stub: cancel semantics are dispatcher-owned
|
|
13
13
|
* (the dispatcher has the `{request_id → AbortController}` map, not the
|
|
14
|
-
* handler). The handler exists for symmetry with other
|
|
14
|
+
* handler). The handler exists for symmetry with other protocol actions
|
|
15
15
|
* like `heartbeat_action`; the dispatcher never calls it. Consumers
|
|
16
|
-
* spread `cancel_action`
|
|
17
|
-
* `
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* spread `cancel_action` (or the `protocol_actions` bundle from
|
|
17
|
+
* `./protocol.js`) into their server's `actions` array so `spec_by_method`
|
|
18
|
+
* knows about it (enabling input validation on incoming cancels) and so
|
|
19
|
+
* `create_rpc_client` codegen produces `app.api.cancel()` when desired —
|
|
20
|
+
* though `FrontendWebsocketClient.request({signal})` sends the cancel on
|
|
21
|
+
* abort without needing the typed API.
|
|
21
22
|
*
|
|
22
23
|
* Wire format is snake_case `cancel` with `{request_id}`, not MCP's
|
|
23
24
|
* `$/cancelRequest` with `{requestId}` — fuz_app's WS transport isn't MCP,
|
|
@@ -64,9 +65,10 @@ export const cancel_action_spec = {
|
|
|
64
65
|
*/
|
|
65
66
|
export const cancel_handler = () => { }; // eslint-disable-line @typescript-eslint/no-empty-function
|
|
66
67
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
68
|
+
* Protocol-action tuple — spread into the server's `actions` array (or via
|
|
69
|
+
* `protocol_actions` from `./protocol.js`) so the dispatcher registers the
|
|
70
|
+
* spec for input validation and so `create_rpc_client` codegen sees the
|
|
71
|
+
* method. The client doesn't need to call it directly;
|
|
70
72
|
* `FrontendWebsocketClient.request({signal})` sends the cancel notification
|
|
71
73
|
* automatically when the signal fires.
|
|
72
74
|
*/
|
|
@@ -58,6 +58,15 @@ export interface CreateFrontendRpcClientOptions<TApi extends object = object> {
|
|
|
58
58
|
* list silently return `undefined` from the Proxy — the generic `TApi`
|
|
59
59
|
* cannot constrain runtime membership, so consumers must keep this list
|
|
60
60
|
* in sync with the typed surface (codegen recommended).
|
|
61
|
+
*
|
|
62
|
+
* Protocol actions (`heartbeat`, `cancel`) are **not** auto-spread —
|
|
63
|
+
* they're filtered out of generated `action_specs` by codegen's
|
|
64
|
+
* `include_protocol_actions: false` default and consumers spread them
|
|
65
|
+
* in explicitly so the contract stays visible at every registration
|
|
66
|
+
* site. For WS-using consumers, spread `protocol_action_specs` from
|
|
67
|
+
* `actions/protocol.ts` here:
|
|
68
|
+
* `specs: [...protocol_action_specs, ...action_specs]`. HTTP-only
|
|
69
|
+
* consumers can omit them.
|
|
61
70
|
*/
|
|
62
71
|
specs: ReadonlyArray<ActionSpecUnion>;
|
|
63
72
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frontend_rpc_client.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/frontend_rpc_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAa,KAAK,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAGN,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEtD,gDAAgD;AAChD,MAAM,WAAW,8BAA8B,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IAC3E
|
|
1
|
+
{"version":3,"file":"frontend_rpc_client.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/frontend_rpc_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAa,KAAK,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAGN,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEtD,gDAAgD;AAChD,MAAM,WAAW,8BAA8B,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IAC3E;;;;;;;;;;;;;;OAcG;IACH,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IACtC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACtC;;;;;;;;;OASG;IACH,oBAAoB,CAAC,EAAE,kBAAkB,CAAC;IAC1C;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC;IACpE;;;;;;;;;;;;;;;;OAgBG;IACH,qBAAqB,CAAC,EAAE,sBAAsB,CAAC,uBAAuB,CAAC,CAAC;CACxE;AAED,uDAAuD;AACvD,MAAM,WAAW,iBAAiB,CAAC,IAAI;IACtC;;;;OAIG;IACH,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IACvB;;;;;OAKG;IACH,UAAU,EAAE,IAAI,CAAC;IACjB,0GAA0G;IAC1G,IAAI,EAAE,UAAU,CAAC;IACjB,sHAAsH;IACtH,WAAW,EAAE,sBAAsB,CAAC;CACpC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,GAAI,IAAI,SAAS,MAAM,EAC7D,SAAS,8BAA8B,CAAC,IAAI,CAAC,KAC3C,iBAAiB,CAAC,IAAI,CAsBxB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared heartbeat action —
|
|
3
|
-
*
|
|
4
|
-
* `
|
|
5
|
-
* array so disconnect detection works identically across every
|
|
6
|
-
* per-consumer ping plumbing.
|
|
2
|
+
* Shared heartbeat action — a fuz_app protocol action carrying both a spec
|
|
3
|
+
* and a handler in one tuple. Consumers spread `heartbeat_action` (or the
|
|
4
|
+
* `protocol_actions` bundle from `./protocol.js`) into the server's
|
|
5
|
+
* `actions` array so disconnect detection works identically across every
|
|
6
|
+
* repo without per-consumer ping plumbing.
|
|
7
7
|
*
|
|
8
8
|
* The client's activity-aware heartbeat timer (in
|
|
9
9
|
* `FrontendWebsocketClient`) issues a `heartbeat` request whenever the
|
|
@@ -38,9 +38,12 @@ export declare const heartbeat_action_spec: {
|
|
|
38
38
|
/** Handler — nullary echo. Stateless, suitable for high-frequency pings. */
|
|
39
39
|
export declare const heartbeat_handler: () => Record<string, never>;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* Protocol-action tuple — spread into the server's `actions` array for
|
|
42
|
+
* dispatch (or via `protocol_actions` from `./protocol.js`) so the
|
|
43
|
+
* dispatcher resolves the heartbeat handler. The frontend-side spread
|
|
44
|
+
* happens via `protocol_action_specs` — the client doesn't run the echo
|
|
45
|
+
* handler, but the spec must be in `ActionRegistry` so `create_rpc_client`
|
|
46
|
+
* types `app.api.heartbeat()` against the shared spec.
|
|
44
47
|
*/
|
|
45
48
|
export declare const heartbeat_action: Action;
|
|
46
49
|
//# sourceMappingURL=heartbeat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heartbeat.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/heartbeat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;CAUG,CAAC;AAEtC,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,QAAO,MAAM,CAAC,MAAM,EAAE,KAAK,CAAS,CAAC;AAEnE
|
|
1
|
+
{"version":3,"file":"heartbeat.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/heartbeat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,mBAAmB,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;CAUG,CAAC;AAEtC,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,QAAO,MAAM,CAAC,MAAM,EAAE,KAAK,CAAS,CAAC;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAG9B,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared heartbeat action —
|
|
3
|
-
*
|
|
4
|
-
* `
|
|
5
|
-
* array so disconnect detection works identically across every
|
|
6
|
-
* per-consumer ping plumbing.
|
|
2
|
+
* Shared heartbeat action — a fuz_app protocol action carrying both a spec
|
|
3
|
+
* and a handler in one tuple. Consumers spread `heartbeat_action` (or the
|
|
4
|
+
* `protocol_actions` bundle from `./protocol.js`) into the server's
|
|
5
|
+
* `actions` array so disconnect detection works identically across every
|
|
6
|
+
* repo without per-consumer ping plumbing.
|
|
7
7
|
*
|
|
8
8
|
* The client's activity-aware heartbeat timer (in
|
|
9
9
|
* `FrontendWebsocketClient`) issues a `heartbeat` request whenever the
|
|
@@ -37,9 +37,12 @@ export const heartbeat_action_spec = {
|
|
|
37
37
|
/** Handler — nullary echo. Stateless, suitable for high-frequency pings. */
|
|
38
38
|
export const heartbeat_handler = () => ({});
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
40
|
+
* Protocol-action tuple — spread into the server's `actions` array for
|
|
41
|
+
* dispatch (or via `protocol_actions` from `./protocol.js`) so the
|
|
42
|
+
* dispatcher resolves the heartbeat handler. The frontend-side spread
|
|
43
|
+
* happens via `protocol_action_specs` — the client doesn't run the echo
|
|
44
|
+
* handler, but the spec must be in `ActionRegistry` so `create_rpc_client`
|
|
45
|
+
* types `app.api.heartbeat()` against the shared spec.
|
|
43
46
|
*/
|
|
44
47
|
export const heartbeat_action = {
|
|
45
48
|
spec: heartbeat_action_spec,
|
|
@@ -0,0 +1,47 @@
|
|
|
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.
|
|
5
|
+
*
|
|
6
|
+
* Protocol actions are wire-protocol concerns (liveness, abort) shipped by
|
|
7
|
+
* fuz_app, not consumer domain logic. The split is intentional: the server
|
|
8
|
+
* needs `{spec, handler}` tuples to drive dispatch; the frontend
|
|
9
|
+
* `ActionRegistry` only stores specs. The codegen
|
|
10
|
+
* `include_protocol_actions: false` default (in `action_codegen.ts`) is the
|
|
11
|
+
* third leg of this contract — protocol actions are excluded from
|
|
12
|
+
* generated typed surfaces because consumers spread them in at
|
|
13
|
+
* registration time.
|
|
14
|
+
*
|
|
15
|
+
* Adding a future protocol action (e.g. clock-skew probe, reconnect-resume
|
|
16
|
+
* token) means appending to these arrays in one place; no consumer
|
|
17
|
+
* migration required.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
import type { ActionSpecUnion } from './action_spec.js';
|
|
22
|
+
import type { Action } from './action_types.js';
|
|
23
|
+
/**
|
|
24
|
+
* Canonical protocol `{spec, handler}` tuples for the server's
|
|
25
|
+
* `register_action_ws` `actions` array. Spread before consumer-owned actions
|
|
26
|
+
* so disconnect detection and per-request cancel work uniformly:
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* register_action_ws({actions: [...protocol_actions, ...consumer_actions], ...})
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const protocol_actions: ReadonlyArray<Action>;
|
|
33
|
+
/**
|
|
34
|
+
* Canonical protocol specs for `ActionRegistry` construction on the
|
|
35
|
+
* frontend. Spread before consumer-owned specs so dispatcher-owned methods
|
|
36
|
+
* are present in the lookup map even though codegen excludes them from the
|
|
37
|
+
* generated `action_specs` array:
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* new ActionRegistry([...protocol_action_specs, ...action_specs])
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Derived from `protocol_actions` so a future protocol action lands in one
|
|
44
|
+
* place — the two arrays cannot drift.
|
|
45
|
+
*/
|
|
46
|
+
export declare const protocol_action_specs: ReadonlyArray<ActionSpecUnion>;
|
|
47
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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.
|
|
5
|
+
*
|
|
6
|
+
* Protocol actions are wire-protocol concerns (liveness, abort) shipped by
|
|
7
|
+
* fuz_app, not consumer domain logic. The split is intentional: the server
|
|
8
|
+
* needs `{spec, handler}` tuples to drive dispatch; the frontend
|
|
9
|
+
* `ActionRegistry` only stores specs. The codegen
|
|
10
|
+
* `include_protocol_actions: false` default (in `action_codegen.ts`) is the
|
|
11
|
+
* third leg of this contract — protocol actions are excluded from
|
|
12
|
+
* generated typed surfaces because consumers spread them in at
|
|
13
|
+
* registration time.
|
|
14
|
+
*
|
|
15
|
+
* Adding a future protocol action (e.g. clock-skew probe, reconnect-resume
|
|
16
|
+
* token) means appending to these arrays in one place; no consumer
|
|
17
|
+
* migration required.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
*/
|
|
21
|
+
import { cancel_action } from './cancel.js';
|
|
22
|
+
import { heartbeat_action } from './heartbeat.js';
|
|
23
|
+
/**
|
|
24
|
+
* Canonical protocol `{spec, handler}` tuples for the server's
|
|
25
|
+
* `register_action_ws` `actions` array. Spread before consumer-owned actions
|
|
26
|
+
* so disconnect detection and per-request cancel work uniformly:
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* register_action_ws({actions: [...protocol_actions, ...consumer_actions], ...})
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const protocol_actions = [heartbeat_action, cancel_action];
|
|
33
|
+
/**
|
|
34
|
+
* Canonical protocol specs for `ActionRegistry` construction on the
|
|
35
|
+
* frontend. Spread before consumer-owned specs so dispatcher-owned methods
|
|
36
|
+
* are present in the lookup map even though codegen excludes them from the
|
|
37
|
+
* generated `action_specs` array:
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* new ActionRegistry([...protocol_action_specs, ...action_specs])
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Derived from `protocol_actions` so a future protocol action lands in one
|
|
44
|
+
* place — the two arrays cannot drift.
|
|
45
|
+
*/
|
|
46
|
+
export const protocol_action_specs = protocol_actions.map((a) => a.spec);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WebSocket JSON-RPC dispatch — the low-level WS transport binding.
|
|
3
3
|
*
|
|
4
4
|
* Most consumers should mount WS endpoints via `register_ws_endpoint`
|
|
5
|
-
* (
|
|
5
|
+
* (`actions/register_ws_endpoint.ts`), which wraps this function with the standard
|
|
6
6
|
* upgrade stack (origin check + auth + optional role). This module stays
|
|
7
7
|
* exported as the lower-level entry point for tests that drive the
|
|
8
8
|
* dispatcher directly via `create_ws_test_harness`.
|
|
@@ -97,8 +97,9 @@ export interface RegisterActionWsOptions<TCtx extends BaseHandlerContext> {
|
|
|
97
97
|
* The actions registered on this endpoint — each carries a spec (drives
|
|
98
98
|
* method lookup, per-action auth, input/output validation) and an
|
|
99
99
|
* optional handler (omit for client-only specs like inbound
|
|
100
|
-
* notifications).
|
|
101
|
-
* complete the disconnect-detection
|
|
100
|
+
* notifications). Spread `protocol_actions` from `actions/protocol.ts`
|
|
101
|
+
* here to complete the disconnect-detection + per-request cancel
|
|
102
|
+
* pairing with the frontend client.
|
|
102
103
|
*/
|
|
103
104
|
actions: ReadonlyArray<Action<TCtx>>;
|
|
104
105
|
/**
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,KAAK,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,MAAM,CAAC;AACxC,OAAO,KAAK,EAAC,gBAAgB,EAAE,SAAS,EAAC,MAAM,SAAS,CAAC;AAEzD,OAAO,EAAS,KAAK,MAAM,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAiBjD,OAAO,EAAC,KAAK,MAAM,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAG7F,OAAO,EAAC,yBAAyB,EAAE,KAAK,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAE9F,YAAY,EAAC,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAC,CAAC;AAE1D,0EAA0E;AAC1E,eAAO,MAAM,gCAAgC,QAAS,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IACjC,qFAAqF;IACrF,EAAE,EAAE,SAAS,CAAC;IACd,4EAA4E;IAC5E,aAAa,EAAE,IAAI,CAAC;IACpB,oDAAoD;IACpD,QAAQ,EAAE,kBAAkB,CAAC;IAC7B;;;OAGG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,wFAAwF;IACxF,MAAM,EAAE,WAAW,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IAClC,+CAA+C;IAC/C,EAAE,EAAE,SAAS,CAAC;IACd,2CAA2C;IAC3C,aAAa,EAAE,IAAI,CAAC;IACpB,kGAAkG;IAClG,QAAQ,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACtC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wCAAwC;AACxC,MAAM,WAAW,uBAAuB,CAAC,IAAI,SAAS,kBAAkB;IACvE,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,GAAG,EAAE,IAAI,CAAC;IACV,iEAAiE;IACjE,gBAAgB,EAAE,gBAAgB,CAAC;IACnC
|
|
1
|
+
{"version":3,"file":"register_action_ws.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/register_action_ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,KAAK,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,MAAM,CAAC;AACxC,OAAO,KAAK,EAAC,gBAAgB,EAAE,SAAS,EAAC,MAAM,SAAS,CAAC;AAEzD,OAAO,EAAS,KAAK,MAAM,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAiBjD,OAAO,EAAC,KAAK,MAAM,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAG7F,OAAO,EAAC,yBAAyB,EAAE,KAAK,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAE9F,YAAY,EAAC,MAAM,EAAE,kBAAkB,EAAE,eAAe,EAAC,CAAC;AAE1D,0EAA0E;AAC1E,eAAO,MAAM,gCAAgC,QAAS,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IACjC,qFAAqF;IACrF,EAAE,EAAE,SAAS,CAAC;IACd,4EAA4E;IAC5E,aAAa,EAAE,IAAI,CAAC;IACpB,oDAAoD;IACpD,QAAQ,EAAE,kBAAkB,CAAC;IAC7B;;;OAGG;IACH,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,wFAAwF;IACxF,MAAM,EAAE,WAAW,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IAClC,+CAA+C;IAC/C,EAAE,EAAE,SAAS,CAAC;IACd,2CAA2C;IAC3C,aAAa,EAAE,IAAI,CAAC;IACpB,kGAAkG;IAClG,QAAQ,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACtC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wCAAwC;AACxC,MAAM,WAAW,uBAAuB,CAAC,IAAI,SAAS,kBAAkB;IACvE,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,GAAG,EAAE,IAAI,CAAC;IACV,iEAAiE;IACjE,gBAAgB,EAAE,gBAAgB,CAAC;IACnC;;;;;;;OAOG;IACH,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC;;;;;OAKG;IACH,cAAc,EAAE,CAAC,IAAI,EAAE,kBAAkB,EAAE,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/D;;;;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;CACpE;AAED,sCAAsC;AACtC,MAAM,WAAW,sBAAsB;IACtC,yEAAyE;IACzE,SAAS,EAAE,yBAAyB,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,SAAS,kBAAkB,EACjE,SAAS,uBAAuB,CAAC,IAAI,CAAC,KACpC,sBA8WF,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WebSocket JSON-RPC dispatch — the low-level WS transport binding.
|
|
3
3
|
*
|
|
4
4
|
* Most consumers should mount WS endpoints via `register_ws_endpoint`
|
|
5
|
-
* (
|
|
5
|
+
* (`actions/register_ws_endpoint.ts`), which wraps this function with the standard
|
|
6
6
|
* upgrade stack (origin check + auth + optional role). This module stays
|
|
7
7
|
* exported as the lower-level entry point for tests that drive the
|
|
8
8
|
* dispatcher directly via `create_ws_test_harness`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Account RPC action specs — declarative contract for self-service account
|
|
3
3
|
* operations. Import this module for the specs, Input/Output schemas, and
|
|
4
4
|
* the `all_account_action_specs` registry. Handlers live in
|
|
5
|
-
*
|
|
5
|
+
* `auth/account_actions.ts` so consumers doing typed-client codegen or surface
|
|
6
6
|
* reporting don't transitively drag in server-only query code.
|
|
7
7
|
*
|
|
8
8
|
* @module
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Account RPC action specs — declarative contract for self-service account
|
|
3
3
|
* operations. Import this module for the specs, Input/Output schemas, and
|
|
4
4
|
* the `all_account_action_specs` registry. Handlers live in
|
|
5
|
-
*
|
|
5
|
+
* `auth/account_actions.ts` so consumers doing typed-client codegen or surface
|
|
6
6
|
* reporting don't transitively drag in server-only query code.
|
|
7
7
|
*
|
|
8
8
|
* @module
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
* - API token management: `account_token_create`, `account_token_list`,
|
|
10
10
|
* `account_token_revoke`.
|
|
11
11
|
*
|
|
12
|
-
* The action specs themselves live in
|
|
12
|
+
* The action specs themselves live in `auth/account_action_specs.ts`. Every spec
|
|
13
13
|
* declares `auth: 'authenticated'` so the dispatcher enforces auth before the
|
|
14
14
|
* handler runs. Revoke operations are account-scoped (via
|
|
15
15
|
* `query_session_revoke_for_account` / `query_revoke_api_token_for_account`)
|
|
16
16
|
* so passing another account's session or token id returns `revoked: false`
|
|
17
17
|
* rather than revealing whether the id exists.
|
|
18
18
|
*
|
|
19
|
-
* Counterpart to `account_routes.ts`, which keeps the cookie-lifecycle flows
|
|
19
|
+
* Counterpart to `auth/account_routes.ts`, which keeps the cookie-lifecycle flows
|
|
20
20
|
* (`login`, `logout`, `password`, `signup`, `bootstrap`) on REST.
|
|
21
21
|
*
|
|
22
22
|
* @module
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
* - API token management: `account_token_create`, `account_token_list`,
|
|
10
10
|
* `account_token_revoke`.
|
|
11
11
|
*
|
|
12
|
-
* The action specs themselves live in
|
|
12
|
+
* The action specs themselves live in `auth/account_action_specs.ts`. Every spec
|
|
13
13
|
* declares `auth: 'authenticated'` so the dispatcher enforces auth before the
|
|
14
14
|
* handler runs. Revoke operations are account-scoped (via
|
|
15
15
|
* `query_session_revoke_for_account` / `query_revoke_api_token_for_account`)
|
|
16
16
|
* so passing another account's session or token id returns `revoked: false`
|
|
17
17
|
* rather than revealing whether the id exists.
|
|
18
18
|
*
|
|
19
|
-
* Counterpart to `account_routes.ts`, which keeps the cookie-lifecycle flows
|
|
19
|
+
* Counterpart to `auth/account_routes.ts`, which keeps the cookie-lifecycle flows
|
|
20
20
|
* (`login`, `logout`, `password`, `signup`, `bootstrap`) on REST.
|
|
21
21
|
*
|
|
22
22
|
* @module
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Admin RPC action specs — declarative contract for admin-only operations.
|
|
3
3
|
*
|
|
4
4
|
* Import this module for the specs, Input/Output schemas, and the
|
|
5
|
-
* `all_admin_action_specs` registry. Handlers live in
|
|
5
|
+
* `all_admin_action_specs` registry. Handlers live in `auth/admin_actions.ts`.
|
|
6
6
|
*
|
|
7
7
|
* Authorization is declared at the spec level (`auth: {role: ROLE_ADMIN}`)
|
|
8
8
|
* so the RPC dispatcher enforces admin before the handler runs and the
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Admin RPC action specs — declarative contract for admin-only operations.
|
|
3
3
|
*
|
|
4
4
|
* Import this module for the specs, Input/Output schemas, and the
|
|
5
|
-
* `all_admin_action_specs` registry. Handlers live in
|
|
5
|
+
* `all_admin_action_specs` registry. Handlers live in `auth/admin_actions.ts`.
|
|
6
6
|
*
|
|
7
7
|
* Authorization is declared at the spec level (`auth: {role: ROLE_ADMIN}`)
|
|
8
8
|
* so the RPC dispatcher enforces admin before the handler runs and the
|