@modality-counter/core 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +303 -303
- package/dist/types/schemas/counter_schemas.d.ts +13 -6
- package/package.json +1 -1
|
@@ -14,13 +14,20 @@ export type PartyMode = z.infer<typeof partyModeSchema>;
|
|
|
14
14
|
* HACK: some MCP clients (e.g. certain Gemini tool runtimes, Copilot CLI) flatten
|
|
15
15
|
* a nested `params` object into dotted top-level keys on the wire — sending
|
|
16
16
|
* `{ "params.reference": "x" }` instead of `{ params: { reference: "x" } }`.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* This preprocessor folds any `params.*` keys back into a nested `params` object
|
|
18
|
+
* before Zod's z.object() sees the input — otherwise the dotted keys would be
|
|
19
|
+
* treated as unknown top-level keys and silently dropped under Zod's default
|
|
20
|
+
* strip mode.
|
|
19
21
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* Preprocess trigger (both paths are needed):
|
|
23
|
+
* 1. MCP framework: the server passes raw JSON-RPC args straight through
|
|
24
|
+
* to execute(). The inputSchema is NOT auto-parsed.
|
|
25
|
+
* 2. executeMethod(): always calls heroMethodSchema.parse(props) before
|
|
26
|
+
* destructuring, so the preprocess fires on every call path.
|
|
27
|
+
*
|
|
28
|
+
* Removing this function or the z.preprocess(liftDottedParams, …) wrapper
|
|
29
|
+
* on heroMethodSchema will break reference loading and method execution for
|
|
30
|
+
* any client that sends flattened wire format.
|
|
24
31
|
*/
|
|
25
32
|
export declare function liftDottedParams(input: unknown): unknown;
|
|
26
33
|
export declare const heroMethodSchema: z.ZodPreprocess<z.ZodObject<{
|
package/package.json
CHANGED