diff --git a/CLAUDE.md b/CLAUDE.md index 6dfe03733..4e8f1b247 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -182,6 +182,40 @@ structures found in legacy packages. - **MCP Providers:** Daemon registers providers as optional via `providerRegistry.RegisterOptional`. Missing or failed providers log warnings and degrade health without terminating the process. +- **`internal/infrastructure/staterpc/` (State Store gRPC contract):** + Authority is `docs/prds/state-store-contract.md` (rev. 2c) -- read it before + changing this package or its callers. +- The proto (`proto/state/v1/state.proto`, service `StateStoreService`, + package `statev1` in `internal/contracts/state/v1/`) is one gRPC service + fronting every ratified store contract (40 RPCs); the Go consumer facades + stay narrow (`workflow.Store`, `store.TaskStore`, etc., all ≤8 methods + except the `TaskStore` composite) via `staterpc.Client`'s multiple `var _` + assertions -- never add a Go interface method without a matching RPC. +- Error sentinels (`store.ErrStaleTransition`, `ErrBindingNotFound`, ...) + cross the wire via `mapError`/`unmapError` in `values.go`, matched on + `(code, exact canonical message)`. Changing a canonical message string + breaks `errors.Is` on the client without changing behavior visibly -- + treat those message constants as part of the wire contract. +- The daemon serves this service in-process (multiplexed), bound to the + Docker bridge gateway address with mandatory per-task bearer-token auth + when a container pool exists, or loopback-only with no token when it does + not (`boot.startStateStoreServer` in `internal/app/archied/bootstrap.go`). + Never add a second listener for the same service. +- `daemon.StateStoreTokens` is a per-task, per-incumbence token registry: + `containerEnv` calls `Generate` on every container acquisition (so a new + container's token supersedes the task's old one) and `process()` calls + `Revoke` on release. The gRPC interceptor (`staterpc.UnaryTokenInterceptor`) + is the only thing that checks it. +- `archie-agent` picks its `workflow.Store` implementation once at boot + (`agenttransport/nats.Transport.Store`): gRPC via `staterpc.Client` when + `STATE_STORE_URL` was injected, otherwise the legacy NATS `storerpc.Client`. + A single agent process is never both; `internal/storerpc` (NATS transport) + is deleted only after every agent path is on gRPC (PRD §12 step 4) -- do + not delete it while `STATE_STORE_URL` injection is still optional. +- `store.BindingDispatcher.RecordDispatch` takes no `*sql.Tx` (dropped in + `.4.2` -- it cannot cross a gRPC boundary; production always passed `nil`). + Do not reintroduce a transaction parameter on a producer-owned store + interface that a remote adapter must also implement. - **`internal/forge/webhook/` (forge webhook receiver):** - Verify HMAC (`webhookguard.VerifyHMAC` against `X-Hub-Signature-256`) before parsing the payload, never after -- an unverified body must not reach @@ -275,3 +309,10 @@ bd remember # Persist cross-session architectural facts unless explicitly instructed. 6. **Handoff:** Report changed files, gate verification results, and active issue states. + +## Maintaining this file + +Keep this file for knowledge useful to almost every future agent session in this project. +Do not repeat what the codebase already shows; point to the authoritative file or command instead. +Prefer rewriting or pruning existing entries over appending new ones. +When updating this file, preserve this bar for all agents and keep entries concise. diff --git a/cmd/archie-agent/main.go b/cmd/archie-agent/main.go index eae9b7dcb..2c7a45c2b 100644 --- a/cmd/archie-agent/main.go +++ b/cmd/archie-agent/main.go @@ -29,6 +29,8 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run flags := flag.NewFlagSet("archie-agent", flag.ContinueOnError) flags.SetOutput(stderr) natsURLFlag := flags.String("nats-url", "", "NATS server URL (defaults to NATS_URL)") + stateStoreURLFlag := flags.String("state-store-url", "", "State Store gRPC target (defaults to STATE_STORE_URL; empty uses the legacy NATS storerpc path)") + stateStoreTokenFlag := flags.String("state-store-token", "", "State Store bearer token (defaults to STATE_STORE_TOKEN)") if err := flags.Parse(args); err != nil { if errors.Is(err, flag.ErrHelp) { return 0 @@ -47,9 +49,20 @@ func runCommand(args []string, getenv func(string) string, stderr io.Writer, run ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) defer stop() + stateStoreURL := *stateStoreURLFlag + if stateStoreURL == "" { + stateStoreURL = getenv("STATE_STORE_URL") + } + stateStoreToken := *stateStoreTokenFlag + if stateStoreToken == "" { + stateStoreToken = getenv("STATE_STORE_TOKEN") + } + if err := runWorker(ctx, agentworker.Settings{ - NATSURL: natsURL, - NATSToken: natsToken, + NATSURL: natsURL, + NATSToken: natsToken, + StateStoreTarget: stateStoreURL, + StateStoreToken: stateStoreToken, }, log); err != nil { return 1 } diff --git a/config.example.toml b/config.example.toml index 7f01cd4aa..48fd71d03 100644 --- a/config.example.toml +++ b/config.example.toml @@ -261,6 +261,18 @@ max_steps = 60 wall_clock = "30m" gate_max_failures = 5 +# Services selects contract adapters at composition time. Leave the section +# absent to use every adapter's default (see docs/prds/state-store-contract.md). +# [services.gateway] +# target = "127.0.0.1:8585" # archie-gateway's gRPC address (always remote once set) + +# [services.state] +# target = "" # empty (default) = local *store.Store adapter. +# # This surface is consumed by the upcoming +# # standalone archie-state-store binary (.4.3); the +# # daemon does not read it yet -- it still serves the +# # State Store gRPC service in-process today. + # NATS is the sole autonomous workflow handoff. mode changes only where the # broker runs; every workflow still runs in a managed task container: # "embedded" – in-process nats-server (the default; no external server) diff --git a/internal/app/agentworker/worker.go b/internal/app/agentworker/worker.go index 25691e224..d0bbe158a 100644 --- a/internal/app/agentworker/worker.go +++ b/internal/app/agentworker/worker.go @@ -32,6 +32,14 @@ type Settings struct { NATSURL string NATSToken string WorkDir string + + // StateStoreTarget and StateStoreToken are the daemon-injected State + // Store gRPC endpoint and per-task bearer token (docs/prds/ + // state-store-contract.md §6: STATE_STORE_URL/STATE_STORE_TOKEN, + // mirroring the NATS_URL/NATS_TOKEN handoff). Empty keeps the legacy + // NATS storerpc path for workflow.Store. + StateStoreTarget string + StateStoreToken string } type workerTransport interface { @@ -83,8 +91,10 @@ func run(ctx context.Context, settings Settings, log *slog.Logger, dependencies dependencies.markSafe(ctx, workDir, log) transport, err := dependencies.connect(ctx, agentnats.Config{ - URL: settings.NATSURL, - Token: settings.NATSToken, + URL: settings.NATSURL, + Token: settings.NATSToken, + StateStoreURL: settings.StateStoreTarget, + StateStoreToken: settings.StateStoreToken, }, log) if err != nil { operation := "nats connect failed" diff --git a/internal/app/archied/bootstrap.go b/internal/app/archied/bootstrap.go index 1103c70ab..bdd7d2b8e 100644 --- a/internal/app/archied/bootstrap.go +++ b/internal/app/archied/bootstrap.go @@ -11,6 +11,7 @@ import ( "errors" "fmt" "log/slog" + "net" "net/http" "os" "os/signal" @@ -22,6 +23,7 @@ import ( "time" "github.com/samcharles93/ai-sdk/runtime" + "google.golang.org/grpc" channelruntime "github.com/samcharles93/archie-core/internal/channels" "github.com/samcharles93/archie-core/internal/channels/email" @@ -49,6 +51,7 @@ import ( "github.com/samcharles93/archie-core/internal/infrastructure/modelcatalog" "github.com/samcharles93/archie-core/internal/infrastructure/sessioncurator" "github.com/samcharles93/archie-core/internal/infrastructure/skillcurator" + "github.com/samcharles93/archie-core/internal/infrastructure/staterpc" "github.com/samcharles93/archie-core/internal/infrastructure/taskactions" "github.com/samcharles93/archie-core/internal/logging" "github.com/samcharles93/archie-core/internal/memory" @@ -1268,6 +1271,55 @@ func (b *boot) buildDaemon() { b.setupForgeWebhook() } +// startStateStoreServer serves the State Store gRPC service in-process +// (multiplexed inside archied), so archie-agent has a gRPC target before the +// standalone archie-state-store binary exists (docs/prds/ +// state-store-contract.md §12 step 3). Listener topology follows §9's single +// rule: bind the host-gateway bridge address with mandatory per-task bearer +// tokens when agent containers can reach this daemon, or loopback-only with +// no token when there is no container pool to serve. Failure degrades +// (archie-agent falls back to the legacy NATS storerpc path) rather than +// aborting boot -- the State Store's in-process server is additive during +// .4.2, not yet load-bearing. +func (b *boot) startStateStoreServer(ctx context.Context) { + log := b.log + deps := staterpc.Deps{ + Tasks: b.st, Mappings: b.d.Mappings, Bindings: b.d.Bindings, + BindingDispatcher: b.d.BindingDispatcher, BindingTaskCreator: b.d.BindingTaskCreator, + Log: log, + } + if cs, ok := b.st.(store.CaptureStore); ok { + deps.Captures = cs + } + + host := "127.0.0.1" + var opts []grpc.ServerOption + if b.containerPool != nil { + if bridge := b.containerPool.HostGateway(); bridge != "" { + host = bridge + tokens := daemon.NewStateStoreTokens() + b.d.StateStoreTokens = tokens + opts = append(opts, grpc.ChainUnaryInterceptor(staterpc.UnaryTokenInterceptor(tokens.Validate))) + } + } + + listener, err := (&net.ListenConfig{}).Listen(ctx, "tcp", net.JoinHostPort(host, "0")) + if err != nil { + log.Error("state store gRPC listen failed; archie-agent will use the legacy NATS storerpc path", "err", err) + return + } + server := grpc.NewServer(opts...) + staterpc.RegisterServer(server, deps) + go func() { + if err := server.Serve(listener); err != nil { + log.Error("state store gRPC server stopped", "err", err) + } + }() + b.addCleanup(server.GracefulStop) + b.d.ConnectedStateStore = daemon.StateStoreEndpoint{URL: listener.Addr().String()} + log.Info("state store gRPC server running", "addr", listener.Addr().String(), "token_required", host != "127.0.0.1") +} + // setupForgeWebhook starts the forge webhook receiver when intake is "webhook" // or "both". It decodes GitHub issue events into task envelopes and publishes // them through the same path the poller uses, so a labelled or assigned issue diff --git a/internal/app/archied/main.go b/internal/app/archied/main.go index 9c271e142..d4d29dff4 100644 --- a/internal/app/archied/main.go +++ b/internal/app/archied/main.go @@ -421,6 +421,7 @@ func Run() int { //nolint:cyclop // the composition root's setup sequence is del } b.registerStandaloneTools() b.buildDaemon() + b.startStateStoreServer(ctx) b.wireConfigPublishing(ctx, args.cfgPath, args.overlayPath) b.installUpdateConfigHandler() b.installUpdateRepoFieldHandler() @@ -1058,13 +1059,18 @@ func startContainers( } pool, err := container.NewPool(ctx, container.Config{ - Image: cfg.Containers.Image, - MaxConcurrency: cfg.Containers.MaxConcurrency, - MaxUptime: cfg.Containers.MaxUptime.Std(), - PullPolicy: cfg.Containers.PullPolicy, - Network: cfg.Containers.Network, - DockerClient: dockerCli, - RequireHostGateway: cfg.NATS.Mode == config.NATSModeEmbedded, + Image: cfg.Containers.Image, + MaxConcurrency: cfg.Containers.MaxConcurrency, + MaxUptime: cfg.Containers.MaxUptime.Std(), + PullPolicy: cfg.Containers.PullPolicy, + Network: cfg.Containers.Network, + DockerClient: dockerCli, + // Always resolve the bridge gateway: agent containers need it to + // reach embedded NATS (when configured) and, as of Phase 2, the + // daemon's in-process State Store gRPC server (docs/prds/ + // state-store-contract.md §9's single listener-topology rule) -- + // a container can never reach the host's 127.0.0.1. + RequireHostGateway: true, }, log) if err != nil { // A missing image is recoverable by hand. The daemon sends no registry diff --git a/internal/config/services.go b/internal/config/services.go index b8334323b..7b485adc8 100644 --- a/internal/config/services.go +++ b/internal/config/services.go @@ -3,6 +3,15 @@ package config // Services selects contract adapters at application composition time. type Services struct { Gateway ServiceConnection `toml:"gateway" yaml:"gateway"` + // State selects the State Store contract adapter. Unlike Gateway, an + // empty Target means local (the *store.Store in-process adapter): the + // State Store service is not yet extracted into its own process. This + // is the ratified presence-based [services.state].target surface + // (docs/prds/state-store-contract.md §10), consumed by the upcoming + // standalone archie-state-store binary (.4.3) -- the daemon does not + // read it yet, so it remains dead configuration until that consumer + // lands. Setting Target would dial the gRPC StateStoreService. + State ServiceConnection `toml:"state" yaml:"state"` } // ServiceConnection is the archie-gateway process's gRPC address. It does not diff --git a/internal/contracts/state/v1/state.pb.go b/internal/contracts/state/v1/state.pb.go new file mode 100644 index 000000000..e99bdbc8f --- /dev/null +++ b/internal/contracts/state/v1/state.pb.go @@ -0,0 +1,5381 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: state/v1/state.proto + +package statev1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Task mirrors internal/domain/workflow.Task. +type Task struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` + Repo string `protobuf:"bytes,3,opt,name=repo,proto3" json:"repo,omitempty"` + IssueNumber int64 `protobuf:"varint,4,opt,name=issue_number,json=issueNumber,proto3" json:"issue_number,omitempty"` + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` + Body string `protobuf:"bytes,6,opt,name=body,proto3" json:"body,omitempty"` + Labels string `protobuf:"bytes,7,opt,name=labels,proto3" json:"labels,omitempty"` + Status string `protobuf:"bytes,8,opt,name=status,proto3" json:"status,omitempty"` + Workflow string `protobuf:"bytes,9,opt,name=workflow,proto3" json:"workflow,omitempty"` + Stage string `protobuf:"bytes,10,opt,name=stage,proto3" json:"stage,omitempty"` + Branch string `protobuf:"bytes,11,opt,name=branch,proto3" json:"branch,omitempty"` + Plan string `protobuf:"bytes,12,opt,name=plan,proto3" json:"plan,omitempty"` + Notes string `protobuf:"bytes,13,opt,name=notes,proto3" json:"notes,omitempty"` + PrNumber int64 `protobuf:"varint,14,opt,name=pr_number,json=prNumber,proto3" json:"pr_number,omitempty"` + TokensUsed int64 `protobuf:"varint,15,opt,name=tokens_used,json=tokensUsed,proto3" json:"tokens_used,omitempty"` + Iterations int64 `protobuf:"varint,16,opt,name=iterations,proto3" json:"iterations,omitempty"` + Attempt int64 `protobuf:"varint,17,opt,name=attempt,proto3" json:"attempt,omitempty"` + ParkReason string `protobuf:"bytes,18,opt,name=park_reason,json=parkReason,proto3" json:"park_reason,omitempty"` + RetryCount int64 `protobuf:"varint,19,opt,name=retry_count,json=retryCount,proto3" json:"retry_count,omitempty"` + WatchCommentId int64 `protobuf:"varint,20,opt,name=watch_comment_id,json=watchCommentId,proto3" json:"watch_comment_id,omitempty"` + Source string `protobuf:"bytes,21,opt,name=source,proto3" json:"source,omitempty"` + Identity string `protobuf:"bytes,22,opt,name=identity,proto3" json:"identity,omitempty"` + BindingId int64 `protobuf:"varint,23,opt,name=binding_id,json=bindingId,proto3" json:"binding_id,omitempty"` + BindingVersion int64 `protobuf:"varint,24,opt,name=binding_version,json=bindingVersion,proto3" json:"binding_version,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,25,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,26,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Task) Reset() { + *x = Task{} + mi := &file_state_v1_state_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Task) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Task) ProtoMessage() {} + +func (x *Task) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Task.ProtoReflect.Descriptor instead. +func (*Task) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{0} +} + +func (x *Task) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Task) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *Task) GetRepo() string { + if x != nil { + return x.Repo + } + return "" +} + +func (x *Task) GetIssueNumber() int64 { + if x != nil { + return x.IssueNumber + } + return 0 +} + +func (x *Task) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Task) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *Task) GetLabels() string { + if x != nil { + return x.Labels + } + return "" +} + +func (x *Task) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *Task) GetWorkflow() string { + if x != nil { + return x.Workflow + } + return "" +} + +func (x *Task) GetStage() string { + if x != nil { + return x.Stage + } + return "" +} + +func (x *Task) GetBranch() string { + if x != nil { + return x.Branch + } + return "" +} + +func (x *Task) GetPlan() string { + if x != nil { + return x.Plan + } + return "" +} + +func (x *Task) GetNotes() string { + if x != nil { + return x.Notes + } + return "" +} + +func (x *Task) GetPrNumber() int64 { + if x != nil { + return x.PrNumber + } + return 0 +} + +func (x *Task) GetTokensUsed() int64 { + if x != nil { + return x.TokensUsed + } + return 0 +} + +func (x *Task) GetIterations() int64 { + if x != nil { + return x.Iterations + } + return 0 +} + +func (x *Task) GetAttempt() int64 { + if x != nil { + return x.Attempt + } + return 0 +} + +func (x *Task) GetParkReason() string { + if x != nil { + return x.ParkReason + } + return "" +} + +func (x *Task) GetRetryCount() int64 { + if x != nil { + return x.RetryCount + } + return 0 +} + +func (x *Task) GetWatchCommentId() int64 { + if x != nil { + return x.WatchCommentId + } + return 0 +} + +func (x *Task) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *Task) GetIdentity() string { + if x != nil { + return x.Identity + } + return "" +} + +func (x *Task) GetBindingId() int64 { + if x != nil { + return x.BindingId + } + return 0 +} + +func (x *Task) GetBindingVersion() int64 { + if x != nil { + return x.BindingVersion + } + return 0 +} + +func (x *Task) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Task) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +// Event mirrors internal/events.Event. Data is carried as a JSON object +// string (matching the store's own on-disk representation) rather than +// google.protobuf.Struct, to stay a direct mirror of the existing column. +type Event struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + At *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=at,proto3" json:"at,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + TaskId int64 `protobuf:"varint,4,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + Repo string `protobuf:"bytes,5,opt,name=repo,proto3" json:"repo,omitempty"` + Issue int64 `protobuf:"varint,6,opt,name=issue,proto3" json:"issue,omitempty"` + Workflow string `protobuf:"bytes,7,opt,name=workflow,proto3" json:"workflow,omitempty"` + Stage string `protobuf:"bytes,8,opt,name=stage,proto3" json:"stage,omitempty"` + Detail string `protobuf:"bytes,9,opt,name=detail,proto3" json:"detail,omitempty"` + DataJson string `protobuf:"bytes,10,opt,name=data_json,json=dataJson,proto3" json:"data_json,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Event) Reset() { + *x = Event{} + mi := &file_state_v1_state_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Event) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Event) ProtoMessage() {} + +func (x *Event) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Event.ProtoReflect.Descriptor instead. +func (*Event) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{1} +} + +func (x *Event) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Event) GetAt() *timestamppb.Timestamp { + if x != nil { + return x.At + } + return nil +} + +func (x *Event) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *Event) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *Event) GetRepo() string { + if x != nil { + return x.Repo + } + return "" +} + +func (x *Event) GetIssue() int64 { + if x != nil { + return x.Issue + } + return 0 +} + +func (x *Event) GetWorkflow() string { + if x != nil { + return x.Workflow + } + return "" +} + +func (x *Event) GetStage() string { + if x != nil { + return x.Stage + } + return "" +} + +func (x *Event) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +func (x *Event) GetDataJson() string { + if x != nil { + return x.DataJson + } + return "" +} + +// CapturedEvent mirrors internal/store.CapturedEvent. +type CapturedEvent struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ReceivedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"` + Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` + RemoteAddr string `protobuf:"bytes,4,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"` + ContentType string `protobuf:"bytes,5,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` + Headers string `protobuf:"bytes,6,opt,name=headers,proto3" json:"headers,omitempty"` + Body string `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"` + Authenticated bool `protobuf:"varint,8,opt,name=authenticated,proto3" json:"authenticated,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CapturedEvent) Reset() { + *x = CapturedEvent{} + mi := &file_state_v1_state_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CapturedEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CapturedEvent) ProtoMessage() {} + +func (x *CapturedEvent) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CapturedEvent.ProtoReflect.Descriptor instead. +func (*CapturedEvent) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{2} +} + +func (x *CapturedEvent) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *CapturedEvent) GetReceivedAt() *timestamppb.Timestamp { + if x != nil { + return x.ReceivedAt + } + return nil +} + +func (x *CapturedEvent) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *CapturedEvent) GetRemoteAddr() string { + if x != nil { + return x.RemoteAddr + } + return "" +} + +func (x *CapturedEvent) GetContentType() string { + if x != nil { + return x.ContentType + } + return "" +} + +func (x *CapturedEvent) GetHeaders() string { + if x != nil { + return x.Headers + } + return "" +} + +func (x *CapturedEvent) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *CapturedEvent) GetAuthenticated() bool { + if x != nil { + return x.Authenticated + } + return false +} + +// MappingField mirrors internal/domain/mapping.Field. +type MappingField struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MappingField) Reset() { + *x = MappingField{} + mi := &file_state_v1_state_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MappingField) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MappingField) ProtoMessage() {} + +func (x *MappingField) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MappingField.ProtoReflect.Descriptor instead. +func (*MappingField) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{3} +} + +func (x *MappingField) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MappingField) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *MappingField) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *MappingField) GetRequired() bool { + if x != nil { + return x.Required + } + return false +} + +// Mapping mirrors internal/domain/mapping.Mapping. +type Mapping struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + SourceHint string `protobuf:"bytes,3,opt,name=source_hint,json=sourceHint,proto3" json:"source_hint,omitempty"` + Fields []*MappingField `protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Mapping) Reset() { + *x = Mapping{} + mi := &file_state_v1_state_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Mapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mapping) ProtoMessage() {} + +func (x *Mapping) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Mapping.ProtoReflect.Descriptor instead. +func (*Mapping) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{4} +} + +func (x *Mapping) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Mapping) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Mapping) GetSourceHint() string { + if x != nil { + return x.SourceHint + } + return "" +} + +func (x *Mapping) GetFields() []*MappingField { + if x != nil { + return x.Fields + } + return nil +} + +func (x *Mapping) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Mapping) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +// BindingMatcher mirrors internal/domain/binding.Matcher. +type BindingMatcher struct { + state protoimpl.MessageState `protogen:"open.v1"` + Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *BindingMatcher) Reset() { + *x = BindingMatcher{} + mi := &file_state_v1_state_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BindingMatcher) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BindingMatcher) ProtoMessage() {} + +func (x *BindingMatcher) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BindingMatcher.ProtoReflect.Descriptor instead. +func (*BindingMatcher) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{5} +} + +func (x *BindingMatcher) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +// Binding mirrors internal/domain/binding.Binding. +type Binding struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Matcher *BindingMatcher `protobuf:"bytes,3,opt,name=matcher,proto3" json:"matcher,omitempty"` + MappingId int64 `protobuf:"varint,4,opt,name=mapping_id,json=mappingId,proto3" json:"mapping_id,omitempty"` + Workflow string `protobuf:"bytes,5,opt,name=workflow,proto3" json:"workflow,omitempty"` + Owner string `protobuf:"bytes,6,opt,name=owner,proto3" json:"owner,omitempty"` + Repo string `protobuf:"bytes,7,opt,name=repo,proto3" json:"repo,omitempty"` + Version int64 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty"` + Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"` + Secret string `protobuf:"bytes,10,opt,name=secret,proto3" json:"secret,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Binding) Reset() { + *x = Binding{} + mi := &file_state_v1_state_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Binding) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Binding) ProtoMessage() {} + +func (x *Binding) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Binding.ProtoReflect.Descriptor instead. +func (*Binding) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{6} +} + +func (x *Binding) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Binding) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Binding) GetMatcher() *BindingMatcher { + if x != nil { + return x.Matcher + } + return nil +} + +func (x *Binding) GetMappingId() int64 { + if x != nil { + return x.MappingId + } + return 0 +} + +func (x *Binding) GetWorkflow() string { + if x != nil { + return x.Workflow + } + return "" +} + +func (x *Binding) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *Binding) GetRepo() string { + if x != nil { + return x.Repo + } + return "" +} + +func (x *Binding) GetVersion() int64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *Binding) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *Binding) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +func (x *Binding) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Binding) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +// WorkflowStat mirrors internal/store.WorkflowStat. +type WorkflowStat struct { + state protoimpl.MessageState `protogen:"open.v1"` + Workflow string `protobuf:"bytes,1,opt,name=workflow,proto3" json:"workflow,omitempty"` + Runs int64 `protobuf:"varint,2,opt,name=runs,proto3" json:"runs,omitempty"` + Merged int64 `protobuf:"varint,3,opt,name=merged,proto3" json:"merged,omitempty"` + PrOpen int64 `protobuf:"varint,4,opt,name=pr_open,json=prOpen,proto3" json:"pr_open,omitempty"` + Parked int64 `protobuf:"varint,5,opt,name=parked,proto3" json:"parked,omitempty"` + AvgTokens int64 `protobuf:"varint,6,opt,name=avg_tokens,json=avgTokens,proto3" json:"avg_tokens,omitempty"` + AvgSteps float64 `protobuf:"fixed64,7,opt,name=avg_steps,json=avgSteps,proto3" json:"avg_steps,omitempty"` + TotalTokens int64 `protobuf:"varint,8,opt,name=total_tokens,json=totalTokens,proto3" json:"total_tokens,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WorkflowStat) Reset() { + *x = WorkflowStat{} + mi := &file_state_v1_state_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WorkflowStat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkflowStat) ProtoMessage() {} + +func (x *WorkflowStat) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkflowStat.ProtoReflect.Descriptor instead. +func (*WorkflowStat) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{7} +} + +func (x *WorkflowStat) GetWorkflow() string { + if x != nil { + return x.Workflow + } + return "" +} + +func (x *WorkflowStat) GetRuns() int64 { + if x != nil { + return x.Runs + } + return 0 +} + +func (x *WorkflowStat) GetMerged() int64 { + if x != nil { + return x.Merged + } + return 0 +} + +func (x *WorkflowStat) GetPrOpen() int64 { + if x != nil { + return x.PrOpen + } + return 0 +} + +func (x *WorkflowStat) GetParked() int64 { + if x != nil { + return x.Parked + } + return 0 +} + +func (x *WorkflowStat) GetAvgTokens() int64 { + if x != nil { + return x.AvgTokens + } + return 0 +} + +func (x *WorkflowStat) GetAvgSteps() float64 { + if x != nil { + return x.AvgSteps + } + return 0 +} + +func (x *WorkflowStat) GetTotalTokens() int64 { + if x != nil { + return x.TotalTokens + } + return 0 +} + +// StageStat mirrors internal/store.StageStat. +type StageStat struct { + state protoimpl.MessageState `protogen:"open.v1"` + Workflow string `protobuf:"bytes,1,opt,name=workflow,proto3" json:"workflow,omitempty"` + Stage string `protobuf:"bytes,2,opt,name=stage,proto3" json:"stage,omitempty"` + Runs int64 `protobuf:"varint,3,opt,name=runs,proto3" json:"runs,omitempty"` + AvgMs int64 `protobuf:"varint,4,opt,name=avg_ms,json=avgMs,proto3" json:"avg_ms,omitempty"` + Errors int64 `protobuf:"varint,5,opt,name=errors,proto3" json:"errors,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StageStat) Reset() { + *x = StageStat{} + mi := &file_state_v1_state_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StageStat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StageStat) ProtoMessage() {} + +func (x *StageStat) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StageStat.ProtoReflect.Descriptor instead. +func (*StageStat) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{8} +} + +func (x *StageStat) GetWorkflow() string { + if x != nil { + return x.Workflow + } + return "" +} + +func (x *StageStat) GetStage() string { + if x != nil { + return x.Stage + } + return "" +} + +func (x *StageStat) GetRuns() int64 { + if x != nil { + return x.Runs + } + return 0 +} + +func (x *StageStat) GetAvgMs() int64 { + if x != nil { + return x.AvgMs + } + return 0 +} + +func (x *StageStat) GetErrors() int64 { + if x != nil { + return x.Errors + } + return 0 +} + +// DayTokens mirrors internal/store.DayTokens. +type DayTokens struct { + state protoimpl.MessageState `protogen:"open.v1"` + Day string `protobuf:"bytes,1,opt,name=day,proto3" json:"day,omitempty"` + Tokens int64 `protobuf:"varint,2,opt,name=tokens,proto3" json:"tokens,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DayTokens) Reset() { + *x = DayTokens{} + mi := &file_state_v1_state_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DayTokens) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DayTokens) ProtoMessage() {} + +func (x *DayTokens) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DayTokens.ProtoReflect.Descriptor instead. +func (*DayTokens) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{9} +} + +func (x *DayTokens) GetDay() string { + if x != nil { + return x.Day + } + return "" +} + +func (x *DayTokens) GetTokens() int64 { + if x != nil { + return x.Tokens + } + return 0 +} + +type EnqueueIssueRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Repo string `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"` + Number int64 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` + Body string `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"` + Labels string `protobuf:"bytes,6,opt,name=labels,proto3" json:"labels,omitempty"` + Identity string `protobuf:"bytes,7,opt,name=identity,proto3" json:"identity,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EnqueueIssueRequest) Reset() { + *x = EnqueueIssueRequest{} + mi := &file_state_v1_state_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EnqueueIssueRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnqueueIssueRequest) ProtoMessage() {} + +func (x *EnqueueIssueRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnqueueIssueRequest.ProtoReflect.Descriptor instead. +func (*EnqueueIssueRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{10} +} + +func (x *EnqueueIssueRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *EnqueueIssueRequest) GetRepo() string { + if x != nil { + return x.Repo + } + return "" +} + +func (x *EnqueueIssueRequest) GetNumber() int64 { + if x != nil { + return x.Number + } + return 0 +} + +func (x *EnqueueIssueRequest) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *EnqueueIssueRequest) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *EnqueueIssueRequest) GetLabels() string { + if x != nil { + return x.Labels + } + return "" +} + +func (x *EnqueueIssueRequest) GetIdentity() string { + if x != nil { + return x.Identity + } + return "" +} + +type EnqueueIssueResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Inserted bool `protobuf:"varint,1,opt,name=inserted,proto3" json:"inserted,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EnqueueIssueResponse) Reset() { + *x = EnqueueIssueResponse{} + mi := &file_state_v1_state_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EnqueueIssueResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnqueueIssueResponse) ProtoMessage() {} + +func (x *EnqueueIssueResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnqueueIssueResponse.ProtoReflect.Descriptor instead. +func (*EnqueueIssueResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{11} +} + +func (x *EnqueueIssueResponse) GetInserted() bool { + if x != nil { + return x.Inserted + } + return false +} + +type EnqueueChatTaskRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Repo string `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + Body string `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` + Workflow string `protobuf:"bytes,5,opt,name=workflow,proto3" json:"workflow,omitempty"` + Identity string `protobuf:"bytes,6,opt,name=identity,proto3" json:"identity,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EnqueueChatTaskRequest) Reset() { + *x = EnqueueChatTaskRequest{} + mi := &file_state_v1_state_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EnqueueChatTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnqueueChatTaskRequest) ProtoMessage() {} + +func (x *EnqueueChatTaskRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnqueueChatTaskRequest.ProtoReflect.Descriptor instead. +func (*EnqueueChatTaskRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{12} +} + +func (x *EnqueueChatTaskRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *EnqueueChatTaskRequest) GetRepo() string { + if x != nil { + return x.Repo + } + return "" +} + +func (x *EnqueueChatTaskRequest) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *EnqueueChatTaskRequest) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *EnqueueChatTaskRequest) GetWorkflow() string { + if x != nil { + return x.Workflow + } + return "" +} + +func (x *EnqueueChatTaskRequest) GetIdentity() string { + if x != nil { + return x.Identity + } + return "" +} + +type EnqueueChatTaskResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EnqueueChatTaskResponse) Reset() { + *x = EnqueueChatTaskResponse{} + mi := &file_state_v1_state_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EnqueueChatTaskResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnqueueChatTaskResponse) ProtoMessage() {} + +func (x *EnqueueChatTaskResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnqueueChatTaskResponse.ProtoReflect.Descriptor instead. +func (*EnqueueChatTaskResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{13} +} + +func (x *EnqueueChatTaskResponse) GetTask() *Task { + if x != nil { + return x.Task + } + return nil +} + +type ClaimNextRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClaimNextRequest) Reset() { + *x = ClaimNextRequest{} + mi := &file_state_v1_state_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClaimNextRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClaimNextRequest) ProtoMessage() {} + +func (x *ClaimNextRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClaimNextRequest.ProtoReflect.Descriptor instead. +func (*ClaimNextRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{14} +} + +type ClaimNextResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClaimNextResponse) Reset() { + *x = ClaimNextResponse{} + mi := &file_state_v1_state_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClaimNextResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClaimNextResponse) ProtoMessage() {} + +func (x *ClaimNextResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClaimNextResponse.ProtoReflect.Descriptor instead. +func (*ClaimNextResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{15} +} + +func (x *ClaimNextResponse) GetTask() *Task { + if x != nil { + return x.Task + } + return nil +} + +func (x *ClaimNextResponse) GetFound() bool { + if x != nil { + return x.Found + } + return false +} + +type ClaimByIssueRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Repo string `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"` + Number int64 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClaimByIssueRequest) Reset() { + *x = ClaimByIssueRequest{} + mi := &file_state_v1_state_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClaimByIssueRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClaimByIssueRequest) ProtoMessage() {} + +func (x *ClaimByIssueRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClaimByIssueRequest.ProtoReflect.Descriptor instead. +func (*ClaimByIssueRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{16} +} + +func (x *ClaimByIssueRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *ClaimByIssueRequest) GetRepo() string { + if x != nil { + return x.Repo + } + return "" +} + +func (x *ClaimByIssueRequest) GetNumber() int64 { + if x != nil { + return x.Number + } + return 0 +} + +type ClaimByIssueResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClaimByIssueResponse) Reset() { + *x = ClaimByIssueResponse{} + mi := &file_state_v1_state_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClaimByIssueResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClaimByIssueResponse) ProtoMessage() {} + +func (x *ClaimByIssueResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClaimByIssueResponse.ProtoReflect.Descriptor instead. +func (*ClaimByIssueResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{17} +} + +func (x *ClaimByIssueResponse) GetTask() *Task { + if x != nil { + return x.Task + } + return nil +} + +func (x *ClaimByIssueResponse) GetFound() bool { + if x != nil { + return x.Found + } + return false +} + +type TransitionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` + To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` + Detail string `protobuf:"bytes,4,opt,name=detail,proto3" json:"detail,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransitionRequest) Reset() { + *x = TransitionRequest{} + mi := &file_state_v1_state_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransitionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransitionRequest) ProtoMessage() {} + +func (x *TransitionRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransitionRequest.ProtoReflect.Descriptor instead. +func (*TransitionRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{18} +} + +func (x *TransitionRequest) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *TransitionRequest) GetFrom() string { + if x != nil { + return x.From + } + return "" +} + +func (x *TransitionRequest) GetTo() string { + if x != nil { + return x.To + } + return "" +} + +func (x *TransitionRequest) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +type TransitionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransitionResponse) Reset() { + *x = TransitionResponse{} + mi := &file_state_v1_state_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransitionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransitionResponse) ProtoMessage() {} + +func (x *TransitionResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransitionResponse.ProtoReflect.Descriptor instead. +func (*TransitionResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{19} +} + +type UpdateRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateRequest) Reset() { + *x = UpdateRequest{} + mi := &file_state_v1_state_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRequest) ProtoMessage() {} + +func (x *UpdateRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead. +func (*UpdateRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{20} +} + +func (x *UpdateRequest) GetTask() *Task { + if x != nil { + return x.Task + } + return nil +} + +type UpdateResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateResponse) Reset() { + *x = UpdateResponse{} + mi := &file_state_v1_state_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateResponse) ProtoMessage() {} + +func (x *UpdateResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead. +func (*UpdateResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{21} +} + +type RequeueRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + FromStatus string `protobuf:"bytes,2,opt,name=from_status,json=fromStatus,proto3" json:"from_status,omitempty"` + Workflow string `protobuf:"bytes,3,opt,name=workflow,proto3" json:"workflow,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RequeueRequest) Reset() { + *x = RequeueRequest{} + mi := &file_state_v1_state_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RequeueRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequeueRequest) ProtoMessage() {} + +func (x *RequeueRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[22] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequeueRequest.ProtoReflect.Descriptor instead. +func (*RequeueRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{22} +} + +func (x *RequeueRequest) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *RequeueRequest) GetFromStatus() string { + if x != nil { + return x.FromStatus + } + return "" +} + +func (x *RequeueRequest) GetWorkflow() string { + if x != nil { + return x.Workflow + } + return "" +} + +type RequeueResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RequeueResponse) Reset() { + *x = RequeueResponse{} + mi := &file_state_v1_state_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RequeueResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequeueResponse) ProtoMessage() {} + +func (x *RequeueResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequeueResponse.ProtoReflect.Descriptor instead. +func (*RequeueResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{23} +} + +type RecoverStaleRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RecoverStaleRequest) Reset() { + *x = RecoverStaleRequest{} + mi := &file_state_v1_state_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RecoverStaleRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RecoverStaleRequest) ProtoMessage() {} + +func (x *RecoverStaleRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RecoverStaleRequest.ProtoReflect.Descriptor instead. +func (*RecoverStaleRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{24} +} + +type RecoverStaleResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RecoverStaleResponse) Reset() { + *x = RecoverStaleResponse{} + mi := &file_state_v1_state_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RecoverStaleResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RecoverStaleResponse) ProtoMessage() {} + +func (x *RecoverStaleResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[25] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RecoverStaleResponse.ProtoReflect.Descriptor instead. +func (*RecoverStaleResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{25} +} + +func (x *RecoverStaleResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +type ArchiveTaskRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + FromStatus string `protobuf:"bytes,2,opt,name=from_status,json=fromStatus,proto3" json:"from_status,omitempty"` + Audit *Event `protobuf:"bytes,3,opt,name=audit,proto3" json:"audit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ArchiveTaskRequest) Reset() { + *x = ArchiveTaskRequest{} + mi := &file_state_v1_state_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ArchiveTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArchiveTaskRequest) ProtoMessage() {} + +func (x *ArchiveTaskRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[26] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArchiveTaskRequest.ProtoReflect.Descriptor instead. +func (*ArchiveTaskRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{26} +} + +func (x *ArchiveTaskRequest) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *ArchiveTaskRequest) GetFromStatus() string { + if x != nil { + return x.FromStatus + } + return "" +} + +func (x *ArchiveTaskRequest) GetAudit() *Event { + if x != nil { + return x.Audit + } + return nil +} + +type ArchiveTaskResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + EventId int64 `protobuf:"varint,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ArchiveTaskResponse) Reset() { + *x = ArchiveTaskResponse{} + mi := &file_state_v1_state_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ArchiveTaskResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArchiveTaskResponse) ProtoMessage() {} + +func (x *ArchiveTaskResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[27] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArchiveTaskResponse.ProtoReflect.Descriptor instead. +func (*ArchiveTaskResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{27} +} + +func (x *ArchiveTaskResponse) GetEventId() int64 { + if x != nil { + return x.EventId + } + return 0 +} + +type RetryTaskRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + FromStatus string `protobuf:"bytes,2,opt,name=from_status,json=fromStatus,proto3" json:"from_status,omitempty"` + Workflow string `protobuf:"bytes,3,opt,name=workflow,proto3" json:"workflow,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RetryTaskRequest) Reset() { + *x = RetryTaskRequest{} + mi := &file_state_v1_state_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RetryTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RetryTaskRequest) ProtoMessage() {} + +func (x *RetryTaskRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[28] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RetryTaskRequest.ProtoReflect.Descriptor instead. +func (*RetryTaskRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{28} +} + +func (x *RetryTaskRequest) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *RetryTaskRequest) GetFromStatus() string { + if x != nil { + return x.FromStatus + } + return "" +} + +func (x *RetryTaskRequest) GetWorkflow() string { + if x != nil { + return x.Workflow + } + return "" +} + +type RetryTaskResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RetryTaskResponse) Reset() { + *x = RetryTaskResponse{} + mi := &file_state_v1_state_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RetryTaskResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RetryTaskResponse) ProtoMessage() {} + +func (x *RetryTaskResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RetryTaskResponse.ProtoReflect.Descriptor instead. +func (*RetryTaskResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{29} +} + +type TaskByIssueRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Repo string `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"` + Number int64 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TaskByIssueRequest) Reset() { + *x = TaskByIssueRequest{} + mi := &file_state_v1_state_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskByIssueRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskByIssueRequest) ProtoMessage() {} + +func (x *TaskByIssueRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TaskByIssueRequest.ProtoReflect.Descriptor instead. +func (*TaskByIssueRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{30} +} + +func (x *TaskByIssueRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *TaskByIssueRequest) GetRepo() string { + if x != nil { + return x.Repo + } + return "" +} + +func (x *TaskByIssueRequest) GetNumber() int64 { + if x != nil { + return x.Number + } + return 0 +} + +type TaskByIssueResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TaskByIssueResponse) Reset() { + *x = TaskByIssueResponse{} + mi := &file_state_v1_state_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskByIssueResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskByIssueResponse) ProtoMessage() {} + +func (x *TaskByIssueResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TaskByIssueResponse.ProtoReflect.Descriptor instead. +func (*TaskByIssueResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{31} +} + +func (x *TaskByIssueResponse) GetTask() *Task { + if x != nil { + return x.Task + } + return nil +} + +func (x *TaskByIssueResponse) GetFound() bool { + if x != nil { + return x.Found + } + return false +} + +type TaskByIDRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TaskByIDRequest) Reset() { + *x = TaskByIDRequest{} + mi := &file_state_v1_state_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskByIDRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskByIDRequest) ProtoMessage() {} + +func (x *TaskByIDRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TaskByIDRequest.ProtoReflect.Descriptor instead. +func (*TaskByIDRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{32} +} + +func (x *TaskByIDRequest) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +type TaskByIDResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TaskByIDResponse) Reset() { + *x = TaskByIDResponse{} + mi := &file_state_v1_state_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskByIDResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskByIDResponse) ProtoMessage() {} + +func (x *TaskByIDResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TaskByIDResponse.ProtoReflect.Descriptor instead. +func (*TaskByIDResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{33} +} + +func (x *TaskByIDResponse) GetTask() *Task { + if x != nil { + return x.Task + } + return nil +} + +func (x *TaskByIDResponse) GetFound() bool { + if x != nil { + return x.Found + } + return false +} + +type OpenPRsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpenPRsRequest) Reset() { + *x = OpenPRsRequest{} + mi := &file_state_v1_state_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpenPRsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpenPRsRequest) ProtoMessage() {} + +func (x *OpenPRsRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OpenPRsRequest.ProtoReflect.Descriptor instead. +func (*OpenPRsRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{34} +} + +type OpenPRsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Tasks []*Task `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OpenPRsResponse) Reset() { + *x = OpenPRsResponse{} + mi := &file_state_v1_state_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OpenPRsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OpenPRsResponse) ProtoMessage() {} + +func (x *OpenPRsResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OpenPRsResponse.ProtoReflect.Descriptor instead. +func (*OpenPRsResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{35} +} + +func (x *OpenPRsResponse) GetTasks() []*Task { + if x != nil { + return x.Tasks + } + return nil +} + +type ClearTerminalTasksRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClearTerminalTasksRequest) Reset() { + *x = ClearTerminalTasksRequest{} + mi := &file_state_v1_state_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClearTerminalTasksRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearTerminalTasksRequest) ProtoMessage() {} + +func (x *ClearTerminalTasksRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearTerminalTasksRequest.ProtoReflect.Descriptor instead. +func (*ClearTerminalTasksRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{36} +} + +type ClearTerminalTasksResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClearTerminalTasksResponse) Reset() { + *x = ClearTerminalTasksResponse{} + mi := &file_state_v1_state_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClearTerminalTasksResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClearTerminalTasksResponse) ProtoMessage() {} + +func (x *ClearTerminalTasksResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[37] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClearTerminalTasksResponse.ProtoReflect.Descriptor instead. +func (*ClearTerminalTasksResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{37} +} + +func (x *ClearTerminalTasksResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +type TasksRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TasksRequest) Reset() { + *x = TasksRequest{} + mi := &file_state_v1_state_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TasksRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TasksRequest) ProtoMessage() {} + +func (x *TasksRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[38] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TasksRequest.ProtoReflect.Descriptor instead. +func (*TasksRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{38} +} + +func (x *TasksRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +type TasksResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Tasks []*Task `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TasksResponse) Reset() { + *x = TasksResponse{} + mi := &file_state_v1_state_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TasksResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TasksResponse) ProtoMessage() {} + +func (x *TasksResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TasksResponse.ProtoReflect.Descriptor instead. +func (*TasksResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{39} +} + +func (x *TasksResponse) GetTasks() []*Task { + if x != nil { + return x.Tasks + } + return nil +} + +type StatusCountsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StatusCountsRequest) Reset() { + *x = StatusCountsRequest{} + mi := &file_state_v1_state_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StatusCountsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusCountsRequest) ProtoMessage() {} + +func (x *StatusCountsRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[40] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusCountsRequest.ProtoReflect.Descriptor instead. +func (*StatusCountsRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{40} +} + +type StatusCountsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Counts map[string]int64 `protobuf:"bytes,1,rep,name=counts,proto3" json:"counts,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StatusCountsResponse) Reset() { + *x = StatusCountsResponse{} + mi := &file_state_v1_state_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StatusCountsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusCountsResponse) ProtoMessage() {} + +func (x *StatusCountsResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[41] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusCountsResponse.ProtoReflect.Descriptor instead. +func (*StatusCountsResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{41} +} + +func (x *StatusCountsResponse) GetCounts() map[string]int64 { + if x != nil { + return x.Counts + } + return nil +} + +type IncrementRetryCountRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IncrementRetryCountRequest) Reset() { + *x = IncrementRetryCountRequest{} + mi := &file_state_v1_state_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IncrementRetryCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IncrementRetryCountRequest) ProtoMessage() {} + +func (x *IncrementRetryCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[42] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IncrementRetryCountRequest.ProtoReflect.Descriptor instead. +func (*IncrementRetryCountRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{42} +} + +func (x *IncrementRetryCountRequest) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +type IncrementRetryCountResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IncrementRetryCountResponse) Reset() { + *x = IncrementRetryCountResponse{} + mi := &file_state_v1_state_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IncrementRetryCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IncrementRetryCountResponse) ProtoMessage() {} + +func (x *IncrementRetryCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[43] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IncrementRetryCountResponse.ProtoReflect.Descriptor instead. +func (*IncrementRetryCountResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{43} +} + +type InsertEventRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Event *Event `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InsertEventRequest) Reset() { + *x = InsertEventRequest{} + mi := &file_state_v1_state_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InsertEventRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InsertEventRequest) ProtoMessage() {} + +func (x *InsertEventRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[44] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InsertEventRequest.ProtoReflect.Descriptor instead. +func (*InsertEventRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{44} +} + +func (x *InsertEventRequest) GetEvent() *Event { + if x != nil { + return x.Event + } + return nil +} + +type InsertEventResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InsertEventResponse) Reset() { + *x = InsertEventResponse{} + mi := &file_state_v1_state_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InsertEventResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InsertEventResponse) ProtoMessage() {} + +func (x *InsertEventResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[45] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InsertEventResponse.ProtoReflect.Descriptor instead. +func (*InsertEventResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{45} +} + +func (x *InsertEventResponse) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type EventsSinceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + SinceId int64 `protobuf:"varint,1,opt,name=since_id,json=sinceId,proto3" json:"since_id,omitempty"` + Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EventsSinceRequest) Reset() { + *x = EventsSinceRequest{} + mi := &file_state_v1_state_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EventsSinceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventsSinceRequest) ProtoMessage() {} + +func (x *EventsSinceRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[46] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventsSinceRequest.ProtoReflect.Descriptor instead. +func (*EventsSinceRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{46} +} + +func (x *EventsSinceRequest) GetSinceId() int64 { + if x != nil { + return x.SinceId + } + return 0 +} + +func (x *EventsSinceRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +type EventsSinceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EventsSinceResponse) Reset() { + *x = EventsSinceResponse{} + mi := &file_state_v1_state_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EventsSinceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventsSinceResponse) ProtoMessage() {} + +func (x *EventsSinceResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventsSinceResponse.ProtoReflect.Descriptor instead. +func (*EventsSinceResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{47} +} + +func (x *EventsSinceResponse) GetEvents() []*Event { + if x != nil { + return x.Events + } + return nil +} + +type TaskEventsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId int64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TaskEventsRequest) Reset() { + *x = TaskEventsRequest{} + mi := &file_state_v1_state_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskEventsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskEventsRequest) ProtoMessage() {} + +func (x *TaskEventsRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[48] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TaskEventsRequest.ProtoReflect.Descriptor instead. +func (*TaskEventsRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{48} +} + +func (x *TaskEventsRequest) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +type TaskEventsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TaskEventsResponse) Reset() { + *x = TaskEventsResponse{} + mi := &file_state_v1_state_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskEventsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskEventsResponse) ProtoMessage() {} + +func (x *TaskEventsResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[49] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TaskEventsResponse.ProtoReflect.Descriptor instead. +func (*TaskEventsResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{49} +} + +func (x *TaskEventsResponse) GetEvents() []*Event { + if x != nil { + return x.Events + } + return nil +} + +type WorkflowStatsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WorkflowStatsRequest) Reset() { + *x = WorkflowStatsRequest{} + mi := &file_state_v1_state_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WorkflowStatsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkflowStatsRequest) ProtoMessage() {} + +func (x *WorkflowStatsRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[50] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkflowStatsRequest.ProtoReflect.Descriptor instead. +func (*WorkflowStatsRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{50} +} + +type WorkflowStatsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Stats []*WorkflowStat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *WorkflowStatsResponse) Reset() { + *x = WorkflowStatsResponse{} + mi := &file_state_v1_state_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *WorkflowStatsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkflowStatsResponse) ProtoMessage() {} + +func (x *WorkflowStatsResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[51] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkflowStatsResponse.ProtoReflect.Descriptor instead. +func (*WorkflowStatsResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{51} +} + +func (x *WorkflowStatsResponse) GetStats() []*WorkflowStat { + if x != nil { + return x.Stats + } + return nil +} + +type StageStatsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StageStatsRequest) Reset() { + *x = StageStatsRequest{} + mi := &file_state_v1_state_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StageStatsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StageStatsRequest) ProtoMessage() {} + +func (x *StageStatsRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[52] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StageStatsRequest.ProtoReflect.Descriptor instead. +func (*StageStatsRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{52} +} + +type StageStatsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Stats []*StageStat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StageStatsResponse) Reset() { + *x = StageStatsResponse{} + mi := &file_state_v1_state_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StageStatsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StageStatsResponse) ProtoMessage() {} + +func (x *StageStatsResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[53] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StageStatsResponse.ProtoReflect.Descriptor instead. +func (*StageStatsResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{53} +} + +func (x *StageStatsResponse) GetStats() []*StageStat { + if x != nil { + return x.Stats + } + return nil +} + +type TokensByDayRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Days int64 `protobuf:"varint,1,opt,name=days,proto3" json:"days,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TokensByDayRequest) Reset() { + *x = TokensByDayRequest{} + mi := &file_state_v1_state_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TokensByDayRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokensByDayRequest) ProtoMessage() {} + +func (x *TokensByDayRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[54] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokensByDayRequest.ProtoReflect.Descriptor instead. +func (*TokensByDayRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{54} +} + +func (x *TokensByDayRequest) GetDays() int64 { + if x != nil { + return x.Days + } + return 0 +} + +type TokensByDayResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Tokens []*DayTokens `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TokensByDayResponse) Reset() { + *x = TokensByDayResponse{} + mi := &file_state_v1_state_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TokensByDayResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokensByDayResponse) ProtoMessage() {} + +func (x *TokensByDayResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[55] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokensByDayResponse.ProtoReflect.Descriptor instead. +func (*TokensByDayResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{55} +} + +func (x *TokensByDayResponse) GetTokens() []*DayTokens { + if x != nil { + return x.Tokens + } + return nil +} + +type InsertCaptureRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Capture *CapturedEvent `protobuf:"bytes,1,opt,name=capture,proto3" json:"capture,omitempty"` + RetentionSeconds int64 `protobuf:"varint,2,opt,name=retention_seconds,json=retentionSeconds,proto3" json:"retention_seconds,omitempty"` + MaxEvents int64 `protobuf:"varint,3,opt,name=max_events,json=maxEvents,proto3" json:"max_events,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InsertCaptureRequest) Reset() { + *x = InsertCaptureRequest{} + mi := &file_state_v1_state_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InsertCaptureRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InsertCaptureRequest) ProtoMessage() {} + +func (x *InsertCaptureRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[56] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InsertCaptureRequest.ProtoReflect.Descriptor instead. +func (*InsertCaptureRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{56} +} + +func (x *InsertCaptureRequest) GetCapture() *CapturedEvent { + if x != nil { + return x.Capture + } + return nil +} + +func (x *InsertCaptureRequest) GetRetentionSeconds() int64 { + if x != nil { + return x.RetentionSeconds + } + return 0 +} + +func (x *InsertCaptureRequest) GetMaxEvents() int64 { + if x != nil { + return x.MaxEvents + } + return 0 +} + +type InsertCaptureResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InsertCaptureResponse) Reset() { + *x = InsertCaptureResponse{} + mi := &file_state_v1_state_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InsertCaptureResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InsertCaptureResponse) ProtoMessage() {} + +func (x *InsertCaptureResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[57] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InsertCaptureResponse.ProtoReflect.Descriptor instead. +func (*InsertCaptureResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{57} +} + +func (x *InsertCaptureResponse) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type ListCapturesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListCapturesRequest) Reset() { + *x = ListCapturesRequest{} + mi := &file_state_v1_state_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListCapturesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCapturesRequest) ProtoMessage() {} + +func (x *ListCapturesRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[58] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCapturesRequest.ProtoReflect.Descriptor instead. +func (*ListCapturesRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{58} +} + +func (x *ListCapturesRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +type ListCapturesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Captures []*CapturedEvent `protobuf:"bytes,1,rep,name=captures,proto3" json:"captures,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListCapturesResponse) Reset() { + *x = ListCapturesResponse{} + mi := &file_state_v1_state_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListCapturesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCapturesResponse) ProtoMessage() {} + +func (x *ListCapturesResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[59] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCapturesResponse.ProtoReflect.Descriptor instead. +func (*ListCapturesResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{59} +} + +func (x *ListCapturesResponse) GetCaptures() []*CapturedEvent { + if x != nil { + return x.Captures + } + return nil +} + +type InsertMappingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Mapping *Mapping `protobuf:"bytes,1,opt,name=mapping,proto3" json:"mapping,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InsertMappingRequest) Reset() { + *x = InsertMappingRequest{} + mi := &file_state_v1_state_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InsertMappingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InsertMappingRequest) ProtoMessage() {} + +func (x *InsertMappingRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[60] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InsertMappingRequest.ProtoReflect.Descriptor instead. +func (*InsertMappingRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{60} +} + +func (x *InsertMappingRequest) GetMapping() *Mapping { + if x != nil { + return x.Mapping + } + return nil +} + +type InsertMappingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InsertMappingResponse) Reset() { + *x = InsertMappingResponse{} + mi := &file_state_v1_state_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InsertMappingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InsertMappingResponse) ProtoMessage() {} + +func (x *InsertMappingResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[61] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InsertMappingResponse.ProtoReflect.Descriptor instead. +func (*InsertMappingResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{61} +} + +func (x *InsertMappingResponse) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type GetMappingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMappingRequest) Reset() { + *x = GetMappingRequest{} + mi := &file_state_v1_state_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMappingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMappingRequest) ProtoMessage() {} + +func (x *GetMappingRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[62] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMappingRequest.ProtoReflect.Descriptor instead. +func (*GetMappingRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{62} +} + +func (x *GetMappingRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type GetMappingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Mapping *Mapping `protobuf:"bytes,1,opt,name=mapping,proto3" json:"mapping,omitempty"` + Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMappingResponse) Reset() { + *x = GetMappingResponse{} + mi := &file_state_v1_state_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMappingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMappingResponse) ProtoMessage() {} + +func (x *GetMappingResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[63] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMappingResponse.ProtoReflect.Descriptor instead. +func (*GetMappingResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{63} +} + +func (x *GetMappingResponse) GetMapping() *Mapping { + if x != nil { + return x.Mapping + } + return nil +} + +func (x *GetMappingResponse) GetFound() bool { + if x != nil { + return x.Found + } + return false +} + +type ListMappingsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListMappingsRequest) Reset() { + *x = ListMappingsRequest{} + mi := &file_state_v1_state_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListMappingsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListMappingsRequest) ProtoMessage() {} + +func (x *ListMappingsRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[64] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListMappingsRequest.ProtoReflect.Descriptor instead. +func (*ListMappingsRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{64} +} + +type ListMappingsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Mappings []*Mapping `protobuf:"bytes,1,rep,name=mappings,proto3" json:"mappings,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListMappingsResponse) Reset() { + *x = ListMappingsResponse{} + mi := &file_state_v1_state_proto_msgTypes[65] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListMappingsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListMappingsResponse) ProtoMessage() {} + +func (x *ListMappingsResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[65] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListMappingsResponse.ProtoReflect.Descriptor instead. +func (*ListMappingsResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{65} +} + +func (x *ListMappingsResponse) GetMappings() []*Mapping { + if x != nil { + return x.Mappings + } + return nil +} + +type UpdateMappingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Mapping *Mapping `protobuf:"bytes,1,opt,name=mapping,proto3" json:"mapping,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateMappingRequest) Reset() { + *x = UpdateMappingRequest{} + mi := &file_state_v1_state_proto_msgTypes[66] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateMappingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateMappingRequest) ProtoMessage() {} + +func (x *UpdateMappingRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[66] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateMappingRequest.ProtoReflect.Descriptor instead. +func (*UpdateMappingRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{66} +} + +func (x *UpdateMappingRequest) GetMapping() *Mapping { + if x != nil { + return x.Mapping + } + return nil +} + +type UpdateMappingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateMappingResponse) Reset() { + *x = UpdateMappingResponse{} + mi := &file_state_v1_state_proto_msgTypes[67] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateMappingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateMappingResponse) ProtoMessage() {} + +func (x *UpdateMappingResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[67] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateMappingResponse.ProtoReflect.Descriptor instead. +func (*UpdateMappingResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{67} +} + +type DeleteMappingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteMappingRequest) Reset() { + *x = DeleteMappingRequest{} + mi := &file_state_v1_state_proto_msgTypes[68] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteMappingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteMappingRequest) ProtoMessage() {} + +func (x *DeleteMappingRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[68] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteMappingRequest.ProtoReflect.Descriptor instead. +func (*DeleteMappingRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{68} +} + +func (x *DeleteMappingRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type DeleteMappingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteMappingResponse) Reset() { + *x = DeleteMappingResponse{} + mi := &file_state_v1_state_proto_msgTypes[69] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteMappingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteMappingResponse) ProtoMessage() {} + +func (x *DeleteMappingResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[69] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteMappingResponse.ProtoReflect.Descriptor instead. +func (*DeleteMappingResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{69} +} + +type InsertBindingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Binding *Binding `protobuf:"bytes,1,opt,name=binding,proto3" json:"binding,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InsertBindingRequest) Reset() { + *x = InsertBindingRequest{} + mi := &file_state_v1_state_proto_msgTypes[70] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InsertBindingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InsertBindingRequest) ProtoMessage() {} + +func (x *InsertBindingRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[70] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InsertBindingRequest.ProtoReflect.Descriptor instead. +func (*InsertBindingRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{70} +} + +func (x *InsertBindingRequest) GetBinding() *Binding { + if x != nil { + return x.Binding + } + return nil +} + +type InsertBindingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InsertBindingResponse) Reset() { + *x = InsertBindingResponse{} + mi := &file_state_v1_state_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InsertBindingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InsertBindingResponse) ProtoMessage() {} + +func (x *InsertBindingResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[71] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InsertBindingResponse.ProtoReflect.Descriptor instead. +func (*InsertBindingResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{71} +} + +func (x *InsertBindingResponse) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type GetBindingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBindingRequest) Reset() { + *x = GetBindingRequest{} + mi := &file_state_v1_state_proto_msgTypes[72] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBindingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBindingRequest) ProtoMessage() {} + +func (x *GetBindingRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[72] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBindingRequest.ProtoReflect.Descriptor instead. +func (*GetBindingRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{72} +} + +func (x *GetBindingRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type GetBindingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Binding *Binding `protobuf:"bytes,1,opt,name=binding,proto3" json:"binding,omitempty"` + Found bool `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetBindingResponse) Reset() { + *x = GetBindingResponse{} + mi := &file_state_v1_state_proto_msgTypes[73] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetBindingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBindingResponse) ProtoMessage() {} + +func (x *GetBindingResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[73] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBindingResponse.ProtoReflect.Descriptor instead. +func (*GetBindingResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{73} +} + +func (x *GetBindingResponse) GetBinding() *Binding { + if x != nil { + return x.Binding + } + return nil +} + +func (x *GetBindingResponse) GetFound() bool { + if x != nil { + return x.Found + } + return false +} + +type ListBindingsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBindingsRequest) Reset() { + *x = ListBindingsRequest{} + mi := &file_state_v1_state_proto_msgTypes[74] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBindingsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBindingsRequest) ProtoMessage() {} + +func (x *ListBindingsRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[74] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBindingsRequest.ProtoReflect.Descriptor instead. +func (*ListBindingsRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{74} +} + +type ListBindingsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Bindings []*Binding `protobuf:"bytes,1,rep,name=bindings,proto3" json:"bindings,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListBindingsResponse) Reset() { + *x = ListBindingsResponse{} + mi := &file_state_v1_state_proto_msgTypes[75] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListBindingsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBindingsResponse) ProtoMessage() {} + +func (x *ListBindingsResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[75] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListBindingsResponse.ProtoReflect.Descriptor instead. +func (*ListBindingsResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{75} +} + +func (x *ListBindingsResponse) GetBindings() []*Binding { + if x != nil { + return x.Bindings + } + return nil +} + +type UpdateBindingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Binding *Binding `protobuf:"bytes,1,opt,name=binding,proto3" json:"binding,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateBindingRequest) Reset() { + *x = UpdateBindingRequest{} + mi := &file_state_v1_state_proto_msgTypes[76] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateBindingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateBindingRequest) ProtoMessage() {} + +func (x *UpdateBindingRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[76] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateBindingRequest.ProtoReflect.Descriptor instead. +func (*UpdateBindingRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{76} +} + +func (x *UpdateBindingRequest) GetBinding() *Binding { + if x != nil { + return x.Binding + } + return nil +} + +type UpdateBindingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateBindingResponse) Reset() { + *x = UpdateBindingResponse{} + mi := &file_state_v1_state_proto_msgTypes[77] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateBindingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateBindingResponse) ProtoMessage() {} + +func (x *UpdateBindingResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[77] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateBindingResponse.ProtoReflect.Descriptor instead. +func (*UpdateBindingResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{77} +} + +type DeleteBindingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteBindingRequest) Reset() { + *x = DeleteBindingRequest{} + mi := &file_state_v1_state_proto_msgTypes[78] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteBindingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteBindingRequest) ProtoMessage() {} + +func (x *DeleteBindingRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[78] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteBindingRequest.ProtoReflect.Descriptor instead. +func (*DeleteBindingRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{78} +} + +func (x *DeleteBindingRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type DeleteBindingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DeleteBindingResponse) Reset() { + *x = DeleteBindingResponse{} + mi := &file_state_v1_state_proto_msgTypes[79] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DeleteBindingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteBindingResponse) ProtoMessage() {} + +func (x *DeleteBindingResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[79] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteBindingResponse.ProtoReflect.Descriptor instead. +func (*DeleteBindingResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{79} +} + +type ApproveBindingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApproveBindingRequest) Reset() { + *x = ApproveBindingRequest{} + mi := &file_state_v1_state_proto_msgTypes[80] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApproveBindingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApproveBindingRequest) ProtoMessage() {} + +func (x *ApproveBindingRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[80] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApproveBindingRequest.ProtoReflect.Descriptor instead. +func (*ApproveBindingRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{80} +} + +func (x *ApproveBindingRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type ApproveBindingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ApproveBindingResponse) Reset() { + *x = ApproveBindingResponse{} + mi := &file_state_v1_state_proto_msgTypes[81] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ApproveBindingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApproveBindingResponse) ProtoMessage() {} + +func (x *ApproveBindingResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[81] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApproveBindingResponse.ProtoReflect.Descriptor instead. +func (*ApproveBindingResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{81} +} + +type ArmedBindingsForSourceRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ArmedBindingsForSourceRequest) Reset() { + *x = ArmedBindingsForSourceRequest{} + mi := &file_state_v1_state_proto_msgTypes[82] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ArmedBindingsForSourceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArmedBindingsForSourceRequest) ProtoMessage() {} + +func (x *ArmedBindingsForSourceRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[82] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArmedBindingsForSourceRequest.ProtoReflect.Descriptor instead. +func (*ArmedBindingsForSourceRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{82} +} + +func (x *ArmedBindingsForSourceRequest) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +type ArmedBindingsForSourceResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Bindings []*Binding `protobuf:"bytes,1,rep,name=bindings,proto3" json:"bindings,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ArmedBindingsForSourceResponse) Reset() { + *x = ArmedBindingsForSourceResponse{} + mi := &file_state_v1_state_proto_msgTypes[83] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ArmedBindingsForSourceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArmedBindingsForSourceResponse) ProtoMessage() {} + +func (x *ArmedBindingsForSourceResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[83] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArmedBindingsForSourceResponse.ProtoReflect.Descriptor instead. +func (*ArmedBindingsForSourceResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{83} +} + +func (x *ArmedBindingsForSourceResponse) GetBindings() []*Binding { + if x != nil { + return x.Bindings + } + return nil +} + +type RecordDispatchRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + BindingId int64 `protobuf:"varint,1,opt,name=binding_id,json=bindingId,proto3" json:"binding_id,omitempty"` + BindingVersion int64 `protobuf:"varint,2,opt,name=binding_version,json=bindingVersion,proto3" json:"binding_version,omitempty"` + CaptureId int64 `protobuf:"varint,3,opt,name=capture_id,json=captureId,proto3" json:"capture_id,omitempty"` + TaskId int64 `protobuf:"varint,4,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RecordDispatchRequest) Reset() { + *x = RecordDispatchRequest{} + mi := &file_state_v1_state_proto_msgTypes[84] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RecordDispatchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RecordDispatchRequest) ProtoMessage() {} + +func (x *RecordDispatchRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[84] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RecordDispatchRequest.ProtoReflect.Descriptor instead. +func (*RecordDispatchRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{84} +} + +func (x *RecordDispatchRequest) GetBindingId() int64 { + if x != nil { + return x.BindingId + } + return 0 +} + +func (x *RecordDispatchRequest) GetBindingVersion() int64 { + if x != nil { + return x.BindingVersion + } + return 0 +} + +func (x *RecordDispatchRequest) GetCaptureId() int64 { + if x != nil { + return x.CaptureId + } + return 0 +} + +func (x *RecordDispatchRequest) GetTaskId() int64 { + if x != nil { + return x.TaskId + } + return 0 +} + +type RecordDispatchResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RecordDispatchResponse) Reset() { + *x = RecordDispatchResponse{} + mi := &file_state_v1_state_proto_msgTypes[85] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RecordDispatchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RecordDispatchResponse) ProtoMessage() {} + +func (x *RecordDispatchResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[85] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RecordDispatchResponse.ProtoReflect.Descriptor instead. +func (*RecordDispatchResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{85} +} + +type ListUndispatchedCapturesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Sources []string `protobuf:"bytes,1,rep,name=sources,proto3" json:"sources,omitempty"` + Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListUndispatchedCapturesRequest) Reset() { + *x = ListUndispatchedCapturesRequest{} + mi := &file_state_v1_state_proto_msgTypes[86] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListUndispatchedCapturesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUndispatchedCapturesRequest) ProtoMessage() {} + +func (x *ListUndispatchedCapturesRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[86] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUndispatchedCapturesRequest.ProtoReflect.Descriptor instead. +func (*ListUndispatchedCapturesRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{86} +} + +func (x *ListUndispatchedCapturesRequest) GetSources() []string { + if x != nil { + return x.Sources + } + return nil +} + +func (x *ListUndispatchedCapturesRequest) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +type ListUndispatchedCapturesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Captures []*CapturedEvent `protobuf:"bytes,1,rep,name=captures,proto3" json:"captures,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListUndispatchedCapturesResponse) Reset() { + *x = ListUndispatchedCapturesResponse{} + mi := &file_state_v1_state_proto_msgTypes[87] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListUndispatchedCapturesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUndispatchedCapturesResponse) ProtoMessage() {} + +func (x *ListUndispatchedCapturesResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[87] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUndispatchedCapturesResponse.ProtoReflect.Descriptor instead. +func (*ListUndispatchedCapturesResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{87} +} + +func (x *ListUndispatchedCapturesResponse) GetCaptures() []*CapturedEvent { + if x != nil { + return x.Captures + } + return nil +} + +type EnqueueBindingTaskRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Repo string `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + Body string `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` + Workflow string `protobuf:"bytes,5,opt,name=workflow,proto3" json:"workflow,omitempty"` + Identity string `protobuf:"bytes,6,opt,name=identity,proto3" json:"identity,omitempty"` + BindingId int64 `protobuf:"varint,7,opt,name=binding_id,json=bindingId,proto3" json:"binding_id,omitempty"` + BindingVersion int64 `protobuf:"varint,8,opt,name=binding_version,json=bindingVersion,proto3" json:"binding_version,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EnqueueBindingTaskRequest) Reset() { + *x = EnqueueBindingTaskRequest{} + mi := &file_state_v1_state_proto_msgTypes[88] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EnqueueBindingTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnqueueBindingTaskRequest) ProtoMessage() {} + +func (x *EnqueueBindingTaskRequest) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[88] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnqueueBindingTaskRequest.ProtoReflect.Descriptor instead. +func (*EnqueueBindingTaskRequest) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{88} +} + +func (x *EnqueueBindingTaskRequest) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + +func (x *EnqueueBindingTaskRequest) GetRepo() string { + if x != nil { + return x.Repo + } + return "" +} + +func (x *EnqueueBindingTaskRequest) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *EnqueueBindingTaskRequest) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *EnqueueBindingTaskRequest) GetWorkflow() string { + if x != nil { + return x.Workflow + } + return "" +} + +func (x *EnqueueBindingTaskRequest) GetIdentity() string { + if x != nil { + return x.Identity + } + return "" +} + +func (x *EnqueueBindingTaskRequest) GetBindingId() int64 { + if x != nil { + return x.BindingId + } + return 0 +} + +func (x *EnqueueBindingTaskRequest) GetBindingVersion() int64 { + if x != nil { + return x.BindingVersion + } + return 0 +} + +type EnqueueBindingTaskResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Task *Task `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EnqueueBindingTaskResponse) Reset() { + *x = EnqueueBindingTaskResponse{} + mi := &file_state_v1_state_proto_msgTypes[89] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EnqueueBindingTaskResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EnqueueBindingTaskResponse) ProtoMessage() {} + +func (x *EnqueueBindingTaskResponse) ProtoReflect() protoreflect.Message { + mi := &file_state_v1_state_proto_msgTypes[89] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EnqueueBindingTaskResponse.ProtoReflect.Descriptor instead. +func (*EnqueueBindingTaskResponse) Descriptor() ([]byte, []int) { + return file_state_v1_state_proto_rawDescGZIP(), []int{89} +} + +func (x *EnqueueBindingTaskResponse) GetTask() *Task { + if x != nil { + return x.Task + } + return nil +} + +var File_state_v1_state_proto protoreflect.FileDescriptor + +const file_state_v1_state_proto_rawDesc = "" + + "\n" + + "\x14state/v1/state.proto\x12\bstate.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x87\x06\n" + + "\x04Task\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x14\n" + + "\x05owner\x18\x02 \x01(\tR\x05owner\x12\x12\n" + + "\x04repo\x18\x03 \x01(\tR\x04repo\x12!\n" + + "\fissue_number\x18\x04 \x01(\x03R\vissueNumber\x12\x14\n" + + "\x05title\x18\x05 \x01(\tR\x05title\x12\x12\n" + + "\x04body\x18\x06 \x01(\tR\x04body\x12\x16\n" + + "\x06labels\x18\a \x01(\tR\x06labels\x12\x16\n" + + "\x06status\x18\b \x01(\tR\x06status\x12\x1a\n" + + "\bworkflow\x18\t \x01(\tR\bworkflow\x12\x14\n" + + "\x05stage\x18\n" + + " \x01(\tR\x05stage\x12\x16\n" + + "\x06branch\x18\v \x01(\tR\x06branch\x12\x12\n" + + "\x04plan\x18\f \x01(\tR\x04plan\x12\x14\n" + + "\x05notes\x18\r \x01(\tR\x05notes\x12\x1b\n" + + "\tpr_number\x18\x0e \x01(\x03R\bprNumber\x12\x1f\n" + + "\vtokens_used\x18\x0f \x01(\x03R\n" + + "tokensUsed\x12\x1e\n" + + "\n" + + "iterations\x18\x10 \x01(\x03R\n" + + "iterations\x12\x18\n" + + "\aattempt\x18\x11 \x01(\x03R\aattempt\x12\x1f\n" + + "\vpark_reason\x18\x12 \x01(\tR\n" + + "parkReason\x12\x1f\n" + + "\vretry_count\x18\x13 \x01(\x03R\n" + + "retryCount\x12(\n" + + "\x10watch_comment_id\x18\x14 \x01(\x03R\x0ewatchCommentId\x12\x16\n" + + "\x06source\x18\x15 \x01(\tR\x06source\x12\x1a\n" + + "\bidentity\x18\x16 \x01(\tR\bidentity\x12\x1d\n" + + "\n" + + "binding_id\x18\x17 \x01(\x03R\tbindingId\x12'\n" + + "\x0fbinding_version\x18\x18 \x01(\x03R\x0ebindingVersion\x129\n" + + "\n" + + "created_at\x18\x19 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + + "\n" + + "updated_at\x18\x1a \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"\x81\x02\n" + + "\x05Event\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12*\n" + + "\x02at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x02at\x12\x12\n" + + "\x04kind\x18\x03 \x01(\tR\x04kind\x12\x17\n" + + "\atask_id\x18\x04 \x01(\x03R\x06taskId\x12\x12\n" + + "\x04repo\x18\x05 \x01(\tR\x04repo\x12\x14\n" + + "\x05issue\x18\x06 \x01(\x03R\x05issue\x12\x1a\n" + + "\bworkflow\x18\a \x01(\tR\bworkflow\x12\x14\n" + + "\x05stage\x18\b \x01(\tR\x05stage\x12\x16\n" + + "\x06detail\x18\t \x01(\tR\x06detail\x12\x1b\n" + + "\tdata_json\x18\n" + + " \x01(\tR\bdataJson\"\x8c\x02\n" + + "\rCapturedEvent\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12;\n" + + "\vreceived_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "receivedAt\x12\x16\n" + + "\x06source\x18\x03 \x01(\tR\x06source\x12\x1f\n" + + "\vremote_addr\x18\x04 \x01(\tR\n" + + "remoteAddr\x12!\n" + + "\fcontent_type\x18\x05 \x01(\tR\vcontentType\x12\x18\n" + + "\aheaders\x18\x06 \x01(\tR\aheaders\x12\x12\n" + + "\x04body\x18\a \x01(\tR\x04body\x12$\n" + + "\rauthenticated\x18\b \x01(\bR\rauthenticated\"f\n" + + "\fMappingField\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04path\x18\x02 \x01(\tR\x04path\x12\x12\n" + + "\x04type\x18\x03 \x01(\tR\x04type\x12\x1a\n" + + "\brequired\x18\x04 \x01(\bR\brequired\"\xf4\x01\n" + + "\aMapping\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1f\n" + + "\vsource_hint\x18\x03 \x01(\tR\n" + + "sourceHint\x12.\n" + + "\x06fields\x18\x04 \x03(\v2\x16.state.v1.MappingFieldR\x06fields\x129\n" + + "\n" + + "created_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + + "\n" + + "updated_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"(\n" + + "\x0eBindingMatcher\x12\x16\n" + + "\x06source\x18\x01 \x01(\tR\x06source\"\x86\x03\n" + + "\aBinding\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x122\n" + + "\amatcher\x18\x03 \x01(\v2\x18.state.v1.BindingMatcherR\amatcher\x12\x1d\n" + + "\n" + + "mapping_id\x18\x04 \x01(\x03R\tmappingId\x12\x1a\n" + + "\bworkflow\x18\x05 \x01(\tR\bworkflow\x12\x14\n" + + "\x05owner\x18\x06 \x01(\tR\x05owner\x12\x12\n" + + "\x04repo\x18\a \x01(\tR\x04repo\x12\x18\n" + + "\aversion\x18\b \x01(\x03R\aversion\x12\x16\n" + + "\x06status\x18\t \x01(\tR\x06status\x12\x16\n" + + "\x06secret\x18\n" + + " \x01(\tR\x06secret\x129\n" + + "\n" + + "created_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + + "\n" + + "updated_at\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"\xe6\x01\n" + + "\fWorkflowStat\x12\x1a\n" + + "\bworkflow\x18\x01 \x01(\tR\bworkflow\x12\x12\n" + + "\x04runs\x18\x02 \x01(\x03R\x04runs\x12\x16\n" + + "\x06merged\x18\x03 \x01(\x03R\x06merged\x12\x17\n" + + "\apr_open\x18\x04 \x01(\x03R\x06prOpen\x12\x16\n" + + "\x06parked\x18\x05 \x01(\x03R\x06parked\x12\x1d\n" + + "\n" + + "avg_tokens\x18\x06 \x01(\x03R\tavgTokens\x12\x1b\n" + + "\tavg_steps\x18\a \x01(\x01R\bavgSteps\x12!\n" + + "\ftotal_tokens\x18\b \x01(\x03R\vtotalTokens\"\x80\x01\n" + + "\tStageStat\x12\x1a\n" + + "\bworkflow\x18\x01 \x01(\tR\bworkflow\x12\x14\n" + + "\x05stage\x18\x02 \x01(\tR\x05stage\x12\x12\n" + + "\x04runs\x18\x03 \x01(\x03R\x04runs\x12\x15\n" + + "\x06avg_ms\x18\x04 \x01(\x03R\x05avgMs\x12\x16\n" + + "\x06errors\x18\x05 \x01(\x03R\x06errors\"5\n" + + "\tDayTokens\x12\x10\n" + + "\x03day\x18\x01 \x01(\tR\x03day\x12\x16\n" + + "\x06tokens\x18\x02 \x01(\x03R\x06tokens\"\xb5\x01\n" + + "\x13EnqueueIssueRequest\x12\x14\n" + + "\x05owner\x18\x01 \x01(\tR\x05owner\x12\x12\n" + + "\x04repo\x18\x02 \x01(\tR\x04repo\x12\x16\n" + + "\x06number\x18\x03 \x01(\x03R\x06number\x12\x14\n" + + "\x05title\x18\x04 \x01(\tR\x05title\x12\x12\n" + + "\x04body\x18\x05 \x01(\tR\x04body\x12\x16\n" + + "\x06labels\x18\x06 \x01(\tR\x06labels\x12\x1a\n" + + "\bidentity\x18\a \x01(\tR\bidentity\"2\n" + + "\x14EnqueueIssueResponse\x12\x1a\n" + + "\binserted\x18\x01 \x01(\bR\binserted\"\xa4\x01\n" + + "\x16EnqueueChatTaskRequest\x12\x14\n" + + "\x05owner\x18\x01 \x01(\tR\x05owner\x12\x12\n" + + "\x04repo\x18\x02 \x01(\tR\x04repo\x12\x14\n" + + "\x05title\x18\x03 \x01(\tR\x05title\x12\x12\n" + + "\x04body\x18\x04 \x01(\tR\x04body\x12\x1a\n" + + "\bworkflow\x18\x05 \x01(\tR\bworkflow\x12\x1a\n" + + "\bidentity\x18\x06 \x01(\tR\bidentity\"=\n" + + "\x17EnqueueChatTaskResponse\x12\"\n" + + "\x04task\x18\x01 \x01(\v2\x0e.state.v1.TaskR\x04task\"\x12\n" + + "\x10ClaimNextRequest\"M\n" + + "\x11ClaimNextResponse\x12\"\n" + + "\x04task\x18\x01 \x01(\v2\x0e.state.v1.TaskR\x04task\x12\x14\n" + + "\x05found\x18\x02 \x01(\bR\x05found\"W\n" + + "\x13ClaimByIssueRequest\x12\x14\n" + + "\x05owner\x18\x01 \x01(\tR\x05owner\x12\x12\n" + + "\x04repo\x18\x02 \x01(\tR\x04repo\x12\x16\n" + + "\x06number\x18\x03 \x01(\x03R\x06number\"P\n" + + "\x14ClaimByIssueResponse\x12\"\n" + + "\x04task\x18\x01 \x01(\v2\x0e.state.v1.TaskR\x04task\x12\x14\n" + + "\x05found\x18\x02 \x01(\bR\x05found\"h\n" + + "\x11TransitionRequest\x12\x17\n" + + "\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x12\n" + + "\x04from\x18\x02 \x01(\tR\x04from\x12\x0e\n" + + "\x02to\x18\x03 \x01(\tR\x02to\x12\x16\n" + + "\x06detail\x18\x04 \x01(\tR\x06detail\"\x14\n" + + "\x12TransitionResponse\"3\n" + + "\rUpdateRequest\x12\"\n" + + "\x04task\x18\x01 \x01(\v2\x0e.state.v1.TaskR\x04task\"\x10\n" + + "\x0eUpdateResponse\"f\n" + + "\x0eRequeueRequest\x12\x17\n" + + "\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x1f\n" + + "\vfrom_status\x18\x02 \x01(\tR\n" + + "fromStatus\x12\x1a\n" + + "\bworkflow\x18\x03 \x01(\tR\bworkflow\"\x11\n" + + "\x0fRequeueResponse\"\x15\n" + + "\x13RecoverStaleRequest\",\n" + + "\x14RecoverStaleResponse\x12\x14\n" + + "\x05count\x18\x01 \x01(\x03R\x05count\"u\n" + + "\x12ArchiveTaskRequest\x12\x17\n" + + "\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x1f\n" + + "\vfrom_status\x18\x02 \x01(\tR\n" + + "fromStatus\x12%\n" + + "\x05audit\x18\x03 \x01(\v2\x0f.state.v1.EventR\x05audit\"0\n" + + "\x13ArchiveTaskResponse\x12\x19\n" + + "\bevent_id\x18\x01 \x01(\x03R\aeventId\"h\n" + + "\x10RetryTaskRequest\x12\x17\n" + + "\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x1f\n" + + "\vfrom_status\x18\x02 \x01(\tR\n" + + "fromStatus\x12\x1a\n" + + "\bworkflow\x18\x03 \x01(\tR\bworkflow\"\x13\n" + + "\x11RetryTaskResponse\"V\n" + + "\x12TaskByIssueRequest\x12\x14\n" + + "\x05owner\x18\x01 \x01(\tR\x05owner\x12\x12\n" + + "\x04repo\x18\x02 \x01(\tR\x04repo\x12\x16\n" + + "\x06number\x18\x03 \x01(\x03R\x06number\"O\n" + + "\x13TaskByIssueResponse\x12\"\n" + + "\x04task\x18\x01 \x01(\v2\x0e.state.v1.TaskR\x04task\x12\x14\n" + + "\x05found\x18\x02 \x01(\bR\x05found\"*\n" + + "\x0fTaskByIDRequest\x12\x17\n" + + "\atask_id\x18\x01 \x01(\x03R\x06taskId\"L\n" + + "\x10TaskByIDResponse\x12\"\n" + + "\x04task\x18\x01 \x01(\v2\x0e.state.v1.TaskR\x04task\x12\x14\n" + + "\x05found\x18\x02 \x01(\bR\x05found\"\x10\n" + + "\x0eOpenPRsRequest\"7\n" + + "\x0fOpenPRsResponse\x12$\n" + + "\x05tasks\x18\x01 \x03(\v2\x0e.state.v1.TaskR\x05tasks\"\x1b\n" + + "\x19ClearTerminalTasksRequest\"2\n" + + "\x1aClearTerminalTasksResponse\x12\x14\n" + + "\x05count\x18\x01 \x01(\x03R\x05count\"$\n" + + "\fTasksRequest\x12\x14\n" + + "\x05limit\x18\x01 \x01(\x03R\x05limit\"5\n" + + "\rTasksResponse\x12$\n" + + "\x05tasks\x18\x01 \x03(\v2\x0e.state.v1.TaskR\x05tasks\"\x15\n" + + "\x13StatusCountsRequest\"\x95\x01\n" + + "\x14StatusCountsResponse\x12B\n" + + "\x06counts\x18\x01 \x03(\v2*.state.v1.StatusCountsResponse.CountsEntryR\x06counts\x1a9\n" + + "\vCountsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\x03R\x05value:\x028\x01\"5\n" + + "\x1aIncrementRetryCountRequest\x12\x17\n" + + "\atask_id\x18\x01 \x01(\x03R\x06taskId\"\x1d\n" + + "\x1bIncrementRetryCountResponse\";\n" + + "\x12InsertEventRequest\x12%\n" + + "\x05event\x18\x01 \x01(\v2\x0f.state.v1.EventR\x05event\"%\n" + + "\x13InsertEventResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"E\n" + + "\x12EventsSinceRequest\x12\x19\n" + + "\bsince_id\x18\x01 \x01(\x03R\asinceId\x12\x14\n" + + "\x05limit\x18\x02 \x01(\x03R\x05limit\">\n" + + "\x13EventsSinceResponse\x12'\n" + + "\x06events\x18\x01 \x03(\v2\x0f.state.v1.EventR\x06events\",\n" + + "\x11TaskEventsRequest\x12\x17\n" + + "\atask_id\x18\x01 \x01(\x03R\x06taskId\"=\n" + + "\x12TaskEventsResponse\x12'\n" + + "\x06events\x18\x01 \x03(\v2\x0f.state.v1.EventR\x06events\"\x16\n" + + "\x14WorkflowStatsRequest\"E\n" + + "\x15WorkflowStatsResponse\x12,\n" + + "\x05stats\x18\x01 \x03(\v2\x16.state.v1.WorkflowStatR\x05stats\"\x13\n" + + "\x11StageStatsRequest\"?\n" + + "\x12StageStatsResponse\x12)\n" + + "\x05stats\x18\x01 \x03(\v2\x13.state.v1.StageStatR\x05stats\"(\n" + + "\x12TokensByDayRequest\x12\x12\n" + + "\x04days\x18\x01 \x01(\x03R\x04days\"B\n" + + "\x13TokensByDayResponse\x12+\n" + + "\x06tokens\x18\x01 \x03(\v2\x13.state.v1.DayTokensR\x06tokens\"\x95\x01\n" + + "\x14InsertCaptureRequest\x121\n" + + "\acapture\x18\x01 \x01(\v2\x17.state.v1.CapturedEventR\acapture\x12+\n" + + "\x11retention_seconds\x18\x02 \x01(\x03R\x10retentionSeconds\x12\x1d\n" + + "\n" + + "max_events\x18\x03 \x01(\x03R\tmaxEvents\"'\n" + + "\x15InsertCaptureResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"+\n" + + "\x13ListCapturesRequest\x12\x14\n" + + "\x05limit\x18\x01 \x01(\x03R\x05limit\"K\n" + + "\x14ListCapturesResponse\x123\n" + + "\bcaptures\x18\x01 \x03(\v2\x17.state.v1.CapturedEventR\bcaptures\"C\n" + + "\x14InsertMappingRequest\x12+\n" + + "\amapping\x18\x01 \x01(\v2\x11.state.v1.MappingR\amapping\"'\n" + + "\x15InsertMappingResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"#\n" + + "\x11GetMappingRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"W\n" + + "\x12GetMappingResponse\x12+\n" + + "\amapping\x18\x01 \x01(\v2\x11.state.v1.MappingR\amapping\x12\x14\n" + + "\x05found\x18\x02 \x01(\bR\x05found\"\x15\n" + + "\x13ListMappingsRequest\"E\n" + + "\x14ListMappingsResponse\x12-\n" + + "\bmappings\x18\x01 \x03(\v2\x11.state.v1.MappingR\bmappings\"C\n" + + "\x14UpdateMappingRequest\x12+\n" + + "\amapping\x18\x01 \x01(\v2\x11.state.v1.MappingR\amapping\"\x17\n" + + "\x15UpdateMappingResponse\"&\n" + + "\x14DeleteMappingRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"\x17\n" + + "\x15DeleteMappingResponse\"C\n" + + "\x14InsertBindingRequest\x12+\n" + + "\abinding\x18\x01 \x01(\v2\x11.state.v1.BindingR\abinding\"'\n" + + "\x15InsertBindingResponse\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"#\n" + + "\x11GetBindingRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"W\n" + + "\x12GetBindingResponse\x12+\n" + + "\abinding\x18\x01 \x01(\v2\x11.state.v1.BindingR\abinding\x12\x14\n" + + "\x05found\x18\x02 \x01(\bR\x05found\"\x15\n" + + "\x13ListBindingsRequest\"E\n" + + "\x14ListBindingsResponse\x12-\n" + + "\bbindings\x18\x01 \x03(\v2\x11.state.v1.BindingR\bbindings\"C\n" + + "\x14UpdateBindingRequest\x12+\n" + + "\abinding\x18\x01 \x01(\v2\x11.state.v1.BindingR\abinding\"\x17\n" + + "\x15UpdateBindingResponse\"&\n" + + "\x14DeleteBindingRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"\x17\n" + + "\x15DeleteBindingResponse\"'\n" + + "\x15ApproveBindingRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\"\x18\n" + + "\x16ApproveBindingResponse\"7\n" + + "\x1dArmedBindingsForSourceRequest\x12\x16\n" + + "\x06source\x18\x01 \x01(\tR\x06source\"O\n" + + "\x1eArmedBindingsForSourceResponse\x12-\n" + + "\bbindings\x18\x01 \x03(\v2\x11.state.v1.BindingR\bbindings\"\x97\x01\n" + + "\x15RecordDispatchRequest\x12\x1d\n" + + "\n" + + "binding_id\x18\x01 \x01(\x03R\tbindingId\x12'\n" + + "\x0fbinding_version\x18\x02 \x01(\x03R\x0ebindingVersion\x12\x1d\n" + + "\n" + + "capture_id\x18\x03 \x01(\x03R\tcaptureId\x12\x17\n" + + "\atask_id\x18\x04 \x01(\x03R\x06taskId\"\x18\n" + + "\x16RecordDispatchResponse\"Q\n" + + "\x1fListUndispatchedCapturesRequest\x12\x18\n" + + "\asources\x18\x01 \x03(\tR\asources\x12\x14\n" + + "\x05limit\x18\x02 \x01(\x03R\x05limit\"W\n" + + " ListUndispatchedCapturesResponse\x123\n" + + "\bcaptures\x18\x01 \x03(\v2\x17.state.v1.CapturedEventR\bcaptures\"\xef\x01\n" + + "\x19EnqueueBindingTaskRequest\x12\x14\n" + + "\x05owner\x18\x01 \x01(\tR\x05owner\x12\x12\n" + + "\x04repo\x18\x02 \x01(\tR\x04repo\x12\x14\n" + + "\x05title\x18\x03 \x01(\tR\x05title\x12\x12\n" + + "\x04body\x18\x04 \x01(\tR\x04body\x12\x1a\n" + + "\bworkflow\x18\x05 \x01(\tR\bworkflow\x12\x1a\n" + + "\bidentity\x18\x06 \x01(\tR\bidentity\x12\x1d\n" + + "\n" + + "binding_id\x18\a \x01(\x03R\tbindingId\x12'\n" + + "\x0fbinding_version\x18\b \x01(\x03R\x0ebindingVersion\"@\n" + + "\x1aEnqueueBindingTaskResponse\x12\"\n" + + "\x04task\x18\x01 \x01(\v2\x0e.state.v1.TaskR\x04task2\x83\x19\n" + + "\x11StateStoreService\x12M\n" + + "\fEnqueueIssue\x12\x1d.state.v1.EnqueueIssueRequest\x1a\x1e.state.v1.EnqueueIssueResponse\x12V\n" + + "\x0fEnqueueChatTask\x12 .state.v1.EnqueueChatTaskRequest\x1a!.state.v1.EnqueueChatTaskResponse\x12D\n" + + "\tClaimNext\x12\x1a.state.v1.ClaimNextRequest\x1a\x1b.state.v1.ClaimNextResponse\x12M\n" + + "\fClaimByIssue\x12\x1d.state.v1.ClaimByIssueRequest\x1a\x1e.state.v1.ClaimByIssueResponse\x12G\n" + + "\n" + + "Transition\x12\x1b.state.v1.TransitionRequest\x1a\x1c.state.v1.TransitionResponse\x12;\n" + + "\x06Update\x12\x17.state.v1.UpdateRequest\x1a\x18.state.v1.UpdateResponse\x12>\n" + + "\aRequeue\x12\x18.state.v1.RequeueRequest\x1a\x19.state.v1.RequeueResponse\x12M\n" + + "\fRecoverStale\x12\x1d.state.v1.RecoverStaleRequest\x1a\x1e.state.v1.RecoverStaleResponse\x12J\n" + + "\vArchiveTask\x12\x1c.state.v1.ArchiveTaskRequest\x1a\x1d.state.v1.ArchiveTaskResponse\x12D\n" + + "\tRetryTask\x12\x1a.state.v1.RetryTaskRequest\x1a\x1b.state.v1.RetryTaskResponse\x12J\n" + + "\vTaskByIssue\x12\x1c.state.v1.TaskByIssueRequest\x1a\x1d.state.v1.TaskByIssueResponse\x12A\n" + + "\bTaskByID\x12\x19.state.v1.TaskByIDRequest\x1a\x1a.state.v1.TaskByIDResponse\x12>\n" + + "\aOpenPRs\x12\x18.state.v1.OpenPRsRequest\x1a\x19.state.v1.OpenPRsResponse\x12_\n" + + "\x12ClearTerminalTasks\x12#.state.v1.ClearTerminalTasksRequest\x1a$.state.v1.ClearTerminalTasksResponse\x128\n" + + "\x05Tasks\x12\x16.state.v1.TasksRequest\x1a\x17.state.v1.TasksResponse\x12M\n" + + "\fStatusCounts\x12\x1d.state.v1.StatusCountsRequest\x1a\x1e.state.v1.StatusCountsResponse\x12b\n" + + "\x13IncrementRetryCount\x12$.state.v1.IncrementRetryCountRequest\x1a%.state.v1.IncrementRetryCountResponse\x12J\n" + + "\vInsertEvent\x12\x1c.state.v1.InsertEventRequest\x1a\x1d.state.v1.InsertEventResponse\x12J\n" + + "\vEventsSince\x12\x1c.state.v1.EventsSinceRequest\x1a\x1d.state.v1.EventsSinceResponse\x12G\n" + + "\n" + + "TaskEvents\x12\x1b.state.v1.TaskEventsRequest\x1a\x1c.state.v1.TaskEventsResponse\x12P\n" + + "\rWorkflowStats\x12\x1e.state.v1.WorkflowStatsRequest\x1a\x1f.state.v1.WorkflowStatsResponse\x12G\n" + + "\n" + + "StageStats\x12\x1b.state.v1.StageStatsRequest\x1a\x1c.state.v1.StageStatsResponse\x12J\n" + + "\vTokensByDay\x12\x1c.state.v1.TokensByDayRequest\x1a\x1d.state.v1.TokensByDayResponse\x12P\n" + + "\rInsertCapture\x12\x1e.state.v1.InsertCaptureRequest\x1a\x1f.state.v1.InsertCaptureResponse\x12M\n" + + "\fListCaptures\x12\x1d.state.v1.ListCapturesRequest\x1a\x1e.state.v1.ListCapturesResponse\x12P\n" + + "\rInsertMapping\x12\x1e.state.v1.InsertMappingRequest\x1a\x1f.state.v1.InsertMappingResponse\x12G\n" + + "\n" + + "GetMapping\x12\x1b.state.v1.GetMappingRequest\x1a\x1c.state.v1.GetMappingResponse\x12M\n" + + "\fListMappings\x12\x1d.state.v1.ListMappingsRequest\x1a\x1e.state.v1.ListMappingsResponse\x12P\n" + + "\rUpdateMapping\x12\x1e.state.v1.UpdateMappingRequest\x1a\x1f.state.v1.UpdateMappingResponse\x12P\n" + + "\rDeleteMapping\x12\x1e.state.v1.DeleteMappingRequest\x1a\x1f.state.v1.DeleteMappingResponse\x12P\n" + + "\rInsertBinding\x12\x1e.state.v1.InsertBindingRequest\x1a\x1f.state.v1.InsertBindingResponse\x12G\n" + + "\n" + + "GetBinding\x12\x1b.state.v1.GetBindingRequest\x1a\x1c.state.v1.GetBindingResponse\x12M\n" + + "\fListBindings\x12\x1d.state.v1.ListBindingsRequest\x1a\x1e.state.v1.ListBindingsResponse\x12P\n" + + "\rUpdateBinding\x12\x1e.state.v1.UpdateBindingRequest\x1a\x1f.state.v1.UpdateBindingResponse\x12P\n" + + "\rDeleteBinding\x12\x1e.state.v1.DeleteBindingRequest\x1a\x1f.state.v1.DeleteBindingResponse\x12S\n" + + "\x0eApproveBinding\x12\x1f.state.v1.ApproveBindingRequest\x1a .state.v1.ApproveBindingResponse\x12k\n" + + "\x16ArmedBindingsForSource\x12'.state.v1.ArmedBindingsForSourceRequest\x1a(.state.v1.ArmedBindingsForSourceResponse\x12S\n" + + "\x0eRecordDispatch\x12\x1f.state.v1.RecordDispatchRequest\x1a .state.v1.RecordDispatchResponse\x12q\n" + + "\x18ListUndispatchedCaptures\x12).state.v1.ListUndispatchedCapturesRequest\x1a*.state.v1.ListUndispatchedCapturesResponse\x12_\n" + + "\x12EnqueueBindingTask\x12#.state.v1.EnqueueBindingTaskRequest\x1a$.state.v1.EnqueueBindingTaskResponseB\xa4\x01\n" + + "\fcom.state.v1B\n" + + "StateProtoP\x01ZGgithub.com/samcharles93/archie-core/internal/contracts/state/v1;statev1\xa2\x02\x03SXX\xaa\x02\bState.V1\xca\x02\bState\\V1\xe2\x02\x14State\\V1\\GPBMetadata\xea\x02\tState::V1b\x06proto3" + +var ( + file_state_v1_state_proto_rawDescOnce sync.Once + file_state_v1_state_proto_rawDescData []byte +) + +func file_state_v1_state_proto_rawDescGZIP() []byte { + file_state_v1_state_proto_rawDescOnce.Do(func() { + file_state_v1_state_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_state_v1_state_proto_rawDesc), len(file_state_v1_state_proto_rawDesc))) + }) + return file_state_v1_state_proto_rawDescData +} + +var file_state_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 91) +var file_state_v1_state_proto_goTypes = []any{ + (*Task)(nil), // 0: state.v1.Task + (*Event)(nil), // 1: state.v1.Event + (*CapturedEvent)(nil), // 2: state.v1.CapturedEvent + (*MappingField)(nil), // 3: state.v1.MappingField + (*Mapping)(nil), // 4: state.v1.Mapping + (*BindingMatcher)(nil), // 5: state.v1.BindingMatcher + (*Binding)(nil), // 6: state.v1.Binding + (*WorkflowStat)(nil), // 7: state.v1.WorkflowStat + (*StageStat)(nil), // 8: state.v1.StageStat + (*DayTokens)(nil), // 9: state.v1.DayTokens + (*EnqueueIssueRequest)(nil), // 10: state.v1.EnqueueIssueRequest + (*EnqueueIssueResponse)(nil), // 11: state.v1.EnqueueIssueResponse + (*EnqueueChatTaskRequest)(nil), // 12: state.v1.EnqueueChatTaskRequest + (*EnqueueChatTaskResponse)(nil), // 13: state.v1.EnqueueChatTaskResponse + (*ClaimNextRequest)(nil), // 14: state.v1.ClaimNextRequest + (*ClaimNextResponse)(nil), // 15: state.v1.ClaimNextResponse + (*ClaimByIssueRequest)(nil), // 16: state.v1.ClaimByIssueRequest + (*ClaimByIssueResponse)(nil), // 17: state.v1.ClaimByIssueResponse + (*TransitionRequest)(nil), // 18: state.v1.TransitionRequest + (*TransitionResponse)(nil), // 19: state.v1.TransitionResponse + (*UpdateRequest)(nil), // 20: state.v1.UpdateRequest + (*UpdateResponse)(nil), // 21: state.v1.UpdateResponse + (*RequeueRequest)(nil), // 22: state.v1.RequeueRequest + (*RequeueResponse)(nil), // 23: state.v1.RequeueResponse + (*RecoverStaleRequest)(nil), // 24: state.v1.RecoverStaleRequest + (*RecoverStaleResponse)(nil), // 25: state.v1.RecoverStaleResponse + (*ArchiveTaskRequest)(nil), // 26: state.v1.ArchiveTaskRequest + (*ArchiveTaskResponse)(nil), // 27: state.v1.ArchiveTaskResponse + (*RetryTaskRequest)(nil), // 28: state.v1.RetryTaskRequest + (*RetryTaskResponse)(nil), // 29: state.v1.RetryTaskResponse + (*TaskByIssueRequest)(nil), // 30: state.v1.TaskByIssueRequest + (*TaskByIssueResponse)(nil), // 31: state.v1.TaskByIssueResponse + (*TaskByIDRequest)(nil), // 32: state.v1.TaskByIDRequest + (*TaskByIDResponse)(nil), // 33: state.v1.TaskByIDResponse + (*OpenPRsRequest)(nil), // 34: state.v1.OpenPRsRequest + (*OpenPRsResponse)(nil), // 35: state.v1.OpenPRsResponse + (*ClearTerminalTasksRequest)(nil), // 36: state.v1.ClearTerminalTasksRequest + (*ClearTerminalTasksResponse)(nil), // 37: state.v1.ClearTerminalTasksResponse + (*TasksRequest)(nil), // 38: state.v1.TasksRequest + (*TasksResponse)(nil), // 39: state.v1.TasksResponse + (*StatusCountsRequest)(nil), // 40: state.v1.StatusCountsRequest + (*StatusCountsResponse)(nil), // 41: state.v1.StatusCountsResponse + (*IncrementRetryCountRequest)(nil), // 42: state.v1.IncrementRetryCountRequest + (*IncrementRetryCountResponse)(nil), // 43: state.v1.IncrementRetryCountResponse + (*InsertEventRequest)(nil), // 44: state.v1.InsertEventRequest + (*InsertEventResponse)(nil), // 45: state.v1.InsertEventResponse + (*EventsSinceRequest)(nil), // 46: state.v1.EventsSinceRequest + (*EventsSinceResponse)(nil), // 47: state.v1.EventsSinceResponse + (*TaskEventsRequest)(nil), // 48: state.v1.TaskEventsRequest + (*TaskEventsResponse)(nil), // 49: state.v1.TaskEventsResponse + (*WorkflowStatsRequest)(nil), // 50: state.v1.WorkflowStatsRequest + (*WorkflowStatsResponse)(nil), // 51: state.v1.WorkflowStatsResponse + (*StageStatsRequest)(nil), // 52: state.v1.StageStatsRequest + (*StageStatsResponse)(nil), // 53: state.v1.StageStatsResponse + (*TokensByDayRequest)(nil), // 54: state.v1.TokensByDayRequest + (*TokensByDayResponse)(nil), // 55: state.v1.TokensByDayResponse + (*InsertCaptureRequest)(nil), // 56: state.v1.InsertCaptureRequest + (*InsertCaptureResponse)(nil), // 57: state.v1.InsertCaptureResponse + (*ListCapturesRequest)(nil), // 58: state.v1.ListCapturesRequest + (*ListCapturesResponse)(nil), // 59: state.v1.ListCapturesResponse + (*InsertMappingRequest)(nil), // 60: state.v1.InsertMappingRequest + (*InsertMappingResponse)(nil), // 61: state.v1.InsertMappingResponse + (*GetMappingRequest)(nil), // 62: state.v1.GetMappingRequest + (*GetMappingResponse)(nil), // 63: state.v1.GetMappingResponse + (*ListMappingsRequest)(nil), // 64: state.v1.ListMappingsRequest + (*ListMappingsResponse)(nil), // 65: state.v1.ListMappingsResponse + (*UpdateMappingRequest)(nil), // 66: state.v1.UpdateMappingRequest + (*UpdateMappingResponse)(nil), // 67: state.v1.UpdateMappingResponse + (*DeleteMappingRequest)(nil), // 68: state.v1.DeleteMappingRequest + (*DeleteMappingResponse)(nil), // 69: state.v1.DeleteMappingResponse + (*InsertBindingRequest)(nil), // 70: state.v1.InsertBindingRequest + (*InsertBindingResponse)(nil), // 71: state.v1.InsertBindingResponse + (*GetBindingRequest)(nil), // 72: state.v1.GetBindingRequest + (*GetBindingResponse)(nil), // 73: state.v1.GetBindingResponse + (*ListBindingsRequest)(nil), // 74: state.v1.ListBindingsRequest + (*ListBindingsResponse)(nil), // 75: state.v1.ListBindingsResponse + (*UpdateBindingRequest)(nil), // 76: state.v1.UpdateBindingRequest + (*UpdateBindingResponse)(nil), // 77: state.v1.UpdateBindingResponse + (*DeleteBindingRequest)(nil), // 78: state.v1.DeleteBindingRequest + (*DeleteBindingResponse)(nil), // 79: state.v1.DeleteBindingResponse + (*ApproveBindingRequest)(nil), // 80: state.v1.ApproveBindingRequest + (*ApproveBindingResponse)(nil), // 81: state.v1.ApproveBindingResponse + (*ArmedBindingsForSourceRequest)(nil), // 82: state.v1.ArmedBindingsForSourceRequest + (*ArmedBindingsForSourceResponse)(nil), // 83: state.v1.ArmedBindingsForSourceResponse + (*RecordDispatchRequest)(nil), // 84: state.v1.RecordDispatchRequest + (*RecordDispatchResponse)(nil), // 85: state.v1.RecordDispatchResponse + (*ListUndispatchedCapturesRequest)(nil), // 86: state.v1.ListUndispatchedCapturesRequest + (*ListUndispatchedCapturesResponse)(nil), // 87: state.v1.ListUndispatchedCapturesResponse + (*EnqueueBindingTaskRequest)(nil), // 88: state.v1.EnqueueBindingTaskRequest + (*EnqueueBindingTaskResponse)(nil), // 89: state.v1.EnqueueBindingTaskResponse + nil, // 90: state.v1.StatusCountsResponse.CountsEntry + (*timestamppb.Timestamp)(nil), // 91: google.protobuf.Timestamp +} +var file_state_v1_state_proto_depIdxs = []int32{ + 91, // 0: state.v1.Task.created_at:type_name -> google.protobuf.Timestamp + 91, // 1: state.v1.Task.updated_at:type_name -> google.protobuf.Timestamp + 91, // 2: state.v1.Event.at:type_name -> google.protobuf.Timestamp + 91, // 3: state.v1.CapturedEvent.received_at:type_name -> google.protobuf.Timestamp + 3, // 4: state.v1.Mapping.fields:type_name -> state.v1.MappingField + 91, // 5: state.v1.Mapping.created_at:type_name -> google.protobuf.Timestamp + 91, // 6: state.v1.Mapping.updated_at:type_name -> google.protobuf.Timestamp + 5, // 7: state.v1.Binding.matcher:type_name -> state.v1.BindingMatcher + 91, // 8: state.v1.Binding.created_at:type_name -> google.protobuf.Timestamp + 91, // 9: state.v1.Binding.updated_at:type_name -> google.protobuf.Timestamp + 0, // 10: state.v1.EnqueueChatTaskResponse.task:type_name -> state.v1.Task + 0, // 11: state.v1.ClaimNextResponse.task:type_name -> state.v1.Task + 0, // 12: state.v1.ClaimByIssueResponse.task:type_name -> state.v1.Task + 0, // 13: state.v1.UpdateRequest.task:type_name -> state.v1.Task + 1, // 14: state.v1.ArchiveTaskRequest.audit:type_name -> state.v1.Event + 0, // 15: state.v1.TaskByIssueResponse.task:type_name -> state.v1.Task + 0, // 16: state.v1.TaskByIDResponse.task:type_name -> state.v1.Task + 0, // 17: state.v1.OpenPRsResponse.tasks:type_name -> state.v1.Task + 0, // 18: state.v1.TasksResponse.tasks:type_name -> state.v1.Task + 90, // 19: state.v1.StatusCountsResponse.counts:type_name -> state.v1.StatusCountsResponse.CountsEntry + 1, // 20: state.v1.InsertEventRequest.event:type_name -> state.v1.Event + 1, // 21: state.v1.EventsSinceResponse.events:type_name -> state.v1.Event + 1, // 22: state.v1.TaskEventsResponse.events:type_name -> state.v1.Event + 7, // 23: state.v1.WorkflowStatsResponse.stats:type_name -> state.v1.WorkflowStat + 8, // 24: state.v1.StageStatsResponse.stats:type_name -> state.v1.StageStat + 9, // 25: state.v1.TokensByDayResponse.tokens:type_name -> state.v1.DayTokens + 2, // 26: state.v1.InsertCaptureRequest.capture:type_name -> state.v1.CapturedEvent + 2, // 27: state.v1.ListCapturesResponse.captures:type_name -> state.v1.CapturedEvent + 4, // 28: state.v1.InsertMappingRequest.mapping:type_name -> state.v1.Mapping + 4, // 29: state.v1.GetMappingResponse.mapping:type_name -> state.v1.Mapping + 4, // 30: state.v1.ListMappingsResponse.mappings:type_name -> state.v1.Mapping + 4, // 31: state.v1.UpdateMappingRequest.mapping:type_name -> state.v1.Mapping + 6, // 32: state.v1.InsertBindingRequest.binding:type_name -> state.v1.Binding + 6, // 33: state.v1.GetBindingResponse.binding:type_name -> state.v1.Binding + 6, // 34: state.v1.ListBindingsResponse.bindings:type_name -> state.v1.Binding + 6, // 35: state.v1.UpdateBindingRequest.binding:type_name -> state.v1.Binding + 6, // 36: state.v1.ArmedBindingsForSourceResponse.bindings:type_name -> state.v1.Binding + 2, // 37: state.v1.ListUndispatchedCapturesResponse.captures:type_name -> state.v1.CapturedEvent + 0, // 38: state.v1.EnqueueBindingTaskResponse.task:type_name -> state.v1.Task + 10, // 39: state.v1.StateStoreService.EnqueueIssue:input_type -> state.v1.EnqueueIssueRequest + 12, // 40: state.v1.StateStoreService.EnqueueChatTask:input_type -> state.v1.EnqueueChatTaskRequest + 14, // 41: state.v1.StateStoreService.ClaimNext:input_type -> state.v1.ClaimNextRequest + 16, // 42: state.v1.StateStoreService.ClaimByIssue:input_type -> state.v1.ClaimByIssueRequest + 18, // 43: state.v1.StateStoreService.Transition:input_type -> state.v1.TransitionRequest + 20, // 44: state.v1.StateStoreService.Update:input_type -> state.v1.UpdateRequest + 22, // 45: state.v1.StateStoreService.Requeue:input_type -> state.v1.RequeueRequest + 24, // 46: state.v1.StateStoreService.RecoverStale:input_type -> state.v1.RecoverStaleRequest + 26, // 47: state.v1.StateStoreService.ArchiveTask:input_type -> state.v1.ArchiveTaskRequest + 28, // 48: state.v1.StateStoreService.RetryTask:input_type -> state.v1.RetryTaskRequest + 30, // 49: state.v1.StateStoreService.TaskByIssue:input_type -> state.v1.TaskByIssueRequest + 32, // 50: state.v1.StateStoreService.TaskByID:input_type -> state.v1.TaskByIDRequest + 34, // 51: state.v1.StateStoreService.OpenPRs:input_type -> state.v1.OpenPRsRequest + 36, // 52: state.v1.StateStoreService.ClearTerminalTasks:input_type -> state.v1.ClearTerminalTasksRequest + 38, // 53: state.v1.StateStoreService.Tasks:input_type -> state.v1.TasksRequest + 40, // 54: state.v1.StateStoreService.StatusCounts:input_type -> state.v1.StatusCountsRequest + 42, // 55: state.v1.StateStoreService.IncrementRetryCount:input_type -> state.v1.IncrementRetryCountRequest + 44, // 56: state.v1.StateStoreService.InsertEvent:input_type -> state.v1.InsertEventRequest + 46, // 57: state.v1.StateStoreService.EventsSince:input_type -> state.v1.EventsSinceRequest + 48, // 58: state.v1.StateStoreService.TaskEvents:input_type -> state.v1.TaskEventsRequest + 50, // 59: state.v1.StateStoreService.WorkflowStats:input_type -> state.v1.WorkflowStatsRequest + 52, // 60: state.v1.StateStoreService.StageStats:input_type -> state.v1.StageStatsRequest + 54, // 61: state.v1.StateStoreService.TokensByDay:input_type -> state.v1.TokensByDayRequest + 56, // 62: state.v1.StateStoreService.InsertCapture:input_type -> state.v1.InsertCaptureRequest + 58, // 63: state.v1.StateStoreService.ListCaptures:input_type -> state.v1.ListCapturesRequest + 60, // 64: state.v1.StateStoreService.InsertMapping:input_type -> state.v1.InsertMappingRequest + 62, // 65: state.v1.StateStoreService.GetMapping:input_type -> state.v1.GetMappingRequest + 64, // 66: state.v1.StateStoreService.ListMappings:input_type -> state.v1.ListMappingsRequest + 66, // 67: state.v1.StateStoreService.UpdateMapping:input_type -> state.v1.UpdateMappingRequest + 68, // 68: state.v1.StateStoreService.DeleteMapping:input_type -> state.v1.DeleteMappingRequest + 70, // 69: state.v1.StateStoreService.InsertBinding:input_type -> state.v1.InsertBindingRequest + 72, // 70: state.v1.StateStoreService.GetBinding:input_type -> state.v1.GetBindingRequest + 74, // 71: state.v1.StateStoreService.ListBindings:input_type -> state.v1.ListBindingsRequest + 76, // 72: state.v1.StateStoreService.UpdateBinding:input_type -> state.v1.UpdateBindingRequest + 78, // 73: state.v1.StateStoreService.DeleteBinding:input_type -> state.v1.DeleteBindingRequest + 80, // 74: state.v1.StateStoreService.ApproveBinding:input_type -> state.v1.ApproveBindingRequest + 82, // 75: state.v1.StateStoreService.ArmedBindingsForSource:input_type -> state.v1.ArmedBindingsForSourceRequest + 84, // 76: state.v1.StateStoreService.RecordDispatch:input_type -> state.v1.RecordDispatchRequest + 86, // 77: state.v1.StateStoreService.ListUndispatchedCaptures:input_type -> state.v1.ListUndispatchedCapturesRequest + 88, // 78: state.v1.StateStoreService.EnqueueBindingTask:input_type -> state.v1.EnqueueBindingTaskRequest + 11, // 79: state.v1.StateStoreService.EnqueueIssue:output_type -> state.v1.EnqueueIssueResponse + 13, // 80: state.v1.StateStoreService.EnqueueChatTask:output_type -> state.v1.EnqueueChatTaskResponse + 15, // 81: state.v1.StateStoreService.ClaimNext:output_type -> state.v1.ClaimNextResponse + 17, // 82: state.v1.StateStoreService.ClaimByIssue:output_type -> state.v1.ClaimByIssueResponse + 19, // 83: state.v1.StateStoreService.Transition:output_type -> state.v1.TransitionResponse + 21, // 84: state.v1.StateStoreService.Update:output_type -> state.v1.UpdateResponse + 23, // 85: state.v1.StateStoreService.Requeue:output_type -> state.v1.RequeueResponse + 25, // 86: state.v1.StateStoreService.RecoverStale:output_type -> state.v1.RecoverStaleResponse + 27, // 87: state.v1.StateStoreService.ArchiveTask:output_type -> state.v1.ArchiveTaskResponse + 29, // 88: state.v1.StateStoreService.RetryTask:output_type -> state.v1.RetryTaskResponse + 31, // 89: state.v1.StateStoreService.TaskByIssue:output_type -> state.v1.TaskByIssueResponse + 33, // 90: state.v1.StateStoreService.TaskByID:output_type -> state.v1.TaskByIDResponse + 35, // 91: state.v1.StateStoreService.OpenPRs:output_type -> state.v1.OpenPRsResponse + 37, // 92: state.v1.StateStoreService.ClearTerminalTasks:output_type -> state.v1.ClearTerminalTasksResponse + 39, // 93: state.v1.StateStoreService.Tasks:output_type -> state.v1.TasksResponse + 41, // 94: state.v1.StateStoreService.StatusCounts:output_type -> state.v1.StatusCountsResponse + 43, // 95: state.v1.StateStoreService.IncrementRetryCount:output_type -> state.v1.IncrementRetryCountResponse + 45, // 96: state.v1.StateStoreService.InsertEvent:output_type -> state.v1.InsertEventResponse + 47, // 97: state.v1.StateStoreService.EventsSince:output_type -> state.v1.EventsSinceResponse + 49, // 98: state.v1.StateStoreService.TaskEvents:output_type -> state.v1.TaskEventsResponse + 51, // 99: state.v1.StateStoreService.WorkflowStats:output_type -> state.v1.WorkflowStatsResponse + 53, // 100: state.v1.StateStoreService.StageStats:output_type -> state.v1.StageStatsResponse + 55, // 101: state.v1.StateStoreService.TokensByDay:output_type -> state.v1.TokensByDayResponse + 57, // 102: state.v1.StateStoreService.InsertCapture:output_type -> state.v1.InsertCaptureResponse + 59, // 103: state.v1.StateStoreService.ListCaptures:output_type -> state.v1.ListCapturesResponse + 61, // 104: state.v1.StateStoreService.InsertMapping:output_type -> state.v1.InsertMappingResponse + 63, // 105: state.v1.StateStoreService.GetMapping:output_type -> state.v1.GetMappingResponse + 65, // 106: state.v1.StateStoreService.ListMappings:output_type -> state.v1.ListMappingsResponse + 67, // 107: state.v1.StateStoreService.UpdateMapping:output_type -> state.v1.UpdateMappingResponse + 69, // 108: state.v1.StateStoreService.DeleteMapping:output_type -> state.v1.DeleteMappingResponse + 71, // 109: state.v1.StateStoreService.InsertBinding:output_type -> state.v1.InsertBindingResponse + 73, // 110: state.v1.StateStoreService.GetBinding:output_type -> state.v1.GetBindingResponse + 75, // 111: state.v1.StateStoreService.ListBindings:output_type -> state.v1.ListBindingsResponse + 77, // 112: state.v1.StateStoreService.UpdateBinding:output_type -> state.v1.UpdateBindingResponse + 79, // 113: state.v1.StateStoreService.DeleteBinding:output_type -> state.v1.DeleteBindingResponse + 81, // 114: state.v1.StateStoreService.ApproveBinding:output_type -> state.v1.ApproveBindingResponse + 83, // 115: state.v1.StateStoreService.ArmedBindingsForSource:output_type -> state.v1.ArmedBindingsForSourceResponse + 85, // 116: state.v1.StateStoreService.RecordDispatch:output_type -> state.v1.RecordDispatchResponse + 87, // 117: state.v1.StateStoreService.ListUndispatchedCaptures:output_type -> state.v1.ListUndispatchedCapturesResponse + 89, // 118: state.v1.StateStoreService.EnqueueBindingTask:output_type -> state.v1.EnqueueBindingTaskResponse + 79, // [79:119] is the sub-list for method output_type + 39, // [39:79] is the sub-list for method input_type + 39, // [39:39] is the sub-list for extension type_name + 39, // [39:39] is the sub-list for extension extendee + 0, // [0:39] is the sub-list for field type_name +} + +func init() { file_state_v1_state_proto_init() } +func file_state_v1_state_proto_init() { + if File_state_v1_state_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_state_v1_state_proto_rawDesc), len(file_state_v1_state_proto_rawDesc)), + NumEnums: 0, + NumMessages: 91, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_state_v1_state_proto_goTypes, + DependencyIndexes: file_state_v1_state_proto_depIdxs, + MessageInfos: file_state_v1_state_proto_msgTypes, + }.Build() + File_state_v1_state_proto = out.File + file_state_v1_state_proto_goTypes = nil + file_state_v1_state_proto_depIdxs = nil +} diff --git a/internal/contracts/state/v1/state_grpc.pb.go b/internal/contracts/state/v1/state_grpc.pb.go new file mode 100644 index 000000000..dbee72a5d --- /dev/null +++ b/internal/contracts/state/v1/state_grpc.pb.go @@ -0,0 +1,1637 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.6.2 +// - protoc (unknown) +// source: state/v1/state.proto + +package statev1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + StateStoreService_EnqueueIssue_FullMethodName = "/state.v1.StateStoreService/EnqueueIssue" + StateStoreService_EnqueueChatTask_FullMethodName = "/state.v1.StateStoreService/EnqueueChatTask" + StateStoreService_ClaimNext_FullMethodName = "/state.v1.StateStoreService/ClaimNext" + StateStoreService_ClaimByIssue_FullMethodName = "/state.v1.StateStoreService/ClaimByIssue" + StateStoreService_Transition_FullMethodName = "/state.v1.StateStoreService/Transition" + StateStoreService_Update_FullMethodName = "/state.v1.StateStoreService/Update" + StateStoreService_Requeue_FullMethodName = "/state.v1.StateStoreService/Requeue" + StateStoreService_RecoverStale_FullMethodName = "/state.v1.StateStoreService/RecoverStale" + StateStoreService_ArchiveTask_FullMethodName = "/state.v1.StateStoreService/ArchiveTask" + StateStoreService_RetryTask_FullMethodName = "/state.v1.StateStoreService/RetryTask" + StateStoreService_TaskByIssue_FullMethodName = "/state.v1.StateStoreService/TaskByIssue" + StateStoreService_TaskByID_FullMethodName = "/state.v1.StateStoreService/TaskByID" + StateStoreService_OpenPRs_FullMethodName = "/state.v1.StateStoreService/OpenPRs" + StateStoreService_ClearTerminalTasks_FullMethodName = "/state.v1.StateStoreService/ClearTerminalTasks" + StateStoreService_Tasks_FullMethodName = "/state.v1.StateStoreService/Tasks" + StateStoreService_StatusCounts_FullMethodName = "/state.v1.StateStoreService/StatusCounts" + StateStoreService_IncrementRetryCount_FullMethodName = "/state.v1.StateStoreService/IncrementRetryCount" + StateStoreService_InsertEvent_FullMethodName = "/state.v1.StateStoreService/InsertEvent" + StateStoreService_EventsSince_FullMethodName = "/state.v1.StateStoreService/EventsSince" + StateStoreService_TaskEvents_FullMethodName = "/state.v1.StateStoreService/TaskEvents" + StateStoreService_WorkflowStats_FullMethodName = "/state.v1.StateStoreService/WorkflowStats" + StateStoreService_StageStats_FullMethodName = "/state.v1.StateStoreService/StageStats" + StateStoreService_TokensByDay_FullMethodName = "/state.v1.StateStoreService/TokensByDay" + StateStoreService_InsertCapture_FullMethodName = "/state.v1.StateStoreService/InsertCapture" + StateStoreService_ListCaptures_FullMethodName = "/state.v1.StateStoreService/ListCaptures" + StateStoreService_InsertMapping_FullMethodName = "/state.v1.StateStoreService/InsertMapping" + StateStoreService_GetMapping_FullMethodName = "/state.v1.StateStoreService/GetMapping" + StateStoreService_ListMappings_FullMethodName = "/state.v1.StateStoreService/ListMappings" + StateStoreService_UpdateMapping_FullMethodName = "/state.v1.StateStoreService/UpdateMapping" + StateStoreService_DeleteMapping_FullMethodName = "/state.v1.StateStoreService/DeleteMapping" + StateStoreService_InsertBinding_FullMethodName = "/state.v1.StateStoreService/InsertBinding" + StateStoreService_GetBinding_FullMethodName = "/state.v1.StateStoreService/GetBinding" + StateStoreService_ListBindings_FullMethodName = "/state.v1.StateStoreService/ListBindings" + StateStoreService_UpdateBinding_FullMethodName = "/state.v1.StateStoreService/UpdateBinding" + StateStoreService_DeleteBinding_FullMethodName = "/state.v1.StateStoreService/DeleteBinding" + StateStoreService_ApproveBinding_FullMethodName = "/state.v1.StateStoreService/ApproveBinding" + StateStoreService_ArmedBindingsForSource_FullMethodName = "/state.v1.StateStoreService/ArmedBindingsForSource" + StateStoreService_RecordDispatch_FullMethodName = "/state.v1.StateStoreService/RecordDispatch" + StateStoreService_ListUndispatchedCaptures_FullMethodName = "/state.v1.StateStoreService/ListUndispatchedCaptures" + StateStoreService_EnqueueBindingTask_FullMethodName = "/state.v1.StateStoreService/EnqueueBindingTask" +) + +// StateStoreServiceClient is the client API for StateStoreService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// StateStore is the single gRPC service fronting archie.db (one store, one +// file). See docs/prds/state-store-contract.md for the ownership split: the +// workflow-domain Store view (Update/Transition/InsertEvent) is consumer-owned +// in internal/domain/workflow, while the rest of this surface stays +// producer-owned in internal/store. Both are served by the same service and +// the same *store.Store implementation; the proto bypasses the Go +// interfacebloat cap (max 8), like gateway.v1.ChatService does. +type StateStoreServiceClient interface { + // Lifecycle + EnqueueIssue(ctx context.Context, in *EnqueueIssueRequest, opts ...grpc.CallOption) (*EnqueueIssueResponse, error) + EnqueueChatTask(ctx context.Context, in *EnqueueChatTaskRequest, opts ...grpc.CallOption) (*EnqueueChatTaskResponse, error) + ClaimNext(ctx context.Context, in *ClaimNextRequest, opts ...grpc.CallOption) (*ClaimNextResponse, error) + ClaimByIssue(ctx context.Context, in *ClaimByIssueRequest, opts ...grpc.CallOption) (*ClaimByIssueResponse, error) + Transition(ctx context.Context, in *TransitionRequest, opts ...grpc.CallOption) (*TransitionResponse, error) + Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) + Requeue(ctx context.Context, in *RequeueRequest, opts ...grpc.CallOption) (*RequeueResponse, error) + RecoverStale(ctx context.Context, in *RecoverStaleRequest, opts ...grpc.CallOption) (*RecoverStaleResponse, error) + // Archive / Retry + ArchiveTask(ctx context.Context, in *ArchiveTaskRequest, opts ...grpc.CallOption) (*ArchiveTaskResponse, error) + RetryTask(ctx context.Context, in *RetryTaskRequest, opts ...grpc.CallOption) (*RetryTaskResponse, error) + // Queries + TaskByIssue(ctx context.Context, in *TaskByIssueRequest, opts ...grpc.CallOption) (*TaskByIssueResponse, error) + TaskByID(ctx context.Context, in *TaskByIDRequest, opts ...grpc.CallOption) (*TaskByIDResponse, error) + OpenPRs(ctx context.Context, in *OpenPRsRequest, opts ...grpc.CallOption) (*OpenPRsResponse, error) + ClearTerminalTasks(ctx context.Context, in *ClearTerminalTasksRequest, opts ...grpc.CallOption) (*ClearTerminalTasksResponse, error) + Tasks(ctx context.Context, in *TasksRequest, opts ...grpc.CallOption) (*TasksResponse, error) + StatusCounts(ctx context.Context, in *StatusCountsRequest, opts ...grpc.CallOption) (*StatusCountsResponse, error) + IncrementRetryCount(ctx context.Context, in *IncrementRetryCountRequest, opts ...grpc.CallOption) (*IncrementRetryCountResponse, error) + // Events + InsertEvent(ctx context.Context, in *InsertEventRequest, opts ...grpc.CallOption) (*InsertEventResponse, error) + EventsSince(ctx context.Context, in *EventsSinceRequest, opts ...grpc.CallOption) (*EventsSinceResponse, error) + TaskEvents(ctx context.Context, in *TaskEventsRequest, opts ...grpc.CallOption) (*TaskEventsResponse, error) + WorkflowStats(ctx context.Context, in *WorkflowStatsRequest, opts ...grpc.CallOption) (*WorkflowStatsResponse, error) + StageStats(ctx context.Context, in *StageStatsRequest, opts ...grpc.CallOption) (*StageStatsResponse, error) + TokensByDay(ctx context.Context, in *TokensByDayRequest, opts ...grpc.CallOption) (*TokensByDayResponse, error) + // Capture + InsertCapture(ctx context.Context, in *InsertCaptureRequest, opts ...grpc.CallOption) (*InsertCaptureResponse, error) + ListCaptures(ctx context.Context, in *ListCapturesRequest, opts ...grpc.CallOption) (*ListCapturesResponse, error) + // Mapping + InsertMapping(ctx context.Context, in *InsertMappingRequest, opts ...grpc.CallOption) (*InsertMappingResponse, error) + GetMapping(ctx context.Context, in *GetMappingRequest, opts ...grpc.CallOption) (*GetMappingResponse, error) + ListMappings(ctx context.Context, in *ListMappingsRequest, opts ...grpc.CallOption) (*ListMappingsResponse, error) + UpdateMapping(ctx context.Context, in *UpdateMappingRequest, opts ...grpc.CallOption) (*UpdateMappingResponse, error) + DeleteMapping(ctx context.Context, in *DeleteMappingRequest, opts ...grpc.CallOption) (*DeleteMappingResponse, error) + // Binding + InsertBinding(ctx context.Context, in *InsertBindingRequest, opts ...grpc.CallOption) (*InsertBindingResponse, error) + GetBinding(ctx context.Context, in *GetBindingRequest, opts ...grpc.CallOption) (*GetBindingResponse, error) + ListBindings(ctx context.Context, in *ListBindingsRequest, opts ...grpc.CallOption) (*ListBindingsResponse, error) + UpdateBinding(ctx context.Context, in *UpdateBindingRequest, opts ...grpc.CallOption) (*UpdateBindingResponse, error) + DeleteBinding(ctx context.Context, in *DeleteBindingRequest, opts ...grpc.CallOption) (*DeleteBindingResponse, error) + ApproveBinding(ctx context.Context, in *ApproveBindingRequest, opts ...grpc.CallOption) (*ApproveBindingResponse, error) + // Dispatch + ArmedBindingsForSource(ctx context.Context, in *ArmedBindingsForSourceRequest, opts ...grpc.CallOption) (*ArmedBindingsForSourceResponse, error) + RecordDispatch(ctx context.Context, in *RecordDispatchRequest, opts ...grpc.CallOption) (*RecordDispatchResponse, error) + ListUndispatchedCaptures(ctx context.Context, in *ListUndispatchedCapturesRequest, opts ...grpc.CallOption) (*ListUndispatchedCapturesResponse, error) + // BindingTaskCreator + EnqueueBindingTask(ctx context.Context, in *EnqueueBindingTaskRequest, opts ...grpc.CallOption) (*EnqueueBindingTaskResponse, error) +} + +type stateStoreServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewStateStoreServiceClient(cc grpc.ClientConnInterface) StateStoreServiceClient { + return &stateStoreServiceClient{cc} +} + +func (c *stateStoreServiceClient) EnqueueIssue(ctx context.Context, in *EnqueueIssueRequest, opts ...grpc.CallOption) (*EnqueueIssueResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(EnqueueIssueResponse) + err := c.cc.Invoke(ctx, StateStoreService_EnqueueIssue_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) EnqueueChatTask(ctx context.Context, in *EnqueueChatTaskRequest, opts ...grpc.CallOption) (*EnqueueChatTaskResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(EnqueueChatTaskResponse) + err := c.cc.Invoke(ctx, StateStoreService_EnqueueChatTask_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) ClaimNext(ctx context.Context, in *ClaimNextRequest, opts ...grpc.CallOption) (*ClaimNextResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ClaimNextResponse) + err := c.cc.Invoke(ctx, StateStoreService_ClaimNext_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) ClaimByIssue(ctx context.Context, in *ClaimByIssueRequest, opts ...grpc.CallOption) (*ClaimByIssueResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ClaimByIssueResponse) + err := c.cc.Invoke(ctx, StateStoreService_ClaimByIssue_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) Transition(ctx context.Context, in *TransitionRequest, opts ...grpc.CallOption) (*TransitionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TransitionResponse) + err := c.cc.Invoke(ctx, StateStoreService_Transition_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UpdateResponse) + err := c.cc.Invoke(ctx, StateStoreService_Update_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) Requeue(ctx context.Context, in *RequeueRequest, opts ...grpc.CallOption) (*RequeueResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RequeueResponse) + err := c.cc.Invoke(ctx, StateStoreService_Requeue_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) RecoverStale(ctx context.Context, in *RecoverStaleRequest, opts ...grpc.CallOption) (*RecoverStaleResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RecoverStaleResponse) + err := c.cc.Invoke(ctx, StateStoreService_RecoverStale_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) ArchiveTask(ctx context.Context, in *ArchiveTaskRequest, opts ...grpc.CallOption) (*ArchiveTaskResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ArchiveTaskResponse) + err := c.cc.Invoke(ctx, StateStoreService_ArchiveTask_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) RetryTask(ctx context.Context, in *RetryTaskRequest, opts ...grpc.CallOption) (*RetryTaskResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RetryTaskResponse) + err := c.cc.Invoke(ctx, StateStoreService_RetryTask_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) TaskByIssue(ctx context.Context, in *TaskByIssueRequest, opts ...grpc.CallOption) (*TaskByIssueResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TaskByIssueResponse) + err := c.cc.Invoke(ctx, StateStoreService_TaskByIssue_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) TaskByID(ctx context.Context, in *TaskByIDRequest, opts ...grpc.CallOption) (*TaskByIDResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TaskByIDResponse) + err := c.cc.Invoke(ctx, StateStoreService_TaskByID_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) OpenPRs(ctx context.Context, in *OpenPRsRequest, opts ...grpc.CallOption) (*OpenPRsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OpenPRsResponse) + err := c.cc.Invoke(ctx, StateStoreService_OpenPRs_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) ClearTerminalTasks(ctx context.Context, in *ClearTerminalTasksRequest, opts ...grpc.CallOption) (*ClearTerminalTasksResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ClearTerminalTasksResponse) + err := c.cc.Invoke(ctx, StateStoreService_ClearTerminalTasks_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) Tasks(ctx context.Context, in *TasksRequest, opts ...grpc.CallOption) (*TasksResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TasksResponse) + err := c.cc.Invoke(ctx, StateStoreService_Tasks_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) StatusCounts(ctx context.Context, in *StatusCountsRequest, opts ...grpc.CallOption) (*StatusCountsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatusCountsResponse) + err := c.cc.Invoke(ctx, StateStoreService_StatusCounts_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) IncrementRetryCount(ctx context.Context, in *IncrementRetryCountRequest, opts ...grpc.CallOption) (*IncrementRetryCountResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(IncrementRetryCountResponse) + err := c.cc.Invoke(ctx, StateStoreService_IncrementRetryCount_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) InsertEvent(ctx context.Context, in *InsertEventRequest, opts ...grpc.CallOption) (*InsertEventResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(InsertEventResponse) + err := c.cc.Invoke(ctx, StateStoreService_InsertEvent_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) EventsSince(ctx context.Context, in *EventsSinceRequest, opts ...grpc.CallOption) (*EventsSinceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(EventsSinceResponse) + err := c.cc.Invoke(ctx, StateStoreService_EventsSince_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) TaskEvents(ctx context.Context, in *TaskEventsRequest, opts ...grpc.CallOption) (*TaskEventsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TaskEventsResponse) + err := c.cc.Invoke(ctx, StateStoreService_TaskEvents_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) WorkflowStats(ctx context.Context, in *WorkflowStatsRequest, opts ...grpc.CallOption) (*WorkflowStatsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(WorkflowStatsResponse) + err := c.cc.Invoke(ctx, StateStoreService_WorkflowStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) StageStats(ctx context.Context, in *StageStatsRequest, opts ...grpc.CallOption) (*StageStatsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StageStatsResponse) + err := c.cc.Invoke(ctx, StateStoreService_StageStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) TokensByDay(ctx context.Context, in *TokensByDayRequest, opts ...grpc.CallOption) (*TokensByDayResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TokensByDayResponse) + err := c.cc.Invoke(ctx, StateStoreService_TokensByDay_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) InsertCapture(ctx context.Context, in *InsertCaptureRequest, opts ...grpc.CallOption) (*InsertCaptureResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(InsertCaptureResponse) + err := c.cc.Invoke(ctx, StateStoreService_InsertCapture_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) ListCaptures(ctx context.Context, in *ListCapturesRequest, opts ...grpc.CallOption) (*ListCapturesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListCapturesResponse) + err := c.cc.Invoke(ctx, StateStoreService_ListCaptures_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) InsertMapping(ctx context.Context, in *InsertMappingRequest, opts ...grpc.CallOption) (*InsertMappingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(InsertMappingResponse) + err := c.cc.Invoke(ctx, StateStoreService_InsertMapping_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) GetMapping(ctx context.Context, in *GetMappingRequest, opts ...grpc.CallOption) (*GetMappingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetMappingResponse) + err := c.cc.Invoke(ctx, StateStoreService_GetMapping_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) ListMappings(ctx context.Context, in *ListMappingsRequest, opts ...grpc.CallOption) (*ListMappingsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListMappingsResponse) + err := c.cc.Invoke(ctx, StateStoreService_ListMappings_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) UpdateMapping(ctx context.Context, in *UpdateMappingRequest, opts ...grpc.CallOption) (*UpdateMappingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UpdateMappingResponse) + err := c.cc.Invoke(ctx, StateStoreService_UpdateMapping_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) DeleteMapping(ctx context.Context, in *DeleteMappingRequest, opts ...grpc.CallOption) (*DeleteMappingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteMappingResponse) + err := c.cc.Invoke(ctx, StateStoreService_DeleteMapping_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) InsertBinding(ctx context.Context, in *InsertBindingRequest, opts ...grpc.CallOption) (*InsertBindingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(InsertBindingResponse) + err := c.cc.Invoke(ctx, StateStoreService_InsertBinding_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) GetBinding(ctx context.Context, in *GetBindingRequest, opts ...grpc.CallOption) (*GetBindingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetBindingResponse) + err := c.cc.Invoke(ctx, StateStoreService_GetBinding_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) ListBindings(ctx context.Context, in *ListBindingsRequest, opts ...grpc.CallOption) (*ListBindingsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListBindingsResponse) + err := c.cc.Invoke(ctx, StateStoreService_ListBindings_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) UpdateBinding(ctx context.Context, in *UpdateBindingRequest, opts ...grpc.CallOption) (*UpdateBindingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UpdateBindingResponse) + err := c.cc.Invoke(ctx, StateStoreService_UpdateBinding_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) DeleteBinding(ctx context.Context, in *DeleteBindingRequest, opts ...grpc.CallOption) (*DeleteBindingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DeleteBindingResponse) + err := c.cc.Invoke(ctx, StateStoreService_DeleteBinding_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) ApproveBinding(ctx context.Context, in *ApproveBindingRequest, opts ...grpc.CallOption) (*ApproveBindingResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ApproveBindingResponse) + err := c.cc.Invoke(ctx, StateStoreService_ApproveBinding_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) ArmedBindingsForSource(ctx context.Context, in *ArmedBindingsForSourceRequest, opts ...grpc.CallOption) (*ArmedBindingsForSourceResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ArmedBindingsForSourceResponse) + err := c.cc.Invoke(ctx, StateStoreService_ArmedBindingsForSource_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) RecordDispatch(ctx context.Context, in *RecordDispatchRequest, opts ...grpc.CallOption) (*RecordDispatchResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RecordDispatchResponse) + err := c.cc.Invoke(ctx, StateStoreService_RecordDispatch_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) ListUndispatchedCaptures(ctx context.Context, in *ListUndispatchedCapturesRequest, opts ...grpc.CallOption) (*ListUndispatchedCapturesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListUndispatchedCapturesResponse) + err := c.cc.Invoke(ctx, StateStoreService_ListUndispatchedCaptures_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stateStoreServiceClient) EnqueueBindingTask(ctx context.Context, in *EnqueueBindingTaskRequest, opts ...grpc.CallOption) (*EnqueueBindingTaskResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(EnqueueBindingTaskResponse) + err := c.cc.Invoke(ctx, StateStoreService_EnqueueBindingTask_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StateStoreServiceServer is the server API for StateStoreService service. +// All implementations must embed UnimplementedStateStoreServiceServer +// for forward compatibility. +// +// StateStore is the single gRPC service fronting archie.db (one store, one +// file). See docs/prds/state-store-contract.md for the ownership split: the +// workflow-domain Store view (Update/Transition/InsertEvent) is consumer-owned +// in internal/domain/workflow, while the rest of this surface stays +// producer-owned in internal/store. Both are served by the same service and +// the same *store.Store implementation; the proto bypasses the Go +// interfacebloat cap (max 8), like gateway.v1.ChatService does. +type StateStoreServiceServer interface { + // Lifecycle + EnqueueIssue(context.Context, *EnqueueIssueRequest) (*EnqueueIssueResponse, error) + EnqueueChatTask(context.Context, *EnqueueChatTaskRequest) (*EnqueueChatTaskResponse, error) + ClaimNext(context.Context, *ClaimNextRequest) (*ClaimNextResponse, error) + ClaimByIssue(context.Context, *ClaimByIssueRequest) (*ClaimByIssueResponse, error) + Transition(context.Context, *TransitionRequest) (*TransitionResponse, error) + Update(context.Context, *UpdateRequest) (*UpdateResponse, error) + Requeue(context.Context, *RequeueRequest) (*RequeueResponse, error) + RecoverStale(context.Context, *RecoverStaleRequest) (*RecoverStaleResponse, error) + // Archive / Retry + ArchiveTask(context.Context, *ArchiveTaskRequest) (*ArchiveTaskResponse, error) + RetryTask(context.Context, *RetryTaskRequest) (*RetryTaskResponse, error) + // Queries + TaskByIssue(context.Context, *TaskByIssueRequest) (*TaskByIssueResponse, error) + TaskByID(context.Context, *TaskByIDRequest) (*TaskByIDResponse, error) + OpenPRs(context.Context, *OpenPRsRequest) (*OpenPRsResponse, error) + ClearTerminalTasks(context.Context, *ClearTerminalTasksRequest) (*ClearTerminalTasksResponse, error) + Tasks(context.Context, *TasksRequest) (*TasksResponse, error) + StatusCounts(context.Context, *StatusCountsRequest) (*StatusCountsResponse, error) + IncrementRetryCount(context.Context, *IncrementRetryCountRequest) (*IncrementRetryCountResponse, error) + // Events + InsertEvent(context.Context, *InsertEventRequest) (*InsertEventResponse, error) + EventsSince(context.Context, *EventsSinceRequest) (*EventsSinceResponse, error) + TaskEvents(context.Context, *TaskEventsRequest) (*TaskEventsResponse, error) + WorkflowStats(context.Context, *WorkflowStatsRequest) (*WorkflowStatsResponse, error) + StageStats(context.Context, *StageStatsRequest) (*StageStatsResponse, error) + TokensByDay(context.Context, *TokensByDayRequest) (*TokensByDayResponse, error) + // Capture + InsertCapture(context.Context, *InsertCaptureRequest) (*InsertCaptureResponse, error) + ListCaptures(context.Context, *ListCapturesRequest) (*ListCapturesResponse, error) + // Mapping + InsertMapping(context.Context, *InsertMappingRequest) (*InsertMappingResponse, error) + GetMapping(context.Context, *GetMappingRequest) (*GetMappingResponse, error) + ListMappings(context.Context, *ListMappingsRequest) (*ListMappingsResponse, error) + UpdateMapping(context.Context, *UpdateMappingRequest) (*UpdateMappingResponse, error) + DeleteMapping(context.Context, *DeleteMappingRequest) (*DeleteMappingResponse, error) + // Binding + InsertBinding(context.Context, *InsertBindingRequest) (*InsertBindingResponse, error) + GetBinding(context.Context, *GetBindingRequest) (*GetBindingResponse, error) + ListBindings(context.Context, *ListBindingsRequest) (*ListBindingsResponse, error) + UpdateBinding(context.Context, *UpdateBindingRequest) (*UpdateBindingResponse, error) + DeleteBinding(context.Context, *DeleteBindingRequest) (*DeleteBindingResponse, error) + ApproveBinding(context.Context, *ApproveBindingRequest) (*ApproveBindingResponse, error) + // Dispatch + ArmedBindingsForSource(context.Context, *ArmedBindingsForSourceRequest) (*ArmedBindingsForSourceResponse, error) + RecordDispatch(context.Context, *RecordDispatchRequest) (*RecordDispatchResponse, error) + ListUndispatchedCaptures(context.Context, *ListUndispatchedCapturesRequest) (*ListUndispatchedCapturesResponse, error) + // BindingTaskCreator + EnqueueBindingTask(context.Context, *EnqueueBindingTaskRequest) (*EnqueueBindingTaskResponse, error) + mustEmbedUnimplementedStateStoreServiceServer() +} + +// UnimplementedStateStoreServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedStateStoreServiceServer struct{} + +func (UnimplementedStateStoreServiceServer) EnqueueIssue(context.Context, *EnqueueIssueRequest) (*EnqueueIssueResponse, error) { + return nil, status.Error(codes.Unimplemented, "method EnqueueIssue not implemented") +} +func (UnimplementedStateStoreServiceServer) EnqueueChatTask(context.Context, *EnqueueChatTaskRequest) (*EnqueueChatTaskResponse, error) { + return nil, status.Error(codes.Unimplemented, "method EnqueueChatTask not implemented") +} +func (UnimplementedStateStoreServiceServer) ClaimNext(context.Context, *ClaimNextRequest) (*ClaimNextResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ClaimNext not implemented") +} +func (UnimplementedStateStoreServiceServer) ClaimByIssue(context.Context, *ClaimByIssueRequest) (*ClaimByIssueResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ClaimByIssue not implemented") +} +func (UnimplementedStateStoreServiceServer) Transition(context.Context, *TransitionRequest) (*TransitionResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Transition not implemented") +} +func (UnimplementedStateStoreServiceServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Update not implemented") +} +func (UnimplementedStateStoreServiceServer) Requeue(context.Context, *RequeueRequest) (*RequeueResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Requeue not implemented") +} +func (UnimplementedStateStoreServiceServer) RecoverStale(context.Context, *RecoverStaleRequest) (*RecoverStaleResponse, error) { + return nil, status.Error(codes.Unimplemented, "method RecoverStale not implemented") +} +func (UnimplementedStateStoreServiceServer) ArchiveTask(context.Context, *ArchiveTaskRequest) (*ArchiveTaskResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ArchiveTask not implemented") +} +func (UnimplementedStateStoreServiceServer) RetryTask(context.Context, *RetryTaskRequest) (*RetryTaskResponse, error) { + return nil, status.Error(codes.Unimplemented, "method RetryTask not implemented") +} +func (UnimplementedStateStoreServiceServer) TaskByIssue(context.Context, *TaskByIssueRequest) (*TaskByIssueResponse, error) { + return nil, status.Error(codes.Unimplemented, "method TaskByIssue not implemented") +} +func (UnimplementedStateStoreServiceServer) TaskByID(context.Context, *TaskByIDRequest) (*TaskByIDResponse, error) { + return nil, status.Error(codes.Unimplemented, "method TaskByID not implemented") +} +func (UnimplementedStateStoreServiceServer) OpenPRs(context.Context, *OpenPRsRequest) (*OpenPRsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method OpenPRs not implemented") +} +func (UnimplementedStateStoreServiceServer) ClearTerminalTasks(context.Context, *ClearTerminalTasksRequest) (*ClearTerminalTasksResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ClearTerminalTasks not implemented") +} +func (UnimplementedStateStoreServiceServer) Tasks(context.Context, *TasksRequest) (*TasksResponse, error) { + return nil, status.Error(codes.Unimplemented, "method Tasks not implemented") +} +func (UnimplementedStateStoreServiceServer) StatusCounts(context.Context, *StatusCountsRequest) (*StatusCountsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method StatusCounts not implemented") +} +func (UnimplementedStateStoreServiceServer) IncrementRetryCount(context.Context, *IncrementRetryCountRequest) (*IncrementRetryCountResponse, error) { + return nil, status.Error(codes.Unimplemented, "method IncrementRetryCount not implemented") +} +func (UnimplementedStateStoreServiceServer) InsertEvent(context.Context, *InsertEventRequest) (*InsertEventResponse, error) { + return nil, status.Error(codes.Unimplemented, "method InsertEvent not implemented") +} +func (UnimplementedStateStoreServiceServer) EventsSince(context.Context, *EventsSinceRequest) (*EventsSinceResponse, error) { + return nil, status.Error(codes.Unimplemented, "method EventsSince not implemented") +} +func (UnimplementedStateStoreServiceServer) TaskEvents(context.Context, *TaskEventsRequest) (*TaskEventsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method TaskEvents not implemented") +} +func (UnimplementedStateStoreServiceServer) WorkflowStats(context.Context, *WorkflowStatsRequest) (*WorkflowStatsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method WorkflowStats not implemented") +} +func (UnimplementedStateStoreServiceServer) StageStats(context.Context, *StageStatsRequest) (*StageStatsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method StageStats not implemented") +} +func (UnimplementedStateStoreServiceServer) TokensByDay(context.Context, *TokensByDayRequest) (*TokensByDayResponse, error) { + return nil, status.Error(codes.Unimplemented, "method TokensByDay not implemented") +} +func (UnimplementedStateStoreServiceServer) InsertCapture(context.Context, *InsertCaptureRequest) (*InsertCaptureResponse, error) { + return nil, status.Error(codes.Unimplemented, "method InsertCapture not implemented") +} +func (UnimplementedStateStoreServiceServer) ListCaptures(context.Context, *ListCapturesRequest) (*ListCapturesResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ListCaptures not implemented") +} +func (UnimplementedStateStoreServiceServer) InsertMapping(context.Context, *InsertMappingRequest) (*InsertMappingResponse, error) { + return nil, status.Error(codes.Unimplemented, "method InsertMapping not implemented") +} +func (UnimplementedStateStoreServiceServer) GetMapping(context.Context, *GetMappingRequest) (*GetMappingResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetMapping not implemented") +} +func (UnimplementedStateStoreServiceServer) ListMappings(context.Context, *ListMappingsRequest) (*ListMappingsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ListMappings not implemented") +} +func (UnimplementedStateStoreServiceServer) UpdateMapping(context.Context, *UpdateMappingRequest) (*UpdateMappingResponse, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateMapping not implemented") +} +func (UnimplementedStateStoreServiceServer) DeleteMapping(context.Context, *DeleteMappingRequest) (*DeleteMappingResponse, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteMapping not implemented") +} +func (UnimplementedStateStoreServiceServer) InsertBinding(context.Context, *InsertBindingRequest) (*InsertBindingResponse, error) { + return nil, status.Error(codes.Unimplemented, "method InsertBinding not implemented") +} +func (UnimplementedStateStoreServiceServer) GetBinding(context.Context, *GetBindingRequest) (*GetBindingResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetBinding not implemented") +} +func (UnimplementedStateStoreServiceServer) ListBindings(context.Context, *ListBindingsRequest) (*ListBindingsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ListBindings not implemented") +} +func (UnimplementedStateStoreServiceServer) UpdateBinding(context.Context, *UpdateBindingRequest) (*UpdateBindingResponse, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateBinding not implemented") +} +func (UnimplementedStateStoreServiceServer) DeleteBinding(context.Context, *DeleteBindingRequest) (*DeleteBindingResponse, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteBinding not implemented") +} +func (UnimplementedStateStoreServiceServer) ApproveBinding(context.Context, *ApproveBindingRequest) (*ApproveBindingResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ApproveBinding not implemented") +} +func (UnimplementedStateStoreServiceServer) ArmedBindingsForSource(context.Context, *ArmedBindingsForSourceRequest) (*ArmedBindingsForSourceResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ArmedBindingsForSource not implemented") +} +func (UnimplementedStateStoreServiceServer) RecordDispatch(context.Context, *RecordDispatchRequest) (*RecordDispatchResponse, error) { + return nil, status.Error(codes.Unimplemented, "method RecordDispatch not implemented") +} +func (UnimplementedStateStoreServiceServer) ListUndispatchedCaptures(context.Context, *ListUndispatchedCapturesRequest) (*ListUndispatchedCapturesResponse, error) { + return nil, status.Error(codes.Unimplemented, "method ListUndispatchedCaptures not implemented") +} +func (UnimplementedStateStoreServiceServer) EnqueueBindingTask(context.Context, *EnqueueBindingTaskRequest) (*EnqueueBindingTaskResponse, error) { + return nil, status.Error(codes.Unimplemented, "method EnqueueBindingTask not implemented") +} +func (UnimplementedStateStoreServiceServer) mustEmbedUnimplementedStateStoreServiceServer() {} +func (UnimplementedStateStoreServiceServer) testEmbeddedByValue() {} + +// UnsafeStateStoreServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StateStoreServiceServer will +// result in compilation errors. +type UnsafeStateStoreServiceServer interface { + mustEmbedUnimplementedStateStoreServiceServer() +} + +func RegisterStateStoreServiceServer(s grpc.ServiceRegistrar, srv StateStoreServiceServer) { + // If the following call panics, it indicates UnimplementedStateStoreServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&StateStoreService_ServiceDesc, srv) +} + +func _StateStoreService_EnqueueIssue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EnqueueIssueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).EnqueueIssue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_EnqueueIssue_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).EnqueueIssue(ctx, req.(*EnqueueIssueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_EnqueueChatTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EnqueueChatTaskRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).EnqueueChatTask(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_EnqueueChatTask_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).EnqueueChatTask(ctx, req.(*EnqueueChatTaskRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_ClaimNext_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClaimNextRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).ClaimNext(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_ClaimNext_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).ClaimNext(ctx, req.(*ClaimNextRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_ClaimByIssue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClaimByIssueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).ClaimByIssue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_ClaimByIssue_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).ClaimByIssue(ctx, req.(*ClaimByIssueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_Transition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TransitionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).Transition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_Transition_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).Transition(ctx, req.(*TransitionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).Update(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_Update_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).Update(ctx, req.(*UpdateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_Requeue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RequeueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).Requeue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_Requeue_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).Requeue(ctx, req.(*RequeueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_RecoverStale_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RecoverStaleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).RecoverStale(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_RecoverStale_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).RecoverStale(ctx, req.(*RecoverStaleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_ArchiveTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ArchiveTaskRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).ArchiveTask(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_ArchiveTask_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).ArchiveTask(ctx, req.(*ArchiveTaskRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_RetryTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RetryTaskRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).RetryTask(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_RetryTask_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).RetryTask(ctx, req.(*RetryTaskRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_TaskByIssue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TaskByIssueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).TaskByIssue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_TaskByIssue_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).TaskByIssue(ctx, req.(*TaskByIssueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_TaskByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TaskByIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).TaskByID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_TaskByID_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).TaskByID(ctx, req.(*TaskByIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_OpenPRs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OpenPRsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).OpenPRs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_OpenPRs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).OpenPRs(ctx, req.(*OpenPRsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_ClearTerminalTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearTerminalTasksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).ClearTerminalTasks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_ClearTerminalTasks_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).ClearTerminalTasks(ctx, req.(*ClearTerminalTasksRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_Tasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TasksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).Tasks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_Tasks_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).Tasks(ctx, req.(*TasksRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_StatusCounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusCountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).StatusCounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_StatusCounts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).StatusCounts(ctx, req.(*StatusCountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_IncrementRetryCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IncrementRetryCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).IncrementRetryCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_IncrementRetryCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).IncrementRetryCount(ctx, req.(*IncrementRetryCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_InsertEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InsertEventRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).InsertEvent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_InsertEvent_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).InsertEvent(ctx, req.(*InsertEventRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_EventsSince_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EventsSinceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).EventsSince(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_EventsSince_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).EventsSince(ctx, req.(*EventsSinceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_TaskEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TaskEventsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).TaskEvents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_TaskEvents_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).TaskEvents(ctx, req.(*TaskEventsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_WorkflowStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WorkflowStatsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).WorkflowStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_WorkflowStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).WorkflowStats(ctx, req.(*WorkflowStatsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_StageStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StageStatsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).StageStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_StageStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).StageStats(ctx, req.(*StageStatsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_TokensByDay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TokensByDayRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).TokensByDay(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_TokensByDay_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).TokensByDay(ctx, req.(*TokensByDayRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_InsertCapture_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InsertCaptureRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).InsertCapture(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_InsertCapture_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).InsertCapture(ctx, req.(*InsertCaptureRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_ListCaptures_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListCapturesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).ListCaptures(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_ListCaptures_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).ListCaptures(ctx, req.(*ListCapturesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_InsertMapping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InsertMappingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).InsertMapping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_InsertMapping_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).InsertMapping(ctx, req.(*InsertMappingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_GetMapping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMappingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).GetMapping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_GetMapping_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).GetMapping(ctx, req.(*GetMappingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_ListMappings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListMappingsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).ListMappings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_ListMappings_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).ListMappings(ctx, req.(*ListMappingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_UpdateMapping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateMappingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).UpdateMapping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_UpdateMapping_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).UpdateMapping(ctx, req.(*UpdateMappingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_DeleteMapping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteMappingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).DeleteMapping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_DeleteMapping_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).DeleteMapping(ctx, req.(*DeleteMappingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_InsertBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InsertBindingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).InsertBinding(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_InsertBinding_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).InsertBinding(ctx, req.(*InsertBindingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_GetBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBindingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).GetBinding(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_GetBinding_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).GetBinding(ctx, req.(*GetBindingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_ListBindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBindingsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).ListBindings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_ListBindings_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).ListBindings(ctx, req.(*ListBindingsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_UpdateBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateBindingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).UpdateBinding(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_UpdateBinding_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).UpdateBinding(ctx, req.(*UpdateBindingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_DeleteBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteBindingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).DeleteBinding(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_DeleteBinding_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).DeleteBinding(ctx, req.(*DeleteBindingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_ApproveBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ApproveBindingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).ApproveBinding(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_ApproveBinding_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).ApproveBinding(ctx, req.(*ApproveBindingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_ArmedBindingsForSource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ArmedBindingsForSourceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).ArmedBindingsForSource(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_ArmedBindingsForSource_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).ArmedBindingsForSource(ctx, req.(*ArmedBindingsForSourceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_RecordDispatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RecordDispatchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).RecordDispatch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_RecordDispatch_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).RecordDispatch(ctx, req.(*RecordDispatchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_ListUndispatchedCaptures_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListUndispatchedCapturesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).ListUndispatchedCaptures(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_ListUndispatchedCaptures_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).ListUndispatchedCaptures(ctx, req.(*ListUndispatchedCapturesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StateStoreService_EnqueueBindingTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EnqueueBindingTaskRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StateStoreServiceServer).EnqueueBindingTask(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: StateStoreService_EnqueueBindingTask_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StateStoreServiceServer).EnqueueBindingTask(ctx, req.(*EnqueueBindingTaskRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// StateStoreService_ServiceDesc is the grpc.ServiceDesc for StateStoreService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var StateStoreService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "state.v1.StateStoreService", + HandlerType: (*StateStoreServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EnqueueIssue", + Handler: _StateStoreService_EnqueueIssue_Handler, + }, + { + MethodName: "EnqueueChatTask", + Handler: _StateStoreService_EnqueueChatTask_Handler, + }, + { + MethodName: "ClaimNext", + Handler: _StateStoreService_ClaimNext_Handler, + }, + { + MethodName: "ClaimByIssue", + Handler: _StateStoreService_ClaimByIssue_Handler, + }, + { + MethodName: "Transition", + Handler: _StateStoreService_Transition_Handler, + }, + { + MethodName: "Update", + Handler: _StateStoreService_Update_Handler, + }, + { + MethodName: "Requeue", + Handler: _StateStoreService_Requeue_Handler, + }, + { + MethodName: "RecoverStale", + Handler: _StateStoreService_RecoverStale_Handler, + }, + { + MethodName: "ArchiveTask", + Handler: _StateStoreService_ArchiveTask_Handler, + }, + { + MethodName: "RetryTask", + Handler: _StateStoreService_RetryTask_Handler, + }, + { + MethodName: "TaskByIssue", + Handler: _StateStoreService_TaskByIssue_Handler, + }, + { + MethodName: "TaskByID", + Handler: _StateStoreService_TaskByID_Handler, + }, + { + MethodName: "OpenPRs", + Handler: _StateStoreService_OpenPRs_Handler, + }, + { + MethodName: "ClearTerminalTasks", + Handler: _StateStoreService_ClearTerminalTasks_Handler, + }, + { + MethodName: "Tasks", + Handler: _StateStoreService_Tasks_Handler, + }, + { + MethodName: "StatusCounts", + Handler: _StateStoreService_StatusCounts_Handler, + }, + { + MethodName: "IncrementRetryCount", + Handler: _StateStoreService_IncrementRetryCount_Handler, + }, + { + MethodName: "InsertEvent", + Handler: _StateStoreService_InsertEvent_Handler, + }, + { + MethodName: "EventsSince", + Handler: _StateStoreService_EventsSince_Handler, + }, + { + MethodName: "TaskEvents", + Handler: _StateStoreService_TaskEvents_Handler, + }, + { + MethodName: "WorkflowStats", + Handler: _StateStoreService_WorkflowStats_Handler, + }, + { + MethodName: "StageStats", + Handler: _StateStoreService_StageStats_Handler, + }, + { + MethodName: "TokensByDay", + Handler: _StateStoreService_TokensByDay_Handler, + }, + { + MethodName: "InsertCapture", + Handler: _StateStoreService_InsertCapture_Handler, + }, + { + MethodName: "ListCaptures", + Handler: _StateStoreService_ListCaptures_Handler, + }, + { + MethodName: "InsertMapping", + Handler: _StateStoreService_InsertMapping_Handler, + }, + { + MethodName: "GetMapping", + Handler: _StateStoreService_GetMapping_Handler, + }, + { + MethodName: "ListMappings", + Handler: _StateStoreService_ListMappings_Handler, + }, + { + MethodName: "UpdateMapping", + Handler: _StateStoreService_UpdateMapping_Handler, + }, + { + MethodName: "DeleteMapping", + Handler: _StateStoreService_DeleteMapping_Handler, + }, + { + MethodName: "InsertBinding", + Handler: _StateStoreService_InsertBinding_Handler, + }, + { + MethodName: "GetBinding", + Handler: _StateStoreService_GetBinding_Handler, + }, + { + MethodName: "ListBindings", + Handler: _StateStoreService_ListBindings_Handler, + }, + { + MethodName: "UpdateBinding", + Handler: _StateStoreService_UpdateBinding_Handler, + }, + { + MethodName: "DeleteBinding", + Handler: _StateStoreService_DeleteBinding_Handler, + }, + { + MethodName: "ApproveBinding", + Handler: _StateStoreService_ApproveBinding_Handler, + }, + { + MethodName: "ArmedBindingsForSource", + Handler: _StateStoreService_ArmedBindingsForSource_Handler, + }, + { + MethodName: "RecordDispatch", + Handler: _StateStoreService_RecordDispatch_Handler, + }, + { + MethodName: "ListUndispatchedCaptures", + Handler: _StateStoreService_ListUndispatchedCaptures_Handler, + }, + { + MethodName: "EnqueueBindingTask", + Handler: _StateStoreService_EnqueueBindingTask_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "state/v1/state.proto", +} diff --git a/internal/daemon/daemon.go b/internal/daemon/daemon.go index ae37080b4..4bec2e380 100644 --- a/internal/daemon/daemon.go +++ b/internal/daemon/daemon.go @@ -5,6 +5,9 @@ package daemon import ( "context" + "crypto/rand" + "crypto/subtle" + "encoding/hex" "encoding/json" "errors" "fmt" @@ -62,6 +65,78 @@ type NATSEndpoint struct { Token string } +// StateStoreEndpoint is the address the daemon's in-process State Store gRPC +// server is bound to (docs/prds/state-store-contract.md §6, §12 step 3). The +// zero value (empty URL) means the server is not serving -- containerEnv +// omits STATE_STORE_URL/STATE_STORE_TOKEN and archie-agent falls back to the +// legacy NATS storerpc path. +type StateStoreEndpoint struct { + URL string +} + +// StateStoreTokens issues and validates the per-task bearer tokens the State +// Store's bridge-address (agent-consumed) listener topology requires (§9's +// token lifecycle). A token is per-incumbence: Generate overwrites any +// earlier token for the same task, so a new container acquisition +// invalidates the previous one, and Revoke drops a released task's token +// entirely. The zero value is ready to use. +type StateStoreTokens struct { + mu sync.Mutex + byTask map[int64]string +} + +// NewStateStoreTokens returns a ready-to-use token registry. +func NewStateStoreTokens() *StateStoreTokens { + return &StateStoreTokens{byTask: make(map[int64]string)} +} + +// Generate issues a fresh bearer token for taskID, replacing (and thereby +// invalidating) any token previously issued for that task. +func (t *StateStoreTokens) Generate(taskID int64) string { + token := randomToken() + t.mu.Lock() + defer t.mu.Unlock() + t.byTask[taskID] = token + return token +} + +// Revoke invalidates taskID's current token, if any. Called when the +// container holding it is released, so a stale token cannot outlive its +// container. +func (t *StateStoreTokens) Revoke(taskID int64) { + t.mu.Lock() + defer t.mu.Unlock() + delete(t.byTask, taskID) +} + +// Validate reports whether token is any task's currently issued token. +// The comparison is constant-time (crypto/subtle) so a timing side channel +// cannot tell how many token bytes matched. +func (t *StateStoreTokens) Validate(token string) bool { + if token == "" { + return false + } + t.mu.Lock() + defer t.mu.Unlock() + for _, v := range t.byTask { + if subtle.ConstantTimeCompare([]byte(v), []byte(token)) == 1 { + return true + } + } + return false +} + +func randomToken() string { + b := make([]byte, 32) + if _, err := rand.Read(b); err != nil { + // crypto/rand.Read on the standard reader does not fail in practice; + // a zero-value token would fail every Validate call, which is a safe + // (fail-closed) degradation rather than a panic. + return "" + } + return hex.EncodeToString(b) +} + type Daemon struct { // Cfg publishes the running configuration. Read through Cfg() so a // reload swaps the published snapshot atomically. See config.Holder. @@ -72,7 +147,16 @@ type Daemon struct { // broker the daemon is not publishing on. The zero value is invalid in // production composition and remains useful only to fail closed in tests. ConnectedNATS NATSEndpoint - Store store.TaskStore + // ConnectedStateStore is the address the daemon's in-process State + // Store gRPC server bound to at startup, if any. Empty means the + // server is not serving (StateStoreTokens is then unused) and + // containerEnv omits STATE_STORE_URL/STATE_STORE_TOKEN. + ConnectedStateStore StateStoreEndpoint + // StateStoreTokens issues and validates the per-task bearer tokens the + // State Store's gRPC interceptor checks. Nil when ConnectedStateStore + // is empty. + StateStoreTokens *StateStoreTokens + Store store.TaskStore // Mappings persists payload field mappings (docs/prds/payload-field-mapping.md). // Used by the binding dispatch loop to resolve capture bodies against // the mapping a binding names. Optional: nil disables the binding @@ -589,7 +673,7 @@ func (d *Daemon) dispatchOneBinding(ctx context.Context, b binding.Binding, c st return } - if err := d.BindingDispatcher.RecordDispatch(ctx, nil, b.ID, int64(b.Version), c.ID, task.ID); err != nil { + if err := d.BindingDispatcher.RecordDispatch(ctx, b.ID, int64(b.Version), c.ID, task.ID); err != nil { if errors.Is(err, store.ErrAlreadyDispatched) { // Another cycle or daemon instance raced us and already // recorded the dispatch. The duplicate task remains @@ -1087,6 +1171,9 @@ func (d *Daemon) process(ctx context.Context, task *workflow.Task) { return } defer d.ContainerPool.Release(ctx, ctr) + if d.StateStoreTokens != nil { + defer d.StateStoreTokens.Revoke(task.ID) + } // Hand the whole task to archie-agent in one NATS round trip. archie-agent // proxies Store/Forge/worktree-push calls back to archied over storerpc/ @@ -1384,6 +1471,14 @@ func (d *Daemon) containerEnv(task *workflow.Task) []string { if token := d.ConnectedNATS.Token; token != "" { env = append(env, "NATS_TOKEN="+token) } + // The State Store gRPC target follows the same seam as NATS_URL/ + // NATS_TOKEN above (docs/prds/state-store-contract.md §6). Omitted + // when the daemon is not serving the State Store in-process, so + // archie-agent falls back to the legacy NATS storerpc path. + if d.ConnectedStateStore.URL != "" && d.StateStoreTokens != nil { + env = append(env, "STATE_STORE_URL="+d.ConnectedStateStore.URL) + env = append(env, "STATE_STORE_TOKEN="+d.StateStoreTokens.Generate(task.ID)) + } // The agent process runs as root inside the container (no USER in the // Dockerfile, no userns-remap), so a commit it writes to the bind-mounted // worktree lands owned by UID 0 on the host. The daemon then reads those diff --git a/internal/infrastructure/agenttransport/nats/transport.go b/internal/infrastructure/agenttransport/nats/transport.go index 259cc46d0..507f13c9c 100644 --- a/internal/infrastructure/agenttransport/nats/transport.go +++ b/internal/infrastructure/agenttransport/nats/transport.go @@ -7,24 +7,37 @@ import ( "encoding/json" "fmt" "log/slog" + "net" "strconv" "strings" "time" natsio "github.com/nats-io/nats.go" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "github.com/samcharles93/archie-core/internal/agentexec" "github.com/samcharles93/archie-core/internal/domain/workflow" + "github.com/samcharles93/archie-core/internal/events" "github.com/samcharles93/archie-core/internal/forgerpc" + "github.com/samcharles93/archie-core/internal/infrastructure/staterpc" "github.com/samcharles93/archie-core/internal/storerpc" "github.com/samcharles93/archie-core/internal/taskrun" "github.com/samcharles93/archie-core/internal/worktreerpc" ) -// Config contains the broker endpoint and credential for the worker transport. +// Config contains the broker endpoint and credential for the worker +// transport, plus the optional State Store gRPC target (docs/prds/ +// state-store-contract.md §6). An empty StateStoreURL keeps the legacy NATS +// storerpc path for workflow.Store; a non-empty one dials the gRPC +// StateStoreService instead -- a single agent process is either NATS-backed +// or gRPC-backed for its store calls, never both. type Config struct { URL string Token string + + StateStoreURL string + StateStoreToken string } const ( @@ -40,12 +53,21 @@ type sdkSubscription interface { // worker has no JetStream consumer. type Transport struct { conn *natsio.Conn + // stateConn is the long-lived gRPC connection to the State Store, + // non-nil only when Config.StateStoreURL was set. Store() dials no + // per-call connection; it wraps this one connection with the + // per-call timeout each caller supplies. + stateConn *grpc.ClientConn subscribe func(string, natsio.MsgHandler) (sdkSubscription, error) flush func(time.Duration) error } -// Connect establishes the worker's core-NATS connection. +// Connect establishes the worker's core-NATS connection and, when +// Config.StateStoreURL is set, a long-lived gRPC connection to the State +// Store (docs/prds/state-store-contract.md §6, §9). A non-loopback +// StateStoreURL with no token fails closed rather than dialing an +// unauthenticated remote store. func Connect(ctx context.Context, config Config, log *slog.Logger) (*Transport, error) { if log == nil { log = slog.New(slog.DiscardHandler) @@ -66,8 +88,20 @@ func Connect(ctx context.Context, config Config, log *slog.Logger) (*Transport, return nil, err } log.Info("worker transport connected", "url", conn.ConnectedUrl()) + + var stateConn *grpc.ClientConn + if config.StateStoreURL != "" { + stateConn, err = dialStateStore(config.StateStoreURL, config.StateStoreToken) + if err != nil { + conn.Close() + return nil, fmt.Errorf("connect state store: %w", err) + } + log.Info("worker state store transport connected", "url", config.StateStoreURL) + } + return &Transport{ - conn: conn, + conn: conn, + stateConn: stateConn, subscribe: func(subject string, handler natsio.MsgHandler) (sdkSubscription, error) { return conn.Subscribe(subject, handler) }, @@ -75,8 +109,32 @@ func Connect(ctx context.Context, config Config, log *slog.Logger) (*Transport, }, nil } +// dialStateStore dials target, failing closed (rather than connecting +// insecurely) when target is not a loopback address and no token was +// configured -- §9's "fail-closed on non-loopback" rule. +func dialStateStore(target, token string) (*grpc.ClientConn, error) { + host, _, err := net.SplitHostPort(target) + if err != nil { + host = target + } + loopback := net.ParseIP(host).IsLoopback() + if !loopback && token == "" { + return nil, fmt.Errorf("state store target %q is not loopback and no token is configured; refusing an unauthenticated remote connection", target) + } + opts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())} + if token != "" { + opts = append(opts, grpc.WithUnaryInterceptor(staterpc.UnaryClientTokenInterceptor(token))) + } + return grpc.NewClient(target, opts...) +} + // Close releases all broker resources. -func (t *Transport) Close() { t.conn.Close() } +func (t *Transport) Close() { + t.conn.Close() + if t.stateConn != nil { + _ = t.stateConn.Close() + } +} // LogPublisher returns the narrow fire-and-forget capability used by system logs. func (t *Transport) LogPublisher() agentexec.LogPublisher { return t.conn } @@ -100,11 +158,51 @@ func (t *Transport) Forger(identity string, timeout time.Duration) workflow.Forg return &forgerpc.Client{Conn: t.conn, Timeout: timeout, Identity: identity} } -// Store constructs the workflow store RPC client. +// Store constructs the workflow store RPC client: a long-lived gRPC +// staterpc.Client over the State Store connection when one was configured, +// or the legacy NATS storerpc.Client otherwise (docs/prds/ +// state-store-contract.md §6). Either way each call is bounded by timeout +// when the caller's context carries no deadline of its own. func (t *Transport) Store(timeout time.Duration) workflow.Store { + if t.stateConn != nil { + return deadlineStore{Store: staterpc.NewClient(t.stateConn), timeout: timeout} + } return &storerpc.Client{Conn: t.conn, Timeout: timeout} } +// deadlineStore applies a default per-call timeout to workflow.Store calls +// whose context carries no deadline of its own, matching storerpc.Client's +// Timeout field semantics for the gRPC path. +type deadlineStore struct { + workflow.Store + timeout time.Duration +} + +func (d deadlineStore) withDeadline(ctx context.Context) (context.Context, context.CancelFunc) { + if _, ok := ctx.Deadline(); ok || d.timeout <= 0 { + return ctx, func() {} + } + return context.WithTimeout(ctx, d.timeout) +} + +func (d deadlineStore) Update(ctx context.Context, t *workflow.Task) error { + ctx, cancel := d.withDeadline(ctx) + defer cancel() + return d.Store.Update(ctx, t) +} + +func (d deadlineStore) Transition(ctx context.Context, taskID int64, from, to, detail string) error { + ctx, cancel := d.withDeadline(ctx) + defer cancel() + return d.Store.Transition(ctx, taskID, from, to, detail) +} + +func (d deadlineStore) InsertEvent(ctx context.Context, e events.Event) (int64, error) { + ctx, cancel := d.withDeadline(ctx) + defer cancel() + return d.Store.InsertEvent(ctx, e) +} + // Trees constructs the identity-scoped worktree RPC client. func (t *Transport) Trees(identity, grant string, timeout time.Duration) RemoteTrees { return &worktreerpc.Client{Conn: t.conn, Timeout: timeout, Identity: identity, Grant: grant} diff --git a/internal/infrastructure/staterpc/auth.go b/internal/infrastructure/staterpc/auth.go new file mode 100644 index 000000000..813a8366d --- /dev/null +++ b/internal/infrastructure/staterpc/auth.go @@ -0,0 +1,60 @@ +package staterpc + +import ( + "context" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// tokenMetadataKey is the gRPC metadata key the bearer token travels in. +// Metadata, never a URL, per docs/prds/state-store-contract.md §9's token +// lifecycle note. +const tokenMetadataKey = "state-store-token" + +// TokenValidator reports whether token is a currently-issued, unexpired +// bearer token for the State Store's bridge-address listener topology. The +// caller (the daemon) owns the issued-token set; this package only enforces +// the check server-side and attaches the token client-side. +type TokenValidator func(token string) bool + +// UnaryTokenInterceptor validates the bearer token carried in each unary +// call's metadata, returning codes.Unauthenticated on a missing, unknown, or +// expired token. Required on the bridge-address (agent-consumed) listener +// topology per §9; not used on the loopback-only, daemon-only topology. +func UnaryTokenInterceptor(validate TokenValidator) grpc.UnaryServerInterceptor { + return func(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) { + if err := checkToken(ctx, validate); err != nil { + return nil, err + } + return handler(ctx, req) + } +} + +func checkToken(ctx context.Context, validate TokenValidator) error { + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return status.Error(codes.Unauthenticated, "missing state store token") + } + values := md.Get(tokenMetadataKey) + if len(values) == 0 || values[0] == "" { + return status.Error(codes.Unauthenticated, "missing state store token") + } + if !validate(values[0]) { + return status.Error(codes.Unauthenticated, "invalid state store token") + } + return nil +} + +// UnaryClientTokenInterceptor attaches token to every outgoing call's +// metadata under tokenMetadataKey. One token covers a task's container +// lifetime (§9's per-incumbence lifecycle) so it does not need to be +// refreshed mid-connection. Used by the agent's long-lived client +// connection to the State Store's bridge-address listener. +func UnaryClientTokenInterceptor(token string) grpc.UnaryClientInterceptor { + return func(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { + return invoker(metadata.AppendToOutgoingContext(ctx, tokenMetadataKey, token), method, req, reply, cc, opts...) + } +} diff --git a/internal/infrastructure/staterpc/client.go b/internal/infrastructure/staterpc/client.go new file mode 100644 index 000000000..0cbf6aa21 --- /dev/null +++ b/internal/infrastructure/staterpc/client.go @@ -0,0 +1,382 @@ +package staterpc + +import ( + "context" + "time" + + "google.golang.org/grpc" + + pb "github.com/samcharles93/archie-core/internal/contracts/state/v1" + "github.com/samcharles93/archie-core/internal/domain/binding" + "github.com/samcharles93/archie-core/internal/domain/mapping" + "github.com/samcharles93/archie-core/internal/domain/workflow" + "github.com/samcharles93/archie-core/internal/events" + "github.com/samcharles93/archie-core/internal/store" +) + +// Client is the single remote adapter wrapping one StateStoreServiceClient, +// asserted against whichever narrow Go interfaces its caller needs -- exactly +// as gatewayrpc.Client asserts both gateway.ChatContract and +// gateway.SessionStore. See docs/prds/state-store-contract.md §2. +type Client struct { + client pb.StateStoreServiceClient +} + +// NewClient wraps conn's generated client. Close is a no-op: the store +// service owns its own DB lifecycle (§11). +func NewClient(conn grpc.ClientConnInterface) *Client { + return &Client{client: pb.NewStateStoreServiceClient(conn)} +} + +// Close is a no-op; the remote store service owns its own DB lifecycle. +func (c *Client) Close() error { return nil } + +var ( + _ workflow.Store = (*Client)(nil) + _ store.TaskStore = (*Client)(nil) + _ store.CaptureStore = (*Client)(nil) + _ store.MappingStore = (*Client)(nil) + _ store.BindingStore = (*Client)(nil) + _ store.BindingDispatcher = (*Client)(nil) + _ store.BindingTaskCreator = (*Client)(nil) +) + +// Lifecycle + +func (c *Client) EnqueueIssue(ctx context.Context, owner, repo string, number int, title, body, labels, identity string) (bool, error) { + r, err := c.client.EnqueueIssue(ctx, &pb.EnqueueIssueRequest{Owner: owner, Repo: repo, Number: int64(number), Title: title, Body: body, Labels: labels, Identity: identity}) + if err != nil { + return false, unmapError(err) + } + return r.Inserted, nil +} + +func (c *Client) EnqueueChatTask(ctx context.Context, owner, repo, title, body, wf, identity string) (*workflow.Task, error) { + r, err := c.client.EnqueueChatTask(ctx, &pb.EnqueueChatTaskRequest{Owner: owner, Repo: repo, Title: title, Body: body, Workflow: wf, Identity: identity}) + if err != nil { + return nil, unmapError(err) + } + return taskValue(r.Task), nil +} + +func (c *Client) ClaimNext(ctx context.Context) (*workflow.Task, error) { + r, err := c.client.ClaimNext(ctx, &pb.ClaimNextRequest{}) + if err != nil { + return nil, unmapError(err) + } + if !r.Found { + return nil, nil + } + return taskValue(r.Task), nil +} + +func (c *Client) ClaimByIssue(ctx context.Context, owner, repo string, number int) (*workflow.Task, error) { + r, err := c.client.ClaimByIssue(ctx, &pb.ClaimByIssueRequest{Owner: owner, Repo: repo, Number: int64(number)}) + if err != nil { + return nil, unmapError(err) + } + if !r.Found { + return nil, nil + } + return taskValue(r.Task), nil +} + +func (c *Client) Transition(ctx context.Context, taskID int64, from, to, detail string) error { + _, err := c.client.Transition(ctx, &pb.TransitionRequest{TaskId: taskID, From: from, To: to, Detail: detail}) + return unmapError(err) +} + +func (c *Client) Update(ctx context.Context, t *workflow.Task) error { + _, err := c.client.Update(ctx, &pb.UpdateRequest{Task: taskProto(t)}) + return unmapError(err) +} + +func (c *Client) Requeue(ctx context.Context, taskID int64, fromStatus, wf string) error { + _, err := c.client.Requeue(ctx, &pb.RequeueRequest{TaskId: taskID, FromStatus: fromStatus, Workflow: wf}) + return unmapError(err) +} + +func (c *Client) RecoverStale(ctx context.Context) (int64, error) { + r, err := c.client.RecoverStale(ctx, &pb.RecoverStaleRequest{}) + if err != nil { + return 0, unmapError(err) + } + return r.Count, nil +} + +// Archive / Retry + +func (c *Client) ArchiveTask(ctx context.Context, taskID int64, fromStatus string, audit events.Event) (int64, error) { + r, err := c.client.ArchiveTask(ctx, &pb.ArchiveTaskRequest{TaskId: taskID, FromStatus: fromStatus, Audit: eventProto(audit)}) + if err != nil { + return 0, unmapError(err) + } + return r.EventId, nil +} + +func (c *Client) RetryTask(ctx context.Context, taskID int64, fromStatus, wf string) error { + _, err := c.client.RetryTask(ctx, &pb.RetryTaskRequest{TaskId: taskID, FromStatus: fromStatus, Workflow: wf}) + return unmapError(err) +} + +// Queries + +func (c *Client) TaskByIssue(ctx context.Context, owner, repo string, number int) (*workflow.Task, error) { + r, err := c.client.TaskByIssue(ctx, &pb.TaskByIssueRequest{Owner: owner, Repo: repo, Number: int64(number)}) + if err != nil { + return nil, unmapError(err) + } + if !r.Found { + return nil, nil + } + return taskValue(r.Task), nil +} + +func (c *Client) TaskByID(ctx context.Context, taskID int64) (*workflow.Task, error) { + r, err := c.client.TaskByID(ctx, &pb.TaskByIDRequest{TaskId: taskID}) + if err != nil { + return nil, unmapError(err) + } + if !r.Found { + return nil, nil + } + return taskValue(r.Task), nil +} + +func (c *Client) OpenPRs(ctx context.Context) ([]workflow.Task, error) { + r, err := c.client.OpenPRs(ctx, &pb.OpenPRsRequest{}) + if err != nil { + return nil, unmapError(err) + } + return derefTasks(r.Tasks), nil +} + +func (c *Client) ClearTerminalTasks(ctx context.Context) (int64, error) { + r, err := c.client.ClearTerminalTasks(ctx, &pb.ClearTerminalTasksRequest{}) + if err != nil { + return 0, unmapError(err) + } + return r.Count, nil +} + +func (c *Client) Tasks(ctx context.Context, limit int) ([]workflow.Task, error) { + r, err := c.client.Tasks(ctx, &pb.TasksRequest{Limit: int64(limit)}) + if err != nil { + return nil, unmapError(err) + } + return derefTasks(r.Tasks), nil +} + +func (c *Client) StatusCounts(ctx context.Context) (map[string]int, error) { + r, err := c.client.StatusCounts(ctx, &pb.StatusCountsRequest{}) + if err != nil { + return nil, unmapError(err) + } + out := make(map[string]int, len(r.Counts)) + for k, v := range r.Counts { + out[k] = int(v) + } + return out, nil +} + +func (c *Client) IncrementRetryCount(ctx context.Context, taskID int64) error { + _, err := c.client.IncrementRetryCount(ctx, &pb.IncrementRetryCountRequest{TaskId: taskID}) + return unmapError(err) +} + +// Events + +func (c *Client) InsertEvent(ctx context.Context, e events.Event) (int64, error) { + r, err := c.client.InsertEvent(ctx, &pb.InsertEventRequest{Event: eventProto(e)}) + if err != nil { + return 0, unmapError(err) + } + return r.Id, nil +} + +func (c *Client) EventsSince(ctx context.Context, sinceID int64, limit int) ([]events.Event, error) { + r, err := c.client.EventsSince(ctx, &pb.EventsSinceRequest{SinceId: sinceID, Limit: int64(limit)}) + if err != nil { + return nil, unmapError(err) + } + return mapValues(r.Events, eventValue), nil +} + +func (c *Client) TaskEvents(ctx context.Context, taskID int64) ([]events.Event, error) { + r, err := c.client.TaskEvents(ctx, &pb.TaskEventsRequest{TaskId: taskID}) + if err != nil { + return nil, unmapError(err) + } + return mapValues(r.Events, eventValue), nil +} + +func (c *Client) WorkflowStats(ctx context.Context) ([]store.WorkflowStat, error) { + r, err := c.client.WorkflowStats(ctx, &pb.WorkflowStatsRequest{}) + if err != nil { + return nil, unmapError(err) + } + return mapValues(r.Stats, workflowStatValue), nil +} + +func (c *Client) StageStats(ctx context.Context) ([]store.StageStat, error) { + r, err := c.client.StageStats(ctx, &pb.StageStatsRequest{}) + if err != nil { + return nil, unmapError(err) + } + return mapValues(r.Stats, stageStatValue), nil +} + +func (c *Client) TokensByDay(ctx context.Context, days int) ([]store.DayTokens, error) { + r, err := c.client.TokensByDay(ctx, &pb.TokensByDayRequest{Days: int64(days)}) + if err != nil { + return nil, unmapError(err) + } + return mapValues(r.Tokens, dayTokensValue), nil +} + +// Capture + +func (c *Client) InsertCapture(ctx context.Context, ce store.CapturedEvent, retention time.Duration, maxEvents int) (int64, error) { + r, err := c.client.InsertCapture(ctx, &pb.InsertCaptureRequest{Capture: capturedEventProto(ce), RetentionSeconds: int64(retention.Seconds()), MaxEvents: int64(maxEvents)}) + if err != nil { + return 0, unmapError(err) + } + return r.Id, nil +} + +func (c *Client) ListCaptures(ctx context.Context, limit int) ([]store.CapturedEvent, error) { + r, err := c.client.ListCaptures(ctx, &pb.ListCapturesRequest{Limit: int64(limit)}) + if err != nil { + return nil, unmapError(err) + } + return mapValues(r.Captures, capturedEventValue), nil +} + +// Mapping + +func (c *Client) InsertMapping(ctx context.Context, m mapping.Mapping) (int64, error) { + r, err := c.client.InsertMapping(ctx, &pb.InsertMappingRequest{Mapping: mappingProto(m)}) + if err != nil { + return 0, unmapError(err) + } + return r.Id, nil +} + +func (c *Client) GetMapping(ctx context.Context, id int64) (*mapping.Mapping, error) { + r, err := c.client.GetMapping(ctx, &pb.GetMappingRequest{Id: id}) + if err != nil { + return nil, unmapError(err) + } + if !r.Found { + return nil, nil + } + v := mappingValue(r.Mapping) + return &v, nil +} + +func (c *Client) ListMappings(ctx context.Context) ([]mapping.Mapping, error) { + r, err := c.client.ListMappings(ctx, &pb.ListMappingsRequest{}) + if err != nil { + return nil, unmapError(err) + } + return mapValues(r.Mappings, mappingValue), nil +} + +func (c *Client) UpdateMapping(ctx context.Context, m mapping.Mapping) error { + _, err := c.client.UpdateMapping(ctx, &pb.UpdateMappingRequest{Mapping: mappingProto(m)}) + return unmapError(err) +} + +func (c *Client) DeleteMapping(ctx context.Context, id int64) error { + _, err := c.client.DeleteMapping(ctx, &pb.DeleteMappingRequest{Id: id}) + return unmapError(err) +} + +// Binding + +func (c *Client) InsertBinding(ctx context.Context, b binding.Binding) (int64, error) { + r, err := c.client.InsertBinding(ctx, &pb.InsertBindingRequest{Binding: bindingProto(b)}) + if err != nil { + return 0, unmapError(err) + } + return r.Id, nil +} + +func (c *Client) GetBinding(ctx context.Context, id int64) (*binding.Binding, error) { + r, err := c.client.GetBinding(ctx, &pb.GetBindingRequest{Id: id}) + if err != nil { + return nil, unmapError(err) + } + if !r.Found { + return nil, nil + } + v := bindingValue(r.Binding) + return &v, nil +} + +func (c *Client) ListBindings(ctx context.Context) ([]binding.Binding, error) { + r, err := c.client.ListBindings(ctx, &pb.ListBindingsRequest{}) + if err != nil { + return nil, unmapError(err) + } + return mapValues(r.Bindings, bindingValue), nil +} + +func (c *Client) UpdateBinding(ctx context.Context, b binding.Binding) error { + _, err := c.client.UpdateBinding(ctx, &pb.UpdateBindingRequest{Binding: bindingProto(b)}) + return unmapError(err) +} + +func (c *Client) DeleteBinding(ctx context.Context, id int64) error { + _, err := c.client.DeleteBinding(ctx, &pb.DeleteBindingRequest{Id: id}) + return unmapError(err) +} + +func (c *Client) ApproveBinding(ctx context.Context, id int64) error { + _, err := c.client.ApproveBinding(ctx, &pb.ApproveBindingRequest{Id: id}) + return unmapError(err) +} + +// Dispatch + +func (c *Client) ArmedBindingsForSource(ctx context.Context, source string) ([]binding.Binding, error) { + r, err := c.client.ArmedBindingsForSource(ctx, &pb.ArmedBindingsForSourceRequest{Source: source}) + if err != nil { + return nil, unmapError(err) + } + return mapValues(r.Bindings, bindingValue), nil +} + +func (c *Client) RecordDispatch(ctx context.Context, bindingID, bindingVersion, captureID, taskID int64) error { + _, err := c.client.RecordDispatch(ctx, &pb.RecordDispatchRequest{BindingId: bindingID, BindingVersion: bindingVersion, CaptureId: captureID, TaskId: taskID}) + return unmapError(err) +} + +func (c *Client) ListUndispatchedCaptures(ctx context.Context, sources []string, limit int) ([]store.CapturedEvent, error) { + r, err := c.client.ListUndispatchedCaptures(ctx, &pb.ListUndispatchedCapturesRequest{Sources: sources, Limit: int64(limit)}) + if err != nil { + return nil, unmapError(err) + } + return mapValues(r.Captures, capturedEventValue), nil +} + +// BindingTaskCreator + +func (c *Client) EnqueueBindingTask(ctx context.Context, owner, repo, title, body, wf, identity string, bindingID int64, bindingVersion int) (*workflow.Task, error) { + r, err := c.client.EnqueueBindingTask(ctx, &pb.EnqueueBindingTaskRequest{Owner: owner, Repo: repo, Title: title, Body: body, Workflow: wf, Identity: identity, BindingId: bindingID, BindingVersion: int64(bindingVersion)}) + if err != nil { + return nil, unmapError(err) + } + return taskValue(r.Task), nil +} + +func derefTasks(in []*pb.Task) []workflow.Task { + if in == nil { + return nil + } + out := make([]workflow.Task, len(in)) + for i, t := range in { + out[i] = *taskValue(t) + } + return out +} diff --git a/internal/infrastructure/staterpc/conformance_test.go b/internal/infrastructure/staterpc/conformance_test.go new file mode 100644 index 000000000..940b58da3 --- /dev/null +++ b/internal/infrastructure/staterpc/conformance_test.go @@ -0,0 +1,306 @@ +package staterpc + +import ( + "context" + "errors" + "net" + "testing" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/test/bufconn" + + "github.com/samcharles93/archie-core/internal/domain/binding" + "github.com/samcharles93/archie-core/internal/domain/mapping" + "github.com/samcharles93/archie-core/internal/events" + "github.com/samcharles93/archie-core/internal/store" +) + +// contract is the union of every store surface staterpc fronts, so the same +// test battery drives both the local *store.Store and the remote *Client +// through one interface value, per docs/prds/state-store-contract.md §11's +// conformance requirement. +type contract interface { + store.TaskStore + store.CaptureStore + store.MappingStore + store.BindingStore + store.BindingDispatcher + store.BindingTaskCreator +} + +func remoteContract(t *testing.T, local *store.Store) contract { + t.Helper() + listener := bufconn.Listen(1 << 20) + server := grpc.NewServer() + RegisterServer(server, Deps{ + Tasks: local, Captures: local, Mappings: local, Bindings: local, + BindingDispatcher: local, BindingTaskCreator: local, + }) + go func() { _ = server.Serve(listener) }() + t.Cleanup(func() { server.Stop(); _ = listener.Close() }) + conn, err := grpc.NewClient("passthrough:///state", + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithContextDialer(func(ctx context.Context, _ string) (net.Conn, error) { return listener.DialContext(ctx) })) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = conn.Close() }) + return NewClient(conn) +} + +// TestStateStoreConformance runs the same battery of contract calls through +// both the local adapter and a bufconn-backed gRPC client, asserting +// identical behaviour including error-sentinel fidelity and the +// not-found-as-(nil,nil) convention (§7, §11). +func TestStateStoreConformance(t *testing.T) { + for _, mode := range []string{"local", "grpc"} { + t.Run(mode, func(t *testing.T) { + ctx := t.Context() + local := store.OpenTest(t) + var c contract = local + if mode == "grpc" { + c = remoteContract(t, local) + } + + // workflow.Store view: EnqueueChatTask, Transition, Update, InsertEvent. + task, err := c.EnqueueChatTask(ctx, "acme", "widget", "title", "body", "implement", "") + if err != nil || task == nil { + t.Fatalf("EnqueueChatTask: %+v %v", task, err) + } + if err := c.Transition(ctx, task.ID, task.Status, "running", "started"); err != nil { + t.Fatalf("Transition: %v", err) + } + task.Plan = "the plan" + task.Status = "running" + if err := c.Update(ctx, task); err != nil { + t.Fatalf("Update: %v", err) + } + eventID, err := c.InsertEvent(ctx, events.Event{Kind: "stage_finish", TaskID: task.ID, Data: map[string]any{"duration_ms": 12.0}}) + if err != nil || eventID == 0 { + t.Fatalf("InsertEvent: %v %v", eventID, err) + } + + // Stale transition: from no longer matches current status. + err = c.Transition(ctx, task.ID, "queued", "merged", "") + if !errors.Is(err, store.ErrStaleTransition) { + t.Fatalf("Transition stale = %v, want ErrStaleTransition", err) + } + + // TaskQueries: found=false is not an error. + missing, err := c.TaskByID(ctx, task.ID+999999) + if err != nil || missing != nil { + t.Fatalf("TaskByID missing: %+v %v", missing, err) + } + got, err := c.TaskByID(ctx, task.ID) + if err != nil || got == nil || got.Plan != "the plan" { + t.Fatalf("TaskByID: %+v %v", got, err) + } + byIssue, err := c.TaskByIssue(ctx, task.Owner, task.Repo, task.IssueNumber) + if err != nil || byIssue == nil || byIssue.ID != task.ID { + t.Fatalf("TaskByIssue: %+v %v", byIssue, err) + } + if _, err := c.Tasks(ctx, 10); err != nil { + t.Fatalf("Tasks: %v", err) + } + if _, err := c.StatusCounts(ctx); err != nil { + t.Fatalf("StatusCounts: %v", err) + } + if _, err := c.OpenPRs(ctx); err != nil { + t.Fatalf("OpenPRs: %v", err) + } + if err := c.IncrementRetryCount(ctx, task.ID); err != nil { + t.Fatalf("IncrementRetryCount: %v", err) + } + + // TaskEvents / EventsSince / stats. + if evs, err := c.TaskEvents(ctx, task.ID); err != nil || len(evs) != 1 || evs[0].Data["duration_ms"] != 12.0 { + t.Fatalf("TaskEvents: %+v %v", evs, err) + } + if _, err := c.EventsSince(ctx, 0, 10); err != nil { + t.Fatalf("EventsSince: %v", err) + } + if _, err := c.WorkflowStats(ctx); err != nil { + t.Fatalf("WorkflowStats: %v", err) + } + if _, err := c.StageStats(ctx); err != nil { + t.Fatalf("StageStats: %v", err) + } + if _, err := c.TokensByDay(ctx, 7); err != nil { + t.Fatalf("TokensByDay: %v", err) + } + + // Lifecycle: ClaimNext / ClaimByIssue / Requeue / RetryTask / RecoverStale. + if _, err := c.EnqueueIssue(ctx, "acme", "widget", 42, "issue title", "body", "bug", ""); err != nil { + t.Fatalf("EnqueueIssue: %v", err) + } + claimed, err := c.ClaimNext(ctx) + if err != nil || claimed == nil { + t.Fatalf("ClaimNext: %+v %v", claimed, err) + } + if err := c.Requeue(ctx, claimed.ID, "running", ""); err != nil { + t.Fatalf("Requeue: %v", err) + } + if err := c.RetryTask(ctx, claimed.ID, "queued", ""); err != nil { + t.Fatalf("RetryTask: %v", err) + } + if _, err := c.RecoverStale(ctx); err != nil { + t.Fatalf("RecoverStale: %v", err) + } + byClaim, err := c.ClaimByIssue(ctx, "acme", "widget", 999999) + if err != nil || byClaim != nil { + t.Fatalf("ClaimByIssue missing: %+v %v", byClaim, err) + } + + // Archive. RecoverStale above may have requeued task if it was + // still running, so re-fetch its current status rather than + // trusting the in-memory snapshot. + current, err := c.TaskByID(ctx, task.ID) + if err != nil || current == nil { + t.Fatalf("TaskByID before archive: %+v %v", current, err) + } + if _, err := c.ArchiveTask(ctx, task.ID, current.Status, events.Event{Kind: "archived"}); err != nil { + t.Fatalf("ArchiveTask: %v", err) + } + if _, err := c.ClearTerminalTasks(ctx); err != nil { + t.Fatalf("ClearTerminalTasks: %v", err) + } + + // Mapping: found=false, ErrMappingNotFound. + mappingID, err := c.InsertMapping(ctx, mapping.Mapping{Name: "m1", Fields: []mapping.Field{{Name: "a", Path: "a", Type: mapping.TypeString}}}) + if err != nil || mappingID == 0 { + t.Fatalf("InsertMapping: %v %v", mappingID, err) + } + missingMapping, err := c.GetMapping(ctx, mappingID+999999) + if err != nil || missingMapping != nil { + t.Fatalf("GetMapping missing: %+v %v", missingMapping, err) + } + gotMapping, err := c.GetMapping(ctx, mappingID) + if err != nil || gotMapping == nil || gotMapping.Name != "m1" { + t.Fatalf("GetMapping: %+v %v", gotMapping, err) + } + if _, err := c.ListMappings(ctx); err != nil { + t.Fatalf("ListMappings: %v", err) + } + gotMapping.Name = "m1-renamed" + if err := c.UpdateMapping(ctx, *gotMapping); err != nil { + t.Fatalf("UpdateMapping: %v", err) + } + err = c.UpdateMapping(ctx, mapping.Mapping{ID: mappingID + 999999, Name: "x", Fields: gotMapping.Fields}) + if !errors.Is(err, store.ErrMappingNotFound) { + t.Fatalf("UpdateMapping missing = %v, want ErrMappingNotFound", err) + } + err = c.DeleteMapping(ctx, mappingID+999999) + if !errors.Is(err, store.ErrMappingNotFound) { + t.Fatalf("DeleteMapping missing = %v, want ErrMappingNotFound", err) + } + + // Binding: found=false, ErrBindingNotFound, ErrBindingOverlap, + // ErrBindingTransition, and the dispatch surface incl. + // ErrAlreadyDispatched. + bindingID, err := c.InsertBinding(ctx, binding.Binding{ + Name: "b1", Matcher: binding.Matcher{Source: "sentry"}, MappingID: mappingID, + Workflow: "implement", Secret: "0123456789abcdef0123456789abcdef", + }) + if err != nil || bindingID == 0 { + t.Fatalf("InsertBinding: %v %v", bindingID, err) + } + _, err = c.InsertBinding(ctx, binding.Binding{ + Name: "b2", Matcher: binding.Matcher{Source: "sentry"}, MappingID: mappingID, + Workflow: "implement", Secret: "0123456789abcdef0123456789abcdef", + }) + if !errors.Is(err, store.ErrBindingOverlap) { + t.Fatalf("InsertBinding overlap = %v, want ErrBindingOverlap", err) + } + missingBinding, err := c.GetBinding(ctx, bindingID+999999) + if err != nil || missingBinding != nil { + t.Fatalf("GetBinding missing: %+v %v", missingBinding, err) + } + gotBinding, err := c.GetBinding(ctx, bindingID) + if err != nil || gotBinding == nil || gotBinding.Name != "b1" { + t.Fatalf("GetBinding: %+v %v", gotBinding, err) + } + if _, err := c.ListBindings(ctx); err != nil { + t.Fatalf("ListBindings: %v", err) + } + err = c.ApproveBinding(ctx, bindingID) + if !errors.Is(err, store.ErrBindingTransition) { + t.Fatalf("ApproveBinding from draft = %v, want ErrBindingTransition", err) + } + err = c.DeleteBinding(ctx, bindingID+999999) + if !errors.Is(err, store.ErrBindingNotFound) { + t.Fatalf("DeleteBinding missing = %v, want ErrBindingNotFound", err) + } + + // Capture + dispatch. + captureID, err := c.InsertCapture(ctx, store.CapturedEvent{Source: "sentry", Body: `{"id":1}`, Authenticated: true}, 0, 0) + if err != nil || captureID == 0 { + t.Fatalf("InsertCapture: %v %v", captureID, err) + } + if _, err := c.ListCaptures(ctx, 10); err != nil { + t.Fatalf("ListCaptures: %v", err) + } + if _, err := c.ArmedBindingsForSource(ctx, "sentry"); err != nil { + t.Fatalf("ArmedBindingsForSource: %v", err) + } + bindingTask, err := c.EnqueueBindingTask(ctx, "acme", "widget", "t", "b", "implement", "", bindingID, 1) + if err != nil || bindingTask == nil { + t.Fatalf("EnqueueBindingTask: %+v %v", bindingTask, err) + } + if err := c.RecordDispatch(ctx, bindingID, 1, captureID, bindingTask.ID); err != nil { + t.Fatalf("RecordDispatch: %v", err) + } + err = c.RecordDispatch(ctx, bindingID, 1, captureID, bindingTask.ID) + if !errors.Is(err, store.ErrAlreadyDispatched) { + t.Fatalf("RecordDispatch dup = %v, want ErrAlreadyDispatched", err) + } + if _, err := c.ListUndispatchedCaptures(ctx, []string{"sentry"}, 10); err != nil { + t.Fatalf("ListUndispatchedCaptures: %v", err) + } + }) + } +} + +// TestTokenInterceptorRejectsMissingOrInvalidToken exercises the gRPC +// interceptor the bridge-address (agent-consumed) listener topology +// requires: missing or unrecognised tokens fail closed with +// codes.Unauthenticated, per §9's token lifecycle. +func TestTokenInterceptorRejectsMissingOrInvalidToken(t *testing.T) { + const validToken = "task-42-token" + validate := func(token string) bool { return token == validToken } + + listener := bufconn.Listen(1 << 20) + local := store.OpenTest(t) + server := grpc.NewServer(grpc.UnaryInterceptor(UnaryTokenInterceptor(validate))) + RegisterServer(server, Deps{Tasks: local}) + go func() { _ = server.Serve(listener) }() + t.Cleanup(func() { server.Stop(); _ = listener.Close() }) + + dial := func(t *testing.T, token string) contract { + t.Helper() + opts := []grpc.DialOption{ + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithContextDialer(func(ctx context.Context, _ string) (net.Conn, error) { return listener.DialContext(ctx) }), + } + if token != "" { + opts = append(opts, grpc.WithUnaryInterceptor(UnaryClientTokenInterceptor(token))) + } + conn, err := grpc.NewClient("passthrough:///state", opts...) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = conn.Close() }) + return NewClient(conn) + } + + ctx := t.Context() + if _, err := dial(t, "").StatusCounts(ctx); err == nil { + t.Fatal("missing token accepted") + } + if _, err := dial(t, "wrong-token").StatusCounts(ctx); err == nil { + t.Fatal("invalid token accepted") + } + if _, err := dial(t, validToken).StatusCounts(ctx); err != nil { + t.Fatalf("valid token rejected: %v", err) + } +} diff --git a/internal/infrastructure/staterpc/server.go b/internal/infrastructure/staterpc/server.go new file mode 100644 index 000000000..9246b6f5a --- /dev/null +++ b/internal/infrastructure/staterpc/server.go @@ -0,0 +1,509 @@ +// Package staterpc adapts the State Store contract (internal/store's +// producer-owned surfaces plus the consumer-owned workflow.Store) to gRPC. +// See docs/prds/state-store-contract.md for the ratified contract this +// package implements against. +package staterpc + +import ( + "context" + "log/slog" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + pb "github.com/samcharles93/archie-core/internal/contracts/state/v1" + "github.com/samcharles93/archie-core/internal/domain/binding" + "github.com/samcharles93/archie-core/internal/domain/mapping" + "github.com/samcharles93/archie-core/internal/store" +) + +// Unavailable-capability errors, mirroring gatewayrpc's missing-session-store +// pattern (docs/prds/state-store-contract.md §7's "capability absent -> +// Unavailable" row): a nil optional Deps field maps to codes.Unavailable +// rather than a nil-pointer panic. +var ( + errCaptureUnavailable = status.Error(codes.Unavailable, "capture store unavailable") + errMappingUnavailable = status.Error(codes.Unavailable, "mapping store unavailable") + errBindingUnavailable = status.Error(codes.Unavailable, "binding store unavailable") + errBindingDispatchUnavailable = status.Error(codes.Unavailable, "binding dispatcher unavailable") + errBindingTaskCreatorUnavailable = status.Error(codes.Unavailable, "binding task creator unavailable") +) + +func timeSeconds(s int64) time.Duration { return time.Duration(s) * time.Second } + +// Deps groups the store surfaces the StateStore service fronts. TaskStore is +// required; the rest are optional (nil disables that group's RPCs, returning +// codes.Unavailable) exactly as their daemon-side consumers already treat a +// nil Mappings/Bindings/BindingDispatcher/BindingTaskCreator as "disabled". +type Deps struct { + Tasks store.TaskStore + Captures store.CaptureStore + Mappings store.MappingStore + Bindings store.BindingStore + BindingDispatcher store.BindingDispatcher + BindingTaskCreator store.BindingTaskCreator + Log *slog.Logger +} + +type server struct { + pb.UnimplementedStateStoreServiceServer + deps Deps +} + +// RegisterServer registers the StateStore gRPC service against registrar, +// backed by deps. Optionally wrap registrar's interceptor chain with +// TokenInterceptor for the bridge-address (agent-consumed) topology; the +// caller decides, per docs/prds/state-store-contract.md §9's listener rule. +func RegisterServer(registrar grpc.ServiceRegistrar, deps Deps) { + if deps.Log == nil { + deps.Log = slog.New(slog.DiscardHandler) + } + pb.RegisterStateStoreServiceServer(registrar, &server{deps: deps}) +} + +func (s *server) logErr(rpc string, err error) error { + if err != nil { + s.deps.Log.Error("staterpc call failed", "rpc", rpc, "err", err) + } + return mapError(err) +} + +// Lifecycle + +func (s *server) EnqueueIssue(ctx context.Context, r *pb.EnqueueIssueRequest) (*pb.EnqueueIssueResponse, error) { + inserted, err := s.deps.Tasks.EnqueueIssue(ctx, r.Owner, r.Repo, int(r.Number), r.Title, r.Body, r.Labels, r.Identity) + if err != nil { + return nil, s.logErr("EnqueueIssue", err) + } + return &pb.EnqueueIssueResponse{Inserted: inserted}, nil +} + +func (s *server) EnqueueChatTask(ctx context.Context, r *pb.EnqueueChatTaskRequest) (*pb.EnqueueChatTaskResponse, error) { + t, err := s.deps.Tasks.EnqueueChatTask(ctx, r.Owner, r.Repo, r.Title, r.Body, r.Workflow, r.Identity) + if err != nil { + return nil, s.logErr("EnqueueChatTask", err) + } + return &pb.EnqueueChatTaskResponse{Task: taskProto(t)}, nil +} + +func (s *server) ClaimNext(ctx context.Context, _ *pb.ClaimNextRequest) (*pb.ClaimNextResponse, error) { + t, err := s.deps.Tasks.ClaimNext(ctx) + if err != nil { + return nil, s.logErr("ClaimNext", err) + } + return &pb.ClaimNextResponse{Task: taskProto(t), Found: t != nil}, nil +} + +func (s *server) ClaimByIssue(ctx context.Context, r *pb.ClaimByIssueRequest) (*pb.ClaimByIssueResponse, error) { + t, err := s.deps.Tasks.ClaimByIssue(ctx, r.Owner, r.Repo, int(r.Number)) + if err != nil { + return nil, s.logErr("ClaimByIssue", err) + } + return &pb.ClaimByIssueResponse{Task: taskProto(t), Found: t != nil}, nil +} + +func (s *server) Transition(ctx context.Context, r *pb.TransitionRequest) (*pb.TransitionResponse, error) { + if err := s.deps.Tasks.Transition(ctx, r.TaskId, r.From, r.To, r.Detail); err != nil { + return nil, s.logErr("Transition", err) + } + return &pb.TransitionResponse{}, nil +} + +func (s *server) Update(ctx context.Context, r *pb.UpdateRequest) (*pb.UpdateResponse, error) { + if err := s.deps.Tasks.Update(ctx, taskValue(r.Task)); err != nil { + return nil, s.logErr("Update", err) + } + return &pb.UpdateResponse{}, nil +} + +func (s *server) Requeue(ctx context.Context, r *pb.RequeueRequest) (*pb.RequeueResponse, error) { + if err := s.deps.Tasks.Requeue(ctx, r.TaskId, r.FromStatus, r.Workflow); err != nil { + return nil, s.logErr("Requeue", err) + } + return &pb.RequeueResponse{}, nil +} + +func (s *server) RecoverStale(ctx context.Context, _ *pb.RecoverStaleRequest) (*pb.RecoverStaleResponse, error) { + n, err := s.deps.Tasks.RecoverStale(ctx) + if err != nil { + return nil, s.logErr("RecoverStale", err) + } + return &pb.RecoverStaleResponse{Count: n}, nil +} + +// Archive / Retry + +func (s *server) ArchiveTask(ctx context.Context, r *pb.ArchiveTaskRequest) (*pb.ArchiveTaskResponse, error) { + eventID, err := s.deps.Tasks.ArchiveTask(ctx, r.TaskId, r.FromStatus, eventValue(r.Audit)) + if err != nil { + return nil, s.logErr("ArchiveTask", err) + } + return &pb.ArchiveTaskResponse{EventId: eventID}, nil +} + +func (s *server) RetryTask(ctx context.Context, r *pb.RetryTaskRequest) (*pb.RetryTaskResponse, error) { + if err := s.deps.Tasks.RetryTask(ctx, r.TaskId, r.FromStatus, r.Workflow); err != nil { + return nil, s.logErr("RetryTask", err) + } + return &pb.RetryTaskResponse{}, nil +} + +// Queries + +func (s *server) TaskByIssue(ctx context.Context, r *pb.TaskByIssueRequest) (*pb.TaskByIssueResponse, error) { + t, err := s.deps.Tasks.TaskByIssue(ctx, r.Owner, r.Repo, int(r.Number)) + if err != nil { + return nil, s.logErr("TaskByIssue", err) + } + return &pb.TaskByIssueResponse{Task: taskProto(t), Found: t != nil}, nil +} + +func (s *server) TaskByID(ctx context.Context, r *pb.TaskByIDRequest) (*pb.TaskByIDResponse, error) { + t, err := s.deps.Tasks.TaskByID(ctx, r.TaskId) + if err != nil { + return nil, s.logErr("TaskByID", err) + } + return &pb.TaskByIDResponse{Task: taskProto(t), Found: t != nil}, nil +} + +func (s *server) OpenPRs(ctx context.Context, _ *pb.OpenPRsRequest) (*pb.OpenPRsResponse, error) { + tasks, err := s.deps.Tasks.OpenPRs(ctx) + if err != nil { + return nil, s.logErr("OpenPRs", err) + } + out := make([]*pb.Task, len(tasks)) + for i := range tasks { + out[i] = taskProto(&tasks[i]) + } + return &pb.OpenPRsResponse{Tasks: out}, nil +} + +func (s *server) ClearTerminalTasks(ctx context.Context, _ *pb.ClearTerminalTasksRequest) (*pb.ClearTerminalTasksResponse, error) { + n, err := s.deps.Tasks.ClearTerminalTasks(ctx) + if err != nil { + return nil, s.logErr("ClearTerminalTasks", err) + } + return &pb.ClearTerminalTasksResponse{Count: n}, nil +} + +func (s *server) Tasks(ctx context.Context, r *pb.TasksRequest) (*pb.TasksResponse, error) { + tasks, err := s.deps.Tasks.Tasks(ctx, int(r.Limit)) + if err != nil { + return nil, s.logErr("Tasks", err) + } + out := make([]*pb.Task, len(tasks)) + for i := range tasks { + out[i] = taskProto(&tasks[i]) + } + return &pb.TasksResponse{Tasks: out}, nil +} + +func (s *server) StatusCounts(ctx context.Context, _ *pb.StatusCountsRequest) (*pb.StatusCountsResponse, error) { + counts, err := s.deps.Tasks.StatusCounts(ctx) + if err != nil { + return nil, s.logErr("StatusCounts", err) + } + out := make(map[string]int64, len(counts)) + for k, v := range counts { + out[k] = int64(v) + } + return &pb.StatusCountsResponse{Counts: out}, nil +} + +func (s *server) IncrementRetryCount(ctx context.Context, r *pb.IncrementRetryCountRequest) (*pb.IncrementRetryCountResponse, error) { + if err := s.deps.Tasks.IncrementRetryCount(ctx, r.TaskId); err != nil { + return nil, s.logErr("IncrementRetryCount", err) + } + return &pb.IncrementRetryCountResponse{}, nil +} + +// Events + +func (s *server) InsertEvent(ctx context.Context, r *pb.InsertEventRequest) (*pb.InsertEventResponse, error) { + id, err := s.deps.Tasks.InsertEvent(ctx, eventValue(r.Event)) + if err != nil { + return nil, s.logErr("InsertEvent", err) + } + return &pb.InsertEventResponse{Id: id}, nil +} + +func (s *server) EventsSince(ctx context.Context, r *pb.EventsSinceRequest) (*pb.EventsSinceResponse, error) { + evs, err := s.deps.Tasks.EventsSince(ctx, r.SinceId, int(r.Limit)) + if err != nil { + return nil, s.logErr("EventsSince", err) + } + return &pb.EventsSinceResponse{Events: mapValues(evs, eventProto)}, nil +} + +func (s *server) TaskEvents(ctx context.Context, r *pb.TaskEventsRequest) (*pb.TaskEventsResponse, error) { + evs, err := s.deps.Tasks.TaskEvents(ctx, r.TaskId) + if err != nil { + return nil, s.logErr("TaskEvents", err) + } + return &pb.TaskEventsResponse{Events: mapValues(evs, eventProto)}, nil +} + +func (s *server) WorkflowStats(ctx context.Context, _ *pb.WorkflowStatsRequest) (*pb.WorkflowStatsResponse, error) { + stats, err := s.deps.Tasks.WorkflowStats(ctx) + if err != nil { + return nil, s.logErr("WorkflowStats", err) + } + return &pb.WorkflowStatsResponse{Stats: mapValues(stats, workflowStatProto)}, nil +} + +func (s *server) StageStats(ctx context.Context, _ *pb.StageStatsRequest) (*pb.StageStatsResponse, error) { + stats, err := s.deps.Tasks.StageStats(ctx) + if err != nil { + return nil, s.logErr("StageStats", err) + } + return &pb.StageStatsResponse{Stats: mapValues(stats, stageStatProto)}, nil +} + +func (s *server) TokensByDay(ctx context.Context, r *pb.TokensByDayRequest) (*pb.TokensByDayResponse, error) { + tokens, err := s.deps.Tasks.TokensByDay(ctx, int(r.Days)) + if err != nil { + return nil, s.logErr("TokensByDay", err) + } + return &pb.TokensByDayResponse{Tokens: mapValues(tokens, dayTokensProto)}, nil +} + +// Capture + +func (s *server) capture() (store.CaptureStore, error) { + if s.deps.Captures == nil { + return nil, errCaptureUnavailable + } + return s.deps.Captures, nil +} + +func (s *server) InsertCapture(ctx context.Context, r *pb.InsertCaptureRequest) (*pb.InsertCaptureResponse, error) { + cs, err := s.capture() + if err != nil { + return nil, err + } + id, err := cs.InsertCapture(ctx, capturedEventValue(r.Capture), timeSeconds(r.RetentionSeconds), int(r.MaxEvents)) + if err != nil { + return nil, s.logErr("InsertCapture", err) + } + return &pb.InsertCaptureResponse{Id: id}, nil +} + +func (s *server) ListCaptures(ctx context.Context, r *pb.ListCapturesRequest) (*pb.ListCapturesResponse, error) { + cs, err := s.capture() + if err != nil { + return nil, err + } + captures, err := cs.ListCaptures(ctx, int(r.Limit)) + if err != nil { + return nil, s.logErr("ListCaptures", err) + } + return &pb.ListCapturesResponse{Captures: mapValues(captures, capturedEventProto)}, nil +} + +// Mapping + +func (s *server) mapping() (store.MappingStore, error) { + if s.deps.Mappings == nil { + return nil, errMappingUnavailable + } + return s.deps.Mappings, nil +} + +func (s *server) InsertMapping(ctx context.Context, r *pb.InsertMappingRequest) (*pb.InsertMappingResponse, error) { + ms, err := s.mapping() + if err != nil { + return nil, err + } + id, err := ms.InsertMapping(ctx, mappingValue(r.Mapping)) + if err != nil { + return nil, s.logErr("InsertMapping", err) + } + return &pb.InsertMappingResponse{Id: id}, nil +} + +func (s *server) GetMapping(ctx context.Context, r *pb.GetMappingRequest) (*pb.GetMappingResponse, error) { + ms, err := s.mapping() + if err != nil { + return nil, err + } + m, err := ms.GetMapping(ctx, r.Id) + if err != nil { + return nil, s.logErr("GetMapping", err) + } + return &pb.GetMappingResponse{Mapping: mappingProtoPtr(m), Found: m != nil}, nil +} + +func (s *server) ListMappings(ctx context.Context, _ *pb.ListMappingsRequest) (*pb.ListMappingsResponse, error) { + ms, err := s.mapping() + if err != nil { + return nil, err + } + mappings, err := ms.ListMappings(ctx) + if err != nil { + return nil, s.logErr("ListMappings", err) + } + return &pb.ListMappingsResponse{Mappings: mapValues(mappings, mappingProto)}, nil +} + +func (s *server) UpdateMapping(ctx context.Context, r *pb.UpdateMappingRequest) (*pb.UpdateMappingResponse, error) { + ms, err := s.mapping() + if err != nil { + return nil, err + } + if err := ms.UpdateMapping(ctx, mappingValue(r.Mapping)); err != nil { + return nil, s.logErr("UpdateMapping", err) + } + return &pb.UpdateMappingResponse{}, nil +} + +func (s *server) DeleteMapping(ctx context.Context, r *pb.DeleteMappingRequest) (*pb.DeleteMappingResponse, error) { + ms, err := s.mapping() + if err != nil { + return nil, err + } + if err := ms.DeleteMapping(ctx, r.Id); err != nil { + return nil, s.logErr("DeleteMapping", err) + } + return &pb.DeleteMappingResponse{}, nil +} + +// Binding + +func (s *server) binding() (store.BindingStore, error) { + if s.deps.Bindings == nil { + return nil, errBindingUnavailable + } + return s.deps.Bindings, nil +} + +func (s *server) InsertBinding(ctx context.Context, r *pb.InsertBindingRequest) (*pb.InsertBindingResponse, error) { + bs, err := s.binding() + if err != nil { + return nil, err + } + id, err := bs.InsertBinding(ctx, bindingValue(r.Binding)) + if err != nil { + return nil, s.logErr("InsertBinding", err) + } + return &pb.InsertBindingResponse{Id: id}, nil +} + +func (s *server) GetBinding(ctx context.Context, r *pb.GetBindingRequest) (*pb.GetBindingResponse, error) { + bs, err := s.binding() + if err != nil { + return nil, err + } + b, err := bs.GetBinding(ctx, r.Id) + if err != nil { + return nil, s.logErr("GetBinding", err) + } + return &pb.GetBindingResponse{Binding: bindingProtoPtr(b), Found: b != nil}, nil +} + +func (s *server) ListBindings(ctx context.Context, _ *pb.ListBindingsRequest) (*pb.ListBindingsResponse, error) { + bs, err := s.binding() + if err != nil { + return nil, err + } + bindings, err := bs.ListBindings(ctx) + if err != nil { + return nil, s.logErr("ListBindings", err) + } + return &pb.ListBindingsResponse{Bindings: mapValues(bindings, bindingProto)}, nil +} + +func (s *server) UpdateBinding(ctx context.Context, r *pb.UpdateBindingRequest) (*pb.UpdateBindingResponse, error) { + bs, err := s.binding() + if err != nil { + return nil, err + } + if err := bs.UpdateBinding(ctx, bindingValue(r.Binding)); err != nil { + return nil, s.logErr("UpdateBinding", err) + } + return &pb.UpdateBindingResponse{}, nil +} + +func (s *server) DeleteBinding(ctx context.Context, r *pb.DeleteBindingRequest) (*pb.DeleteBindingResponse, error) { + bs, err := s.binding() + if err != nil { + return nil, err + } + if err := bs.DeleteBinding(ctx, r.Id); err != nil { + return nil, s.logErr("DeleteBinding", err) + } + return &pb.DeleteBindingResponse{}, nil +} + +func (s *server) ApproveBinding(ctx context.Context, r *pb.ApproveBindingRequest) (*pb.ApproveBindingResponse, error) { + bs, err := s.binding() + if err != nil { + return nil, err + } + if err := bs.ApproveBinding(ctx, r.Id); err != nil { + return nil, s.logErr("ApproveBinding", err) + } + return &pb.ApproveBindingResponse{}, nil +} + +// Dispatch + +func (s *server) ArmedBindingsForSource(ctx context.Context, r *pb.ArmedBindingsForSourceRequest) (*pb.ArmedBindingsForSourceResponse, error) { + if s.deps.BindingDispatcher == nil { + return nil, errBindingDispatchUnavailable + } + bindings, err := s.deps.BindingDispatcher.ArmedBindingsForSource(ctx, r.Source) + if err != nil { + return nil, s.logErr("ArmedBindingsForSource", err) + } + return &pb.ArmedBindingsForSourceResponse{Bindings: mapValues(bindings, bindingProto)}, nil +} + +func (s *server) RecordDispatch(ctx context.Context, r *pb.RecordDispatchRequest) (*pb.RecordDispatchResponse, error) { + if s.deps.BindingDispatcher == nil { + return nil, errBindingDispatchUnavailable + } + if err := s.deps.BindingDispatcher.RecordDispatch(ctx, r.BindingId, r.BindingVersion, r.CaptureId, r.TaskId); err != nil { + return nil, s.logErr("RecordDispatch", err) + } + return &pb.RecordDispatchResponse{}, nil +} + +func (s *server) ListUndispatchedCaptures(ctx context.Context, r *pb.ListUndispatchedCapturesRequest) (*pb.ListUndispatchedCapturesResponse, error) { + if s.deps.BindingDispatcher == nil { + return nil, errBindingDispatchUnavailable + } + captures, err := s.deps.BindingDispatcher.ListUndispatchedCaptures(ctx, r.Sources, int(r.Limit)) + if err != nil { + return nil, s.logErr("ListUndispatchedCaptures", err) + } + return &pb.ListUndispatchedCapturesResponse{Captures: mapValues(captures, capturedEventProto)}, nil +} + +// BindingTaskCreator + +func (s *server) EnqueueBindingTask(ctx context.Context, r *pb.EnqueueBindingTaskRequest) (*pb.EnqueueBindingTaskResponse, error) { + if s.deps.BindingTaskCreator == nil { + return nil, errBindingTaskCreatorUnavailable + } + t, err := s.deps.BindingTaskCreator.EnqueueBindingTask(ctx, r.Owner, r.Repo, r.Title, r.Body, r.Workflow, r.Identity, r.BindingId, int(r.BindingVersion)) + if err != nil { + return nil, s.logErr("EnqueueBindingTask", err) + } + return &pb.EnqueueBindingTaskResponse{Task: taskProto(t)}, nil +} + +func mappingProtoPtr(m *mapping.Mapping) *pb.Mapping { + if m == nil { + return nil + } + return mappingProto(*m) +} + +func bindingProtoPtr(b *binding.Binding) *pb.Binding { + if b == nil { + return nil + } + return bindingProto(*b) +} diff --git a/internal/infrastructure/staterpc/values.go b/internal/infrastructure/staterpc/values.go new file mode 100644 index 000000000..9128c4cac --- /dev/null +++ b/internal/infrastructure/staterpc/values.go @@ -0,0 +1,311 @@ +package staterpc + +import ( + "encoding/json" + "errors" + "fmt" + "time" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" + + pb "github.com/samcharles93/archie-core/internal/contracts/state/v1" + "github.com/samcharles93/archie-core/internal/domain/binding" + "github.com/samcharles93/archie-core/internal/domain/mapping" + "github.com/samcharles93/archie-core/internal/domain/workflow" + "github.com/samcharles93/archie-core/internal/events" + "github.com/samcharles93/archie-core/internal/store" +) + +func timestamp(t time.Time) *timestamppb.Timestamp { + if t.IsZero() { + return nil + } + return timestamppb.New(t) +} + +func timeValue(t *timestamppb.Timestamp) time.Time { + if t == nil { + return time.Time{} + } + return t.AsTime() +} + +func mapValues[A, B any](in []A, f func(A) B) []B { + if in == nil { + return nil + } + out := make([]B, len(in)) + for i, v := range in { + out[i] = f(v) + } + return out +} + +func taskProto(t *workflow.Task) *pb.Task { //nolint:dupl // mirror-image field-by-field proto<->domain mapping; taskValue below reverses every assignment, so line-level duplication is unavoidable without reflection + if t == nil { + return nil + } + return &pb.Task{ + Id: t.ID, Owner: t.Owner, Repo: t.Repo, IssueNumber: int64(t.IssueNumber), + Title: t.Title, Body: t.Body, Labels: t.Labels, Status: t.Status, + Workflow: t.Workflow, Stage: t.Stage, Branch: t.Branch, Plan: t.Plan, Notes: t.Notes, + PrNumber: int64(t.PRNumber), TokensUsed: int64(t.TokensUsed), Iterations: int64(t.Iterations), + Attempt: int64(t.Attempt), ParkReason: t.ParkReason, RetryCount: int64(t.RetryCount), + WatchCommentId: t.WatchCommentID, Source: t.Source, Identity: t.Identity, + BindingId: t.BindingID, BindingVersion: int64(t.BindingVersion), + CreatedAt: timestamp(t.CreatedAt), UpdatedAt: timestamp(t.UpdatedAt), + } +} + +func taskValue(t *pb.Task) *workflow.Task { //nolint:dupl // see taskProto above + if t == nil { + return nil + } + return &workflow.Task{ + ID: t.Id, Owner: t.Owner, Repo: t.Repo, IssueNumber: int(t.IssueNumber), + Title: t.Title, Body: t.Body, Labels: t.Labels, Status: t.Status, + Workflow: t.Workflow, Stage: t.Stage, Branch: t.Branch, Plan: t.Plan, Notes: t.Notes, + PRNumber: int(t.PrNumber), TokensUsed: int(t.TokensUsed), Iterations: int(t.Iterations), + Attempt: int(t.Attempt), ParkReason: t.ParkReason, RetryCount: int(t.RetryCount), + WatchCommentID: t.WatchCommentId, Source: t.Source, Identity: t.Identity, + BindingID: t.BindingId, BindingVersion: int(t.BindingVersion), + CreatedAt: timeValue(t.CreatedAt), UpdatedAt: timeValue(t.UpdatedAt), + } +} + +// eventDataJSON and eventDataValue convert events.Event.Data (map[string]any) +// to/from a JSON object string, mirroring the store's own on-disk column. +func eventDataJSON(data map[string]any) string { + if data == nil { + return "" + } + b, err := json.Marshal(data) + if err != nil { + return "" + } + return string(b) +} + +func eventDataValue(s string) map[string]any { + if s == "" { + return nil + } + var data map[string]any + if err := json.Unmarshal([]byte(s), &data); err != nil { + return nil + } + return data +} + +func eventProto(e events.Event) *pb.Event { + return &pb.Event{ + Id: e.ID, At: timestamp(e.At), Kind: e.Kind, TaskId: e.TaskID, Repo: e.Repo, + Issue: int64(e.Issue), Workflow: e.Workflow, Stage: e.Stage, Detail: e.Detail, + DataJson: eventDataJSON(e.Data), + } +} + +func eventValue(e *pb.Event) events.Event { + if e == nil { + return events.Event{} + } + return events.Event{ + ID: e.Id, At: timeValue(e.At), Kind: e.Kind, TaskID: e.TaskId, Repo: e.Repo, + Issue: int(e.Issue), Workflow: e.Workflow, Stage: e.Stage, Detail: e.Detail, + Data: eventDataValue(e.DataJson), + } +} + +func capturedEventProto(c store.CapturedEvent) *pb.CapturedEvent { + return &pb.CapturedEvent{ + Id: c.ID, ReceivedAt: timestamp(c.ReceivedAt), Source: c.Source, + RemoteAddr: c.RemoteAddr, ContentType: c.ContentType, Headers: c.Headers, + Body: c.Body, Authenticated: c.Authenticated, + } +} + +func capturedEventValue(c *pb.CapturedEvent) store.CapturedEvent { + if c == nil { + return store.CapturedEvent{} + } + return store.CapturedEvent{ + ID: c.Id, ReceivedAt: timeValue(c.ReceivedAt), Source: c.Source, + RemoteAddr: c.RemoteAddr, ContentType: c.ContentType, Headers: c.Headers, + Body: c.Body, Authenticated: c.Authenticated, + } +} + +func mappingFieldProto(f mapping.Field) *pb.MappingField { + return &pb.MappingField{Name: f.Name, Path: f.Path, Type: string(f.Type), Required: f.Required} +} + +func mappingFieldValue(f *pb.MappingField) mapping.Field { + if f == nil { + return mapping.Field{} + } + return mapping.Field{Name: f.Name, Path: f.Path, Type: mapping.FieldType(f.Type), Required: f.Required} +} + +func mappingProto(m mapping.Mapping) *pb.Mapping { + return &pb.Mapping{ + Id: m.ID, Name: m.Name, SourceHint: m.SourceHint, + Fields: mapValues(m.Fields, mappingFieldProto), + CreatedAt: timestamp(m.CreatedAt), UpdatedAt: timestamp(m.UpdatedAt), + } +} + +func mappingValue(m *pb.Mapping) mapping.Mapping { + if m == nil { + return mapping.Mapping{} + } + return mapping.Mapping{ + ID: m.Id, Name: m.Name, SourceHint: m.SourceHint, + Fields: mapValues(m.Fields, mappingFieldValue), + CreatedAt: timeValue(m.CreatedAt), UpdatedAt: timeValue(m.UpdatedAt), + } +} + +func bindingProto(b binding.Binding) *pb.Binding { + return &pb.Binding{ + Id: b.ID, Name: b.Name, Matcher: &pb.BindingMatcher{Source: b.Matcher.Source}, + MappingId: b.MappingID, Workflow: b.Workflow, Owner: b.Owner, Repo: b.Repo, + Version: int64(b.Version), Status: string(b.Status), Secret: b.Secret, + CreatedAt: timestamp(b.CreatedAt), UpdatedAt: timestamp(b.UpdatedAt), + } +} + +func bindingValue(b *pb.Binding) binding.Binding { + if b == nil { + return binding.Binding{} + } + var source string + if b.Matcher != nil { + source = b.Matcher.Source + } + return binding.Binding{ + ID: b.Id, Name: b.Name, Matcher: binding.Matcher{Source: source}, + MappingID: b.MappingId, Workflow: b.Workflow, Owner: b.Owner, Repo: b.Repo, + Version: int(b.Version), Status: binding.Status(b.Status), Secret: b.Secret, + CreatedAt: timeValue(b.CreatedAt), UpdatedAt: timeValue(b.UpdatedAt), + } +} + +func workflowStatProto(w store.WorkflowStat) *pb.WorkflowStat { + return &pb.WorkflowStat{ + Workflow: w.Workflow, Runs: int64(w.Runs), Merged: int64(w.Merged), + PrOpen: int64(w.PROpen), Parked: int64(w.Parked), AvgTokens: int64(w.AvgTokens), + AvgSteps: w.AvgSteps, TotalTokens: int64(w.TotalToken), + } +} + +func workflowStatValue(w *pb.WorkflowStat) store.WorkflowStat { + if w == nil { + return store.WorkflowStat{} + } + return store.WorkflowStat{ + Workflow: w.Workflow, Runs: int(w.Runs), Merged: int(w.Merged), + PROpen: int(w.PrOpen), Parked: int(w.Parked), AvgTokens: int(w.AvgTokens), + AvgSteps: w.AvgSteps, TotalToken: int(w.TotalTokens), + } +} + +func stageStatProto(s store.StageStat) *pb.StageStat { + return &pb.StageStat{Workflow: s.Workflow, Stage: s.Stage, Runs: int64(s.Runs), AvgMs: int64(s.AvgMs), Errors: int64(s.Errors)} +} + +func stageStatValue(s *pb.StageStat) store.StageStat { + if s == nil { + return store.StageStat{} + } + return store.StageStat{Workflow: s.Workflow, Stage: s.Stage, Runs: int(s.Runs), AvgMs: int(s.AvgMs), Errors: int(s.Errors)} +} + +func dayTokensProto(d store.DayTokens) *pb.DayTokens { + return &pb.DayTokens{Day: d.Day, Tokens: int64(d.Tokens)} +} + +func dayTokensValue(d *pb.DayTokens) store.DayTokens { + if d == nil { + return store.DayTokens{} + } + return store.DayTokens{Day: d.Day, Tokens: int(d.Tokens)} +} + +// Canonical public phrases for sentinel errors (rev. 2c §7). These strings +// are the wire contract for sentinel identity -- the client rehydrates by +// matching (code, message), never by parsing free-form text. +const ( + msgStaleTransition = "stale transition" + msgBindingNotFound = "binding not found" + msgMappingNotFound = "mapping not found" + msgBindingOverlap = "binding overlap" + msgBindingTransition = "binding transition rejected" + msgAlreadyDispatched = "already dispatched" + msgInternal = "state store: internal error" +) + +// mapError converts a store sentinel error into a structured gRPC status +// carrying a short, public, stable message -- never the raw wrapped chain +// (which may contain SQL, provider detail, or secrets). Infra errors map to +// codes.Internal with a sanitised message; the caller is expected to log the +// full error server-side before calling mapError. +func mapError(err error) error { + if err == nil { + return nil + } + switch { + case errors.Is(err, store.ErrStaleTransition): + return status.Error(codes.FailedPrecondition, msgStaleTransition) + case errors.Is(err, store.ErrBindingNotFound): + return status.Error(codes.NotFound, msgBindingNotFound) + case errors.Is(err, store.ErrMappingNotFound): + return status.Error(codes.NotFound, msgMappingNotFound) + case errors.Is(err, store.ErrBindingOverlap): + return status.Error(codes.FailedPrecondition, msgBindingOverlap) + case errors.Is(err, store.ErrBindingTransition): + return status.Error(codes.FailedPrecondition, msgBindingTransition) + case errors.Is(err, store.ErrAlreadyDispatched): + return status.Error(codes.AlreadyExists, msgAlreadyDispatched) + default: + return status.Error(codes.Internal, msgInternal) + } +} + +// unmapError rehydrates a gRPC status error back to the store sentinel it +// came from, so a caller's errors.Is(err, store.ErrX) keeps working across +// the wire. A non-status error (e.g. a transport failure, a cancelled or +// deadline-exceeded context) is returned unchanged. +func unmapError(err error) error { + if err == nil { + return nil + } + st, ok := status.FromError(err) + if !ok { + return err + } + switch st.Code() { + case codes.FailedPrecondition: + switch st.Message() { + case msgStaleTransition: + return store.ErrStaleTransition + case msgBindingOverlap: + return store.ErrBindingOverlap + case msgBindingTransition: + return store.ErrBindingTransition + } + case codes.NotFound: + switch st.Message() { + case msgBindingNotFound: + return store.ErrBindingNotFound + case msgMappingNotFound: + return store.ErrMappingNotFound + } + case codes.AlreadyExists: + if st.Message() == msgAlreadyDispatched { + return store.ErrAlreadyDispatched + } + } + return fmt.Errorf("state store: %s: %w", st.Message(), err) +} diff --git a/internal/store/bindings.go b/internal/store/bindings.go index 56a33414b..0807a1f12 100644 --- a/internal/store/bindings.go +++ b/internal/store/bindings.go @@ -338,33 +338,21 @@ func (s *Store) decryptBindingSecret(b *binding.Binding) error { return nil } -// sqlExecutor is the subset of *sql.DB / *sql.Tx that RecordDispatch needs. -// Both satisfy it; nil falls back to the store's own *sql.DB so callers -// that don't open an explicit transaction get best-effort semantics. -type sqlExecutor interface { - ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error) -} - -// RecordDispatch writes a (binding, capture) dedup row. The caller may -// pass a *sql.Tx to make the dispatch row commit atomically with the -// surrounding task insert; pass nil to use the store's own connection -// (best-effort, not atomic with the task row). INSERT OR IGNORE + +// RecordDispatch writes a (binding, capture) dedup row using the store's +// own connection (best-effort, not atomic with the task row -- the +// at-most-once guarantee is the INSERT OR IGNORE dedup row itself, which +// is already transactionless in production). INSERT OR IGNORE + // RowsAffected is the dedup test: a duplicate (binding_id, capture_id) // is a no-op write and returns ErrAlreadyDispatched rather than a // constraint error. func (s *Store) RecordDispatch( ctx context.Context, - tx *sql.Tx, bindingID int64, bindingVersion int64, captureID int64, taskID int64, ) error { - exec := sqlExecutor(s.db) - if tx != nil { - exec = tx - } - res, err := exec.ExecContext(ctx, ` + res, err := s.db.ExecContext(ctx, ` INSERT OR IGNORE INTO binding_dispatches (binding_id, binding_version, capture_id, task_id, dispatched_at) VALUES (?, ?, ?, ?, ?)`, bindingID, bindingVersion, captureID, taskID, diff --git a/internal/store/bindings_test.go b/internal/store/bindings_test.go index ddbf10200..f5bab4379 100644 --- a/internal/store/bindings_test.go +++ b/internal/store/bindings_test.go @@ -381,16 +381,9 @@ func TestDeleteBindingRemovesRowAndLedgerEntries(t *testing.T) { if err != nil { t.Fatalf("InsertBinding: %v", err) } - tx, err := s.db.BeginTx(t.Context(), nil) - if err != nil { - t.Fatalf("BeginTx: %v", err) - } - if err := s.RecordDispatch(t.Context(), tx, id, 1, 42, 7); err != nil { + if err := s.RecordDispatch(t.Context(), id, 1, 42, 7); err != nil { t.Fatalf("RecordDispatch: %v", err) } - if err := tx.Commit(); err != nil { - t.Fatalf("Commit: %v", err) - } if err := s.DeleteBinding(t.Context(), id); err != nil { t.Fatalf("DeleteBinding: %v", err) } @@ -417,28 +410,14 @@ func TestRecordDispatchIsIdempotent(t *testing.T) { t.Fatalf("InsertBinding: %v", err) } ctx := t.Context() - tx1, err := s.db.BeginTx(ctx, nil) - if err != nil { - t.Fatalf("BeginTx 1: %v", err) - } - if err := s.RecordDispatch(ctx, tx1, id, 1, 42, 7); err != nil { + if err := s.RecordDispatch(ctx, id, 1, 42, 7); err != nil { t.Fatalf("first RecordDispatch: %v", err) } - if err := tx1.Commit(); err != nil { - t.Fatalf("Commit 1: %v", err) - } - tx2, err := s.db.BeginTx(ctx, nil) - if err != nil { - t.Fatalf("BeginTx 2: %v", err) - } - err = s.RecordDispatch(ctx, tx2, id, 1, 42, 99) + err = s.RecordDispatch(ctx, id, 1, 42, 99) if !errors.Is(err, ErrAlreadyDispatched) { t.Fatalf("second RecordDispatch (same binding/capture) = %v, want ErrAlreadyDispatched", err) } - if err := tx2.Rollback(); err != nil { - t.Fatalf("Rollback 2: %v", err) - } } func TestListUndispatchedCapturesExcludesDispatched(t *testing.T) { @@ -474,16 +453,9 @@ func TestListUndispatchedCapturesExcludesDispatched(t *testing.T) { } ctx := t.Context() - tx, err := s.db.BeginTx(ctx, nil) - if err != nil { - t.Fatalf("BeginTx: %v", err) - } - if err := s.RecordDispatch(ctx, tx, id, 1, cap1, 100); err != nil { + if err := s.RecordDispatch(ctx, id, 1, cap1, 100); err != nil { t.Fatalf("RecordDispatch: %v", err) } - if err := tx.Commit(); err != nil { - t.Fatalf("Commit: %v", err) - } got, err := s.ListUndispatchedCaptures(ctx, []string{"sentry"}, 10) if err != nil { diff --git a/internal/store/interface.go b/internal/store/interface.go index 97c2c647c..eb48744cd 100644 --- a/internal/store/interface.go +++ b/internal/store/interface.go @@ -5,7 +5,6 @@ package store import ( "context" - "database/sql" "time" "github.com/samcharles93/archie-core/internal/domain/binding" @@ -122,7 +121,6 @@ type BindingDispatcher interface { ArmedBindingsForSource(ctx context.Context, source string) ([]binding.Binding, error) RecordDispatch( ctx context.Context, - tx *sql.Tx, bindingID int64, bindingVersion int64, captureID int64, diff --git a/internal/webui/api_capture_test.go b/internal/webui/api_capture_test.go index 9b2dfb61a..7f237a983 100644 --- a/internal/webui/api_capture_test.go +++ b/internal/webui/api_capture_test.go @@ -4,7 +4,6 @@ import ( "context" "crypto/hmac" "crypto/sha256" - "database/sql" "encoding/hex" "encoding/json" "errors" @@ -104,7 +103,6 @@ func (s *stubBindingStore) ApproveBinding(_ context.Context, _ int64) error { func (s *stubBindingStore) RecordDispatch( _ context.Context, - _ *sql.Tx, _ int64, _ int64, _ int64, diff --git a/proto/state/v1/state.proto b/proto/state/v1/state.proto new file mode 100644 index 000000000..ad486f2b7 --- /dev/null +++ b/proto/state/v1/state.proto @@ -0,0 +1,398 @@ +syntax = "proto3"; + +package state.v1; + +import "google/protobuf/timestamp.proto"; + +// StateStore is the single gRPC service fronting archie.db (one store, one +// file). See docs/prds/state-store-contract.md for the ownership split: the +// workflow-domain Store view (Update/Transition/InsertEvent) is consumer-owned +// in internal/domain/workflow, while the rest of this surface stays +// producer-owned in internal/store. Both are served by the same service and +// the same *store.Store implementation; the proto bypasses the Go +// interfacebloat cap (max 8), like gateway.v1.ChatService does. +service StateStoreService { + // Lifecycle + rpc EnqueueIssue(EnqueueIssueRequest) returns (EnqueueIssueResponse); + rpc EnqueueChatTask(EnqueueChatTaskRequest) returns (EnqueueChatTaskResponse); + rpc ClaimNext(ClaimNextRequest) returns (ClaimNextResponse); + rpc ClaimByIssue(ClaimByIssueRequest) returns (ClaimByIssueResponse); + rpc Transition(TransitionRequest) returns (TransitionResponse); + rpc Update(UpdateRequest) returns (UpdateResponse); + rpc Requeue(RequeueRequest) returns (RequeueResponse); + rpc RecoverStale(RecoverStaleRequest) returns (RecoverStaleResponse); + + // Archive / Retry + rpc ArchiveTask(ArchiveTaskRequest) returns (ArchiveTaskResponse); + rpc RetryTask(RetryTaskRequest) returns (RetryTaskResponse); + + // Queries + rpc TaskByIssue(TaskByIssueRequest) returns (TaskByIssueResponse); + rpc TaskByID(TaskByIDRequest) returns (TaskByIDResponse); + rpc OpenPRs(OpenPRsRequest) returns (OpenPRsResponse); + rpc ClearTerminalTasks(ClearTerminalTasksRequest) returns (ClearTerminalTasksResponse); + rpc Tasks(TasksRequest) returns (TasksResponse); + rpc StatusCounts(StatusCountsRequest) returns (StatusCountsResponse); + rpc IncrementRetryCount(IncrementRetryCountRequest) returns (IncrementRetryCountResponse); + + // Events + rpc InsertEvent(InsertEventRequest) returns (InsertEventResponse); + rpc EventsSince(EventsSinceRequest) returns (EventsSinceResponse); + rpc TaskEvents(TaskEventsRequest) returns (TaskEventsResponse); + rpc WorkflowStats(WorkflowStatsRequest) returns (WorkflowStatsResponse); + rpc StageStats(StageStatsRequest) returns (StageStatsResponse); + rpc TokensByDay(TokensByDayRequest) returns (TokensByDayResponse); + + // Capture + rpc InsertCapture(InsertCaptureRequest) returns (InsertCaptureResponse); + rpc ListCaptures(ListCapturesRequest) returns (ListCapturesResponse); + + // Mapping + rpc InsertMapping(InsertMappingRequest) returns (InsertMappingResponse); + rpc GetMapping(GetMappingRequest) returns (GetMappingResponse); + rpc ListMappings(ListMappingsRequest) returns (ListMappingsResponse); + rpc UpdateMapping(UpdateMappingRequest) returns (UpdateMappingResponse); + rpc DeleteMapping(DeleteMappingRequest) returns (DeleteMappingResponse); + + // Binding + rpc InsertBinding(InsertBindingRequest) returns (InsertBindingResponse); + rpc GetBinding(GetBindingRequest) returns (GetBindingResponse); + rpc ListBindings(ListBindingsRequest) returns (ListBindingsResponse); + rpc UpdateBinding(UpdateBindingRequest) returns (UpdateBindingResponse); + rpc DeleteBinding(DeleteBindingRequest) returns (DeleteBindingResponse); + rpc ApproveBinding(ApproveBindingRequest) returns (ApproveBindingResponse); + + // Dispatch + rpc ArmedBindingsForSource(ArmedBindingsForSourceRequest) returns (ArmedBindingsForSourceResponse); + rpc RecordDispatch(RecordDispatchRequest) returns (RecordDispatchResponse); + rpc ListUndispatchedCaptures(ListUndispatchedCapturesRequest) returns (ListUndispatchedCapturesResponse); + + // BindingTaskCreator + rpc EnqueueBindingTask(EnqueueBindingTaskRequest) returns (EnqueueBindingTaskResponse); +} + +// Task mirrors internal/domain/workflow.Task. +message Task { + int64 id = 1; + string owner = 2; + string repo = 3; + int64 issue_number = 4; + string title = 5; + string body = 6; + string labels = 7; + string status = 8; + string workflow = 9; + string stage = 10; + string branch = 11; + string plan = 12; + string notes = 13; + int64 pr_number = 14; + int64 tokens_used = 15; + int64 iterations = 16; + int64 attempt = 17; + string park_reason = 18; + int64 retry_count = 19; + int64 watch_comment_id = 20; + string source = 21; + string identity = 22; + int64 binding_id = 23; + int64 binding_version = 24; + google.protobuf.Timestamp created_at = 25; + google.protobuf.Timestamp updated_at = 26; +} + +// Event mirrors internal/events.Event. Data is carried as a JSON object +// string (matching the store's own on-disk representation) rather than +// google.protobuf.Struct, to stay a direct mirror of the existing column. +message Event { + int64 id = 1; + google.protobuf.Timestamp at = 2; + string kind = 3; + int64 task_id = 4; + string repo = 5; + int64 issue = 6; + string workflow = 7; + string stage = 8; + string detail = 9; + string data_json = 10; +} + +// CapturedEvent mirrors internal/store.CapturedEvent. +message CapturedEvent { + int64 id = 1; + google.protobuf.Timestamp received_at = 2; + string source = 3; + string remote_addr = 4; + string content_type = 5; + string headers = 6; + string body = 7; + bool authenticated = 8; +} + +// MappingField mirrors internal/domain/mapping.Field. +message MappingField { + string name = 1; + string path = 2; + string type = 3; + bool required = 4; +} + +// Mapping mirrors internal/domain/mapping.Mapping. +message Mapping { + int64 id = 1; + string name = 2; + string source_hint = 3; + repeated MappingField fields = 4; + google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp updated_at = 6; +} + +// BindingMatcher mirrors internal/domain/binding.Matcher. +message BindingMatcher { + string source = 1; +} + +// Binding mirrors internal/domain/binding.Binding. +message Binding { + int64 id = 1; + string name = 2; + BindingMatcher matcher = 3; + int64 mapping_id = 4; + string workflow = 5; + string owner = 6; + string repo = 7; + int64 version = 8; + string status = 9; + string secret = 10; + google.protobuf.Timestamp created_at = 11; + google.protobuf.Timestamp updated_at = 12; +} + +// WorkflowStat mirrors internal/store.WorkflowStat. +message WorkflowStat { + string workflow = 1; + int64 runs = 2; + int64 merged = 3; + int64 pr_open = 4; + int64 parked = 5; + int64 avg_tokens = 6; + double avg_steps = 7; + int64 total_tokens = 8; +} + +// StageStat mirrors internal/store.StageStat. +message StageStat { + string workflow = 1; + string stage = 2; + int64 runs = 3; + int64 avg_ms = 4; + int64 errors = 5; +} + +// DayTokens mirrors internal/store.DayTokens. +message DayTokens { + string day = 1; + int64 tokens = 2; +} + +message EnqueueIssueRequest { + string owner = 1; + string repo = 2; + int64 number = 3; + string title = 4; + string body = 5; + string labels = 6; + string identity = 7; +} +message EnqueueIssueResponse { bool inserted = 1; } + +message EnqueueChatTaskRequest { + string owner = 1; + string repo = 2; + string title = 3; + string body = 4; + string workflow = 5; + string identity = 6; +} +message EnqueueChatTaskResponse { Task task = 1; } + +message ClaimNextRequest {} +message ClaimNextResponse { + Task task = 1; + bool found = 2; +} + +message ClaimByIssueRequest { + string owner = 1; + string repo = 2; + int64 number = 3; +} +message ClaimByIssueResponse { + Task task = 1; + bool found = 2; +} + +message TransitionRequest { + int64 task_id = 1; + string from = 2; + string to = 3; + string detail = 4; +} +message TransitionResponse {} + +message UpdateRequest { Task task = 1; } +message UpdateResponse {} + +message RequeueRequest { + int64 task_id = 1; + string from_status = 2; + string workflow = 3; +} +message RequeueResponse {} + +message RecoverStaleRequest {} +message RecoverStaleResponse { int64 count = 1; } + +message ArchiveTaskRequest { + int64 task_id = 1; + string from_status = 2; + Event audit = 3; +} +message ArchiveTaskResponse { int64 event_id = 1; } + +message RetryTaskRequest { + int64 task_id = 1; + string from_status = 2; + string workflow = 3; +} +message RetryTaskResponse {} + +message TaskByIssueRequest { + string owner = 1; + string repo = 2; + int64 number = 3; +} +message TaskByIssueResponse { + Task task = 1; + bool found = 2; +} + +message TaskByIDRequest { int64 task_id = 1; } +message TaskByIDResponse { + Task task = 1; + bool found = 2; +} + +message OpenPRsRequest {} +message OpenPRsResponse { repeated Task tasks = 1; } + +message ClearTerminalTasksRequest {} +message ClearTerminalTasksResponse { int64 count = 1; } + +message TasksRequest { int64 limit = 1; } +message TasksResponse { repeated Task tasks = 1; } + +message StatusCountsRequest {} +message StatusCountsResponse { map counts = 1; } + +message IncrementRetryCountRequest { int64 task_id = 1; } +message IncrementRetryCountResponse {} + +message InsertEventRequest { Event event = 1; } +message InsertEventResponse { int64 id = 1; } + +message EventsSinceRequest { + int64 since_id = 1; + int64 limit = 2; +} +message EventsSinceResponse { repeated Event events = 1; } + +message TaskEventsRequest { int64 task_id = 1; } +message TaskEventsResponse { repeated Event events = 1; } + +message WorkflowStatsRequest {} +message WorkflowStatsResponse { repeated WorkflowStat stats = 1; } + +message StageStatsRequest {} +message StageStatsResponse { repeated StageStat stats = 1; } + +message TokensByDayRequest { int64 days = 1; } +message TokensByDayResponse { repeated DayTokens tokens = 1; } + +message InsertCaptureRequest { + CapturedEvent capture = 1; + int64 retention_seconds = 2; + int64 max_events = 3; +} +message InsertCaptureResponse { int64 id = 1; } + +message ListCapturesRequest { int64 limit = 1; } +message ListCapturesResponse { repeated CapturedEvent captures = 1; } + +message InsertMappingRequest { Mapping mapping = 1; } +message InsertMappingResponse { int64 id = 1; } + +message GetMappingRequest { int64 id = 1; } +message GetMappingResponse { + Mapping mapping = 1; + bool found = 2; +} + +message ListMappingsRequest {} +message ListMappingsResponse { repeated Mapping mappings = 1; } + +message UpdateMappingRequest { Mapping mapping = 1; } +message UpdateMappingResponse {} + +message DeleteMappingRequest { int64 id = 1; } +message DeleteMappingResponse {} + +message InsertBindingRequest { Binding binding = 1; } +message InsertBindingResponse { int64 id = 1; } + +message GetBindingRequest { int64 id = 1; } +message GetBindingResponse { + Binding binding = 1; + bool found = 2; +} + +message ListBindingsRequest {} +message ListBindingsResponse { repeated Binding bindings = 1; } + +message UpdateBindingRequest { Binding binding = 1; } +message UpdateBindingResponse {} + +message DeleteBindingRequest { int64 id = 1; } +message DeleteBindingResponse {} + +message ApproveBindingRequest { int64 id = 1; } +message ApproveBindingResponse {} + +message ArmedBindingsForSourceRequest { string source = 1; } +message ArmedBindingsForSourceResponse { repeated Binding bindings = 1; } + +message RecordDispatchRequest { + int64 binding_id = 1; + int64 binding_version = 2; + int64 capture_id = 3; + int64 task_id = 4; +} +message RecordDispatchResponse {} + +message ListUndispatchedCapturesRequest { + repeated string sources = 1; + int64 limit = 2; +} +message ListUndispatchedCapturesResponse { repeated CapturedEvent captures = 1; } + +message EnqueueBindingTaskRequest { + string owner = 1; + string repo = 2; + string title = 3; + string body = 4; + string workflow = 5; + string identity = 6; + int64 binding_id = 7; + int64 binding_version = 8; +} +message EnqueueBindingTaskResponse { Task task = 1; }