import type { StepType as _memoflow_v1_StepType, StepType__Output as _memoflow_v1_StepType__Output } from '../../memoflow/v1/StepType.js'; import type { StepStatus as _memoflow_v1_StepStatus, StepStatus__Output as _memoflow_v1_StepStatus__Output } from '../../memoflow/v1/StepStatus.js'; import type { Timestamp as _google_protobuf_Timestamp, Timestamp__Output as _google_protobuf_Timestamp__Output } from '../../google/protobuf/Timestamp.js'; import type { Long } from '@grpc/proto-loader'; export interface StepCheckpoint { 'step_seq'?: (number); 'step_type'?: (_memoflow_v1_StepType); 'step_name'?: (string); 'status'?: (_memoflow_v1_StepStatus); 'input'?: (Buffer | Uint8Array | string); 'output'?: (Buffer | Uint8Array | string); 'error'?: (string); 'attempt'?: (number); 'started_at'?: (_google_protobuf_Timestamp | null); 'completed_at'?: (_google_protobuf_Timestamp | null); /** * Content-addressed step identity: hash(step_kind, step_name)[:16] + ':' + occurrence_index. * A memoized result may be returned only if this matches the calling site's computed key. * Empty on checkpoints written before the field existed (validated by step_name instead). */ 'step_key'?: (string); /** * Size in bytes of the step's output. Set on WorkflowTask.completed_steps * entries whose `output` was stripped (see WorkflowTask.outputs_inline) so * observers still know the payload size without the payload. */ 'output_size'?: (number | string | Long); /** * Optional structured observability metadata (e.g. step.llm: model, token * counts, cost estimate, finish reason), JSON-serialized by the SDK. Empty * means absent. Purely observational — never consulted for memoization or * step-identity decisions (Law 1 is unaffected by this field). */ 'meta'?: (Buffer | Uint8Array | string); /** * ── Claim-check blob store (P3.4) ── * * When a step's input/output exceeds the server's configured * `blob_store.threshold_bytes`, the payload is uploaded to object storage * (S3/MinIO or a local file:// tree) at checkpoint-write time and the * corresponding `input`/`output` bytes field above is left EMPTY — the * claim check (`*_blob_ref` + `*_blob_size` + `*_blob_sha256`) replaces it. * A step never has both the inline bytes AND a blob_ref set for the same * side. Absent `*_blob_ref` (empty string) means "not externalized" — * `input`/`output` carries the value inline, as before this field existed. * * The read path (GetCheckpoints, task building) never inlines a blob's * bytes server-side by default: it returns the claim-check metadata as-is. * Callers that need the resolved value set `GetCheckpointsRequest.resolve_blobs * = true`, which fetches + sha256-verifies each blob server-side (the SDK * has no object-store credentials) and inlines it into `input`/`output` * (see `GetCheckpointsRequest`). A missing or corrupt blob when resolving * is a loud RPC error (Design Law 4) — never silently swapped for empty * bytes. */ 'output_blob_ref'?: (string); 'output_blob_size'?: (number | string | Long); 'output_blob_sha256'?: (string); 'input_blob_ref'?: (string); 'input_blob_size'?: (number | string | Long); 'input_blob_sha256'?: (string); /** * P6.3 transactional step (Postgres tier only): true when this COMPLETED * checkpoint was written by the SDK itself, inside the SAME Postgres * transaction as the step's own database writes (ctx.transaction()), * rather than by the server's normal CompleteActivity path. Dashboard * badges these steps EXACTLY_ONCE_TX. The guarantee this implies is * narrow and precondition-bound: exactly-once for a step ONLY when it * writes to the same Postgres database that stores memoflow's own * checkpoints — never a general claim about activities at large (those * remain at-least-once, Design Law 6). Absent/false means "written by * the server as usual" — the default, unaffected by this field existing. */ 'exactly_once_tx'?: (boolean); /** * N3 (F8 advisory): sha256 hex of the step's recorded input, computed by * the server at task-build time from the persisted input bytes. * Dispatched WorkflowTasks strip the input BYTES for payload size; this * fingerprint lets the SDK warn when a replayed step's memoized result is * served against different arguments (same-name reorder detection after a * deploy). Empty when no input was recorded. Advisory ONLY — never * consulted for memoization or step identity (Design Law 1 unaffected). */ 'input_sha256'?: (string); } export interface StepCheckpoint__Output { 'step_seq': (number); 'step_type': (_memoflow_v1_StepType__Output); 'step_name': (string); 'status': (_memoflow_v1_StepStatus__Output); 'input': (Buffer); 'output': (Buffer); 'error': (string); 'attempt': (number); 'started_at': (_google_protobuf_Timestamp__Output | null); 'completed_at': (_google_protobuf_Timestamp__Output | null); /** * Content-addressed step identity: hash(step_kind, step_name)[:16] + ':' + occurrence_index. * A memoized result may be returned only if this matches the calling site's computed key. * Empty on checkpoints written before the field existed (validated by step_name instead). */ 'step_key': (string); /** * Size in bytes of the step's output. Set on WorkflowTask.completed_steps * entries whose `output` was stripped (see WorkflowTask.outputs_inline) so * observers still know the payload size without the payload. */ 'output_size': (string); /** * Optional structured observability metadata (e.g. step.llm: model, token * counts, cost estimate, finish reason), JSON-serialized by the SDK. Empty * means absent. Purely observational — never consulted for memoization or * step-identity decisions (Law 1 is unaffected by this field). */ 'meta': (Buffer); /** * ── Claim-check blob store (P3.4) ── * * When a step's input/output exceeds the server's configured * `blob_store.threshold_bytes`, the payload is uploaded to object storage * (S3/MinIO or a local file:// tree) at checkpoint-write time and the * corresponding `input`/`output` bytes field above is left EMPTY — the * claim check (`*_blob_ref` + `*_blob_size` + `*_blob_sha256`) replaces it. * A step never has both the inline bytes AND a blob_ref set for the same * side. Absent `*_blob_ref` (empty string) means "not externalized" — * `input`/`output` carries the value inline, as before this field existed. * * The read path (GetCheckpoints, task building) never inlines a blob's * bytes server-side by default: it returns the claim-check metadata as-is. * Callers that need the resolved value set `GetCheckpointsRequest.resolve_blobs * = true`, which fetches + sha256-verifies each blob server-side (the SDK * has no object-store credentials) and inlines it into `input`/`output` * (see `GetCheckpointsRequest`). A missing or corrupt blob when resolving * is a loud RPC error (Design Law 4) — never silently swapped for empty * bytes. */ 'output_blob_ref': (string); 'output_blob_size': (string); 'output_blob_sha256': (string); 'input_blob_ref': (string); 'input_blob_size': (string); 'input_blob_sha256': (string); /** * P6.3 transactional step (Postgres tier only): true when this COMPLETED * checkpoint was written by the SDK itself, inside the SAME Postgres * transaction as the step's own database writes (ctx.transaction()), * rather than by the server's normal CompleteActivity path. Dashboard * badges these steps EXACTLY_ONCE_TX. The guarantee this implies is * narrow and precondition-bound: exactly-once for a step ONLY when it * writes to the same Postgres database that stores memoflow's own * checkpoints — never a general claim about activities at large (those * remain at-least-once, Design Law 6). Absent/false means "written by * the server as usual" — the default, unaffected by this field existing. */ 'exactly_once_tx': (boolean); /** * N3 (F8 advisory): sha256 hex of the step's recorded input, computed by * the server at task-build time from the persisted input bytes. * Dispatched WorkflowTasks strip the input BYTES for payload size; this * fingerprint lets the SDK warn when a replayed step's memoized result is * served against different arguments (same-name reorder detection after a * deploy). Empty when no input was recorded. Advisory ONLY — never * consulted for memoization or step identity (Design Law 1 unaffected). */ 'input_sha256': (string); }