cairnline

package module
v0.1.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 5 Imported by: 0

README

Cairnline

Cairnline is an experimental local-first coordination server for human and AI work.

It provides durable project identity, work coordination, context metadata, collaboration artifacts, evidence, reviews, handoffs, accepted project memory, and memory-candidate concepts without assuming that any specific agent host can be launched or supervised.

Initial status: early implementation. Cairnline is usable as an experimental local MCP server, but its contracts are not stable yet.

For host authors, see Agent Host Integration for how MCP-capable clients should map Cairnline roles, assignments, desired-agent hints, and skills into their own agent/runtime concepts.

Goals

  • Work for rootless planning/research/design projects and workspace-backed code projects.
  • Expose project coordination over MCP stdio.
  • Let agents pull/claim work through MCP instead of requiring push-based orchestration.
  • Keep Hecate-specific runtime behavior out of the portable core.

Concept Boundary

Cairnline's portable concepts are coordination concepts:

  • Project role: a responsibility inside a project, such as architect, implementer, reviewer, researcher, designer, or operator.
  • Assignment: a durable coordination record binding work item, role, optional root, execution mode, desired agent metadata, and lifecycle status.
  • Desired agent: a portable hint about which kind of human or agent host should claim work, plus skill ids the claimant may understand.
  • Skill metadata: referenced capability/instruction metadata only; it does not load, inject, execute, install, or fetch skill bodies.

Cairnline does not expose agent presets, runtime profiles, provider settings, model settings, sandbox policy, or launch permissions as portable MCP concepts. MCP clients should create project roles plus assignments with execution_mode, desired_agent.kind, and desired_agent.skill_ids, then map those hints to their own Claude, Cursor, Copilot, OpenAI, Hecate, human, or other host-specific agent configuration. Cairnline records intent and provenance; the agent host remains responsible for runtime policy, permissions, model choice, sandboxing, and launch behavior. Cairnline does not keep portable agent-preset or runtime-profile catalogs, and host-specific preset/runtime ids should live in the consuming agent host rather than in Cairnline coordination records.

Security Boundaries

Cairnline is local-first and single-operator by default. It stores coordination state and exposes it over MCP, so clients should treat mutating tools as durable state changes that need the same care as editing a project database.

Project roots are optional metadata until a feature explicitly needs local files. Current skill discovery is the main local-read path: it reads bounded guidance files from active roots, discovers local SKILL.md metadata, and skips absolute paths, parent traversal, remote URLs, and hidden worktree folders. It stores names, descriptions, provenance, suggested tool names, and nullable permission hints without storing, injecting, executing, installing, or fetching skill bodies. Skill metadata is not permission to enable tools, writes, network access, approvals, or sandbox escapes.

Source locators, evidence locators, and evidence URLs are operator-provided metadata. Cairnline stores them as-is and does not fetch or render them. Clients must validate schemes before displaying a locator as a clickable link or before opening/fetching it.

Assignments are coordination records. Claiming or reading an assignment does not authorize an agent host to bypass its own sandboxing, approval policy, network policy, credential handling, or logged-in session boundaries. Secrets, cookies, provider credentials, and external-agent private memory are outside Cairnline's core model.

Cairnline assignment metadata is not authorization. Agent hosts and orchestrators must enforce their own policy boundaries even when an assignment asks for a particular execution mode, desired agent kind, or skill id.

Role references are durable coordination metadata rather than hard ownership. Creating or updating work-item owner/reviewer refs and assignment role refs validates the role at write time, but deleting a role does not delete or block historical records that still carry that role id. Context and launch-packet reads surface missing-role warnings so operators can repair or preserve the historical record deliberately.

Current Slice

