{"modulePath":"github.com/GoCodeAlone/workflow-plugin-agent","version":"v0.12.11","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package genkit\n\nPackage genkit provides Genkit-backed implementations of provider.Provider.\n\n## Functions\n\n```go\nfunc Instance(ctx context.Context) *gk.Genkit\n```\nInstance returns the shared Genkit instance, initializing it lazily on first call. This instance has no plugins and is used for mock/test model definitions. Production providers use per-factory Genkit instances initialized with their specific plugin.\n\n```go\nfunc NewACPProvider(name, binPath string, args []string, workDir string) (provider.Provider, error)\n```\nNewACPProvider creates a provider that drives an ACP-compliant agent binary.\n\n```go\nfunc NewAnthropicCompatibleProvider(ctx context.Context, providerName, apiKey, model, baseURL string, maxTokens int) (provider.Provider, error)\n```\nNewAnthropicCompatibleProvider creates a provider for Anthropic-compatible endpoints.\n\n```go\nfunc NewAnthropicFoundryProvider(ctx context.Context, resource, model, apiKey, entraToken string, maxTokens int) (provider.Provider, error)\n```\nNewAnthropicFoundryProvider creates a provider for Anthropic on Azure AI Foundry.\n\n```go\nfunc NewAnthropicProvider(ctx context.Context, apiKey, model, baseURL string, maxTokens int) (provider.Provider, error)\n```\nNewAnthropicProvider creates a provider backed by Genkit's Anthropic plugin.\n\n```go\nfunc NewAzureOpenAIProvider(ctx context.Context, resource, deploymentName, apiVersion, apiKey, entraToken string, maxTokens int) (provider.Provider, error)\n```\nNewAzureOpenAIProvider creates a provider for Azure OpenAI Service.\n\n```go\nfunc NewBedrockProvider(ctx context.Context, providerName, region, model, accessKeyID, secretAccessKey, sessionToken, baseURL string, maxTokens int) (provider.Provider, error)\n```\nNewBedrockProvider creates a provider for AWS Bedrock using the provider-neutral Converse API.\n\n```go\nfunc NewClaudeCodeProvider(workDir string) (provider.Provider, error)\n```\nNewClaudeCodeProvider creates a provider backed by the \\`claude\\` CLI.\n\n```go\nfunc NewCodexCLIProvider(workDir string) (provider.Provider, error)\n```\nNewCodexCLIProvider creates a provider backed by the \\`codex\\` CLI.\n\n```go\nfunc NewCopilotCLIProvider(workDir string) (provider.Provider, error)\n```\nNewCopilotCLIProvider creates a provider backed by the \\`copilot\\` CLI.\n\n```go\nfunc NewCursorCLIProvider(workDir string) (provider.Provider, error)\n```\nNewCursorCLIProvider creates a provider backed by the \\`agent\\` CLI (Cursor).\n\n```go\nfunc NewGeminiCLIProvider(workDir string) (provider.Provider, error)\n```\nNewGeminiCLIProvider creates a provider backed by the \\`gemini\\` CLI.\n\n```go\nfunc NewGoogleAIProvider(ctx context.Context, apiKey, model string, maxTokens int) (provider.Provider, error)\n```\nNewGoogleAIProvider creates a provider backed by Genkit's Google AI plugin (Gemini API).\n\n```go\nfunc NewOllamaProvider(ctx context.Context, model, serverAddress string, maxTokens, contextWindow int) (provider.Provider, error)\n```\nNewOllamaProvider creates a provider backed by Genkit's Ollama plugin. contextWindow, when \u003e 0, sets the Ollama num\\_ctx (KV cache size) and is also reported via ContextWindow() so the executor can tune compaction.\n\n```go\nfunc NewOpenAIChatGPTProvider(ctx context.Context, tokenJSON, model, baseURL string, maxTokens int) (provider.Provider, error)\n```\nNewOpenAIChatGPTProvider creates a provider that uses a ChatGPT subscription token bundle against OpenAI's Codex Responses endpoint.\n\n```go\nfunc NewOpenAICompatibleProvider(ctx context.Context, providerName, apiKey, model, baseURL string, maxTokens int) (provider.Provider, error)\n```\nNewOpenAICompatibleProvider creates a provider for OpenAI-compatible endpoints. Used for OpenRouter, Copilot, Cohere, HuggingFace, llama.cpp, etc.\n\n```go\nfunc NewOpenAIProvider(ctx context.Context, apiKey, model, baseURL string, maxTokens int) (provider.Provider, error)\n```\nNewOpenAIProvider creates a provider backed by Genkit's OpenAI plugin.\n\n```go\nfunc NewVertexAIProvider(ctx context.Context, projectID, region, model, credentialsJSON string, maxTokens int) (provider.Provider, error)\n```\nNewVertexAIProvider creates a provider backed by Genkit's Vertex AI plugin.\n\n## Types\n\n```go\ntype CLIAdapter interface {\n\t// Name returns the provider type name (e.g. \"claude_code\").\n\tName() string\n\t// Binary returns the binary name to execute (e.g. \"claude\").\n\tBinary() string\n\t// NonInteractiveArgs returns CLI args for single-shot (non-interactive) mode.\n\tNonInteractiveArgs(msg string) []string\n\t// StreamingArgs returns CLI args for streaming JSON output mode.\n\t// Returns nil if the tool doesn't support structured streaming — falls back\n\t// to NonInteractiveArgs with line-by-line stdout reading.\n\tStreamingArgs(msg string) []string\n\t// HealthCheckArgs returns args for a quick health check invocation.\n\tHealthCheckArgs() []string\n\t// DetectPrompt returns true when the CLI output indicates it is ready for input.\n\tDetectPrompt(output string) bool\n\t// DetectResponseEnd returns true when the CLI output indicates the response is complete.\n\tDetectResponseEnd(output string) bool\n\t// ParseResponse cleans raw PTY output into plain response text.\n\tParseResponse(raw string) string\n\t// ParseStreamEvent parses a line of streaming JSON output into text content.\n\t// Returns the text content and true if the line contained assistant text,\n\t// or empty string and false if the line should be skipped.\n\tParseStreamEvent(line string) (string, bool)\n\t// SupportsInteractivePTY returns true if the tool's interactive TUI is\n\t// compatible with vt10x screen reading. Tools that return false skip the\n\t// interactive path and go straight to JSON streaming or non-interactive exec.\n\tSupportsInteractivePTY() bool\n\t// InteractiveArgs returns CLI args used when launching the interactive PTY session.\n\t// For example, Claude Code returns [\"--permission-mode\", \"acceptEdits\"] to\n\t// auto-approve file edits. Returns nil for no extra args.\n\tInteractiveArgs() []string\n}\n```\nCLIAdapter defines per-tool behavior for driving a CLI via PTY.\n\n```go\ntype ClaudeCodeAdapter struct {\n\tExtraArgs []string // configurable interactive args; overrides default when non-empty\n}\n```\nClaudeCodeAdapter drives the \\`claude\\` CLI.\n\n```go\nfunc (ClaudeCodeAdapter) Binary() string\n```\n\n```go\nfunc (ClaudeCodeAdapter) DetectPrompt(output string) bool\n```\n\n```go\nfunc (ClaudeCodeAdapter) DetectResponseEnd(output string) bool\n```\n\n```go\nfunc (ClaudeCodeAdapter) HealthCheckArgs() []string\n```\n\n```go\nfunc (a ClaudeCodeAdapter) InteractiveArgs() []string\n```\n\n```go\nfunc (ClaudeCodeAdapter) Name() string\n```\n\n```go\nfunc (ClaudeCodeAdapter) NonInteractiveArgs(msg string) []string\n```\n\n```go\nfunc (ClaudeCodeAdapter) ParseResponse(raw string) string\n```\n\n```go\nfunc (ClaudeCodeAdapter) ParseStreamEvent(line string) (string, bool)\n```\n\n```go\nfunc (ClaudeCodeAdapter) StreamingArgs(msg string) []string\n```\n\n```go\nfunc (ClaudeCodeAdapter) SupportsInteractivePTY() bool\n```\n\n```go\ntype CodexCLIAdapter struct{}\n```\nCodexCLIAdapter drives the \\`codex\\` CLI.\n\n```go\nfunc (CodexCLIAdapter) Binary() string\n```\n\n```go\nfunc (CodexCLIAdapter) DetectPrompt(output string) bool\n```\n\n```go\nfunc (CodexCLIAdapter) DetectResponseEnd(output string) bool\n```\n\n```go\nfunc (CodexCLIAdapter) HealthCheckArgs() []string\n```\n\n```go\nfunc (CodexCLIAdapter) InteractiveArgs() []string\n```\n\n```go\nfunc (CodexCLIAdapter) Name() string\n```\n\n```go\nfunc (CodexCLIAdapter) NonInteractiveArgs(msg string) []string\n```\n\n```go\nfunc (CodexCLIAdapter) ParseResponse(raw string) string\n```\n\n```go\nfunc (CodexCLIAdapter) ParseStreamEvent(_ string) (string, bool)\n```\n\n```go\nfunc (CodexCLIAdapter) StreamingArgs(_ string) []string\n```\n\n```go\nfunc (CodexCLIAdapter) SupportsInteractivePTY() bool\n```\n\n```go\ntype CopilotCLIAdapter struct {\n\tExtraArgs []string // configurable interactive args; overrides default when non-empty\n}\n```\nCopilotCLIAdapter drives the \\`copilot\\` CLI.\n\n```go\nfunc (CopilotCLIAdapter) Binary() string\n```\n\n```go\nfunc (CopilotCLIAdapter) DetectPrompt(output string) bool\n```\n\n```go\nfunc (CopilotCLIAdapter) DetectResponseEnd(output string) bool\n```\n\n```go\nfunc (CopilotCLIAdapter) HealthCheckArgs() []string\n```\n\n```go\nfunc (a CopilotCLIAdapter) InteractiveArgs() []string\n```\n\n```go\nfunc (CopilotCLIAdapter) Name() string\n```\n\n```go\nfunc (CopilotCLIAdapter) NonInteractiveArgs(msg string) []string\n```\n\n```go\nfunc (CopilotCLIAdapter) ParseResponse(raw string) string\n```\n\n```go\nfunc (CopilotCLIAdapter) ParseStreamEvent(_ string) (string, bool)\n```\n\n```go\nfunc (CopilotCLIAdapter) StreamingArgs(_ string) []string\n```\nCopilot uses non-interactive fallback for now — interactive PTY response extraction needs refinement for Copilot's specific screen layout.\n\n```go\nfunc (CopilotCLIAdapter) SupportsInteractivePTY() bool\n```\nSupportsInteractivePTY returns true — Copilot uses vt10x with screen-diff extraction.\n\n```go\ntype CursorCLIAdapter struct{}\n```\nCursorCLIAdapter drives the \\`agent\\` binary (Cursor's agent CLI).\n\n```go\nfunc (CursorCLIAdapter) Binary() string\n```\n\n```go\nfunc (CursorCLIAdapter) DetectPrompt(output string) bool\n```\n\n```go\nfunc (CursorCLIAdapter) DetectResponseEnd(output string) bool\n```\n\n```go\nfunc (CursorCLIAdapter) HealthCheckArgs() []string\n```\n\n```go\nfunc (CursorCLIAdapter) InteractiveArgs() []string\n```\n\n```go\nfunc (CursorCLIAdapter) Name() string\n```\n\n```go\nfunc (CursorCLIAdapter) NonInteractiveArgs(msg string) []string\n```\n\n```go\nfunc (CursorCLIAdapter) ParseResponse(raw string) string\n```\n\n```go\nfunc (CursorCLIAdapter) ParseStreamEvent(_ string) (string, bool)\n```\n\n```go\nfunc (CursorCLIAdapter) StreamingArgs(_ string) []string\n```\n\n```go\nfunc (CursorCLIAdapter) SupportsInteractivePTY() bool\n```\n\n```go\ntype GeminiCLIAdapter struct{}\n```\nGeminiCLIAdapter drives the \\`gemini\\` CLI.\n\n```go\nfunc (GeminiCLIAdapter) Binary() string\n```\n\n```go\nfunc (GeminiCLIAdapter) DetectPrompt(output string) bool\n```\n\n```go\nfunc (GeminiCLIAdapter) DetectResponseEnd(output string) bool\n```\n\n```go\nfunc (GeminiCLIAdapter) HealthCheckArgs() []string\n```\n\n```go\nfunc (GeminiCLIAdapter) InteractiveArgs() []string\n```\n\n```go\nfunc (GeminiCLIAdapter) Name() string\n```\n\n```go\nfunc (GeminiCLIAdapter) NonInteractiveArgs(msg string) []string\n```\n\n```go\nfunc (GeminiCLIAdapter) ParseResponse(raw string) string\n```\n\n```go\nfunc (GeminiCLIAdapter) ParseStreamEvent(line string) (string, bool)\n```\n\n```go\nfunc (GeminiCLIAdapter) StreamingArgs(msg string) []string\n```\n\n```go\nfunc (GeminiCLIAdapter) SupportsInteractivePTY() bool\n```\n\n```go\ntype OpenAIChatGPTTokenBundle struct {\n\tAccessToken             string `json:\"access_token\"`\n\tRefreshToken            string `json:\"refresh_token\"`\n\tIDToken                 string `json:\"id_token,omitempty\"`\n\tAccountID               string `json:\"account_id,omitempty\"`\n\tChatGPTAccountID        string `json:\"chatgpt_account_id,omitempty\"`\n\tChatGPTAccountIsFedRAMP bool   `json:\"chatgpt_account_is_fedramp,omitempty\"`\n\tChatGPTUserID           string `json:\"chatgpt_user_id,omitempty\"`\n\tPlanType                string `json:\"chatgpt_plan_type,omitempty\"`\n\tExpiresAt               int64  `json:\"expires_at,omitempty\"`\n}\n```\nOpenAIChatGPTTokenBundle contains ChatGPT subscription credentials compatible with the Codex CLI auth.json token shape.\n\n```go\nfunc ParseOpenAIChatGPTTokenBundle(raw string) (*OpenAIChatGPTTokenBundle, error)\n```\nParseOpenAIChatGPTTokenBundle parses either a direct token bundle or Codex CLI auth.json, whose token fields are nested under \"tokens\".\n\n```go\ntype PromptAction int\n```\nPromptAction is what the handler decides to do with a detected screen prompt.\n\n```go\nconst (\n\tPromptActionNone    PromptAction = iota // no prompt detected\n\tPromptActionRespond                     // auto-respond with a keystroke\n\tPromptActionQueue                       // queue for human approval\n)\n```\n\n```go\ntype PromptHandler struct {\n\t// contains filtered or unexported fields\n}\n```\nPromptHandler auto-responds to known screen prompts from CLI tools.\n\n```go\nfunc NewPromptHandler(trust *policy.TrustEngine, customPatterns []PromptPattern, onQueue func(agentName, promptText string)) *PromptHandler\n```\nNewPromptHandler creates a PromptHandler with the given trust engine. customPatterns are checked before built-in patterns. onQueue is called when a prompt requires human approval.\n\n```go\nfunc (ph *PromptHandler) Evaluate(screen string) (PromptAction, string)\n```\nEvaluate checks the screen content against known patterns. Returns the action to take and the response string to send (if PromptActionRespond).\n\n```go\ntype PromptPattern struct {\n\tName    string\n\tMatchRe string              // regex string to match against screen content\n\tExtract func(string) string // optional: extract the action/path from screen\n\tDefault policy.Action       // what to do if no trust rule matches\n\t// contains filtered or unexported fields\n}\n```\nPromptPattern is a screen content pattern with a default action.\n\n","path":"github.com/GoCodeAlone/workflow-plugin-agent/genkit","name":"genkit","synopsis":"Package genkit provides Genkit-backed implementations of provider.Provider.","isRedistributable":true}
