diff --git a/Makefile b/Makefile index 77e58f4b..9f3b5907 100644 --- a/Makefile +++ b/Makefile @@ -22,11 +22,8 @@ ifeq ($(shell uname),Darwin) @echo "Signed $(BINARY) for macOS" endif -install: build - cp $(BUILD_DIR)/$(BINARY) ~/.local/bin/$(BINARY) -ifeq ($(shell uname),Darwin) - @codesign -s - -f ~/.local/bin/$(BINARY) 2>/dev/null || true -endif +install: generate + go install -ldflags "$(LDFLAGS)" ./cmd/gt clean: rm -f $(BUILD_DIR)/$(BINARY) diff --git a/internal/beads/beads_types.go b/internal/beads/beads_types.go index b8c0ba22..eee42ccb 100644 --- a/internal/beads/beads_types.go +++ b/internal/beads/beads_types.go @@ -107,6 +107,7 @@ func EnsureCustomTypes(beadsDir string) error { typesList := strings.Join(constants.BeadsCustomTypesList(), ",") cmd := exec.Command("bd", "config", "set", "types.custom", typesList) cmd.Dir = beadsDir + cmd.Env = append(os.Environ(), "BEADS_DIR="+beadsDir) if output, err := cmd.CombinedOutput(); err != nil { return fmt.Errorf("configure custom types in %s: %s: %w", beadsDir, strings.TrimSpace(string(output)), err) diff --git a/internal/config/loader_test.go b/internal/config/loader_test.go index e99349e4..f881c795 100644 --- a/internal/config/loader_test.go +++ b/internal/config/loader_test.go @@ -981,9 +981,9 @@ func TestBuildAgentStartupCommand(t *testing.T) { // New signature: (role, rig, townRoot, rigPath, prompt) cmd := BuildAgentStartupCommand("witness", "gastown", "", "", "") - // Should contain environment exports and claude command - if !strings.Contains(cmd, "export") { - t.Error("expected export in command") + // Should contain environment prefix and claude command + if !strings.Contains(cmd, "exec env") { + t.Error("expected exec env in command") } if !strings.Contains(cmd, "GT_ROLE=witness") { t.Error("expected GT_ROLE=witness in command") diff --git a/internal/rig/manager_test.go b/internal/rig/manager_test.go index 82d99a8a..af5798ba 100644 --- a/internal/rig/manager_test.go +++ b/internal/rig/manager_test.go @@ -503,6 +503,9 @@ case "$cmd" in echo "$id" >> "$AGENT_LOG" printf '{"id":"%s","title":"%s","description":"","issue_type":"agent"}' "$id" "$title" ;; + config) + # Accept config commands + ;; slot) # Accept slot commands ;; @@ -512,7 +515,7 @@ case "$cmd" in ;; esac ` - windowsScript := "@echo off\r\nsetlocal enabledelayedexpansion\r\nif defined BEADS_DIR_LOG (\r\n if defined BEADS_DIR (\r\n echo %BEADS_DIR%>>\"%BEADS_DIR_LOG%\"\r\n ) else (\r\n echo ^ >>\"%BEADS_DIR_LOG%\"\r\n )\r\n)\r\nset \"cmd=%1\"\r\nset \"arg2=%2\"\r\nset \"arg3=%3\"\r\nif \"%cmd%\"==\"--no-daemon\" (\r\n set \"cmd=%2\"\r\n set \"arg2=%3\"\r\n set \"arg3=%4\"\r\n)\r\nif \"%cmd%\"==\"--allow-stale\" (\r\n set \"cmd=%2\"\r\n set \"arg2=%3\"\r\n set \"arg3=%4\"\r\n)\r\nif \"%cmd%\"==\"show\" (\r\n echo []\r\n exit /b 0\r\n)\r\nif \"%cmd%\"==\"create\" (\r\n set \"id=\"\r\n set \"title=\"\r\n for %%A in (%*) do (\r\n set \"arg=%%~A\"\r\n if /i \"!arg:~0,5!\"==\"--id=\" set \"id=!arg:~5!\"\r\n if /i \"!arg:~0,8!\"==\"--title=\" set \"title=!arg:~8!\"\r\n )\r\n if defined AGENT_LOG (\r\n echo !id!>>\"%AGENT_LOG%\"\r\n )\r\n echo {\"id\":\"!id!\",\"title\":\"!title!\",\"description\":\"\",\"issue_type\":\"agent\"}\r\n exit /b 0\r\n)\r\nif \"%cmd%\"==\"slot\" exit /b 0\r\nexit /b 1\r\n" + windowsScript := "@echo off\r\nsetlocal enabledelayedexpansion\r\nif defined BEADS_DIR_LOG (\r\n if defined BEADS_DIR (\r\n echo %BEADS_DIR%>>\"%BEADS_DIR_LOG%\"\r\n ) else (\r\n echo ^ >>\"%BEADS_DIR_LOG%\"\r\n )\r\n)\r\nset \"cmd=%1\"\r\nset \"arg2=%2\"\r\nset \"arg3=%3\"\r\nif \"%cmd%\"==\"--no-daemon\" (\r\n set \"cmd=%2\"\r\n set \"arg2=%3\"\r\n set \"arg3=%4\"\r\n)\r\nif \"%cmd%\"==\"--allow-stale\" (\r\n set \"cmd=%2\"\r\n set \"arg2=%3\"\r\n set \"arg3=%4\"\r\n)\r\nif \"%cmd%\"==\"show\" (\r\n echo []\r\n exit /b 0\r\n)\r\nif \"%cmd%\"==\"create\" (\r\n set \"id=\"\r\n set \"title=\"\r\n for %%A in (%*) do (\r\n set \"arg=%%~A\"\r\n if /i \"!arg:~0,5!\"==\"--id=\" set \"id=!arg:~5!\"\r\n if /i \"!arg:~0,8!\"==\"--title=\" set \"title=!arg:~8!\"\r\n )\r\n if defined AGENT_LOG (\r\n echo !id!>>\"%AGENT_LOG%\"\r\n )\r\n echo {\"id\":\"!id!\",\"title\":\"!title!\",\"description\":\"\",\"issue_type\":\"agent\"}\r\n exit /b 0\r\n)\r\nif \"%cmd%\"==\"config\" exit /b 0\r\nif \"%cmd%\"==\"slot\" exit /b 0\r\nexit /b 1\r\n" binDir := writeFakeBD(t, script, windowsScript) agentLog := filepath.Join(t.TempDir(), "agents.log")