Documentation
¶
Index ¶
- type ApprovalResult
- type ContextHandleData
- type PendingApproval
- type Server
- func (s *Server) ApplyEdits(_ context.Context, req *acppb.ApplyEditsRequest) (*acppb.ApplyEditsResponse, error)
- func (s *Server) ApproveToolExecution(_ context.Context, req *acppb.ToolApproval) (*emptypb.Empty, error)
- func (s *Server) CreateContextHandle(_ context.Context, req *acppb.ContextHandleRequest) (*acppb.ContextHandle, error)
- func (s *Server) CreatePendingApproval(executionID, agentID, tool string, params map[string]string) chan ApprovalResult
- func (s *Server) CreateSession(_ context.Context, req *acppb.CreateSessionRequest) (*acppb.Session, error)
- func (s *Server) DeleteContextHandle(handleID string) bool
- func (s *Server) DiscoverAgents(ctx context.Context, req *acppb.DiscoverAgentsRequest) (*acppb.DiscoverAgentsResponse, error)
- func (s *Server) EstablishP2PConnection(ctx context.Context, req *acppb.P2PHandshake) (*acppb.P2PConnectionInfo, error)
- func (s *Server) GetAgentInfo(ctx context.Context, req *acppb.GetAgentInfoRequest) (*acppb.AgentInfo, error)
- func (s *Server) GetP2PEndpoint(ctx context.Context, req *acppb.P2PEndpointRequest) (*acppb.P2PEndpoint, error)
- func (s *Server) GetPendingApprovals() []*PendingApproval
- func (s *Server) GetServerCapabilities(_ context.Context, _ *emptypb.Empty) (*acppb.ServerCapabilities, error)
- func (s *Server) ProposeEdits(ctx context.Context, req *acppb.ProposeEditsRequest) (*acppb.ProposeEditsResponse, error)
- func (s *Server) RegisterAgent(ctx context.Context, req *acppb.RegisterAgentRequest) (*acppb.RegisterAgentResponse, error)
- func (s *Server) RejectToolExecution(_ context.Context, req *acppb.ToolRejection) (*emptypb.Empty, error)
- func (s *Server) RequestCapabilities(ctx context.Context, req *acppb.CapabilityRequest) (*acppb.CapabilityGrant, error)
- func (s *Server) RequestToolExecution(req *acppb.ToolExecutionRequest, ...) error
- func (s *Server) ResolveContextHandle(_ context.Context, req *acppb.ContextHandle) (*acppb.ContextData, error)
- func (s *Server) RevokeCapabilities(_ context.Context, req *acppb.CapabilityRevocation) (*emptypb.Empty, error)
- func (s *Server) SendMessage(_ context.Context, req *acppb.SendMessageRequest) (*acppb.SendMessageResponse, error)
- func (s *Server) SetMessageBus(b bus.MessageBus)
- func (s *Server) SetTaskHistory(h agent.TaskHistory)
- func (s *Server) StreamAuthInterceptor(srv interface{}, stream grpc.ServerStream, _ *grpc.StreamServerInfo, ...) error
- func (s *Server) StreamInlineCompletions(req *acppb.InlineCompletionRequest, ...) error
- func (s *Server) StreamTask(req *acppb.TaskStreamRequest, stream acppb.AgentCommunication_StreamTaskServer) error
- func (s *Server) SubscribeTaskEvents(req *acppb.TaskSubscription, ...) error
- func (s *Server) UnaryAuthInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, ...) (interface{}, error)
- func (s *Server) UnregisterAgent(ctx context.Context, req *acppb.UnregisterAgentRequest) (*emptypb.Empty, error)
- func (s *Server) UpdateEditorState(_ context.Context, req *acppb.UpdateEditorStateRequest) (*acppb.UpdateEditorStateResponse, error)
- func (s *Server) UpdateSessionContext(_ context.Context, req *acppb.ContextDelta) (*emptypb.Empty, error)
- type SessionContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApprovalResult ¶
ApprovalResult is the outcome of an approval decision.
type ContextHandleData ¶
ContextHandleData stores the actual data for a context handle.
type PendingApproval ¶
type PendingApproval struct {
ExecutionID string
AgentID string
Tool string
Parameters map[string]string
CreatedAt time.Time
ResultChan chan ApprovalResult
}
PendingApproval represents a tool execution awaiting approval.
type Server ¶
type Server struct {
acppb.UnimplementedAgentCommunicationServer
// contains filtered or unexported fields
}
Server implements the Zed ACP gRPC service.
func NewServer ¶
func NewServer(coord *coordinator.Coordinator, models *model.Manager, cfg *config.Config, store *storage.Store) (*Server, error)
NewServer creates a new ACP gRPC server
func (*Server) ApplyEdits ¶
func (s *Server) ApplyEdits(_ context.Context, req *acppb.ApplyEditsRequest) (*acppb.ApplyEditsResponse, error)
ApplyEdits applies editor-supplied text edits to files under the project root.
func (*Server) ApproveToolExecution ¶
func (s *Server) ApproveToolExecution(_ context.Context, req *acppb.ToolApproval) (*emptypb.Empty, error)
ApproveToolExecution approves a pending tool execution request.
func (*Server) CreateContextHandle ¶
func (s *Server) CreateContextHandle(_ context.Context, req *acppb.ContextHandleRequest) (*acppb.ContextHandle, error)
CreateContextHandle stores context data and returns a handle for later retrieval.
func (*Server) CreatePendingApproval ¶
func (s *Server) CreatePendingApproval(executionID, agentID, tool string, params map[string]string) chan ApprovalResult
CreatePendingApproval creates a pending approval entry for human-in-the-loop tool execution. The executionID should be cryptographically random to prevent guessing attacks.
func (*Server) CreateSession ¶
func (s *Server) CreateSession(_ context.Context, req *acppb.CreateSessionRequest) (*acppb.Session, error)
CreateSession creates a lightweight session record for chat routing.
func (*Server) DeleteContextHandle ¶
DeleteContextHandle removes a context handle from storage.
func (*Server) DiscoverAgents ¶
func (s *Server) DiscoverAgents(ctx context.Context, req *acppb.DiscoverAgentsRequest) (*acppb.DiscoverAgentsResponse, error)
DiscoverAgents proxies to the coordinator.
func (*Server) EstablishP2PConnection ¶
func (s *Server) EstablishP2PConnection(ctx context.Context, req *acppb.P2PHandshake) (*acppb.P2PConnectionInfo, error)
EstablishP2PConnection sets up a P2P communication channel between agents.
func (*Server) GetAgentInfo ¶
func (s *Server) GetAgentInfo(ctx context.Context, req *acppb.GetAgentInfoRequest) (*acppb.AgentInfo, error)
GetAgentInfo returns info about a registered agent.
func (*Server) GetP2PEndpoint ¶
func (s *Server) GetP2PEndpoint(ctx context.Context, req *acppb.P2PEndpointRequest) (*acppb.P2PEndpoint, error)
GetP2PEndpoint returns the message bus endpoint for direct agent communication.
func (*Server) GetPendingApprovals ¶
func (s *Server) GetPendingApprovals() []*PendingApproval
GetPendingApprovals returns all pending approval requests (useful for UI).
func (*Server) GetServerCapabilities ¶
func (s *Server) GetServerCapabilities(_ context.Context, _ *emptypb.Empty) (*acppb.ServerCapabilities, error)
GetServerCapabilities returns advertised capabilities.
func (*Server) ProposeEdits ¶
func (s *Server) ProposeEdits(ctx context.Context, req *acppb.ProposeEditsRequest) (*acppb.ProposeEditsResponse, error)
ProposeEdits generates editor-ready edits using the execution model. Strategy: focus on the active document/selection; return a single ProposedEdit that either replaces the current selection or the whole file.
func (*Server) RegisterAgent ¶
func (s *Server) RegisterAgent(ctx context.Context, req *acppb.RegisterAgentRequest) (*acppb.RegisterAgentResponse, error)
RegisterAgent handles agent registration requests
func (*Server) RejectToolExecution ¶
func (s *Server) RejectToolExecution(_ context.Context, req *acppb.ToolRejection) (*emptypb.Empty, error)
RejectToolExecution rejects a pending tool execution request.
func (*Server) RequestCapabilities ¶
func (s *Server) RequestCapabilities(ctx context.Context, req *acppb.CapabilityRequest) (*acppb.CapabilityGrant, error)
RequestCapabilities grants requested capabilities and stores the grant for later revocation.
func (*Server) RequestToolExecution ¶
func (s *Server) RequestToolExecution(req *acppb.ToolExecutionRequest, stream acppb.AgentCommunication_RequestToolExecutionServer) error
RequestToolExecution acknowledges tool execution requests.
func (*Server) ResolveContextHandle ¶
func (s *Server) ResolveContextHandle(_ context.Context, req *acppb.ContextHandle) (*acppb.ContextData, error)
ResolveContextHandle retrieves the stored data for a context handle.
func (*Server) RevokeCapabilities ¶
func (s *Server) RevokeCapabilities(_ context.Context, req *acppb.CapabilityRevocation) (*emptypb.Empty, error)
RevokeCapabilities revokes a previously issued capability grant.
func (*Server) SendMessage ¶
func (s *Server) SendMessage(_ context.Context, req *acppb.SendMessageRequest) (*acppb.SendMessageResponse, error)
SendMessage handles a simple request/response for editor integrations.
func (*Server) SetMessageBus ¶
func (s *Server) SetMessageBus(b bus.MessageBus)
SetMessageBus configures the server to use a specific message bus.
func (*Server) SetTaskHistory ¶
func (s *Server) SetTaskHistory(h agent.TaskHistory)
SetTaskHistory configures the server to use a specific task history store.
func (*Server) StreamAuthInterceptor ¶
func (s *Server) StreamAuthInterceptor(srv interface{}, stream grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamAuthInterceptor enforces mTLS identity for streaming RPCs.
func (*Server) StreamInlineCompletions ¶
func (s *Server) StreamInlineCompletions(req *acppb.InlineCompletionRequest, stream acppb.AgentCommunication_StreamInlineCompletionsServer) error
StreamInlineCompletions streams inline suggestions using the execution model.
func (*Server) StreamTask ¶
func (s *Server) StreamTask(req *acppb.TaskStreamRequest, stream acppb.AgentCommunication_StreamTaskServer) error
StreamTask returns a simple streamed response for Zed bridge.
func (*Server) SubscribeTaskEvents ¶
func (s *Server) SubscribeTaskEvents(req *acppb.TaskSubscription, stream acppb.AgentCommunication_SubscribeTaskEventsServer) error
SubscribeTaskEvents streams task events from the message bus.
func (*Server) UnaryAuthInterceptor ¶
func (s *Server) UnaryAuthInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
UnaryAuthInterceptor enforces mTLS identity and injects claims.
func (*Server) UnregisterAgent ¶
func (s *Server) UnregisterAgent(ctx context.Context, req *acppb.UnregisterAgentRequest) (*emptypb.Empty, error)
UnregisterAgent handles agent unregistration
func (*Server) UpdateEditorState ¶
func (s *Server) UpdateEditorState(_ context.Context, req *acppb.UpdateEditorStateRequest) (*acppb.UpdateEditorStateResponse, error)
UpdateEditorState returns lightweight status for editor gutters/status bars.
func (*Server) UpdateSessionContext ¶
func (s *Server) UpdateSessionContext(_ context.Context, req *acppb.ContextDelta) (*emptypb.Empty, error)
UpdateSessionContext stores context delta (added/removed files and metadata) for a session.