pluginsdk

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Kandev Go plugin SDK

Module: github.com/kdlbs/kandev/pluginsdk. The shared Go/npm SDK version starts at 0.1.0 and is independent of the Kandev host version. Public availability requires a successful Stable SDK release; an untagged checkout with null host metadata is not a published SDK.

After public verification:

go get github.com/kdlbs/kandev/pluginsdk@v0.1.0
import "github.com/kdlbs/kandev/pluginsdk"

func main() { pluginsdk.Serve(&pluginsdk.UnimplementedPlugin{}) }

Read sdk-release.json for the originating host, whole-SDK host floor, and supported manifest API versions. Run the checker in the consumer project:

go run github.com/kdlbs/kandev/pluginsdk/cmd/kandev-sdk-check@v0.1.0 --manifest manifest.yaml

For a frontend dependency, add --frontend-sdk node_modules/@kdlbs/plugin-sdk. The checker reads installed versions and rejects local SDK substitutions. It does not edit project files. Keep exact dependency pins and commit lockfiles.

See the public authoring guide for migration, compatibility, permissions, and packaging. The source move preserves the existing handshake and wire contract. Old source imports need migration; already built binaries retain their existing runtime contract.

Contributors run go test -race ./..., go vet ./..., and make proto from this module. The host's local replacement is a development dependency, not a plugin release pattern. The SDK is licensed under AGPL-3.0-only; see LICENSE.

Documentation

Overview

data_types.go defines the Go-native mirrors of the Host data API messages (ADR 0043: docs/decisions/0043-plugin-host-data-api.md) plus the proto<->Go conversion helpers used by host.go's data accessors. As with the rest of types.go, authors and kandev's runtime manager only ever see these Go-native structs; the pluginv1 message types never leak past the package boundary.

Conventions (mirroring the wire contract):

  • Timestamps are RFC3339 strings, matching the JSON API and Event envelope.
  • Optional/nullable fields use *string, matching proto3 `optional`, so "absent" is distinguishable from "empty".
  • Free-form metadata uses map[string]any via mapToStruct/structToMap, exactly like StateEntry.Value and Event.Payload.

host.go implements the Host side of the kandev.plugin.v1.Host service (§3 of docs/plans/plugins/GRPC-CONTRACT.md) in both directions:

  • grpcHostClient: used inside the plugin subprocess. Wraps a pluginv1.HostClient dialed over the go-plugin broker (see serve.go) and satisfies the Go-native Host interface that Serve injects into the author's Plugin.
  • grpcHostServer: used inside kandev. Wraps kandev's own Go-native Host implementation (state store, secrets, event bus) and satisfies the generated pluginv1.HostServer interface so it can be registered on the broker-served grpc.Server that GRPCPlugin.GRPCClient spins up (see serve.go's "Host injection" section).

Both directions share the same Go-native Host interface and the same proto conversion helpers in types.go, so kandev's runtime manager implements Host exactly once and gets both the client and server wiring for free via GRPCPlugin.

interactions.go is the Go-native side of the Host interaction API (ADR 0052): the durable record of every agent request still owed a human answer, plus the capability-gated writes that answer them.

It exists because session state cannot answer "does a human owe this session something?". WAITING_FOR_INPUT also describes an ordinarily completed turn, so a state-only plugin reports attention nobody owes. Events alone cannot answer it either — a plugin may start after the request, restart, or drop an event. Only the durable record can, which is what ListPending returns and what Get resolves for any id, terminal ones included.

Like ExecutorProfileHost and PluginOwnedTaskTreeHost, this is an OPTIONAL Host extension rather than a method on Host itself, so every existing Go-native Host implementation stays source-compatible.

serve.go wires plugin authors (via Serve) and kandev's runtime manager (via the exported GRPCPlugin type) onto hashicorp/go-plugin, per §2/§3 of docs/plans/plugins/GRPC-CONTRACT.md.

Host injection

The frozen Plugin service (§3) has no RPC for negotiating a broker ID, so the two sides can't use go-plugin's usual "allocate an ID and pass it in the request" bidirectional pattern for the Host service. Instead they agree on a constant, hostBrokerID:

  • kandev (host side, GRPCPlugin.GRPCClient — called once when kandev dispenses the plugin) starts serving its own Host implementation on hostBrokerID via broker.AcceptAndServe.
  • The plugin subprocess (GRPCPlugin.GRPCServer — called once at subprocess startup, before the process has even accepted a connection from kandev) cannot dial hostBrokerID synchronously: the broker's control stream to kandev doesn't exist yet, so a blocking Dial here would deadlock startup. It instead spawns a background goroutine that retries broker.Dial(hostBrokerID) with backoff until it succeeds or HostDialTimeout elapses, then injects the resulting Host into Impl via the optional HostSetter interface — UnimplementedPlugin implements HostSetter, so embedding it is enough to opt in. A Plugin that doesn't implement HostSetter simply never receives a Host (fine for plugins that don't need one).

GRPCPlugin is exported specifically so kandev's runtime manager can reuse it on the host side with plugin.NewClient — see the GRPCPlugin doc comment for the exact wiring.

Package pluginsdk is the author-facing SDK for kandev plugin backends, and the shared wiring kandev's own runtime manager imports to spawn and talk to those plugins. See docs/plans/plugins/GRPC-CONTRACT.md §4 for the frozen public surface this package implements.

types.go defines the Go-native mirrors of the kandev.plugin.v1 proto messages (using map[string]any in place of google.protobuf.Struct) plus the proto<->Go conversion helpers used by every other file in this package. Authors and kandev's runtime manager only ever see these Go-native types; proto types from github.com/kdlbs/kandev/pluginsdk/proto/kandev/plugin/v1 never leak past the package boundary.

Index

Constants

View Source
const (
	HumanResponseKindPermission    = "permission"
	HumanResponseKindClarification = "clarification"
	HumanResponseKindStepApproval  = "step_approval"
)

Human response kinds a linked Kandev user can authorize through a plugin.

View Source
const (
	InteractionKindPermission    = "permission"
	InteractionKindClarification = "clarification"
)

Interaction kind values. A plugin should compare against these rather than bare strings; new kinds are additive.

View Source
const (
	InteractionStatusPending   = "pending"
	InteractionStatusApproved  = "approved"
	InteractionStatusRejected  = "rejected"
	InteractionStatusAnswered  = "answered"
	InteractionStatusCancelled = "cancelled"
	InteractionStatusExpired   = "expired"
)

Interaction status values. Anything other than InteractionStatusPending is terminal: the interaction can no longer be answered, and a write against it returns a gRPC FailedPrecondition.

View Source
const (
	MaxSidebarGroupingResponseBytes = 1 << 20
	MaxSidebarGroupingValues        = 1000
	MaxSidebarGroupingMemberships   = 10000
)
View Source
const MaxExecutorRuntimeArtifactChunkBytes = 256 << 10
View Source
const PluginMapKey = "plugin"

PluginMapKey is the go-plugin plugin-map key both Serve (plugin side) and kandev's runtime manager (host side, plugin.ClientConfig.Plugins) use.

Variables

View Source
var Handshake = hcplugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "KANDEV_PLUGIN",
	MagicCookieValue: "kandev-plugin-v1",
}

Handshake is the go-plugin handshake shared by kandev and every plugin backend (§2 of docs/plans/plugins/GRPC-CONTRACT.md). Both sides must use this exact value — Serve uses it automatically; kandev's runtime manager must set it on plugin.ClientConfig.HandshakeConfig.

Functions

func ActionErrorHTTPStatus

func ActionErrorHTTPStatus(code ActionErrorCode) int

ActionErrorHTTPStatus is the shared action-category projection used by plugins. Unknown future categories fail closed as an upstream failure.

func CategorizeActionError

func CategorizeActionError(code ActionErrorCode, err error) error

CategorizeActionError wraps err without flattening its cause.

func CategorizeActionErrorWithRetry

func CategorizeActionErrorWithRetry(code ActionErrorCode, retryAfter string, err error) error

CategorizeActionErrorWithRetry also projects a provider-neutral Retry-After value without flattening the original error.

func HostCallReference

func HostCallReference(ctx context.Context) string

HostCallReference returns only a reference restored by the Host interceptor. Event payloads and plugin-supplied task IDs cannot install this value.

func ParseSidebarGroupingReference added in v0.4.0

func ParseSidebarGroupingReference(value string) (pluginID, groupingID string, ok bool)

ParseSidebarGroupingReference accepts a persisted provider identity without consulting the live plugin registry. Disabled providers retain their views.

func Serve

func Serve(p Plugin, opts ...Option)

Serve wires p up as a kandev plugin backend and blocks until the process is terminated by kandev. It owns all go-plugin/grpc plumbing: the handshake (Handshake), the plugin map (PluginMapKey), and the Host broker dial + injection described in the file header.

func UnidentifiedEventContext

func UnidentifiedEventContext(ctx context.Context) context.Context

UnidentifiedEventContext preserves notification delivery without granting domain Host authority when the event's live origin can no longer be resolved.

func ValidateNotificationFormat added in v0.3.0

func ValidateNotificationFormat(result *NotificationFormatResponse) error

ValidateNotificationFormat checks the entire replacement pair without including personal content in an error. Both peers enforce this boundary.

Types

type ActionError

type ActionError struct {
	Code       ActionErrorCode
	RetryAfter string
	Err        error
}

ActionError preserves a machine-readable category and optional retry hint. Plugins should return sanitized response bodies; Err is retained only for errors.Is/errors.As and local diagnostics.

func (*ActionError) Error

func (e *ActionError) Error() string

func (*ActionError) Unwrap

func (e *ActionError) Unwrap() error

type ActionErrorCode

type ActionErrorCode string

ActionErrorCode is a transport-independent failure category plugins can use when turning domain errors into stable action responses.

const (
	ActionErrorInvalidArgument  ActionErrorCode = "invalid_argument"
	ActionErrorUnauthenticated  ActionErrorCode = "unauthenticated"
	ActionErrorPermissionDenied ActionErrorCode = "permission_denied"
	ActionErrorNotFound         ActionErrorCode = "not_found"
	ActionErrorConflict         ActionErrorCode = "conflict"
	ActionErrorRateLimited      ActionErrorCode = "rate_limited"
	ActionErrorUnavailable      ActionErrorCode = "unavailable"
	ActionErrorUpstream         ActionErrorCode = "upstream"
)

type ActionHandler

type ActionHandler interface {
	HandleAction(context.Context, *PluginActionRequest) (*PluginActionResponse, error)
}

ActionHandler is an optional browser-action extension. Keeping it separate from Plugin preserves source compatibility for plugins that only handle events and public webhooks.

type AgentConversationDescriptor

type AgentConversationDescriptor struct {
	TaskID          string
	SessionID       string
	WorkspaceID     string
	ConversationKey string
	AgentProfileID  string
}

AgentConversationDescriptor identifies an existing conversation.

type AgentConversationDispatch

type AgentConversationDispatch struct {
	SessionID  string
	Status     string
	Descriptor AgentConversationDescriptor
}

AgentConversationDispatch is the outcome of DispatchAgentConversation.

type AgentConversationHost

type AgentConversationHost interface {
	AgentConversations() AgentConversationManager
}

AgentConversationHost is an optional Host extension for managing workspace agent conversations. It is kept separate from Host so existing host implementations remain source-compatible.

type AgentConversationManager

type AgentConversationManager interface {
	// Ensure creates or repairs one conversation per (workspace_id, conversation_key).
	// Returns the existing descriptor when one already exists for this
	// plugin/workspace/key. Returns a typed configuration-required result
	// (status="configuration_required") when the referenced agent profile is
	// missing, disabled, or incompatible — the conversation is neither created
	// nor dispatched until the operator resolves the profile.
	Ensure(ctx context.Context, spec AgentConversationSpec) (AgentConversationDescriptor, string, error)

	// Dispatch sends text to an ensured conversation. OccurrenceKey provides
	// stable idempotency: a key that was already claimed returns the prior
	// dispatch result. Returns status "duplicate_occurrence" when
	// occurrence_key matches a previously dispatched occurrence (same session
	// for in-flight turns, skipped for busy-session coalesced drops).
	// Returns "skipped_busy" when the session is mid-turn and the dispatch
	// was coalesced rather than queued.
	Dispatch(ctx context.Context, workspaceID, conversationKey, text, occurrenceKey string) (AgentConversationDispatch, error)

	// Delete removes all conversations matching the workspace and key owned
	// by this plugin. Returns the count of deleted conversations.
	Delete(ctx context.Context, workspaceID, conversationKey string) (int32, error)
}

AgentConversationManager is the interface for managing workspace agent conversations. It lets a plugin create (or find), dispatch to, and delete a hidden workflowless ephemeral task/session per (plugin_id, workspace_id, conversation_key).

func AgentConversations

func AgentConversations(host Host) (AgentConversationManager, bool)

AgentConversations returns the optional agent conversation manager.

type AgentConversationSpec

type AgentConversationSpec struct {
	WorkspaceID     string
	ConversationKey string
	BasePrompt      string
	AgentProfileID  string
}

AgentConversationSpec controls how Ensure creates a conversation.

type AgentProfile

type AgentProfile struct {
	ID          string
	AgentID     string
	DisplayName string
	Name        string
	Model       string
	Mode        string
}

AgentProfile is the Go-native mirror of kandev.plugin.v1.AgentProfile.

type AgentProfileReader

type AgentProfileReader interface {
	List(ctx context.Context, page Page) ([]AgentProfile, *PageInfo, error)
}

AgentProfileReader is the read-only accessor behind Host.AgentProfiles(), mirroring the Host data API's ListAgentProfiles RPC.

type AgentToolContext

type AgentToolContext struct {
	TaskID               string
	SessionID            string
	WorkspaceID          string
	Surface              string
	ExecutionID          string
	InstallationID       string
	ConversationRevision uint64
	ApprovalRevision     uint64
	ManifestDigest       string
	AgentToolNames       []string
}

AgentToolContext is the host-owned invocation identity. Surface is one of kanban-task, office-task, managed-conversation, automation, coordinator, or external. TaskID, SessionID, and WorkspaceID are empty for an external instance read; an external workspace read carries only the host-verified WorkspaceID. Task-backed contexts are always derived from the running execution, never from tool arguments.

type AgentToolPlugin

type AgentToolPlugin interface {
	InvokeAgentTool(context.Context, *AgentToolRequest) (*AgentToolResult, error)
}

AgentToolPlugin is an optional extension implemented by plugins that declare agent_tools in their manifest. Keeping it separate from Plugin preserves source compatibility for existing plugins.

type AgentToolRequest

type AgentToolRequest struct {
	InvocationID string
	Name         string
	Arguments    map[string]any
	Context      AgentToolContext
}

type AgentToolResult

type AgentToolResult struct {
	Text              string
	StructuredContent map[string]any
	IsError           bool
}

type AttachExecutorEnvironmentRequest

type AttachExecutorEnvironmentRequest = pluginv1.AttachExecutorEnvironmentRequest

type AttachExecutorEnvironmentResponse

type AttachExecutorEnvironmentResponse = pluginv1.AttachExecutorEnvironmentResponse

type AuthorizeEntityReferenceRequest

type AuthorizeEntityReferenceRequest struct {
	Source      string
	WorkspaceID string
	Purpose     string
	Reference   map[string]any
}

AuthorizeEntityReferenceRequest asks a live plugin to approve a canonical reference for search or final message submission.

type AuthorizeEntityReferenceResponse

type AuthorizeEntityReferenceResponse struct {
	Allowed bool
	Reason  string
}

type AutomationAdapter

type AutomationAdapter interface {
	DescribeAutomationCondition(context.Context, *AutomationConditionRequest) (*AutomationConditionResponse, error)
	VerifyAutomationWebhook(context.Context, *AutomationWebhookRequest) (*AutomationWebhookResponse, error)
}

AutomationAdapter is an optional provider-owned verification capability. A response cannot select an automation destination: the host binds that authority.

type AutomationConditionRequest

type AutomationConditionRequest = pluginv1.AutomationConditionRequest

type AutomationConditionResponse

type AutomationConditionResponse = pluginv1.AutomationConditionResponse

type AutomationDefinitionFilter

type AutomationDefinitionFilter struct {
	AutomationID  string
	CreatedFrom   *string
	CreatedBefore *string
}

