Skip to content

🦌 Add declarative input system for actions#3

Open
zdavison wants to merge 2 commits intomainfrom
deer/add-action-inputs-system
Open

🦌 Add declarative input system for actions#3
zdavison wants to merge 2 commits intomainfrom
deer/add-action-inputs-system

Conversation

@zdavison
Copy link
Copy Markdown
Owner

@zdavison zdavison commented Mar 20, 2026

Summary

Introduces a declarative kadai:input frontmatter system that allows actions to declare their interactive inputs upfront. Declared inputs are collected as a form in the interactive menu, exposed as typed parameters in MCP tool calls, and automatically replayed by --rerun.

The .last-action file format is upgraded from a plain action ID string to a JSON record ({ actionId, inputs }) with backward-compatible parsing for old plain-text format. Sensitive inputs are filtered before saving so secrets are never persisted to disk.

Changes

  • src/core/inputs.ts — new module with runWithStdinRecording, buildInjection, buildStdinStream, and filterSensitiveInputs helpers
  • src/core/last-action.ts — upgraded .last-action format to JSON LastActionRecord; backward compat for old plain-string format
  • src/core/commands.tshandleRun supports recording and replay modes; handleRerun passes saved input values back through
  • src/core/mcp.ts — declared inputs become typed Zod-validated MCP tool parameters
  • src/types.ts — added ActionInput, InputValues, and LastActionRecord types
  • src/cli.tsx — wires recording mode and sensitive input filtering into the interactive menu flow
  • src/core/init-wizard.ts — documents input declaration syntax and injection behavior
  • README.md — full documentation for kadai:input syntax, injection mechanics, and --rerun
  • test/commands.test.ts, test/last-action.test.ts — updated tests for new record format and input handling
  • test/fixtures/*/. kadai/.last-action — fixture files updated to JSON format

Created by deer — review carefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant