Versions in this module Expand all Collapse all v1 v1.1.2 Aug 27, 2026 v1.1.1 Aug 27, 2026 Changes in this version + func WithDeclaredCommandDiagnostic(ctx context.Context, diagnostic DeclaredCommandDiagnostic) context.Context + type DeclaredCommandDiagnostic struct + Command string + Date string + Source string + WindowEnd string + WindowStart string v1.1.0 Aug 27, 2026 v1.0.0 Aug 26, 2026 Changes in this version + const BaseAgentsFile + const BaseBinDir + const BaseDirMode + const BaseEnvVar + const BaseFileMode + const BaseSkillsDir + const ConfigFileName + const ConfigVersion + const DeclaredCommandDirectory + const DeclaredCommandEnvironmentPolicy + const FieldID + const FieldTime + const FieldTitle + const FieldURL + const GraphFile + const GraphMetaFile + const LocalConfigName + const MarkdownExtension + const MaxBaseNameLength + const MaxCLIOutputBytes + const MaxConfigBytes + const MaxControlFileBytes + const MaxFieldDescriptionLength + const MaxFieldExampleLength + const MaxFieldExamples + const MaxFieldNameLength + const MaxFields + const MaxFreshnessAgeHours + const MaxLocalInputBytes + const MaxMinInterval + const MaxNarrativeBytes + const MaxPathsPerField + const MaxRetryAttempts + const MaxRetryBackoff + const MaxSourceDocumentBytes + const MaxSourceNameLength + const MaxSyncConcurrency + const SchemaURL + const TaskTraceFile + var ErrBaseBusy = errors.New("base has an active writer") + var ErrCLIOutputTooLarge = errors.New("CLI output exceeds size limit") + var ErrConfig = errors.New("invalid configuration") + var ErrFileTooLarge = errors.New("file exceeds size limit") + var ErrNoBase = errors.New("no fkf base found") + var ErrNotAddressable = errors.New("path is not addressable in a base") + var ErrPathEscapes = errors.New("path escapes the base") + var ErrUnsafePath = errors.New("unsafe filesystem path") + var ErrUntrusted = errors.New("base is not trusted on this machine") + var Layers = []Layer + var RunPlaceholders = []string + var Version = resolveVersion(version, debug.ReadBuildInfo) + func CleanRelative(relative string) (string, error) + func ConfigDigest(ctx context.Context, root string) (string, error) + func ConfigSchema() map[string]any + func ConfigureLogging() + func EncodeConfigSchema() ([]byte, error) + func ExpandHome(value string) string + func IsWellKnownField(name string) bool + func LayerNames() string + func LookPathIn(name, pathList string) (string, bool) + func NewCommandFailure(cause error, stderr string) error + func OpenRegularFile(path string) (*os.File, error) + func ReadFileLimit(path string, limit int64) ([]byte, error) + func ReadFileLimitContext(ctx context.Context, path string, limit int64) ([]byte, error) + func RequireTrust(ctx context.Context, root string) error + func RequireTrustConfig(ctx context.Context, config *Config) error + func ResolveAbsolutePath(value string) (string, error) + func ResolveExecutable(name, pathList string) (string, error) + func RunCLI(ctx context.Context, cmd []string, cwd string, timeout time.Duration) (string, error) + func RunCLIBounded(ctx context.Context, cmd []string, cwd, stdin string, timeout time.Duration, ...) (string, error) + func RunCLIStdin(ctx context.Context, cmd []string, cwd, stdin string, timeout time.Duration) (string, error) + func SanitizePathList(pathList, forbiddenRoot string) string + func ScalarString(value any) (string, bool) + func StateDir() string + func SyncDirectory(dir string) error + func ValidBodyValue(value string) bool + func ValidateDate(value string) error + func ValidateDirectoryConfinement(path string) error + func ValidateEntityScheme(value string) error + func ValidateFieldMap(fields FieldMap, event bool) error + func ValidateFieldSchema(schema FieldSchema) error + func ValidatePathConfinement(path string) error + func ValidateRelationValue(value string) error + func ValidateSourceName(name string) error + func ValidateWithinRoot(root, absolute string) error + func WithCommandEnvironment(ctx context.Context, values map[string]string) (context.Context, error) + func WithCommandEnvironmentForRoot(ctx context.Context, values map[string]string, forbiddenRoot string) (context.Context, error) + func WriteDataToJSON(data any, path string) error + func WriteFileAtomicMode(path string, bytes []byte, mode os.FileMode) error + type BaseOrigin string + const BaseFromDiscovery + const BaseFromEnvironment + const BaseFromFlag + func DiscoverBase(explicit string) (string, BaseOrigin, error) + type BinScript struct + Digest string + Executable bool + Kind string + Name string + Target string + func BinScripts(ctx context.Context, root string) ([]BinScript, error) + type Cardinality string + const CardinalityMany + const CardinalityOne + const CardinalityOptional + func (c Cardinality) Allows(count int) bool + func (c Cardinality) MaxOne() bool + type Config struct + Bin []string + FKF int + Layers map[Layer]bool + LocalPath string + Name string + Origins map[string]string + Path string + Schema FieldSchema + Sources map[string]*Source + Sync SyncConfig + func LoadConfig(root string) (*Config, error) + func (c *Config) EnabledSources() []*Source + func (c *Config) SourceNames() []string + func (c *Config) Store() Store + type ErrLayerDisabled struct + Layer Layer + func (e ErrLayerDisabled) Error() string + type FieldDefinition struct + Cardinality Cardinality + Description string + Examples []string + Relation bool + type FieldMap map[string]FieldPaths + func (m FieldMap) EvalField(name string, value any) ([]string, error) + func (m FieldMap) EvalRelation(name string, value any) ([]string, error) + func (m FieldMap) EvalString(name string, value any) (string, bool) + func (m FieldMap) EvalStrings(name string, value any) []string + func (m FieldMap) Names() []string + func (m FieldMap) Path(name string) FieldPath + func (m FieldMap) Paths(name string) FieldPaths + type FieldPath struct + func ParseFieldPath(raw string) (FieldPath, error) + func (p *FieldPath) UnmarshalJSON(data []byte) error + func (p FieldPath) Eval(value any) []any + func (p FieldPath) EvalString(value any) (string, bool) + func (p FieldPath) EvalStrings(value any) []string + func (p FieldPath) IsZero() bool + func (p FieldPath) MarshalJSON() ([]byte, error) + func (p FieldPath) String() string + type FieldPaths []FieldPath + func (p *FieldPaths) UnmarshalJSON(data []byte) error + func (p *FieldPaths) UnmarshalYAML(node *yaml.Node) error + func (p FieldPaths) MarshalJSON() ([]byte, error) + type FieldSchema map[string]FieldDefinition + func (s FieldSchema) Names() []string + func (s FieldSchema) Select(fields FieldMap) FieldSchema + type Layer string + const LayerEvents + const LayerIndex + const LayerProjects + const LayerTasks + const LayerWiki + func ParseLayer(value string) (Layer, error) + type OutputFormat string + const FormatJSON + const FormatNDJSON + type RetryPolicy struct + Attempts int + Backoff time.Duration + On []string + func (r RetryPolicy) IsZero() bool + type Source struct + Body []string + Enabled bool + Fields FieldMap + Format OutputFormat + Install string + Layer Layer + MinInterval time.Duration + Name string + Records FieldPath + Requires []string + Retry RetryPolicy + Run []string + Schema FieldSchema + Timeout time.Duration + Window bool + func (s Source) BodyFieldNames() []string + func (s Source) HasBody() bool + func (s Source) RetryAttempts() int + type Store struct + func NewStore(root string, enabled map[Layer]bool) Store + func (s Store) BinDir() string + func (s Store) ConfigPath() string + func (s Store) Dir(layer Layer) (string, error) + func (s Store) Enabled(layer Layer) bool + func (s Store) EnabledLayers() []Layer + func (s Store) EnforcePermissions() bool + func (s Store) LayerOf(relative string) (Layer, bool) + func (s Store) LocalConfigPath() string + func (s Store) Relative(absolute string) (string, error) + func (s Store) Resolve(relative string) (string, error) + func (s Store) Root() string + func (s Store) Versioned() bool + type SyncConfig struct + Concurrency int + Days int + IndexMaxAgeHours int + Timeout time.Duration + func DefaultSync() SyncConfig + type TrustChange struct + Item TrustItemKind + Kind TrustChangeKind + Name string + func DiffTrustItems(stored, current []TrustItem) []TrustChange + type TrustChangeKind string + const TrustAdded + const TrustArmed + const TrustDisarmed + const TrustModified + const TrustRemoved + type TrustItem struct + Digest string + Executable bool + Kind TrustItemKind + Name string + func TrustItems(ctx context.Context, root string) ([]TrustItem, error) + type TrustItemKind string + const TrustItemConfig + const TrustItemScript + const TrustItemSource + type TrustRecord struct + Base string + Digest string + Items []TrustItem + TrustedAt string + type TrustState struct + Base string + Changes []TrustChange + Digest string + Items []TrustItem + Path string + Since string + Stored string + Trusted bool + func ReadTrust(ctx context.Context, root string) (TrustState, error) + func ReadTrustConfig(ctx context.Context, config *Config) (TrustState, error) + func WriteTrust(ctx context.Context, root string, now time.Time) (TrustState, error) + func WriteTrustConfig(ctx context.Context, config *Config, now time.Time) (TrustState, error) + type WriterLock struct + func AcquireWriterLock(ctx context.Context, root string) (*WriterLock, error) + func (lock *WriterLock) Close() error