AutomationDefinitionFilter narrows a definition snapshot. CreatedFrom is inclusive and CreatedBefore is exclusive; nil bounds are omitted. Times are UTC RFC3339Nano strings.

type AutomationDefinitionObservation

type AutomationDefinitionObservation struct {
	ID              string
	WorkspaceID     string
	Name            string
	Enabled         bool
	CreatedAt       string
	UpdatedAt       string
	ResourceVersion string
	ObservedAt      string
	Triggers        []AutomationTriggerObservation
}

type AutomationDefinitionPage

type AutomationDefinitionPage struct {
	Items    []AutomationDefinitionObservation
	PageInfo ExactReadPageInfo
}

type AutomationDefinitionQuery

type AutomationDefinitionQuery struct {
	RequestID   string
	WorkspaceID string
	Filter      AutomationDefinitionFilter
	Page        ExactReadPage
}

type AutomationHistoryHost

type AutomationHistoryHost interface {
	AutomationHistory() AutomationHistoryReader
}

AutomationHistoryHost is an optional Host extension. The base Host interface stays unchanged so existing implementations keep working.

type AutomationHistoryReader

AutomationHistoryReader is the optional workspace-authorized automation history reader.

func HostAutomationHistory

func HostAutomationHistory(host Host) (AutomationHistoryReader, bool)

HostAutomationHistory reports whether host exposes the optional automation history reader. A remote Host wrapper always reports true; a call against an older server then fails with Unimplemented.

type AutomationRunFilter

type AutomationRunFilter struct {
	AutomationID  string
	CreatedFrom   *string
	CreatedBefore *string
}

AutomationRunFilter narrows a run snapshot. CreatedFrom is inclusive and CreatedBefore is exclusive; nil bounds are omitted. Times are UTC RFC3339Nano strings.

type AutomationRunGetQuery

type AutomationRunGetQuery struct {
	RequestID   string
	WorkspaceID string
	RunID       string
}

type AutomationRunObservation

type AutomationRunObservation struct {
	ID                    string
	WorkspaceID           string
	AutomationID          string
	AutomationName        string
	TriggerID             string
	TriggerKind           string
	TaskID                string
	SessionID             string
	TurnID                string
	ManagedConversationID string
	SourceStatus          string
	Status                string
	RetryState            string
	DeliveryStatus        string
	RetryGroupID          string
	RetryParentRunID      string
	AttemptNumber         *int64
	CreatedAt             string
	RetryScheduledAt      *string
	RetryClaimedAt        *string
	Summary               string
	ErrorExcerpt          string
	ResourceVersion       string
	ObservedAt            string
}

AutomationRunObservation preserves source status and observed status separately. Status values remain strings so unknown source values survive transport. A nil attempt number means the source did not record one.

type AutomationRunPage

type AutomationRunPage struct {
	Items    []AutomationRunObservation
	PageInfo ExactReadPageInfo
}

type AutomationRunQuery

type AutomationRunQuery struct {
	RequestID   string
	WorkspaceID string
	Filter      AutomationRunFilter
	Page        ExactReadPage
}

type AutomationTriggerObservation

type AutomationTriggerObservation struct {
	ID                string
	Kind              string
	Enabled           bool
	CronExpression    string
	Timezone          *string
	ScheduleAvailable bool
}

AutomationTriggerObservation is the safe public trigger projection. CronExpression and Timezone are only meaningful when ScheduleAvailable is true; an absent configured timezone stays nil.

type AutomationWebhookRequest

type AutomationWebhookRequest = pluginv1.AutomationWebhookRequest

type AutomationWebhookResponse

type AutomationWebhookResponse = pluginv1.AutomationWebhookResponse

type CapabilityContext

type CapabilityContext struct {
	InstallationID     string
	WorkspaceID        string
	ManifestDigest     string
	ApprovalRevision   uint64
	ApprovalState      string
	Operations         []CapabilityOperation
	Limits             map[string]uint64
	SupportedProviders []string
}

CapabilityContext describes the exact Host operations available to this installation in one workspace and the approval revision used to evaluate them.

type CapabilityOperation

type CapabilityOperation struct {
	Method            string
	CapabilityID      string
	Description       string
	Supported         bool
	Authorized        bool
	UnavailableReason string
}

CapabilityOperation reports one exact Host method, whether the host can serve it, and whether this workspace currently authorizes it.

type ChangeRequestEvidence

type ChangeRequestEvidence struct {
	TaskID                  string
	Provider                string
	RepositoryID            string
	RepositoryOwner         string
	RepositoryName          string
	Number                  int64
	URL                     string
	HeadRevision            string
	ReviewState             string
	ChecksState             string
	MergeableState          string
	UnresolvedReviewThreads int32
	ChecksTotal             int32
	ChecksPassing           int32
	ProviderState           string
	ProviderError           *string
	FetchedAt               *string
	ResourceVersion         string
	ObservedAt              string
}

type CheckpointExecutorResourceRequest

type CheckpointExecutorResourceRequest = pluginv1.CheckpointExecutorResourceRequest

type CheckpointExecutorResourceResponse

type CheckpointExecutorResourceResponse = pluginv1.CheckpointExecutorResourceResponse

type ClarificationAnswer

type ClarificationAnswer struct {
	QuestionID      string
	SelectedOptions []string
	CustomText      string
}

ClarificationAnswer is a user's answer to one question of a bundle.

type ClarificationResponse

type ClarificationResponse struct {
	InteractionID string
	Answers       []ClarificationAnswer
}

ClarificationResponse answers a whole clarification bundle. Answers must contain exactly one entry per question in the interaction.

type CommandReceipt

type CommandReceipt struct {
	ID               string
	OperationID      string
	Status           CommandStatus
	TargetID         string
	ResourceVersion  string
	ApprovalRevision uint64
	CreatedAt        string
	UpdatedAt        string
}

CommandReceipt identifies the durable Host command intent and its outcome.

type CommandResult

type CommandResult struct {
	Status  CommandStatus
	Reason  string
	Receipt *CommandReceipt
}

CommandResult is the typed outcome of an exact Host command.

type CommandStatus

type CommandStatus string

CommandStatus is the stable result vocabulary for exact Host commands.

const (
	CommandApplied        CommandStatus = "APPLIED"
	CommandAlreadyApplied CommandStatus = "ALREADY_APPLIED"
	CommandNoChange       CommandStatus = "NO_CHANGE"
	CommandConflict       CommandStatus = "CONFLICT"
	CommandDenied         CommandStatus = "DENIED"
	CommandNotFound       CommandStatus = "NOT_FOUND"
	CommandInvalid        CommandStatus = "INVALID"
	CommandUnsupported    CommandStatus = "UNSUPPORTED"
	CommandRateLimited    CommandStatus = "RATE_LIMITED"
	CommandUnavailable    CommandStatus = "UNAVAILABLE"
	CommandPartial        CommandStatus = "PARTIAL"
	CommandUncertain      CommandStatus = "UNCERTAIN"
)

type CreateTaskInput

type CreateTaskInput struct {
	WorkspaceID string
	WorkflowID  string
	// ProjectID optionally selects an Office project in the task workspace.
	// Nil omits it; an empty value is explicit and invalid.
	ProjectID      *string `json:"project_id,omitempty"`
	WorkflowStepID *string
	Title          string
	Description    string
	ParentID       *string
	// StartAgent asks the host to auto-launch an agent on the created task,
	// mirroring the REST/MCP create_task start_agent flag. Best-effort: a
	// launch failure does not fail task creation.
	StartAgent bool
	// Priority accepts critical, high, medium, or low. Empty defaults to medium.
	Priority     string
	Repositories []PluginTaskRepository
	Launch       *PluginTaskLaunchOptions
	Metadata     map[string]any
}

CreateTaskInput is the Go-native mirror of kandev.plugin.v1.CreateTaskRequest. WorkspaceID/WorkflowID may be left empty to accept the host's defaults (the single workspace, and that workspace's first workflow); the host returns a gRPC InvalidArgument when a default cannot be resolved unambiguously.

type DestroyExecutorEnvironmentRequest

type DestroyExecutorEnvironmentRequest = pluginv1.DestroyExecutorEnvironmentRequest

type DestroyExecutorEnvironmentResponse

type DestroyExecutorEnvironmentResponse = pluginv1.DestroyExecutorEnvironmentResponse

type EntityReferenceAuthorizer

type EntityReferenceAuthorizer interface {
	AuthorizeEntityReference(context.Context, *AuthorizeEntityReferenceRequest) (*AuthorizeEntityReferenceResponse, error)
}

EntityReferenceAuthorizer is an optional live authorization extension for canonical composer references.

type EntityReferenceCandidate

type EntityReferenceCandidate struct {
	ProviderLocalID string
	Title           string
	URL             string
	Attributes      map[string]any
}

EntityReferenceCandidate is untrusted plugin search output. Kandev adds manifest-owned descriptor identity before it reaches a composer result.

type EntityReferenceHandler

type EntityReferenceHandler interface {
	EntityReferenceSearcher
	EntityReferenceAuthorizer
}

EntityReferenceHandler is the convenient optional extension for plugins that own a complete reference source. The narrower interfaces above remain available so the transport can return a precise unsupported error per RPC.

type EntityReferenceSearcher

type EntityReferenceSearcher interface {
	SearchEntityReferences(context.Context, *SearchEntityReferencesRequest) (*SearchEntityReferencesResponse, error)
}

EntityReferenceSearcher is an optional manifest-owned composer source.

type Event

type Event struct {
	EventID     string
	EventType   string
	OccurredAt  string
	WorkspaceID string
	Payload     map[string]any
}

Event is the Go-native mirror of kandev.plugin.v1.Event, delivered to a Plugin's OnEvent method.

type ExactChangeRequestEvidencePage

type ExactChangeRequestEvidencePage struct {
	Items    []ChangeRequestEvidence
	PageInfo ExactReadPageInfo
}

type ExactChangeRequestEvidenceQuery

type ExactChangeRequestEvidenceQuery struct {
	RequestID   string
	WorkspaceID string
	TaskIDs     []string
	Page        ExactReadPage
}

type ExactClarificationResponse

type ExactClarificationResponse struct {
	RequestID, WorkspaceID, InteractionID, ExpectedResourceVersion string
	Answers                                                        []ClarificationAnswer
	HumanResponseReceiptID                                         string
	ApprovalRevision                                               uint64
	ManifestDigest                                                 string
}

ExactClarificationResponse relays a human-submitted answer bundle.

type ExactExecutionCommandHost

type ExactExecutionCommandHost interface {
	ExecutionCommands() ExactExecutionCommandManager
}

type ExactExecutionCommandManager

type ExactExecutionCommandManager interface {
	EnsureTaskRun(context.Context, ExactTaskRunCommand) (*CommandResult, ExactTaskRunResult, error)
	StopTaskRun(context.Context, ExactTaskExecutionCommand) (*CommandResult, bool, error)
	// CancelTurn interrupts the observed execution's current turn without
	// stopping the session. It reports false with NO_CHANGE when no turn is
	// active, and uses the same fences and grant as StopTaskRun.
	CancelTurn(context.Context, ExactTaskExecutionCommand) (*CommandResult, bool, error)
	RecoverSession(context.Context, ExactSessionRecoveryCommand) (*CommandResult, ExactTaskRunResult, error)
	CancelPendingTaskTransition(context.Context, ExactPendingTransitionCommand) (*CommandResult, error)
	GetSessionModeContext(context.Context, ExactTaskExecutionCommand) (SessionModeContext, error)
	SetSessionMode(context.Context, ExactSessionModeCommand) (*CommandResult, string, error)
	// GetStepApproval reads whether the session's current step awaits approval.
	// An Office approval stage returns gRPC Unimplemented.
	GetStepApproval(context.Context, ExactStepApprovalQuery) (StepApproval, error)
	// ApproveStep approves an awaiting step through the native Approve path.
	// A step that no longer awaits approval returns CONFLICT.
	ApproveStep(context.Context, ExactStepApprovalCommand) (*CommandResult, StepApprovalResult, error)
}

ExactExecutionCommandManager exposes exact task and session lifecycle controls.

func HostExecutionCommands

func HostExecutionCommands(host Host) (ExactExecutionCommandManager, bool)

HostExecutionCommands returns the optional exact execution-control extension.

type ExactHost

type ExactHost interface {
	Host
	GetCapabilityContext(ctx context.Context, workspaceID string) (*CapabilityContext, error)
	UpdateTaskExact(ctx context.Context, input ExactTaskUpdate) (*CommandResult, *Task, error)
	ManagedAgentConversations() ManagedAgentConversationManager
}

ExactHost is the additive v2 extension to Host. A type assertion preserves source compatibility for plugins and host implementations that only use v1.

func HostV2

func HostV2(host Host) (ExactHost, bool)

HostV2 reports whether host implements the additive exact-operation contract. Plugins can keep using the unchanged Host v1 methods when an older Kandev host does not advertise this extension.

type ExactInteractionCommandHost

type ExactInteractionCommandHost interface {
	ExactInteractionCommands() ExactInteractionCommandManager
}

type ExactInteractionCommandManager

type ExactInteractionCommandManager interface {
	RespondPermission(context.Context, ExactPermissionResponse) (*CommandResult, *Interaction, error)
	AnswerClarification(context.Context, ExactClarificationResponse) (*CommandResult, *Interaction, error)
}

ExactInteractionCommandManager exposes responses that require a Host-issued human receipt.

func HostExactInteractionCommands

func HostExactInteractionCommands(host Host) (ExactInteractionCommandManager, bool)

HostExactInteractionCommands returns the optional receipt-gated interaction extension.

type ExactInteractionGetQuery

type ExactInteractionGetQuery struct {
	RequestID     string
	WorkspaceID   string
	InteractionID string
}

type ExactInteractionObservation

type ExactInteractionObservation struct {
	Interaction     Interaction
	ResourceVersion string
	ObservedAt      string
}

type ExactInteractionPage

type ExactInteractionPage struct {
	Items    []ExactInteractionObservation
	PageInfo ExactReadPageInfo
}

type ExactInteractionQuery

type ExactInteractionQuery struct {
	RequestID   string
	WorkspaceID string
	Filter      InteractionFilter
	Page        ExactReadPage
}

type ExactMessageObservation

type ExactMessageObservation struct {
	Message         Message
	ResourceVersion string
	ObservedAt      string
	Sanitization    string
}

type ExactMessagePage

type ExactMessagePage struct {
	Items    []ExactMessageObservation
	PageInfo ExactReadPageInfo
}

type ExactMessageQuery

type ExactMessageQuery struct {
	RequestID   string
	WorkspaceID string
	Filter      MessageFilter
	Page        ExactReadPage
}

type ExactPendingTaskTransitionsQuery

type ExactPendingTaskTransitionsQuery struct {
	RequestID, WorkspaceID, TaskID string
	Page                           ExactReadPage
}

type ExactPendingTransitionCommand

type ExactPendingTransitionCommand struct {
	RequestID, WorkspaceID, TaskID, TransitionID string
	ExpectedResourceVersion, IdempotencyKey      string
	ManagementInstanceKey                        string
	ExpectedClaimGeneration                      int64
	ApprovalRevision                             uint64
	ManifestDigest                               string
}

ExactPendingTransitionCommand cancels one versioned pending task transition and carries the task management claim fence described by ExactTaskRunCommand.

type ExactPendingTransitionsPage

type ExactPendingTransitionsPage struct {
	Items    []PendingTaskTransition
	PageInfo ExactReadPageInfo
}

type ExactPermissionResponse

type ExactPermissionResponse struct {
	RequestID, WorkspaceID, InteractionID, ExpectedResourceVersion string
	OptionID, HumanResponseReceiptID                               string
	Cancelled                                                      bool
	ApprovalRevision                                               uint64
	ManifestDigest                                                 string
}

ExactPermissionResponse relays a human-approved response to one exact request.

type ExactQueryHost

type ExactQueryHost interface{ ExactQueries() ExactQueryManager }

ExactQueryHost is implemented by Host v2 transports that expose canonical, snapshot-bound workspace observations. It stays separate from Host so v1 plugins and implementations retain source compatibility.

type ExactQueryManager

