OpenWriterControle/scripts
darrenhinde bc8a322550 feat: enhance installation system with universal path transformation
Add support for custom global installation paths with automatic context
reference transformation. This enables users to install to any location
while maintaining working context references.

Changes:
- Add universal path transformation for ANY global installation path
  (not just ~/.config/opencode)
- Implement automatic cleanup trap for temp files on exit/crash/interrupt
- Add early validation for --install-dir argument with clear error messages
- Add developer documentation for context reference convention

Technical Details:
- Path transformation detects local vs global by checking if path ends
  in .opencode (local) or not (global)
- Transformation applies to ALL file types during installation
- sed transforms both @ references and shell command paths
- Cleanup trap handles EXIT, INT, and TERM signals

Testing:
- 31 unit and integration tests (100% pass rate)
- All README installation scenarios verified
- Edge cases tested and handled
- Cross-platform compatible (macOS, Linux, Windows Git Bash)

Documentation:
- Added dev/docs/context-reference-convention.md explaining the required
  @.opencode/context/ format and why it's necessary
- Includes examples, validation instructions, and test results

Breaking changes: None
New capabilities: Custom global path support
2025-11-19 11:22:48 +00:00
..
tests Rename to OpenAgents, remove model specs, and update documentation 2025-11-18 22:37:41 +00:00
cleanup-stale-sessions.sh ✨ feat: introduce OpenAgent universal agent with session management 2025-11-18 18:45:42 +00:00
README.md Rename to OpenAgents, remove model specs, and update documentation 2025-11-18 22:37:41 +00:00
register-component.sh fix: simplify registration script to preserve manual registry 2025-11-17 23:43:13 +00:00
uninstall.sh feat: enhance installation system with universal path transformation 2025-11-19 11:22:48 +00:00
validate-component.sh feat: add interactive installer with component registry system 2025-11-17 23:43:13 +00:00
validate-context-refs.sh feat: enhance installation system with universal path transformation 2025-11-19 11:22:48 +00:00

Scripts

This directory contains utility scripts for the OpenAgents system.

Available Scripts

Component Management

  • register-component.sh - Register a new component in the registry
  • validate-component.sh - Validate component structure and metadata

Session Management

  • cleanup-stale-sessions.sh - Remove stale agent sessions older than 24 hours

Testing

See tests/ subdirectory for test scripts.

Session Cleanup

Agent instances create temporary context files in .tmp/sessions/{session-id}/ for subagent delegation. These sessions are automatically cleaned up, but you can manually remove stale sessions:

# Clean up sessions older than 24 hours
./scripts/cleanup-stale-sessions.sh

# Or manually delete all sessions
rm -rf .tmp/sessions/

Sessions are safe to delete anytime - they only contain temporary context files for agent coordination.

Usage Examples

Register a Component

./scripts/register-component.sh path/to/component

Validate a Component

./scripts/validate-component.sh path/to/component

Clean Stale Sessions

./scripts/cleanup-stale-sessions.sh