Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
44 lines
1.6 KiB
Go
44 lines
1.6 KiB
Go
package runtimeprep
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
// Computer use is delivered to agents through the daemon-owned `tutti computer`
|
|
// CLI (a cua-driver MCP the daemon drives), not through per-provider MCP
|
|
// injection. The sidecar's only job here is to advertise, per session, whether
|
|
// computer use is enabled — the agent runtime surfaces the `computerUse`
|
|
// capability from this marker, and the computer-use skill is injected when set.
|
|
const (
|
|
// computerUseSwitchEnv is the operator-facing master switch read from the
|
|
// tuttid process environment. Computer use is on by default; set to a falsy
|
|
// value ("0"/"false"/"off"/"no") to disable it for all sessions.
|
|
computerUseSwitchEnv = "TUTTI_COMPUTER_USE"
|
|
|
|
// computerUseEnabledSessionEnv is the per-session marker consumed by the
|
|
// agent runtime (packages/agent/daemon/runtime/computer_capability.go).
|
|
computerUseEnabledSessionEnv = "TUTTI_COMPUTER_USE_ENABLED"
|
|
)
|
|
|
|
// computerUseEnv returns the per-session env advertising computer use, or nil
|
|
// when it is disabled or unavailable.
|
|
func computerUseEnv(sessionEnabled bool) []string {
|
|
if !sessionEnabled || !ComputerUseDefaultEnabled() {
|
|
return nil
|
|
}
|
|
return []string{computerUseEnabledSessionEnv + "=1"}
|
|
}
|
|
|
|
// ComputerUseDefaultEnabled reports whether computer use is on. Defaults to true;
|
|
// only an explicit falsy value disables it. This is the operator master switch,
|
|
// not the runtime availability check.
|
|
func ComputerUseDefaultEnabled() bool {
|
|
switch strings.ToLower(strings.TrimSpace(os.Getenv(computerUseSwitchEnv))) {
|
|
case "0", "false", "off", "no":
|
|
return false
|
|
default:
|
|
return true
|
|
}
|
|
}
|