type ExactQueryManager interface {
	ListWorkspaces(context.Context, ExactWorkspaceQuery) (ExactWorkspacePage, error)
	ListWorkflows(context.Context, ExactWorkflowQuery) (ExactWorkflowPage, error)
	ListWorkflowSteps(context.Context, ExactWorkflowStepQuery) (ExactWorkflowStepPage, error)
	ListTasks(context.Context, ExactTaskQuery) (ExactTaskPage, error)
	GetTask(context.Context, ExactTaskGetQuery) (ExactTaskObservation, HostReadReceipt, error)
	ListSessions(context.Context, ExactSessionQuery) (ExactSessionPage, error)
	ListPendingInteractions(context.Context, ExactInteractionQuery) (ExactInteractionPage, error)
	GetInteraction(context.Context, ExactInteractionGetQuery) (ExactInteractionObservation, HostReadReceipt, error)
	ListSanitizedMessages(context.Context, ExactMessageQuery) (ExactMessagePage, error)
	ListTaskInbox(context.Context, ExactTaskInboxQuery) (ExactTaskInboxPage, error)
	GetTaskDirective(context.Context, ExactTaskDirectiveGetQuery) (TaskDirective, HostReadReceipt, error)
	ListTaskDirectives(context.Context, ExactTaskDirectiveQuery) (ExactTaskDirectivesPage, error)
	GetTaskRelations(context.Context, ExactTaskRelationsQuery) (ExactTaskRelationsPage, error)
	ListTaskRelations(context.Context, ExactTaskRelationsQuery) (ExactTaskRelationsPage, error)
	ListPendingTaskTransitions(context.Context, ExactPendingTaskTransitionsQuery) (ExactPendingTransitionsPage, error)
	ListChangeRequestEvidence(context.Context, ExactChangeRequestEvidenceQuery) (ExactChangeRequestEvidencePage, error)
	ListTaskUsage(context.Context, ExactTaskUsageQuery) (ExactTaskUsagePage, error)
}

func HostExactQueries

func HostExactQueries(host Host) (ExactQueryManager, bool)

HostExactQueries returns the optional exact query manager when supported.

type ExactReadPage

type ExactReadPage struct {
	Limit           int32
	Cursor          string
	SnapshotVersion string
}

ExactReadPage is a bounded page within one immutable Host read snapshot. Plugins must treat both cursor fields as opaque.

type ExactReadPageInfo

type ExactReadPageInfo struct {
	NextCursor      string
	HasMore         bool
	SnapshotVersion string
	ObservedAt      string
	Receipt         HostReadReceipt
}

type ExactSessionModeCommand

type ExactSessionModeCommand struct {
	ExactTaskExecutionCommand
	ModeID string
}

ExactSessionModeCommand changes mode only on the observed execution generation.

type ExactSessionObservation

type ExactSessionObservation struct {
	Session         Session
	ExecutionState  string
	ResourceVersion string
	ObservedAt      string
	// ExecutionID is the opaque agent generation used to fence exact lifecycle commands.
	ExecutionID string
}

type ExactSessionPage

type ExactSessionPage struct {
	Items    []ExactSessionObservation
	PageInfo ExactReadPageInfo
}

type ExactSessionQuery

type ExactSessionQuery struct {
	RequestID   string
	WorkspaceID string
	Filter      SessionFilter
	Page        ExactReadPage
}

type ExactSessionRecoveryCommand

type ExactSessionRecoveryCommand struct {
	ExactTaskExecutionCommand
	Action string
}

ExactSessionRecoveryCommand requests only the safe resume recovery action.

type ExactSourceIssueLinkHost added in v0.6.0

type ExactSourceIssueLinkHost interface {
	SourceIssueLinks() ExactSourceIssueLinkManager
}

type ExactSourceIssueLinkManager added in v0.6.0

type ExactSourceIssueLinkManager interface {
	Link(ctx context.Context, command SourceIssueLinkCommand) (*CommandResult, *SourceIssueWritebackReceipt, error)
}

ExactSourceIssueLinkManager is the optional link extension. Existing SDK consumers are unaffected because it is discovered separately.

func HostSourceIssueLink(host Host) (ExactSourceIssueLinkManager, bool)

type ExactSourceIssueWorklogHost added in v0.6.0

type ExactSourceIssueWorklogHost interface {
	SourceIssueWorklog() ExactSourceIssueWorklogManager
}

type ExactSourceIssueWorklogManager added in v0.6.0

type ExactSourceIssueWorklogManager interface {
	Log(ctx context.Context, command SourceIssueWorklogCommand) (*CommandResult, *SourceIssueWritebackReceipt, error)
}

ExactSourceIssueWorklogManager is the optional worklog extension.

func HostSourceIssueWorklog added in v0.6.0

func HostSourceIssueWorklog(host Host) (ExactSourceIssueWorklogManager, bool)

type ExactSourceIssueWritebackHost

type ExactSourceIssueWritebackHost interface {
	SourceIssueWriteback() ExactSourceIssueWritebackManager
}

type ExactStepApprovalCommand added in v0.5.0

type ExactStepApprovalCommand struct {
	RequestID, WorkspaceID, SessionID       string
	ExpectedResourceVersion, IdempotencyKey string
	HumanResponseReceiptID                  string
	ApprovalRevision                        uint64
	ManifestDigest                          string
}

ExactStepApprovalCommand approves one awaiting step with a step_approval human response receipt, exactly like the native Approve button.

type ExactStepApprovalQuery added in v0.5.0

type ExactStepApprovalQuery struct {
	RequestID, WorkspaceID, SessionID string
}

ExactStepApprovalQuery reads one session's workflow-step approval state.

type ExactTaskArchive

type ExactTaskArchive struct {
	RequestID               string
	WorkspaceID             string
	TaskID                  string
	IdempotencyKey          string
	ExpectedResourceVersion string
	ApprovalRevision        uint64
	ManifestDigest          string
	ManagementInstanceKey   string
	ExpectedClaimGeneration int64
}

ExactTaskArchive archives a task through its native lifecycle when its resource version still matches the caller's observation.

type ExactTaskAssignment

type ExactTaskAssignment struct {
	RequestID               string
	WorkspaceID             string
	TaskID                  string
	IdempotencyKey          string
	ExpectedResourceVersion string
	ApprovalRevision        uint64
	ManifestDigest          string
	ManagementInstanceKey   string
	ExpectedClaimGeneration int64
	AssigneeUserID          string
}

ExactTaskAssignment sets or clears the human assignee. Worker agent assignment remains a separate native orchestration action.

type ExactTaskCommandHost

type ExactTaskCommandHost interface {
	TaskCommands() ExactTaskCommandManager
}

ExactTaskCommandHost is an additive Host extension for exact task commands.

type ExactTaskCommandManager

type ExactTaskCommandManager interface {
	CreateTask(ctx context.Context, input ExactTaskCreate) (*CommandResult, *Task, error)
	SetLabels(ctx context.Context, input ExactTaskLabels) (*CommandResult, *Task, error)
	Assign(ctx context.Context, input ExactTaskAssignment) (*CommandResult, *Task, error)
	Move(ctx context.Context, input ExactTaskMove) (*CommandResult, *Task, error)
	Archive(ctx context.Context, input ExactTaskArchive) (*CommandResult, *Task, error)
	AddRelation(ctx context.Context, input ExactTaskRelation) (*CommandResult, error)
	RemoveRelation(ctx context.Context, input ExactTaskRelation) (*CommandResult, error)
	SendMessage(ctx context.Context, input ExactTaskMessage) (*CommandResult, error)
	IssueDirective(ctx context.Context, input ExactTaskDirectiveIssue) (*CommandResult, TaskDirective, error)
	ResolveDirective(ctx context.Context, input ExactTaskDirectiveResolve) (*CommandResult, TaskDirective, error)
}

ExactTaskCommandManager exposes versioned, approved task mutations.

func HostTaskCommands

func HostTaskCommands(host Host) (ExactTaskCommandManager, bool)

HostTaskCommands returns the exact task command extension when available.

type ExactTaskCompletionCriteria

type ExactTaskCompletionCriteria struct {
	RequestID                   string
	WorkspaceID                 string
	TaskID                      string
	IdempotencyKey              string
	ExpectedTaskResourceVersion string
	ExpectedRevision            int64
	ApprovalRevision            uint64
	ManifestDigest              string
	ManagementInstanceKey       string
	ExpectedClaimGeneration     int64
	Criteria                    []TaskCompletionCriterionInput
}

type ExactTaskCompletionEvidence

type ExactTaskCompletionEvidence struct {
	RequestID                   string
	WorkspaceID                 string
	TaskID                      string
	CriterionID                 string
	IdempotencyKey              string
	ExpectedTaskResourceVersion string
	ExpectedRevision            int64
	Evidence                    TaskCompletionEvidence
	ApprovalRevision            uint64
	ManifestDigest              string
	ManagementInstanceKey       string
	ExpectedClaimGeneration     int64
}

type ExactTaskCompletionGateCommandHost

type ExactTaskCompletionGateCommandHost interface {
	TaskCompletionGates() ExactTaskCompletionGateCommandManager
}

type ExactTaskCompletionGateCommandManager

type ExactTaskCompletionGateCommandManager interface {
	SetCriteria(ctx context.Context, input ExactTaskCompletionCriteria) (*CommandResult, *TaskCompletionGate, error)
	Verify(ctx context.Context, input ExactTaskCompletionEvidence) (*CommandResult, *TaskCompletionGate, error)
}

func HostTaskCompletionGates

func HostTaskCompletionGates(host Host) (ExactTaskCompletionGateCommandManager, bool)

type ExactTaskCreate

type ExactTaskCreate struct {
	RequestID        string
	WorkspaceID      string
	IdempotencyKey   string
	ExternalID       string
	ApprovalRevision uint64
	ManifestDigest   string
	Task             CreateTaskInput
}

ExactTaskCreate requests one source-identified task creation. ExternalID is unique within the workspace and lets the task service recover a create after the Host command receipt was not acknowledged.

type ExactTaskDirectiveGetQuery

type ExactTaskDirectiveGetQuery struct{ RequestID, WorkspaceID, DirectiveID string }

type ExactTaskDirectiveIssue

type ExactTaskDirectiveIssue struct {
	RequestID                      string
	WorkspaceID                    string
	TaskID                         string
	SessionID                      string
	CapabilityClass                string
	InstructionDigest              string
	ExpectedTaskResourceVersion    string
	ExpectedSessionResourceVersion string
	ExpiresAt                      string
	IdempotencyKey                 string
	ApprovalRevision               uint64
	ManifestDigest                 string
}

ExactTaskDirectiveIssue creates a short-lived directive bound to one task, session, approved capability class, and observed resource versions.

type ExactTaskDirectiveQuery

type ExactTaskDirectiveQuery struct {
	RequestID, WorkspaceID, TaskID string
	Page                           ExactReadPage
}

type ExactTaskDirectiveResolve

type ExactTaskDirectiveResolve struct {
	RequestID               string
	WorkspaceID             string
	DirectiveID             string
	ExpectedResourceVersion string
	IdempotencyKey          string
	Resolution              string
	ResolutionDigest        string
	ApprovalRevision        uint64
	ManifestDigest          string
}

ExactTaskDirectiveResolve consumes one pending directive at its current resource version. Resolution details are stored as a digest.

type ExactTaskDirectivesPage

type ExactTaskDirectivesPage struct {
	Items    []TaskDirective
	PageInfo ExactReadPageInfo
}

type ExactTaskExecutionCommand

type ExactTaskExecutionCommand struct {
	RequestID, WorkspaceID, TaskID, SessionID string
	ExpectedSessionResourceVersion            string
	ExpectedExecutionID, IdempotencyKey       string
	ManagementInstanceKey                     string
	ExpectedClaimGeneration                   int64
	ApprovalRevision                          uint64
	ManifestDigest                            string
}

ExactTaskExecutionCommand targets one observed session execution and carries the task management claim fence described by ExactTaskRunCommand.

type ExactTaskGetQuery

type ExactTaskGetQuery struct {
	RequestID   string
	WorkspaceID string
	TaskID      string
}

type ExactTaskInboxPage

type ExactTaskInboxPage struct {
	Items    []TaskInboxItem
	PageInfo ExactReadPageInfo
}

type ExactTaskInboxQuery

type ExactTaskInboxQuery struct {
	RequestID, WorkspaceID, TaskID, SessionID string
	Page                                      ExactReadPage
}

type ExactTaskLabels

type ExactTaskLabels struct {
	RequestID               string
	WorkspaceID             string
	TaskID                  string
	IdempotencyKey          string
	ExpectedResourceVersion string
	ApprovalRevision        uint64
	ManifestDigest          string
	ManagementInstanceKey   string
	ExpectedClaimGeneration int64
	Labels                  []string
}

ExactTaskLabels replaces all labels on one task at the observed resource version. An empty slice clears the labels.

type ExactTaskManagementClaimAcquire

type ExactTaskManagementClaimAcquire struct {
	ExactTaskManagementClaimCommand
	InstanceKey string
}

type ExactTaskManagementClaimCommand

type ExactTaskManagementClaimCommand struct {
	RequestID                    string
	WorkspaceID                  string
	TaskID                       string
	ExpectedTaskResourceVersion  string
	ExpectedClaimResourceVersion string
	IdempotencyKey               string
	Reason                       string
	ApprovalRevision             uint64
	ManifestDigest               string
}

type ExactTaskManagementClaimCommandHost

type ExactTaskManagementClaimCommandHost interface {
	TaskManagementClaims() ExactTaskManagementClaimCommandManager
}

type ExactTaskManagementClaimRelease

type ExactTaskManagementClaimRelease struct {
	ExactTaskManagementClaimCommand
	InstanceKey string
}

type ExactTaskManagementClaimTransfer

type ExactTaskManagementClaimTransfer struct {
	ExactTaskManagementClaimCommand
	InstanceKey          string
	TargetInstallationID string
	TargetInstanceKey    string
}

type ExactTaskMessage

type ExactTaskMessage struct {
	RequestID                      string
	WorkspaceID                    string
	TaskID                         string
	SessionID                      string
	IdempotencyKey                 string
	ExpectedTaskResourceVersion    string
	ExpectedSessionResourceVersion string
	ApprovalRevision               uint64
	ManifestDigest                 string
	ManagementInstanceKey          string
	ExpectedClaimGeneration        int64
	Content                        string
}

ExactTaskMessage admits one prompt into the target session's durable FIFO queue while the observed task and session versions remain current.

type ExactTaskMove

type ExactTaskMove struct {
	RequestID               string
	WorkspaceID             string
	TaskID                  string
	IdempotencyKey          string
	ExpectedResourceVersion string
	WorkflowID              string
	WorkflowStepID          string
	Position                int32
	ApprovalRevision        uint64
	ManifestDigest          string
	ManagementInstanceKey   string
	ExpectedClaimGeneration int64
}

ExactTaskMove moves a task through the shared workflow admission path at the resource version observed by the caller.

type ExactTaskObservation

type ExactTaskObservation struct {
	Task                     Task
	CanonicalStatus          string
	SemanticActivity         string
	LastMeaningfulActivityAt *string
	ExecutionState           string
	BlockingReasons          []string
	StatusKnown              bool
	ResourceVersion          string
	ObservedAt               string
}

type ExactTaskPage

type ExactTaskPage struct {
	Items    []ExactTaskObservation
	PageInfo ExactReadPageInfo
}

type ExactTaskQuery

type ExactTaskQuery struct {
	RequestID   string
	WorkspaceID string
	Filter      TaskFilter
	Page        ExactReadPage
}

type ExactTaskRelation

type ExactTaskRelation struct {
	RequestID                      string
	WorkspaceID                    string
	TaskID                         string
	RelatedTaskID                  string
	ExpectedTaskResourceVersion    string
	ExpectedRelatedResourceVersion string
	IdempotencyKey                 string
	ApprovalRevision               uint64
	ManifestDigest                 string
	ManagementInstanceKey          string
	ExpectedClaimGeneration        int64
}

ExactTaskRelation adds or removes one dependency edge between tasks in the same workspace.

type ExactTaskRelationsPage

type ExactTaskRelationsPage struct {
	Items    []TaskRelation
	PageInfo ExactReadPageInfo
}

type ExactTaskRelationsQuery

type ExactTaskRelationsQuery struct {
	RequestID   string
	WorkspaceID string
	TaskID      string
	Page        ExactReadPage
}

type ExactTaskRunCommand

