command_components_dodder

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const XDGUtilityNameMadder = "madder"

XDGUtilityNameMadder is the literal scope segment for madder's XDG namespace. Used as the second-env scope in env_repo.Make's two-env composition.

Variables

This section is empty.

Functions

func MakeOperateEnvDir added in v0.2.6

func MakeOperateEnvDir(
	req command.Request,
	config repo_config_cli.Config,
	utilityName string,
) mad_env_dir.Env

MakeOperateEnvDir builds one env_dir slot for the nearest-operate repo paths (show/query/edit, serve, info xdg/env), honoring every FDR-0019 cwd scope that resolves against an *existing* repo:

  • system (`//name`) and explicit user (`name`): MakeDefaultAndInitialize preserves the scoped_id's LocationType — system roots at the system root (#280); an explicit XDG-user bare name pins to the XDG-user home with NO cwd walk-up (FDR-0019: bare name is XDG-user scope unconditionally, so it must not be hijacked to a workspace-local repo by an ancestor .dodder/).
  • multi-dot cwd (`..name`, cwdDepth > 0): the Nth same-named ancestor, resolved store-aware via resolveCwdRepoAncestor, then rooted there (#281).
  • everything else (auto, single-dot `.name`): MakeDefault's nearest-ancestor walk, unchanged.

utilityName selects the slot: the dodder metadata slot nests under repos/<name>/; the madder blob slot stays flat (repoName ""). Call it once per slot. The literal-init paths (genesis, MakeEnvRepo) deliberately stay on MakeDefaultAndInitialize(EffectiveId) instead — see repo_id.CheckSupported.

Exported because info's env/xdg display (uniform) shares it with the tango repo builders, so `info ..name xdg` reports the same path `show ..name` operates on.

Types

type BlobStore

type BlobStore struct{}

func (BlobStore) GetFlagValueBlobIds

func (cmd BlobStore) GetFlagValueBlobIds(
	blobStoreId *blob_store_id.Id,
) interfaces.FlagValue

func (*BlobStore) MakeBlobStoreFromIdOrConfigPath

func (cmd *BlobStore) MakeBlobStoreFromIdOrConfigPath(
	envBlobStore env_repo.BlobStoreEnv,
	basePath string,
	blobStoreIndexOrConfigPath string,
) (blobStore blob_stores.BlobStoreInitialized)

func (*BlobStore) MakeBlobStoreFromIdString

func (cmd *BlobStore) MakeBlobStoreFromIdString(
	envBlobStore env_repo.BlobStoreEnv,
	blobStoreIdString string,
) (blobStore blob_stores.BlobStoreInitialized)

type Checkout

type Checkout struct {
	Delete   bool
	Organize bool
	Edit     bool
}

func (*Checkout) SetFlagDefinitions

func (c *Checkout) SetFlagDefinitions(f interfaces.CLIFlagDefinitions)

type Complete

type Complete struct {
	ObjectMetadata
	Query
}

func (Complete) CompleteObjects

func (cmd Complete) CompleteObjects(
	req command.Request,
	local *local_working_copy.Repo,
	queryBuilderOptions pkg_query.BuilderOption,
	args ...string,
)

func (Complete) CompleteObjectsIncludingWorkspace

func (cmd Complete) CompleteObjectsIncludingWorkspace(
	req command.Request,
	local *local_working_copy.Repo,
	queryBuilderOptions pkg_query.BuilderOption,
	args ...string,
)

func (Complete) GetFlagValueMetadataTags

func (cmd Complete) GetFlagValueMetadataTags(
	metadata objects.MetadataMutable,
) interfaces.FlagValue

func (Complete) GetFlagValueMetadataType

func (cmd Complete) GetFlagValueMetadataType(
	metadata objects.MetadataMutable,
) interfaces.FlagValue

func (Complete) GetFlagValueStringTags

func (cmd Complete) GetFlagValueStringTags(
	value *values.String,
) interfaces.FlagValue

func (Complete) SetFlagsProto

func (cmd Complete) SetFlagsProto(
	proto *sku.Proto,
	flagSet interfaces.CLIFlagDefinitions, descriptionUsage string,
	tagUsage string,
	typeUsage string,
)

type Env

type Env struct{}

func (*Env) MakeEnv

func (cmd *Env) MakeEnv(req command.Request) env_local.Env

func (*Env) MakeEnvWithOptions

func (cmd *Env) MakeEnvWithOptions(
	req command.Request,
	options env_ui.Options,
) env_local.Env

func (*Env) MakeEnvWithXDGLayoutAndOptions

func (cmd *Env) MakeEnvWithXDGLayoutAndOptions(
	req command.Request,
	xdgDotenvPath string,
	options env_ui.Options,
) env_local.Env

type EnvRepo

type EnvRepo struct{}

TODO move to command_components

func (EnvRepo) MakeEnvRepo

func (cmd EnvRepo) MakeEnvRepo(
	req command.Request,
	permitNoDodderDirectory bool,
) env_repo.Env

type Genesis

type Genesis struct {
	env_repo.BigBang
	LocalWorkingCopy
	BlobStore
}

func (Genesis) OnTheFirstDay

func (cmd Genesis) OnTheFirstDay(
	req command.Request,
) *local_working_copy.Repo

func (*Genesis) SetFlagDefinitions

func (cmd *Genesis) SetFlagDefinitions(
	flagSet interfaces.CLIFlagDefinitions,
)

func (Genesis) SetLocationFromPositionalRequired added in v0.2.7

func (cmd Genesis) SetLocationFromPositionalRequired(
	req command.Request,
	argName string,
)

SetLocationFromPositionalRequired pops the required new-repo location positional and parses it into config.RepoId via the shared *Config pointer (FromAny returns a copy, so the mutation must go through the pointer). A non-auto config.RepoId means -repo_id / DODDER_REPO_ID was set, and under FDR-0021 T3-C those address an EXISTING repo rather than name a new one — so reject and point the caller at the positional.

type InventoryLists

type InventoryLists struct{}

func (InventoryLists) MakeInventoryListCoderCloset

func (InventoryLists) MakeInventoryListCoderCloset(
	envRepo env_repo.Env,
) inventory_list_coders.Closet

func (InventoryLists) MakeSeqFromPath

func (InventoryLists) MakeSeqFromPath(
	ctx interfaces.ActiveContext,
	inventoryListCoderCloset inventory_list_coders.Closet,
	inventoryListPath string,
	afterDecoding func(*sku.Transacted) error,
) interfaces.SeqError[*sku.Transacted]

type LocalWorkingCopy

type LocalWorkingCopy struct {
	command_components.Env
}

func (LocalWorkingCopy) MakeLocalWorkingCopy

func (cmd LocalWorkingCopy) MakeLocalWorkingCopy(
	req command.Request,
) *local_working_copy.Repo

func (LocalWorkingCopy) MakeLocalWorkingCopyFromConfigAndXDGDotenvPath

func (cmd LocalWorkingCopy) MakeLocalWorkingCopyFromConfigAndXDGDotenvPath(
	req command.Request,
	xdgDotenvPath string,
	options env_ui.Options,
) (local *local_working_copy.Repo)

TODO modify to work with archives

func (LocalWorkingCopy) MakeLocalWorkingCopyFromEnvLocal

func (cmd LocalWorkingCopy) MakeLocalWorkingCopyFromEnvLocal(
	req command.Request,
	envLocal env_local.Env,
) (local *local_working_copy.Repo)

MakeLocalWorkingCopyFromEnvLocal serves callers that already hold an env_local.Env for the own (dodder) scope — serve, serve-proto, and the HTTP/websocket remote server. envLocal's metadata XDG nests under repos/<name>/ (FDR-0019), so it is correct for the own slot but wrong for the blob-store slot: madder blob pools are separate, content- addressed, and never nest (see XDGUtilityNameMadder / configFor). The second slot is therefore built the same way the two-env builders do (env_dir.MakeDefault blanks RepoName for the madder utility and resolves the blob-store base via the madder XDG override / cwd walk), so opening a repo here lands on the same flat blob pool that init wrote and that ordinary commands read.

func (LocalWorkingCopy) MakeLocalWorkingCopyWithOptions

func (cmd LocalWorkingCopy) MakeLocalWorkingCopyWithOptions(
	req command.Request,
	envOptions env_ui.Options,
	repoOptions local_working_copy.Options,
) *local_working_copy.Repo

func (*LocalWorkingCopy) SetFlagDefinitions

func (cmd *LocalWorkingCopy) SetFlagDefinitions(
	f interfaces.CLIFlagDefinitions,
)

type LocalWorkingCopyWithQueryGroup

type LocalWorkingCopyWithQueryGroup struct {
	LocalWorkingCopy
	Query
}

func (LocalWorkingCopyWithQueryGroup) MakeLocalWorkingCopyAndQueryGroup

func (cmd LocalWorkingCopyWithQueryGroup) MakeLocalWorkingCopyAndQueryGroup(
	req command.Request,
	builderOptions queries.BuilderOption,
) (*local_working_copy.Repo, *queries.Query)

func (LocalWorkingCopyWithQueryGroup) MakeLocalWorkingCopyAndQueryGroupResolvingFilenames

func (cmd LocalWorkingCopyWithQueryGroup) MakeLocalWorkingCopyAndQueryGroupResolvingFilenames(
	req command.Request,
	builderOptions queries.BuilderOption,
) (*local_working_copy.Repo, *queries.Query)

func (*LocalWorkingCopyWithQueryGroup) SetFlagDefinitions

type ObjectMetadata

type ObjectMetadata struct{}

func (ObjectMetadata) GetFlagValueMetadataDescription

func (cmd ObjectMetadata) GetFlagValueMetadataDescription(
	metadata objects.MetadataMutable,
) interfaces.FlagValue

func (ObjectMetadata) GetFlagValueMetadataTags

func (cmd ObjectMetadata) GetFlagValueMetadataTags(
	metadata objects.MetadataMutable,
) interfaces.FlagValue

func (ObjectMetadata) GetFlagValueMetadataType

func (cmd ObjectMetadata) GetFlagValueMetadataType(
	metadata objects.MetadataMutable,
) interfaces.FlagValue

type Query

type Query struct {
	sku.ExternalQueryOptions
}

func (Query) GetArgGroup

func (cmd Query) GetArgGroup() command.ArgGroup

func (Query) MakeQuery

func (cmd Query) MakeQuery(
	req command.Request,
	options pkg_query.BuilderOption,
	workingCopy repo.Repo,
	args []string,
) (query *pkg_query.Query)

func (Query) MakeQueryIncludingWorkspace

func (cmd Query) MakeQueryIncludingWorkspace(
	req command.Request,
	options pkg_query.BuilderOption,
	repo *local_working_copy.Repo,
	args []string,
) (query *pkg_query.Query)

func (Query) MakeQueryResolvingFilenames

func (cmd Query) MakeQueryResolvingFilenames(
	req command.Request,
	options pkg_query.BuilderOption,
	repo *local_working_copy.Repo,
	args []string,
) (query *pkg_query.Query)

func (*Query) SetFlagDefinitions

func (cmd *Query) SetFlagDefinitions(flagSet interfaces.CLIFlagDefinitions)

type Remote

type Remote struct {
	RemoteRepoBlobs

	InventoryLists
	LocalWorkingCopy

	DirectPath string

	RemoteConnectionType remote_connection_types.Type
	// contains filtered or unexported fields
}

func (Remote) IsDirectTransfer

func (cmd Remote) IsDirectTransfer() bool

func (Remote) IsHomeRepoParent

func (cmd Remote) IsHomeRepoParent() bool

func (Remote) IsWebSocketProtocol added in v0.2.0

func (cmd Remote) IsWebSocketProtocol() bool

IsWebSocketProtocol reports whether the remote should be reached over the drtp websocket transport (sierra/remote_proto, RFC 0004) rather than the legacy remote_http backend.

func (Remote) MakeDirectRemoteFromPath

func (cmd Remote) MakeDirectRemoteFromPath(
	req command.Request,
	local *local_working_copy.Repo,
) repo.Repo

func (Remote) MakeHomeRepoRemote

func (cmd Remote) MakeHomeRepoRemote(
	req command.Request,
) repo.Repo

func (Remote) MakeProtoConnectionFromObject added in v0.2.0

func (cmd Remote) MakeProtoConnectionFromObject(
	req command.Request,
	local *local_working_copy.Repo,
	object *sku.Transacted,
) (conn io.ReadWriteCloser, client *remote_proto.Client)

MakeProtoConnectionFromObject resolves a stored url remote object to a drtp websocket connection and a client bound to local. Used by pull/push when -remote-connection-type=url-websocket is set.

func (Remote) MakeRemote

func (cmd Remote) MakeRemote(
	req command.Request,
	repo *local_working_copy.Repo,
	object *sku.Transacted,
) (remote repo.Repo)

returns a ready-to-use repo.Repo FROM an associated *sku.Transacted

func (Remote) MakeRemoteAndObject

func (cmd Remote) MakeRemoteAndObject(
	req command.Request,
	local *local_working_copy.Repo,
) (remote repo.Repo, remoteObject *sku.Transacted)

returns a ready-to-use repo.Repo and an associated *sku.Transacted that can be persisted

func (Remote) MakeRemoteFromBlob

func (cmd Remote) MakeRemoteFromBlob(
	req command.Request,
	repo *local_working_copy.Repo,
	blob repo_blobs.Blob,
) (remote repo.Repo)

returns a ready-to-use repo.Repo FROM an associated repo_blobs.Blob

func (Remote) MakeRemoteFromBlobAndSetPublicKey

func (cmd Remote) MakeRemoteFromBlobAndSetPublicKey(
	req command.Request,
	repo *local_working_copy.Repo,
	blob repo_blobs.BlobMutable,
) (remote repo.Repo)

func (*Remote) MakeRemoteHTTPFromXDGDotenvPath

func (cmd *Remote) MakeRemoteHTTPFromXDGDotenvPath(
	req command.Request,
	xdgDotenvPath string,
	options env_ui.Options,
	repo *local_working_copy.Repo,
	pubkey markl.Id,
) (remoteHTTP repo.Repo)

func (*Remote) MakeRemoteStdioLocal

func (cmd *Remote) MakeRemoteStdioLocal(
	req command.Request,
	env env_local.Env,
	dir string,
	repo *local_working_copy.Repo,
	pubkey mad_domain_interfaces.MarklId,
) (remoteHTTP repo.Repo)

func (*Remote) MakeRemoteStdioSSH

func (cmd *Remote) MakeRemoteStdioSSH(
	req command.Request,
	env env_local.Env,
	arg string,
	repo *local_working_copy.Repo,
) (remoteHTTP repo.Repo)

func (*Remote) MakeRemoteUrl

func (cmd *Remote) MakeRemoteUrl(
	req command.Request,
	env env_local.Env,
	uri values.Uri,
	repo *local_working_copy.Repo,
) (remoteHTTP repo.Repo)

func (*Remote) ResolveImplicitDirectPath

func (cmd *Remote) ResolveImplicitDirectPath(
	local *local_working_copy.Repo,
)

func (Remote) ResolvedFromParent added in v0.2.7

func (cmd Remote) ResolvedFromParent() bool

ResolvedFromParent reports whether the remote was resolved from the workspace's recorded parent (path or home repo), as opposed to an explicit -direct path or a stored remote object. Only a parent-resolved remote is subject to #287b pubkey verification.

func (*Remote) SetFlagDefinitions

func (cmd *Remote) SetFlagDefinitions(
	flagSet interfaces.CLIFlagDefinitions,
)

func (Remote) VerifyOrPinParent added in v0.2.7

func (cmd Remote) VerifyOrPinParent(
	req command.Request,
	local *local_working_copy.Repo,
	remote repo.Repo,
)

VerifyOrPinParent enforces the #287b parent-identity invariant before a push/pull whose remote was resolved from the workspace's parent. It is a no-op for any other remote (explicit -direct or a stored remote object).

  • Pinned + live pubkey matches -> proceed.
  • Pinned + mismatch -> hard error (the resolved parent is a different repo).
  • Unpinned (legacy workspace) + TTY -> confirm-pin the resolved parent, upgrading the workspace config, then proceed.
  • Unpinned + non-TTY -> hard error directing the user to `dodder set-parent`.

type RemoteRepoBlobs

type RemoteRepoBlobs struct {
	EnvRepo
}

func (RemoteRepoBlobs) CreateRemoteBlob

func (cmd RemoteRepoBlobs) CreateRemoteBlob(
	req command.Request,
	local *local_working_copy.Repo,
	remoteType ids.Type,
) (blob repo_blobs.BlobMutable)

Returns a repo_blobs.BlobMutable that can be used to create a repo.Repo. The blob's public key SHOULD be set before writing it to the store.

func (*RemoteRepoBlobs) SetFlagDefinitions

func (cmd *RemoteRepoBlobs) SetFlagDefinitions(
	flagSet interfaces.CLIFlagDefinitions,
)

type RemoteTransfer

type RemoteTransfer struct {
	Remote
	repo.ImporterOptions
}

func (*RemoteTransfer) SetFlagDefinitions

func (cmd *RemoteTransfer) SetFlagDefinitions(
	flagDefinitions interfaces.CLIFlagDefinitions,
)

Jump to

Keyboard shortcuts

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