Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ jobs:
fetch-depth: 0

- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Lint
run: buf lint

- name: Breaking change detection
if: github.event_name == 'pull_request'
# Allowed to fail until main has a lint-passing baseline.
# Remove continue-on-error once this PR merges.
continue-on-error: true
run: buf breaking --against .git#branch=main
12 changes: 6 additions & 6 deletions kontext/agent/v1/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package kontext.agent.v1;

option go_package = "github.com/kontext-dev/kontext-cli/gen/kontext/agent/v1;agentv1";
option go_package = "github.com/kontext-dev/proto/gen/kontext/agent/v1;agentv1";

// AgentService is the bidirectional streaming service between the CLI sidecar
// and the Kontext backend. The sidecar maintains a persistent connection and
Expand All @@ -11,7 +11,7 @@ service AgentService {
// ProcessHookEvent streams tool call events from the CLI to the backend
// and receives policy decisions in return. Bidirectional streaming keeps
// the connection open for the session lifetime — no per-hook HTTP overhead.
rpc ProcessHookEvent(stream HookEventRequest) returns (stream HookEventResponse);
rpc ProcessHookEvent(stream ProcessHookEventRequest) returns (stream ProcessHookEventResponse);

// CreateSession establishes a governed agent session. Called once at the
// start of `kontext start`. Returns session context used for all subsequent
Expand All @@ -33,12 +33,12 @@ service AgentService {
// SyncPolicy streams the current policy state for the session's org/agent.
// The sidecar caches this locally for fast hook evaluation. The server
// pushes updates when policy changes.
rpc SyncPolicy(SyncPolicyRequest) returns (stream PolicyUpdate);
rpc SyncPolicy(SyncPolicyRequest) returns (stream SyncPolicyResponse);
}

// --- Hook Events ---

message HookEventRequest {
message ProcessHookEventRequest {
string session_id = 1;
string agent = 2; // "claude", "cursor", "codex"
string hook_event = 3; // "PreToolUse", "PostToolUse", "UserPromptSubmit"
Expand All @@ -49,7 +49,7 @@ message HookEventRequest {
string cwd = 8;
}

message HookEventResponse {
message ProcessHookEventResponse {
Decision decision = 1;
string reason = 2;
string event_id = 3;
Expand Down Expand Up @@ -128,7 +128,7 @@ message SyncPolicyRequest {
string session_id = 1;
}

message PolicyUpdate {
message SyncPolicyResponse {
// OpenFGA tuples for local evaluation
repeated PolicyTuple tuples = 1;
bool full_sync = 2; // true = replace all, false = incremental
Expand Down
Loading