type ExactTaskRunCommand struct {
	RequestID, WorkspaceID, TaskID, IdempotencyKey string
	ExpectedTaskResourceVersion                    string
	ManagementInstanceKey                          string
	ExpectedClaimGeneration                        int64
	ApprovalRevision                               uint64
	ManifestDigest                                 string
}

ExactTaskRunCommand requests one task-scoped run action at an observed task version. The Host derives the caller installation from the connected plugin. The management key and generation are assertions copied from the observed task claim: pass an empty key and generation zero for a task that has never had a claim, or an empty key and the current positive generation after release.

type ExactTaskRunResult

type ExactTaskRunResult struct {
	Result       *CommandResult
	SessionID    string
	SessionState string
	ExecutionID  string
}

ExactTaskRunResult reports the canonical session and execution created or found.

type ExactTaskUpdate

type ExactTaskUpdate struct {
	RequestID               string
	WorkspaceID             string
	TaskID                  string
	IdempotencyKey          string
	ExpectedResourceVersion string
	ApprovalRevision        uint64
	ManifestDigest          string
	ManagementInstanceKey   string
	ExpectedClaimGeneration int64
	Title                   *string
	Description             *string
	State                   *string
	Priority                *string
}

ExactTaskUpdate contains one version-checked, idempotent task update.

type ExactTaskUsagePage

type ExactTaskUsagePage struct {
	Items    []TaskUsageObservation
	PageInfo ExactReadPageInfo
}

type ExactTaskUsageQuery

type ExactTaskUsageQuery struct {
	RequestID   string
	WorkspaceID string
	TaskIDs     []string
	Page        ExactReadPage
}

type ExactWorkflowObservation

type ExactWorkflowObservation struct {
	Workflow        Workflow
	ResourceVersion string
	ObservedAt      string
}

type ExactWorkflowPage

type ExactWorkflowPage struct {
	Items    []ExactWorkflowObservation
	PageInfo ExactReadPageInfo
}

type ExactWorkflowQuery

type ExactWorkflowQuery = ExactWorkspaceQuery

type ExactWorkflowStepObservation

type ExactWorkflowStepObservation struct {
	Step            WorkflowStep
	ResourceVersion string
	ObservedAt      string
}

type ExactWorkflowStepPage

type ExactWorkflowStepPage struct {
	Items    []ExactWorkflowStepObservation
	PageInfo ExactReadPageInfo
}

type ExactWorkflowStepQuery

type ExactWorkflowStepQuery struct {
	RequestID   string
	WorkspaceID string
	WorkflowID  string
	Page        ExactReadPage
}

type ExactWorkspaceAdministrationHost

type ExactWorkspaceAdministrationHost interface {
	WorkspaceAdministration() ExactWorkspaceAdministrationManager
}

type ExactWorkspaceAdministrationManager

type ExactWorkspaceAdministrationManager interface {
	Apply(ctx context.Context, command WorkspaceAdminCommand) (*CommandResult, error)
}

func HostWorkspaceAdministration

func HostWorkspaceAdministration(host Host) (ExactWorkspaceAdministrationManager, bool)

type ExactWorkspaceObservation

type ExactWorkspaceObservation struct {
	Workspace       Workspace
	ResourceVersion string
	ObservedAt      string
}

type ExactWorkspacePage

type ExactWorkspacePage struct {
	Items    []ExactWorkspaceObservation
	PageInfo ExactReadPageInfo
}

type ExactWorkspaceQuery

type ExactWorkspaceQuery struct {
	RequestID   string
	WorkspaceID string
	Page        ExactReadPage
}

type ExecutorConnectionLease

type ExecutorConnectionLease = pluginv1.ExecutorConnectionLease

type ExecutorProfile

type ExecutorProfile struct {
	ID           string
	DisplayName  string
	ExecutorType string
}

ExecutorProfile is the Go-native mirror of kandev.plugin.v1.ExecutorProfile.

type ExecutorProfileHost

type ExecutorProfileHost interface {
	ExecutorProfiles() ExecutorProfileReader
}

ExecutorProfileHost is an optional Host extension. It is kept separate from Host so existing host implementations remain source-compatible.

type ExecutorProfileReader

type ExecutorProfileReader interface {
	List(ctx context.Context, page Page) ([]ExecutorProfile, *PageInfo, error)
}

func ExecutorProfiles

func ExecutorProfiles(host Host) (ExecutorProfileReader, bool)

ExecutorProfiles returns the optional executor-profile reader.

type ExecutorProfileSnapshot

type ExecutorProfileSnapshot = pluginv1.ExecutorProfileSnapshot

type ExecutorProviderCapabilities

type ExecutorProviderCapabilities = pluginv1.ExecutorProviderCapabilities

type ExecutorProviderError

type ExecutorProviderError = pluginv1.ExecutorProviderError

type ExecutorProviderFieldError

type ExecutorProviderFieldError = pluginv1.ExecutorProviderFieldError

type ExecutorProviderHost

type ExecutorProviderHost interface {
	ExecutorProvider() ExecutorProviderHostAPI
}

ExecutorProviderHost is an optional Host extension available to providers. Its callbacks are scoped to the host-admitted operation.

type ExecutorProviderHostAPI

ExecutorProviderHostAPI contains the operation-bound callbacks a provider can use during launch and bootstrap.

type ExecutorProviderPlugin

ExecutorProviderPlugin is an optional all-or-nothing extension. The host treats a partial implementation as unsupported so a manifest cannot expose a provider whose recovery or cleanup methods are missing.

type ExecutorProviderRequestContext

type ExecutorProviderRequestContext = pluginv1.ExecutorProviderRequestContext

type ExecutorResourceDescriptor

type ExecutorResourceDescriptor = pluginv1.ExecutorResourceDescriptor

type ExecutorRuntimeArtifactChunk

type ExecutorRuntimeArtifactChunk = pluginv1.ExecutorRuntimeArtifactChunk
type ExternalIdentityLink struct {
	ID, Provider, Subject, DisplayName string
	UserID, UserDisplayName            string
	CreatedAt                          string // RFC3339
}

ExternalIdentityLink is one active link from an external account to a Kandev user, scoped to the calling plugin installation.

type ExternalIdentityLinkRequest added in v0.5.0

type ExternalIdentityLinkRequest struct {
	RequestID, Code, Provider, Subject, DisplayName string
}

ExternalIdentityLinkRequest redeems a link code that a Kandev user created on the plugin's settings page. Provider and Subject name the external account that presented the code (for example "discord" and a user ID); DisplayName is that account's display name, shown to the Kandev user.

type GRPCPlugin

type GRPCPlugin struct {
	hcplugin.NetRPCUnsupportedPlugin

	// Impl is the plugin author's implementation. Set by Serve on the
	// plugin subprocess side.
	Impl Plugin

	// Host is kandev's Go-native Host implementation. Set by kandev's
	// runtime manager on the host side.
	Host Host

	// HostDialTimeout overrides defaultHostDialTimeout. Zero means use the
	// default; mainly useful in tests.
	HostDialTimeout time.Duration
}

GRPCPlugin adapts a Plugin (subprocess side) and/or a Host (kandev side) to hashicorp/go-plugin's plugin.GRPCPlugin interface. It is the shared type both sides use:

  • Plugin authors never construct it directly; Serve does so internally.

  • kandev's runtime manager constructs it directly:

    client := plugin.NewClient(&plugin.ClientConfig{ HandshakeConfig: pluginsdk.Handshake, Plugins: map[string]plugin.Plugin{pluginsdk.PluginMapKey: &pluginsdk.GRPCPlugin{Host: myHostImpl}}, AllowedProtocols: []plugin.Protocol{plugin.ProtocolGRPC}, AutoMTLS: true, Cmd: exec.Command(pluginBinaryPath), }) rpcClient, _ := client.Client() raw, _ := rpcClient.Dispense(pluginsdk.PluginMapKey) remote := raw.(*pluginsdk.RemotePlugin)

See the file header for how Host injection works across the two sides.

func (*GRPCPlugin) GRPCClient

func (p *GRPCPlugin) GRPCClient(_ context.Context, broker *hcplugin.GRPCBroker, conn *grpc.ClientConn) (interface{}, error)

