sdk

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

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

View Source
const (
	ToolName        = "run_bitwave_cli"
	ToolProvider    = "bitwave-cli"
	ToolDescription = "" /* 504-byte string literal not displayed */

)

Variables

View Source
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 NormalizeArgs(args []string) []string

func ValidateArgs

func ValidateArgs(args []string) error

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.

Jump to

Keyboard shortcuts

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