Phase 0: turn Supermarket into a Dockerized local web app
Replace the old Go TUI with a web app (port 8470) that runs in a container as a CoreDesktop sibling: - cmd/supermarket server with htmx web UI: dashboard, company profile, inventory (partners/competitors), AI and credential settings, and a Core & Hermes page - SQLite storage and a secrets store under ~/.local/share/supermarket - AI providers (Anthropic, OpenAI-compatible) behind one interface - MCP server and a Hermes bridge to the Federated Core MCP hub - Import of the old Coremarketing TUI's state - install.sh / update.sh / lib.sh, Dockerfile, compose.yaml, the bin/supermarket launcher and hermes/setup.sh Posting is not wired back up yet; that comes in Phase 1. See PLAN.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const sample = `credentials:
|
||||
twitter:
|
||||
oauth2_access_token: "old-access"
|
||||
oauth2_refresh_token: "old-refresh"
|
||||
linkedin:
|
||||
access_token: ""
|
||||
author_urn: ""
|
||||
`
|
||||
|
||||
func TestUpdateTokensDoesNotTouchOtherSections(t *testing.T) {
|
||||
path := filepath.Join(t.TempDir(), "config.yaml")
|
||||
if err := os.WriteFile(path, []byte(sample), 0600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := UpdateOAuth2Tokens(path, "new-access", "new-refresh"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := UpdateLinkedInCredentials(path, "li-token", "urn:li:person:1"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
data, _ := os.ReadFile(path)
|
||||
got := string(data)
|
||||
for _, want := range []string{
|
||||
`oauth2_access_token: "new-access"`,
|
||||
`oauth2_refresh_token: "new-refresh"`,
|
||||
` access_token: "li-token"`,
|
||||
`author_urn: "urn:li:person:1"`,
|
||||
} {
|
||||
if !strings.Contains(got, want) {
|
||||
t.Errorf("missing %q in:\n%s", want, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user