GRPCClient is called once inside kandev (by plugin.NewClient's Dispense) to build the RemotePlugin used to call the plugin, and — if Host is set — to start serving it on hostBrokerID so the plugin subprocess can call back. See the file header.

func (*GRPCPlugin) GRPCServer

func (p *GRPCPlugin) GRPCServer(broker *hcplugin.GRPCBroker, s *grpc.Server) error

GRPCServer is called once inside the plugin subprocess (by plugin.Serve, via Serve) to register the Plugin service and — if Impl implements HostSetter — kick off the background Host dial described in the file header.

type GitCredentialBinder

type GitCredentialBinder interface {
	GetGitCredentialBinding(context.Context, *GitCredentialBindingRequest) (*GitCredentialBindingResponse, error)
}

GitCredentialBinder is an optional companion to GitCredentialResolver. It provides a non-secret opaque revision for an exact provider lease scope. Generic provider leases require this extension so credential rotation and disconnect invalidate an already-issued helper lease without a secret read.

type GitCredentialBindingRequest

type GitCredentialBindingRequest struct {
	ProviderID   string
	WorkspaceID  string
	TaskID       string
	SessionID    string
	RepositoryID string
	Host         string
	Path         string
}

GitCredentialBindingRequest contains the exact host-verified lease scope for a non-secret credential revision lookup.

type GitCredentialBindingResponse

type GitCredentialBindingResponse struct{ Binding string }

GitCredentialBindingResponse returns an opaque, non-secret revision for a credential scope. Hosts must treat an empty response as a revoked binding.

type GitCredentialHandler

type GitCredentialHandler interface {
	GitCredentialResolver
	GitCredentialBinder
}

GitCredentialHandler is the complete provider-neutral Git credential extension. It keeps existing resolvers source-compatible while allowing hosts to fail closed when a generic provider lacks binding support.

type GitCredentialResolver

type GitCredentialResolver interface {
	ResolveGitCredential(context.Context, *ResolveGitCredentialRequest) (*ResolveGitCredentialResponse, error)
}

GitCredentialResolver is an optional provider-neutral credential resolver. Returned credentials are transient and must never be logged or persisted.

type Host

type Host interface {
	// GetState looks up a single state entry. found is false, err is nil
	// when the key does not exist.
	GetState(ctx context.Context, scope, scopeID, key string) (value map[string]any, found bool, err error)

	// SetState upserts a single state entry.
	SetState(ctx context.Context, scope, scopeID, key string, value map[string]any) error

	// DeleteState removes a single state entry. Deleting a missing key is
	// not an error.
	DeleteState(ctx context.Context, scope, scopeID, key string) error

	// ListState returns every state entry for a scope/scopeID pair.
	ListState(ctx context.Context, scope, scopeID string) ([]StateEntry, error)

	// GetConfig returns the plugin's own operator-editable config: the
	// values set in kandev's Settings > Plugins > <plugin> page against the
	// manifest's config_schema. Returns an empty (non-nil) map when no
	// config has been set yet. Ungated — a plugin can always read its own
	// config, secret values included. Plugins should re-read config at
	// startup: kandev restarts a running plugin when its config changes.
	GetConfig(ctx context.Context) (map[string]any, error)

	// RevealSecret resolves an operator-provided secret reference (e.g. a
	// ref placed in config pointing at a shared kandev secret) to its
	// cleartext value. For secrets the plugin itself owns, use
	// GetSecret/SetSecret/DeleteSecret instead.
	RevealSecret(ctx context.Context, ref string) (string, error)

	// GetSecret reads a plugin-owned secret previously stored with
	// SetSecret. found is false, err is nil when the key was never set.
	// Requires the `secrets` capability.
	GetSecret(ctx context.Context, key string) (value string, found bool, err error)

	// SetSecret upserts a plugin-owned secret into kandev's encrypted
	// vault. Keys are namespaced to this plugin server-side — a plugin can
	// never read or write another plugin's (or kandev's) secrets through
	// this API. Keys must match [a-zA-Z0-9][a-zA-Z0-9._-]{0,127}. Requires
	// the `secrets` capability.
	SetSecret(ctx context.Context, key, value string) error

	// DeleteSecret removes a plugin-owned secret. Deleting a missing key
	// is not an error. Requires the `secrets` capability.
	DeleteSecret(ctx context.Context, key string) error

	// EmitEvent publishes a plugin-originated event onto kandev's bus.
	EmitEvent(ctx context.Context, name string, payload map[string]any) error

	// Tasks returns the reader for the Host data API's task RPCs
	// (capability api_read:tasks per ADR 0043).
	Tasks() TaskReader

	// Sessions returns the reader for the Host data API's session and
	// session-code-stats RPCs (capability api_read:sessions).
	Sessions() SessionReader

	// Workspaces returns the reader for the Host data API's workspace RPCs
	// (capability api_read:workspaces).
	Workspaces() WorkspaceReader

	// Workflows returns the reader for the Host data API's workflow and
	// workflow-step RPCs (capability api_read:workflows).
	Workflows() WorkflowReader

	// AgentProfiles returns the reader for the Host data API's agent
	// profile RPCs (capability api_read:agent_profiles).
	AgentProfiles() AgentProfileReader

	// Repositories returns the reader for the Host data API's repository
	// RPCs (capability api_read:repositories).
	Repositories() RepositoryReader

	// Messages returns the accessor for the Host data API's message RPCs.
	// List (capability api_read:messages) reads historical user/agent
	// conversation content; Send (capability api_write:messages) delivers a
	// prompt to a task session.
	Messages() MessageReader

	// InvokeUtilityAgent runs a one-shot, non-interactive completion. With no
	// options, or an empty ProfileID, it uses the platform default utility
	// profile. A non-empty ProfileID selects that profile for this call only.
	// Requires the `agent_invoke` capability and returns gRPC FailedPrecondition
	// for a missing or ineligible profile.
	InvokeUtilityAgent(ctx context.Context, prompt string, options ...UtilityAgentOptions) (string, error)
}

Host is the set of operations kandev exposes back to a running plugin, per §3's Host service. On the plugin side, Serve injects an SDK-provided implementation that proxies these calls to kandev over the go-plugin broker. On the kandev side, the runtime manager provides its own Go-native implementation of this same interface (backed by the real state store / secrets / event bus) and hands it to GRPCPlugin.Host; the SDK wraps it into the generated pluginv1.HostServer for registration. With workspace collaboration enabled, domain calls must retain the incoming plugin handler context. Detached work without a live server invocation cannot acquire domain caller authority; plugin-owned storage keeps startup behavior.

func NewHostClient

func NewHostClient(conn *grpc.ClientConn) Host

NewHostClient returns the SDK Host handle for an existing gRPC connection to a Kandev Host service. Normal plugins receive this handle from Serve; this constructor supports integration tests and embedders that manage their own connection.

type HostCallContextPolicy

type HostCallContextPolicy interface {
	HostCallContextEnabled() bool
	ValidateHostCallContext(context.Context, bool) error
}

HostCallContextPolicy is implemented by the host application. The SDK does not interpret task identities; it carries the original server context only.

type HostReadReceipt

type HostReadReceipt struct {
	InstallationID     string
	WorkspaceID        string
	CapabilityRevision uint64
	RequestID          string
	SnapshotVersion    string
	ObservedAt         string
}

HostReadReceipt identifies the installation and approval generation used for an authoritative snapshot read.

type HostSetter

type HostSetter interface {
	SetHost(Host)
}

HostSetter is implemented by Plugin values that want Serve to inject the Host once the broker connection back to kandev is established (see the "Host injection" section of the serve.go file header). UnimplementedPlugin implements this, so embedding it is the easiest way to opt in.

type HumanResponseDelegationHost added in v0.5.0

type HumanResponseDelegationHost interface {
	HumanResponseDelegation() HumanResponseDelegationManager
}

type HumanResponseDelegationManager added in v0.5.0

type HumanResponseDelegationManager interface {
	LinkExternalIdentity(context.Context, ExternalIdentityLinkRequest) (*CommandResult, ExternalIdentityLink, error)
	RequestHumanResponseReceipt(context.Context, HumanResponseReceiptRequest) (*CommandResult, HumanResponseReceipt, error)
}

HumanResponseDelegationManager links external accounts to Kandev users and mints receipts for those users. It requires the manifest declaration api_write: [human_responses]; receipts also require the workspace grant host.v2.write:human_responses.

func HostHumanResponseDelegation added in v0.5.0

func HostHumanResponseDelegation(host Host) (HumanResponseDelegationManager, bool)

HostHumanResponseDelegation returns the optional linked-account extension.

type HumanResponseReceipt added in v0.5.0

type HumanResponseReceipt struct {
	ID, Kind, TargetID, ResourceVersion string
	ExpiresAt                           string // RFC3339
	Actor                               InteractionActor
}

HumanResponseReceipt is a single-use, five-minute proof of one linked user's decision, bound to the calling installation, the workspace, the target revision, and the exact payload.

type HumanResponseReceiptRequest added in v0.5.0

type HumanResponseReceiptRequest struct {
	RequestID, WorkspaceID, Provider, Subject string
	Kind, TargetID, ExpectedResourceVersion   string
	OptionID                                  string
	Cancelled                                 bool
	Answers                                   []ClarificationAnswer
	ApprovalRevision                          uint64
	ManifestDigest                            string
}

HumanResponseReceiptRequest asks the Host for a single-use receipt for one exact response by the Kandev user linked to Provider/Subject. TargetID is the interaction ID for permission and clarification responses and the session ID for step approval; ExpectedResourceVersion is the target's observed version. The payload fields must match the later exact command: OptionID or Cancelled for a permission, Answers for a clarification, and none for a step approval.

type InspectExecutorEnvironmentRequest

type InspectExecutorEnvironmentRequest = pluginv1.InspectExecutorEnvironmentRequest

type InspectExecutorEnvironmentResponse

type InspectExecutorEnvironmentResponse = pluginv1.InspectExecutorEnvironmentResponse

type Interaction

type Interaction struct {
	ID                string
	Kind              string // InteractionKind* constant
	TaskID            string
	SessionID         string
	TurnID            string
	Status            string // InteractionStatus* constant
	Title             string
	Context           string
	ToolCallID        string
	ActionType        string
	Options           []InteractionOption   // permission options
	Questions         []InteractionQuestion // clarification questions
	AgentDisconnected bool
	CreatedAt         string // RFC3339
	UpdatedAt         string // RFC3339
	// ResolvedBy is set on an interaction resolved through a receipt minted
	// for a linked Kandev user: that user and the external surface.
	ResolvedBy *InteractionActor
}

Interaction is one thing a human still owes an answer to. ID is the pending id every response method keys on — the same id the permission and clarification bus events carry, so an event-driven cache can reconcile against a ListPending snapshot without inventing a correlation key.

AgentDisconnected marks a still-pending clarification whose original waiter has gone away. It remains answerable (the answer resumes the session in a new turn), so it is NOT a resolution — treating it as one is exactly the false negative the durable record exists to prevent.

type InteractionAccessor

type InteractionAccessor interface {
	// ListPending returns every interaction still owed a response, under the
	// same turn/session authority kandev's own list surfaces use.
	ListPending(ctx context.Context, filter InteractionFilter, page Page) ([]Interaction, *PageInfo, error)

	// Get resolves one interaction by pending id whatever its status,
	// terminal ones included, so a replayed or missed event converges on the
	// current durable result instead of disappearing.
	Get(ctx context.Context, id string) (*Interaction, error)

	// RespondToPermission is retained for source compatibility and returns
	// PermissionDenied. Use HostExactInteractionCommands with a human response
	// receipt minted by the authenticated native UI.
	RespondToPermission(ctx context.Context, in PermissionResponse) (*Interaction, error)

	// AnswerClarification is retained for source compatibility and returns
	// PermissionDenied. Use HostExactInteractionCommands with a human response
	// receipt minted by the authenticated native UI.
	AnswerClarification(ctx context.Context, in ClarificationResponse) (*Interaction, error)

	// CancelClarification is retained for source compatibility and returns
	// PermissionDenied. Use HostExactInteractionCommands with a human response
	// receipt minted by the authenticated native UI.
	CancelClarification(ctx context.Context, id, reason string) (*Interaction, error)
}

InteractionAccessor is the accessor behind Host.Interactions(). Reads (ListPending/Get) require api_read:interactions. The legacy response methods remain for source compatibility but return PermissionDenied because they cannot carry an observed resource version or a Host-issued human response receipt. Use HostExactInteractionCommands for responses.

func Interactions

func Interactions(host Host) (InteractionAccessor, bool)

Interactions returns the optional interaction accessor, and false when the host predates the extension.

type InteractionActor added in v0.5.0

type InteractionActor struct {
	UserID, DisplayName, Via string
}

InteractionActor names the Kandev user who decided and the external surface that carried the decision, for example "discord".

type InteractionFilter

type InteractionFilter struct {
	SessionIDs []string
	TaskIDs    []string
	Kinds      []string
}

InteractionFilter narrows ListPending. SessionIDs and TaskIDs are ORed within each axis and ANDed across the two; an empty axis is unconstrained. Kinds narrows by interaction kind; empty means both.

type InteractionHost

type InteractionHost interface {
	Interactions() InteractionAccessor
}

InteractionHost is the optional Host extension exposing Interactions().

type InteractionOption

type InteractionOption struct {
	OptionID    string
	Label       string
	Kind        string
	Description string
}

InteractionOption is one selectable response. Kind carries the ACP permission-option kind on a permission ("allow_once", "allow_always", "reject_once", "reject_always") and is empty on a clarification option; Description is the reverse.

type InteractionQuestion

type InteractionQuestion struct {
	ID      string
	Title   string
	Prompt  string
	Options []InteractionOption
}

InteractionQuestion is one question of a clarification bundle. Every question must be answered before the agent unblocks.

type ManagedAgentConversationDelete

type ManagedAgentConversationDelete struct {
	RequestID        string
	IdempotencyKey   string
	WorkspaceID      string
	InstanceKey      string
	ExpectedRevision uint64
	ApprovalRevision uint64
	ManifestDigest   string
}

ManagedAgentConversationDelete removes one retained conversation at one revision.

type ManagedAgentConversationDescriptor

type ManagedAgentConversationDescriptor struct {
	InstallationID     string
	TaskID             string
	SessionID          string
	WorkspaceID        string
	InstanceKey        string
	Revision           uint64
	AgentProfileID     string
	ExecutorID         string
	ExecutorProfileID  string
	BasePrompt         string
	InstructionVersion string
	DesiredPaused      bool
	RetentionMode      string
	Detached           bool
	AgentToolNames     []string
}

ManagedAgentConversationDescriptor is a host-owned projection of a retained conversation. Internal task and session IDs are opaque handles.

type ManagedAgentConversationDispatch

type ManagedAgentConversationDispatch struct {
	RequestID                    string
	IdempotencyKey               string
	WorkspaceID                  string
	InstanceKey                  string
	ExpectedConversationRevision uint64
	ApprovalRevision             uint64
	ManifestDigest               string
	OccurrenceKey                string
	Origin                       ManagedAgentInputOrigin
	Payload                      string
	CoalesceKey                  string
}

ManagedAgentConversationDispatch requests an immediate turn. If the conversation is busy, Dispatch returns ManagedAgentDispatchBusy and does not enqueue the payload.

type ManagedAgentConversationListQuery

type ManagedAgentConversationListQuery struct {
	WorkspaceID      string
	ApprovalRevision uint64
	ManifestDigest   string
}

ManagedAgentConversationListQuery scopes retained conversation discovery.

type ManagedAgentConversationPause

type ManagedAgentConversationPause struct {
	RequestID        string
	IdempotencyKey   string
	WorkspaceID      string
	InstanceKey      string
	ExpectedRevision uint64
	ApprovalRevision uint64
	ManifestDigest   string
	Paused           bool
}

ManagedAgentConversationPause changes desired pause state at one revision.

type ManagedAgentConversationQuery

type ManagedAgentConversationQuery struct {
	WorkspaceID      string
	InstanceKey      string
	ApprovalRevision uint64
	ManifestDigest   string
}

ManagedAgentConversationQuery identifies one retained conversation read.

type ManagedAgentConversationSpec

type ManagedAgentConversationSpec struct {
	RequestID          string
	IdempotencyKey     string
	WorkspaceID        string
	InstanceKey        string
	ExpectedRevision   uint64
	ApprovalRevision   uint64
	ManifestDigest     string
	AgentProfileID     string
	ExecutorID         string
	ExecutorProfileID  string
	BasePrompt         string
	InstructionVersion string
	AgentToolNames     []string
}

ManagedAgentConversationSpec creates a retained, installation-owned conversation or updates its launch settings at the supplied revision.

type ManagedAgentDispatchStatus

type ManagedAgentDispatchStatus string

ManagedAgentDispatchStatus describes an immediate attempt to start a conversation turn. Busy is an explicit result and never means queued.

const (
	ManagedAgentDispatchBusy    ManagedAgentDispatchStatus = "busy"
	ManagedAgentDispatchStarted ManagedAgentDispatchStatus = "started"
	ManagedAgentDispatchSent    ManagedAgentDispatchStatus = "sent"
)

type ManagedAgentInputCancel

type ManagedAgentInputCancel struct {
	RequestID                    string
	IdempotencyKey               string
	WorkspaceID                  string
	InstanceKey                  string
	HostInputID                  string
	ExpectedConversationRevision uint64
	ExpectedExecutionID          string
	ApprovalRevision             uint64
	ManifestDigest               string
}

ManagedAgentInputCancel cancels one accepted input or stops one exact running execution. ExpectedExecutionID is empty only for accepted inputs.

type ManagedAgentInputEnqueue

type ManagedAgentInputEnqueue struct {
	RequestID                    string
	IdempotencyKey               string
	WorkspaceID                  string
	InstanceKey                  string
	ExpectedConversationRevision uint64
	ApprovalRevision             uint64
	ManifestDigest               string
	OccurrenceKey                string
	Origin                       ManagedAgentInputOrigin
	Payload                      string
	CoalesceKey                  string
}

ManagedAgentInputEnqueue requests an idempotent durable input admission. CoalesceKey is allowed only for periodic origin and must be non-empty when periodic replacement is requested.

type ManagedAgentInputListQuery

type ManagedAgentInputListQuery struct {
	WorkspaceID      string
	InstanceKey      string
	SequenceCursor   uint64
	Limit            uint32
	ApprovalRevision uint64
	ManifestDigest   string
}

ManagedAgentInputListQuery scopes a bounded sequence-cursor read.

type ManagedAgentInputOrigin

type ManagedAgentInputOrigin string

ManagedAgentInputOrigin identifies the source of durable conversation input. Only periodic inputs can request replacement through a coalesce key.

const (
	ManagedAgentInputHuman       ManagedAgentInputOrigin = "human"
	ManagedAgentInputAutomation  ManagedAgentInputOrigin = "automation"
	ManagedAgentInputPeriodic    ManagedAgentInputOrigin = "periodic"
	ManagedAgentInputInteraction ManagedAgentInputOrigin = "interaction"
)

type ManagedAgentInputPage

type ManagedAgentInputPage struct {
	Inputs             []ManagedAgentInputReceipt
	NextSequenceCursor uint64
	HasMore            bool
}

ManagedAgentInputPage is one bounded page of receipts after the supplied sequence cursor.

type ManagedAgentInputQuery

type ManagedAgentInputQuery struct {
	WorkspaceID      string
	InstanceKey      string
	HostInputID      string
	ApprovalRevision uint64
	ManifestDigest   string
}

ManagedAgentInputQuery identifies one input under the current approved conversation authority.

type ManagedAgentInputReceipt

type ManagedAgentInputReceipt struct {
	HostInputID          string
	OccurrenceKey        string
	Sequence             uint64
	Origin               ManagedAgentInputOrigin
	Payload              string
	CoalesceKey          string
	ConversationRevision uint64
	State                ManagedAgentInputState
	CreatedAt            string
	UpdatedAt            string
	QueueEntryID         string
	ExecutionID          string
	TurnID               string
	SupersededBy         string
}

ManagedAgentInputReceipt is the host-owned receipt for one durable input. Payload is canonical text; queue and execution identifiers remain opaque.

type ManagedAgentInputState

type ManagedAgentInputState string

ManagedAgentInputState is the durable lifecycle state of one accepted input.

const (
	ManagedAgentInputAccepted  ManagedAgentInputState = "accepted"
	ManagedAgentInputRunning   ManagedAgentInputState = "running"
	ManagedAgentInputCompleted ManagedAgentInputState = "completed"
	ManagedAgentInputFailed    ManagedAgentInputState = "failed"
	ManagedAgentInputCancelled ManagedAgentInputState = "cancelled"
	ManagedAgentInputUncertain ManagedAgentInputState = "uncertain"
)

type ManagedConversationSchedule

type ManagedConversationSchedule struct {
	ID                  string
	WorkspaceID         string
	Name                string
	Description         string
	Prompt              string
	PluginID            string
	InstanceKey         string
	DestinationRevision uint64
	ResourceRevision    uint64
	Enabled             bool
	Triggers            []ManagedConversationScheduleTrigger
}

type ManagedConversationScheduleCreate

type ManagedConversationScheduleCreate struct {
	RequestID        string
	IdempotencyKey   string
	ApprovalRevision uint64
	ManifestDigest   string
	Schedule         ManagedConversationSchedule
}

type ManagedConversationScheduleDelete

type ManagedConversationScheduleDelete struct {
	RequestID                string
	IdempotencyKey           string
	WorkspaceID              string
	AutomationID             string
	ExpectedResourceRevision uint64
	ApprovalRevision         uint64
	ManifestDigest           string
}

type ManagedConversationScheduleEnabled

type ManagedConversationScheduleEnabled struct {
	RequestID                string
	IdempotencyKey           string
	WorkspaceID              string
	AutomationID             string
	ExpectedResourceRevision uint64
	Enabled                  bool
	ApprovalRevision         uint64
	ManifestDigest           string
}

type ManagedConversationScheduleHost

type ManagedConversationScheduleHost interface {
	ManagedConversationSchedules() ManagedConversationScheduleManager
}

type ManagedConversationScheduleQuery

type ManagedConversationScheduleQuery struct {
	WorkspaceID      string
	ApprovalRevision uint64
	ManifestDigest   string
}

type ManagedConversationScheduleTrigger

type ManagedConversationScheduleTrigger struct {
	Type    string
	Config  json.RawMessage
	Enabled bool
}

type ManagedConversationScheduleUpdate

type ManagedConversationScheduleUpdate struct {
	RequestID                string
	IdempotencyKey           string
	AutomationID             string
	ExpectedResourceRevision uint64
	ApprovalRevision         uint64
	ManifestDigest           string
	Schedule                 ManagedConversationSchedule
}

type Message

type Message struct {
	ID         string
	SessionID  string
	TaskID     string
	TurnID     string
	AuthorType string // "user" | "agent"
	Content    string
	Type       string // "message" default; see the MessageType vocabulary
	CreatedAt  string // RFC3339
	// Source is the persisted metadata.source provenance, for example
	// "plugin:<id>" on a message a plugin sent; empty when absent. No other
	// message metadata is exposed.
	Source string
}

Message is the Go-native mirror of kandev.plugin.v1.Message — one user/agent message in a session transcript. Content has kandev's injected <kandev-system> blocks stripped; raw system content is never exposed.

type MessageDispatch

type MessageDispatch struct {
	SessionID string
	Status    string
}

MessageDispatch is the Go-native mirror of kandev.plugin.v1.SendMessageResponse — the result of delivering a prompt to a task session. Status is "queued" (the session was running and the message was queued for its next turn), "sent" (delivered to an idle/resumed session), or "started" (the session was launched with it as the first prompt).

type MessageFilter

type MessageFilter struct {
	SessionIDs []string
	TaskIDs    []string
	Since      *string
	Until      *string
	Types      []string
}

MessageFilter is the Go-native mirror of kandev.plugin.v1.MessageFilter. Since/Until are RFC3339 strings bounding created_at (Since inclusive, Until exclusive); nil means unbounded on that end.

type MessageReader

type MessageReader interface {
	// List returns messages matching filter, oldest first within a page.
	List(ctx context.Context, filter MessageFilter, page Page) ([]Message, *PageInfo, error)

	// Send delivers text as a prompt to a task session through kandev's
	// orchestrator (the same delivery path message_task uses), recording a
	// user message stamped "plugin:<id>". sessionID may be empty to target the
	// task's primary session. Returns the target session and a dispatch status
	// ("queued" | "sent" | "started"). Requires api_write:messages.
	Send(ctx context.Context, taskID, sessionID, text string) (*MessageDispatch, error)
}

MessageReader is the accessor behind Host.Messages(), mirroring the Host data API's ListMessages/SendMessage RPCs. List (api_read:messages) reads historical conversation content filtered by session, task, and/or time range; Send (api_write:messages) delivers a prompt to a task session. The two capabilities gate independently. (The name is kept for source stability with already-shipped read-only plugins; the interface now also writes.)

type MoveTaskInput

type MoveTaskInput struct {
	TaskID         string
	WorkflowStepID string
	WorkflowID     *string
	Position       int32
}

MoveTaskInput is the Go-native mirror of kandev.plugin.v1.MoveTaskRequest. Unlike Update, Move transitions the task through the same path the board's own move uses, so on_enter actions (auto-start included) actually fire. WorkflowID is optional: nil inherits the task's current workflow; a pointer to "" is rejected rather than treated as inherit. Position stays on the struct for wire compatibility but is ignored: the server computes an arriving task's position from the target step's current highest position, so it always sorts last there rather than displacing work a user has already ordered. Naming the task's current step is not an arrival and leaves its existing position untouched.

type MoveTaskOutcome

type MoveTaskOutcome struct {
	Task            *Task
	Transitioned    bool
	QueuedForStepID *string
	FromStepID      string
}

MoveTaskOutcome is the Go-native mirror of kandev.plugin.v1.MoveTaskResponse. Transitioned reports whether a ledger row was written for this move (false when the task was already on the target step). QueuedForStepID is the sole admission discriminator, reported on both values of Transitioned: nil means admitted (when Transitioned) or not applicable (when not); non-nil means queued for that step holding no WIP slot. FromStepID is the step the task left; empty when Transitioned is false.

type NotificationConfigurationRequest added in v0.3.0

type NotificationConfigurationRequest = pluginv1.NotificationConfigurationRequest

type NotificationConfigurationResponse added in v0.3.0

type NotificationConfigurationResponse = pluginv1.NotificationConfigurationResponse

type NotificationFormatRequest added in v0.3.0

type NotificationFormatRequest = pluginv1.NotificationFormatRequest

type NotificationFormatResponse added in v0.3.0

type NotificationFormatResponse = pluginv1.NotificationFormatResponse

type NotificationFormatter added in v0.3.0

type NotificationFormatter interface {
	FormatNotification(context.Context, *NotificationFormatRequest) (*NotificationFormatResponse, error)
	InspectNotificationConfiguration(context.Context, *NotificationConfigurationRequest) (*NotificationConfigurationResponse, error)
}

NotificationFormatter is optional. Implementations render only the requested immutable configuration and never deliver or mutate a notification.

type NotificationInboxContext added in v0.3.0

type NotificationInboxContext = pluginv1.NotificationInboxContext

type NotificationTaskContext added in v0.3.0

type NotificationTaskContext = pluginv1.NotificationTaskContext

type NotificationUpdateContext added in v0.3.0

type NotificationUpdateContext = pluginv1.NotificationUpdateContext

type Option

type Option func(*serveConfig)

Option configures Serve.

func WithHostDialTimeout

func WithHostDialTimeout(d time.Duration) Option

WithHostDialTimeout overrides how long Serve retries dialing kandev's Host broker connection before giving up (default 30s). Mainly useful in tests that want a tighter bound than production.

type Page

type Page struct {
	Limit  int32
	Cursor string
}

Page is the Go-native mirror of kandev.plugin.v1.Page: an opaque-cursor pagination request. A zero Page requests the server's default page.

type PageInfo

type PageInfo struct {
	NextCursor string
	HasMore    bool
}

PageInfo is the Go-native mirror of kandev.plugin.v1.PageInfo, returned alongside every paginated Host data read.

type PendingTaskTransition

type PendingTaskTransition struct {
	ID              string
	WorkspaceID     string
	TaskID          string
	FromWorkflowID  string
	FromStepID      string
	ToWorkflowID    string
	ToStepID        string
	State           string
	ResourceVersion string
	CreatedAt       string
}

type PermissionResponse

type PermissionResponse struct {
	InteractionID string
	OptionID      string
	Cancelled     bool
}

PermissionResponse names the option a user chose for a permission request. kandev derives the approve/deny outcome from that option's recorded kind, so a plugin cannot report an outcome the agent never offered. Set Cancelled to dismiss the request instead of choosing (OptionID must then be empty).

type Plugin

type Plugin interface {
	// OnEvent handles a single bus event delivery. A non-nil error causes
	// kandev's delivery subsystem to retry per §5 (3 retries, 5s/15s/45s).
	OnEvent(ctx context.Context, e *Event) error

	// HandleWebhook handles an inbound webhook relayed by kandev's
	// POST /api/plugins/{id}/webhooks/{key} endpoint.
	HandleWebhook(ctx context.Context, req *WebhookRequest) (*WebhookResponse, error)
}

Plugin is the interface a plugin author implements. It is delivered RPCs from kandev over the go-plugin gRPC transport (§3 of docs/plans/plugins/GRPC-CONTRACT.md): DeliverEvent -> OnEvent, HandleWebhook -> HandleWebhook.

type PluginActionRequest

type PluginActionRequest struct {
	ActionKey string
	Context   VerifiedActionContext
	Body      []byte
}

PluginActionRequest is the Go-native mirror of PluginActionRequest.

type PluginActionResponse

type PluginActionResponse struct {
	Body    []byte
	Headers map[string]string
	// Status is a final HTTP status in [200, 599]. Zero means 200 for
	// compatibility with plugins built before domain responses were added.
	Status int
}

PluginActionResponse is the Go-native mirror of PluginActionResponse. Kandev filters Headers before returning them to the browser.

type PluginOwnedTaskTreeHost

type PluginOwnedTaskTreeHost interface {
	PluginOwnedTaskTrees() PluginOwnedTaskTreeManager
}

PluginOwnedTaskTreeHost is an optional Host extension for previewing task trees whose source provenance matches the caller. Delete remains in the compatibility interface, but the current Kandev Host denies it because the RPC cannot carry a native Human's one-use task-deletion confirmation.

type PluginOwnedTaskTreeManager

type PluginOwnedTaskTreeManager interface {
	Preview(ctx context.Context, rootTaskID string) ([]Task, error)
	// Delete is retained for wire compatibility. The current Kandev Host returns
	// PermissionDenied with native_human_confirmation_required; direct plugins
	// to the native task UI when a person requests deletion.
	Delete(ctx context.Context, rootTaskID string) ([]string, error)
}

func PluginOwnedTaskTrees

func PluginOwnedTaskTrees(host Host) (PluginOwnedTaskTreeManager, bool)

PluginOwnedTaskTrees returns the optional provenance-safe task-tree manager.

type PluginTaskLaunchOptions

type PluginTaskLaunchOptions struct {
	AgentProfileID    *string
	ExecutorProfileID *string
	Prompt            *string
	PlanMode          *string
}

PluginTaskLaunchOptions declares the optional launch context for a plugin- created task. Host implementation validates each value before use.

type PluginTaskRepository

type PluginTaskRepository struct {
	RepositoryID      string
	Remote            *RemoteRepositoryDescriptor
	BaseBranch        *string
	CheckoutBranch    *string
	PullRequestNumber *int64
}

PluginTaskRepository selects an existing repository or a complete remote descriptor to attach when a plugin creates a task.

type ReadExecutorRuntimeArtifactRequest

type ReadExecutorRuntimeArtifactRequest = pluginv1.ReadExecutorRuntimeArtifactRequest

type RecoverExecutorOperationRequest

type RecoverExecutorOperationRequest = pluginv1.RecoverExecutorOperationRequest

type RecoverExecutorOperationResponse

type RecoverExecutorOperationResponse = pluginv1.RecoverExecutorOperationResponse

type RemotePlugin

type RemotePlugin struct {
	// contains filtered or unexported fields
}

RemotePlugin is the Go-native client kandev's runtime manager uses to call a running plugin, returned by Dispense(pluginsdk.PluginMapKey).

func (*RemotePlugin) ApplySourceIssueProviderWriteback added in v0.6.0

func (*RemotePlugin) AuthorizeEntityReference

AuthorizeEntityReference calls an optional live reference authorizer.

func (*RemotePlugin) DeliverEvent

func (r *RemotePlugin) DeliverEvent(ctx context.Context, e *Event) error

DeliverEvent calls the plugin's DeliverEvent RPC. Timeout/retry policy (§5: 10s timeout, 3 retries) is the caller's responsibility — this method is a thin, context-respecting proxy.

func (*RemotePlugin) DescribeAutomationCondition

func (r *RemotePlugin) DescribeAutomationCondition(ctx context.Context, req *AutomationConditionRequest) (*AutomationConditionResponse, error)

func (*RemotePlugin) EventOriginContext

func (r *RemotePlugin) EventOriginContext(ctx context.Context, reference string) (context.Context, context.CancelFunc)

EventOriginContext resolves a plugin-emitted event against the same live invocation map used by Host callbacks. References never survive a restart.

func (*RemotePlugin) FormatNotification added in v0.3.0

func (*RemotePlugin) GetGitCredentialBinding

GetGitCredentialBinding calls an optional non-secret credential-binding extension for an exact host-verified lease scope.

func (*RemotePlugin) GetSourceIssueProviderCapabilities added in v0.6.0

func (*RemotePlugin) HandleAction

HandleAction calls an optional authenticated plugin action.

func (*RemotePlugin) HandleWebhook

func (r *RemotePlugin) HandleWebhook(ctx context.Context, req *WebhookRequest) (*WebhookResponse, error)

HandleWebhook calls the plugin's HandleWebhook RPC.

func (*RemotePlugin) InspectNotificationConfiguration added in v0.3.0

func (r *RemotePlugin) InspectNotificationConfiguration(ctx context.Context, req *NotificationConfigurationRequest) (*NotificationConfigurationResponse, error)

func (*RemotePlugin) InvokeAgentTool

func (r *RemotePlugin) InvokeAgentTool(ctx context.Context, req *AgentToolRequest) (*AgentToolResult, error)

InvokeAgentTool calls the optional plugin agent-tool RPC. The caller owns timeout and retry policy because tool calls may have side effects.

func (*RemotePlugin) RecoverExecutorOperation

func (*RemotePlugin) ResolveGitCredential

ResolveGitCredential calls an optional declared-provider credential resolver.

func (*RemotePlugin) SearchEntityReferences

SearchEntityReferences calls an optional manifest-owned reference source.

func (*RemotePlugin) ValidateExecutorProfile

func (*RemotePlugin) VerifyAutomationWebhook

func (r *RemotePlugin) VerifyAutomationWebhook(ctx context.Context, req *AutomationWebhookRequest) (*AutomationWebhookResponse, error)

type RemoteRepositoryDescriptor

type RemoteRepositoryDescriptor struct {
	ProviderID           string
	ProviderHost         string
	ProviderScope        string
	OwnerOrProject       string
	ProviderRepositoryID string
	Name                 string
	CloneURL             string
	DefaultBranch        *string
	BaseBranch           *string
	HeadBranch           *string
	PullRequestNumber    *int64
}

RemoteRepositoryDescriptor is a fully resolved plugin-provider repository identity. CloneURL is exact and credential-free; the host must not rebuild it.

type ReportExecutorProgressRequest

type ReportExecutorProgressRequest = pluginv1.ReportExecutorProgressRequest

type ReportExecutorProgressResponse

type ReportExecutorProgressResponse = pluginv1.ReportExecutorProgressResponse

type Repository

type Repository struct {
	ID                   string
	WorkspaceID          string
	Name                 string
	DefaultBranch        *string
	SourceType           string
	ProviderID           string
	ProviderRepositoryID string
	ProviderHost         string
	ProviderScope        string
	OwnerOrProject       string
	ProviderName         string
	RemoteURL            string
}

Repository is the Go-native mirror of kandev.plugin.v1.Repository.

type RepositoryReader

type RepositoryReader interface {
	// List returns repositories for workspaceID.
	List(ctx context.Context, workspaceID string, page Page) ([]Repository, *PageInfo, error)
}

RepositoryReader is the read-only accessor behind Host.Repositories(), mirroring the Host data API's ListRepositories RPC.

type ResolveExecutorConnectionRequest

type ResolveExecutorConnectionRequest = pluginv1.ResolveExecutorConnectionRequest

type ResolveExecutorConnectionResponse

type ResolveExecutorConnectionResponse = pluginv1.ResolveExecutorConnectionResponse

type ResolveGitCredentialRequest

type ResolveGitCredentialRequest struct {
	ProviderID   string
	WorkspaceID  string
	TaskID       string
	SessionID    string
	RepositoryID string
	Host         string
	Path         string
}

ResolveGitCredentialRequest contains exact host-verified lease scope.

type ResolveGitCredentialResponse

type ResolveGitCredentialResponse struct {
	Username  string
	Secret    string
	ExpiresAt string
}

ResolveGitCredentialResponse is transient authentication material. Hosts must not log or persist Secret.

type SearchEntityReferencesRequest

type SearchEntityReferencesRequest struct {
	Source      string
	WorkspaceID string
	Query       string
	Limit       int32
}

SearchEntityReferencesRequest is a host-verified workspace search request.

type SearchEntityReferencesResponse

type SearchEntityReferencesResponse struct{ Candidates []EntityReferenceCandidate }

SearchEntityReferencesResponse is the Go-native search response.

type Session

type Session struct {
	ID               string
	TaskID           string
	AgentProfileID   string
	AgentDisplayName string
	Model            string
	ACPSessionID     string
	State            string
	StartedAt        string
	EndedAt          *string
	AgentProfileName string // profile name from the snapshot at run time
}

Session is the Go-native mirror of kandev.plugin.v1.Session.

type SessionCodeStats

type SessionCodeStats struct {
	SessionID               string
	LinesAddedCommitted     int64
	LinesDeletedCommitted   int64
	LinesAddedPeakPending   int64
	LinesDeletedPeakPending int64
	CommittedLinesAvailable bool
}

SessionCodeStats is the Go-native mirror of kandev.plugin.v1.SessionCodeStats — a computed per-session code-change summary, never the raw commit/snapshot rows.

CommittedLinesAvailable is false (with LinesAddedCommitted/ LinesDeletedCommitted reading 0) for a session that predates commit-capture activation and has no observed commits — capture wasn't running yet, so that zero cannot be told apart from a real zero-change session. This is a separate bool rather than making the existing fields pointers: they are already-shipped public SDK fields (ADR 0043's additive-only DTO contract), and changing their Go type from int64 to *int64 would be a source-compatibility break for any plugin rebuilding against a new SDK version. See internal/analytics/models.SessionCodeStats for the full contract (that internal type is not part of the public plugin surface and keeps its own *int64 representation).

