import type { SessionHello as _memoflow_v1_SessionHello, SessionHello__Output as _memoflow_v1_SessionHello__Output } from '../../memoflow/v1/SessionHello.js'; import type { CompleteWorkflowTaskRequest as _memoflow_v1_CompleteWorkflowTaskRequest, CompleteWorkflowTaskRequest__Output as _memoflow_v1_CompleteWorkflowTaskRequest__Output } from '../../memoflow/v1/CompleteWorkflowTaskRequest.js'; import type { CompleteActivityRequest as _memoflow_v1_CompleteActivityRequest, CompleteActivityRequest__Output as _memoflow_v1_CompleteActivityRequest__Output } from '../../memoflow/v1/CompleteActivityRequest.js'; import type { RecordEffects as _memoflow_v1_RecordEffects, RecordEffects__Output as _memoflow_v1_RecordEffects__Output } from '../../memoflow/v1/RecordEffects.js'; import type { Ping as _memoflow_v1_Ping, Ping__Output as _memoflow_v1_Ping__Output } from '../../memoflow/v1/Ping.js'; import type { StreamChunkRequest as _memoflow_v1_StreamChunkRequest, StreamChunkRequest__Output as _memoflow_v1_StreamChunkRequest__Output } from '../../memoflow/v1/StreamChunkRequest.js'; import type { AvailabilityUpdate as _memoflow_v1_AvailabilityUpdate, AvailabilityUpdate__Output as _memoflow_v1_AvailabilityUpdate__Output } from '../../memoflow/v1/AvailabilityUpdate.js'; import type { ReleaseTask as _memoflow_v1_ReleaseTask, ReleaseTask__Output as _memoflow_v1_ReleaseTask__Output } from '../../memoflow/v1/ReleaseTask.js'; import type { AppendOutputChunkRequest as _memoflow_v1_AppendOutputChunkRequest, AppendOutputChunkRequest__Output as _memoflow_v1_AppendOutputChunkRequest__Output } from '../../memoflow/v1/AppendOutputChunkRequest.js'; import type { RecordAiInvocationRequest as _memoflow_v1_RecordAiInvocationRequest, RecordAiInvocationRequest__Output as _memoflow_v1_RecordAiInvocationRequest__Output } from '../../memoflow/v1/RecordAiInvocationRequest.js'; import type { RecordAiToolEffectRequest as _memoflow_v1_RecordAiToolEffectRequest, RecordAiToolEffectRequest__Output as _memoflow_v1_RecordAiToolEffectRequest__Output } from '../../memoflow/v1/RecordAiToolEffectRequest.js'; import type { ReserveAiBudgetRequest as _memoflow_v1_ReserveAiBudgetRequest, ReserveAiBudgetRequest__Output as _memoflow_v1_ReserveAiBudgetRequest__Output } from '../../memoflow/v1/ReserveAiBudgetRequest.js'; import type { SettleAiBudgetRequest as _memoflow_v1_SettleAiBudgetRequest, SettleAiBudgetRequest__Output as _memoflow_v1_SettleAiBudgetRequest__Output } from '../../memoflow/v1/SettleAiBudgetRequest.js'; import type { ResolveAiBudgetRequest as _memoflow_v1_ResolveAiBudgetRequest, ResolveAiBudgetRequest__Output as _memoflow_v1_ResolveAiBudgetRequest__Output } from '../../memoflow/v1/ResolveAiBudgetRequest.js'; import type { SettleRecoveredAiBudgetRequest as _memoflow_v1_SettleRecoveredAiBudgetRequest, SettleRecoveredAiBudgetRequest__Output as _memoflow_v1_SettleRecoveredAiBudgetRequest__Output } from '../../memoflow/v1/SettleRecoveredAiBudgetRequest.js'; import type { Long } from '@grpc/proto-loader'; export interface WorkerFrame { /** * Strictly increasing per session, starting at 1. Identifies this frame in * DurableAck.acked_seqs. Frames that need no durable ack (hello, ping, * stream_chunk) still consume a seq for uniform bookkeeping. */ 'seq'?: (number | string | Long); 'hello'?: (_memoflow_v1_SessionHello | null); /** * Reused verbatim from the unary protocol so proto-mapper logic and * server command handling carry over unchanged (task_token + outcome). */ 'workflow_completion'?: (_memoflow_v1_CompleteWorkflowTaskRequest | null); 'activity_completion'?: (_memoflow_v1_CompleteActivityRequest | null); /** * P9.3 eager flush: implicit-step effect records emitted MID-slice, * before the slice suspends/completes. The server persists them as * SIDE_EFFECT checkpoints (identical schema to suspension-time records — * Design Law 9) and acks. Records for one task MUST be sent in step_seq * order. */ 'record_effects'?: (_memoflow_v1_RecordEffects | null); /** * Liveness + lease renewal (replaces the P7.1 unary workflow-task * heartbeat AND the activity heartbeat when sent with activity tokens). */ 'ping'?: (_memoflow_v1_Ping | null); /** * Best-effort activity output streaming (P3.5), unchanged semantics. */ 'stream_chunk'?: (_memoflow_v1_StreamChunkRequest | null); /** * Absolute per-lane execution limits. Updates may grow or shrink limits; * shrinking never cancels work already in flight. When draining is true * no new task is delivered and the worker closes after current work and * durable acknowledgements settle. */ 'availability'?: (_memoflow_v1_AvailabilityUpdate | null); /** * Return local admission for a task the SDK could not start (for example * a push racing graceful drain). The durable task remains eligible for * its normal lease/timeout recovery path. */ 'release_task'?: (_memoflow_v1_ReleaseTask | null); /** * DATA-005 durable run output. Unlike stream_chunk telemetry, this is * fenced, persisted, ordered and acknowledged after commit. */ 'append_output_chunk'?: (_memoflow_v1_AppendOutputChunkRequest | null); /** * AI-001 provider-neutral invocation/tool transitions. Both are * activity-attempt fenced and acknowledged only after the normalized row * and canonical execution event commit atomically. */ 'record_ai_invocation'?: (_memoflow_v1_RecordAiInvocationRequest | null); 'record_ai_tool_effect'?: (_memoflow_v1_RecordAiToolEffectRequest | null); /** * AI-003 server-authoritative admission and ledger-derived settlement. * A successful DurableAck for reserve means provider work may begin. */ 'reserve_ai_budget'?: (_memoflow_v1_ReserveAiBudgetRequest | null); 'settle_ai_budget'?: (_memoflow_v1_SettleAiBudgetRequest | null); 'resolve_ai_budget'?: (_memoflow_v1_ResolveAiBudgetRequest | null); /** * A later activity attempt recovered conclusive receiver-side evidence * for one previously uncertain tool effect. This closes only the prior * budget reservation; it never rewrites the historical invocation. */ 'settle_recovered_ai_budget'?: (_memoflow_v1_SettleRecoveredAiBudgetRequest | null); 'kind'?: "hello" | "workflow_completion" | "activity_completion" | "record_effects" | "ping" | "stream_chunk" | "availability" | "release_task" | "append_output_chunk" | "record_ai_invocation" | "record_ai_tool_effect" | "reserve_ai_budget" | "settle_ai_budget" | "resolve_ai_budget" | "settle_recovered_ai_budget"; } export interface WorkerFrame__Output { /** * Strictly increasing per session, starting at 1. Identifies this frame in * DurableAck.acked_seqs. Frames that need no durable ack (hello, ping, * stream_chunk) still consume a seq for uniform bookkeeping. */ 'seq': (string); 'hello'?: (_memoflow_v1_SessionHello__Output | null); /** * Reused verbatim from the unary protocol so proto-mapper logic and * server command handling carry over unchanged (task_token + outcome). */ 'workflow_completion'?: (_memoflow_v1_CompleteWorkflowTaskRequest__Output | null); 'activity_completion'?: (_memoflow_v1_CompleteActivityRequest__Output | null); /** * P9.3 eager flush: implicit-step effect records emitted MID-slice, * before the slice suspends/completes. The server persists them as * SIDE_EFFECT checkpoints (identical schema to suspension-time records — * Design Law 9) and acks. Records for one task MUST be sent in step_seq * order. */ 'record_effects'?: (_memoflow_v1_RecordEffects__Output | null); /** * Liveness + lease renewal (replaces the P7.1 unary workflow-task * heartbeat AND the activity heartbeat when sent with activity tokens). */ 'ping'?: (_memoflow_v1_Ping__Output | null); /** * Best-effort activity output streaming (P3.5), unchanged semantics. */ 'stream_chunk'?: (_memoflow_v1_StreamChunkRequest__Output | null); /** * Absolute per-lane execution limits. Updates may grow or shrink limits; * shrinking never cancels work already in flight. When draining is true * no new task is delivered and the worker closes after current work and * durable acknowledgements settle. */ 'availability'?: (_memoflow_v1_AvailabilityUpdate__Output | null); /** * Return local admission for a task the SDK could not start (for example * a push racing graceful drain). The durable task remains eligible for * its normal lease/timeout recovery path. */ 'release_task'?: (_memoflow_v1_ReleaseTask__Output | null); /** * DATA-005 durable run output. Unlike stream_chunk telemetry, this is * fenced, persisted, ordered and acknowledged after commit. */ 'append_output_chunk'?: (_memoflow_v1_AppendOutputChunkRequest__Output | null); /** * AI-001 provider-neutral invocation/tool transitions. Both are * activity-attempt fenced and acknowledged only after the normalized row * and canonical execution event commit atomically. */ 'record_ai_invocation'?: (_memoflow_v1_RecordAiInvocationRequest__Output | null); 'record_ai_tool_effect'?: (_memoflow_v1_RecordAiToolEffectRequest__Output | null); /** * AI-003 server-authoritative admission and ledger-derived settlement. * A successful DurableAck for reserve means provider work may begin. */ 'reserve_ai_budget'?: (_memoflow_v1_ReserveAiBudgetRequest__Output | null); 'settle_ai_budget'?: (_memoflow_v1_SettleAiBudgetRequest__Output | null); 'resolve_ai_budget'?: (_memoflow_v1_ResolveAiBudgetRequest__Output | null); /** * A later activity attempt recovered conclusive receiver-side evidence * for one previously uncertain tool effect. This closes only the prior * budget reservation; it never rewrites the historical invocation. */ 'settle_recovered_ai_budget'?: (_memoflow_v1_SettleRecoveredAiBudgetRequest__Output | null); 'kind'?: "hello" | "workflow_completion" | "activity_completion" | "record_effects" | "ping" | "stream_chunk" | "availability" | "release_task" | "append_output_chunk" | "record_ai_invocation" | "record_ai_tool_effect" | "reserve_ai_budget" | "settle_ai_budget" | "resolve_ai_budget" | "settle_recovered_ai_budget"; }