moduleagent

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// Home is the host state root; modules are discovered beneath it.
	//
	// The WORKSPACE is not stored here: it is resolved per agent and arrives as
	// an argument, so one provider serves every agent rather than each needing
	// its own.
	Home string
}

Provider adapts the detached-module host to the kernel's ToolProvider door.

THIS TYPE IS WHY THE KERNEL CAN BE EMBEDDED. The kernel used to import this package directly, which made it depend on module discovery, subprocess execution, both wire protocols, the contract gate and the cockpit's artefact view -- and made it impossible for an external module to import at all, since Go forbids importing internal/.

The direction is now inverted: the module host knows about the kernel, which is correct, because Layer 2 is optional infrastructure built ON the kernel rather than part of it.

Full Studio constructs one of these at its composition root. A standalone product constructs its own native provider instead and never links this package.

func NewProvider

func NewProvider(home string) *Provider

NewProvider returns a provider backed by the modules installed under home.

func (*Provider) RegisterTools

func (p *Provider) RegisterTools(workspace string, register func(agent.Tool)) (
	[]string, func(string) (string, string, []string))

RegisterTools satisfies agent.ToolProvider.

Behaviour is identical to the call the kernel used to make directly: every capability of every enabled module becomes a tool, summaries describe them in one line each, and the knowledge loader closes over the modules discovered HERE so selecting one costs a file read rather than re-describing every installed module as a subprocess.

Jump to

Keyboard shortcuts

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