type SessionFilter

type SessionFilter struct {
	TaskIDs      []string
	WorkspaceIDs []string
	States       []string
}

SessionFilter is the Go-native mirror of kandev.plugin.v1.SessionFilter.

type SessionModeContext

type SessionModeContext struct {
	SessionID, ExecutionID, CurrentModeID string
	AvailableModes                        []SessionModeOption
	ResourceVersion, ObservedAt           string
}

SessionModeContext is a provider snapshot for one observed execution.

type SessionModeOption

type SessionModeOption struct {
	ID, Name, Description string
}

SessionModeOption describes a mode advertised by the active provider.

type SessionReader

type SessionReader interface {
	// List returns sessions matching filter.
	List(ctx context.Context, filter SessionFilter, page Page) ([]Session, *PageInfo, error)

	// CodeStats returns computed per-session code-change stats matching
	// filter. SessionCodeStats is a stable, computed shape — never raw
	// commit/snapshot rows.
	CodeStats(ctx context.Context, filter SessionFilter, page Page) ([]SessionCodeStats, *PageInfo, error)
}

SessionReader is the read-only accessor behind Host.Sessions(), mirroring the Host data API's ListSessions/ListSessionCodeStats RPCs.

type SessionTurnHost added in v0.6.0

type SessionTurnHost interface {
	SessionTurns() SessionTurnReader
}