Implemented now:

  • portable core types for projects with roots/default root, context source provenance metadata, project roles, work items, assignments with lifecycle timestamps, desired agent hints, skill metadata, generic collaboration artifacts, assignment-scoped evidence with source/provider/external-id metadata, structured review verdict/risk metadata, handoffs with source/target refs and status-transition timestamps, accepted memory, and memory candidates
  • in-memory service for projects, project roles, work items, assignments, assistant proposal records including project-root/default-root actions, and collaboration artifacts
  • SQLite store for durable projects, project roles, work items, assignments, skill metadata, assistant proposal records, and collaboration artifacts
  • project skill discovery from interoperable .agents/skills, Cairnline-native .cairnline/skills, Claude-compatible .claude/skills, Gemini-compatible .gemini/skills, compatibility .hecate/skills, and enabled guidance-linked local skill roots; recognized guidance locators include AGENTS.md, CLAUDE.md, GEMINI.md, .cursor/rules, .github/instructions, .devin/rules, and .windsurf/rules; rediscovery refreshes discovered status, provenance, suggested tools, and permission hints while preserving operator-edited enabled/title/description and trust-label fields

Skill roots are metadata discovery only: Cairnline records SKILL.md title, description, path, provenance, suggested-tool hints, and nullable permission hints, but never loads skill bodies, executes skill code, or treats a skill as authorization. The .claude/skills default follows the Claude Code skills documentation, and .gemini/skills follows Gemini CLI Agent Skills workspace discovery; both were checked on July 4, 2026: Claude Code skills, Gemini CLI Agent Skills.

  • embeddable Go API for applications that want to use the coordination core directly instead of speaking MCP, including work-item owner/reviewer role-ref validation, assignment metadata updates that preserve created time and claim ownership while validating work-item, role, root, and durable coordination references, a narrow claimed-assignment release path for pre-dispatch retry cleanup, plus source-level context metadata create/update/delete helpers that avoid whole-project replacement
  • embeddable snapshot export/import for migration rehearsals and bridge seeding; snapshots cover projects, skills, roles, work, assignments, artifacts, evidence, reviews, handoffs, memory entries, memory candidates, and assistant proposal records
  • stdio MCP server with JSON-RPC framing
  • MCP protocol structs carry the spec fields a richer tool surface needs: tool outputSchema, _meta passthrough on tools, resources, resource content, and tool results, embedded-resource and base64 blob tool-result content, and capabilities.extensions negotiation during initialize (the server declares none by default)
  • MCP read tools return human-readable text plus structuredContent where a stable data shape exists, including core project/role/work/assignment list surfaces, coordination capabilities, and assignment context/launch packet reads, so compatible clients can avoid scraping text output
  • MCP resources and resource templates:
    • cairnline://projects/{project_id}
    • cairnline://projects/{project_id}/work-items/{work_item_id}
    • cairnline://projects/{project_id}/work-items/{work_item_id}/closeout-readiness
    • cairnline://projects/{project_id}/assignments/{assignment_id}
    • cairnline://projects/{project_id}/assignments/{assignment_id}/launch-packet
    • cairnline://projects/{project_id}/memory-candidates/{memory_candidate_id}
  • MCP tools:
    • coordination.capabilities
    • projects.list
    • projects.get
    • projects.create
    • projects.update
    • projects.delete
    • projects.activity
    • projects.health
    • projects.operations_brief
    • projects.setup_readiness
    • roots.list
    • roots.create
    • roots.update
    • roots.delete
    • context_sources.list
    • context_sources.create
    • context_sources.update
    • context_sources.delete
    • assistant.propose
    • assistant.proposals.list
    • assistant.proposals.get
    • assistant.apply
    • skills.list
    • skills.create
    • skills.update
    • skills.discover
    • roles.list
    • roles.create
    • roles.update
    • roles.delete
    • work_items.list
    • work_items.get
    • work_items.create
    • work_items.update
    • work_items.delete
    • work_items.closeout_readiness
    • assignments.list
    • assignments.get
    • assignments.next
    • assignments.create
    • assignments.update
    • assignments.claim
    • assignments.release
    • assignments.update_status
    • assignments.context
    • assignments.launch_packet
    • assignments.complete
    • assignments.delete
    • artifacts.list
    • artifacts.get
    • artifacts.create
    • evidence.list
    • evidence.get
    • evidence.record
    • reviews.list
    • reviews.get
    • reviews.record
    • handoffs.create
    • handoffs.list
    • handoffs.get
    • handoffs.update
    • handoffs.update_status
    • handoffs.delete
    • memory_entries.list
    • memory_entries.get
    • memory_entries.create
    • memory_entries.update
    • memory_entries.delete
    • memory_candidates.list
    • memory_candidates.get
    • memory_candidates.create
    • memory_candidates.promote
    • memory_candidates.reject
    • memory_candidates.delete
  • assignment launch packets with project, role, assignment, desired-agent, skill, generic-artifact, evidence, review, handoff, accepted-memory, and memory-candidate metadata
  • read-only work-item closeout readiness summaries derived from assignment, evidence, review, and handoff metadata
  • read-only project operations briefs for attention routing across active assignments, blocked closeout, review follow-up, memory candidates, and open work
  • read-only project activity projections grouped by active, blocked, completed, and recent assignment state; queued assignments are attention items until claimed, while claimed/running/review assignments are active
  • read-only project setup-readiness and health summaries for onboarding, context/skill gaps, and bounded operator attention
  • deterministic assistant proposal/apply tools with durable proposal records, proposal warnings, apply attempts, latest-result state, and repeat-apply protection for confirmed project-state mutations; applying a proposal can create queued assignment coordination records, but it does not launch or supervise agents
  • snapshot and proposal-record imports preserve assistant ledger state without replaying proposal actions

