runtime

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package runtime coordinates workspace capability bindings, sandbox execution, inline-safe response budgeting, live TUI status updates, and audit logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine manages workspace-scoped capability instances, state stores, audit logs, and PTC program execution.

func NewEngine

func NewEngine(dataDir, defaultCwd string) *Engine

NewEngine creates a PTC runtime engine with Antigravity plugin defaults.

func NewEngineWithOptions

func NewEngineWithOptions(opts EngineOptions) *Engine

NewEngineWithOptions creates a runtime engine with explicit host profile options.

func (*Engine) Close

func (e *Engine) Close()

Close shuts down pooled external MCP processes.

func (*Engine) RunMCPExec

func (e *Engine) RunMCPExec(ctx context.Context, in ExecInput) (text string, isError bool)

RunMCPExec executes a PTC TypeScript program and returns an inline-safe (`<= 9,600 B` UTF-8 by default) formatted response.

func (*Engine) SetClientWorkspace

func (e *Engine) SetClientWorkspace(ws string)

SetClientWorkspace records a workspace root reported by the MCP client during `initialize`.

type EngineOptions

type EngineOptions struct {
	DataDir               string
	DefaultCwd            string
	DefaultMaxOutputBytes int  // 0 -> output.DefaultInlineMaxBytes (9600)
	StrictWorkspace       bool // confine all file/shell access strictly to workspace + ExtraRoots
	ExtraRoots            []string
	PolicyFiles           []string
	MCPConfigPaths        []string
	TrustWorkspaceMCP     bool
	AntigravityMode       bool // true for agy-ptc plugin; false for standalone generic mcplex
}

EngineOptions configures a runtime Engine for either standalone MCPlex or Antigravity plugin mode.

type ExecInput

type ExecInput struct {
	Code           string            `json:"code"`
	Payloads       map[string]string `json:"payloads,omitempty"`
	Cwd            string            `json:"cwd,omitempty"`
	Title          string            `json:"title,omitempty"`
	TimeoutMs      int               `json:"timeoutMs,omitempty"`
	TimeoutSec     int               `json:"timeoutSec,omitempty"`
	MaxOutputBytes int               `json:"maxOutputBytes,omitempty"`
}

ExecInput represents the flat MCP arguments passed to `exec`.

type LiveStatus

type LiveStatus struct {
	Active       bool   `json:"active"`
	Title        string `json:"title,omitempty"`
	CurrentOp    string `json:"currentOp,omitempty"`
	TotalRuns    int64  `json:"totalRuns"`
	TotalHostOps int64  `json:"totalHostOps"`
	LastDurMs    int64  `json:"lastDurationMs"`
	LastStatus   string `json:"lastStatus"`
	UpdatedAt    string `json:"updatedAt"`
}

LiveStatus is written atomically to `${PLUGIN_DATA}/live-status.json` for `agy-ptc statusline`.

Jump to

Keyboard shortcuts

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