kit

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package kit exposes prism's engine as an embeddable library for downstream agents (e.g. provasign/mason).

It is a thin facade over the same internals the CLI uses: one Kit is one prism session against one repo root, with the grove client, session cache, and persistent ledger wired exactly as `prism <op>` CLI invocations wire them. Nothing in this package changes existing prism behavior; it only re-exposes it across the module boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kit

type Kit struct {
	// contains filtered or unexported fields
}

Kit is an open prism session against one repository root.

func Open

func Open(dir string) (*Kit, error)

Open starts (or connects to) the grove engine for dir, auto-indexes a never-indexed repo, and attaches the persistent per-root ledger.

func (*Kit) Close

func (k *Kit) Close() error

Close persists the session cache and ledger and shuts down the client.

func (*Kit) Invoke

func (k *Kit) Invoke(tool string, args map[string]any) (any, error)

Invoke runs one prism tool by its MCP name (e.g. "prism_change_impact", "prism_read") and returns the raw result. Same dispatch as the MCP server and the CLI query commands.

func (*Kit) Root

func (k *Kit) Root() string

Root returns the absolute repository root this Kit is bound to.

func (*Kit) Savings

func (k *Kit) Savings() Savings

Savings reports the persistent ledger totals for this root.

type Savings

type Savings struct {
	OriginalTokens  int64
	DeliveredTokens int64
	SavedPercent    float64
}

Savings is the session token ledger as plain data, safe to consume from other modules (the underlying ledger type is prism-internal).

Jump to

Keyboard shortcuts

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