paths

package
v1.16.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package paths provides centralized path resolution for the DevClaw application. All data is stored in ./data/ relative to the project root.

Index

Constants

View Source
const AppName = "devclaw"

AppName is the application name used for the state directory.

View Source
const ConfigPathEnv = "DEVCLAW_CONFIG_PATH"

ConfigPathEnv is the environment variable for custom config path.

View Source
const StateDirEnv = "DEVCLAW_STATE_DIR"

StateDirEnv is the environment variable for custom state directory.

Variables

This section is empty.

Functions

func EnsureStateDirs

func EnsureStateDirs() error

EnsureStateDirs creates the state directory structure if it doesn't exist.

func EnsureWorkspaceTemplates added in v1.16.0

func EnsureWorkspaceTemplates() error

EnsureWorkspaceTemplates creates default template files in configs/templates/ if they don't already exist. These templates are used as defaults when scaffolding new workspace directories for non-main agents.

func ResolveConfigPath

func ResolveConfigPath() string

ResolveConfigPath returns the config file path. Precedence: DEVCLAW_CONFIG_PATH > ./config.yaml

func ResolveDataDir

func ResolveDataDir() string

ResolveDataDir returns the data directory path.

func ResolveDatabasePath

func ResolveDatabasePath(filename string) string

ResolveDatabasePath returns the database file path.

func ResolveMediaDir

func ResolveMediaDir() string

ResolveMediaDir returns the media directory path.

func ResolveMediaPath

func ResolveMediaPath(channel, sessionID string) string

ResolveMediaPath returns the media path for a specific channel and session. Input is sanitized to prevent path traversal attacks.

func ResolvePluginsDir

func ResolvePluginsDir() string

ResolvePluginsDir returns the plugins directory path.

func ResolveSessionsDir

func ResolveSessionsDir() string

ResolveSessionsDir returns the sessions directory path.

func ResolveSkillsDir

func ResolveSkillsDir() string

ResolveSkillsDir returns the skills directory path.

func ResolveStateDir

func ResolveStateDir() string

ResolveStateDir returns the project root directory.

func ResolveVaultPath

func ResolveVaultPath() string

ResolveVaultPath returns the vault file path.

func ResolveWorkspaceDir added in v1.16.0

func ResolveWorkspaceDir(wsID string) string

ResolveWorkspaceDir returns the workspace directory for a given workspace ID. Main agent uses "workspace", others use "workspace-{id}". The wsID is sanitized to prevent path traversal.

func ResolveWorkspaceTemplatesDir added in v1.16.0

func ResolveWorkspaceTemplatesDir() string

ResolveWorkspaceTemplatesDir returns the workspace templates directory path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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