mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-09 11:10:10 +00:00
* refactor: extract shared test helpers and utilities Created centralized test-helpers.ts module to eliminate duplication across test files: **Extracted Helpers:** - createMockManifest() - Reusable mock manifest data - createEmptyManifest() - Empty manifest for edge cases - createConsoleMocks() - Console spy setup - createProcessExitMock() - Process exit mock - restoreMocks() - Mock cleanup utility - mockSuccessfulFetch() - Simplified successful fetch mock - mockFailedFetch() - Simplified failed fetch mock - mockFetchWithStatus() - Fetch mock with custom status - setupTestEnvironment() - Test directory and env setup - teardownTestEnvironment() - Cleanup utility **Deduplication Impact:** - commands.test.ts: Removed 50+ lines of duplicate mock setup - manifest.test.ts: Removed 80+ lines of duplicate manifest data and setup code - integration.test.ts: Removed 40+ lines of duplicate setup/teardown **Benefits:** - Single source of truth for test fixtures - Consistent mock patterns across all tests - Easier maintenance - changes to test setup in one place - Improved test readability Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor: Add non-interactive mode for agent execution Implements --prompt and --prompt-file flags to enable non-interactive agent execution. This allows users to: - Execute agents with a prompt and exit automatically - Use spawn in CI/CD pipelines and automation scripts - Pass prompts via command line or file Changes: - TypeScript CLI: Parse --prompt/-p and --prompt-file flags - Security: Add validatePrompt() to prevent command injection - Commands: Pass prompt via SPAWN_PROMPT env var to bash scripts - Bash scripts: Detect SPAWN_PROMPT and fork interactive/non-interactive - Help text: Document new flags with examples Implementation: - claude.sh: Use 'claude -p' for non-interactive execution - aider.sh: Use 'aider -m' for non-interactive execution - shared/common.sh: Add execute_agent_non_interactive() helper Security: - Validates prompts for command injection patterns - Length limit: 10KB max - Blocks $(), backticks, piping to bash/sh - Uses printf %q for proper shell escaping Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * docs: Add testing guide for non-interactive mode Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Sprite <noreply@sprite.dev> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .claude/rules | ||
| lib | ||
| aider.sh | ||
| amazonq.sh | ||
| claude.sh | ||
| cline.sh | ||
| codex.sh | ||
| gemini.sh | ||
| goose.sh | ||
| gptme.sh | ||
| interpreter.sh | ||
| nanoclaw.sh | ||
| openclaw.sh | ||
| opencode.sh | ||
| README.md | ||
Sprite
Sprites.dev managed VMs with CLI. Sprite
Agents
Claude Code
bash <(curl -fsSL https://openrouter.ai/lab/spawn/sprite/claude.sh)
OpenClaw
bash <(curl -fsSL https://openrouter.ai/lab/spawn/sprite/openclaw.sh)
NanoClaw
bash <(curl -fsSL https://openrouter.ai/lab/spawn/sprite/nanoclaw.sh)
Aider
bash <(curl -fsSL https://openrouter.ai/lab/spawn/sprite/aider.sh)
Goose
bash <(curl -fsSL https://openrouter.ai/lab/spawn/sprite/goose.sh)
Codex CLI
bash <(curl -fsSL https://openrouter.ai/lab/spawn/sprite/codex.sh)
Open Interpreter
bash <(curl -fsSL https://openrouter.ai/lab/spawn/sprite/interpreter.sh)
Gemini CLI
bash <(curl -fsSL https://openrouter.ai/lab/spawn/sprite/gemini.sh)
Amazon Q CLI
bash <(curl -fsSL https://openrouter.ai/lab/spawn/sprite/amazonq.sh)
Cline
bash <(curl -fsSL https://openrouter.ai/lab/spawn/sprite/cline.sh)
Non-Interactive Mode
SPRITE_NAME=dev-mk1 \
OPENROUTER_API_KEY=sk-or-v1-xxxxx \
bash <(curl -fsSL https://openrouter.ai/lab/spawn/sprite/claude.sh)