runtime

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

@index Shared runtime wiring for ccg CLI and ccg-server binaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildWalkers

func BuildWalkers(logger *slog.Logger) map[string]*treesitter.Walker

BuildWalkers constructs the language parser registry keyed by file extension. @intent register supported language walkers for build, update, and MCP execution paths.

Types

type Runtime

type Runtime struct {
	Logger            *slog.Logger
	DB                *gorm.DB
	Store             *graphgorm.Store
	UnitOfWork        ingest.UnitOfWork
	Search            ingest.SearchWriter
	SearchMaintenance document.Maintenance
	SearchBackend     searchsql.Backend
	SearchReader      *searchsql.Reader
	Walkers           map[string]*treesitter.Walker
	Syncer            *incremental.Syncer
	// contains filtered or unexported fields
}

Runtime holds shared graph, DB, parser, and search dependencies. @intent provide one dependency assembly path for local CLI and self-hosted server binaries. @sideEffect Init opens a database connection and Close closes parser/database resources.

func NewRuntime

func NewRuntime(logger *slog.Logger) *Runtime

NewRuntime creates shared runtime dependencies that do not require the database yet. @intent initialize parser walkers once before command-specific database setup runs.

func (*Runtime) Close

func (r *Runtime) Close()

Close releases parser and database resources owned by the runtime. @intent give both binaries one cleanup path for shared dependencies. @sideEffect closes Tree-sitter parsers and the active DB connection.

func (*Runtime) Init

func (r *Runtime) Init(driver, dsn string) error

Init opens the configured DB and attaches store/search/incremental services to the runtime. @intent keep schema validation and graph storage wiring identical across ccg and ccg-server. @sideEffect opens a database connection and may run safe local schema initialization.

func (*Runtime) MCPComponents

func (r *Runtime) MCPComponents() mcpruntime.Components

MCPComponents returns the shared application/adapter set used by stdio and HTTP MCP runtimes. @intent keep both transports on one grouped MCP assembly input without exposing composition to inbound adapters.

func (*Runtime) Migrate

func (r *Runtime) Migrate(driver, dsn, migrationsDir string) error

Migrate runs application migrations for the provided database settings. @intent expose migration execution without coupling binaries to migration internals. @sideEffect modifies the target database schema.

Directories

Path Synopsis
@index Shared MCP runtime assembly for stdio and HTTP server entry points.
@index Shared MCP runtime assembly for stdio and HTTP server entry points.
@index Remote HTTP runtime composition for MCP, Wiki, webhook, and repository sync.
@index Remote HTTP runtime composition for MCP, Wiki, webhook, and repository sync.

Jump to

Keyboard shortcuts

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