Documentation
¶
Index ¶
- Variables
- func Breadcrumb(action, command, description string) baseoutput.Breadcrumb
- func NormalizeInputNumbers(object map[string]any) error
- type App
- func (a *App) AuthService(allowFileCredentials bool) (*auth.Service, error)
- func (a *App) ExecuteTool(ctx context.Context, name string, arguments map[string]any) (*ToolExecution, error)
- func (a *App) Interactive() bool
- func (a *App) MCP(ctx context.Context) (*mcpclient.Client, string, error)
- func (a *App) OpenSession(ctx context.Context, profile string, allowFileCredentials bool) (Session, error)
- func (a *App) Output() *clioutput.Writer
- func (a *App) ResolveProfile(required bool) (string, error)
- type Catalogue
- type GlobalOptions
- type Invocation
- type OutcomeUnknownError
- type PreviewHandle
- type ProjectTrustDecision
- type SchemaChangedError
- type Session
- type SessionTool
- type ToolExecution
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Breadcrumb ¶
func Breadcrumb(action, command, description string) baseoutput.Breadcrumb
func NormalizeInputNumbers ¶
NormalizeInputNumbers prepares a decoded JSON object for schema validation. The validator recognizes int/uint/float JSON numbers, but currently treats a json.Number as a string during its type check. Preserve large integer inputs rather than converting every number through float64 during the defensive copy.
Types ¶
type App ¶
type App struct {
Paths config.Paths
Config *config.Store
Snapshot schema.Snapshot
Manifest schema.Manifest
SnapshotData []byte
Global *GlobalOptions
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
// InteractiveCheck is a test seam for terminal-only command flows. Output
// modes and explicit non-interactive controls are always enforced before it.
InteractiveCheck func() bool
WorkingDirectory func() (string, error)
ProjectTrustPrompt func(config.ProjectProfile, config.ProjectTrustState) (ProjectTrustDecision, error)
// contains filtered or unexported fields
}
func (*App) AuthService ¶
func (*App) ExecuteTool ¶
func (*App) Interactive ¶
type Catalogue ¶
type Catalogue struct {
Tools []SessionTool
Resources []*mcp.Resource
ResourceTemplates []*mcp.ResourceTemplate
Warnings []string
}
type GlobalOptions ¶
type Invocation ¶
type OutcomeUnknownError ¶
OutcomeUnknownError never means that a write failed or was cancelled. The gateway may have executed it before the connection was lost. Do not replay.
func (*OutcomeUnknownError) Error ¶
func (e *OutcomeUnknownError) Error() string
func (*OutcomeUnknownError) Unwrap ¶
func (e *OutcomeUnknownError) Unwrap() error
type PreviewHandle ¶
type PreviewHandle struct {
// contains filtered or unexported fields
}
PreviewHandle carries no user-editable preview ID. Valid reports whether a handle was issued; Confirm also checks whether it remains valid and unused.
func (PreviewHandle) Valid ¶
func (h PreviewHandle) Valid() bool
type ProjectTrustDecision ¶
type ProjectTrustDecision string
const ( ProjectUseOnce ProjectTrustDecision = "once" ProjectTrustAlways ProjectTrustDecision = "always" ProjectTrustCancel ProjectTrustDecision = "cancel" )
type SchemaChangedError ¶
type SchemaChangedError struct{ Tool SessionTool }
func (*SchemaChangedError) Error ¶
func (e *SchemaChangedError) Error() string
type Session ¶
type Session interface {
Profile() string
Catalogue(context.Context) (*Catalogue, error)
Invoke(context.Context, Invocation) (*ToolExecution, error)
Confirm(context.Context, PreviewHandle) (*ToolExecution, error)
ReadResource(context.Context, string) (*mcpclient.ResourceOutcome, error)
InvalidatePreviews()
Close() error
}
Session is a long-lived, explicit-profile connection. It never prompts, auto-confirms, or retries an invocation. The caller owns presentation and deliberate review; the gateway remains the authorization authority.
type SessionTool ¶
type SessionTool struct {
Name, Title, Description, Domain, Command, SchemaRevision string
InputSchema schema.JSONSchema
RawSchema json.RawMessage
Reviewed, ReadOnly, Destructive bool
SchemaError string
}
SessionTool combines live availability with reviewed local metadata. An unreviewed or uncompileable schema is retained for inspection, never silently replaced with the embedded schema. ReadOnly is deliberately conservative.
type ToolExecution ¶
type ToolExecution struct {
Profile string `json:"profile"`
Preview *mcpclient.ToolOutcome `json:"preview,omitempty"`
Confirmation *mcpclient.ToolOutcome `json:"confirmation,omitempty"`
Result *mcpclient.ToolOutcome `json:"result"`
PreviewHandle PreviewHandle `json:"-"`
}
func (*ToolExecution) HumanText ¶
func (e *ToolExecution) HumanText() string