Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ Binary message-type IDs encode role bits 7–2 / slot bits 1–0 per spec. Binar

- **`internal/server`**: Audio engine, source decoders, Opus/FLAC encoders, resampler, server TUI. `pkg/sendspin.Server` is a façade over this.
- **`internal/ui`**: bubbletea models, hotkey/device-picker widgets shared by both binaries.
- **`internal/discovery`**: mDNS plumbing (TXT parsing, browse loops) used by `pkg/discovery`.
- **`internal/version`**: ldflags version target.

The legacy `internal/{app,artwork,audio,client,player,protocol,sync}` packages were deleted in the v1.2 "rip-legacy-cli" sweep. Do not reintroduce that layering.
Expand Down
5 changes: 3 additions & 2 deletions docs/superpowers/plans/2026-06-11-three-repo-split.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ Each phase is independently shippable and keeps `make test` + `make conformance`
- Gate: `make test` green locally (12→ same after the file moves); `make conformance` runs in CI. **No public API change** — all symbols kept the same package + names, so the conformance adapter and external importers are unaffected.

### Phase 2 — Promote cross-boundary `internal/` to public `pkg/` (still one module)
- [ ] Promote `internal/discovery` `Manager`/types → `pkg/discovery`; repoint `server.go`/`client_dialer.go`.
- [ ] Promote encoders → `pkg/audio/encode`; repoint `server.go`/`server_client.go`/`role_player.go`. Verify both `make test` and `make BUILDTAGS= test` (the opus.Stream path).
- [x] Promote `internal/discovery` → `pkg/discovery` (verbatim move; repointed `main.go`, `server.go`, `client_dialer.go`). `pkg/sendspin` no longer imports `internal/discovery`.
- [ ] Promote encoders → `pkg/audio/encode`; repoint `server.go`/`server_client.go`/`role_player.go`. Verify both `make test` and `make BUILDTAGS= test` (the opus.Stream path). **Note:** `internal/server` has its own `AudioSource` interface and `Default*` constants entangled with the sources — reconcile when moving sources.
- [ ] Promote source decoders → `pkg/audio/source`; leave server TUI in `internal/`.
- Gate (critical checkpoint): SDK has **zero cross-boundary `internal/` imports**; `make test` + `make conformance` green.

Expand Down Expand Up @@ -130,3 +130,4 @@ Each phase is independently shippable and keeps `make test` + `make conformance`

- 2026-06-11: Plan written. Phase 0 complete (in one PR): removed the dead legacy `internal/server` server, the orphaned `pkg/discovery` and `pkg/audio/encode` packages, dead `ResampledSource`/`internal/server/resampler.go`, and fixed stale protocol godoc. `NewFileSource` stub deferred to Phase 1. Net ~1.4 KLOC of dead code removed.
- 2026-06-11: Phase 1 complete — decomposed `pkg/sendspin` by file (in place, same package, no public API change): hoisted shared constants to `constants.go`, split `config.go` into common/player/server, split `source.go` and removed the `NewFileSource` stub, moved `containsRole` to `receiver.go`. Sets up the eventual client/server package split as a mechanical move.
- 2026-06-11: Phase 2 (1/3) — promoted `internal/discovery` → `pkg/discovery` (verbatim move, repointed importers). Encoders and source decoders are the remaining two promotions; they need interface/constant reconciliation (`internal/server` has its own `AudioSource`) so they land as separate PRs.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"syscall"
"time"

"github.com/Sendspin/sendspin-go/internal/discovery"
"github.com/Sendspin/sendspin-go/internal/ui"
"github.com/Sendspin/sendspin-go/internal/version"
"github.com/Sendspin/sendspin-go/pkg/audio/output"
"github.com/Sendspin/sendspin-go/pkg/discovery"
"github.com/Sendspin/sendspin-go/pkg/sendspin"
tea "github.com/charmbracelet/bubbletea"
)
Expand Down
3 changes: 3 additions & 0 deletions internal/discovery/mdns.go → pkg/discovery/mdns.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// ABOUTME: mDNS service discovery for Sendspin Protocol
// ABOUTME: Handles both advertisement (server-initiated) and browsing (client-initiated)

// Package discovery provides mDNS service discovery for Sendspin: advertising a
// server, and browsing for servers (client side) or clients (server side).
package discovery

import (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/sendspin/client_dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"sync"
"time"

"github.com/Sendspin/sendspin-go/internal/discovery"
"github.com/Sendspin/sendspin-go/pkg/discovery"
"github.com/gorilla/websocket"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sendspin/client_dialer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"
"time"

"github.com/Sendspin/sendspin-go/internal/discovery"
"github.com/Sendspin/sendspin-go/pkg/discovery"
)

func TestClientInfoURL(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/sendspin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"sync/atomic"
"time"

"github.com/Sendspin/sendspin-go/internal/discovery"
"github.com/Sendspin/sendspin-go/internal/server"
"github.com/Sendspin/sendspin-go/pkg/discovery"
"github.com/Sendspin/sendspin-go/pkg/protocol"
"github.com/google/uuid"
"github.com/gorilla/websocket"
Expand Down
Loading