Run

Install a release binary on macOS or Linux:

version=v0.1.0-alpha.4 # replace with the release tag you want
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
arch="$(uname -m)"
case "$arch" in
  x86_64) arch=amd64 ;;
  aarch64) arch=arm64 ;;
esac
curl -L "https://github.com/hecatehq/cairnline/releases/download/${version}/cairnline_${version}_${os}_${arch}.tar.gz" -o cairnline.tar.gz
tar -xzf cairnline.tar.gz cairnline
mkdir -p "$HOME/.local/bin"
install -m 0755 cairnline "$HOME/.local/bin/cairnline"
"$HOME/.local/bin/cairnline" -version

On Windows, download the cairnline_${version}_windows_amd64.tar.gz archive from the same release, extract cairnline.exe, and run:

.\cairnline.exe -version

Each release also publishes checksums.txt for the archives. Prerelease tags such as v0.1.0-alpha.4 are published as GitHub prereleases while the MCP contract is still settling. Release binaries are built for darwin/amd64, darwin/arm64, linux/amd64, linux/arm64, and windows/amd64.

Maintainers cut binary releases by pushing a v* tag. The release workflow runs tests, vet, race tests, builds the archives, and attaches them to the GitHub release.

Or install the command from source:

go install github.com/hecatehq/cairnline/cmd/cairnline@latest

Ephemeral in-memory state:

go run ./cmd/cairnline

Durable SQLite state:

go run ./cmd/cairnline -db ./cairnline.db

The server speaks MCP over newline-delimited JSON-RPC on stdin/stdout.

For a first standalone workflow, see the MCP quickstart. It walks through creating a rootless project, adding a role and work item, queueing an assignment, claiming it from an agent, recording evidence, and completing the assignment without any Hecate-specific runtime.

Embedded Go API

