openapi

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CredentialScope added in v0.3.11

func CredentialScope(apiName string) string

CredentialScope returns the scopedStore scope for an api.json apis entry name.

func NewOpenAPI

func NewOpenAPI(cfg OpenAPIConfig, deps OpenAPIDeps) (agentkit.ToolProvider, error)

NewOpenAPI registers tool/openapi: Load api.json (an index of REST APIs described OpenAPI-compatibly) and expose each operation as a dynamic model-visible tool.

Best practices:

  • Mount via tools/runtime deps.dynamicTools, not deps.tools, because definitions are discovered at runtime.
  • api.json is an index: each entry under "apis" points at an OpenAPI document via path (specFile is a legacy alias).
  • Definitions are loaded once and cached; run the "openapi" command to reload api.json (and any specFile) from disk after editing it.
  • Secrets in auth (token/value/password) accept "env:NAME" and resolve through credentials, same as tool/mcp.

Types

type OpenAPIConfig

type OpenAPIConfig struct {
	// Files are api.json paths in precedence order; first file wins for duplicate API names.
	// When omitted, defaults to global:api.json only; set EnableLocal to also load local:api.json.
	Files []string `json:"files,omitempty"`
	// EnableLocal allows per-tenant/project local:api.json and /openapi add writes. Off by default.
	EnableLocal bool `json:"enableLocal,omitempty"`
}

type OpenAPIDeps

type OpenAPIDeps struct {
	Workspace   workspace.Service `json:"workspace"`
	Credentials credentials.Store `json:"credentials,omitempty"`
}

Jump to

Keyboard shortcuts

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