paths

package
v0.8.69 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package paths centralizes the on-host filesystem layout for Dejima.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountAuthorizedKeysPath

func AccountAuthorizedKeysPath() (string, error)

AccountAuthorizedKeysPath returns ~/.dejima/ssh_authorized_keys — the account-wide allow-set of public keys that may ssh into *every* island (current and future). Consulted in addition to each island's own authorized_keys, so registering a key once grants fleet-wide access without per-island seeding. 0600.

func AuthTokensPath

func AuthTokensPath() (string, error)

AuthTokensPath returns ~/.dejima/tokens.json — the store of issued operator bearer tokens (owner/operator/viewer roles + optional per-island scope) for the team-auth path. Only token *metadata* and a SHA-256 of each secret are kept here (never the raw bearer), so a leaked file can't be replayed. 0600, daemon-host-only, outside every container's blast radius.

func AuthorizedKeysPath

func AuthorizedKeysPath(name string) (string, error)

AuthorizedKeysPath returns ~/.dejima/projects/<name>/ssh/authorized_keys — the public keys permitted to ssh into this island via the daemon's façade.

func CapabilitiesDir

func CapabilitiesDir() (string, error)

CapabilitiesDir returns ~/.dejima/capabilities, creating it (0700). It holds the user-authored executables the capability broker's script adapter runs (docs/capability-broker-spec.md §2.2). Owned by the daemon user and not island-writable — that is the curation boundary.

func ClaudeSeedDir

func ClaudeSeedDir() (string, error)

ClaudeSeedDir returns ~/.dejima/secrets/claude — where the daemon materializes Claude credentials (from the host Keychain/file or a `dejima auth push`) for read-only mounting into islands. Created 0700.

func DaemonInstallMetaPath

func DaemonInstallMetaPath() (string, error)

