// loomcycle's gRPC service surface (v0.5.5).
//
// Mirrors the existing HTTP+SSE wire shape exactly — every RPC has a
// 1:1 mapping to an HTTP route under /v1/. Both wire surfaces coexist
// on the same loomcycle process; operators pick one (or both) via
// LOOMCYCLE_GRPC_ADDR / LOOMCYCLE_LISTEN_ADDR.
//
// Compatibility:
//   - The HTTP+SSE surface is the canonical contract for now.
//     Anything that ships there must be expressible here without
//     loss; proto changes follow HTTP+SSE, not the other way.
//   - Field numbers are stable across v0.5.x. Adding a new field is
//     non-breaking; removing or renumbering one is. v0 caveats apply
//     until v1.0 is tagged.
//   - The `status` strings use the same enum the HTTP API uses
//     (running / completed / failed / cancelled) — represented as
//     proto strings, not a typed enum, so adding a new state on the
//     HTTP side doesn't require regenerating gRPC stubs everywhere.

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             v7.35.1
// source: loomcycle.proto

package loomcyclepb

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 (
	Loomcycle_Run_FullMethodName                 = "/loomcycle.v1.Loomcycle/Run"
	Loomcycle_Continue_FullMethodName            = "/loomcycle.v1.Loomcycle/Continue"
	Loomcycle_SpawnRunBatch_FullMethodName       = "/loomcycle.v1.Loomcycle/SpawnRunBatch"
	Loomcycle_CompactRun_FullMethodName          = "/loomcycle.v1.Loomcycle/CompactRun"
	Loomcycle_DirectoryUsers_FullMethodName      = "/loomcycle.v1.Loomcycle/DirectoryUsers"
	Loomcycle_DirectoryInspect_FullMethodName    = "/loomcycle.v1.Loomcycle/DirectoryInspect"
	Loomcycle_DirectoryTenants_FullMethodName    = "/loomcycle.v1.Loomcycle/DirectoryTenants"
	Loomcycle_ErasureReport_FullMethodName       = "/loomcycle.v1.Loomcycle/ErasureReport"
	Loomcycle_ErasureExecute_FullMethodName      = "/loomcycle.v1.Loomcycle/ErasureExecute"
	Loomcycle_ReplaySession_FullMethodName       = "/loomcycle.v1.Loomcycle/ReplaySession"
	Loomcycle_RunInput_FullMethodName            = "/loomcycle.v1.Loomcycle/RunInput"
	Loomcycle_CancelTurn_FullMethodName          = "/loomcycle.v1.Loomcycle/CancelTurn"
	Loomcycle_ResolveInterrupt_FullMethodName    = "/loomcycle.v1.Loomcycle/ResolveInterrupt"
	Loomcycle_StreamRun_FullMethodName           = "/loomcycle.v1.Loomcycle/StreamRun"
	Loomcycle_GetTranscript_FullMethodName       = "/loomcycle.v1.Loomcycle/GetTranscript"
	Loomcycle_GetAgent_FullMethodName            = "/loomcycle.v1.Loomcycle/GetAgent"
	Loomcycle_CancelAgent_FullMethodName         = "/loomcycle.v1.Loomcycle/CancelAgent"
	Loomcycle_ListUserAgents_FullMethodName      = "/loomcycle.v1.Loomcycle/ListUserAgents"
	Loomcycle_UsageReport_FullMethodName         = "/loomcycle.v1.Loomcycle/UsageReport"
	Loomcycle_TokenLimit_FullMethodName          = "/loomcycle.v1.Loomcycle/TokenLimit"
	Loomcycle_Health_FullMethodName              = "/loomcycle.v1.Loomcycle/Health"
	Loomcycle_Config_FullMethodName              = "/loomcycle.v1.Loomcycle/Config"
	Loomcycle_RegisterHook_FullMethodName        = "/loomcycle.v1.Loomcycle/RegisterHook"
	Loomcycle_ListHooks_FullMethodName           = "/loomcycle.v1.Loomcycle/ListHooks"
	Loomcycle_DeleteHook_FullMethodName          = "/loomcycle.v1.Loomcycle/DeleteHook"
	Loomcycle_PauseRuntime_FullMethodName        = "/loomcycle.v1.Loomcycle/PauseRuntime"
	Loomcycle_ResumeRuntime_FullMethodName       = "/loomcycle.v1.Loomcycle/ResumeRuntime"
	Loomcycle_GetRuntimeState_FullMethodName     = "/loomcycle.v1.Loomcycle/GetRuntimeState"
	Loomcycle_ResolveProbe_FullMethodName        = "/loomcycle.v1.Loomcycle/ResolveProbe"
	Loomcycle_CreateSnapshot_FullMethodName      = "/loomcycle.v1.Loomcycle/CreateSnapshot"
	Loomcycle_ListSnapshots_FullMethodName       = "/loomcycle.v1.Loomcycle/ListSnapshots"
	Loomcycle_GetSnapshot_FullMethodName         = "/loomcycle.v1.Loomcycle/GetSnapshot"
	Loomcycle_ExportSnapshot_FullMethodName      = "/loomcycle.v1.Loomcycle/ExportSnapshot"
	Loomcycle_RestoreSnapshot_FullMethodName     = "/loomcycle.v1.Loomcycle/RestoreSnapshot"
	Loomcycle_DeleteSnapshot_FullMethodName      = "/loomcycle.v1.Loomcycle/DeleteSnapshot"
	Loomcycle_AgentDef_FullMethodName            = "/loomcycle.v1.Loomcycle/AgentDef"
	Loomcycle_SkillDef_FullMethodName            = "/loomcycle.v1.Loomcycle/SkillDef"
	Loomcycle_MCPServerDef_FullMethodName        = "/loomcycle.v1.Loomcycle/MCPServerDef"
	Loomcycle_ScheduleDef_FullMethodName         = "/loomcycle.v1.Loomcycle/ScheduleDef"
	Loomcycle_A2AServerCardDef_FullMethodName    = "/loomcycle.v1.Loomcycle/A2AServerCardDef"
	Loomcycle_A2AAgentDef_FullMethodName         = "/loomcycle.v1.Loomcycle/A2AAgentDef"
	Loomcycle_WebhookDef_FullMethodName          = "/loomcycle.v1.Loomcycle/WebhookDef"
	Loomcycle_MemoryBackendDef_FullMethodName    = "/loomcycle.v1.Loomcycle/MemoryBackendDef"
	Loomcycle_OperatorTokenDef_FullMethodName    = "/loomcycle.v1.Loomcycle/OperatorTokenDef"
	Loomcycle_VolumeDef_FullMethodName           = "/loomcycle.v1.Loomcycle/VolumeDef"
	Loomcycle_TeamDef_FullMethodName             = "/loomcycle.v1.Loomcycle/TeamDef"
	Loomcycle_Path_FullMethodName                = "/loomcycle.v1.Loomcycle/Path"
	Loomcycle_Document_FullMethodName            = "/loomcycle.v1.Loomcycle/Document"
	Loomcycle_History_FullMethodName             = "/loomcycle.v1.Loomcycle/History"
	Loomcycle_ListChannels_FullMethodName        = "/loomcycle.v1.Loomcycle/ListChannels"
	Loomcycle_StreamUserRunStates_FullMethodName = "/loomcycle.v1.Loomcycle/StreamUserRunStates"
	Loomcycle_PublishChannel_FullMethodName      = "/loomcycle.v1.Loomcycle/PublishChannel"
	Loomcycle_SubscribeChannel_FullMethodName    = "/loomcycle.v1.Loomcycle/SubscribeChannel"
	Loomcycle_PeekChannel_FullMethodName         = "/loomcycle.v1.Loomcycle/PeekChannel"
	Loomcycle_AckChannel_FullMethodName          = "/loomcycle.v1.Loomcycle/AckChannel"
	Loomcycle_AwaitChannels_FullMethodName       = "/loomcycle.v1.Loomcycle/AwaitChannels"
	Loomcycle_BroadcastChannels_FullMethodName   = "/loomcycle.v1.Loomcycle/BroadcastChannels"
)

