Documentation
¶
Index ¶
- Constants
- Variables
- func ChatToolErrorResult(errType, message, suggestion string) (string, error)
- func ChatToolNames() []string
- func ChatToolSuccess(data any) (string, error)
- func CoordinationToolNames() []string
- func EnsureRepositoryValidationReviewBinding(ctx context.Context, bindingStore RepositoryValidationBindingStore, ...) error
- func FailedToolResultForTelemetry(result string) (bool, string, string)
- func IsRepositoryValidationCommandBindingInvalid(err error) bool
- func KnownBuiltInToolNames() []string
- func RecordRejectedToolCall(ctx context.Context, name, toolCallID, errType, message string)
- func RegisterBrokeredCoordinationTools(r *Registry, k8sClient client.Client) error
- func RegisterBrokeredDelegateTaskTool(registry *Registry, k8sClient client.Client, ...) error
- func RegisterBrokeredWebTools(r *Registry) error
- func RegisterBuiltinTools()
- func RegisterChatTools(r *Registry)
- func RegisterChatToolsDefault()
- func RegisterCoordinationTools(k8sClient client.Client, mode executionmode.Mode)
- func RegisterProxyPRTools(k8sClient client.Client)
- func RepositoryValidationCommandBindingEvent(parent *corev1alpha1.Task, monitor *corev1alpha1.RepositoryMonitor, ...) (*store.MonitorEvent, error)
- func RepositoryValidationCommandBindingFilter(event *store.MonitorEvent) store.MonitorEventFilter
- func RepositoryValidationCommandBindingMatches(existing, expected *store.MonitorEvent) bool
- func RepositoryValidationCommandDigest(command string) string
- func RepositoryValidationCommandSecretName(validationTaskName string) string
- func RepositoryValidationReviewBindingEvent(reviewTask *corev1alpha1.Task, monitor *corev1alpha1.RepositoryMonitor) (*store.MonitorEvent, error)
- func RepositoryValidationTaskName(parent *corev1alpha1.Task) string
- func RepositoryValidationTaskSpecMatches(parent *corev1alpha1.Task, monitor *corev1alpha1.RepositoryMonitor, ...) bool
- func TransactionHasScope(tx *corev1alpha1.TaskTransaction, want string) bool
- func ValidRepositoryValidationImage(image string) bool
- func ValidateRepositoryValidationCommandBinding(ctx context.Context, bindingStore RepositoryValidationBindingStore, ...) error
- func ValidateRepositoryValidationCommandSecret(parent, validationTask *corev1alpha1.Task, secret *corev1.Secret, ...) error
- func ValidateRepositoryValidationOrphanCommandSecret(parent *corev1alpha1.Task, secret *corev1.Secret, ...) error
- func ValidateRepositoryValidationReviewBinding(ctx context.Context, bindingStore RepositoryValidationBindingStore, ...) error
- func WithToolContext(ctx context.Context, tc *ToolContext) context.Context
- type AllowedAgentArg
- type AutoMergePullRequestArgs
- type AutoMergePullRequestResult
- type AutoMergePullRequestTool
- type BrokeredDelegateTaskTransactionExchangeConfig
- type CICheckResult
- type CancelTaskArgs
- type CancelTaskResult
- type CancelTaskTool
- type ChatCancelTaskTool
- type ChatCreateAgentTool
- type ChatDeleteAgentTool
- type ChatToolError
- type ChatToolResult
- type CheckMessagesArgs
- type CheckMessagesTool
- type CheckPRReviewMarkerArgs
- type CheckPRReviewMarkerResult
- type CheckPRReviewMarkerTool
- type CheckPullRequestCIArgs
- type CheckPullRequestCIResult
- type CheckPullRequestCITool
- type CheckTaskProgressTool
- type CodeExecArgs
- type CodeExecResult
- type CodeExecTool
- type CodeExecutionRequest
- type CodeExecutor
- type CommentOnIssueArgs
- type CommentOnIssueResult
- type CommentOnIssueTool
- type CoordinationArgs
- type CreateAITaskTool
- type CreateAgentArgs
- type CreateAgentResult
- type CreateAgentTaskTool
- type CreateAgentTool
- type CreateContainerTaskTool
- type CreatePRMonitorTool
- type CreatePullRequestArgs
- type CreatePullRequestResult
- type CreatePullRequestTool
- type CreateToolCRDTool
- type DelegateTaskArgs
- type DelegateTaskResult
- type DelegateTaskSubjectTokenResolver
- type DelegateTaskTool
- type DeleteAgentArgs
- type DeleteAgentResult
- type DeleteAgentTool
- type DeleteSessionTool
- type DeleteToolTool
- type FailureDetails
- type FetchTaskOutputTool
- type FileChange
- type FileReadArgs
- type FileReadResult
- type FileReadTool
- type FileWriteArgs
- type FileWriteResult
- type FileWriteTool
- type GetIssueArgs
- type GetIssueResult
- type GetIssueTool
- type GitHubPullRequest
- type InProcessCodeExecutor
- type IssueComment
- type IssueSummary
- type KubernetesJobCodeExecutor
- type ListAgentsTool
- type ListIssuesArgs
- type ListIssuesResult
- type ListIssuesTool
- type ListPullRequestsArgs
- type ListPullRequestsResult
- type ListPullRequestsTool
- type ListTasksTool
- type ListToolsTool
- type MemoryProposalWriter
- type MemoryReader
- type MergePullRequestArgs
- type MergePullRequestResult
- type MergePullRequestTool
- type ModelArgs
- type PRSummary
- type PostReviewCommentArgs
- type PostReviewCommentResult
- type PostReviewCommentTool
- type ProposeMemoryTool
- type RecallMemoryTool
- type Registry
- type RememberMemoryTool
- type RepositoryValidationBindingStore
- type RepositoryValidationCommandBinding
- type RequestApprovalTool
- type RequestApprovalValidationError
- type ReviewComment
- type ReviewPullRequestArgs
- type ReviewPullRequestResult
- type ReviewPullRequestTool
- type RunValidationTool
- type RuntimeArgs
- type SearchTranscriptTool
- type SendMessageArgs
- type SendMessageTool
- type TaskMessageStore
- type TaskResultInfo
- type Tool
- type ToolContext
- type TranscriptSearcher
- type UpdateAgentTool
- type UpdatePlanTool
- type WaitForTaskTool
- type WaitForTasksArgs
- type WaitForTasksResult
- type WaitForTasksTool
- type WebFetchArgs
- type WebFetchResult
- type WebFetchTool
- type WebSearchArgs
- type WebSearchResult
- type WebSearchTool
- type WorkspaceArgs
Constants ¶
const ( GitHubPullRequestStatusCreated = "created" GitHubPullRequestStatusExisting = "existing" )
const ( // RunValidationToolName is the brokered tool exposed only to controller-owned // repository monitor review Tasks with a configured validation image. RunValidationToolName = "run_validation" // RepositoryValidationTimeout is the fixed execution timeout for repository // validation Tasks. RepositoryValidationTimeout = 45 * time.Minute // RepositoryValidationWaitTimeout bounds each poll below runtime MCP request // deadlines. The reviewer repeats polls until the validation Task is terminal. RepositoryValidationWaitTimeout = 30 * time.Second )
const ( // RepositoryValidationCommandSecretKey is the only data key accepted in a // controller-owned repository validation command Secret. RepositoryValidationCommandSecretKey = "command" )
Variables ¶
var DefaultRegistry = NewRegistry()
DefaultRegistry is the default tool registry with built-in tools
Functions ¶
func ChatToolErrorResult ¶
ChatToolErrorResult returns a failed ChatToolResult JSON string.
func ChatToolNames ¶
func ChatToolNames() []string
ChatToolNames returns the names of all chat tools in registration order.
func ChatToolSuccess ¶
ChatToolSuccess returns a successful ChatToolResult JSON string.
func CoordinationToolNames ¶
func CoordinationToolNames() []string
CoordinationToolNames returns the names of all coordination tools registered by RegisterCoordinationTools in worker processes.
func EnsureRepositoryValidationReviewBinding ¶ added in v0.2.0
func EnsureRepositoryValidationReviewBinding(ctx context.Context, bindingStore RepositoryValidationBindingStore, expected *store.MonitorEvent) error
EnsureRepositoryValidationReviewBinding persists the immutable review workspace binding before the controller creates or adopts the review Task.
func FailedToolResultForTelemetry ¶
FailedToolResultForTelemetry detects structured tool failures for callers that reject tool calls before dispatch but still need telemetry.
func IsRepositoryValidationCommandBindingInvalid ¶ added in v0.2.0
IsRepositoryValidationCommandBindingInvalid reports whether validation failed because the durable binding is missing or conflicts with the Task. Other errors may be transient storage failures.
func KnownBuiltInToolNames ¶
func KnownBuiltInToolNames() []string
KnownBuiltInToolNames returns every built-in tool name known to Orka, including tools registered in the default proxy registry and coordination tools that are registered in worker processes. Controller-side validation uses this to reject approvalRequiredTools entries that would be handled as built-ins rather than Tool CRDs.
func RecordRejectedToolCall ¶
RecordRejectedToolCall records a failed tool invocation that is rejected before dispatch, for example by request-level allowlists or invalid arguments. It intentionally does not execute the tool.
func RegisterBrokeredCoordinationTools ¶ added in v0.2.0
RegisterBrokeredCoordinationTools registers only coordination tools whose implementations can execute safely inside the authenticated controller MCP broker. Registration is idempotent because Registry.Register replaces the implementation for a stable tool name.
Do not broaden this list with worker-local tools or tools that obtain forge, repository, or ServiceAccount credentials from process environment. Those implementations are not request-scoped in the controller process.
func RegisterBrokeredDelegateTaskTool ¶ added in v0.2.0
func RegisterBrokeredDelegateTaskTool( registry *Registry, k8sClient client.Client, config BrokeredDelegateTaskTransactionExchangeConfig, ) error
RegisterBrokeredDelegateTaskTool replaces the generic delegate_task registration with the controller-configured broker implementation.
func RegisterBrokeredWebTools ¶ added in v0.2.0
RegisterBrokeredWebTools registers public web reads whose implementations are safe to execute inside the controller MCP broker. Registration is idempotent because Registry.Register replaces the implementation for a stable tool name.
func RegisterBuiltinTools ¶
func RegisterBuiltinTools()
RegisterBuiltinTools registers all built-in tools
func RegisterChatTools ¶
func RegisterChatTools(r *Registry)
RegisterChatTools registers the chat/management tools into the given registry.
func RegisterChatToolsDefault ¶
func RegisterChatToolsDefault()
RegisterChatToolsDefault registers chat tools into DefaultRegistry for use by the proxy.
func RegisterCoordinationTools ¶
func RegisterCoordinationTools(k8sClient client.Client, mode executionmode.Mode)
RegisterCoordinationTools registers coordination tools that require a K8s client
func RegisterProxyPRTools ¶
RegisterProxyPRTools registers the GitHub PR coordination tools that the Anthropic and OpenAI proxies advertise in coordinatorProxyTools but that RegisterChatTools does not provide. Without this the proxy lists the tools for the model, ToLLMTools silently drops them (they are missing from the registry), and the model gets back "tool not available in this request" when it tries to open the PR after all the real work is done.
Callers must invoke this once after the controller manager's client is available. Tests that exercise injectOrkaTools should also call this so the advertised tool set matches the runtime registration set.
func RepositoryValidationCommandBindingEvent ¶ added in v0.2.0
func RepositoryValidationCommandBindingEvent(parent *corev1alpha1.Task, monitor *corev1alpha1.RepositoryMonitor, validationTask *corev1alpha1.Task, image, headSHA, command string) (*store.MonitorEvent, error)
RepositoryValidationCommandBindingEvent returns the append-only event that binds a review Task to the originally requested validation command.
func RepositoryValidationCommandBindingFilter ¶ added in v0.2.0
func RepositoryValidationCommandBindingFilter(event *store.MonitorEvent) store.MonitorEventFilter
RepositoryValidationCommandBindingFilter returns the narrow lookup used for one command-binding event.
func RepositoryValidationCommandBindingMatches ¶ added in v0.2.0
func RepositoryValidationCommandBindingMatches(existing, expected *store.MonitorEvent) bool
RepositoryValidationCommandBindingMatches reports whether a stored event contains the exact controller-generated binding.
func RepositoryValidationCommandDigest ¶ added in v0.2.0
RepositoryValidationCommandDigest returns the durable digest used to bind a reviewer-selected command to its validation Task.
func RepositoryValidationCommandSecretName ¶ added in v0.2.0
RepositoryValidationCommandSecretName returns the deterministic Secret name used for one repository validation Task. Secret and Task names may match because Kubernetes names are scoped by resource kind.
func RepositoryValidationReviewBindingEvent ¶ added in v0.2.0
func RepositoryValidationReviewBindingEvent(reviewTask *corev1alpha1.Task, monitor *corev1alpha1.RepositoryMonitor) (*store.MonitorEvent, error)
RepositoryValidationReviewBindingEvent returns the append-only event that freezes the review workspace before the review Task can call run_validation.
func RepositoryValidationTaskName ¶ added in v0.2.0
func RepositoryValidationTaskName(parent *corev1alpha1.Task) string
RepositoryValidationTaskName returns the deterministic child Task name for one exact review Task incarnation. Including the UID prevents a recreated review with the same Kubernetes name from adopting an earlier validation.
func RepositoryValidationTaskSpecMatches ¶ added in v0.2.0
func RepositoryValidationTaskSpecMatches(parent *corev1alpha1.Task, monitor *corev1alpha1.RepositoryMonitor, validationTask *corev1alpha1.Task, image, headSHA string) bool
RepositoryValidationTaskSpecMatches reports whether a validation Task has the exact spec the run_validation tool would create for the review.
func TransactionHasScope ¶
func TransactionHasScope(tx *corev1alpha1.TaskTransaction, want string) bool
func ValidRepositoryValidationImage ¶ added in v0.2.0
ValidRepositoryValidationImage reports whether image satisfies the public RepositoryMonitor validation-image contract.
func ValidateRepositoryValidationCommandBinding ¶ added in v0.2.0
func ValidateRepositoryValidationCommandBinding(ctx context.Context, bindingStore RepositoryValidationBindingStore, expected *store.MonitorEvent) error
ValidateRepositoryValidationCommandBinding verifies that the durable event still binds the validation Task to the command accepted by run_validation.
func ValidateRepositoryValidationCommandSecret ¶ added in v0.2.0
func ValidateRepositoryValidationCommandSecret(parent, validationTask *corev1alpha1.Task, secret *corev1.Secret, binding *RepositoryValidationCommandBinding) error
ValidateRepositoryValidationCommandSecret verifies that the immutable Secret belongs to the exact review and contains the command bound before Task creation. It never returns or embeds the command value in an error.
func ValidateRepositoryValidationOrphanCommandSecret ¶ added in v0.2.0
func ValidateRepositoryValidationOrphanCommandSecret(parent *corev1alpha1.Task, secret *corev1.Secret, binding *RepositoryValidationCommandBinding) error
ValidateRepositoryValidationOrphanCommandSecret verifies a command Secret after its deterministic child Task has disappeared. Callers must first verify the binding against the owning review Task and RepositoryMonitor.
func ValidateRepositoryValidationReviewBinding ¶ added in v0.2.0
func ValidateRepositoryValidationReviewBinding(ctx context.Context, bindingStore RepositoryValidationBindingStore, reviewTask *corev1alpha1.Task, monitor *corev1alpha1.RepositoryMonitor) error
ValidateRepositoryValidationReviewBinding verifies that the live review Task still has the controller-frozen workspace, monitor, image, and head identity.
func WithToolContext ¶
func WithToolContext(ctx context.Context, tc *ToolContext) context.Context
WithToolContext adds a ToolContext to a context.
Types ¶
type AllowedAgentArg ¶
type AllowedAgentArg struct {
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
}
AllowedAgentArg specifies an allowed agent for coordination
type AutoMergePullRequestArgs ¶
type AutoMergePullRequestArgs struct {
// TaskName is the name of the child task to read workspace config from.
TaskName string `json:"task_name"`
// PRNumber is the GitHub PR number to merge.
PRNumber int `json:"pr_number"`
// MergeMethod is the merge method: "merge", "squash", "rebase". Defaults to "squash".
MergeMethod string `json:"merge_method,omitempty"`
// CommitTitle is the custom merge commit title.
CommitTitle string `json:"commit_title,omitempty"`
// CommitMessage is the custom merge commit message.
CommitMessage string `json:"commit_message,omitempty"`
// Timeout is the maximum time to wait for CI checks (e.g. "30m"). Defaults to "30m".
Timeout string `json:"timeout,omitempty"`
}
AutoMergePullRequestArgs are the arguments for the auto_merge_pull_request tool.
type AutoMergePullRequestResult ¶
type AutoMergePullRequestResult struct {
Merged bool `json:"merged"`
ChecksPassed bool `json:"checks_passed"`
SHA string `json:"sha,omitempty"`
Message string `json:"message"`
Outcome string `json:"outcome"`
ChecksDetails string `json:"checks_details,omitempty"`
}
AutoMergePullRequestResult is the result of the auto-merge operation.
type AutoMergePullRequestTool ¶
type AutoMergePullRequestTool struct {
// contains filtered or unexported fields
}
AutoMergePullRequestTool polls GitHub CI checks and auto-merges a PR when all checks pass.
func NewAutoMergePullRequestTool ¶
func NewAutoMergePullRequestTool(k8sClient client.Client) *AutoMergePullRequestTool
NewAutoMergePullRequestTool creates a new auto_merge_pull_request tool.
func (*AutoMergePullRequestTool) Description ¶
func (t *AutoMergePullRequestTool) Description() string
Description returns the tool description.
func (*AutoMergePullRequestTool) Execute ¶
func (t *AutoMergePullRequestTool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
Execute polls CI checks and merges the PR when all checks pass.
func (*AutoMergePullRequestTool) Name ¶
func (t *AutoMergePullRequestTool) Name() string
Name returns the tool name.
func (*AutoMergePullRequestTool) Parameters ¶
func (t *AutoMergePullRequestTool) Parameters() json.RawMessage
Parameters returns the JSON schema for tool parameters.
type BrokeredDelegateTaskTransactionExchangeConfig ¶ added in v0.2.0
type BrokeredDelegateTaskTransactionExchangeConfig struct {
TTS contexttoken.TTSConfig
Exchanger contexttoken.Exchanger
SubjectTokenType string
ChildScope string
ResolveSubjectToken DelegateTaskSubjectTokenResolver
}
BrokeredDelegateTaskTransactionExchangeConfig carries controller-parsed TTS settings and request-scoped dependencies for brokered child-token exchange.
type CICheckResult ¶
CICheckResult categorizes CI check status into passed, failed, or pending.
type CancelTaskArgs ¶
type CancelTaskArgs struct {
TaskName string `json:"task_name"`
Namespace string `json:"namespace,omitempty"`
Reason string `json:"reason,omitempty"`
}
CancelTaskArgs are the arguments for the cancel_task tool
type CancelTaskResult ¶
CancelTaskResult represents the cancellation result
type CancelTaskTool ¶
type CancelTaskTool struct {
// contains filtered or unexported fields
}
CancelTaskTool implements task cancellation for coordination workflows
func NewCancelTaskTool ¶
func NewCancelTaskTool(k8sClient client.Client) *CancelTaskTool
NewCancelTaskTool creates a new cancel task tool
func (*CancelTaskTool) Description ¶
func (t *CancelTaskTool) Description() string
Description returns the tool description
func (*CancelTaskTool) Execute ¶
func (t *CancelTaskTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute cancels a running child task
func (*CancelTaskTool) Parameters ¶
func (t *CancelTaskTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for the tool parameters
type ChatCancelTaskTool ¶
type ChatCancelTaskTool struct{}
ChatCancelTaskTool cancels and deletes a task (chat version).
func (*ChatCancelTaskTool) Description ¶
func (t *ChatCancelTaskTool) Description() string
func (*ChatCancelTaskTool) Execute ¶
func (t *ChatCancelTaskTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*ChatCancelTaskTool) Name ¶
func (t *ChatCancelTaskTool) Name() string
func (*ChatCancelTaskTool) Parameters ¶
func (t *ChatCancelTaskTool) Parameters() json.RawMessage
type ChatCreateAgentTool ¶
type ChatCreateAgentTool struct{}
ChatCreateAgentTool creates an Agent CRD from the chat context.
func (*ChatCreateAgentTool) Description ¶
func (t *ChatCreateAgentTool) Description() string
func (*ChatCreateAgentTool) Execute ¶
func (t *ChatCreateAgentTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*ChatCreateAgentTool) Name ¶
func (t *ChatCreateAgentTool) Name() string
func (*ChatCreateAgentTool) Parameters ¶
func (t *ChatCreateAgentTool) Parameters() json.RawMessage
type ChatDeleteAgentTool ¶
type ChatDeleteAgentTool struct{}
ChatDeleteAgentTool deletes an Agent CRD (chat version).
func (*ChatDeleteAgentTool) Description ¶
func (t *ChatDeleteAgentTool) Description() string
func (*ChatDeleteAgentTool) Execute ¶
func (t *ChatDeleteAgentTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*ChatDeleteAgentTool) Name ¶
func (t *ChatDeleteAgentTool) Name() string
func (*ChatDeleteAgentTool) Parameters ¶
func (t *ChatDeleteAgentTool) Parameters() json.RawMessage
type ChatToolError ¶
type ChatToolError struct {
Type string `json:"errorType"`
Message string `json:"error"`
Suggestion string `json:"suggestion"`
}
ChatToolError represents a structured error from a chat tool.
func (*ChatToolError) Error ¶
func (e *ChatToolError) Error() string
type ChatToolResult ¶
type ChatToolResult struct {
Success bool `json:"success"`
Data any `json:"data,omitempty"`
Error string `json:"error,omitempty"`
ErrorType string `json:"errorType,omitempty"`
Suggestion string `json:"suggestion,omitempty"`
}
ChatToolResult represents the result of a chat tool execution.
type CheckMessagesArgs ¶
type CheckMessagesArgs struct {
MarkRead *bool `json:"mark_read,omitempty"`
}
CheckMessagesArgs are the arguments for the check_messages tool
type CheckMessagesTool ¶
type CheckMessagesTool struct{}
CheckMessagesTool implements checking for inter-agent messages
func NewCheckMessagesTool ¶
func NewCheckMessagesTool() *CheckMessagesTool
NewCheckMessagesTool creates a new check messages tool
func (*CheckMessagesTool) Description ¶
func (t *CheckMessagesTool) Description() string
Description returns the tool description
func (*CheckMessagesTool) Execute ¶
func (t *CheckMessagesTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute checks for messages from sibling tasks via the controller's internal API
func (*CheckMessagesTool) Name ¶
func (t *CheckMessagesTool) Name() string
Name returns the tool name
func (*CheckMessagesTool) Parameters ¶
func (t *CheckMessagesTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for the tool parameters
type CheckPRReviewMarkerArgs ¶
type CheckPRReviewMarkerArgs struct {
TaskName string `json:"task_name,omitempty"`
RepoURL string `json:"repo_url,omitempty"`
PRNumber int `json:"pr_number"`
HeadSHA string `json:"head_sha,omitempty"`
}
CheckPRReviewMarkerArgs are the arguments for check_pr_review_marker.
type CheckPRReviewMarkerResult ¶
type CheckPRReviewMarkerResult struct {
Found bool `json:"found"`
PRNumber int `json:"pr_number"`
HeadSHA string `json:"head_sha,omitempty"`
Marker string `json:"marker,omitempty"`
Source string `json:"source,omitempty"`
HTMLURL string `json:"html_url,omitempty"`
Author string `json:"author,omitempty"`
Message string `json:"message"`
}
CheckPRReviewMarkerResult is the result of checking review markers.
type CheckPRReviewMarkerTool ¶
type CheckPRReviewMarkerTool struct {
// contains filtered or unexported fields
}
CheckPRReviewMarkerTool checks whether Orka has already reviewed a PR head SHA.
func NewCheckPRReviewMarkerTool ¶
func NewCheckPRReviewMarkerTool(k8sClient client.Client) *CheckPRReviewMarkerTool
NewCheckPRReviewMarkerTool creates a new check_pr_review_marker tool.
func (*CheckPRReviewMarkerTool) Description ¶
func (t *CheckPRReviewMarkerTool) Description() string
func (*CheckPRReviewMarkerTool) Execute ¶
func (t *CheckPRReviewMarkerTool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
func (*CheckPRReviewMarkerTool) Name ¶
func (t *CheckPRReviewMarkerTool) Name() string
func (*CheckPRReviewMarkerTool) Parameters ¶
func (t *CheckPRReviewMarkerTool) Parameters() json.RawMessage
type CheckPullRequestCIArgs ¶
type CheckPullRequestCIArgs struct {
// TaskName is the child task whose workspace config has the repo and git credentials.
TaskName string `json:"task_name,omitempty"`
// RepoURL is an explicit GitHub repository URL. When provided with task context, it must match that task's repository scope.
RepoURL string `json:"repo_url,omitempty"`
// PRNumber is the GitHub PR number to inspect.
PRNumber int `json:"pr_number"`
// WaitTimeout is the optional maximum time to wait for pending checks (e.g. "30m").
// When empty, the tool performs one immediate status check.
WaitTimeout string `json:"wait_timeout,omitempty"`
// PollInterval is the optional delay between polls while waiting (e.g. "30s").
// Defaults to 30s when wait_timeout is set.
PollInterval string `json:"poll_interval,omitempty"`
}
CheckPullRequestCIArgs are the arguments for the check_pull_request_ci tool.
type CheckPullRequestCIResult ¶
type CheckPullRequestCIResult struct {
Status string `json:"status"`
PRNumber int `json:"pr_number"`
HeadSHA string `json:"head_sha,omitempty"`
ChecksPassed bool `json:"checks_passed"`
ChecksFailed bool `json:"checks_failed"`
ChecksPending bool `json:"checks_pending"`
ChecksDetails string `json:"checks_details,omitempty"`
WaitTimedOut bool `json:"wait_timed_out,omitempty"`
Attempts int `json:"attempts,omitempty"`
Message string `json:"message"`
}
CheckPullRequestCIResult is the result of checking pull request CI.
type CheckPullRequestCITool ¶
type CheckPullRequestCITool struct {
// contains filtered or unexported fields
}
CheckPullRequestCITool checks GitHub CI status for a pull request without merging it.
func NewCheckPullRequestCITool ¶
func NewCheckPullRequestCITool(k8sClient client.Client) *CheckPullRequestCITool
NewCheckPullRequestCITool creates a new check_pull_request_ci tool.
func (*CheckPullRequestCITool) Description ¶
func (t *CheckPullRequestCITool) Description() string
Description returns the tool description.
func (*CheckPullRequestCITool) Execute ¶
func (t *CheckPullRequestCITool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
Execute checks CI status for a pull request.
func (*CheckPullRequestCITool) Name ¶
func (t *CheckPullRequestCITool) Name() string
Name returns the tool name.
func (*CheckPullRequestCITool) Parameters ¶
func (t *CheckPullRequestCITool) Parameters() json.RawMessage
Parameters returns the JSON schema for tool parameters.
type CheckTaskProgressTool ¶
type CheckTaskProgressTool struct{}
CheckTaskProgressTool gets the current phase, duration, and status conditions of a task.
func (*CheckTaskProgressTool) Description ¶
func (t *CheckTaskProgressTool) Description() string
func (*CheckTaskProgressTool) Execute ¶
func (t *CheckTaskProgressTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*CheckTaskProgressTool) Name ¶
func (t *CheckTaskProgressTool) Name() string
func (*CheckTaskProgressTool) Parameters ¶
func (t *CheckTaskProgressTool) Parameters() json.RawMessage
type CodeExecArgs ¶
type CodeExecArgs struct {
Language string `json:"language"`
Code string `json:"code"`
Timeout int `json:"timeout,omitempty"` // Timeout in seconds
}
CodeExecArgs are the arguments for the code execution tool.
type CodeExecResult ¶
type CodeExecResult struct {
Output string `json:"output"`
Error string `json:"error,omitempty"`
ExitCode int `json:"exit_code"`
TimedOut bool `json:"timed_out,omitempty"`
OutputTruncated bool `json:"output_truncated,omitempty"`
ErrorTruncated bool `json:"error_truncated,omitempty"`
}
CodeExecResult represents the execution result.
type CodeExecTool ¶
type CodeExecTool struct {
// contains filtered or unexported fields
}
CodeExecTool implements code execution functionality.
func NewCodeExecTool ¶
func NewCodeExecTool() *CodeExecTool
NewCodeExecTool creates a new code execution tool.
func (*CodeExecTool) Description ¶
func (t *CodeExecTool) Description() string
Description returns the tool description.
func (*CodeExecTool) Execute ¶
func (t *CodeExecTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute runs the code.
func (*CodeExecTool) Parameters ¶
func (t *CodeExecTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for parameters.
type CodeExecutionRequest ¶
type CodeExecutionRequest struct {
Backend string
Language string
Code string
Timeout time.Duration
WorkDir string
DenyPatterns []denyPattern
OutputLimitBytes int64
ResourceAudit map[string]string
Tenant string
Provider string
ProviderType string
RunID string
InputHash string
}
CodeExecutionRequest contains a validated code execution request for a backend.
type CodeExecutor ¶
type CodeExecutor interface {
Execute(ctx context.Context, req CodeExecutionRequest) CodeExecResult
}
CodeExecutor is the execution backend used by CodeExecTool. Kubernetes, in-process, and unsupported backends all implement it.
type CommentOnIssueArgs ¶
type CommentOnIssueArgs struct {
// TaskName is the name of a task whose workspace config provides the repo and git credentials.
TaskName string `json:"task_name"`
// RepoURL is a direct GitHub repo URL (falls back to ORKA_GIT_REPO env var).
RepoURL string `json:"repo_url"`
// IssueNumber is the GitHub issue number to comment on.
IssueNumber int `json:"issue_number"`
// Body is the comment text (Markdown supported).
Body string `json:"body"`
}
CommentOnIssueArgs are the arguments for the comment_on_issue tool.
type CommentOnIssueResult ¶
type CommentOnIssueResult struct {
CommentID int `json:"comment_id"`
HTMLURL string `json:"html_url"`
Status string `json:"status"`
}
CommentOnIssueResult is the result of posting a comment on an issue.
type CommentOnIssueTool ¶
type CommentOnIssueTool struct {
// contains filtered or unexported fields
}
CommentOnIssueTool posts a comment on a GitHub issue.
func NewCommentOnIssueTool ¶
func NewCommentOnIssueTool(k8sClient client.Client) *CommentOnIssueTool
NewCommentOnIssueTool creates a new comment_on_issue tool.
func (*CommentOnIssueTool) Description ¶
func (t *CommentOnIssueTool) Description() string
Description returns the tool description.
func (*CommentOnIssueTool) Execute ¶
func (t *CommentOnIssueTool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
Execute posts a comment on a GitHub issue.
func (*CommentOnIssueTool) Name ¶
func (t *CommentOnIssueTool) Name() string
Name returns the tool name.
func (*CommentOnIssueTool) Parameters ¶
func (t *CommentOnIssueTool) Parameters() json.RawMessage
Parameters returns the JSON schema for tool parameters.
type CoordinationArgs ¶
type CoordinationArgs struct {
Enabled bool `json:"enabled"`
MaxDepth int32 `json:"maxDepth,omitempty"`
MaxConcurrentChildren int32 `json:"maxConcurrentChildren,omitempty"`
AllowedAgents []AllowedAgentArg `json:"allowedAgents,omitempty"`
}
CoordinationArgs specifies coordination configuration
type CreateAITaskTool ¶
type CreateAITaskTool struct{}
CreateAITaskTool creates an AI-type Task CR.
func (*CreateAITaskTool) Description ¶
func (t *CreateAITaskTool) Description() string
func (*CreateAITaskTool) Execute ¶
func (t *CreateAITaskTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*CreateAITaskTool) Name ¶
func (t *CreateAITaskTool) Name() string
func (*CreateAITaskTool) Parameters ¶
func (t *CreateAITaskTool) Parameters() json.RawMessage
type CreateAgentArgs ¶
type CreateAgentArgs struct {
Role string `json:"role"`
SystemPrompt string `json:"systemPrompt"`
Model *ModelArgs `json:"model,omitempty"`
ProviderRef string `json:"providerRef,omitempty"`
Tools []string `json:"tools,omitempty"`
Skills []string `json:"skills,omitempty"`
Coordination *CoordinationArgs `json:"coordination,omitempty"`
Runtime *RuntimeArgs `json:"runtime,omitempty"`
}
CreateAgentArgs are the arguments for the create_agent tool
type CreateAgentResult ¶
type CreateAgentResult struct {
AgentName string `json:"agentName"`
Namespace string `json:"namespace"`
Status string `json:"status"`
}
CreateAgentResult is the result of creating an agent
type CreateAgentTaskTool ¶
type CreateAgentTaskTool struct{}
CreateAgentTaskTool creates an agent-runtime Task CR.
func (*CreateAgentTaskTool) Description ¶
func (t *CreateAgentTaskTool) Description() string
func (*CreateAgentTaskTool) Execute ¶
func (t *CreateAgentTaskTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*CreateAgentTaskTool) Name ¶
func (t *CreateAgentTaskTool) Name() string
func (*CreateAgentTaskTool) Parameters ¶
func (t *CreateAgentTaskTool) Parameters() json.RawMessage
type CreateAgentTool ¶
type CreateAgentTool struct {
// contains filtered or unexported fields
}
CreateAgentTool implements dynamic Agent CRD creation
func NewCreateAgentTool ¶
func NewCreateAgentTool(k8sClient client.Client, mode executionmode.Mode) *CreateAgentTool
NewCreateAgentTool creates a new create_agent tool
func (*CreateAgentTool) Description ¶
func (t *CreateAgentTool) Description() string
Description returns the tool description
func (*CreateAgentTool) Execute ¶
func (t *CreateAgentTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute creates an Agent CRD dynamically
func (*CreateAgentTool) Parameters ¶
func (t *CreateAgentTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for parameters
type CreateContainerTaskTool ¶
type CreateContainerTaskTool struct {
// contains filtered or unexported fields
}
CreateContainerTaskTool creates a container-type Task CR.
func NewCreateContainerTaskTool ¶
func NewCreateContainerTaskTool(k8sClient client.Client) *CreateContainerTaskTool
NewCreateContainerTaskTool creates a container task tool for coordinator agents.
func (*CreateContainerTaskTool) Description ¶
func (t *CreateContainerTaskTool) Description() string
func (*CreateContainerTaskTool) Execute ¶
func (t *CreateContainerTaskTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*CreateContainerTaskTool) Name ¶
func (t *CreateContainerTaskTool) Name() string
func (*CreateContainerTaskTool) Parameters ¶
func (t *CreateContainerTaskTool) Parameters() json.RawMessage
type CreatePRMonitorTool ¶
type CreatePRMonitorTool struct{}
CreatePRMonitorTool creates a scheduled AI task that monitors GitHub PRs.
func (*CreatePRMonitorTool) Description ¶
func (t *CreatePRMonitorTool) Description() string
func (*CreatePRMonitorTool) Execute ¶
func (t *CreatePRMonitorTool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
func (*CreatePRMonitorTool) Name ¶
func (t *CreatePRMonitorTool) Name() string
func (*CreatePRMonitorTool) Parameters ¶
func (t *CreatePRMonitorTool) Parameters() json.RawMessage
type CreatePullRequestArgs ¶
type CreatePullRequestArgs struct {
// TaskName is the name of the completed child task whose branch to use.
// The tool reads the task's workspace config to determine repo and git secret.
TaskName string `json:"task_name"`
// HeadBranch is the remote branch that contains the changes.
HeadBranch string `json:"head_branch"`
// BaseBranch is the target branch to merge into (e.g. "main").
BaseBranch string `json:"base_branch"`
// Title is the pull request title.
Title string `json:"title"`
// Body is the pull request body (Markdown).
Body string `json:"body"`
}
CreatePullRequestArgs are the arguments for the create_pull_request tool.
type CreatePullRequestResult ¶
type CreatePullRequestResult struct {
PRURL string `json:"pr_url"`
PRNumber int `json:"pr_number"`
Status string `json:"status"`
}
CreatePullRequestResult is the result of creating a pull request.
type CreatePullRequestTool ¶
type CreatePullRequestTool struct {
// contains filtered or unexported fields
}
CreatePullRequestTool creates a GitHub pull request from a pushed branch.
func NewCreatePullRequestTool ¶
func NewCreatePullRequestTool(k8sClient client.Client) *CreatePullRequestTool
NewCreatePullRequestTool creates a new create_pull_request tool.
func (*CreatePullRequestTool) Description ¶
func (t *CreatePullRequestTool) Description() string
Description returns the tool description.
func (*CreatePullRequestTool) Execute ¶
func (t *CreatePullRequestTool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
Execute creates a pull request on GitHub.
func (*CreatePullRequestTool) Name ¶
func (t *CreatePullRequestTool) Name() string
Name returns the tool name.
func (*CreatePullRequestTool) Parameters ¶
func (t *CreatePullRequestTool) Parameters() json.RawMessage
Parameters returns the JSON schema for tool parameters.
type CreateToolCRDTool ¶
type CreateToolCRDTool struct{}
CreateToolCRDTool creates a Tool CRD with an HTTP endpoint.
func (*CreateToolCRDTool) Description ¶
func (t *CreateToolCRDTool) Description() string
func (*CreateToolCRDTool) Execute ¶
func (t *CreateToolCRDTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*CreateToolCRDTool) Name ¶
func (t *CreateToolCRDTool) Name() string
func (*CreateToolCRDTool) Parameters ¶
func (t *CreateToolCRDTool) Parameters() json.RawMessage
type DelegateTaskArgs ¶
type DelegateTaskArgs struct {
Agent string `json:"agent"`
Prompt string `json:"prompt"`
Namespace string `json:"namespace,omitempty"`
AgentNamespace string `json:"agentNamespace,omitempty"`
TaskNamespace string `json:"taskNamespace,omitempty"`
Priority *int32 `json:"priority,omitempty"`
Timeout string `json:"timeout,omitempty"`
Workspace *WorkspaceArgs `json:"workspace,omitempty"`
MaxTurns *int32 `json:"maxTurns,omitempty"`
AllowBash *bool `json:"allowBash,omitempty"`
// PriorTask references a previously completed task whose diff should be
// applied to the workspace before this task begins. Optional.
PriorTask string `json:"prior_task,omitempty"`
// Feedback provides review feedback to include in the task prompt.
// Used with prior_task for iterative code review workflows. Optional.
Feedback string `json:"feedback,omitempty"`
// AutoRetry marks this task for structured failure reporting.
// When enabled, wait_for_tasks includes retry metadata (attempt count,
// max retries, error message) in the failure result so the coordinator
// can make informed retry decisions. Does NOT automatically re-create tasks.
AutoRetry bool `json:"auto_retry,omitempty"`
// MaxRetries is the maximum retry budget for coordinator reference (default: 2).
// Only used when auto_retry is true.
MaxRetries *int `json:"max_retries,omitempty"`
}
DelegateTaskArgs are the arguments for the delegate_task tool
type DelegateTaskResult ¶
type DelegateTaskResult struct {
TaskName string `json:"taskName"`
TaskUID string `json:"taskUID,omitempty"`
ParentTaskUID string `json:"parentTaskUID,omitempty"`
Status string `json:"status"`
}
DelegateTaskResult represents the delegation result
type DelegateTaskSubjectTokenResolver ¶ added in v0.2.0
type DelegateTaskSubjectTokenResolver func(context.Context, *corev1alpha1.Task, string) (string, error)
DelegateTaskSubjectTokenResolver resolves the exact subject token authorized for one authenticated parent Task. Implementations must not fall back to process-global worker credentials for brokered requests.
type DelegateTaskTool ¶
type DelegateTaskTool struct {
// contains filtered or unexported fields
}
DelegateTaskTool implements multi-agent task delegation.
func NewBrokeredDelegateTaskTool ¶ added in v0.2.0
func NewBrokeredDelegateTaskTool( k8sClient client.Client, config BrokeredDelegateTaskTransactionExchangeConfig, ) (*DelegateTaskTool, error)
NewBrokeredDelegateTaskTool creates a delegate_task implementation that uses controller-parsed TTS settings and request-scoped subject-token resolution. The configuration is copied so later caller mutation cannot change the live broker policy.
func NewDelegateTaskTool ¶
func NewDelegateTaskTool(k8sClient client.Client) *DelegateTaskTool
NewDelegateTaskTool creates a new delegate task tool
func (*DelegateTaskTool) Description ¶
func (t *DelegateTaskTool) Description() string
Description returns the tool description
func (*DelegateTaskTool) Execute ¶
func (t *DelegateTaskTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute delegates a task to another agent
func (*DelegateTaskTool) Parameters ¶
func (t *DelegateTaskTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for parameters
type DeleteAgentArgs ¶
type DeleteAgentArgs struct {
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
}
DeleteAgentArgs are the arguments for the delete_agent tool
type DeleteAgentResult ¶
DeleteAgentResult represents the deletion result
type DeleteAgentTool ¶
type DeleteAgentTool struct {
// contains filtered or unexported fields
}
DeleteAgentTool implements agent cleanup for dynamically created agents
func NewDeleteAgentTool ¶
func NewDeleteAgentTool(k8sClient client.Client) *DeleteAgentTool
NewDeleteAgentTool creates a new delete agent tool
func (*DeleteAgentTool) Description ¶
func (t *DeleteAgentTool) Description() string
Description returns the tool description
func (*DeleteAgentTool) Execute ¶
func (t *DeleteAgentTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute deletes an agent CR
func (*DeleteAgentTool) Parameters ¶
func (t *DeleteAgentTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for parameters
type DeleteSessionTool ¶
type DeleteSessionTool struct{}
DeleteSessionTool deletes a session and its transcript data.
func (*DeleteSessionTool) Description ¶
func (t *DeleteSessionTool) Description() string
func (*DeleteSessionTool) Execute ¶
func (t *DeleteSessionTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*DeleteSessionTool) Name ¶
func (t *DeleteSessionTool) Name() string
func (*DeleteSessionTool) Parameters ¶
func (t *DeleteSessionTool) Parameters() json.RawMessage
type DeleteToolTool ¶
type DeleteToolTool struct{}
DeleteToolTool deletes a Tool CRD.
func (*DeleteToolTool) Description ¶
func (t *DeleteToolTool) Description() string
func (*DeleteToolTool) Execute ¶
func (t *DeleteToolTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*DeleteToolTool) Name ¶
func (t *DeleteToolTool) Name() string
func (*DeleteToolTool) Parameters ¶
func (t *DeleteToolTool) Parameters() json.RawMessage
type FailureDetails ¶
type FailureDetails struct {
Message string `json:"message"`
RetryCount int `json:"retryCount"`
MaxRetries int `json:"maxRetries"`
}
FailureDetails provides structured information about a failed task
type FetchTaskOutputTool ¶
type FetchTaskOutputTool struct{}
FetchTaskOutputTool fetches the result/output of a completed task.
func (*FetchTaskOutputTool) Description ¶
func (t *FetchTaskOutputTool) Description() string
func (*FetchTaskOutputTool) Execute ¶
func (t *FetchTaskOutputTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*FetchTaskOutputTool) Name ¶
func (t *FetchTaskOutputTool) Name() string
func (*FetchTaskOutputTool) Parameters ¶
func (t *FetchTaskOutputTool) Parameters() json.RawMessage
type FileChange ¶
type FileChange struct {
Filename string `json:"filename"`
Status string `json:"status"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
Patch string `json:"patch"`
}
FileChange represents a changed file in a pull request.
type FileReadArgs ¶
type FileReadArgs struct {
Path string `json:"path"`
Offset int64 `json:"offset,omitempty"`
Limit int64 `json:"limit,omitempty"`
Encoding string `json:"encoding,omitempty"`
}
FileReadArgs are the arguments for the file read tool
type FileReadResult ¶
type FileReadResult struct {
Content string `json:"content"`
Path string `json:"path"`
Size int64 `json:"size"`
Truncated bool `json:"truncated"`
}
FileReadResult represents the file read result
type FileReadTool ¶
type FileReadTool struct {
// contains filtered or unexported fields
}
FileReadTool implements file reading functionality
func NewFileReadTool ¶
func NewFileReadTool() *FileReadTool
NewFileReadTool creates a new file read tool
func (*FileReadTool) Description ¶
func (t *FileReadTool) Description() string
Description returns the tool description
func (*FileReadTool) Execute ¶
func (t *FileReadTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute reads the file.
func (*FileReadTool) Parameters ¶
func (t *FileReadTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for parameters
type FileWriteArgs ¶
type FileWriteArgs struct {
Path string `json:"path"`
Content string `json:"content"`
Mode string `json:"mode,omitempty"`
CreateDirs bool `json:"create_dirs,omitempty"`
}
FileWriteArgs are the arguments for the file write tool
type FileWriteResult ¶
type FileWriteResult struct {
Path string `json:"path"`
Size int `json:"size"`
Mode string `json:"mode"`
Created bool `json:"created"`
}
FileWriteResult represents the file write result
type FileWriteTool ¶
type FileWriteTool struct {
// contains filtered or unexported fields
}
FileWriteTool implements file writing functionality
func NewFileWriteTool ¶
func NewFileWriteTool() *FileWriteTool
NewFileWriteTool creates a new file write tool
func (*FileWriteTool) Description ¶
func (t *FileWriteTool) Description() string
Description returns the tool description
func (*FileWriteTool) Execute ¶
func (t *FileWriteTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute writes the file
func (*FileWriteTool) Parameters ¶
func (t *FileWriteTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for parameters
type GetIssueArgs ¶
type GetIssueArgs struct {
// TaskName is the name of the task to read workspace config from (optional).
TaskName string `json:"task_name"`
// RepoURL is a direct GitHub repo URL (optional; falls back to ORKA_GIT_REPO).
RepoURL string `json:"repo_url"`
// IssueNumber is the GitHub issue number (required).
IssueNumber int `json:"issue_number"`
}
GetIssueArgs are the arguments for the get_issue tool.
type GetIssueResult ¶
type GetIssueResult struct {
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
Author string `json:"author"`
Labels []string `json:"labels"`
Assignees []string `json:"assignees"`
State string `json:"state"`
CreatedAt string `json:"created_at"`
HTMLURL string `json:"html_url"`
CommentCount int `json:"comment_count"`
Comments []IssueComment `json:"comments"`
}
GetIssueResult is the result of fetching a GitHub issue.
type GetIssueTool ¶
type GetIssueTool struct {
// contains filtered or unexported fields
}
GetIssueTool fetches full details of a specific GitHub issue including comments.
func NewGetIssueTool ¶
func NewGetIssueTool(k8sClient client.Client) *GetIssueTool
NewGetIssueTool creates a new get_issue tool.
func (*GetIssueTool) Description ¶
func (t *GetIssueTool) Description() string
Description returns the tool description.
func (*GetIssueTool) Execute ¶
func (t *GetIssueTool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
Execute fetches the issue details and comments from GitHub.
func (*GetIssueTool) Parameters ¶
func (t *GetIssueTool) Parameters() json.RawMessage
Parameters returns the JSON schema for tool parameters.
type GitHubPullRequest ¶
GitHubPullRequest captures the canonical URL, number, and resolution status.
func CreateOrGetGitHubPullRequest ¶
func CreateOrGetGitHubPullRequest(ctx context.Context, token, owner, repo, head, base, title, body, apiBaseURL string) (GitHubPullRequest, error)
CreateOrGetGitHubPullRequest creates a pull request via the GitHub REST API. If GitHub reports that the pull request already exists, it resolves and returns the existing open pull request instead.
type InProcessCodeExecutor ¶
type InProcessCodeExecutor struct{}
InProcessCodeExecutor runs code on the current worker host with local process hardening.
func (*InProcessCodeExecutor) Execute ¶
func (e *InProcessCodeExecutor) Execute(ctx context.Context, req CodeExecutionRequest) CodeExecResult
Execute runs the request with the in-process backend.
type IssueComment ¶
type IssueComment struct {
Author string `json:"author"`
Body string `json:"body"`
CreatedAt string `json:"created_at"`
}
IssueComment represents a single comment on a GitHub issue.
type IssueSummary ¶
type IssueSummary struct {
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
Author string `json:"author"`
Labels []string `json:"labels"`
CreatedAt string `json:"created_at"`
HTMLURL string `json:"html_url"`
}
IssueSummary represents a single GitHub issue in the result.
type KubernetesJobCodeExecutor ¶
type KubernetesJobCodeExecutor struct {
// contains filtered or unexported fields
}
KubernetesJobCodeExecutor runs code in a short-lived Kubernetes Job.
func (*KubernetesJobCodeExecutor) Execute ¶
func (e *KubernetesJobCodeExecutor) Execute(ctx context.Context, req CodeExecutionRequest) CodeExecResult
Execute runs the request in Kubernetes.
type ListAgentsTool ¶
type ListAgentsTool struct{}
ListAgentsTool lists available Agent CRDs.
func (*ListAgentsTool) Description ¶
func (t *ListAgentsTool) Description() string
func (*ListAgentsTool) Execute ¶
func (t *ListAgentsTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*ListAgentsTool) Name ¶
func (t *ListAgentsTool) Name() string
func (*ListAgentsTool) Parameters ¶
func (t *ListAgentsTool) Parameters() json.RawMessage
type ListIssuesArgs ¶
type ListIssuesArgs struct {
// TaskName is the name of a task whose workspace config provides the repo and git credentials.
TaskName string `json:"task_name"`
// RepoURL is a direct GitHub repo URL (falls back to ORKA_GIT_REPO env var).
RepoURL string `json:"repo_url"`
// UnassignedOnly filters to issues with no assignee. Default is true.
UnassignedOnly *bool `json:"unassigned_only"`
// PerPage is the number of results per page (default: 30, max: 100).
PerPage int `json:"per_page"`
// Page is the page number for pagination.
Page int `json:"page"`
}
ListIssuesArgs are the arguments for the list_issues tool.
type ListIssuesResult ¶
type ListIssuesResult struct {
Issues []IssueSummary `json:"issues"`
Count int `json:"count"` // number of issues on this page (after filtering)
HasNextPage bool `json:"has_next_page"` // true if more pages may exist
}
ListIssuesResult is the result of listing issues.
type ListIssuesTool ¶
type ListIssuesTool struct {
// contains filtered or unexported fields
}
ListIssuesTool lists open GitHub issues in a repository.
func NewListIssuesTool ¶
func NewListIssuesTool(k8sClient client.Client) *ListIssuesTool
NewListIssuesTool creates a new list_issues tool.
func (*ListIssuesTool) Description ¶
func (t *ListIssuesTool) Description() string
Description returns the tool description.
func (*ListIssuesTool) Execute ¶
func (t *ListIssuesTool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
Execute lists open issues from a GitHub repository.
func (*ListIssuesTool) Parameters ¶
func (t *ListIssuesTool) Parameters() json.RawMessage
Parameters returns the JSON schema for tool parameters.
type ListPullRequestsArgs ¶
type ListPullRequestsArgs struct {
TaskName string `json:"task_name"` // optional: resolve repo from a task's workspace
RepoURL string `json:"repo_url"` // optional: direct repo URL; with task context it must match that task's repository scope
PerPage int `json:"per_page"` // results per page (default: 30, max: 100)
Page int `json:"page"` // page number (default: 1)
}
ListPullRequestsArgs are the arguments for the list_pull_requests tool.
type ListPullRequestsResult ¶
type ListPullRequestsResult struct {
PullRequests []PRSummary `json:"pull_requests"`
TotalCount int `json:"total_count"`
}
ListPullRequestsResult is the result of listing pull requests.
type ListPullRequestsTool ¶
type ListPullRequestsTool struct {
// contains filtered or unexported fields
}
ListPullRequestsTool lists open pull requests in a GitHub repository.
func NewListPullRequestsTool ¶
func NewListPullRequestsTool(k8sClient client.Client) *ListPullRequestsTool
NewListPullRequestsTool creates a new list_pull_requests tool.
func (*ListPullRequestsTool) Description ¶
func (t *ListPullRequestsTool) Description() string
Description returns the tool description.
func (*ListPullRequestsTool) Execute ¶
func (t *ListPullRequestsTool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
Execute lists open pull requests from GitHub.
func (*ListPullRequestsTool) Name ¶
func (t *ListPullRequestsTool) Name() string
Name returns the tool name.
func (*ListPullRequestsTool) Parameters ¶
func (t *ListPullRequestsTool) Parameters() json.RawMessage
Parameters returns the JSON schema for tool parameters.
type ListTasksTool ¶
type ListTasksTool struct{}
ListTasksTool lists Task CRDs with optional status filter.
func (*ListTasksTool) Description ¶
func (t *ListTasksTool) Description() string
func (*ListTasksTool) Execute ¶
func (t *ListTasksTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*ListTasksTool) Name ¶
func (t *ListTasksTool) Name() string
func (*ListTasksTool) Parameters ¶
func (t *ListTasksTool) Parameters() json.RawMessage
type ListToolsTool ¶
type ListToolsTool struct{}
ListToolsTool lists available Tool CRDs.
func (*ListToolsTool) Description ¶
func (t *ListToolsTool) Description() string
func (*ListToolsTool) Execute ¶
func (t *ListToolsTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*ListToolsTool) Name ¶
func (t *ListToolsTool) Name() string
func (*ListToolsTool) Parameters ¶
func (t *ListToolsTool) Parameters() json.RawMessage
type MemoryProposalWriter ¶ added in v0.2.0
type MemoryProposalWriter interface {
CreateMemoryProposal(context.Context, *store.MemoryProposal) error
}
MemoryProposalWriter is the least-privilege store dependency required by remember and propose_memory.
type MemoryReader ¶ added in v0.2.0
type MemoryReader interface {
ListMemories(context.Context, store.MemoryFilter) ([]store.Memory, error)
}
MemoryReader is the least-privilege store dependency required by recall_memory.
type MergePullRequestArgs ¶
type MergePullRequestArgs struct {
// TaskName is the name of the child task to read workspace config from.
TaskName string `json:"task_name"`
// PRNumber is the GitHub PR number to merge.
PRNumber int `json:"pr_number"`
// MergeMethod is the merge method: "merge", "squash", "rebase". Defaults to "squash".
MergeMethod string `json:"merge_method,omitempty"`
// CommitTitle is the custom merge commit title.
CommitTitle string `json:"commit_title,omitempty"`
// CommitMessage is the custom merge commit message.
CommitMessage string `json:"commit_message,omitempty"`
}
MergePullRequestArgs are the arguments for the merge_pull_request tool.
type MergePullRequestResult ¶
type MergePullRequestResult struct {
SHA string `json:"sha"`
Merged bool `json:"merged"`
Message string `json:"message"`
ChecksPassed bool `json:"checks_passed"`
}
MergePullRequestResult is the result of merging a pull request.
type MergePullRequestTool ¶
type MergePullRequestTool struct {
// contains filtered or unexported fields
}
MergePullRequestTool merges a GitHub pull request after verifying CI checks pass.
func NewMergePullRequestTool ¶
func NewMergePullRequestTool(k8sClient client.Client) *MergePullRequestTool
NewMergePullRequestTool creates a new merge_pull_request tool.
func (*MergePullRequestTool) Description ¶
func (t *MergePullRequestTool) Description() string
Description returns the tool description.
func (*MergePullRequestTool) Execute ¶
func (t *MergePullRequestTool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
Execute merges a pull request on GitHub after verifying CI checks.
func (*MergePullRequestTool) Name ¶
func (t *MergePullRequestTool) Name() string
Name returns the tool name.
func (*MergePullRequestTool) Parameters ¶
func (t *MergePullRequestTool) Parameters() json.RawMessage
Parameters returns the JSON schema for tool parameters.
type ModelArgs ¶
type ModelArgs struct {
Provider string `json:"provider,omitempty"`
Name string `json:"name,omitempty"`
ContextWindow *int32 `json:"contextWindow,omitempty"`
MaxTokens *int32 `json:"maxTokens,omitempty"`
}
ModelArgs specifies LLM model configuration
type PRSummary ¶
type PRSummary struct {
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
Author string `json:"author"`
BaseBranch string `json:"base_branch"`
HeadBranch string `json:"head_branch"`
Labels []string `json:"labels"`
CreatedAt string `json:"created_at"`
HTMLURL string `json:"html_url"`
Draft bool `json:"draft"`
}
PRSummary represents a single pull request in the listing.
type PostReviewCommentArgs ¶
type PostReviewCommentArgs struct {
// TaskName is an optional task to read workspace config and credentials from.
TaskName string `json:"task_name,omitempty"`
// RepoURL is an optional GitHub repository URL.
RepoURL string `json:"repo_url,omitempty"`
// PRNumber is the GitHub PR number.
PRNumber int `json:"pr_number"`
// Body is the top-level review body text.
Body string `json:"body"`
// Event is one of reviewEventApprove, reviewEventRequestChanges, reviewEventComment.
Event string `json:"event"`
// Comments is an optional list of line-level review comments.
Comments []ReviewComment `json:"comments,omitempty"`
}
PostReviewCommentArgs are the arguments for the post_review_comment tool.
type PostReviewCommentResult ¶
type PostReviewCommentResult struct {
ReviewID int `json:"review_id"`
Status string `json:"status"`
HTMLURL string `json:"html_url"`
}
PostReviewCommentResult is the result of posting a review.
type PostReviewCommentTool ¶
type PostReviewCommentTool struct {
// contains filtered or unexported fields
}
PostReviewCommentTool posts a review on a GitHub pull request.
func NewPostReviewCommentTool ¶
func NewPostReviewCommentTool(k8sClient client.Client) *PostReviewCommentTool
NewPostReviewCommentTool creates a new post_review_comment tool.
func (*PostReviewCommentTool) Description ¶
func (t *PostReviewCommentTool) Description() string
Description returns the tool description.
func (*PostReviewCommentTool) Execute ¶
func (t *PostReviewCommentTool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
Execute posts a review on a GitHub pull request.
func (*PostReviewCommentTool) Name ¶
func (t *PostReviewCommentTool) Name() string
Name returns the tool name.
func (*PostReviewCommentTool) Parameters ¶
func (t *PostReviewCommentTool) Parameters() json.RawMessage
Parameters returns the JSON schema for tool parameters.
type ProposeMemoryTool ¶
type ProposeMemoryTool struct{}
ProposeMemoryTool submits memory-adjacent governance proposals for coordinator review.
func NewProposeMemoryTool ¶
func NewProposeMemoryTool() *ProposeMemoryTool
NewProposeMemoryTool creates a new propose_memory tool.
func (*ProposeMemoryTool) Description ¶
func (t *ProposeMemoryTool) Description() string
Description returns the tool description.
func (*ProposeMemoryTool) Execute ¶
func (t *ProposeMemoryTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute submits a memory proposal through the controller's internal API.
func (*ProposeMemoryTool) Name ¶
func (t *ProposeMemoryTool) Name() string
Name returns the tool name.
func (*ProposeMemoryTool) Parameters ¶
func (t *ProposeMemoryTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for the tool parameters.
type RecallMemoryTool ¶
type RecallMemoryTool struct{}
RecallMemoryTool retrieves durable namespace-scoped memories relevant to the current task.
func NewRecallMemoryTool ¶
func NewRecallMemoryTool() *RecallMemoryTool
NewRecallMemoryTool creates a new recall_memory tool.
func (*RecallMemoryTool) Description ¶
func (t *RecallMemoryTool) Description() string
Description returns the tool description.
func (*RecallMemoryTool) Execute ¶
func (t *RecallMemoryTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute recalls matching memories through the controller's internal API.
func (*RecallMemoryTool) Name ¶
func (t *RecallMemoryTool) Name() string
Name returns the tool name.
func (*RecallMemoryTool) Parameters ¶
func (t *RecallMemoryTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for the tool parameters.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages registered tools
func (*Registry) Execute ¶
Execute executes a tool by name. It is the DRY instrumentation point for built-in registry tools used by chat, proxy-compatible handlers, and workers.
type RememberMemoryTool ¶
type RememberMemoryTool struct{}
RememberMemoryTool submits durable memory proposals for coordinator review.
func NewRememberMemoryTool ¶
func NewRememberMemoryTool() *RememberMemoryTool
NewRememberMemoryTool creates a new remember tool.
func (*RememberMemoryTool) Description ¶
func (t *RememberMemoryTool) Description() string
Description returns the tool description.
func (*RememberMemoryTool) Execute ¶
func (t *RememberMemoryTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute submits a durable memory proposal through the controller's internal API.
func (*RememberMemoryTool) Name ¶
func (t *RememberMemoryTool) Name() string
Name returns the tool name.
func (*RememberMemoryTool) Parameters ¶
func (t *RememberMemoryTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for the tool parameters.
type RepositoryValidationBindingStore ¶ added in v0.2.0
type RepositoryValidationBindingStore interface {
CreateMonitorEvent(context.Context, *store.MonitorEvent) error
ListMonitorEvents(context.Context, store.MonitorEventFilter) ([]store.MonitorEvent, string, error)
}
RepositoryValidationBindingStore is the least-privilege durable dependency used to bind a review workspace and its validation command before execution.
type RepositoryValidationCommandBinding ¶ added in v0.2.0
type RepositoryValidationCommandBinding struct {
MonitorNamespace string
MonitorName string
RunID string
ItemKind string
ItemNumber int64
MonitorUID string
ReviewTaskName string
ReviewTaskUID string
ValidationTaskName string
Image string
HeadSHA string
CommandDigest string
}
RepositoryValidationCommandBinding is the controller-owned execution provenance persisted before a repository validation Task is created.
func FindRepositoryValidationCommandBinding ¶ added in v0.2.0
func FindRepositoryValidationCommandBinding(ctx context.Context, bindingStore RepositoryValidationBindingStore, namespace, validationTaskName string) (*RepositoryValidationCommandBinding, error)
FindRepositoryValidationCommandBinding finds the durable binding for one deterministic validation Task name. A conflicting duplicate fails closed.
func (*RepositoryValidationCommandBinding) MatchesCommand ¶ added in v0.2.0
func (b *RepositoryValidationCommandBinding) MatchesCommand(command string) bool
MatchesCommand reports whether command is the value accepted before the validation Task was created.
func (*RepositoryValidationCommandBinding) MatchesReview ¶ added in v0.2.0
func (b *RepositoryValidationCommandBinding) MatchesReview(parent *corev1alpha1.Task, monitor *corev1alpha1.RepositoryMonitor, image, headSHA string) bool
MatchesReview reports whether a durable binding belongs to the exact review Task and RepositoryMonitor that requested it.
type RequestApprovalTool ¶
type RequestApprovalTool struct{}
RequestApprovalTool records human approval requests for consequential worker actions.
func NewRequestApprovalTool ¶
func NewRequestApprovalTool() *RequestApprovalTool
func (*RequestApprovalTool) Description ¶
func (t *RequestApprovalTool) Description() string
func (*RequestApprovalTool) Execute ¶
func (t *RequestApprovalTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*RequestApprovalTool) Name ¶
func (t *RequestApprovalTool) Name() string
func (*RequestApprovalTool) Parameters ¶
func (t *RequestApprovalTool) Parameters() json.RawMessage
type RequestApprovalValidationError ¶
type RequestApprovalValidationError struct {
Err error
}
func (*RequestApprovalValidationError) Error ¶
func (e *RequestApprovalValidationError) Error() string
func (*RequestApprovalValidationError) Unwrap ¶
func (e *RequestApprovalValidationError) Unwrap() error
type ReviewComment ¶
type ReviewComment struct {
// Path is the file path relative to the repo root.
Path string `json:"path"`
// Line is the line number in the diff (new file line number).
Line int `json:"line"`
// Body is the comment text.
Body string `json:"body"`
}
ReviewComment represents a line-level review comment on a PR diff.
type ReviewPullRequestArgs ¶
type ReviewPullRequestArgs struct {
// TaskName is an optional task to read workspace config and credentials from.
TaskName string `json:"task_name,omitempty"`
// RepoURL is an optional GitHub repository URL.
RepoURL string `json:"repo_url,omitempty"`
// PRNumber is the GitHub PR number to review.
PRNumber int `json:"pr_number"`
}
ReviewPullRequestArgs are the arguments for the review_pull_request tool.
type ReviewPullRequestResult ¶
type ReviewPullRequestResult struct {
PRTitle string `json:"pr_title"`
PRBody string `json:"pr_body"`
PRAuthor string `json:"pr_author"`
BaseBranch string `json:"base_branch"`
HeadBranch string `json:"head_branch"`
Diff string `json:"diff"`
Files []FileChange `json:"files"`
Status string `json:"status"`
}
ReviewPullRequestResult is the result of fetching a pull request for review.
type ReviewPullRequestTool ¶
type ReviewPullRequestTool struct {
// contains filtered or unexported fields
}
ReviewPullRequestTool fetches a GitHub PR's diff and file changes for LLM review.
func NewReviewPullRequestTool ¶
func NewReviewPullRequestTool(k8sClient client.Client) *ReviewPullRequestTool
NewReviewPullRequestTool creates a new review_pull_request tool.
func (*ReviewPullRequestTool) Description ¶
func (t *ReviewPullRequestTool) Description() string
Description returns the tool description.
func (*ReviewPullRequestTool) Execute ¶
func (t *ReviewPullRequestTool) Execute(ctx context.Context, argsJSON json.RawMessage) (string, error)
Execute fetches a pull request's diff and file changes from GitHub.
func (*ReviewPullRequestTool) Name ¶
func (t *ReviewPullRequestTool) Name() string
Name returns the tool name.
func (*ReviewPullRequestTool) Parameters ¶
func (t *ReviewPullRequestTool) Parameters() json.RawMessage
Parameters returns the JSON schema for tool parameters.
type RunValidationTool ¶ added in v0.2.0
type RunValidationTool struct {
// contains filtered or unexported fields
}
RunValidationTool creates one tightly scoped validation Task for a controller-owned repository monitor review. The caller chooses the shell command, while the controller fixes the image and exact source checkout.
func NewRunValidationTool ¶ added in v0.2.0
func NewRunValidationTool(k8sClient client.Client) *RunValidationTool
func (*RunValidationTool) Description ¶ added in v0.2.0
func (t *RunValidationTool) Description() string
func (*RunValidationTool) Execute ¶ added in v0.2.0
func (t *RunValidationTool) Execute(ctx context.Context, raw json.RawMessage) (string, error)
func (*RunValidationTool) Name ¶ added in v0.2.0
func (t *RunValidationTool) Name() string
func (*RunValidationTool) Parameters ¶ added in v0.2.0
func (t *RunValidationTool) Parameters() json.RawMessage
type RuntimeArgs ¶
type RuntimeArgs struct {
Type string `json:"type"`
SecretRef string `json:"secretRef,omitempty"`
DefaultAllowedTools []string `json:"defaultAllowedTools,omitempty"`
DefaultAllowBash *bool `json:"defaultAllowBash,omitempty"`
}
RuntimeArgs specifies agent CLI runtime configuration
type SearchTranscriptTool ¶
type SearchTranscriptTool struct{}
SearchTranscriptTool searches prior session transcripts in the current namespace.
func NewSearchTranscriptTool ¶
func NewSearchTranscriptTool() *SearchTranscriptTool
NewSearchTranscriptTool creates a new search_transcript tool.
func (*SearchTranscriptTool) Description ¶
func (t *SearchTranscriptTool) Description() string
Description returns the tool description.
func (*SearchTranscriptTool) Execute ¶
func (t *SearchTranscriptTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute searches transcript snippets through the controller's internal API.
func (*SearchTranscriptTool) Name ¶
func (t *SearchTranscriptTool) Name() string
Name returns the tool name.
func (*SearchTranscriptTool) Parameters ¶
func (t *SearchTranscriptTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for the tool parameters.
type SendMessageArgs ¶
SendMessageArgs are the arguments for the send_message tool
type SendMessageTool ¶
type SendMessageTool struct{}
SendMessageTool implements inter-agent messaging
func NewSendMessageTool ¶
func NewSendMessageTool() *SendMessageTool
NewSendMessageTool creates a new send message tool
func (*SendMessageTool) Description ¶
func (t *SendMessageTool) Description() string
Description returns the tool description
func (*SendMessageTool) Execute ¶
func (t *SendMessageTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute sends a message to a sibling task via the controller's internal API
func (*SendMessageTool) Parameters ¶
func (t *SendMessageTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for the tool parameters
type TaskMessageStore ¶ added in v0.2.0
type TaskMessageStore interface {
SendMessage(context.Context, *store.Message) error
GetMessages(context.Context, string, string, string, bool) ([]store.Message, error)
}
TaskMessageStore exposes only message send and inbox access to tools. Brokered contexts must supply an implementation bound to the authenticated Task.
type TaskResultInfo ¶
type TaskResultInfo struct {
Task string `json:"task"`
Agent string `json:"agent,omitempty"`
Phase string `json:"phase"`
Result string `json:"result,omitempty"`
Summary string `json:"summary,omitempty"`
Verdict string `json:"verdict,omitempty"`
Feedback string `json:"feedback,omitempty"`
Files []string `json:"files,omitempty"`
Data map[string]any `json:"data,omitempty"`
Artifacts []common.ArtifactRef `json:"artifacts,omitempty"`
BaseSHA string `json:"baseSHA,omitempty"`
HeadSHA string `json:"headSHA,omitempty"`
PushBranch string `json:"pushBranch,omitempty"`
WorkspaceRef string `json:"workspaceRef,omitempty"`
WorkspaceBranch string `json:"workspaceBranch,omitempty"`
Iteration string `json:"iteration,omitempty"`
FailureDetails *FailureDetails `json:"failureDetails,omitempty"`
Retried bool `json:"retried,omitempty"`
RetryTaskName string `json:"retryTaskName,omitempty"`
ExecutionOutcome *corev1alpha1.TaskWorkloadExecutionOutcome `json:"executionOutcome,omitempty"`
WorkspaceStatus *corev1alpha1.ExecutionWorkspaceStatus `json:"workspaceStatus,omitempty"`
Delivery *corev1alpha1.TaskDeliveryStatus `json:"delivery,omitempty"`
}
TaskResultInfo holds individual task result information
type Tool ¶
type Tool interface {
// Name returns the tool name
Name() string
// Description returns the tool description for the LLM
Description() string
// Parameters returns the JSON Schema for the tool parameters
Parameters() json.RawMessage
// Execute executes the tool with the given arguments
Execute(ctx context.Context, args json.RawMessage) (string, error)
}
Tool is the interface for built-in tools
type ToolContext ¶
type ToolContext struct {
Client client.Client
// PolicyReader bypasses informer lag when coordination tools resolve Task,
// Agent, Provider, Tool, and AgentRuntime policy. Writes continue through Client.
PolicyReader client.Reader
KubeClient kubernetes.Interface
Namespace string
SessionID string
TaskID string
TaskUID string
ParentTaskID string
AgentName string
ToolCallID string
OperationID string
Tenant string
Provider string
ProviderType string
ExecutionMode executionmode.Mode
WatchNamespace string
EnforceNamespaceIsolation bool
// Brokered marks an authenticated controller-side MCP broker execution.
// Broker-aware tools must fail closed on missing request-scoped dependencies
// instead of falling back to controller process environment or credentials.
Brokered bool
// TaskProvenanceProtected reports that Task provenance admission reserves
// controller-authenticated lineage metadata from direct namespace writes.
TaskProvenanceProtected bool
// ExternalEffects and OperationID let brokered coordination tools bind
// created resources to the controller-owned effect receipt for this exact
// tool call. The receipt remains authoritative when provenance admission is
// disabled and Task metadata is mutable.
ExternalEffects store.ExternalEffectStore
// Least-privilege durable dependencies for brokered memory tools.
MemoryReader MemoryReader
MemoryProposalWriter MemoryProposalWriter
TranscriptSearcher TranscriptSearcher
// RepositoryValidationBindings stores the controller-owned command binding
// created before a repository validation Task.
RepositoryValidationBindings RepositoryValidationBindingStore
// ResultStore for fetching task outputs (store.ResultStore)
ResultStore interface {
GetResult(ctx context.Context, namespace, taskName string) ([]byte, error)
}
// MessageStore for inter-agent messaging when tools execute in-process from the controller broker.
MessageStore TaskMessageStore
// SessionDeleter for deleting sessions (controller.SessionManager)
SessionDeleter interface {
DeleteSession(ctx context.Context, namespace, sessionID string) error
}
// Task creation helpers provided by the chat executor
GenerateTaskName func() string
TaskLabels func() map[string]string
CheckTaskLimit func() *ChatToolError
AuthorizeTaskCreate func(context.Context, *corev1alpha1.Task) *ChatToolError
AuthorizeTaskDelete func(context.Context, *corev1alpha1.Task) *ChatToolError
AuthorizeAgentCreate func(context.Context, *corev1alpha1.Agent) *ChatToolError
// AuthorizeAgentInitialTask preflights the combined Agent/Task operation
// before creating the Agent. Full Task authorization still runs later.
AuthorizeAgentInitialTask func(context.Context, *corev1alpha1.Agent) *ChatToolError
AuthorizeAgentUpdate func(context.Context, *corev1alpha1.Agent) *ChatToolError
AuthorizeAgentDelete func(context.Context, *corev1alpha1.Agent) *ChatToolError
AuthorizeSecretRead func(context.Context, string, string) *ChatToolError
AuthorizePodLogs func(context.Context, string, string) error
// AuthorizeCodeExecResources checks creation and cleanup permissions for
// the complete temporary resource set before code_exec creates anything.
AuthorizeCodeExecResources func(context.Context, []client.Object) error
RequireSecretReadAuthorization bool
// RequireGitHubTaskCredentials disables controller-global repository and
// credential fallback for external GitHub tool calls.
RequireGitHubTaskCredentials bool
IncrementTasks func()
ApprovalEmitter func(context.Context, approvals.ApprovalTarget) error
ApprovalTargetSpecDigest func(context.Context, string) (string, error)
ApprovalTargetArguments func(context.Context, string, json.RawMessage) (json.RawMessage, error)
ApprovalTargetRefresh func(context.Context, string, *corev1alpha1.Tool) error
}
ToolContext provides dependencies for tools that need K8s client access or other services.
func GetToolContext ¶
func GetToolContext(ctx context.Context) *ToolContext
GetToolContext extracts a ToolContext from a context.
type TranscriptSearcher ¶ added in v0.2.0
type TranscriptSearcher interface {
SearchTranscript(context.Context, store.TranscriptSearchFilter) ([]store.TranscriptSearchResult, error)
}
TranscriptSearcher is the least-privilege store dependency required by search_transcript.
type UpdateAgentTool ¶
type UpdateAgentTool struct{}
UpdateAgentTool updates an existing Agent CRD.
func (*UpdateAgentTool) Description ¶
func (t *UpdateAgentTool) Description() string
func (*UpdateAgentTool) Execute ¶
func (t *UpdateAgentTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*UpdateAgentTool) Name ¶
func (t *UpdateAgentTool) Name() string
func (*UpdateAgentTool) Parameters ¶
func (t *UpdateAgentTool) Parameters() json.RawMessage
type UpdatePlanTool ¶
type UpdatePlanTool struct{}
UpdatePlanTool allows the LLM to update the autonomous plan state.
func NewUpdatePlanTool ¶
func NewUpdatePlanTool() *UpdatePlanTool
NewUpdatePlanTool creates a new UpdatePlanTool.
func (*UpdatePlanTool) Description ¶
func (t *UpdatePlanTool) Description() string
Description returns the tool description for the LLM.
func (*UpdatePlanTool) Execute ¶
func (t *UpdatePlanTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute saves the plan state via the controller's internal API.
func (*UpdatePlanTool) Parameters ¶
func (t *UpdatePlanTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for the tool parameters.
type WaitForTaskTool ¶
type WaitForTaskTool struct{}
WaitForTaskTool waits for a single task to complete.
func (*WaitForTaskTool) Description ¶
func (t *WaitForTaskTool) Description() string
func (*WaitForTaskTool) Execute ¶
func (t *WaitForTaskTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
func (*WaitForTaskTool) Name ¶
func (t *WaitForTaskTool) Name() string
func (*WaitForTaskTool) Parameters ¶
func (t *WaitForTaskTool) Parameters() json.RawMessage
type WaitForTasksArgs ¶
type WaitForTasksArgs struct {
Tasks []string `json:"tasks"`
Timeout string `json:"timeout,omitempty"`
}
WaitForTasksArgs are the arguments for the wait_for_tasks tool
type WaitForTasksResult ¶
type WaitForTasksResult struct {
Completed bool `json:"completed"`
Results []TaskResultInfo `json:"results"`
}
WaitForTasksResult represents the aggregated result
type WaitForTasksTool ¶
type WaitForTasksTool struct {
// contains filtered or unexported fields
}
WaitForTasksTool implements waiting for child tasks to complete
func NewWaitForTasksTool ¶
func NewWaitForTasksTool(k8sClient client.Client) *WaitForTasksTool
NewWaitForTasksTool creates a new wait_for_tasks tool
func (*WaitForTasksTool) Description ¶
func (t *WaitForTasksTool) Description() string
Description returns the tool description
func (*WaitForTasksTool) Execute ¶
func (t *WaitForTasksTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute waits for the specified tasks to complete and returns their results
func (*WaitForTasksTool) Parameters ¶
func (t *WaitForTasksTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for parameters
type WebFetchArgs ¶
type WebFetchArgs struct {
URL string `json:"url"`
MaxChars int `json:"max_chars,omitempty"`
Raw bool `json:"raw,omitempty"`
}
WebFetchArgs are the arguments for the web fetch tool
type WebFetchResult ¶
type WebFetchResult struct {
URL string `json:"url"`
Status int `json:"status"`
Content string `json:"content"`
Length int `json:"length"`
Truncated bool `json:"truncated"`
Extractor string `json:"extractor"`
}
WebFetchResult represents the fetch result
type WebFetchTool ¶
type WebFetchTool struct {
// contains filtered or unexported fields
}
WebFetchTool implements URL content fetching and extraction
func NewBrokeredWebFetchTool ¶ added in v0.2.0
func NewBrokeredWebFetchTool() *WebFetchTool
NewBrokeredWebFetchTool creates the bounded web fetch implementation exposed through the controller MCP broker.
func NewWebFetchTool ¶
func NewWebFetchTool() *WebFetchTool
NewWebFetchTool creates a new web fetch tool
func (*WebFetchTool) Description ¶
func (t *WebFetchTool) Description() string
Description returns the tool description
func (*WebFetchTool) Execute ¶
func (t *WebFetchTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute fetches the URL and extracts content
func (*WebFetchTool) Parameters ¶
func (t *WebFetchTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for parameters
type WebSearchArgs ¶
WebSearchArgs are the arguments for the web search tool
type WebSearchResult ¶
type WebSearchResult struct {
Title string `json:"title"`
URL string `json:"url"`
Snippet string `json:"snippet"`
}
WebSearchResult represents a search result
type WebSearchTool ¶
type WebSearchTool struct {
// contains filtered or unexported fields
}
WebSearchTool implements web search functionality
func NewBrokeredWebSearchTool ¶ added in v0.2.0
func NewBrokeredWebSearchTool() *WebSearchTool
NewBrokeredWebSearchTool creates a credential-free web search tool for the controller MCP broker. It intentionally ignores worker search configuration and permits only direct connections to public endpoints.
func NewWebSearchTool ¶
func NewWebSearchTool() *WebSearchTool
NewWebSearchTool creates a new web search tool
func (*WebSearchTool) Description ¶
func (t *WebSearchTool) Description() string
Description returns the tool description
func (*WebSearchTool) Execute ¶
func (t *WebSearchTool) Execute(ctx context.Context, args json.RawMessage) (string, error)
Execute performs the web search
func (*WebSearchTool) Parameters ¶
func (t *WebSearchTool) Parameters() json.RawMessage
Parameters returns the JSON Schema for parameters
type WorkspaceArgs ¶
type WorkspaceArgs struct {
Intent string `json:"intent,omitempty"`
GitRepo string `json:"gitRepo,omitempty"`
Branch string `json:"branch,omitempty"`
Ref string `json:"ref,omitempty"`
ReadCredentialRef string `json:"readCredentialRef,omitempty"`
PublicationGitRepo string `json:"publicationGitRepo,omitempty"`
PublicationReadCredentialRef string `json:"publicationReadCredentialRef,omitempty"`
PublicationCredentialRef string `json:"publicationCredentialRef,omitempty"`
ForgeCredentialRef string `json:"forgeCredentialRef,omitempty"`
PushBranch string `json:"pushBranch,omitempty"`
PRBaseBranch string `json:"prBaseBranch,omitempty"`
CreatePR bool `json:"createPR,omitempty"`
}
WorkspaceArgs specifies a git workspace for agent runtime tasks
Source Files
¶
- agent_model_update.go
- agent_runtime_policy.go
- authorize_agent_create.go
- authorize_mutations.go
- authorize_task_create.go
- auto_merge_pull_request.go
- cancel_task.go
- chat_cancel_task.go
- chat_create_agent.go
- chat_delete_agent.go
- chat_helpers.go
- check_messages.go
- check_pr_review_marker.go
- check_pull_request_ci.go
- check_task_progress.go
- code_exec.go
- code_exec_kubernetes.go
- code_exec_platform_unix.go
- comment_on_issue.go
- common_constants.go
- create_agent.go
- create_agent_task.go
- create_ai_task.go
- create_container_task.go
- create_pr_monitor.go
- create_pull_request.go
- create_tool_crd.go
- delegate_task.go
- delete_agent.go
- delete_session.go
- delete_tool.go
- fetch_task_output.go
- file_read.go
- file_write.go
- get_issue.go
- github_helpers.go
- github_pull_requests.go
- list_agents.go
- list_issues.go
- list_pull_requests.go
- list_tasks.go
- list_tools.go
- memory_tools.go
- merge_pull_request.go
- opencode_model_validation.go
- post_review_comment.go
- provenance.go
- registry.go
- repository_validation_binding.go
- request_approval.go
- review_pull_request.go
- run_validation.go
- secret_resolution.go
- send_message.go
- transaction_context_authorization.go
- transaction_token.go
- update_agent.go
- update_plan.go
- wait_for_task.go
- wait_for_tasks.go
- web_fetch.go
- web_search.go