Skip to content

feat: add INPUTS_JSON environment variable for type preservation#13

Merged
izumin5210 merged 1 commit intomainfrom
feat/inputs-json
Aug 25, 2025
Merged

feat: add INPUTS_JSON environment variable for type preservation#13
izumin5210 merged 1 commit intomainfrom
feat/inputs-json

Conversation

@izumin5210
Copy link
Owner

Summary

  • Add INPUTS_JSON environment variable that passes all inputs as a single JSON object
  • Preserve type information (numbers stay as numbers, booleans as booleans) for non-shell interpreters
  • Maintain full backward compatibility with existing INPUTS__ prefixed environment variables

Motivation

When using non-shell interpreters (Node.js, Python, Deno), all environment variables are strings, requiring manual type conversion. This adds complexity and potential bugs. The new INPUTS_JSON environment variable solves this by preserving the original types.

Changes

  • executor.ts: Added INPUTS_JSON environment variable alongside existing individual variables
  • Tests: Added comprehensive unit tests and E2E tests
  • Documentation: Updated README with usage examples and benefits

Test plan

  • Unit tests for type preservation in executor.test.ts
  • E2E tests for MCP server integration in server.test.ts
  • Tests pass for Node.js, Python examples
  • Backward compatibility verified

🤖 Generated with Claude Code

- Add INPUTS_JSON env var that passes all inputs as JSON
- Preserve type information (numbers, booleans) for non-shell interpreters
- Maintain backward compatibility with individual INPUTS__ variables
- Add comprehensive tests for the new feature
- Update documentation with usage examples

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@izumin5210 izumin5210 merged commit bf3e929 into main Aug 25, 2025
4 checks passed
@izumin5210 izumin5210 deleted the feat/inputs-json branch August 25, 2025 16:24
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