SessionTurnHost is an optional Host extension. The base Host interface stays unchanged so existing implementations keep working.

type SessionTurnObservation added in v0.6.0

type SessionTurnObservation struct {
	TurnID      string
	SessionID   string
	StartedAt   string
	CompletedAt *string
}

SessionTurnObservation is one retained agent turn's timing. CompletedAt is nil while the turn is open.

type SessionTurnPage added in v0.6.0

type SessionTurnPage struct {
	Items    []SessionTurnObservation
	PageInfo ExactReadPageInfo
}

type SessionTurnQuery added in v0.6.0

type SessionTurnQuery struct {
	RequestID     string
	WorkspaceID   string
	TaskID        string
	SessionID     string
	StartedFrom   *string
	StartedBefore *string
	Page          ExactReadPage
}

SessionTurnQuery selects retained agent turns for one workspace and exactly one task or session selector. StartedFrom is inclusive and StartedBefore is exclusive; nil bounds are omitted. Times are UTC RFC3339Nano strings.

type SessionTurnReader added in v0.6.0

type SessionTurnReader interface {
	ListSessionTurns(context.Context, SessionTurnQuery) (SessionTurnPage, error)
}

SessionTurnReader is the optional workspace-authorized turn timing reader.

func HostSessionTurns added in v0.6.0

func HostSessionTurns(host Host) (SessionTurnReader, bool)

HostSessionTurns reports whether host exposes the optional turn timing reader. A remote Host wrapper always reports true; a call against an older server then fails with Unimplemented.

type SidebarGroupingMembership added in v0.4.0

type SidebarGroupingMembership struct {
	TaskID  string `json:"task_id"`
	GroupID string `json:"group_id"`
}

type SidebarGroupingProvider added in v0.4.0

type SidebarGroupingProvider struct {
	Reference  string `json:"reference"`
	Label      string `json:"label"`
	LabelKey   string `json:"labelKey,omitempty"`
	Generation string `json:"generation"`
}

SidebarGroupingProvider is host-owned metadata for a complete grouping. It contains no classification values, task IDs, or dispatchable action names.

type SidebarGroupingSnapshot added in v0.4.0

type SidebarGroupingSnapshot struct {
	Version     int                         `json:"version"`
	Revision    string                      `json:"revision"`
	Complete    bool                        `json:"complete"`
	Groups      []SidebarGroupingValue      `json:"groups"`
	Memberships []SidebarGroupingMembership `json:"memberships"`
}

SidebarGroupingSnapshot is a complete workspace classification returned by a manifest-declared sidebar grouping action. Membership never grants access.

func DecodeSidebarGroupingSnapshot added in v0.4.0

func DecodeSidebarGroupingSnapshot(body []byte) (*SidebarGroupingSnapshot, error)

DecodeSidebarGroupingSnapshot validates a bounded, explicitly complete snapshot.

type SidebarGroupingValue added in v0.4.0

type SidebarGroupingValue struct {
	ID    string `json:"id"`
	Label string `json:"label"`
	Color string `json:"color,omitempty"`
}

type SourceIssueCapabilities

type SourceIssueCapabilities struct {
	WorkspaceID         string
	TaskID              string
	TaskResourceVersion string
	Provider            string
	SourceID            string
	Identifier          string
	URL                 string
	Title               string
	StatusID            string
	StatusName          string
	Transitions         []SourceIssueTransition
	Operations          []string
	// Revision is the provider's opaque tracker revision token. The Host
	// passes it back to the provider before a conditional write.
	Revision string
	// Generation and InstallationID are Host-internal dispatch identity. They
	// are set only for plugin-owned providers and are not part of the Host RPC
	// item.
	Generation      string
	InstallationID  string
	ResourceVersion string
	ObservedAt      string
	Receipt         HostReadReceipt
}

type SourceIssueCapabilitiesQuery

type SourceIssueCapabilitiesQuery struct {
	RequestID   string
	WorkspaceID string
	TaskID      string
}

type SourceIssueLinkCommand added in v0.6.0

type SourceIssueLinkCommand struct {
	RequestID                   string
	WorkspaceID                 string
	TaskID                      string
	IdempotencyKey              string
	ExpectedTaskResourceVersion string
	Provider                    string
	SourceID                    string
	SourceURL                   string
	ApprovalRevision            uint64
	ManifestDigest              string
}

SourceIssueLinkCommand establishes the first source-issue association for a task. External identity is Host-derived; the caller supplies only the provider and its opaque issue identity.

type SourceIssueProviderCapabilitiesRequest added in v0.6.0

type SourceIssueProviderCapabilitiesRequest = pluginv1.SourceIssueProviderCapabilitiesRequest

type SourceIssueProviderCapabilitiesResponse added in v0.6.0

type SourceIssueProviderCapabilitiesResponse = pluginv1.SourceIssueProviderCapabilitiesResponse

type SourceIssueProviderContext added in v0.6.0

type SourceIssueProviderContext = pluginv1.SourceIssueProviderContext

type SourceIssueProviderPlugin added in v0.6.0

type SourceIssueProviderPlugin interface {
	GetSourceIssueProviderCapabilities(context.Context, *SourceIssueProviderCapabilitiesRequest) (*SourceIssueProviderCapabilitiesResponse, error)
	ApplySourceIssueProviderWriteback(context.Context, *SourceIssueProviderWritebackRequest) (*SourceIssueProviderWritebackResponse, error)
}

SourceIssueProviderPlugin is an optional all-or-nothing extension for plugins that own source-issue providers. The Host dispatches neither method unless both are implemented.

type SourceIssueProviderTransition added in v0.6.0

type SourceIssueProviderTransition = pluginv1.SourceIssueTransition

type SourceIssueProviderWritebackRequest added in v0.6.0

type SourceIssueProviderWritebackRequest = pluginv1.SourceIssueProviderWritebackRequest

type SourceIssueProviderWritebackResponse added in v0.6.0

type SourceIssueProviderWritebackResponse = pluginv1.SourceIssueProviderWritebackResponse

type SourceIssueTransition

type SourceIssueTransition struct {
	TargetID   string
	TargetName string
}

type SourceIssueWorklogCommand added in v0.6.0

type SourceIssueWorklogCommand struct {
	RequestID                     string
	WorkspaceID                   string
	TaskID                        string
	SessionID                     string
	IdempotencyKey                string
	ExpectedTaskResourceVersion   string
	ExpectedSourceResourceVersion string
	DurationSeconds               int32
	StartedAt                     string
	Comment                       string
	ApprovalRevision              uint64
	ManifestDigest                string
}

SourceIssueWorklogCommand books a session's work against the linked issue. StartedAt is RFC 3339; the Host normalizes it to UTC for the payload digest.

type SourceIssueWritebackCommand

type SourceIssueWritebackCommand struct {
	RequestID                     string
	WorkspaceID                   string
	TaskID                        string
	IdempotencyKey                string
	ExpectedTaskResourceVersion   string
	ExpectedSourceResourceVersion string
	ApprovalRevision              uint64
	ManifestDigest                string
	Body                          string
	TargetID                      string
	// Worklog fields are populated only by LogSourceIssueWorkExact.
	SessionID       string
	DurationSeconds int32
	StartedAt       string
	Comment         string
}

type SourceIssueWritebackReceipt

type SourceIssueWritebackReceipt struct {
	ReceiptID             string
	OperationID           string
	InstallationID        string
	WorkspaceID           string
	TaskID                string
	Provider              string
	SourceID              string
	Operation             string
	State                 string
	Status                CommandStatus
	Reason                string
	ProviderReceiptID     string
	ExpectedSourceVersion string
	CreatedAt             string
	UpdatedAt             string
}

type StateEntry

type StateEntry struct {
	Key       string
	Value     map[string]any
	UpdatedAt string
}

StateEntry is the Go-native mirror of kandev.plugin.v1.StateEntry, as returned by Host.ListState.

type StepApproval added in v0.5.0

type StepApproval struct {
	SessionID, TaskID           string
	Awaiting                    bool
	FromStepID, FromStepName    string
	ToStepID, ToStepName        string
	ResourceVersion, ObservedAt string
}

StepApproval reports whether a session's current workflow step awaits the native Approve action and where approval moves the task. ToStepID is empty when approval does not move the task (a final step). ResourceVersion is the target revision a step_approval receipt and ApproveStep must name.

type StepApprovalResult added in v0.5.0

type StepApprovalResult struct {
	FromStepID, ToStepID string
}

StepApprovalResult names the step the session was approved in and the step the task moved to; ToStepID is empty when the task did not move.

type Task

type Task struct {
	ID              string
	WorkspaceID     string
	WorkflowID      string
	ResourceVersion string
	Title           string
	Description     string
	State           string
	// Priority is one of critical, high, medium, or low.
	Priority     string
	CreatedBy    string
	CreatedAt    string
	UpdatedAt    string
	StartedAt    *string
	CompletedAt  *string
	ParentID     *string
	Identifier   string
	IsEphemeral  bool
	Repositories []TaskRepository
	Metadata     map[string]any
	// ArchivedAt is nil for a live task. Only ever populated when the read asked
	// for archived tasks (TaskFilter.IncludeArchived).
	ArchivedAt *string
	// PullRequests are the changes opened for this task, newest first. The link
	// is not derivable from any other field on Task: CheckoutBranch is the BASE
	// branch, and a PR title is rewritten to conventional-commit form.
	PullRequests []TaskPullRequest
	// WorkflowStepID is where on the board the task stands. State says how it is
	// going; this says where it is.
	WorkflowStepID         string
	Position               int32
	AssigneeAgentProfileID string
	// Deprecated: provider-specific labels belong in plugin-owned task state
	// and UI slot data. Retained for API v1 source and wire compatibility.
	Labels          []string
	Autopilot       bool
	WIPAdmitted     bool
	QueuedForStepID string
	QueuedAt        *string
	ProjectID       string
	ExternalID      string
	// Dependency projection derived from task_blockers. Blocked and
	// BlockedReason report the task's own gate; DependsOn is what it is
	// waiting on and Blocks is what is waiting on it. A read that cannot
	// resolve the dependency graph reports Blocked=true,
	// BlockedReason="unknown" and empty lists rather than a false
	// "unblocked".
	Blocked            bool
	BlockedReason      string // "pending" | "failed" | "unknown" | ""
	DependsOn          []TaskDependencyRef
	Blocks             []TaskDependencyRef
	DependsOnTruncated bool
	BlocksTruncated    bool
	// StartWhenUnblocked is always false when BlockedReason is "unknown",
	// regardless of the underlying stored configuration.
	StartWhenUnblocked bool
}

Task is the Go-native mirror of kandev.plugin.v1.Task.

type TaskCompletionBlocker

type TaskCompletionBlocker struct {
	CriterionID string
	Reason      string
}

type TaskCompletionCriterion

type TaskCompletionCriterion struct {
	ID                string
	Description       string
	EvidenceSubject   TaskCompletionEvidenceSubject
	CriterionRevision int64
	VerifiedRevision  int64
	Evidence          *TaskCompletionEvidence
	VerifierKind      string
	VerifierID        string
	VerifiedAt        string
}

type TaskCompletionCriterionInput

type TaskCompletionCriterionInput struct {
	ID              string
	Description     string
	EvidenceSubject TaskCompletionEvidenceSubject
}

type TaskCompletionEvidence

type TaskCompletionEvidence struct {
	Subject   TaskCompletionEvidenceSubject
	Summary   string
	Reference string
}

type TaskCompletionEvidenceSubject

type TaskCompletionEvidenceSubject struct {
	Kind     string
	ID       string
	Revision string
}

type TaskCompletionGate

type TaskCompletionGate struct {
	TaskID      string
	WorkspaceID string
	Revision    int64
	Criteria    []TaskCompletionCriterion
	Blockers    []TaskCompletionBlocker
	Blocked     bool
}

type TaskDependencyRef

type TaskDependencyRef struct {
	ID    string
	Title string // redacted to "" on a canvas surface outside the caller's scope
	State string // redacted to "" alongside Title
	// Status is DependencyStatusForTask's verdict ("resolved" | "failed" |
	// "pending"). Always "" on a Blocks entry.
	Status string
	// WorkspaceID is never sent over the wire (not mapped by toProto/proto
	// decode). It exists only so a canvas surface can decide, without a
	// further read, whether this ref falls outside the caller's scope.
	WorkspaceID string
}

TaskDependencyRef is one edge end in a task's dependency projection: a predecessor entry in DependsOn, or a dependent entry in Blocks.

type TaskDirective

type TaskDirective struct {
	ID                string
	WorkspaceID       string
	TaskID            string
	CapabilityClass   string
	State             string
	InstructionDigest string
	ExpiresAt         *string
	ResourceVersion   string
}

type TaskFilter

type TaskFilter struct {
	WorkspaceIDs     []string
	WorkflowIDs      []string
	States           []string
	ParentID         *string
	IncludeEphemeral bool
	// IncludeArchived defaults false, matching the behaviour before this field
	// existed: a plugin that does not ask still sees only live tasks. A plugin
	// reporting on delivery needs true — an archived task is usually a
	// delivered one, and omitting it makes finished work look like it never
	// happened.
	IncludeArchived bool
}

TaskFilter is the Go-native mirror of kandev.plugin.v1.TaskFilter.

type TaskInboxItem

type TaskInboxItem struct {
	ID              string
	WorkspaceID     string
	TaskID          string
	SessionID       string
	Kind            string
	State           string
	CreatedAt       string
	ResourceVersion string
}

type TaskManagementClaim

type TaskManagementClaim struct {
	TaskID          string
	WorkspaceID     string
	OwnerKind       string
	OwnerActorID    string
	InstallationID  string
	InstanceKey     string
	Generation      int64
	ResourceVersion string
	AcquiredAt      string
	UpdatedAt       string
	UpdatedByActor  string
}

TaskManagementClaim is the Host's owner projection for one task. The generation is a fencing token and remains monotonic after release.

type TaskPullRequest

type TaskPullRequest struct {
	Number     int64
	URL        string
	Title      string
	State      string // "open" | "closed" | "merged"
	HeadBranch string
	BaseBranch string
	IsDraft    bool
	Provider   string // "github" | "gitlab"
	MergedAt   *string
	ClosedAt   *string
	// Readiness, already synced by kandev's PR watcher. Carried so a plugin
	// asking "what can merge" does not re-fetch all of it from the forge.
	ReviewState             string
	ChecksState             string
	MergeableState          string
	UnresolvedReviewThreads int32
	ChecksTotal             int32
	ChecksPassing           int32
	Additions               int32
	Deletions               int32
	AuthorLogin             string
}

TaskPullRequest is one change opened for a task. Provider-neutral by design: review metadata specific to one forge stays out of the plugin contract.

type TaskReader

type TaskReader interface {
	// List returns tasks matching filter, newest page first per page.
	List(ctx context.Context, filter TaskFilter, page Page) ([]Task, *PageInfo, error)

	// Get returns a single task by id.
	Get(ctx context.Context, id string) (*Task, error)

	// Create creates a task through kandev's task service (so task.* events
	// fire and WS clients update) and returns the created task. Requires
	// api_write:tasks.
	Create(ctx context.Context, in CreateTaskInput) (*Task, error)

	// Update mutates a conservative field surface of an existing task
	// (title/description/state) and returns the updated task. Requires
	// api_write:tasks. WorkflowStepID is rejected when present — use Move to
	// transition a task between workflow steps.
	Update(ctx context.Context, in UpdateTaskInput) (*Task, error)

	// Move transitions a task to a workflow step through the same path the
	// board's own move uses (validation, WIP admission, task.moved
	// publication, auto-start gates, queue reconciliation) — unlike Update,
	// which rejects a workflow step change. Requires api_write:tasks.
	Move(ctx context.Context, in MoveTaskInput) (*MoveTaskOutcome, error)
}

TaskReader is the accessor behind Host.Tasks(), mirroring the Host data API's ListTasks/GetTask/CreateTask/UpdateTask RPCs (ADR 0043). Reads (List/Get) require api_read:tasks; writes (Create/Update) require api_write:tasks — the two capabilities gate independently, so a plugin may declare one without the other. (The name is kept for source stability with already-shipped read-only plugins; the interface now also writes.)

type TaskRelation

type TaskRelation struct {
	WorkspaceID           string
	SourceTaskID          string
	TargetTaskID          string
	Kind                  string
	SourceResourceVersion string
	TargetResourceVersion string
	ResourceVersion       string
}

