fix(mcp): add role/stream to Catalog types to match generated catalog
Phase 0 added `role` to FieldDoc and `stream` to ActionDoc and regenerated catalog.ts, but the mcp package's own CatalogParam/CatalogAction types (intentionally decoupled from onebot per ADR-0005) weren't updated — so `tsc --noEmit` failed on the generated catalog.ts (TS2353, unknown properties role/stream). The mcp vitest suite passed because esbuild doesn't type-check the generated snapshot, which is why this slipped. CatalogParam gains role?: string (loose, to stay decoupled from onebot's FieldRole union); CatalogAction gains stream?: boolean. `pnpm typecheck` is green across all packages.
This commit is contained in:
1 file changed
+8
@@ -11,6 +11,11 @@ export interface CatalogParam {
|
|||||||
default?: unknown;
|
default?: unknown;
|
||||||
desc?: string;
|
desc?: string;
|
||||||
values?: ReadonlyArray<string | number>;
|
values?: ReadonlyArray<string | number>;
|
||||||
|
/** Semantic role (group_id / user_id / member_id / image / face_id / …),
|
||||||
|
* orthogonal to `type`; drives smart-widget selection in the WebUI console.
|
||||||
|
* Kept as a loose string here so the package stays decoupled from onebot's
|
||||||
|
* FieldRole union. */
|
||||||
|
role?: string;
|
||||||
/** JSON Schema fragment for this single field. */
|
/** JSON Schema fragment for this single field. */
|
||||||
schema?: Record<string, unknown>;
|
schema?: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
@@ -27,6 +32,9 @@ export interface CatalogAction {
|
|||||||
* read/write tool routing: read-only → query_action, else → invoke_action.
|
* read/write tool routing: read-only → query_action, else → invoke_action.
|
||||||
* Classified at the source spec by what the action's `run` actually does. */
|
* Classified at the source spec by what the action's `run` actually does. */
|
||||||
readOnly: boolean;
|
readOnly: boolean;
|
||||||
|
/** True for Stream API actions (multi-frame transport). Absent ⇒ ordinary
|
||||||
|
* single-response action. */
|
||||||
|
stream?: boolean;
|
||||||
params: CatalogParam[];
|
params: CatalogParam[];
|
||||||
/** Cross-field invariants, e.g. "exactly one of: message_id | (group_id+user_id)". */
|
/** Cross-field invariants, e.g. "exactly one of: message_id | (group_id+user_id)". */
|
||||||
invariants: string[];
|
invariants: string[];
|
||||||
|
|||||||
Reference in new issue
Block a user