sdk
Generated from the public Go package via gomarkdoc.
Import path: github.com/777genius/plugin-kit-ai/sdk
import "github.com/777genius/plugin-kit-ai/sdk"Package pluginkitai exposes the public root SDK for building plugin-kit-ai runtime binaries with typed Claude, Codex, and Gemini registrars.
Index
- Constants
- type App
- func New(cfg Config) *App
- func (a *App) Claude() *claude.Registrar
- func (a *App) Codex() *codex.Registrar
- func (a *App) Gemini() *gemini.Registrar
- func (a *App) Run() int
- func (a *App) RunContext(ctx context.Context) int
- func (a *App) Use(mw Middleware)
- type CapabilityID
- type Config
- type Env
- type Handled
- type IO
- type InvocationContext
- type Logger
- type MaturityLevel
- type Middleware
- type Next
- type NopLogger
- type Result
- type SupportEntry
- func Supported() []SupportEntry
- type SupportStatus
- type TransportMode
Constants
MaxPayloadBytes is the single wire limit for stdin and argv JSON payloads accepted by runtime decoders. Consumers should reference this constant instead of duplicating the number.
const MaxPayloadBytes = runtime.MaxPayloadBytestype App
App owns middleware, handler registration, and invocation dispatch.
type App struct {
// contains filtered or unexported fields
}func New
func New(cfg Config) *AppNew builds an App with sane defaults for argv, process I/O, env, and logging.
func (*App) Claude
func (a *App) Claude() *claude.RegistrarClaude returns a registrar for Claude-specific hook handlers.
Example
package main
import (
pluginkitai "github.com/777genius/plugin-kit-ai/sdk"
"github.com/777genius/plugin-kit-ai/sdk/claude"
)
func main() {
app := pluginkitai.New(pluginkitai.Config{Name: "demo"})
app.Claude().OnStop(func(*claude.StopEvent) *claude.Response {
return claude.Allow()
})
_ = app
}func (*App) Codex
func (a *App) Codex() *codex.RegistrarCodex returns a registrar for Codex-specific event handlers.
Example
package main
import (
pluginkitai "github.com/777genius/plugin-kit-ai/sdk"
"github.com/777genius/plugin-kit-ai/sdk/codex"
)
func main() {
app := pluginkitai.New(pluginkitai.Config{Name: "demo"})
app.Codex().OnNotify(func(*codex.NotifyEvent) *codex.Response {
return codex.Continue()
})
_ = app
}func (*App) Gemini
func (a *App) Gemini() *gemini.RegistrarGemini returns a registrar for Gemini-specific hook handlers.
Example
package main
import (
pluginkitai "github.com/777genius/plugin-kit-ai/sdk"
"github.com/777genius/plugin-kit-ai/sdk/gemini"
)
func main() {
app := pluginkitai.New(pluginkitai.Config{Name: "demo"})
app.Gemini().OnBeforeTool(func(*gemini.BeforeToolEvent) *gemini.BeforeToolResponse {
return gemini.BeforeToolContinue()
})
_ = app
}func (*App) Run
func (a *App) Run() intRun dispatches the current process invocation with context.Background().
func (*App) RunContext
func (a *App) RunContext(ctx context.Context) intRunContext dispatches the current process invocation using the supplied context.
func (*App) Use
func (a *App) Use(mw Middleware)Use appends middleware that wraps all subsequent handler dispatch.
type CapabilityID
CapabilityID aliases the normalized cross-platform capability identifier.
type CapabilityID = runtime.CapabilityIDtype Config
Config configures a root SDK app instance before handlers are registered.
type Config struct {
// Name is the human-readable app label used in diagnostics and examples.
Name string
// Args overrides the process argv used to resolve the current invocation.
Args []string
// IO overrides the stdin/stdout/stderr implementation used by Run.
IO IO
// Env overrides environment lookups used during invocation resolution.
Env Env
// Logger overrides structured logging emitted by the runtime engine.
Logger Logger
}type Env
Env aliases the runtime environment reader used by invocation resolution.
type Env = runtime.Envtype Handled
Handled aliases the typed handler result container.
type Handled = runtime.Handledtype IO
IO aliases the runtime I/O contract used by the SDK app host.
type IO = runtime.IOtype InvocationContext
InvocationContext aliases the metadata that accompanies a decoded invocation.
type InvocationContext = runtime.InvocationContexttype Logger
Logger aliases the structured logger interface accepted by the SDK app host.
type Logger = runtime.Loggertype MaturityLevel
MaturityLevel aliases the API maturity enum exposed by support metadata.
type MaturityLevel = runtime.MaturityLeveltype Middleware
Middleware aliases the SDK middleware function signature.
type Middleware = runtime.Middlewaretype Next
Next aliases the middleware continuation function.
type Next = runtime.Nexttype NopLogger
NopLogger aliases the logger implementation that drops all log records.
type NopLogger = runtime.NopLoggertype Result
Result aliases the low-level runtime result written back to the host process.
type Result = runtime.Resulttype SupportEntry
SupportEntry aliases a generated public support-matrix row.
type SupportEntry = runtime.SupportEntryfunc Supported
func Supported() []SupportEntrySupported returns a copy of the generated public support matrix entries.
type SupportStatus
SupportStatus aliases the support-level enum used by generated support entries.
type SupportStatus = runtime.SupportStatustype TransportMode
TransportMode aliases the runtime transport mode enum for supported hooks.
type TransportMode = runtime.TransportMode