type TaskRepository

type TaskRepository struct {
	ID             string
	RepositoryID   string
	BaseBranch     string
	Position       int32
	CheckoutBranch string
}

TaskRepository is the Go-native mirror of kandev.plugin.v1.TaskRepository.

type TaskStepTransition

type TaskStepTransition struct {
	ID                 string
	FromWorkflowID     *string
	FromWorkflowStepID *string
	ToWorkflowID       *string
	ToWorkflowStepID   *string
	Trigger            string
	OccurredAt         string
}

TaskStepTransition is one retained task movement. Identity is a decimal string to preserve the ledger's int64 value in browser and SDK clients.

type TaskUsageObservation

type TaskUsageObservation struct {
	TaskID               string
	SessionID            *string
	TokensIn             int64
	TokensCachedRead     int64
	TokensCachedWrite    int64
	TokensOut            int64
	TokensThought        int64
	TokensTotal          int64
	CostSubcents         *int64
	Currency             string
	EventCount           int64
	EstimatedEventCount  int64
	UnpricedEventCount   int64
	OutputTokensComplete bool
	ObservationState     string
	CostUnknownReason    *string
	CostComplete         bool
	FirstEventAt         *string
	LastEventAt          *string
	ElapsedMilliseconds  *int64
	ResourceVersion      string
	ObservedAt           string
}

type TransitionHistoryHost

type TransitionHistoryHost interface {
	Transitions() TransitionHistoryReader
}

type TransitionHistoryReader

type TransitionHistoryReader interface {
	ListTask(ctx context.Context, taskID string, page Page) ([]TaskStepTransition, *PageInfo, error)
	ListWorkflowGroups(ctx context.Context, workflowID string, page Page) ([]WorkflowTransitionGroup, *PageInfo, error)
}

TransitionHistoryReader is an optional Host extension so existing Host implementations remain source compatible.

func TransitionHistory

func TransitionHistory(host Host) (TransitionHistoryReader, bool)

TransitionHistory returns a Host's optional transition-history reader.

type UnimplementedHostData

type UnimplementedHostData struct{}

UnimplementedHostData is an embeddable default for the Host data API (ADR 0043) sub-accessors: Tasks/Sessions/Workspaces/Workflows/ AgentProfiles/Repositories. Embed it in a Go-native Host implementation to satisfy the interface before wiring real data access — every method on every returned reader returns a gRPC Unimplemented error. Override individual accessor methods (e.g. define your own Tasks() on the embedding type) as real capability-gated, service-backed logic lands; unlike UnimplementedPlugin's per-RPC methods, these are per-resource accessors because each one fans out to multiple reader methods.

func (UnimplementedHostData) AgentConversations

func (UnimplementedHostData) AgentConversations() AgentConversationManager

AgentConversations is the embeddable default for the agent_conversation Host extension: a Host that hasn't wired a conversation manager still satisfies AgentConversationHost, returning gRPC Unimplemented until overridden.

func (UnimplementedHostData) AgentProfiles

func (UnimplementedHostData) AgentProfiles() AgentProfileReader

func (UnimplementedHostData) ExecutorProfiles

func (UnimplementedHostData) ExecutorProfiles() ExecutorProfileReader

func (UnimplementedHostData) Interactions

Interactions is the embeddable default on UnimplementedHostData, so a Host that has not wired the interaction API still satisfies InteractionHost and answers Unimplemented rather than panicking.

func (UnimplementedHostData) InvokeUtilityAgent

InvokeUtilityAgent is the embeddable default for the agent_invoke Host method (ADR 0048). It lives on UnimplementedHostData — the shared "unimplemented Host extensions" embed both real Host implementations use — so a Host that hasn't wired a utility agent (e.g. a test double) still satisfies the interface, returning gRPC Unimplemented until overridden.

func (UnimplementedHostData) Messages

func (UnimplementedHostData) PluginOwnedTaskTrees

func (UnimplementedHostData) PluginOwnedTaskTrees() PluginOwnedTaskTreeManager

func (UnimplementedHostData) Repositories

func (UnimplementedHostData) Repositories() RepositoryReader

func (UnimplementedHostData) Sessions

func (UnimplementedHostData) Tasks

func (UnimplementedHostData) Workflows

func (UnimplementedHostData) Workspaces

type UnimplementedPlugin

type UnimplementedPlugin struct {
	// contains filtered or unexported fields
}

UnimplementedPlugin is an embeddable no-op base for Plugin. Authors that only care about one or two RPCs embed this and override the rest. It also implements HostSetter, storing the injected Host for retrieval via Host().

SetHost is called from a background goroutine (see the GRPCPlugin doc comment in serve.go for why), so access to the stored Host is mutex-guarded — Host() may be called concurrently with SetHost from another goroutine.

func (*UnimplementedPlugin) HandleWebhook

HandleWebhook is a no-op default: it returns 404, since an unhandled webhook path has nothing sensible to serve.

func (*UnimplementedPlugin) Host

func (p *UnimplementedPlugin) Host() Host

Host returns the Host injected by Serve, or nil if the broker connection hasn't completed yet (or Serve hasn't been called, e.g. in unit tests).

func (*UnimplementedPlugin) InvokeAgentTool

func (*UnimplementedPlugin) OnEvent

OnEvent is a no-op default: it accepts the event without doing anything.

Pointer receiver (like every other UnimplementedPlugin method): the type embeds a sync.RWMutex, and a value receiver would trip go vet's copylocks check even though this method never touches it.

func (*UnimplementedPlugin) SetHost

func (p *UnimplementedPlugin) SetHost(h Host)

SetHost stores the Host injected by Serve. Call Host() from your overridden methods to reach kandev.

type UpdateTaskInput

type UpdateTaskInput struct {
	ID             string
	Title          *string
	Description    *string
	State          *string
	WorkflowStepID *string
	// Priority, when set, must be critical, high, medium, or low.
	Priority *string
}

UpdateTaskInput is the Go-native mirror of kandev.plugin.v1.UpdateTaskRequest. Every field except ID is optional: a nil pointer leaves that field untouched, a non-nil pointer overwrites it. The conservative field surface (title/description/state/priority) is the documented plugin-writable mask. WorkflowStepID is rejected when non-nil — it exists on this struct only for wire-shape symmetry with UpdateTaskRequest; use TaskReader.Move (see host.go) to transition a task between workflow steps, which routes through the same validation, WIP admission, task.moved publication, auto-start gates, and queue reconciliation the board's own move uses.

type UtilityAgentOptions

type UtilityAgentOptions struct {
	ProfileID string
}

UtilityAgentOptions contains per-call utility completion options. ProfileID is an agent-profile ID, not a utility-agent record ID. An empty value uses the platform default.

type ValidateExecutorProfileRequest

type ValidateExecutorProfileRequest = pluginv1.ValidateExecutorProfileRequest

type ValidateExecutorProfileResponse

type ValidateExecutorProfileResponse = pluginv1.ValidateExecutorProfileResponse

type VerifiedActionContext

type VerifiedActionContext struct {
	ActorID                  string
	WorkspaceID              string
	TaskID                   string
	RepositoryID             string
	SessionID                string
	HeadBranch               string
	NotificationProviderID   string
	NotificationFormatterKey string
}

VerifiedActionContext is derived by Kandev after authenticating and authorizing an action request. Plugins must treat Body as untrusted input and use this context for all authority decisions.

type WebhookRequest

type WebhookRequest struct {
	WebhookKey string
	Method     string
	Path       string
	Query      string
	Headers    map[string]string
	Body       []byte
}

WebhookRequest is the Go-native mirror of kandev.plugin.v1.WebhookRequest, delivered to a Plugin's HandleWebhook method. Unlike Event, it has no Struct-typed fields so conversion cannot fail.

type WebhookResponse

type WebhookResponse struct {
	Status  int32
	Headers map[string]string
	Body    []byte
}

WebhookResponse is the Go-native mirror of kandev.plugin.v1.WebhookResponse, returned by a Plugin's HandleWebhook method.

type Workflow

type Workflow struct {
	ID          string
	WorkspaceID string
	Name        string
	Description *string
	SortOrder   int32
	CreatedAt   string
	UpdatedAt   string
}

Workflow is the Go-native mirror of kandev.plugin.v1.Workflow.

type WorkflowReader

type WorkflowReader interface {
	// List returns workflows for workspaceID.
	List(ctx context.Context, workspaceID string, page Page) ([]Workflow, *PageInfo, error)

	// ListSteps returns the steps for workflowID, in position order.
	ListSteps(ctx context.Context, workflowID string) ([]WorkflowStep, error)
}

WorkflowReader is the read-only accessor behind Host.Workflows(), mirroring the Host data API's ListWorkflows/ListWorkflowSteps RPCs.

type WorkflowStep

type WorkflowStep struct {
	ID         string
	WorkflowID string
	Name       string
	Position   int32
	StageType  string
	// Color is the step's own presentation colour. A plugin rendering a board
	// reads it rather than inventing a palette, so its columns match the ones
	// the operator already sees in kandev.
	Color          string
	IsStartStep    bool
	WIPLimit       int32 // 0 means unlimited
	AgentProfileID string
	// OnEnterActionTypes lists the on_enter action types configured on this
	// step, as authored. A type appearing here means it is configured, not a
	// guarantee of when or whether it fires. Config maps are deliberately not
	// exposed. Nil when the step has no on_enter actions, never an empty
	// non-nil slice. Callers must ignore action types they do not recognize.
	OnEnterActionTypes []string
}

WorkflowStep is the Go-native mirror of kandev.plugin.v1.WorkflowStep.

type WorkflowStepConfiguration

type WorkflowStepConfiguration struct {
	ID                         string
	WorkflowID                 string
	Name                       string
	Position                   int32
	StageType                  string
	Color                      string
	Prompt                     string
	AllowManualMove            bool
	IsStartStep                bool
	ShowInCommandPanel         bool
	AutoArchiveAfterHours      int32
	AgentProfileID             string
	ProfileSessionStartPolicy  string
	ProfileSessionEndPolicy    string
	WIPLimit                   int32
	PullFromStepID             string
	AutoAdvanceRequiresSignal  bool
	CancelTriggersTurnComplete bool
	CompleteTaskOnEnter        bool
	OnEnterActionTypes         []string
	OnTurnStartActions         []WorkflowTransitionAction
	OnTurnCompleteActions      []WorkflowTransitionAction
}

type WorkflowTransitionAction

type WorkflowTransitionAction struct {
	Type         string
	TargetStepID string
}

type WorkflowTransitionGroup

type WorkflowTransitionGroup struct {
	Kind       string
	FromStepID *string
	ToStepID   *string
	Count      int64
}

WorkflowTransitionGroup counts one route through or across a workflow.

type Workspace

type Workspace struct {
	ID                    string
	Name                  string
	Description           *string
	OwnerID               string
	DefaultExecutorID     *string
	DefaultAgentProfileID *string
	CreatedAt             string
	UpdatedAt             string
}

Workspace is the Go-native mirror of kandev.plugin.v1.Workspace.

type WorkspaceAdminCommand

type WorkspaceAdminCommand struct {
	RequestID        string
	WorkspaceID      string
	IdempotencyKey   string
	ApprovalRevision uint64
	ManifestDigest   string
	UpdateDefaults   *WorkspaceDefaultsUpdate
	CreateWorkflow   *WorkspaceWorkflowCreate
	UpdateWorkflow   *WorkspaceWorkflowUpdate
	ReorderWorkflows *WorkspaceWorkflowReorder
	CreateStep       *WorkspaceWorkflowStepCreate
	UpdateStep       *WorkspaceWorkflowStepUpdate
	ReorderSteps     *WorkspaceWorkflowStepReorder
	RegisterRepo     *WorkspaceRepositoryRegister
	UpdateRepo       *WorkspaceRepositoryUpdate
}

type WorkspaceAdminOperationKind

type WorkspaceAdminOperationKind string
const (
	WorkspaceAdminUpdateDefaults      WorkspaceAdminOperationKind = "UpdateWorkspaceDefaultsExact"
	WorkspaceAdminCreateWorkflow      WorkspaceAdminOperationKind = "CreateWorkflowExact"
	WorkspaceAdminUpdateWorkflow      WorkspaceAdminOperationKind = "UpdateWorkflowExact"
	WorkspaceAdminReorderWorkflows    WorkspaceAdminOperationKind = "ReorderWorkflowsExact"
	WorkspaceAdminCreateWorkflowStep  WorkspaceAdminOperationKind = "CreateWorkflowStepExact"
	WorkspaceAdminUpdateWorkflowStep  WorkspaceAdminOperationKind = "UpdateWorkflowStepExact"
	WorkspaceAdminReorderWorkflowStep WorkspaceAdminOperationKind = "ReorderWorkflowStepsExact"
	WorkspaceAdminRegisterRepository  WorkspaceAdminOperationKind = "RegisterRepositoryExact"
	WorkspaceAdminUpdateRepository    WorkspaceAdminOperationKind = "UpdateRepositoryExact"
)

type WorkspaceDefaultsUpdate

type WorkspaceDefaultsUpdate struct {
	ExpectedResourceVersion   string
	Name                      *string
	Description               *string
	DefaultExecutorID         *string
	DefaultEnvironmentID      *string
	DefaultAgentProfileID     *string
	DefaultConfigAgentProfile *string
}

type WorkspaceReader

type WorkspaceReader interface {
	List(ctx context.Context, page Page) ([]Workspace, *PageInfo, error)
}

WorkspaceReader is the read-only accessor behind Host.Workspaces(), mirroring the Host data API's ListWorkspaces RPC.

type WorkspaceRepositoryRegister

type WorkspaceRepositoryRegister struct {
	ExpectedWorkspaceResourceVersion string
	Name                             string
	SourceType                       string
	LocalPath                        string
	Provider                         string
	ProviderRepoID                   string
	ProviderHost                     string
	ProviderScope                    string
	ProviderOwner                    string
	ProviderName                     string
	RemoteURL                        string
	DefaultBranch                    string
	WorktreeBranchPrefix             string
	WorktreeBranchTemplate           string
	PullBeforeWorktree               *bool
}

type WorkspaceRepositoryUpdate

type WorkspaceRepositoryUpdate struct {
	RepositoryID            string
	ExpectedResourceVersion string
	Name                    *string
	DefaultBranch           *string
	WorktreeBranchPrefix    *string
	WorktreeBranchTemplate  *string
	PullBeforeWorktree      *bool
}

type WorkspaceWorkflowCreate

type WorkspaceWorkflowCreate struct {
	ExpectedWorkspaceResourceVersion string
	Name                             string
	Description                      string
	Prompt                           string
}

type WorkspaceWorkflowReorder

type WorkspaceWorkflowReorder struct {
	ExpectedWorkspaceResourceVersion string
	WorkflowIDs                      []string
	WorkflowResourceVersions         []string
}

type WorkspaceWorkflowStepCreate

type WorkspaceWorkflowStepCreate struct {
	WorkflowID                      string
	ExpectedWorkflowResourceVersion string
	Configuration                   WorkflowStepConfiguration
}

type WorkspaceWorkflowStepReorder

type WorkspaceWorkflowStepReorder struct {
	WorkflowID                      string
	ExpectedWorkflowResourceVersion string
	StepIDs                         []string
	StepResourceVersions            []string
}

type WorkspaceWorkflowStepUpdate

type WorkspaceWorkflowStepUpdate struct {
	WorkflowID                      string
	StepID                          string
	ExpectedWorkflowResourceVersion string
	ExpectedStepResourceVersion     string
	Configuration                   WorkflowStepConfiguration
}

type WorkspaceWorkflowUpdate

type WorkspaceWorkflowUpdate struct {
	WorkflowID              string
	ExpectedResourceVersion string
	Name                    *string
	Description             *string
	Prompt                  *string
	AgentProfileID          *string
}

Directories

Path Synopsis
cmd
kandev-sdk-check command
kandev-sdk-check verifies installed SDK compatibility without changing a project.
kandev-sdk-check verifies installed SDK compatibility without changing a project.
internal
compatibility
Package compatibility checks installed SDK evidence against a plugin manifest.
Package compatibility checks installed SDK evidence against a plugin manifest.
proto

Jump to

Keyboard shortcuts

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