Setting up your dashboard0 entities found · 9/32 branches scanned
ID:WORK-161Status:draft
Extend CliPluginCommand with inputSchema/outputSchema/mcpHandler
Add three optional fields to the CliPluginCommand interface so plugin commands can declare structured input/output schemas and an MCP-friendly handler that bypasses argv parsing. Existing plugins keep working unchanged — the fields are purely additive.
plan(v0.11.0): scaffold milestone and 17 work items
Acceptance Criteria
CliPluginCommand in @refrakt-md/types gains inputSchema?: JSONSchema7, outputSchema?: JSONSchema7, and mcpHandler?: (input: unknown) => Promise<unknown> fields
All three fields are optional; existing plugins compile and run without modification
JSDoc on each field documents its role: inputSchema for MCP tool input validation, outputSchema for structured output declaration, mcpHandler for direct structured invocation that bypasses argv parsing
Type-level test asserts that a plugin without these fields still satisfies the interface
JSONSchema7 type imported from @types/json-schema (already a likely transitive dep; add directly if not)
Approach
Locate the current CliPluginCommand declaration. Today it lives inline in packages/cli/src/bin.ts; promote it to a shared type in @refrakt-md/types and re-export from there.
Add the three optional fields with JSDoc.
Update packages/cli/src/bin.ts to import the shared type instead of declaring its own.
Update runes/plan/src/cli-plugin.ts to import the shared type for type-checking purposes (no runtime change in this work item).
Dependencies
None. Pure type additions.
References
SPEC-043 — Refrakt MCP Server (Plugin Contract Extension section)
packages/cli/src/bin.ts — current CliPluginCommand declaration
runes/plan/src/cli-plugin.ts — first plugin to consume the extended type