feat: Implement Uplink remote management system#6
Open
MiniCodeMonkey wants to merge 55 commits intomainfrom
Open
feat: Implement Uplink remote management system#6MiniCodeMonkey wants to merge 55 commits intomainfrom
MiniCodeMonkey wants to merge 55 commits intomainfrom
Conversation
Replace manual flag parsing with Cobra command tree. All existing commands (new, edit, status, list, wiggum) and flags (--max-iterations, --no-sound, --no-retry, --verbose, --merge, --force, --help, --version) are preserved. TUI remains the default when no subcommand is given. Clean, organized help output with command grouping. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create internal/engine package that wraps loop.Manager with fan-out event subscription, enabling multiple concurrent consumers (TUI and future WebSocket handler). Refactor TUI to consume events from engine instead of directly from loop.Manager. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pment Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…elease Dev builds from git describe (e.g. v0.4.0-61-gd06835b) were compared as plain strings against the latest release tag, causing a false "update available" prompt. Extract the base semver from git-describe suffixes so builds ahead of a tag are recognized as current.
The CLI was directing users to /device but the web app serves the device code entry page at /oauth/device.
Running `chief serve` without --workspace produced a confusing error with an empty path. Now defaults to the current directory and resolves to an absolute path before validation.
…efresh The Go client previously hardcoded the WS URL, but on Laravel Cloud the Reverb WebSocket server runs at a separate hostname. Include ws_url in OAuth token responses so the client discovers it automatically during login and refresh, storing it in credentials.yaml. WS URL precedence: flag > env > user config > credentials > default.
Add internal/uplink package with HTTP client for the device API. Replaces WebSocket-based connect/disconnect with HTTP POST endpoints. - Client struct with functional options pattern (matching ws.Client style) - Connect(ctx) calls POST /api/device/connect, returns WelcomeResponse with Reverb config - Disconnect(ctx) calls POST /api/device/disconnect - HTTPS enforcement with localhost/127.0.0.1 exception - Thread-safe SetAccessToken() for token refresh - ConnectWithRetry() with exponential backoff + jitter (same pattern as ws.Client) - Auth error classification (401/403 not retried) - 20 unit tests with httptest mock server
…oding Set explicit Origin header on WebSocket dial to satisfy Reverb's origin check. Double-unmarshal the connection_established data field to match the real Pusher wire format (JSON string containing JSON). Update test helper to match the real protocol.
Strip the -dirty suffix before parsing so dev builds like "0.4.0-81-g1d1ebf3-dirty" correctly resolve to base version "0.4.0" instead of being treated as a different version.
The server requires grant_type=refresh_token in the request body and returns HTML error pages without an Accept: application/json header, causing JSON parse failures on refresh.
…ages
The server's CommandRelayController sends commands wrapped in
{"type": ..., "payload": {...}} but handlers expected fields at the
top level. Extract the payload before dispatching to handlers.
Add shared JSON fixtures and contract tests that verify both sides agree on the wire format. Catches serialization mismatches (like port-as-string, name-vs-project_slug, payload wrapper) with zero infrastructure — just unit tests against canonical fixture files. Also fixes mock Pusher server to double-encode connection_established data, matching the real Pusher protocol. - contract/fixtures/ synced from chief-uplink (source of truth) - internal/contract/contract_test.go: 9 contract tests - Makefile: sync-fixtures and test-contract targets - .gitignore: exclude synced fixtures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the Uplink feature — a complete remote management and control system for Chief. This enables a central server to manage Chief instances running on remote machines via WebSocket, supporting remote PRD sessions, run control, file watching, project management, and automated deployment.
Changes
CLI Foundation
Authentication
chief login/chief logoutwith automatic token refresh (US-003, US-004)WebSocket Communication Layer
Server Mode (
chief serve)Remote Operations
chief updatetriggered via WebSocket (US-022, US-023)Deployment
Stats