Adding a New Tool
Prerequisites
- LAW repository installed and set up
- Basic understanding of Zod schemas
- Dependencies installed (
pnpm install
already run)
Video Tutorial
Generating the Tool Structure
- From the repository root:
pnpm new-tool [tool-name]
Follow interactive prompts for:
- Tool name (kebab-case)
- Execution parameters (name, type, description, Zod schema)
- Policy parameters (name, type, description)
Select build configuration matching existing tools:
- Bundler:
tsc
- Linter:
eslint
- Test runner:
jest
- Bundler:
Generated location: packages/aw-tools-[tool-name]
Implementing Tool Logic
1. Utility Functions
- Add helper functions to:
src/lib/lit-actions/utils/
2. Policy Validation
- Implement policies in:
src/lib/lit-actions/policies.ts
3. Core Implementation
- Import required utilities in:
src/lib/lit-actions/tool.ts
- Add execution logic at the marked section
Post-Installation
- Clean build artifacts:
pnpm clean
- Reinstall dependencies:
pnpm install
- Test execution:
pnpm start:cli