Documentation
¶
Index ¶
- func Define[In any, Out any](c *Client, name string, handler func(context.Context, In) (Out, error)) *sdk.Runnable[In, Out]
- func MustReadFile(path string) []byte
- func NewRequestEnv(text, action string, labels []string) core.Envelope
- func WithExtractor(action core.Action, ext ports.Extractor) core.Action
- type Client
- type ClientOption
- func WithConfig(cfg *config.Config) ClientOption
- func WithConfigFile(path string) ClientOption
- func WithEngine(e core.Evaluator) ClientOption
- func WithHistory(store core.HistoryStore) ClientOption
- func WithLLM(gen core.TextGenerator) ClientOption
- func WithLogger(l core.Logger) ClientOption
- func WithMemory(mem core.AgentMemory) ClientOption
- func WithPolicyPath(path string) ClientOption
- func WithProviderConfig(name string, cfg config.ActionConfig) ClientOption
- func WithStateProvider(provider core.StateProvider) ClientOption
- func WithStdoutTracer() ClientOption
- func WithSteeringEnabled() ClientOption
- func WithTracerProvider(tp trace.TracerProvider) ClientOption
- type ExecuteOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Define ¶
func Define[In any, Out any]( c *Client, name string, handler func(context.Context, In) (Out, error), ) *sdk.Runnable[In, Out]
Define is the public entry point for creating Actions
func MustReadFile ¶ added in v0.4.0
MustReadFile reads the file at path and panics on error. It is a small convenience for example/demo setup code where a missing fixture is fatal.
The path is resolved cwd-independently for relative paths: if the file cannot be found relative to the current working directory, it is resolved relative to the source directory of MustReadFile's caller (via runtime.Caller). This makes examples and tests work whether they are run from the repo root, the example's directory, or `go test`.
func NewRequestEnv ¶ added in v0.4.0
NewRequestEnv builds an envelope for a request gated by a policy. It sets the payload to text, attaches the provided security labels (e.g. "tainted"), and emits an action_operation fact so policies keyed on the action name can match.
Types ¶
type Client ¶
--- Aliases ---
func MustNewClient ¶ added in v0.4.0
func MustNewClient(ctx context.Context, opts ...ClientOption) *Client
MustNewClient creates a client and panics if initialization fails.
func NewClient ¶
func NewClient(ctx context.Context, opts ...ClientOption) (*Client, error)
NewClient initializes the client with defaults. It implements the "Batteries Included" philosophy by leveraging SDK defaults.
func QuickClient ¶ added in v0.7.0
QuickClient is the shortest path to a governed client: it constructs a Client and loads the Datalog policy at policyPath (same as WithPolicyPath), returning typed errors for a missing file or an invalid policy. For anything beyond a policy file, use NewClient with options.
client, err := manglekit.QuickClient(ctx, "policy.dl")
type ClientOption ¶
type ClientOption = sdk.ClientOption
func WithConfig ¶ added in v0.7.0
func WithConfig(cfg *config.Config) ClientOption
WithConfig applies settings from a loaded configuration struct.
func WithConfigFile ¶ added in v0.7.0
func WithConfigFile(path string) ClientOption
WithConfigFile loads configuration from a YAML file and applies it.
func WithEngine ¶ added in v0.7.0
func WithEngine(e core.Evaluator) ClientOption
WithEngine allows injecting a custom or mock core.Evaluator.
func WithHistory ¶
func WithHistory(store core.HistoryStore) ClientOption
WithHistory sets only the chat-history component of the memory, composing with an existing HybridMemory. It returns an error at construction time (rather than silently discarding it) if a custom non-hybrid memory was configured via WithMemory.
func WithLLM ¶ added in v0.7.0
func WithLLM(gen core.TextGenerator) ClientOption
WithLLM configures the AI backend for the client.
func WithLogger ¶
func WithLogger(l core.Logger) ClientOption
WithLogger sets a custom logger for the client.
func WithMemory ¶
func WithMemory(mem core.AgentMemory) ClientOption
WithMemory replaces the whole memory implementation (history + RAG).
func WithPolicyPath ¶
func WithPolicyPath(path string) ClientOption
WithPolicyPath specifies the file path of the Datalog policy to load at client construction. This is the canonical option name; it matches config `policy.path` and the CLI `--policy` flag.
func WithProviderConfig ¶ added in v0.7.0
func WithProviderConfig(name string, cfg config.ActionConfig) ClientOption
WithProviderConfig wires a provider-backed action from config.
func WithStateProvider ¶ added in v0.7.0
func WithStateProvider(provider core.StateProvider) ClientOption
WithStateProvider configures durable session persistence.
func WithStdoutTracer ¶ added in v0.7.0
func WithStdoutTracer() ClientOption
WithStdoutTracer enables a console tracer for debugging.
func WithSteeringEnabled ¶ added in v0.7.0
func WithSteeringEnabled() ClientOption
WithSteeringEnabled enables policy-driven routing (route/retry).
func WithTracerProvider ¶ added in v0.7.0
func WithTracerProvider(tp trace.TracerProvider) ClientOption
WithTracerProvider configures the OpenTelemetry tracer provider.
type ExecuteOption ¶
type ExecuteOption = sdk.ExecuteOption
func WithMetadata ¶
func WithMetadata(key, value string) ExecuteOption
WithMetadata injects custom key-value pairs into the execution envelope's metadata.
func WithSessionID ¶
func WithSessionID(id string) ExecuteOption
WithSessionID activates persistent stateful mode for the execution.
func WithTransientMemory ¶
func WithTransientMemory() ExecuteOption
WithTransientMemory activates in-memory stateful mode.
Directories
¶
| Path | Synopsis |
|---|---|
|
adapters
|
|
|
storage/meb
Package meb provides a MEB (Mangle Extension for Badger) storage adapter that implements the KnowledgeStore interface for the OODA loop.
|
Package meb provides a MEB (Mangle Extension for Badger) storage adapter that implements the KnowledgeStore interface for the OODA loop. |
|
storage/session
Package session provides a transient, in-memory store for coordination facts during OODA loop execution.
|
Package session provides a transient, in-memory store for coordination facts during OODA loop execution. |
|
Package agents provides the Architect Agent implementation using the OODA Chassis SDK with Dual Memory architecture.
|
Package agents provides the Architect Agent implementation using the OODA Chassis SDK with Dual Memory architecture. |
|
tools
Package tools provides the tool implementations for the Architect Agent
|
Package tools provides the tool implementations for the Architect Agent |
|
cmd
|
|
|
mkit
command
|
|
|
mkit/commands/check
Package check implements the `mkit check` subcommand: load and lint a policy without running a query.
|
Package check implements the `mkit check` subcommand: load and lint a policy without running a query. |
|
mkit/commands/exitcode
Package exitcode defines the mkit CLI exit-code contract and maps errors to exit codes.
|
Package exitcode defines the mkit CLI exit-code contract and maps errors to exit codes. |
|
mkit/commands/version
Package version implements the `mkit version` subcommand.
|
Package version implements the `mkit version` subcommand. |
|
internal
|
|
|
providers
|
|
|
predicates
Package predicates provides reference external predicates for use in Datalog policies.
|
Package predicates provides reference external predicates for use in Datalog policies. |
|
Package scenario provides a tiny, dependency-free test harness for running behavior-driven policy scenarios against a Manglekit client.
|
Package scenario provides a tiny, dependency-free test harness for running behavior-driven policy scenarios against a Manglekit client. |
|
Package sdk provides the Manglekit SDK.
|
Package sdk provides the Manglekit SDK. |
|
Package testutil provides deterministic, dependency-free test doubles for building examples and tests against manglekit without external services or API keys:
|
Package testutil provides deterministic, dependency-free test doubles for building examples and tests against manglekit without external services or API keys: |
|
x
|
|
|
east
Package east implements EAST (Entropy-Activity-Steering-Throttling), the OODA v4 generative/research path.
|
Package east implements EAST (Entropy-Activity-Steering-Throttling), the OODA v4 generative/research path. |