Applications can embed Cairnline directly through the root Go package. Do not import internal/* packages; they are private implementation details.

package main

import (
	"context"
	"log"

	"github.com/hecatehq/cairnline"
)

func main() {
	ctx := context.Background()

	service, store, err := cairnline.NewSQLiteService(ctx, "cairnline.db")
	if err != nil {
		log.Fatal(err)
	}
	defer store.Close()

	project, err := service.CreateProject(ctx, cairnline.Project{
		Name: "Example project",
	})
	if err != nil {
		log.Fatal(err)
	}

	_, err = service.CreateWorkItem(ctx, cairnline.WorkItem{
		ProjectID: project.ID,
		Title:     "Coordinate the next reviewable task",
	})
	if err != nil {
		log.Fatal(err)
	}
}

For tests or short-lived tools, use the in-memory service:

service := cairnline.NewMemoryService()

Embedded hosts can rehearse migration through snapshots:

snapshot, err := source.ExportSnapshot(ctx)
if err != nil {
	log.Fatal(err)
}

_, err = target.ImportSnapshot(ctx, snapshot)
if err != nil {
	log.Fatal(err)
}

Snapshot import is additive/upsert. It does not delete records that are absent from the snapshot, does not replay assistant proposal actions, and is not exposed as an MCP bulk mutation tool.

An embedding host can also build the MCP server from the root package instead of shelling out to the stdio binary. cairnline.NewMCPServer(service, version) returns the fully-registered server; mount it on a custom transport by feeding each inbound JSON-RPC message through server.HandleMessage(ctx, msg) (the second return is false for notifications), or run the built-in stdio loop with server.Serve(ctx, os.Stdin, os.Stdout). See Agent Host Integration for the mount details and optional capabilities.extensions negotiation.

MCP Client Config

Use a durable SQLite database for normal local use:

{
  "mcpServers": {
    "cairnline": {
      "command": "cairnline",
      "args": ["-db", "/Users/alice/.local/share/cairnline/cairnline.db"]
    }
  }
}

For development from a checkout:

{
  "mcpServers": {
    "cairnline-dev": {
      "command": "go",
      "args": [
        "run",
        "./cmd/cairnline",
        "-db",
        "/tmp/cairnline-dev.db"
      ],
      "cwd": "/path/to/cairnline"
    }
  }
}

Hecate Integration Status

Cairnline is the intended portable extraction path for Hecate's Projects coordination substrate. It is still developed as a standalone, agent-neutral server first; Hecate is one integration client, not the host that defines the core model.

Cairnline ships a public embeddable Go API, and Hecate embeds it live today: Hecate pins Cairnline through go.mod and runs it as an in-process service. A sidecar connector mode also exists for running Cairnline out of process. MCP remains the interoperability surface for external agents and other hosts.

Mirror-on-write is live. Hecate live-mirrors every portable project-coordination write family into the embedded Cairnline store: project identity, metadata/defaults, roots, context sources, skills, roles, work items, assignments, collaboration artifacts, handoffs, accepted memory, memory candidates, and Project Assistant proposal-ledger records.

Current Hecate dogfood covers:

  • embedded Cairnline read-model projections for Hecate's project list/detail, setup, health, skills, memory, roles, work, assignment, collaboration, Project Assistant, chat-context, activity, closeout, and operations views
  • live write-mirroring of all the portable project-coordination families listed above into the embedded Cairnline store
  • strict embedded mirror/parity probes, migration rehearsal evidence, rollback notes, and backend-status gates for deciding when Cairnline is authoritative for portable project coordination state
  • Cairnline-only project identity and project-work journeys in Hecate tests, where Hecate keeps only runtime/workspace overlays for task/chat execution

Recent fidelity work (cairnline#76, merged 2026-07-09) added a structured ExecutionRef, a first-class awaiting_approval assignment status, and memory in assignment context packets, tightening how host runtime state maps onto Cairnline coordination records.

An opt-in armed replacement mode is implemented and off by default. When an operator enables it, Cairnline becomes authoritative for portable project coordination and Hecate keeps only a runtime overlay for task/chat execution. Normal builds still default to Hecate-owned coordination with Cairnline mirrored alongside.

These integration contracts are not stable yet. Cairnline is still alpha, and both the MCP surface and the embedded Go API can change.

Hecate still owns native operator UI/UX, model gateway behavior, task runtime, External Agent supervision, approvals, traces, root discovery, and Git worktree creation. Those are host/orchestrator responsibilities, not Cairnline core.

Before Hecate can make Cairnline the default Projects backend in normal builds, the remaining integration work is:

  • keep replacement-mode gates green under real dogfood, not only fixture tests
  • shrink Hecate compatibility-shadow code once cutover behavior is stable
  • package Cairnline as an additional local download for non-Hecate hosts
  • keep MCP contracts stable enough for MCP-pull/manual assignment workflows
  • decide whether Hecate should also support standalone MCP-server mode as an operator-selectable backend in addition to the embedded Go service

Test

go test ./...

The public CI also runs:

go vet ./...
go test -race ./...

Documentation

Overview

Package cairnline exposes the embeddable project coordination core.

The root package is the public API intended for applications such as Hecate. Concrete storage internals remain in internal packages; NewMCPServer exposes the MCP protocol server so an embedding host can mount Cairnline's tool and resource surface on its own transport.

Index

Constants

View Source
const (
	SnapshotVersion = core.SnapshotVersion

	WorkStatusReady = core.WorkStatusReady
	WorkStatusDone  = core.WorkStatusDone
	PriorityNormal  = core.PriorityNormal

	ExecutionManual          = core.ExecutionManual
	ExecutionMCPPull         = core.ExecutionMCPPull
	ExecutionExternalAdapter = core.ExecutionExternalAdapter
	ExecutionOrchestrated    = core.ExecutionOrchestrated

	AssignmentQueued           = core.AssignmentQueued
	AssignmentClaimed          = core.AssignmentClaimed
	AssignmentRunning          = core.AssignmentRunning
	AssignmentAwaitingApproval = core.AssignmentAwaitingApproval
	AssignmentReview           = core.AssignmentReview
	AssignmentCompleted        = core.AssignmentCompleted
	AssignmentFailed           = core.AssignmentFailed
	AssignmentCancelled        = core.AssignmentCancelled

	DesiredAgentAny = core.DesiredAgentAny

	SkillFormatMarkdown  = core.SkillFormatMarkdown
	SkillStatusAvailable = core.SkillStatusAvailable
	SkillStatusMissing   = core.SkillStatusMissing
	SkillStatusInvalid   = core.SkillStatusInvalid
	SkillStatusConflict  = core.SkillStatusConflict
	SkillTrustWorkspace  = core.SkillTrustWorkspace
	SkillPathAgents      = core.SkillPathAgents
	SkillPathHecate      = core.SkillPathHecate
	SkillPathCairnline   = core.SkillPathCairnline
	SkillPathClaude      = core.SkillPathClaude
	SkillPathGemini      = core.SkillPathGemini

	EvidenceTrustOperator = core.EvidenceTrustOperator

	ReviewVerdictApproved         = core.ReviewVerdictApproved
	ReviewVerdictChangesRequested = core.ReviewVerdictChangesRequested
	ReviewVerdictBlocked          = core.ReviewVerdictBlocked
	ReviewVerdictRisk             = core.ReviewVerdictRisk
	ReviewVerdictPass             = core.ReviewVerdictPass
	ReviewVerdictConcerns         = core.ReviewVerdictConcerns
	ReviewRiskLow                 = core.ReviewRiskLow
	ReviewRiskMedium              = core.ReviewRiskMedium
	ReviewRiskHigh                = core.ReviewRiskHigh
	ReviewRiskUnknown             = core.ReviewRiskUnknown
	ReviewStatusRecorded          = core.ReviewStatusRecorded

	HandoffStatusOpen       = core.HandoffStatusOpen
	HandoffStatusAccepted   = core.HandoffStatusAccepted
	HandoffStatusSuperseded = core.HandoffStatusSuperseded
	HandoffStatusDismissed  = core.HandoffStatusDismissed

	MemoryTrustOperator   = core.MemoryTrustOperator
	MemoryTrustGenerated  = core.MemoryTrustGenerated
	MemorySourceOperator  = core.MemorySourceOperator
	MemorySourceGenerated = core.MemorySourceGenerated

	MemoryCandidatePending  = core.MemoryCandidatePending
	MemoryCandidatePromoted = core.MemoryCandidatePromoted
	MemoryCandidateRejected = core.MemoryCandidateRejected
	MemoryCandidateProposed = core.MemoryCandidateProposed

	ProjectOperationsStatusClear     = core.ProjectOperationsStatusClear
	ProjectOperationsStatusAttention = core.ProjectOperationsStatusAttention

	ProjectSetupStatusReady    = core.ProjectSetupStatusReady
	ProjectSetupStatusTodo     = core.ProjectSetupStatusTodo
	ProjectSetupStatusOptional = core.ProjectSetupStatusOptional

	ProjectSetupActionSetupProject   = core.ProjectSetupActionSetupProject
	ProjectSetupActionCreateWorkItem = core.ProjectSetupActionCreateWorkItem
	ProjectSetupActionUpdateProject  = core.ProjectSetupActionUpdateProject
	ProjectSetupActionManageContext  = core.ProjectSetupActionManageContext
	ProjectSetupActionManageRoles    = core.ProjectSetupActionManageRoles

	ProjectHealthStatusClear     = core.ProjectHealthStatusClear
	ProjectHealthStatusAttention = core.ProjectHealthStatusAttention

	AssistantProposalSourceAPI       = core.AssistantProposalSourceAPI
	AssistantProposalSourceAssistant = core.AssistantProposalSourceAssistant

	AssistantProposalStatusProposed     = core.AssistantProposalStatusProposed
	AssistantProposalStatusNeedsConfirm = core.AssistantProposalStatusNeedsConfirm
	AssistantProposalStatusApplied      = core.AssistantProposalStatusApplied
	AssistantProposalStatusPartial      = core.AssistantProposalStatusPartial
	AssistantProposalStatusRejected     = core.AssistantProposalStatusRejected

	AssistantActionCreateProject         = core.AssistantActionCreateProject
	AssistantActionUpdateProject         = core.AssistantActionUpdateProject
	AssistantActionAttachProjectRoot     = core.AssistantActionAttachProjectRoot
	AssistantActionRemoveProjectRoot     = core.AssistantActionRemoveProjectRoot
	AssistantActionSetProjectDefaults    = core.AssistantActionSetProjectDefaults
	AssistantActionCreateRole            = core.AssistantActionCreateRole
	AssistantActionUpdateRole            = core.AssistantActionUpdateRole
	AssistantActionCreateWorkItem        = core.AssistantActionCreateWorkItem
	AssistantActionUpdateWorkItem        = core.AssistantActionUpdateWorkItem
	AssistantActionCreateAssignment      = core.AssistantActionCreateAssignment
	AssistantActionCreateEvidence        = core.AssistantActionCreateEvidence
	AssistantActionCreateReview          = core.AssistantActionCreateReview
	AssistantActionCreateHandoff         = core.AssistantActionCreateHandoff
	AssistantActionUpdateHandoff         = core.AssistantActionUpdateHandoff
	AssistantActionCreateMemoryCandidate = core.AssistantActionCreateMemoryCandidate

	AssistantApplyStatusApplied      = core.AssistantApplyStatusApplied
	AssistantApplyStatusNeedsConfirm = core.AssistantApplyStatusNeedsConfirm
	AssistantApplyStatusPartial      = core.AssistantApplyStatusPartial
	AssistantApplyStatusRejected     = core.AssistantApplyStatusRejected

	ProjectOperationKindAssignment      = core.ProjectOperationKindAssignment
	ProjectOperationKindCloseoutReady   = core.ProjectOperationKindCloseoutReady
	ProjectOperationKindHandoff         = core.ProjectOperationKindHandoff
	ProjectOperationKindMemoryCandidate = core.ProjectOperationKindMemoryCandidate
	ProjectOperationKindMissingEvidence = core.ProjectOperationKindMissingEvidence
	ProjectOperationKindReviewFollowUp  = core.ProjectOperationKindReviewFollowUp
	ProjectOperationKindProjectSetup    = core.ProjectOperationKindProjectSetup
	ProjectOperationKindSkill           = core.ProjectOperationKindSkill
	ProjectOperationKindWorkItem        = core.ProjectOperationKindWorkItem

	ProjectOperationSeverityBlocked = core.ProjectOperationSeverityBlocked
	ProjectOperationSeverityAction  = core.ProjectOperationSeverityAction
	ProjectOperationSeverityActive  = core.ProjectOperationSeverityActive
	ProjectOperationSeverityReady   = core.ProjectOperationSeverityReady
	ProjectOperationSeverityInfo    = core.ProjectOperationSeverityInfo

	ProjectActivityBucketActive    = core.ProjectActivityBucketActive
	ProjectActivityBucketBlocked   = core.ProjectActivityBucketBlocked
	ProjectActivityBucketCompleted = core.ProjectActivityBucketCompleted
	ProjectActivityBucketOther     = core.ProjectActivityBucketOther

	LaunchPacketKindAssignment = core.LaunchPacketKindAssignment
)
View Source
const (
	// ErrorCodeNotFound reports that a referenced entity does not exist.
	// Suggested host HTTP status: 404.
	ErrorCodeNotFound = core.ErrorCodeNotFound
	// ErrorCodeInvalid reports bad or missing input, including argument-decode
	// failures and domain validation errors. Suggested host HTTP status: 400.
	ErrorCodeInvalid = core.ErrorCodeInvalid
	// ErrorCodeAlreadyExists reports an id or uniqueness collision.
	// Suggested host HTTP status: 409.
	ErrorCodeAlreadyExists = core.ErrorCodeAlreadyExists
	// ErrorCodeConflict reports an invalid state transition or a claim race —
	// the request was well-formed but conflicts with current state.
	// Suggested host HTTP status: 409.
	ErrorCodeConflict = core.ErrorCodeConflict
	// ErrorCodeInternal is the default for any unexpected, unclassified
	// server-side failure. Suggested host HTTP status: 500.
	ErrorCodeInternal = core.ErrorCodeInternal
)

Tool-error codes are the stable, machine-readable contract a host places on MCP tool failures. Each code names one class of failure so a host can map it to an HTTP status (or its own error taxonomy) without parsing human prose.

The canonical definitions live in internal/core beside the store sentinels so the MCP server can classify errors without importing the root package (which would form an import cycle). These names are the public surface re-exported for external callers of the cairnline module.

Variables

View Source
var (
	ErrNotFound  = core.ErrNotFound
	ErrInvalid   = core.ErrInvalid
	ErrDuplicate = core.ErrDuplicate
	ErrConflict  = core.ErrConflict
)

Functions

func ClassifyErrorCode

func ClassifyErrorCode(err error) string

ClassifyErrorCode maps an error to its stable tool-error code by matching the typed store sentinels with errors.Is, so wrapped and joined errors classify correctly. It returns "" for a nil error and ErrorCodeInternal for anything that matches no sentinel. It delegates to internal/core, the canonical home of the classification logic.

func NewSQLiteService

func NewSQLiteService(ctx context.Context, path string) (*Service, *SQLiteStore, error)

Types

type Artifact

type Artifact = core.Artifact

type Assignment

type Assignment = core.Assignment

type AssignmentCompatibilityFilter

type AssignmentCompatibilityFilter = core.AssignmentCompatibilityFilter

type AssignmentContext

type AssignmentContext = core.AssignmentContext

type AssignmentLaunchPacket

type AssignmentLaunchPacket = core.AssignmentLaunchPacket

type AssistantAction

type AssistantAction = core.AssistantAction

type AssistantActionResult

type AssistantActionResult = core.AssistantActionResult

type AssistantApplyAttempt

type AssistantApplyAttempt = core.AssistantApplyAttempt

type AssistantApplyResult

type AssistantApplyResult = core.AssistantApplyResult

type AssistantProposal

type AssistantProposal = core.AssistantProposal

type AssistantProposalRecord

type AssistantProposalRecord = core.AssistantProposalRecord

type AssistantTarget

type AssistantTarget = core.AssistantTarget

type DesiredAgent

type DesiredAgent = core.DesiredAgent

type Evidence

type Evidence = core.Evidence

type ExecutionRef

type ExecutionRef = core.ExecutionRef

type Handoff

type Handoff = core.Handoff

type MCPServer

type MCPServer = mcp.Server

MCPServer is the MCP protocol server that exposes Cairnline's coordination tools and resources. Build one with NewMCPServer, then mount it on a custom transport via HandleMessage or run the built-in stdio loop with Serve. DeclareExtension advertises optional protocol extensions during initialize.

func NewMCPServer

func NewMCPServer(service *Service, version string) *MCPServer

NewMCPServer builds an MCP server with Cairnline's full tool and resource set registered against service. version is reported in serverInfo and the coordination.capabilities tool.

type MemoryCandidate

type MemoryCandidate = core.MemoryCandidate

type MemoryCandidateFilter

type MemoryCandidateFilter = core.MemoryCandidateFilter

type MemoryCandidatePromotion

type MemoryCandidatePromotion = core.MemoryCandidatePromotion

type MemoryCandidateSourceRef

type MemoryCandidateSourceRef = core.MemoryCandidateSourceRef

type MemoryEntry

type MemoryEntry = core.MemoryEntry

type MemoryStore

type MemoryStore = core.MemoryStore

func NewMemoryStore

func NewMemoryStore() *MemoryStore

type Project

type Project = core.Project

type ProjectActivity

type ProjectActivity = core.ProjectActivity

type ProjectActivityBuckets

type ProjectActivityBuckets = core.ProjectActivityBuckets

type ProjectActivityCounts

type ProjectActivityCounts = core.ProjectActivityCounts

type ProjectActivityItem

type ProjectActivityItem = core.ProjectActivityItem

type ProjectHealth

type ProjectHealth = core.ProjectHealth

type ProjectHealthAttentionItem

type ProjectHealthAttentionItem = core.ProjectHealthAttentionItem

type ProjectHealthSummary

type ProjectHealthSummary = core.ProjectHealthSummary

type ProjectOperationItem

type ProjectOperationItem = core.ProjectOperationItem

type ProjectOperationsBrief

type ProjectOperationsBrief = core.ProjectOperationsBrief

type ProjectOperationsCounts

type ProjectOperationsCounts = core.ProjectOperationsCounts

type ProjectSetupReadiness

type ProjectSetupReadiness = core.ProjectSetupReadiness

type ProjectSetupReadinessAction

type ProjectSetupReadinessAction = core.ProjectSetupReadinessAction

type ProjectSetupReadinessCheck

type ProjectSetupReadinessCheck = core.ProjectSetupReadinessCheck

type ProjectSetupReadinessSummary

type ProjectSetupReadinessSummary = core.ProjectSetupReadinessSummary

type ProjectSkill

type ProjectSkill = core.ProjectSkill

type RequiredPermissions

type RequiredPermissions = core.RequiredPermissions

type Review

type Review = core.Review

type ReviewFollowUpReadiness

type ReviewFollowUpReadiness = core.ReviewFollowUpReadiness

type Role

type Role = core.Role

type Root

type Root = core.Root

type SQLiteStore

type SQLiteStore = sqlitestore.Store

func OpenSQLiteStore

func OpenSQLiteStore(ctx context.Context, path string) (*SQLiteStore, error)

type Service

type Service = core.Service

func NewMemoryService

func NewMemoryService() *Service

func NewService

func NewService(store Store) *Service

type Snapshot

type Snapshot = core.Snapshot

type Source

type Source = core.Source

type Store

type Store = core.Store

type WorkItem

type WorkItem = core.WorkItem

type WorkItemCloseoutReadiness

type WorkItemCloseoutReadiness = core.WorkItemCloseoutReadiness

Directories

Path Synopsis
cmd
cairnline command
internal
app
mcp

Jump to

Keyboard shortcuts

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