// LoomcycleClient is the client API for Loomcycle 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.
type LoomcycleClient interface {
	// Run starts a fresh agent run and server-streams its events. One
	// request → many Event responses. The stream terminates on EOF when
	// the loop reaches its terminal state (done, failed, or cancelled).
	//
	// Mirrors POST /v1/runs.
	Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error)
	// Continue extends an existing session with a new run. The session's
	// prior transcript is replayed into the loop's context; the response
	// stream covers only the NEW events from this continuation.
	//
	// Mirrors POST /v1/sessions/{id}/messages.
	Continue(ctx context.Context, in *ContinueRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error)
	// SpawnRunBatch spawns N fresh runs concurrently in one call (RFC Y
	// external fan-out, mode "join"), bounded by the per-user admission
	// gate, returning a combined index-aligned envelope once all settle. A
	// per-child failure is captured in that child's result and never fails
	// the batch. mode "detach" (async run handles) is reserved for a future
	// release and rejected today.
	//
	// Mirrors POST /v1/runs:batch + the spawn_runs MCP tool.
	SpawnRunBatch(ctx context.Context, in *BatchSpawnRequest, opts ...grpc.CallOption) (*BatchSpawnResult, error)
	// CompactRun summarizes a run's conversation to free context and
	// continue from the summary. A live run must be PARKED (awaiting input);
	// a mid-turn run returns FailedPrecondition. Keyed by run_id.
	//
	// Mirrors POST /v1/runs/{run_id}/compact + the compact_run MCP tool.
	CompactRun(ctx context.Context, in *CompactRunRequest, opts ...grpc.CallOption) (*CompactRunResult, error)
	// ErasureReport enumerates what this deployment holds about one subject, in
	// three tiers separated by what they guarantee. Read-only.
	//
	// The tenant is taken from the caller's credentials and is NOT a field: a
	// subject id is only unique within one tenant, so a wire tenant would let a
	// caller enumerate another tenant's subject.
	// DirectoryUsers lists the subjects with activity in the caller's tenant, and
	// DirectoryInspect aggregates one subject's activity, chats, memory, documents,
	// budget and usage in a single call. READ-ONLY and derived — a "user" is a
	// GROUP BY over runs.user_id, not a stored row, so there is no create or update
	// here; removing a subject's footprint is ErasureExecute.
	//
	// No tenant field on either, deliberately: a subject id is only unique within
	// one tenant, so accepting one would let a caller inspect somebody else's.
	DirectoryUsers(ctx context.Context, in *DirectoryUsersRequest, opts ...grpc.CallOption) (*DirectoryUsersResponse, error)
	DirectoryInspect(ctx context.Context, in *DirectoryInspectRequest, opts ...grpc.CallOption) (*DirectoryInspectResponse, error)
	// DirectoryTenants enumerates tenants with derived counts. ADMIN ONLY: the
	// counts are unremarkable, but the LIST is cross-tenant information a confined
	// principal must not learn — so a non-admin is REFUSED rather than given a
	// filtered list, which would still confirm its own tenant's existence.
	DirectoryTenants(ctx context.Context, in *DirectoryTenantsRequest, opts ...grpc.CallOption) (*DirectoryTenantsResponse, error)
	ErasureReport(ctx context.Context, in *ErasureReportRequest, opts ...grpc.CallOption) (*ErasureReportResponse, error)
	// ErasureExecute removes tiers 1 and 2 and reports what it could not reach.
	// DEFAULTS TO A DRY RUN: dry_run is `optional` so an unset field means true,
	// matching HTTP — a client that forgets it deletes nothing.
	ErasureExecute(ctx context.Context, in *ErasureExecuteRequest, opts ...grpc.CallOption) (*ErasureExecuteResponse, error)
	// ReplaySession copies a source session's transcript into a new session bound
	// to a (possibly different) target agent (RFC BJ Phase 4). Mirrors
	// POST /v1/sessions/{id}/replay.
	ReplaySession(ctx context.Context, in *ReplaySessionRequest, opts ...grpc.CallOption) (*ReplaySessionResult, error)
	// RunInput pushes an operator steering message into a LIVE interactive
	// run (one parked at end_turn awaiting input, or mid-turn — the message
	// is drained at the next iteration boundary). delivered=false +
	// NotFound when no in-flight run holds run_id; ResourceExhausted when
	// the run's steer queue is full. The injected `source` is server-stamped
	// (never wire-trusted). Cross-replica routing is inherited from the
	// steer registry. Mirrors POST /v1/runs/{run_id}/input. (RFC AI)
	RunInput(ctx context.Context, in *RunInputRequest, opts ...grpc.CallOption) (*RunInputResponse, error)
	// CancelTurn stops the CURRENT turn of a LIVE interactive run (its in-flight
	// model generation + the tool calls it started) and parks it at
	// awaiting_input — session + transcript intact. This is NOT whole-run cancel
	// (CancelAgent), which terminates the run. FailedPrecondition when the run
	// isn't mid-turn (not_mid_turn) or isn't interactive (not_interactive);
	// NotFound (opaque) for an unknown / cross-tenant / not-reachable run.
	// Owner-routed cross-replica by runs.replica_id.
	//
	// Mirrors POST /v1/runs/{run_id}/cancel. (RFC BH)
	CancelTurn(ctx context.Context, in *CancelTurnRequest, opts ...grpc.CallOption) (*CancelTurnResponse, error)
	// ResolveInterrupt resolves a pending interruption — either an answer
	// (disposition "" / "answer", validated against the declared options) or a
	// decline (disposition "declined": no answer, skips option validation) so the
	// waiting Question tool proceeds. InvalidArgument on a bad kind / disposition
	// / answer; NotFound (opaque) for an unknown / cross-tenant interrupt;
	// FailedPrecondition when already terminal or expired.
	//
	// Mirrors POST /v1/runs/{run_id}/interrupts/{interrupt_id}/resolve. (RFC BH)
	ResolveInterrupt(ctx context.Context, in *ResolveInterruptRequest, opts ...grpc.CallOption) (*ResolveInterruptResponse, error)
	// StreamRun re-attaches to a run's event stream by run_id, replaying
	// from from_seq and then live-tailing — the gRPC twin of
	// GET /v1/runs/{run_id}/stream. For a PARKED interactive run (non-
	// terminal) the stream stays open until the run ends or ctx fires; a
	// disconnect does NOT stop the run. The first frame is a synthetic
	// type="agent" Event carrying run metadata. (RFC AI)
	StreamRun(ctx context.Context, in *StreamRunRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error)
	// GetTranscript returns the full event history for a session,
	// ordered by seq. Used by adapters that re-attach to a previously
	// started session (e.g. cross-tab sync).
	//
	// Mirrors GET /v1/sessions/{id}/transcript.
	GetTranscript(ctx context.Context, in *GetTranscriptRequest, opts ...grpc.CallOption) (*Transcript, error)
	// GetAgent returns one agent's current status + usage stats. Used
	// by adapters polling for completion when the SSE/gRPC stream was
	// interrupted (browser tab closed, network blip).
	//
	// Mirrors GET /v1/agents/{agent_id}.
	GetAgent(ctx context.Context, in *GetAgentRequest, opts ...grpc.CallOption) (*Agent, error)
	// CancelAgent sets the agent's terminal status to "cancelled" and
	// cascades the cancellation to every child via parent_agent_id.
	//
	// Mirrors POST /v1/agents/{agent_id}/cancel.
	CancelAgent(ctx context.Context, in *CancelAgentRequest, opts ...grpc.CallOption) (*CancelAgentResponse, error)
	// ListUserAgents enumerates a user's recent agent runs, optionally
	// filtered by status.
	//
	// Mirrors GET /v1/users/{user_id}/agents.
	ListUserAgents(ctx context.Context, in *ListUserAgentsRequest, opts ...grpc.CallOption) (*ListUserAgentsResponse, error)
	// UsageReport aggregates the token-usage + cost ledger (RFC AV): summed
	// tokens + cost grouped by the requested dimensions over an optional tenant +
	// time window. Tenant-scoped like the HTTP twin (a substrate:tenant caller is
	// confined to its own tenant; admin sees all + an optional tenant focus).
	//
	// Mirrors GET /v1/_usage.
	UsageReport(ctx context.Context, in *UsageReportRequest, opts ...grpc.CallOption) (*UsageReportResponse, error)
	// TokenLimit manages per-scope token budgets (RFC AW): one op-based RPC
	// (op ∈ list|set|delete) mirroring GET/PUT/DELETE /v1/_limits. Tenant-scoped
	// like the HTTP twin — a substrate:tenant caller may only see/set/delete its
	// own tenant's budgets; the operator-global cap + cross-tenant rows are
	// admin-only.
	//
	// Mirrors GET/PUT/DELETE /v1/_limits.
	TokenLimit(ctx context.Context, in *TokenLimitRequest, opts ...grpc.CallOption) (*TokenLimitResponse, error)
	// Health is the liveness probe. Returns build identifier + uptime.
	//
	// Mirrors GET /healthz (which is unauthenticated on the HTTP side;
	// the gRPC equivalent stays unauthenticated for parity).
	Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error)
	// Config returns the instance-configuration report: build identity, the
	// feature matrix, and the live provider/model/search cascade with coarse
	// active/inactive status.
	//
	// Mirrors GET /v1/config at the CALLER's disclosure level. The HTTP side has a
	// third, narrower `public` level reachable with no bearer under
	// LOOMCYCLE_PUBLIC_CONFIG; that level does NOT exist here, because gRPC
	// authenticates before dispatch — so a caller gets `authenticated` or `admin`
	// from its own scopes. `view` in the payload names which.
	Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error)
	// RegisterHook registers a pre- or post-tool webhook. The
	// callback_url must be an http:// or https:// endpoint the consumer
	// runs. Returns the loomcycle-assigned id. Re-registering the same
	// (owner, name) replaces the prior entry in-place (idempotent on
	// app restart).
	//
	// Mirrors POST /v1/hooks.
	RegisterHook(ctx context.Context, in *RegisterHookRequest, opts ...grpc.CallOption) (*RegisterHookResponse, error)
	// ListHooks returns every currently-registered hook. Useful for
	// debug; no pagination — the registry is intentionally small
	// (operator-curated set).
	//
	// Mirrors GET /v1/hooks.
	ListHooks(ctx context.Context, in *ListHooksRequest, opts ...grpc.CallOption) (*ListHooksResponse, error)
	// DeleteHook removes a registered hook by id. Returns
	// codes.NotFound when no hook has that id.
	//
	// Mirrors DELETE /v1/hooks/{id}.
	DeleteHook(ctx context.Context, in *DeleteHookRequest, opts ...grpc.CallOption) (*DeleteHookResponse, error)
	// PauseRuntime quiesces the runtime. Idempotent tools cancel
	// immediately; non-idempotent + external tools get a grace window
	// (default 30 s; max 5 min) then force-cancel. Returns 409-equivalent
	// when the runtime is already pausing or paused.
	//
	// Mirrors POST /v1/_pause.
	PauseRuntime(ctx context.Context, in *PauseRuntimeRequest, opts ...grpc.CallOption) (*PauseRuntimeResponse, error)
	// ResumeRuntime releases the quiesce. Paused runs re-enter their
	// loops. Returns 409-equivalent when the runtime is not paused.
	//
	// Mirrors POST /v1/_resume.
	ResumeRuntime(ctx context.Context, in *ResumeRuntimeRequest, opts ...grpc.CallOption) (*ResumeRuntimeResponse, error)
	// GetRuntimeState returns the current quiesce state for dashboards.
	//
	// Mirrors GET /v1/_state.
	GetRuntimeState(ctx context.Context, in *GetRuntimeStateRequest, opts ...grpc.CallOption) (*RuntimeStateResponse, error)
	// ResolveProbe triggers an immediate, synchronous re-probe of every
	// configured provider and returns the refreshed availability matrix
	// — the operator escape hatch when a transient outage stalls every
	// provider. Unavailable when no resolver / no probe loop is wired.
	//
	// Mirrors POST /v1/_resolve/probe.
	ResolveProbe(ctx context.Context, in *ResolveProbeRequest, opts ...grpc.CallOption) (*ResolverMatrixResponse, error)
	// CreateSnapshot captures running-state into a per-section-semver
	// JSON envelope (agent_defs, agent_def_active, memory, channels,
	// evaluations, paused_runs, optional interaction_history). Returns
	// 413-equivalent when the serialised envelope exceeds the configured
	// cap (LOOMCYCLE_SNAPSHOT_MAX_BYTES; default 512 MiB).
	//
	// Mirrors POST /v1/_snapshots.
	CreateSnapshot(ctx context.Context, in *CreateSnapshotRequest, opts ...grpc.CallOption) (*SnapshotDescriptor, error)
	// ListSnapshots returns metadata for the most-recent snapshots
	// (capped at 200). The JSON envelope itself is not included; use
	// GetSnapshot / ExportSnapshot to fetch.
	//
	// Mirrors GET /v1/_snapshots.
	ListSnapshots(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (*ListSnapshotsResponse, error)
	// GetSnapshot returns the full envelope including JSON content.
	// Distinct from ExportSnapshot, which is operator-facing "where did
	// this land on the host" semantics.
	//
	// Mirrors GET /v1/_snapshots/{id}.
	GetSnapshot(ctx context.Context, in *GetSnapshotRequest, opts ...grpc.CallOption) (*SnapshotEnvelope, error)
	// ExportSnapshot returns canonical envelope bytes (raw_json) for a
	// snapshot id. Transports that stream large exports use raw_json
	// directly; file_path / checksum stay empty unless materialised.
	//
	// Mirrors GET /v1/_snapshots/{id}/export.
	ExportSnapshot(ctx context.Context, in *ExportSnapshotRequest, opts ...grpc.CallOption) (*ExportSnapshotResponse, error)
	// RestoreSnapshot restores from a same-instance snapshot_id OR
	// cross-instance raw_json. Idempotent: ON CONFLICT DO NOTHING per
	// row. Counters in the response reflect rows actually written.
	// Returns 422-equivalent on snapshot version newer than reader
	// supports.
	//
	// Mirrors POST /v1/_snapshots/{id}/restore.
	RestoreSnapshot(ctx context.Context, in *RestoreSnapshotRequest, opts ...grpc.CallOption) (*RestoreSnapshotResponse, error)
	// DeleteSnapshot removes a snapshot. Idempotent — succeeds whether
	// or not the row existed.
	//
	// Mirrors DELETE /v1/_snapshots/{id}.
	DeleteSnapshot(ctx context.Context, in *DeleteSnapshotRequest, opts ...grpc.CallOption) (*DeleteSnapshotResponse, error)
	// AgentDef dispatches to the in-process AgentDef tool. Mirrors
	// POST /v1/_agentdef.
	AgentDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// SkillDef dispatches to the in-process SkillDef tool. Mirrors
	// POST /v1/_skilldef.
	SkillDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// MCPServerDef dispatches to the v0.9.x dynamic MCP server
	// registration substrate. Mirrors POST /v1/_mcpserverdef.
	// Operator-admin-only — same SubstrateRequest body shape as
	// AgentDef + SkillDef (op-discriminated input_json + is_error
	// tool refusals in the response).
	MCPServerDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// ScheduleDef dispatches to the v1.x RFC E scheduled-runs
	// substrate. Mirrors POST /v1/_scheduledef. Operator-admin-only.
	// Same SubstrateRequest body shape — op-discriminated input_json
	// (create / fork / get / list / retire) + is_error tool refusals
	// in the response.
	ScheduleDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// A2AServerCardDef dispatches to the v1.x RFC G A2A-server-card
	// substrate. Mirrors POST /v1/_a2aservercarddef. Operator-admin-only.
	// Same SubstrateRequest body shape — op-discriminated input_json
	// (create / fork / get / list / retire) + is_error tool refusals
	// in the response.
	A2AServerCardDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// A2AAgentDef dispatches to the v1.x RFC G A2A-agent substrate.
	// Mirrors POST /v1/_a2aagentdef. Operator-admin-only. Same
	// SubstrateRequest body shape — op-discriminated input_json
	// (create / fork / get / list / retire) + is_error tool refusals
	// in the response.
	A2AAgentDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// WebhookDef dispatches to the v1.x RFC H inbound-webhook substrate.
	// Mirrors POST /v1/_webhookdef. Operator-admin-only. Same
	// SubstrateRequest body shape — op-discriminated input_json
	// (create / fork / get / list / retire) + is_error tool refusals
	// in the response. (RFC H WH-3 / mirrors A2AAgentDef.)
	WebhookDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// MemoryBackendDef dispatches to the RFC I MR-3a memory-backend
	// substrate. Mirrors POST /v1/_memorybackenddef. Operator-admin-only.
	// Same SubstrateRequest body shape — op-discriminated input_json
	// (create / fork / get / list / retire) + is_error tool refusals
	// in the response. (RFC I MR-3a / mirrors WebhookDef.)
	MemoryBackendDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// OperatorTokenDef dispatches to the RFC L OSS multi-tenant
	// authorization substrate (auth-token minting/rotation/retirement).
	// Mirrors POST /v1/_operatortokendef. Operator-admin-only. Same
	// SubstrateRequest body shape — op-discriminated input_json
	// (create / rotate / retire / get / list).
	OperatorTokenDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// VolumeDef dispatches to the RFC AH dynamic filesystem-volume
	// substrate. Mirrors POST /v1/_volumedef. TENANT-CONFINED (ScopeTenant,
	// like AgentDef/SkillDef — NOT operator-admin-only): the tool stamps the
	// caller's authoritative tenant + opaque-404s cross-tenant reads. A
	// VolumeDef is flat (a pointer to mutable on-disk state, not a versioned
	// definition), so the op set is create / get / list / delete / purge —
	// NOT the content-addressed retire/promote/fork of the families above.
	// Same SubstrateRequest body shape (op-discriminated input_json +
	// is_error tool refusals in the response).
	VolumeDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// TeamDef dispatches to the RFC AP team-workflow substrate. Mirrors
	// POST /v1/_teamdef. TENANT-CONFINED (ScopeTenant, like AgentDef/SkillDef):
	// the tool stamps the caller's authoritative tenant + opaque-404s
	// cross-tenant reads. Op-discriminated input_json (create / fork / get /
	// list / retire / delete / promote / verify / render_diagram / run — a
	// versioned def family; `run` walks the team's state graph, spawning each
	// state's agent under the same admission a run would get). Same
	// SubstrateRequest/Response body shape (is_error carries tool refusals).
	TeamDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// Path dispatches to the RFC AL Unix-like VFS tool. Mirrors POST /v1/_path.
	// TENANT-CONFINED (ScopeTenant): scope (agent/user/tenant) is resolved from
	// the operator-trust ctx + the caller's authoritative tenant, never the
	// wire. Op-discriminated input_json (resolve / ls / stat / mkdir / mv / rm);
	// same SubstrateRequest/Response body shape (is_error carries tool refusals).
	Path(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// Document dispatches to the RFC AK chunked-graph Document tool. Mirrors
	// POST /v1/_document. TENANT-CONFINED (ScopeTenant); requires SQL Memory.
	// Op-discriminated input_json (13 ops: document/chunk lifecycle, edges,
	// query_chunks, type defs); same SubstrateRequest/Response body shape.
	Document(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// History dispatches to the RFC BE History tool (browse/search/annotate
	// past chats; a chat = a session). Mirrors POST /v1/_history. TENANT-CONFINED
	// (ScopeTenant): the owner is resolved from the operator-trust ctx +
	// caller's authoritative tenant, NEVER the wire — a scope:"user" op keys on
	// the principal's own subject, scope:"tenant" on its tenant; the cross-tenant
	// scope:"global" is admin-only. Op-discriminated input_json (list / get /
	// search / rename / annotate / pin / archive / recap / resume); same
	// SubstrateRequest/Response body shape (is_error carries tool refusals).
	History(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error)
	// ----- v0.9.x n8n RFC Phase 0 -----
	//
	// ListChannels mirrors GET /v1/_channels — operator-declared
	// channels joined with runtime stats.
	ListChannels(ctx context.Context, in *ListChannelsRequest, opts ...grpc.CallOption) (*ListChannelsResponse, error)
	// StreamUserRunStates mirrors GET /v1/users/{user_id}/agents/stream.
	// Server-streams one RunStateEvent per matching state transition
	// until ctx cancels or the client closes the stream.
	StreamUserRunStates(ctx context.Context, in *StreamUserRunStatesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RunStateEvent], error)
	// ----- v0.9.x Channel CRUD (admin + per-user) -----
	//
	// Mirrors the four HTTP routes:
	//
	//	PublishChannel   → POST /v1/_channels/{name}/publish (and the
	//	                    /v1/users/{user_id}/channels/... variant)
	//	SubscribeChannel → POST /v1/_channels/{name}/subscribe (single-
	//	                    round-trip long-poll; not streaming)
	//	PeekChannel      → GET  /v1/_channels/{name}/peek (non-destructive)
	//	AckChannel       → POST /v1/_channels/{name}/ack
	//
	// Scope + scope_id select the cursor namespace: scope="global" with
	// empty scope_id addresses the admin surface; scope="user" with a
	// non-empty scope_id addresses a per-end-user channel.
	PublishChannel(ctx context.Context, in *PublishChannelRequest, opts ...grpc.CallOption) (*PublishChannelResponse, error)
	SubscribeChannel(ctx context.Context, in *SubscribeChannelRequest, opts ...grpc.CallOption) (*SubscribeChannelResponse, error)
	PeekChannel(ctx context.Context, in *PeekChannelRequest, opts ...grpc.CallOption) (*PeekChannelResponse, error)
	AckChannel(ctx context.Context, in *AckChannelRequest, opts ...grpc.CallOption) (*AckChannelResponse, error)
	// RFC S client twins (mirror POST /v1/_channels/_await and
	// /v1/_channels/_broadcast). AwaitChannels fans IN across a set of
	// channels (any/all/at_least N, or a timeout — a timeout is
	// satisfied=false / timed_out=true, NOT an error); BroadcastChannels
	// fans OUT one payload to a set of channels (atomic at the declare
	// pre-flight). Scope + scope_id apply to every channel in the set.
	AwaitChannels(ctx context.Context, in *AwaitChannelsRequest, opts ...grpc.CallOption) (*AwaitChannelsResponse, error)
	BroadcastChannels(ctx context.Context, in *BroadcastChannelsRequest, opts ...grpc.CallOption) (*BroadcastChannelsResponse, error)
}

type loomcycleClient struct {
	cc grpc.ClientConnInterface
}

func NewLoomcycleClient(cc grpc.ClientConnInterface) LoomcycleClient {
	return &loomcycleClient{cc}
}

func (c *loomcycleClient) Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Loomcycle_ServiceDesc.Streams[0], Loomcycle_Run_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[RunRequest, Event]{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Loomcycle_RunClient = grpc.ServerStreamingClient[Event]

func (c *loomcycleClient) Continue(ctx context.Context, in *ContinueRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Loomcycle_ServiceDesc.Streams[1], Loomcycle_Continue_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[ContinueRequest, Event]{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Loomcycle_ContinueClient = grpc.ServerStreamingClient[Event]

func (c *loomcycleClient) SpawnRunBatch(ctx context.Context, in *BatchSpawnRequest, opts ...grpc.CallOption) (*BatchSpawnResult, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(BatchSpawnResult)
	err := c.cc.Invoke(ctx, Loomcycle_SpawnRunBatch_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) CompactRun(ctx context.Context, in *CompactRunRequest, opts ...grpc.CallOption) (*CompactRunResult, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CompactRunResult)
	err := c.cc.Invoke(ctx, Loomcycle_CompactRun_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) DirectoryUsers(ctx context.Context, in *DirectoryUsersRequest, opts ...grpc.CallOption) (*DirectoryUsersResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(DirectoryUsersResponse)
	err := c.cc.Invoke(ctx, Loomcycle_DirectoryUsers_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) DirectoryInspect(ctx context.Context, in *DirectoryInspectRequest, opts ...grpc.CallOption) (*DirectoryInspectResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(DirectoryInspectResponse)
	err := c.cc.Invoke(ctx, Loomcycle_DirectoryInspect_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) DirectoryTenants(ctx context.Context, in *DirectoryTenantsRequest, opts ...grpc.CallOption) (*DirectoryTenantsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(DirectoryTenantsResponse)
	err := c.cc.Invoke(ctx, Loomcycle_DirectoryTenants_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ErasureReport(ctx context.Context, in *ErasureReportRequest, opts ...grpc.CallOption) (*ErasureReportResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ErasureReportResponse)
	err := c.cc.Invoke(ctx, Loomcycle_ErasureReport_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ErasureExecute(ctx context.Context, in *ErasureExecuteRequest, opts ...grpc.CallOption) (*ErasureExecuteResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ErasureExecuteResponse)
	err := c.cc.Invoke(ctx, Loomcycle_ErasureExecute_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ReplaySession(ctx context.Context, in *ReplaySessionRequest, opts ...grpc.CallOption) (*ReplaySessionResult, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ReplaySessionResult)
	err := c.cc.Invoke(ctx, Loomcycle_ReplaySession_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) RunInput(ctx context.Context, in *RunInputRequest, opts ...grpc.CallOption) (*RunInputResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RunInputResponse)
	err := c.cc.Invoke(ctx, Loomcycle_RunInput_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) CancelTurn(ctx context.Context, in *CancelTurnRequest, opts ...grpc.CallOption) (*CancelTurnResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CancelTurnResponse)
	err := c.cc.Invoke(ctx, Loomcycle_CancelTurn_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ResolveInterrupt(ctx context.Context, in *ResolveInterruptRequest, opts ...grpc.CallOption) (*ResolveInterruptResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ResolveInterruptResponse)
	err := c.cc.Invoke(ctx, Loomcycle_ResolveInterrupt_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) StreamRun(ctx context.Context, in *StreamRunRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Event], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Loomcycle_ServiceDesc.Streams[2], Loomcycle_StreamRun_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[StreamRunRequest, Event]{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Loomcycle_StreamRunClient = grpc.ServerStreamingClient[Event]

func (c *loomcycleClient) GetTranscript(ctx context.Context, in *GetTranscriptRequest, opts ...grpc.CallOption) (*Transcript, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Transcript)
	err := c.cc.Invoke(ctx, Loomcycle_GetTranscript_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) GetAgent(ctx context.Context, in *GetAgentRequest, opts ...grpc.CallOption) (*Agent, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Agent)
	err := c.cc.Invoke(ctx, Loomcycle_GetAgent_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) CancelAgent(ctx context.Context, in *CancelAgentRequest, opts ...grpc.CallOption) (*CancelAgentResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CancelAgentResponse)
	err := c.cc.Invoke(ctx, Loomcycle_CancelAgent_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ListUserAgents(ctx context.Context, in *ListUserAgentsRequest, opts ...grpc.CallOption) (*ListUserAgentsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListUserAgentsResponse)
	err := c.cc.Invoke(ctx, Loomcycle_ListUserAgents_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) UsageReport(ctx context.Context, in *UsageReportRequest, opts ...grpc.CallOption) (*UsageReportResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(UsageReportResponse)
	err := c.cc.Invoke(ctx, Loomcycle_UsageReport_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) TokenLimit(ctx context.Context, in *TokenLimitRequest, opts ...grpc.CallOption) (*TokenLimitResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(TokenLimitResponse)
	err := c.cc.Invoke(ctx, Loomcycle_TokenLimit_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(HealthResponse)
	err := c.cc.Invoke(ctx, Loomcycle_Health_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ConfigResponse)
	err := c.cc.Invoke(ctx, Loomcycle_Config_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) RegisterHook(ctx context.Context, in *RegisterHookRequest, opts ...grpc.CallOption) (*RegisterHookResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RegisterHookResponse)
	err := c.cc.Invoke(ctx, Loomcycle_RegisterHook_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ListHooks(ctx context.Context, in *ListHooksRequest, opts ...grpc.CallOption) (*ListHooksResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListHooksResponse)
	err := c.cc.Invoke(ctx, Loomcycle_ListHooks_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) DeleteHook(ctx context.Context, in *DeleteHookRequest, opts ...grpc.CallOption) (*DeleteHookResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(DeleteHookResponse)
	err := c.cc.Invoke(ctx, Loomcycle_DeleteHook_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) PauseRuntime(ctx context.Context, in *PauseRuntimeRequest, opts ...grpc.CallOption) (*PauseRuntimeResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PauseRuntimeResponse)
	err := c.cc.Invoke(ctx, Loomcycle_PauseRuntime_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ResumeRuntime(ctx context.Context, in *ResumeRuntimeRequest, opts ...grpc.CallOption) (*ResumeRuntimeResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ResumeRuntimeResponse)
	err := c.cc.Invoke(ctx, Loomcycle_ResumeRuntime_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) GetRuntimeState(ctx context.Context, in *GetRuntimeStateRequest, opts ...grpc.CallOption) (*RuntimeStateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RuntimeStateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_GetRuntimeState_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ResolveProbe(ctx context.Context, in *ResolveProbeRequest, opts ...grpc.CallOption) (*ResolverMatrixResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ResolverMatrixResponse)
	err := c.cc.Invoke(ctx, Loomcycle_ResolveProbe_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) CreateSnapshot(ctx context.Context, in *CreateSnapshotRequest, opts ...grpc.CallOption) (*SnapshotDescriptor, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SnapshotDescriptor)
	err := c.cc.Invoke(ctx, Loomcycle_CreateSnapshot_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ListSnapshots(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (*ListSnapshotsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListSnapshotsResponse)
	err := c.cc.Invoke(ctx, Loomcycle_ListSnapshots_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) GetSnapshot(ctx context.Context, in *GetSnapshotRequest, opts ...grpc.CallOption) (*SnapshotEnvelope, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SnapshotEnvelope)
	err := c.cc.Invoke(ctx, Loomcycle_GetSnapshot_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ExportSnapshot(ctx context.Context, in *ExportSnapshotRequest, opts ...grpc.CallOption) (*ExportSnapshotResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ExportSnapshotResponse)
	err := c.cc.Invoke(ctx, Loomcycle_ExportSnapshot_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) RestoreSnapshot(ctx context.Context, in *RestoreSnapshotRequest, opts ...grpc.CallOption) (*RestoreSnapshotResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RestoreSnapshotResponse)
	err := c.cc.Invoke(ctx, Loomcycle_RestoreSnapshot_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) DeleteSnapshot(ctx context.Context, in *DeleteSnapshotRequest, opts ...grpc.CallOption) (*DeleteSnapshotResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(DeleteSnapshotResponse)
	err := c.cc.Invoke(ctx, Loomcycle_DeleteSnapshot_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) AgentDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_AgentDef_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) SkillDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_SkillDef_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) MCPServerDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_MCPServerDef_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ScheduleDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_ScheduleDef_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) A2AServerCardDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_A2AServerCardDef_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) A2AAgentDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_A2AAgentDef_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) WebhookDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_WebhookDef_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) MemoryBackendDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_MemoryBackendDef_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) OperatorTokenDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_OperatorTokenDef_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) VolumeDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_VolumeDef_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) TeamDef(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_TeamDef_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) Path(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_Path_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) Document(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_Document_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) History(ctx context.Context, in *SubstrateRequest, opts ...grpc.CallOption) (*SubstrateResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubstrateResponse)
	err := c.cc.Invoke(ctx, Loomcycle_History_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) ListChannels(ctx context.Context, in *ListChannelsRequest, opts ...grpc.CallOption) (*ListChannelsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListChannelsResponse)
	err := c.cc.Invoke(ctx, Loomcycle_ListChannels_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) StreamUserRunStates(ctx context.Context, in *StreamUserRunStatesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RunStateEvent], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &Loomcycle_ServiceDesc.Streams[3], Loomcycle_StreamUserRunStates_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[StreamUserRunStatesRequest, RunStateEvent]{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Loomcycle_StreamUserRunStatesClient = grpc.ServerStreamingClient[RunStateEvent]

func (c *loomcycleClient) PublishChannel(ctx context.Context, in *PublishChannelRequest, opts ...grpc.CallOption) (*PublishChannelResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PublishChannelResponse)
	err := c.cc.Invoke(ctx, Loomcycle_PublishChannel_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) SubscribeChannel(ctx context.Context, in *SubscribeChannelRequest, opts ...grpc.CallOption) (*SubscribeChannelResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubscribeChannelResponse)
	err := c.cc.Invoke(ctx, Loomcycle_SubscribeChannel_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) PeekChannel(ctx context.Context, in *PeekChannelRequest, opts ...grpc.CallOption) (*PeekChannelResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PeekChannelResponse)
	err := c.cc.Invoke(ctx, Loomcycle_PeekChannel_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) AckChannel(ctx context.Context, in *AckChannelRequest, opts ...grpc.CallOption) (*AckChannelResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AckChannelResponse)
	err := c.cc.Invoke(ctx, Loomcycle_AckChannel_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) AwaitChannels(ctx context.Context, in *AwaitChannelsRequest, opts ...grpc.CallOption) (*AwaitChannelsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AwaitChannelsResponse)
	err := c.cc.Invoke(ctx, Loomcycle_AwaitChannels_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *loomcycleClient) BroadcastChannels(ctx context.Context, in *BroadcastChannelsRequest, opts ...grpc.CallOption) (*BroadcastChannelsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(BroadcastChannelsResponse)
	err := c.cc.Invoke(ctx, Loomcycle_BroadcastChannels_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// LoomcycleServer is the server API for Loomcycle service.
// All implementations must embed UnimplementedLoomcycleServer
// for forward compatibility.
type LoomcycleServer interface {
	// Run starts a fresh agent run and server-streams its events. One
	// request → many Event responses. The stream terminates on EOF when
	// the loop reaches its terminal state (done, failed, or cancelled).
	//
	// Mirrors POST /v1/runs.
	Run(*RunRequest, grpc.ServerStreamingServer[Event]) error
	// Continue extends an existing session with a new run. The session's
	// prior transcript is replayed into the loop's context; the response
	// stream covers only the NEW events from this continuation.
	//
	// Mirrors POST /v1/sessions/{id}/messages.
	Continue(*ContinueRequest, grpc.ServerStreamingServer[Event]) error
	// SpawnRunBatch spawns N fresh runs concurrently in one call (RFC Y
	// external fan-out, mode "join"), bounded by the per-user admission
	// gate, returning a combined index-aligned envelope once all settle. A
	// per-child failure is captured in that child's result and never fails
	// the batch. mode "detach" (async run handles) is reserved for a future
	// release and rejected today.
	//
	// Mirrors POST /v1/runs:batch + the spawn_runs MCP tool.
	SpawnRunBatch(context.Context, *BatchSpawnRequest) (*BatchSpawnResult, error)
	// CompactRun summarizes a run's conversation to free context and
	// continue from the summary. A live run must be PARKED (awaiting input);
	// a mid-turn run returns FailedPrecondition. Keyed by run_id.
	//
	// Mirrors POST /v1/runs/{run_id}/compact + the compact_run MCP tool.
	CompactRun(context.Context, *CompactRunRequest) (*CompactRunResult, error)
	// ErasureReport enumerates what this deployment holds about one subject, in
	// three tiers separated by what they guarantee. Read-only.
	//
	// The tenant is taken from the caller's credentials and is NOT a field: a
	// subject id is only unique within one tenant, so a wire tenant would let a
	// caller enumerate another tenant's subject.
	// DirectoryUsers lists the subjects with activity in the caller's tenant, and
	// DirectoryInspect aggregates one subject's activity, chats, memory, documents,
	// budget and usage in a single call. READ-ONLY and derived — a "user" is a
	// GROUP BY over runs.user_id, not a stored row, so there is no create or update
	// here; removing a subject's footprint is ErasureExecute.
	//
	// No tenant field on either, deliberately: a subject id is only unique within
	// one tenant, so accepting one would let a caller inspect somebody else's.
	DirectoryUsers(context.Context, *DirectoryUsersRequest) (*DirectoryUsersResponse, error)
	DirectoryInspect(context.Context, *DirectoryInspectRequest) (*DirectoryInspectResponse, error)
	// DirectoryTenants enumerates tenants with derived counts. ADMIN ONLY: the
	// counts are unremarkable, but the LIST is cross-tenant information a confined
	// principal must not learn — so a non-admin is REFUSED rather than given a
	// filtered list, which would still confirm its own tenant's existence.
	DirectoryTenants(context.Context, *DirectoryTenantsRequest) (*DirectoryTenantsResponse, error)
	ErasureReport(context.Context, *ErasureReportRequest) (*ErasureReportResponse, error)
	// ErasureExecute removes tiers 1 and 2 and reports what it could not reach.
	// DEFAULTS TO A DRY RUN: dry_run is `optional` so an unset field means true,
	// matching HTTP — a client that forgets it deletes nothing.
	ErasureExecute(context.Context, *ErasureExecuteRequest) (*ErasureExecuteResponse, error)
	// ReplaySession copies a source session's transcript into a new session bound
	// to a (possibly different) target agent (RFC BJ Phase 4). Mirrors
	// POST /v1/sessions/{id}/replay.
	ReplaySession(context.Context, *ReplaySessionRequest) (*ReplaySessionResult, error)
	// RunInput pushes an operator steering message into a LIVE interactive
	// run (one parked at end_turn awaiting input, or mid-turn — the message
	// is drained at the next iteration boundary). delivered=false +
	// NotFound when no in-flight run holds run_id; ResourceExhausted when
	// the run's steer queue is full. The injected `source` is server-stamped
	// (never wire-trusted). Cross-replica routing is inherited from the
	// steer registry. Mirrors POST /v1/runs/{run_id}/input. (RFC AI)
	RunInput(context.Context, *RunInputRequest) (*RunInputResponse, error)
	// CancelTurn stops the CURRENT turn of a LIVE interactive run (its in-flight
	// model generation + the tool calls it started) and parks it at
	// awaiting_input — session + transcript intact. This is NOT whole-run cancel
	// (CancelAgent), which terminates the run. FailedPrecondition when the run
	// isn't mid-turn (not_mid_turn) or isn't interactive (not_interactive);
	// NotFound (opaque) for an unknown / cross-tenant / not-reachable run.
	// Owner-routed cross-replica by runs.replica_id.
	//
	// Mirrors POST /v1/runs/{run_id}/cancel. (RFC BH)
	CancelTurn(context.Context, *CancelTurnRequest) (*CancelTurnResponse, error)
	// ResolveInterrupt resolves a pending interruption — either an answer
	// (disposition "" / "answer", validated against the declared options) or a
	// decline (disposition "declined": no answer, skips option validation) so the
	// waiting Question tool proceeds. InvalidArgument on a bad kind / disposition
	// / answer; NotFound (opaque) for an unknown / cross-tenant interrupt;
	// FailedPrecondition when already terminal or expired.
	//
	// Mirrors POST /v1/runs/{run_id}/interrupts/{interrupt_id}/resolve. (RFC BH)
	ResolveInterrupt(context.Context, *ResolveInterruptRequest) (*ResolveInterruptResponse, error)
	// StreamRun re-attaches to a run's event stream by run_id, replaying
	// from from_seq and then live-tailing — the gRPC twin of
	// GET /v1/runs/{run_id}/stream. For a PARKED interactive run (non-
	// terminal) the stream stays open until the run ends or ctx fires; a
	// disconnect does NOT stop the run. The first frame is a synthetic
	// type="agent" Event carrying run metadata. (RFC AI)
	StreamRun(*StreamRunRequest, grpc.ServerStreamingServer[Event]) error
	// GetTranscript returns the full event history for a session,
	// ordered by seq. Used by adapters that re-attach to a previously
	// started session (e.g. cross-tab sync).
	//
	// Mirrors GET /v1/sessions/{id}/transcript.
	GetTranscript(context.Context, *GetTranscriptRequest) (*Transcript, error)
	// GetAgent returns one agent's current status + usage stats. Used
	// by adapters polling for completion when the SSE/gRPC stream was
	// interrupted (browser tab closed, network blip).
	//
	// Mirrors GET /v1/agents/{agent_id}.
	GetAgent(context.Context, *GetAgentRequest) (*Agent, error)
	// CancelAgent sets the agent's terminal status to "cancelled" and
	// cascades the cancellation to every child via parent_agent_id.
	//
	// Mirrors POST /v1/agents/{agent_id}/cancel.
	CancelAgent(context.Context, *CancelAgentRequest) (*CancelAgentResponse, error)
	// ListUserAgents enumerates a user's recent agent runs, optionally
	// filtered by status.
	//
	// Mirrors GET /v1/users/{user_id}/agents.
	ListUserAgents(context.Context, *ListUserAgentsRequest) (*ListUserAgentsResponse, error)
	// UsageReport aggregates the token-usage + cost ledger (RFC AV): summed
	// tokens + cost grouped by the requested dimensions over an optional tenant +
	// time window. Tenant-scoped like the HTTP twin (a substrate:tenant caller is
	// confined to its own tenant; admin sees all + an optional tenant focus).
	//
	// Mirrors GET /v1/_usage.
	UsageReport(context.Context, *UsageReportRequest) (*UsageReportResponse, error)
	// TokenLimit manages per-scope token budgets (RFC AW): one op-based RPC
	// (op ∈ list|set|delete) mirroring GET/PUT/DELETE /v1/_limits. Tenant-scoped
	// like the HTTP twin — a substrate:tenant caller may only see/set/delete its
	// own tenant's budgets; the operator-global cap + cross-tenant rows are
	// admin-only.
	//
	// Mirrors GET/PUT/DELETE /v1/_limits.
	TokenLimit(context.Context, *TokenLimitRequest) (*TokenLimitResponse, error)
	// Health is the liveness probe. Returns build identifier + uptime.
	//
	// Mirrors GET /healthz (which is unauthenticated on the HTTP side;
	// the gRPC equivalent stays unauthenticated for parity).
	Health(context.Context, *HealthRequest) (*HealthResponse, error)
	// Config returns the instance-configuration report: build identity, the
	// feature matrix, and the live provider/model/search cascade with coarse
	// active/inactive status.
	//
	// Mirrors GET /v1/config at the CALLER's disclosure level. The HTTP side has a
	// third, narrower `public` level reachable with no bearer under
	// LOOMCYCLE_PUBLIC_CONFIG; that level does NOT exist here, because gRPC
	// authenticates before dispatch — so a caller gets `authenticated` or `admin`
	// from its own scopes. `view` in the payload names which.
	Config(context.Context, *ConfigRequest) (*ConfigResponse, error)
	// RegisterHook registers a pre- or post-tool webhook. The
	// callback_url must be an http:// or https:// endpoint the consumer
	// runs. Returns the loomcycle-assigned id. Re-registering the same
	// (owner, name) replaces the prior entry in-place (idempotent on
	// app restart).
	//
	// Mirrors POST /v1/hooks.
	RegisterHook(context.Context, *RegisterHookRequest) (*RegisterHookResponse, error)
	// ListHooks returns every currently-registered hook. Useful for
	// debug; no pagination — the registry is intentionally small
	// (operator-curated set).
	//
	// Mirrors GET /v1/hooks.
	ListHooks(context.Context, *ListHooksRequest) (*ListHooksResponse, error)
	// DeleteHook removes a registered hook by id. Returns
	// codes.NotFound when no hook has that id.
	//
	// Mirrors DELETE /v1/hooks/{id}.
	DeleteHook(context.Context, *DeleteHookRequest) (*DeleteHookResponse, error)
	// PauseRuntime quiesces the runtime. Idempotent tools cancel
	// immediately; non-idempotent + external tools get a grace window
	// (default 30 s; max 5 min) then force-cancel. Returns 409-equivalent
	// when the runtime is already pausing or paused.
	//
	// Mirrors POST /v1/_pause.
	PauseRuntime(context.Context, *PauseRuntimeRequest) (*PauseRuntimeResponse, error)
	// ResumeRuntime releases the quiesce. Paused runs re-enter their
	// loops. Returns 409-equivalent when the runtime is not paused.
	//
	// Mirrors POST /v1/_resume.
	ResumeRuntime(context.Context, *ResumeRuntimeRequest) (*ResumeRuntimeResponse, error)
	// GetRuntimeState returns the current quiesce state for dashboards.
	//
	// Mirrors GET /v1/_state.
	GetRuntimeState(context.Context, *GetRuntimeStateRequest) (*RuntimeStateResponse, error)
	// ResolveProbe triggers an immediate, synchronous re-probe of every
	// configured provider and returns the refreshed availability matrix
	// — the operator escape hatch when a transient outage stalls every
	// provider. Unavailable when no resolver / no probe loop is wired.
	//
	// Mirrors POST /v1/_resolve/probe.
	ResolveProbe(context.Context, *ResolveProbeRequest) (*ResolverMatrixResponse, error)
	// CreateSnapshot captures running-state into a per-section-semver
	// JSON envelope (agent_defs, agent_def_active, memory, channels,
	// evaluations, paused_runs, optional interaction_history). Returns
	// 413-equivalent when the serialised envelope exceeds the configured
	// cap (LOOMCYCLE_SNAPSHOT_MAX_BYTES; default 512 MiB).
	//
	// Mirrors POST /v1/_snapshots.
	CreateSnapshot(context.Context, *CreateSnapshotRequest) (*SnapshotDescriptor, error)
	// ListSnapshots returns metadata for the most-recent snapshots
	// (capped at 200). The JSON envelope itself is not included; use
	// GetSnapshot / ExportSnapshot to fetch.
	//
	// Mirrors GET /v1/_snapshots.
	ListSnapshots(context.Context, *ListSnapshotsRequest) (*ListSnapshotsResponse, error)
	// GetSnapshot returns the full envelope including JSON content.
	// Distinct from ExportSnapshot, which is operator-facing "where did
	// this land on the host" semantics.
	//
	// Mirrors GET /v1/_snapshots/{id}.
	GetSnapshot(context.Context, *GetSnapshotRequest) (*SnapshotEnvelope, error)
	// ExportSnapshot returns canonical envelope bytes (raw_json) for a
	// snapshot id. Transports that stream large exports use raw_json
	// directly; file_path / checksum stay empty unless materialised.
	//
	// Mirrors GET /v1/_snapshots/{id}/export.
	ExportSnapshot(context.Context, *ExportSnapshotRequest) (*ExportSnapshotResponse, error)
	// RestoreSnapshot restores from a same-instance snapshot_id OR
	// cross-instance raw_json. Idempotent: ON CONFLICT DO NOTHING per
	// row. Counters in the response reflect rows actually written.
	// Returns 422-equivalent on snapshot version newer than reader
	// supports.
	//
	// Mirrors POST /v1/_snapshots/{id}/restore.
	RestoreSnapshot(context.Context, *RestoreSnapshotRequest) (*RestoreSnapshotResponse, error)
	// DeleteSnapshot removes a snapshot. Idempotent — succeeds whether
	// or not the row existed.
	//
	// Mirrors DELETE /v1/_snapshots/{id}.
	DeleteSnapshot(context.Context, *DeleteSnapshotRequest) (*DeleteSnapshotResponse, error)
	// AgentDef dispatches to the in-process AgentDef tool. Mirrors
	// POST /v1/_agentdef.
	AgentDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// SkillDef dispatches to the in-process SkillDef tool. Mirrors
	// POST /v1/_skilldef.
	SkillDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// MCPServerDef dispatches to the v0.9.x dynamic MCP server
	// registration substrate. Mirrors POST /v1/_mcpserverdef.
	// Operator-admin-only — same SubstrateRequest body shape as
	// AgentDef + SkillDef (op-discriminated input_json + is_error
	// tool refusals in the response).
	MCPServerDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// ScheduleDef dispatches to the v1.x RFC E scheduled-runs
	// substrate. Mirrors POST /v1/_scheduledef. Operator-admin-only.
	// Same SubstrateRequest body shape — op-discriminated input_json
	// (create / fork / get / list / retire) + is_error tool refusals
	// in the response.
	ScheduleDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// A2AServerCardDef dispatches to the v1.x RFC G A2A-server-card
	// substrate. Mirrors POST /v1/_a2aservercarddef. Operator-admin-only.
	// Same SubstrateRequest body shape — op-discriminated input_json
	// (create / fork / get / list / retire) + is_error tool refusals
	// in the response.
	A2AServerCardDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// A2AAgentDef dispatches to the v1.x RFC G A2A-agent substrate.
	// Mirrors POST /v1/_a2aagentdef. Operator-admin-only. Same
	// SubstrateRequest body shape — op-discriminated input_json
	// (create / fork / get / list / retire) + is_error tool refusals
	// in the response.
	A2AAgentDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// WebhookDef dispatches to the v1.x RFC H inbound-webhook substrate.
	// Mirrors POST /v1/_webhookdef. Operator-admin-only. Same
	// SubstrateRequest body shape — op-discriminated input_json
	// (create / fork / get / list / retire) + is_error tool refusals
	// in the response. (RFC H WH-3 / mirrors A2AAgentDef.)
	WebhookDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// MemoryBackendDef dispatches to the RFC I MR-3a memory-backend
	// substrate. Mirrors POST /v1/_memorybackenddef. Operator-admin-only.
	// Same SubstrateRequest body shape — op-discriminated input_json
	// (create / fork / get / list / retire) + is_error tool refusals
	// in the response. (RFC I MR-3a / mirrors WebhookDef.)
	MemoryBackendDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// OperatorTokenDef dispatches to the RFC L OSS multi-tenant
	// authorization substrate (auth-token minting/rotation/retirement).
	// Mirrors POST /v1/_operatortokendef. Operator-admin-only. Same
	// SubstrateRequest body shape — op-discriminated input_json
	// (create / rotate / retire / get / list).
	OperatorTokenDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// VolumeDef dispatches to the RFC AH dynamic filesystem-volume
	// substrate. Mirrors POST /v1/_volumedef. TENANT-CONFINED (ScopeTenant,
	// like AgentDef/SkillDef — NOT operator-admin-only): the tool stamps the
	// caller's authoritative tenant + opaque-404s cross-tenant reads. A
	// VolumeDef is flat (a pointer to mutable on-disk state, not a versioned
	// definition), so the op set is create / get / list / delete / purge —
	// NOT the content-addressed retire/promote/fork of the families above.
	// Same SubstrateRequest body shape (op-discriminated input_json +
	// is_error tool refusals in the response).
	VolumeDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// TeamDef dispatches to the RFC AP team-workflow substrate. Mirrors
	// POST /v1/_teamdef. TENANT-CONFINED (ScopeTenant, like AgentDef/SkillDef):
	// the tool stamps the caller's authoritative tenant + opaque-404s
	// cross-tenant reads. Op-discriminated input_json (create / fork / get /
	// list / retire / delete / promote / verify / render_diagram / run — a
	// versioned def family; `run` walks the team's state graph, spawning each
	// state's agent under the same admission a run would get). Same
	// SubstrateRequest/Response body shape (is_error carries tool refusals).
	TeamDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// Path dispatches to the RFC AL Unix-like VFS tool. Mirrors POST /v1/_path.
	// TENANT-CONFINED (ScopeTenant): scope (agent/user/tenant) is resolved from
	// the operator-trust ctx + the caller's authoritative tenant, never the
	// wire. Op-discriminated input_json (resolve / ls / stat / mkdir / mv / rm);
	// same SubstrateRequest/Response body shape (is_error carries tool refusals).
	Path(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// Document dispatches to the RFC AK chunked-graph Document tool. Mirrors
	// POST /v1/_document. TENANT-CONFINED (ScopeTenant); requires SQL Memory.
	// Op-discriminated input_json (13 ops: document/chunk lifecycle, edges,
	// query_chunks, type defs); same SubstrateRequest/Response body shape.
	Document(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// History dispatches to the RFC BE History tool (browse/search/annotate
	// past chats; a chat = a session). Mirrors POST /v1/_history. TENANT-CONFINED
	// (ScopeTenant): the owner is resolved from the operator-trust ctx +
	// caller's authoritative tenant, NEVER the wire — a scope:"user" op keys on
	// the principal's own subject, scope:"tenant" on its tenant; the cross-tenant
	// scope:"global" is admin-only. Op-discriminated input_json (list / get /
	// search / rename / annotate / pin / archive / recap / resume); same
	// SubstrateRequest/Response body shape (is_error carries tool refusals).
	History(context.Context, *SubstrateRequest) (*SubstrateResponse, error)
	// ----- v0.9.x n8n RFC Phase 0 -----
	//
	// ListChannels mirrors GET /v1/_channels — operator-declared
	// channels joined with runtime stats.
	ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error)
	// StreamUserRunStates mirrors GET /v1/users/{user_id}/agents/stream.
	// Server-streams one RunStateEvent per matching state transition
	// until ctx cancels or the client closes the stream.
	StreamUserRunStates(*StreamUserRunStatesRequest, grpc.ServerStreamingServer[RunStateEvent]) error
	// ----- v0.9.x Channel CRUD (admin + per-user) -----
	//
	// Mirrors the four HTTP routes:
	//
	//	PublishChannel   → POST /v1/_channels/{name}/publish (and the
	//	                    /v1/users/{user_id}/channels/... variant)
	//	SubscribeChannel → POST /v1/_channels/{name}/subscribe (single-
	//	                    round-trip long-poll; not streaming)
	//	PeekChannel      → GET  /v1/_channels/{name}/peek (non-destructive)
	//	AckChannel       → POST /v1/_channels/{name}/ack
	//
	// Scope + scope_id select the cursor namespace: scope="global" with
	// empty scope_id addresses the admin surface; scope="user" with a
	// non-empty scope_id addresses a per-end-user channel.
	PublishChannel(context.Context, *PublishChannelRequest) (*PublishChannelResponse, error)
	SubscribeChannel(context.Context, *SubscribeChannelRequest) (*SubscribeChannelResponse, error)
	PeekChannel(context.Context, *PeekChannelRequest) (*PeekChannelResponse, error)
	AckChannel(context.Context, *AckChannelRequest) (*AckChannelResponse, error)
	// RFC S client twins (mirror POST /v1/_channels/_await and
	// /v1/_channels/_broadcast). AwaitChannels fans IN across a set of
	// channels (any/all/at_least N, or a timeout — a timeout is
	// satisfied=false / timed_out=true, NOT an error); BroadcastChannels
	// fans OUT one payload to a set of channels (atomic at the declare
	// pre-flight). Scope + scope_id apply to every channel in the set.
	AwaitChannels(context.Context, *AwaitChannelsRequest) (*AwaitChannelsResponse, error)
	BroadcastChannels(context.Context, *BroadcastChannelsRequest) (*BroadcastChannelsResponse, error)
	mustEmbedUnimplementedLoomcycleServer()
}

// UnimplementedLoomcycleServer 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 UnimplementedLoomcycleServer struct{}

func (UnimplementedLoomcycleServer) Run(*RunRequest, grpc.ServerStreamingServer[Event]) error {
	return status.Error(codes.Unimplemented, "method Run not implemented")
}
func (UnimplementedLoomcycleServer) Continue(*ContinueRequest, grpc.ServerStreamingServer[Event]) error {
	return status.Error(codes.Unimplemented, "method Continue not implemented")
}
func (UnimplementedLoomcycleServer) SpawnRunBatch(context.Context, *BatchSpawnRequest) (*BatchSpawnResult, error) {
	return nil, status.Error(codes.Unimplemented, "method SpawnRunBatch not implemented")
}
func (UnimplementedLoomcycleServer) CompactRun(context.Context, *CompactRunRequest) (*CompactRunResult, error) {
	return nil, status.Error(codes.Unimplemented, "method CompactRun not implemented")
}
func (UnimplementedLoomcycleServer) DirectoryUsers(context.Context, *DirectoryUsersRequest) (*DirectoryUsersResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method DirectoryUsers not implemented")
}
func (UnimplementedLoomcycleServer) DirectoryInspect(context.Context, *DirectoryInspectRequest) (*DirectoryInspectResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method DirectoryInspect not implemented")
}
func (UnimplementedLoomcycleServer) DirectoryTenants(context.Context, *DirectoryTenantsRequest) (*DirectoryTenantsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method DirectoryTenants not implemented")
}
func (UnimplementedLoomcycleServer) ErasureReport(context.Context, *ErasureReportRequest) (*ErasureReportResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ErasureReport not implemented")
}
func (UnimplementedLoomcycleServer) ErasureExecute(context.Context, *ErasureExecuteRequest) (*ErasureExecuteResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ErasureExecute not implemented")
}
func (UnimplementedLoomcycleServer) ReplaySession(context.Context, *ReplaySessionRequest) (*ReplaySessionResult, error) {
	return nil, status.Error(codes.Unimplemented, "method ReplaySession not implemented")
}
func (UnimplementedLoomcycleServer) RunInput(context.Context, *RunInputRequest) (*RunInputResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method RunInput not implemented")
}
func (UnimplementedLoomcycleServer) CancelTurn(context.Context, *CancelTurnRequest) (*CancelTurnResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method CancelTurn not implemented")
}
func (UnimplementedLoomcycleServer) ResolveInterrupt(context.Context, *ResolveInterruptRequest) (*ResolveInterruptResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ResolveInterrupt not implemented")
}
func (UnimplementedLoomcycleServer) StreamRun(*StreamRunRequest, grpc.ServerStreamingServer[Event]) error {
	return status.Error(codes.Unimplemented, "method StreamRun not implemented")
}
func (UnimplementedLoomcycleServer) GetTranscript(context.Context, *GetTranscriptRequest) (*Transcript, error) {
	return nil, status.Error(codes.Unimplemented, "method GetTranscript not implemented")
}
func (UnimplementedLoomcycleServer) GetAgent(context.Context, *GetAgentRequest) (*Agent, error) {
	return nil, status.Error(codes.Unimplemented, "method GetAgent not implemented")
}
func (UnimplementedLoomcycleServer) CancelAgent(context.Context, *CancelAgentRequest) (*CancelAgentResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method CancelAgent not implemented")
}
func (UnimplementedLoomcycleServer) ListUserAgents(context.Context, *ListUserAgentsRequest) (*ListUserAgentsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListUserAgents not implemented")
}
func (UnimplementedLoomcycleServer) UsageReport(context.Context, *UsageReportRequest) (*UsageReportResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method UsageReport not implemented")
}
func (UnimplementedLoomcycleServer) TokenLimit(context.Context, *TokenLimitRequest) (*TokenLimitResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method TokenLimit not implemented")
}
func (UnimplementedLoomcycleServer) Health(context.Context, *HealthRequest) (*HealthResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Health not implemented")
}
func (UnimplementedLoomcycleServer) Config(context.Context, *ConfigRequest) (*ConfigResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Config not implemented")
}
func (UnimplementedLoomcycleServer) RegisterHook(context.Context, *RegisterHookRequest) (*RegisterHookResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method RegisterHook not implemented")
}
func (UnimplementedLoomcycleServer) ListHooks(context.Context, *ListHooksRequest) (*ListHooksResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListHooks not implemented")
}
func (UnimplementedLoomcycleServer) DeleteHook(context.Context, *DeleteHookRequest) (*DeleteHookResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method DeleteHook not implemented")
}
func (UnimplementedLoomcycleServer) PauseRuntime(context.Context, *PauseRuntimeRequest) (*PauseRuntimeResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method PauseRuntime not implemented")
}
func (UnimplementedLoomcycleServer) ResumeRuntime(context.Context, *ResumeRuntimeRequest) (*ResumeRuntimeResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ResumeRuntime not implemented")
}
func (UnimplementedLoomcycleServer) GetRuntimeState(context.Context, *GetRuntimeStateRequest) (*RuntimeStateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method GetRuntimeState not implemented")
}
func (UnimplementedLoomcycleServer) ResolveProbe(context.Context, *ResolveProbeRequest) (*ResolverMatrixResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ResolveProbe not implemented")
}
func (UnimplementedLoomcycleServer) CreateSnapshot(context.Context, *CreateSnapshotRequest) (*SnapshotDescriptor, error) {
	return nil, status.Error(codes.Unimplemented, "method CreateSnapshot not implemented")
}
func (UnimplementedLoomcycleServer) ListSnapshots(context.Context, *ListSnapshotsRequest) (*ListSnapshotsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListSnapshots not implemented")
}
func (UnimplementedLoomcycleServer) GetSnapshot(context.Context, *GetSnapshotRequest) (*SnapshotEnvelope, error) {
	return nil, status.Error(codes.Unimplemented, "method GetSnapshot not implemented")
}
func (UnimplementedLoomcycleServer) ExportSnapshot(context.Context, *ExportSnapshotRequest) (*ExportSnapshotResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ExportSnapshot not implemented")
}
func (UnimplementedLoomcycleServer) RestoreSnapshot(context.Context, *RestoreSnapshotRequest) (*RestoreSnapshotResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method RestoreSnapshot not implemented")
}
func (UnimplementedLoomcycleServer) DeleteSnapshot(context.Context, *DeleteSnapshotRequest) (*DeleteSnapshotResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method DeleteSnapshot not implemented")
}
func (UnimplementedLoomcycleServer) AgentDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method AgentDef not implemented")
}
func (UnimplementedLoomcycleServer) SkillDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method SkillDef not implemented")
}
func (UnimplementedLoomcycleServer) MCPServerDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method MCPServerDef not implemented")
}
func (UnimplementedLoomcycleServer) ScheduleDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ScheduleDef not implemented")
}
func (UnimplementedLoomcycleServer) A2AServerCardDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method A2AServerCardDef not implemented")
}
func (UnimplementedLoomcycleServer) A2AAgentDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method A2AAgentDef not implemented")
}
func (UnimplementedLoomcycleServer) WebhookDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method WebhookDef not implemented")
}
func (UnimplementedLoomcycleServer) MemoryBackendDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method MemoryBackendDef not implemented")
}
func (UnimplementedLoomcycleServer) OperatorTokenDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method OperatorTokenDef not implemented")
}
func (UnimplementedLoomcycleServer) VolumeDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method VolumeDef not implemented")
}
func (UnimplementedLoomcycleServer) TeamDef(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method TeamDef not implemented")
}
func (UnimplementedLoomcycleServer) Path(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Path not implemented")
}
func (UnimplementedLoomcycleServer) Document(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Document not implemented")
}
func (UnimplementedLoomcycleServer) History(context.Context, *SubstrateRequest) (*SubstrateResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method History not implemented")
}
func (UnimplementedLoomcycleServer) ListChannels(context.Context, *ListChannelsRequest) (*ListChannelsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListChannels not implemented")
}
func (UnimplementedLoomcycleServer) StreamUserRunStates(*StreamUserRunStatesRequest, grpc.ServerStreamingServer[RunStateEvent]) error {
	return status.Error(codes.Unimplemented, "method StreamUserRunStates not implemented")
}
func (UnimplementedLoomcycleServer) PublishChannel(context.Context, *PublishChannelRequest) (*PublishChannelResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method PublishChannel not implemented")
}
func (UnimplementedLoomcycleServer) SubscribeChannel(context.Context, *SubscribeChannelRequest) (*SubscribeChannelResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method SubscribeChannel not implemented")
}
func (UnimplementedLoomcycleServer) PeekChannel(context.Context, *PeekChannelRequest) (*PeekChannelResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method PeekChannel not implemented")
}
func (UnimplementedLoomcycleServer) AckChannel(context.Context, *AckChannelRequest) (*AckChannelResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method AckChannel not implemented")
}
func (UnimplementedLoomcycleServer) AwaitChannels(context.Context, *AwaitChannelsRequest) (*AwaitChannelsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method AwaitChannels not implemented")
}
func (UnimplementedLoomcycleServer) BroadcastChannels(context.Context, *BroadcastChannelsRequest) (*BroadcastChannelsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method BroadcastChannels not implemented")
}
func (UnimplementedLoomcycleServer) mustEmbedUnimplementedLoomcycleServer() {}
func (UnimplementedLoomcycleServer) testEmbeddedByValue()                   {}

// UnsafeLoomcycleServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to LoomcycleServer will
// result in compilation errors.
type UnsafeLoomcycleServer interface {
	mustEmbedUnimplementedLoomcycleServer()
}

func RegisterLoomcycleServer(s grpc.ServiceRegistrar, srv LoomcycleServer) {
	// If the following call panics, it indicates UnimplementedLoomcycleServer 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(&Loomcycle_ServiceDesc, srv)
}

func _Loomcycle_Run_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(RunRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(LoomcycleServer).Run(m, &grpc.GenericServerStream[RunRequest, Event]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Loomcycle_RunServer = grpc.ServerStreamingServer[Event]

func _Loomcycle_Continue_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(ContinueRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(LoomcycleServer).Continue(m, &grpc.GenericServerStream[ContinueRequest, Event]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Loomcycle_ContinueServer = grpc.ServerStreamingServer[Event]

func _Loomcycle_SpawnRunBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(BatchSpawnRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).SpawnRunBatch(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_SpawnRunBatch_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).SpawnRunBatch(ctx, req.(*BatchSpawnRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_CompactRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CompactRunRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).CompactRun(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_CompactRun_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).CompactRun(ctx, req.(*CompactRunRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_DirectoryUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DirectoryUsersRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).DirectoryUsers(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_DirectoryUsers_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).DirectoryUsers(ctx, req.(*DirectoryUsersRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_DirectoryInspect_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DirectoryInspectRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).DirectoryInspect(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_DirectoryInspect_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).DirectoryInspect(ctx, req.(*DirectoryInspectRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_DirectoryTenants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DirectoryTenantsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).DirectoryTenants(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_DirectoryTenants_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).DirectoryTenants(ctx, req.(*DirectoryTenantsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ErasureReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ErasureReportRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ErasureReport(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ErasureReport_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ErasureReport(ctx, req.(*ErasureReportRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ErasureExecute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ErasureExecuteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ErasureExecute(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ErasureExecute_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ErasureExecute(ctx, req.(*ErasureExecuteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ReplaySession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ReplaySessionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ReplaySession(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ReplaySession_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ReplaySession(ctx, req.(*ReplaySessionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_RunInput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RunInputRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).RunInput(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_RunInput_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).RunInput(ctx, req.(*RunInputRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_CancelTurn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CancelTurnRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).CancelTurn(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_CancelTurn_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).CancelTurn(ctx, req.(*CancelTurnRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ResolveInterrupt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResolveInterruptRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ResolveInterrupt(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ResolveInterrupt_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ResolveInterrupt(ctx, req.(*ResolveInterruptRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_StreamRun_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(StreamRunRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(LoomcycleServer).StreamRun(m, &grpc.GenericServerStream[StreamRunRequest, Event]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Loomcycle_StreamRunServer = grpc.ServerStreamingServer[Event]

func _Loomcycle_GetTranscript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetTranscriptRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).GetTranscript(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_GetTranscript_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).GetTranscript(ctx, req.(*GetTranscriptRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_GetAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetAgentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).GetAgent(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_GetAgent_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).GetAgent(ctx, req.(*GetAgentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_CancelAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CancelAgentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).CancelAgent(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_CancelAgent_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).CancelAgent(ctx, req.(*CancelAgentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ListUserAgents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListUserAgentsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ListUserAgents(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ListUserAgents_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ListUserAgents(ctx, req.(*ListUserAgentsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_UsageReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UsageReportRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).UsageReport(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_UsageReport_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).UsageReport(ctx, req.(*UsageReportRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_TokenLimit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TokenLimitRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).TokenLimit(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_TokenLimit_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).TokenLimit(ctx, req.(*TokenLimitRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_Health_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(HealthRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).Health(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_Health_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).Health(ctx, req.(*HealthRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_Config_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ConfigRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).Config(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_Config_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).Config(ctx, req.(*ConfigRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_RegisterHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RegisterHookRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).RegisterHook(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_RegisterHook_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).RegisterHook(ctx, req.(*RegisterHookRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ListHooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListHooksRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ListHooks(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ListHooks_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ListHooks(ctx, req.(*ListHooksRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_DeleteHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteHookRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).DeleteHook(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_DeleteHook_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).DeleteHook(ctx, req.(*DeleteHookRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_PauseRuntime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PauseRuntimeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).PauseRuntime(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_PauseRuntime_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).PauseRuntime(ctx, req.(*PauseRuntimeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ResumeRuntime_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResumeRuntimeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ResumeRuntime(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ResumeRuntime_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ResumeRuntime(ctx, req.(*ResumeRuntimeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_GetRuntimeState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetRuntimeStateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).GetRuntimeState(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_GetRuntimeState_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).GetRuntimeState(ctx, req.(*GetRuntimeStateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ResolveProbe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResolveProbeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ResolveProbe(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ResolveProbe_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ResolveProbe(ctx, req.(*ResolveProbeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_CreateSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateSnapshotRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).CreateSnapshot(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_CreateSnapshot_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).CreateSnapshot(ctx, req.(*CreateSnapshotRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ListSnapshots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListSnapshotsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ListSnapshots(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ListSnapshots_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ListSnapshots(ctx, req.(*ListSnapshotsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_GetSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetSnapshotRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).GetSnapshot(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_GetSnapshot_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).GetSnapshot(ctx, req.(*GetSnapshotRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ExportSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ExportSnapshotRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ExportSnapshot(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ExportSnapshot_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ExportSnapshot(ctx, req.(*ExportSnapshotRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_RestoreSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RestoreSnapshotRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).RestoreSnapshot(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_RestoreSnapshot_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).RestoreSnapshot(ctx, req.(*RestoreSnapshotRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_DeleteSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteSnapshotRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).DeleteSnapshot(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_DeleteSnapshot_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).DeleteSnapshot(ctx, req.(*DeleteSnapshotRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_AgentDef_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).AgentDef(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_AgentDef_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).AgentDef(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_SkillDef_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).SkillDef(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_SkillDef_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).SkillDef(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_MCPServerDef_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).MCPServerDef(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_MCPServerDef_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).MCPServerDef(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ScheduleDef_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ScheduleDef(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ScheduleDef_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ScheduleDef(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_A2AServerCardDef_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).A2AServerCardDef(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_A2AServerCardDef_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).A2AServerCardDef(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_A2AAgentDef_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).A2AAgentDef(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_A2AAgentDef_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).A2AAgentDef(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_WebhookDef_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).WebhookDef(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_WebhookDef_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).WebhookDef(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_MemoryBackendDef_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).MemoryBackendDef(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_MemoryBackendDef_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).MemoryBackendDef(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_OperatorTokenDef_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).OperatorTokenDef(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_OperatorTokenDef_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).OperatorTokenDef(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_VolumeDef_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).VolumeDef(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_VolumeDef_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).VolumeDef(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_TeamDef_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).TeamDef(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_TeamDef_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).TeamDef(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_Path_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).Path(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_Path_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).Path(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_Document_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).Document(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_Document_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).Document(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_History_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubstrateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).History(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_History_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).History(ctx, req.(*SubstrateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_ListChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListChannelsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).ListChannels(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_ListChannels_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).ListChannels(ctx, req.(*ListChannelsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_StreamUserRunStates_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(StreamUserRunStatesRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(LoomcycleServer).StreamUserRunStates(m, &grpc.GenericServerStream[StreamUserRunStatesRequest, RunStateEvent]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Loomcycle_StreamUserRunStatesServer = grpc.ServerStreamingServer[RunStateEvent]

func _Loomcycle_PublishChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PublishChannelRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).PublishChannel(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_PublishChannel_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).PublishChannel(ctx, req.(*PublishChannelRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_SubscribeChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubscribeChannelRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).SubscribeChannel(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_SubscribeChannel_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).SubscribeChannel(ctx, req.(*SubscribeChannelRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_PeekChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PeekChannelRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).PeekChannel(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_PeekChannel_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).PeekChannel(ctx, req.(*PeekChannelRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_AckChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AckChannelRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).AckChannel(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_AckChannel_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).AckChannel(ctx, req.(*AckChannelRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_AwaitChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AwaitChannelsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).AwaitChannels(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_AwaitChannels_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).AwaitChannels(ctx, req.(*AwaitChannelsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Loomcycle_BroadcastChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(BroadcastChannelsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LoomcycleServer).BroadcastChannels(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Loomcycle_BroadcastChannels_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LoomcycleServer).BroadcastChannels(ctx, req.(*BroadcastChannelsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Loomcycle_ServiceDesc is the grpc.ServiceDesc for Loomcycle service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Loomcycle_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "loomcycle.v1.Loomcycle",
	HandlerType: (*LoomcycleServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SpawnRunBatch",
			Handler:    _Loomcycle_SpawnRunBatch_Handler,
		},
		{
			MethodName: "CompactRun",
			Handler:    _Loomcycle_CompactRun_Handler,
		},
		{
			MethodName: "DirectoryUsers",
			Handler:    _Loomcycle_DirectoryUsers_Handler,
		},
		{
			MethodName: "DirectoryInspect",
			Handler:    _Loomcycle_DirectoryInspect_Handler,
		},
		{
			MethodName: "DirectoryTenants",
			Handler:    _Loomcycle_DirectoryTenants_Handler,
		},
		{
			MethodName: "ErasureReport",
			Handler:    _Loomcycle_ErasureReport_Handler,
		},
		{
			MethodName: "ErasureExecute",
			Handler:    _Loomcycle_ErasureExecute_Handler,
		},
		{
			MethodName: "ReplaySession",
			Handler:    _Loomcycle_ReplaySession_Handler,
		},
		{
			MethodName: "RunInput",
			Handler:    _Loomcycle_RunInput_Handler,
		},
		{
			MethodName: "CancelTurn",
			Handler:    _Loomcycle_CancelTurn_Handler,
		},
		{
			MethodName: "ResolveInterrupt",
			Handler:    _Loomcycle_ResolveInterrupt_Handler,
		},
		{
			MethodName: "GetTranscript",
			Handler:    _Loomcycle_GetTranscript_Handler,
		},
		{
			MethodName: "GetAgent",
			Handler:    _Loomcycle_GetAgent_Handler,
		},
		{
			MethodName: "CancelAgent",
			Handler:    _Loomcycle_CancelAgent_Handler,
		},
		{
			MethodName: "ListUserAgents",
			Handler:    _Loomcycle_ListUserAgents_Handler,
		},
		{
			MethodName: "UsageReport",
			Handler:    _Loomcycle_UsageReport_Handler,
		},
		{
			MethodName: "TokenLimit",
			Handler:    _Loomcycle_TokenLimit_Handler,
		},
		{
			MethodName: "Health",
			Handler:    _Loomcycle_Health_Handler,
		},
		{
			MethodName: "Config",
			Handler:    _Loomcycle_Config_Handler,
		},
		{
			MethodName: "RegisterHook",
			Handler:    _Loomcycle_RegisterHook_Handler,
		},
		{
			MethodName: "ListHooks",
			Handler:    _Loomcycle_ListHooks_Handler,
		},
		{
			MethodName: "DeleteHook",
			Handler:    _Loomcycle_DeleteHook_Handler,
		},
		{
			MethodName: "PauseRuntime",
			Handler:    _Loomcycle_PauseRuntime_Handler,
		},
		{
			MethodName: "ResumeRuntime",
			Handler:    _Loomcycle_ResumeRuntime_Handler,
		},
		{
			MethodName: "GetRuntimeState",
			Handler:    _Loomcycle_GetRuntimeState_Handler,
		},
		{
			MethodName: "ResolveProbe",
			Handler:    _Loomcycle_ResolveProbe_Handler,
		},
		{
			MethodName: "CreateSnapshot",
			Handler:    _Loomcycle_CreateSnapshot_Handler,
		},
		{
			MethodName: "ListSnapshots",
			Handler:    _Loomcycle_ListSnapshots_Handler,
		},
		{
			MethodName: "GetSnapshot",
			Handler:    _Loomcycle_GetSnapshot_Handler,
		},
		{
			MethodName: "ExportSnapshot",
			Handler:    _Loomcycle_ExportSnapshot_Handler,
		},
		{
			MethodName: "RestoreSnapshot",
			Handler:    _Loomcycle_RestoreSnapshot_Handler,
		},
		{
			MethodName: "DeleteSnapshot",
			Handler:    _Loomcycle_DeleteSnapshot_Handler,
		},
		{
			MethodName: "AgentDef",
			Handler:    _Loomcycle_AgentDef_Handler,
		},
		{
			MethodName: "SkillDef",
			Handler:    _Loomcycle_SkillDef_Handler,
		},
		{
			MethodName: "MCPServerDef",
			Handler:    _Loomcycle_MCPServerDef_Handler,
		},
		{
			MethodName: "ScheduleDef",
			Handler:    _Loomcycle_ScheduleDef_Handler,
		},
		{
			MethodName: "A2AServerCardDef",
			Handler:    _Loomcycle_A2AServerCardDef_Handler,
		},
		{
			MethodName: "A2AAgentDef",
			Handler:    _Loomcycle_A2AAgentDef_Handler,
		},
		{
			MethodName: "WebhookDef",
			Handler:    _Loomcycle_WebhookDef_Handler,
		},
		{
			MethodName: "MemoryBackendDef",
			Handler:    _Loomcycle_MemoryBackendDef_Handler,
		},
		{
			MethodName: "OperatorTokenDef",
			Handler:    _Loomcycle_OperatorTokenDef_Handler,
		},
		{
			MethodName: "VolumeDef",
			Handler:    _Loomcycle_VolumeDef_Handler,
		},
		{
			MethodName: "TeamDef",
			Handler:    _Loomcycle_TeamDef_Handler,
		},
		{
			MethodName: "Path",
			Handler:    _Loomcycle_Path_Handler,
		},
		{
			MethodName: "Document",
			Handler:    _Loomcycle_Document_Handler,
		},
		{
			MethodName: "History",
			Handler:    _Loomcycle_History_Handler,
		},
		{
			MethodName: "ListChannels",
			Handler:    _Loomcycle_ListChannels_Handler,
		},
		{
			MethodName: "PublishChannel",
			Handler:    _Loomcycle_PublishChannel_Handler,
		},
		{
			MethodName: "SubscribeChannel",
			Handler:    _Loomcycle_SubscribeChannel_Handler,
		},
		{
			MethodName: "PeekChannel",
			Handler:    _Loomcycle_PeekChannel_Handler,
		},
		{
			MethodName: "AckChannel",
			Handler:    _Loomcycle_AckChannel_Handler,
		},
		{
			MethodName: "AwaitChannels",
			Handler:    _Loomcycle_AwaitChannels_Handler,
		},
		{
			MethodName: "BroadcastChannels",
			Handler:    _Loomcycle_BroadcastChannels_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Run",
			Handler:       _Loomcycle_Run_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Continue",
			Handler:       _Loomcycle_Continue_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "StreamRun",
			Handler:       _Loomcycle_StreamRun_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "StreamUserRunStates",
			Handler:       _Loomcycle_StreamUserRunStates_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "loomcycle.proto",
}
