Documentation
¶
Overview ¶
Package daemon implements the TaskSmith Brain Daemon server, providing a single-instance background runtime over a Unix domain socket with HTTP/JSON endpoints and real-time Server-Sent Events (SSE).
Architecture ¶
The Brain Daemon decouples long-running agent execution, SQLite persistence, OS sandboxes, and workspace state from stateless client interfaces (such as the TUI or CLI):
- Single-Instance Lockfile: Daemon acquires a non-blocking exclusive `flock` on Config.LockPath before binding Config.SocketPath, returning ErrAlreadyRunning if another daemon instance is active.
- Lazy Workspace Runtime Cache: Each workspace directory is opened on demand and cached with its own workspace.Workspace, sandbox.Sandbox, pooled gateway.Gateway, SQLite database (`tasksmith.db`), timeline.Store, and session.Store.
- Detached Background Turns: Conversational turns (`Send` and `RespondPermission`) execute in daemon-owned background goroutines bound to the workspace runtime's lifecycle rather than the incoming HTTP request context. If a client disconnects mid-turn, the agent continues executing and persisting messages and events to the timeline in SQLite undisturbed.
- Real-Time Topic Broker: Events (api.EventEntryAdded, api.EventChunk, api.EventPermissionRequested, api.EventCompleted, api.EventError, and session lifecycle events) are delivered through broker.Broker to subscribers matching their exact topics (e.g. `sessions` or `sessions.<id>.stream`).
- Modular Server Layer: HTTP routing and request multiplexing are delegated to server.Server and specialized modular routers (server.NewSystemRouter, server.NewEventRouter, server.NewWorkspaceRouter, server.NewSessionRouter), allowing clean decoupling between HTTP transport and daemon runtime logic.
Index ¶
- Constants
- Variables
- func DefaultLockPath() (string, error)
- func DefaultSocketPath() (string, error)
- func LockPathForSocket(socketPath string) string
- type Config
- type Daemon
- func (d *Daemon) AddPermissionRule(ctx context.Context, rawWS string, req api.PermissionRuleRequest) (*api.PermissionsResponse, error)
- func (d *Daemon) AddSubscriber(_ context.Context, subscriberID, since string, topics ...string) (*broker.Subscriber, []string, error)
- func (d *Daemon) AllowMCPPolicy(ctx context.Context, rawWS, name string, req api.MCPAllowPolicyRequest) (api.MCPServer, error)
- func (d *Daemon) AssignModelAliases(ctx context.Context, rawWS string, req api.AssignModelAliasesRequest) (*api.AssignModelAliasesResponse, error)
- func (d *Daemon) AuthenticateMCP(ctx context.Context, rawWS, name string) (api.MCPAuthResponse, error)
- func (d *Daemon) Cancel(ctx context.Context, rawWS, id string) error
- func (d *Daemon) Changes(ctx context.Context, rawWS, id string) ([]api.FileChange, error)
- func (d *Daemon) Close(ctx context.Context) error
- func (d *Daemon) CompleteMCPAuth(ctx context.Context, rawWS, name string, req api.MCPAuthCallbackRequest) error
- func (d *Daemon) CompleteProviderAuth(ctx context.Context, provider string, req api.ProviderAuthCallbackRequest) (*api.ProviderAuthResponse, error)
- func (d *Daemon) CreateProvider(ctx context.Context, rawWS string, req api.CreateProviderRequest) (*api.WorkspaceProvider, error)
- func (d *Daemon) CreateSession(ctx context.Context, rawWS string, req api.CreateSessionRequest) (*api.Session, bool, error)
- func (d *Daemon) DeleteSession(ctx context.Context, rawWS, id string) error
- func (d *Daemon) Diff(ctx context.Context, rawWS, id, path, entryID string) (*api.DiffResponse, error)
- func (d *Daemon) Done() <-chan struct{}
- func (d *Daemon) ForkSession(ctx context.Context, rawWS, id string, req api.ForkSessionRequest) (*api.Session, error)
- func (d *Daemon) FormatEvent(msg broker.Message) (api.Event, error)
- func (d *Daemon) GetAgent(ctx context.Context, rawWS, name string) (*api.Agent, error)
- func (d *Daemon) GetCommand(ctx context.Context, rawWS, name string) (*api.Command, error)
- func (d *Daemon) GetMCPPrompt(ctx context.Context, rawWS, name, prompt string, req api.MCPPromptRequest) (api.MCPPromptResponse, error)
- func (d *Daemon) GetModel(ctx context.Context, rawWS, id string) (*api.Model, error)
- func (d *Daemon) GetModelQuota(ctx context.Context, rawWS, id string) (*api.ModelQuota, error)
- func (d *Daemon) GetPermissions(ctx context.Context, rawWS string) (*api.PermissionsResponse, error)
- func (d *Daemon) GetProviderAuthStatus(_ context.Context, provider string) (*api.ProviderAuthResponse, error)
- func (d *Daemon) GetQuotaSnapshots(ctx context.Context, rawWS string) (*api.QuotaSnapshotResponse, error)
- func (d *Daemon) GetSandbox(ctx context.Context, rawWS string) (*api.SandboxResponse, error)
- func (d *Daemon) GetSession(ctx context.Context, rawWS, id string) (*api.Session, error)
- func (d *Daemon) GetSkill(ctx context.Context, rawWS, name string) (*api.Skill, error)
- func (d *Daemon) GetTrustStatus(ctx context.Context, rawWS string) (*api.TrustStatus, error)
- func (d *Daemon) GetWorkspace(ctx context.Context, rawWS string) (*api.Workspace, error)
- func (d *Daemon) GetWorkspaceStatus(ctx context.Context, rawWS string) (*api.WorkspaceStatus, error)
- func (d *Daemon) Health(_ context.Context) (*api.HealthResponse, error)
- func (d *Daemon) InitWorkspace(ctx context.Context, req api.InitWorkspaceRequest) (*api.InitWorkspaceResponse, error)
- func (d *Daemon) KillTask(ctx context.Context, rawWS, id, taskID string) error
- func (d *Daemon) LatestSession(ctx context.Context, rawWS string) (*api.Session, error)
- func (d *Daemon) ListAgents(ctx context.Context, rawWS string) ([]api.Agent, error)
- func (d *Daemon) ListAliasAssignments(ctx context.Context, rawWS string) ([]api.AliasAssignment, error)
- func (d *Daemon) ListCommands(ctx context.Context, rawWS string) ([]api.Command, error)
- func (d *Daemon) ListMCPs(ctx context.Context, rawWS string) ([]api.MCPServer, error)
- func (d *Daemon) ListModels(ctx context.Context, rawWS string) ([]api.Model, error)
- func (d *Daemon) ListProviderCatalog(ctx context.Context, rawWS, name string) ([]api.ProviderCatalogEntry, error)
- func (d *Daemon) ListProviders(_ context.Context) ([]api.ProviderSummary, error)
- func (d *Daemon) ListRules(ctx context.Context, rawWS string) ([]api.Rule, error)
- func (d *Daemon) ListSessions(ctx context.Context, rawWS string) ([]api.Session, error)
- func (d *Daemon) ListSkills(ctx context.Context, rawWS string) ([]api.Skill, error)
- func (d *Daemon) ListTools(ctx context.Context, rawWS, agent string) ([]api.Tool, error)
- func (d *Daemon) ListWorkspaceFiles(ctx context.Context, rawWS string, req api.ListFilesRequest) ([]api.WorkspaceFile, error)
- func (d *Daemon) ListWorkspaceProviders(ctx context.Context, rawWS string) ([]api.WorkspaceProvider, error)
- func (d *Daemon) LogoutProviderAuth(ctx context.Context, provider string) (*api.ProviderAuthResponse, error)
- func (d *Daemon) MetricsQuery(ctx context.Context, req api.MetricsQuery) (*api.MetricsResult, error)
- func (d *Daemon) PreviewSession(ctx context.Context, rawWS string, req api.PreviewSessionRequest) (*api.SessionPreview, error)
- func (d *Daemon) ReadMCPResource(ctx context.Context, rawWS, name string, req api.MCPResourceRequest) (api.MCPResourceResponse, error)
- func (d *Daemon) ReloadWorkspace(ctx context.Context, rawWS string) error
- func (d *Daemon) RemovePermissionRule(ctx context.Context, rawWS string, req api.PermissionRuleRequest) (*api.PermissionsResponse, error)
- func (d *Daemon) RemoveSubscriber(sub *broker.Subscriber)
- func (d *Daemon) RestartMCP(ctx context.Context, rawWS, name string) (api.MCPServer, error)
- func (d *Daemon) Revert(ctx context.Context, rawWS, id string, req api.RevertRequest) error
- func (d *Daemon) RevokeTrust(ctx context.Context, rawWS string) error
- func (d *Daemon) Send(ctx context.Context, rawWS, id string, req api.SendRequest) error
- func (d *Daemon) Serve(ctx context.Context) error
- func (d *Daemon) SessionUsage(ctx context.Context, rawWS, id string) (*api.SessionUsage, error)
- func (d *Daemon) SetMCPEnabled(ctx context.Context, rawWS, name string, enabled bool) ([]api.MCPServer, error)
- func (d *Daemon) SetProviderEnabled(ctx context.Context, rawWS, name string, enabled bool) ([]api.WorkspaceProvider, error)
- func (d *Daemon) SetToolEnabled(ctx context.Context, rawWS, name string, enabled bool) ([]api.Tool, error)
- func (d *Daemon) Shutdown(_ context.Context) error
- func (d *Daemon) SocketPath() string
- func (d *Daemon) Start(ctx context.Context) error
- func (d *Daemon) StartProviderAuth(ctx context.Context, provider string) (*api.ProviderAuthResponse, error)
- func (d *Daemon) StreamTaskOutput(ctx context.Context, rawWS, id, taskID string) (<-chan string, string, func(), error)
- func (d *Daemon) Subscribe(_ context.Context, subscriberID, since string, topics ...string) ([]string, error)
- func (d *Daemon) Tasks(ctx context.Context, rawWS, id string) ([]api.Task, error)
- func (d *Daemon) Timeline(ctx context.Context, rawWS, id string) ([]api.TimelineEntry, error)
- func (d *Daemon) TrustWorkspace(ctx context.Context, req api.TrustFolderRequest) error
- func (d *Daemon) Unsubscribe(_ context.Context, subscriberID string, topics ...string) ([]string, error)
- func (d *Daemon) UpdateProviderModels(ctx context.Context, rawWS, name string, req api.UpdateProviderModelsRequest) ([]api.WorkspaceProvider, error)
- func (d *Daemon) UpdateSandbox(ctx context.Context, rawWS string, req api.UpdateSandboxRequest) (*api.SandboxResponse, error)
- func (d *Daemon) UpdateSession(ctx context.Context, rawWS, id string, req api.UpdateSessionRequest) (*api.Session, error)
- func (d *Daemon) UploadMedia(ctx context.Context, rawWS, id, mimeType, filename string, data []byte) (*api.Media, error)
- func (d *Daemon) Usage(ctx context.Context, rawWS string, req api.UsageRequest) (*api.UsageSummary, error)
- func (d *Daemon) VerifyProvider(ctx context.Context, req api.VerifyProviderRequest) (*api.VerifyProviderResponse, error)
- func (d *Daemon) Workspaces() []string
Constants ¶
ErrCodeMCPUnavailable is the API error code returned when an MCP operation is requested but the workspace has no MCP runtime attached to connect its configured servers.
Variables ¶
var ( ErrInvalidConfig = errors.New("daemon: invalid configuration") ErrAlreadyRunning = errors.New("daemon: server is already running") ErrSessionRunning = session.ErrSessionRunning ErrEmptyWorkspace = errors.New("daemon: workspace parameter is required") ErrEmptyMessage = session.ErrEmptyMessage )
Sentinel errors returned by the daemon package.
Functions ¶
func DefaultLockPath ¶
DefaultLockPath returns the default XDG runtime lockfile path ("brain.lock").
func DefaultSocketPath ¶
DefaultSocketPath returns the default XDG runtime Unix domain socket path ("brain.sock").
func LockPathForSocket ¶
LockPathForSocket returns the lockfile path paired with a socket path: the same directory and base name with a ".lock" extension. A socket that does not end in ".sock" gets ".lock" appended.
Types ¶
type Config ¶
type Config struct {
SocketPath string
LockPath string
GatewayPool gateway.Pool
Logger log.Interface
// DisableMCPAutoConnect keeps a workspace's MCP servers disconnected until an
// MCP operation asks for them. It exists for tests, which must not launch the
// commands or reach the endpoints a workspace's manifests declare.
DisableMCPAutoConnect bool
}
Config holds the mandatory configuration parameters for starting a Daemon.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is the single-instance TaskSmith Brain Daemon HTTP+SSE server.
func New ¶
New validates cfg, initializes internal subsystems, creates the HTTP multiplexer, and constructs a new Daemon.
func (*Daemon) AddPermissionRule ¶
func (d *Daemon) AddPermissionRule(ctx context.Context, rawWS string, req api.PermissionRuleRequest) (*api.PermissionsResponse, error)
func (*Daemon) AddSubscriber ¶
func (*Daemon) AllowMCPPolicy ¶
func (d *Daemon) AllowMCPPolicy(ctx context.Context, rawWS, name string, req api.MCPAllowPolicyRequest) (api.MCPServer, error)
AllowMCPPolicy updates the named server's writable manifest on disk so req.Value is permitted under the matching spec.policies section, reloads the server, and returns the updated state.
func (*Daemon) AssignModelAliases ¶
func (d *Daemon) AssignModelAliases(ctx context.Context, rawWS string, req api.AssignModelAliasesRequest) (*api.AssignModelAliasesResponse, error)
AssignModelAliases saves the exact alias set one model should own, stripping each alias from other models across writable manifests first (the atomic move), then hot-reloads the workspace and returns the refreshed alias report.
func (*Daemon) AuthenticateMCP ¶
func (d *Daemon) AuthenticateMCP(ctx context.Context, rawWS, name string) (api.MCPAuthResponse, error)
AuthenticateMCP starts or resumes the interactive authorization flow for the named MCP server and returns the URL the user should open.
func (*Daemon) Close ¶
Close gracefully shuts down the HTTP server, waits for any in-flight background turns to abort, closes all workspace runtimes, the gateway pool, and browser OAuth drivers, removes the Unix socket, and releases the lockfile. Concurrent calls to Close block until teardown completes and return the same result.
func (*Daemon) CompleteMCPAuth ¶
func (d *Daemon) CompleteMCPAuth(ctx context.Context, rawWS, name string, req api.MCPAuthCallbackRequest) error
CompleteMCPAuth feeds a redirect URL the user pasted to the authorization flow in progress for the named MCP server. It exists for the common case where the browser cannot reach the daemon's loopback callback listener — the user is on a remote host, or localhost is blocked — and can only copy the address bar.
func (*Daemon) CompleteProviderAuth ¶
func (d *Daemon) CompleteProviderAuth(ctx context.Context, provider string, req api.ProviderAuthCallbackRequest) (*api.ProviderAuthResponse, error)
CompleteProviderAuth finishes an in-flight provider OAuth flow with a callback URL the user copied from their browser, which is the fallback when the browser runs on a different machine (SSH or headless hosts) and cannot reach the daemon's loopback listener.
func (*Daemon) CreateProvider ¶
func (d *Daemon) CreateProvider(ctx context.Context, rawWS string, req api.CreateProviderRequest) (*api.WorkspaceProvider, error)
CreateProvider authors a new ModelProvider manifest in the user or workspace scope. A supplied API key is written exclusively to the scope's .env file and referenced from the manifest through a ${env:...} expression, so no secret is ever stored in YAML.
func (*Daemon) CreateSession ¶
func (*Daemon) DeleteSession ¶
func (*Daemon) ForkSession ¶
func (d *Daemon) ForkSession(ctx context.Context, rawWS, id string, req api.ForkSessionRequest) (*api.Session, error)
ForkSession branches a session into a new top-level session seeded with the source's conversation.
func (*Daemon) FormatEvent ¶
FormatEvent converts an internal broker message into a public API event. Sessions publish api.EventPayload values directly, so this only needs to wrap the payload with the message envelope.
func (*Daemon) GetCommand ¶
func (*Daemon) GetMCPPrompt ¶
func (d *Daemon) GetMCPPrompt(ctx context.Context, rawWS, name, prompt string, req api.MCPPromptRequest) (api.MCPPromptResponse, error)
GetMCPPrompt renders a prompt discovered on the named MCP server. A prompt prohibited by the server manifest's policies is rejected with HTTP 403 unless the user-authorized AllowProhibited flag is set.
func (*Daemon) GetModelQuota ¶
GetModelQuota reports the remaining quota of a quota-billed model. It returns a nil payload (HTTP 204 semantics handled by the router) when the model is unknown, has no provider gateway, or its provider does not report quotas.
func (*Daemon) GetPermissions ¶
func (*Daemon) GetProviderAuthStatus ¶
func (*Daemon) GetQuotaSnapshots ¶
func (d *Daemon) GetQuotaSnapshots(ctx context.Context, rawWS string) (*api.QuotaSnapshotResponse, error)
GetQuotaSnapshots returns the live multi-bucket quota snapshots across all quota-capable providers in the workspace.
func (*Daemon) GetSandbox ¶
GetSandbox returns the workspace's sandbox posture: the stored global and project sandbox.json scopes, their effective merge, host kernel backend diagnostics, and the canonical resolved path rules for transparent inspection in clients.
func (*Daemon) GetSession ¶
func (*Daemon) GetTrustStatus ¶
func (*Daemon) GetWorkspace ¶
func (*Daemon) GetWorkspaceStatus ¶
func (*Daemon) InitWorkspace ¶
func (d *Daemon) InitWorkspace(ctx context.Context, req api.InitWorkspaceRequest) (*api.InitWorkspaceResponse, error)
func (*Daemon) LatestSession ¶
LatestSession returns metadata for the workspace's most recently updated top-level session without hydrating session runtimes. It returns a nil session when the workspace has no sessions.
func (*Daemon) ListAgents ¶
func (*Daemon) ListAliasAssignments ¶
func (d *Daemon) ListAliasAssignments(ctx context.Context, rawWS string) ([]api.AliasAssignment, error)
ListAliasAssignments returns the workspace-wide bare-alias report used by the shared model alias editor.
func (*Daemon) ListCommands ¶
func (*Daemon) ListMCPs ¶
ListMCPs returns every MCP server configured in the workspace sorted by name, including servers disabled via spec.enabled or WORKSPACE.md policies. When an MCP runtime is attached, its live connection state and discovered tools, prompts, and resources are reported for running servers; servers the runtime does not track (disabled ones never spawn) are reported from their manifests with a disconnected status and Enabled false.
func (*Daemon) ListModels ¶
func (*Daemon) ListProviderCatalog ¶
func (d *Daemon) ListProviderCatalog(ctx context.Context, rawWS, name string) ([]api.ProviderCatalogEntry, error)
ListProviderCatalog returns the models a provider type offers, so the /providers model manager can offer a curated list (context window, pricing, capabilities) instead of asking for raw IDs. It uses the gateway's catalog when available and falls back to the built-in preset.
func (*Daemon) ListProviders ¶
ListProviders returns the built-in provider presets with their current credential availability, independent of any workspace.
func (*Daemon) ListSessions ¶
func (*Daemon) ListSkills ¶
func (*Daemon) ListTools ¶
ListTools returns every effective tool in the workspace. When agent is not empty, each tool is also classified with its availability for that agent (eager, deferred, denied, or inactive).
func (*Daemon) ListWorkspaceFiles ¶
func (d *Daemon) ListWorkspaceFiles(ctx context.Context, rawWS string, req api.ListFilesRequest) ([]api.WorkspaceFile, error)
ListWorkspaceFiles searches and ranks workspace files and directories for context mentions.
func (*Daemon) ListWorkspaceProviders ¶
func (d *Daemon) ListWorkspaceProviders(ctx context.Context, rawWS string) ([]api.WorkspaceProvider, error)
ListWorkspaceProviders returns every ModelProvider the workspace resolved across tiers — including disabled and shadowed ones the effective listing hides — with the manifest path, scope badge, and status the /providers browser renders.
func (*Daemon) LogoutProviderAuth ¶
func (d *Daemon) LogoutProviderAuth(ctx context.Context, provider string) (*api.ProviderAuthResponse, error)
LogoutProviderAuth cancels any in-flight OAuth flow for provider and removes its persisted credentials, then reloads workspaces so pooled gateways drop the signed-in client. It reports whether credential material was deleted.
func (*Daemon) MetricsQuery ¶
func (d *Daemon) MetricsQuery(ctx context.Context, req api.MetricsQuery) (*api.MetricsResult, error)
func (*Daemon) PreviewSession ¶
func (d *Daemon) PreviewSession(ctx context.Context, rawWS string, req api.PreviewSessionRequest) (*api.SessionPreview, error)
func (*Daemon) ReadMCPResource ¶
func (d *Daemon) ReadMCPResource(ctx context.Context, rawWS, name string, req api.MCPResourceRequest) (api.MCPResourceResponse, error)
ReadMCPResource reads a resource URI from the named MCP server. A resource prohibited by the server manifest's policies is rejected with HTTP 403 unless the user-authorized AllowProhibited flag is set.
func (*Daemon) ReloadWorkspace ¶
func (*Daemon) RemovePermissionRule ¶
func (d *Daemon) RemovePermissionRule(ctx context.Context, rawWS string, req api.PermissionRuleRequest) (*api.PermissionsResponse, error)
func (*Daemon) RemoveSubscriber ¶
func (d *Daemon) RemoveSubscriber(sub *broker.Subscriber)
func (*Daemon) RestartMCP ¶
RestartMCP reconnects the named MCP server, re-discovers its tools, prompts, and resources, and returns the updated server state.
func (*Daemon) Serve ¶
Serve starts the daemon (if not already started) and blocks until ctx is canceled or a shutdown is requested via `/v1/shutdown` or Daemon.Close.
func (*Daemon) SessionUsage ¶
func (*Daemon) SetMCPEnabled ¶
func (d *Daemon) SetMCPEnabled(ctx context.Context, rawWS, name string, enabled bool) ([]api.MCPServer, error)
SetMCPEnabled patches availability for the named MCP server and hot-reloads the workspace. The reload's MCP sync closes a newly disabled server (and unregisters its tools), while re-enabling spawns and connects it.
func (*Daemon) SetProviderEnabled ¶
func (d *Daemon) SetProviderEnabled(ctx context.Context, rawWS, name string, enabled bool) ([]api.WorkspaceProvider, error)
SetProviderEnabled patches spec.enabled on the named provider's manifest and hot-reloads the workspace so the gateway and model catalog agree immediately.
func (*Daemon) SetToolEnabled ¶
func (d *Daemon) SetToolEnabled(ctx context.Context, rawWS, name string, enabled bool) ([]api.Tool, error)
SetToolEnabled patches availability for the named tool — spec.enabled on its own manifest when writable, otherwise a WORKSPACE.md tools policy exclusion — and hot-reloads the workspace so sessions, listings, and the deferred tool catalog agree immediately.
func (*Daemon) SocketPath ¶
SocketPath returns the Unix domain socket path configured on the daemon.
func (*Daemon) Start ¶
Start acquires the non-blocking exclusive flock on Config.LockPath, binds the Unix domain socket at Config.SocketPath, and begins serving HTTP+SSE requests in a background goroutine.
func (*Daemon) StartProviderAuth ¶
func (*Daemon) StreamTaskOutput ¶
func (*Daemon) TrustWorkspace ¶
func (*Daemon) Unsubscribe ¶
func (*Daemon) UpdateProviderModels ¶
func (d *Daemon) UpdateProviderModels(ctx context.Context, rawWS, name string, req api.UpdateProviderModelsRequest) ([]api.WorkspaceProvider, error)
UpdateProviderModels replaces spec.models on the manifest owning the named provider, then hot-reloads the workspace.
func (*Daemon) UpdateSandbox ¶
func (d *Daemon) UpdateSandbox(ctx context.Context, rawWS string, req api.UpdateSandboxRequest) (*api.SandboxResponse, error)
UpdateSandbox validates and atomically overwrites one scope's sandbox.json settings, then refreshes the kernel path policy of every open session in the workspace so edits take effect on the next command without restarting them. It returns the updated api.SandboxResponse.
func (*Daemon) UpdateSession ¶
func (*Daemon) UploadMedia ¶
func (*Daemon) Usage ¶
func (d *Daemon) Usage(ctx context.Context, rawWS string, req api.UsageRequest) (*api.UsageSummary, error)
func (*Daemon) VerifyProvider ¶
func (d *Daemon) VerifyProvider(ctx context.Context, req api.VerifyProviderRequest) (*api.VerifyProviderResponse, error)
func (*Daemon) Workspaces ¶
Workspaces returns sorted canonical root directories of all open workspace runtimes.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package broker routes events to the subscribers that asked for them.
|
Package broker routes events to the subscribers that asked for them. |
|
Package gateway manages model provider lifecycles and instantiates client interfaces for LLM completions, probabilistic decision models, and dense vector embeddings.
|
Package gateway manages model provider lifecycles and instantiates client interfaces for LLM completions, probabilistic decision models, and dense vector embeddings. |
|
auth
Package auth resolves provider credentials and manages authentication transports and OAuth sessions for the TaskSmith gateway.
|
Package auth resolves provider credentials and manages authentication transports and OAuth sessions for the TaskSmith gateway. |
|
providers
Package providers contains upstream-specific client adapters for the TaskSmith gateway.
|
Package providers contains upstream-specific client adapters for the TaskSmith gateway. |
|
Package harness orchestrates conversational and tool-augmented agent execution over a compiled github.com/masterkeysrd/loom/graph.Graph with durable SQLite-backed conversation state and permission checkpointing.
|
Package harness orchestrates conversational and tool-augmented agent execution over a compiled github.com/masterkeysrd/loom/graph.Graph with durable SQLite-backed conversation state and permission checkpointing. |
|
Package journal tracks per-session file reads and persists file change metadata in SQLite paired with content-addressable snapshots in the session's blobs directory, enabling on-demand diff generation, point-in-time recovery, and conflict-aware 3-way baseline reversion.
|
Package journal tracks per-session file reads and persists file change metadata in SQLite paired with content-addressable snapshots in the session's blobs directory, enabling on-demand diff generation, point-in-time recovery, and conflict-aware 3-way baseline reversion. |
|
Package mcp owns the live lifecycle of the MCP servers a workspace declares.
|
Package mcp owns the live lifecycle of the MCP servers a workspace declares. |
|
Package media implements content-addressed storage, magic-byte format detection, per-modality size limits, and lightweight message-block descriptors for multimodal inputs (images, PDFs, and audio).
|
Package media implements content-addressed storage, magic-byte format detection, per-modality size limits, and lightweight message-block descriptors for multimodal inputs (images, PDFs, and audio). |
|
Package metrics provides an asynchronous, SQLite-backed system for recording and querying operational measurements across LLM calls, tool executions, and file changes, and for aggregating them into per-session and cross-session usage summaries.
|
Package metrics provides an asynchronous, SQLite-backed system for recording and querying operational measurements across LLM calls, tool executions, and file changes, and for aggregating them into per-session and cross-session usage summaries. |
|
Package models provides a single, effective description of a model within a workspace.
|
Package models provides a single, effective description of a model within a workspace. |
|
Package permissions implements the daemon's permission gate: it evaluates planned tool invocations against workspace policies, the active permission mode, safety classifications, and allow/deny rules, minting a github.com/masterkeysrd/tasksmith/api.PermissionRequest whenever a human decision is required.
|
Package permissions implements the daemon's permission gate: it evaluates planned tool invocations against workspace policies, the active permission mode, safety classifications, and allow/deny rules, minting a github.com/masterkeysrd/tasksmith/api.PermissionRequest whenever a human decision is required. |
|
Package permreview hosts the daemon-owned Permission Review Service: a calibrated, one-shot decision-model reviewer that evaluates risky permission cards in auto mode before the human is interrupted.
|
Package permreview hosts the daemon-owned Permission Review Service: a calibrated, one-shot decision-model reviewer that evaluates risky permission cards in auto mode before the human is interrupted. |
|
Package sandbox provides an OS-level virtualized execution environment with strict confinement across three foundational capabilities: Filesystem (FS), Process execution (Proc), and Network access (Net).
|
Package sandbox provides an OS-level virtualized execution environment with strict confinement across three foundational capabilities: Filesystem (FS), Process execution (Proc), and Network access (Net). |
|
Package sandboxcfg persists and merges the user-facing sandbox.json configuration layer that decides *what* the kernel boundary allows once a process runs (mode, availability locks, unsandboxed escape hatches, and filesystem/network overrides).
|
Package sandboxcfg persists and merges the user-facing sandbox.json configuration layer that decides *what* the kernel boundary allows once a process runs (mode, availability locks, unsandboxed escape hatches, and filesystem/network overrides). |
|
Package scope carries session-, turn-, and tool-scoped metadata through context.Context so that subsystems (journal, metrics, sandbox, and others) can attribute their work without explicit parameter passing.
|
Package scope carries session-, turn-, and tool-scoped metadata through context.Context so that subsystems (journal, metrics, sandbox, and others) can attribute their work without explicit parameter passing. |
|
Package server implements the HTTP server layer for the TaskSmith Brain Daemon, providing pluggable modular routers, Server-Sent Events (SSE) streaming, and REST routes that serve the daemon to its clients.
|
Package server implements the HTTP server layer for the TaskSmith Brain Daemon, providing pluggable modular routers, Server-Sent Events (SSE) streaming, and REST routes that serve the daemon to its clients. |
|
Package session manages user-facing chat threads, session metadata, persistent per-session file change journals, per-session tool containers and permission gates, and the chronological session timeline stored in SQLite, resolving workspace agents, system prompts, and language models per session and executing conversational turns through github.com/masterkeysrd/tasksmith/internal/daemon/harness.Harness.
|
Package session manages user-facing chat threads, session metadata, persistent per-session file change journals, per-session tool containers and permission gates, and the chronological session timeline stored in SQLite, resolving workspace agents, system prompts, and language models per session and executing conversational turns through github.com/masterkeysrd/tasksmith/internal/daemon/harness.Harness. |
|
Package std provides TaskSmith's Standard Operations Library for executing filesystem, process, and network operations strictly within an isolated sandbox.Sandbox.
|
Package std provides TaskSmith's Standard Operations Library for executing filesystem, process, and network operations strictly within an isolated sandbox.Sandbox. |
|
Package tasks provides the daemon's background task management and execution, used to run workloads (notably the `bash` tool) that may outlive the synchronous wait window of a single tool call.
|
Package tasks provides the daemon's background task management and execution, used to run workloads (notably the `bash` tool) that may outlive the synchronous wait window of a single tool call. |
|
Package timeline manages the persistent, append-only chronological log of session events (messages, model/effort/agent/mode transitions, and permission resolutions) stored in the timeline SQLite table, ordered by UUIDv7 id ASC.
|
Package timeline manages the persistent, append-only chronological log of session events (messages, model/effort/agent/mode transitions, and permission resolutions) stored in the timeline SQLite table, ordered by UUIDv7 id ASC. |
|
Package tools provides TaskSmith's generic tool execution container, typed tool specification builder, custom workspace command tool adapter, and session permission and policy evaluation gate.
|
Package tools provides TaskSmith's generic tool execution container, typed tool specification builder, custom workspace command tool adapter, and session permission and policy evaluation gate. |
|
builtin
Package builtin provides the embedded WARP tool manifests (*.tool.md), generated tool-name constants, and standard library adapters for Tasksmith's built-in system tools (view, ls, glob, grep, write, edit, remove, bash, web_fetch, and download).
|
Package builtin provides the embedded WARP tool manifests (*.tool.md), generated tool-name constants, and standard library adapters for Tasksmith's built-in system tools (view, ls, glob, grep, write, edit, remove, bash, web_fetch, and download). |
|
Package workspace manages the discovery, loading, resolution, and rendering of declarative TaskSmith workspace configurations and resources.
|
Package workspace manages the discovery, loading, resolution, and rendering of declarative TaskSmith workspace configurations and resources. |