DaemonInstallMetaPath returns ~/.dejima/daemon-install.json — install context recorded by `dejima service install` (the source checkout dir and whether it's a system service) so the daemon can update + restart itself correctly.

func GitHubIslandConfigDir

func GitHubIslandConfigDir(name string) (string, error)

GitHubIslandConfigDir returns the per-island gh config dir the daemon materializes (containing a single-identity hosts.yml) and mounts read-only at /opt/host/gh-config when an island uses a specific GitHub identity. Created 0700.

func GitHubIslandConfigPath

func GitHubIslandConfigPath(name string) (string, error)

GitHubIslandConfigPath returns the per-island gh config dir path WITHOUT creating it — for cleanup when an island is torn down.

func GitHubSecretsDir

func GitHubSecretsDir() (string, error)

GitHubSecretsDir returns ~/.dejima/secrets/github — the daemon's store of GitHub identities and the per-island gh configs materialized from them. Created 0700.

func HostClaudeDir

func HostClaudeDir() (string, error)

HostClaudeDir returns the user's ~/.claude dir (may not exist).

func HostCodexDir

func HostCodexDir() (string, error)

HostCodexDir returns the user's ~/.codex dir (may not exist).

func HostGHConfigDir

func HostGHConfigDir() (string, error)

HostGHConfigDir returns the user's ~/.config/gh dir (may not exist).

func HostGitConfig

func HostGitConfig() (string, error)

HostGitConfig returns the user's ~/.gitconfig path (may not exist).

func HostKeyPath

func HostKeyPath() (string, error)

HostKeyPath returns ~/.dejima/ssh_host_ed25519 — the daemon's SSH host key for the SSH-façade listener. One key for the daemon (it is the single SSH front door for every island), generated on first use, 0600.

func IslandSecretsDir added in v0.8.28

func IslandSecretsDir(name string) (string, error)

IslandSecretsDir returns ~/.dejima/secrets/islands/<name> — the daemon-side store of an island's secrets, plus the KEY=VALUE file bind-mounted into it. Created 0700; sits under the same secrets/ root as the GitHub identities.

func IslandSecretsPath added in v0.8.28

func IslandSecretsPath(name string) (string, error)

IslandSecretsPath returns an island's secrets dir WITHOUT creating it — for cleanup when the island is torn down.

func LLMIslandConfigDir

func LLMIslandConfigDir(name string) (string, error)

LLMIslandConfigDir returns the per-island LLM config dir the daemon materializes (containing one <provider>.env per referenced provider) and mounts read-only at /opt/host/llm. Created 0700.

func LLMIslandConfigPath

func LLMIslandConfigPath(name string) (string, error)

LLMIslandConfigPath returns the per-island LLM config dir path WITHOUT creating it — for cleanup when an island is torn down (it holds plaintext provider keys, so it lives under secrets/ and must be removed on teardown).

func LLMSecretsDir

func LLMSecretsDir() (string, error)

LLMSecretsDir returns ~/.dejima/secrets/llm — the daemon's store of LLM provider credentials (provider→api_key) and the per-island provider configs materialized from them. Created 0700.

func LedgerPath

func LedgerPath() (string, error)

LedgerPath returns ~/.dejima/ledger.jsonl — the append-only, hash-chained audit log of brokered Port operations (scope grants and file Trades).

func LinksDir

func LinksDir() (string, error)

LinksDir returns ~/.dejima/links — the daemon's store of inter-island link grants (Lane 5, Phase 2). Created 0700.

func PanicFlagPath

func PanicFlagPath() (string, error)

PanicFlagPath returns ~/.dejima/PANIC — the presence of this file stops the daemon from auto-starting (adopting) any island at startup. Written by `dejima panic`, removed by `dejima panic --clear`.

func PolicyDir added in v0.6.0

func PolicyDir() (string, error)

PolicyDir returns ~/.dejima/policy — the daemon's store of action-gate auto-approve rules (Lane 5, Phase 3.x). Created 0700.

func ProjectConfigPath

func ProjectConfigPath(name string) (string, error)

ProjectConfigPath returns ~/.dejima/projects/<name>/config.toml, creating the island's directory. For writers — Save needs somewhere to write to.

func ProjectConfigPathRead added in v0.8.66

func ProjectConfigPathRead(name string) (string, error)

ProjectConfigPathRead is ProjectConfigPath for readers: the same path, creating nothing.

A read that creates is not a read. Asking whether island "x" exists used to bring ~/.dejima/projects/x/ into being and then answer "no", which is wrong on its own terms and had two observable consequences:

  • Stray directories in the operator's real ~/.dejima, one per island name anything ever looked up. Four of them were sitting in this container.
  • The internal/api test flake. project.Load runs inside detached goroutines (the mailbox arrival hook), which outlive the test that started them. By the time one lands, $HOME is either the NEXT test's t.TempDir — where re-creating .dejima during RemoveAll gives "unlinkat: directory not empty" — or, if no test is running, the developer's real home.

The goroutines outliving their test is a separate defect and is still true. This makes their filesystem footprint nil, which is what turns the flake off.

func ProjectDir

func ProjectDir(name string) (string, error)

ProjectDir returns ~/.dejima/projects/<name>/, creating it if necessary.

func ProjectsDir

func ProjectsDir() (string, error)

ProjectsDir returns ~/.dejima/projects, creating it if necessary.

func Root

func Root() (string, error)

Root returns ~/.dejima, creating it if necessary.

func SSHDir

func SSHDir(name string) (string, error)

SSHDir returns ~/.dejima/projects/<name>/ssh — the per-island SSH dir holding authorized_keys (the public keys allowed to ssh into this island). Created 0700.

func SocketPath

func SocketPath() (string, error)

SocketPath returns the Unix socket the daemon listens on.

func SpawnDir added in v0.6.9

func SpawnDir() (string, error)

SpawnDir returns ~/.dejima/spawn — the daemon's store of operator-granted ephemeral-sub-agent spawn budgets (per island). Created 0700.

func TokenPath

func TokenPath(name string) (string, error)

TokenPath returns ~/.dejima/projects/<name>/token — the per-island bearer token for the authenticated in-island → dejimad path (macOS autonomy route).

Types

This section is empty.

Jump to

Keyboard shortcuts

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