shared

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PortableMemoryDir  = "/claw/memory"
	PortableMemoryEnv  = "CLAW_MEMORY_DIR"
	PortableHistoryDir = "/claw/history"
	PortableHistoryEnv = "CLAW_HISTORY_DIR"
)

Variables

This section is empty.

Functions

func CollectProviders added in v0.2.0

func CollectProviders(models map[string]string) []string

CollectProviders returns a sorted unique provider list from MODEL refs.

func ExecInContainer added in v0.3.0

func ExecInContainer(
	ctx context.Context,
	cli *client.Client,
	containerID string,
	cmd []string,
) (stdout, stderr string, exitCode int, err error)

func ExpectedProviderKeys added in v0.2.0

func ExpectedProviderKeys(provider string) []string

func GenerateClawdapusMD

func GenerateClawdapusMD(rc *driver.ResolvedClaw, podName string) string

GenerateClawdapusMD builds the CLAWDAPUS.md context file — the infrastructure layer's letter to the agent. Contains identity, surfaces, and skill index. Injected into the agent's context via bootstrap-extra-files hook.

func IsFiveFieldCron added in v0.3.0

func IsFiveFieldCron(expr string) bool

func MergeTree added in v0.4.2

func MergeTree(dstDir, srcDir string) error

MergeTree recursively copies regular files from srcDir into dstDir without overwriting files that already exist in dstDir. Symlinks and special files are ignored.

func NormalizeProvider added in v0.2.0

func NormalizeProvider(provider string) string

func ParseConfigSetCommand added in v0.3.0

func ParseConfigSetCommand(line, driverPrefix string) (path string, value any, err error)

func PlatformTokenVar

func PlatformTokenVar(platform string) string

PlatformTokenVar returns the conventional env var name for a platform's bot token.

func PreparePortableHistory added in v0.4.2

func PreparePortableHistory(stateDir string, extraImportRoots ...string) (string, error)

PreparePortableHistory creates a read-oriented cross-driver history archive for one service and opportunistically imports native runner session stores. It is intentionally additive: existing files win, and imported history keeps runner-specific formats under subdirectories.

func PreparePortableMemory added in v0.4.2

func PreparePortableMemory(stateDir string, extraImportRoots ...string) (string, error)

PreparePortableMemory creates the canonical cross-driver memory directory for one service runtime and opportunistically imports memory from older layouts.

func PrimaryModelRef added in v0.3.0

func PrimaryModelRef(models map[string]string) (string, error)

func ProviderAllowsEmptyAPIKey added in v0.2.0

func ProviderAllowsEmptyAPIKey(provider string) bool

func ResolveEnvToken added in v0.2.0

func ResolveEnvToken(raw string) string

func ResolveEnvTokenFromMap added in v0.2.0

func ResolveEnvTokenFromMap(env map[string]string, key string) string

func ResolveProviderAPIKey added in v0.2.0

func ResolveProviderAPIKey(provider string, env map[string]string) string

func ResolveStateDir added in v0.4.2

func ResolveStateDir(runtimeDir, stateDir string) string

ResolveStateDir picks the durable host state directory when one is provided, otherwise it falls back to the runtime directory for call sites that have not yet been wired for persistence-aware tests.

func SetPath added in v0.3.0

func SetPath(obj map[string]any, path string, value any) error

func SplitModelRef added in v0.2.0

func SplitModelRef(ref string) (string, string, bool)

SplitModelRef splits provider/model refs and applies the default anthropic provider for bare model IDs.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL