Documentation
¶
Overview ¶
Package sdk exposes the Bitwave CLI as a single structured tool for agent harnesses. Consumers import this package and invoke the CLI with argv; no HTTP bridge or callback service is involved.
Index ¶
Constants ¶
const ( ToolName = "run_bitwave_cli" ToolProvider = "bitwave-cli" ToolDescription = "" /* 504-byte string literal not displayed */ )
Variables ¶
var ToolInputSchema = json.RawMessage(`{
"type": "object",
"properties": {
"args": {
"type": "array",
"items": {"type": "string"},
"description": "Arguments passed to bitwave, excluding the executable name. Omit or pass an empty array to return bitwave --help. Use separate array elements; shell syntax is not supported.",
"default": []
}
},
"additionalProperties": false
}`)
Functions ¶
func NormalizeArgs ¶
func ValidateArgs ¶
Types ¶
type CommandResult ¶
type CommandResult struct {
Command []string `json:"command"`
Directory string `json:"directory"`
ExitCode int `json:"exitCode"`
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
Truncated bool `json:"truncated,omitempty"`
}
func Execute ¶
func Execute(ctx context.Context, args []string, organizationID string) CommandResult
Execute is the compact API for callers that only need org scope.
func ExecuteWithOptions ¶
func ExecuteWithOptions(ctx context.Context, options ExecuteOptions) CommandResult
ExecuteWithOptions runs one Bitwave command in process. The mutex is intentional: Cobra's command package retains a small amount of flag state, and invocation-scoped environment/cwd values must not bleed across agents.
type ExecuteOptions ¶
type ExecuteOptions struct {
Args []string
WorkingDirectory string
OrganizationID string
Token string
AgentToken string
}
ExecuteOptions supplies invocation-scoped context without relying on a user's persisted CLI configuration. Environment changes and working-directory changes are serialized and restored before ExecuteWithOptions returns.