Commit Graph

4 Commits

Author SHA1 Message Date
rictus
478dc60db1 feat(connection): Add extended address parser (gt-f9x.10)
Implement address parsing for cross-machine operations:

Format: [machine:]rig[/polecat]

Examples:
- gastown/rictus -> local, gastown rig, rictus polecat
- vm:gastown/rictus -> vm machine, gastown rig, rictus
- gastown/ -> broadcast to gastown rig

Address struct with:
- ParseAddress() parser with validation
- String() canonical form
- IsLocal(), IsBroadcast() predicates
- Equal() comparison (normalizes local machine)
- Validate() against MachineRegistry
- RigPath() for rig/polecat without machine prefix

Includes comprehensive test coverage.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:24:51 -08:00
rictus
0013cc0f19 feat(connection): Add MachineRegistry for federation support (gt-f9x.9)
Implement MachineRegistry that manages machine configurations and
provides Connection instances for local and remote operations:

- Machine struct with name, type, host, key path, and town path
- Registry with JSON persistence (federation.json)
- CRUD operations: Get, Add, Remove, List
- Connection factory that returns appropriate Connection type
- Built-in "local" machine that cannot be removed

SSH connections return an error until SSHConnection is implemented.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:24:51 -08:00
rictus
b4ff6781b3 feat(connection): Add LocalConnection implementation (gt-f9x.8)
Implement LocalConnection that provides local file operations, command
execution, and tmux integration:

- File ops: ReadFile, WriteFile, MkdirAll, Remove, RemoveAll, Stat, Glob, Exists
- Command exec: Exec, ExecDir, ExecEnv
- Tmux: NewSession, KillSession, SendKeys, CapturePane, HasSession, ListSessions

Uses proper error wrapping with NotFoundError and PermissionError types.
Integrates with existing internal/tmux package for session management.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:20:32 -08:00
rictus
ca3c6da8ec feat(connection): Add Connection interface for local/remote ops (gt-f9x.7)
Define the Connection interface that abstracts file operations, command
execution, and tmux management for both local and remote (SSH) contexts.

Includes:
- Connection interface with file, exec, and tmux operations
- FileInfo interface for remote stat results
- BasicFileInfo implementation with JSON serialization
- Error types for connection failures

This enables Gas Town to manage rigs on remote machines using the
same interface as local operations.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:20:32 -08:00