{"version":3,"file":"types.cjs","names":[],"sources":["../../src/serde/types.ts"],"sourcesContent":["export type ConstructorRecord = {\n  lc: 2;\n  type: \"constructor\";\n  id: unknown;\n  method?: unknown;\n  args?: unknown;\n};\n\nexport const TASKS = \"__pregel_tasks\";\nexport const ERROR = \"__error__\";\nexport const SCHEDULED = \"__scheduled__\";\nexport const INTERRUPT = \"__interrupt__\";\nexport const RESUME = \"__resume__\";\n\n/**\n * Snapshot blob for a `DeltaChannel` with finite snapshot frequency.\n *\n * Stored directly in a checkpoint's `channel_values` in place of the full\n * accumulated value. The ancestor walk in\n * {@link BaseCheckpointSaver.getDeltaChannelHistory} terminates when it\n * encounters a populated `channel_values` entry for a channel; a\n * `DeltaSnapshot` value is the materialized state at that ancestor, so the\n * channel reconstructs directly from `.value` without replaying earlier\n * writes.\n *\n * @remarks Beta. The on-disk representation may change in future releases.\n */\nexport class DeltaSnapshot<Value = unknown> {\n  /** Marker used for structural detection across module/realm boundaries. */\n  lg_name = \"DeltaSnapshot\" as const;\n\n  value: Value;\n\n  constructor(value: Value) {\n    this.value = value;\n  }\n}\n\n/**\n * Structural type guard for {@link DeltaSnapshot}. Uses the `lg_name` marker\n * so it survives serialization round-trips and cross-package duplication.\n */\nexport function isDeltaSnapshot<Value = unknown>(\n  value: unknown\n): value is DeltaSnapshot<Value> {\n  return (\n    value != null &&\n    typeof value === \"object\" &&\n    (value as { lg_name?: string }).lg_name === \"DeltaSnapshot\"\n  );\n}\n\n// Mirrors BaseChannel in \"@langchain/langgraph\"\nexport interface ChannelProtocol<\n  ValueType = unknown,\n  UpdateType = unknown,\n  CheckpointType = unknown,\n> {\n  ValueType: ValueType;\n\n  UpdateType: UpdateType;\n\n  /**\n   * The name of the channel.\n   */\n  lc_graph_name: string;\n\n  /**\n   * Return a new identical channel, optionally initialized from a checkpoint.\n   * Can be thought of as a \"restoration\" from a checkpoint which is a \"snapshot\" of the channel's state.\n   *\n   * @param {CheckpointType | undefined} checkpoint\n   * @returns {this}\n   */\n  fromCheckpoint(checkpoint?: CheckpointType): this;\n\n  /**\n   * Update the channel's value with the given sequence of updates.\n   * The order of the updates in the sequence is arbitrary.\n   *\n   * @throws {InvalidUpdateError} if the sequence of updates is invalid.\n   * @param {Array<UpdateType>} values\n   * @returns {void}\n   */\n  update(values: UpdateType[]): void;\n\n  /**\n   * Return the current value of the channel.\n   *\n   * @throws {EmptyChannelError} if the channel is empty (never updated yet).\n   * @returns {ValueType}\n   */\n  get(): ValueType;\n\n  /**\n   * Return a string representation of the channel's current state.\n   *\n   * @throws {EmptyChannelError} if the channel is empty (never updated yet), or doesn't support checkpoints.\n   * @returns {CheckpointType | undefined}\n   */\n  checkpoint(): CheckpointType | undefined;\n}\n\n// Mirrors SendInterface in \"@langchain/langgraph\"\nexport interface SendProtocol {\n  node: string;\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  args: any;\n  // Optional per-task timeout policy. Structural to avoid a dependency on the\n  // langgraph package; mirrors `TimeoutPolicy` in \"@langchain/langgraph\".\n  timeout?: {\n    runTimeout?: number;\n    idleTimeout?: number;\n    refreshOn?: \"auto\" | \"heartbeat\";\n  };\n}\n"],"mappings":";AAQA,MAAa,QAAQ;AACrB,MAAa,QAAQ;AACrB,MAAa,YAAY;AACzB,MAAa,YAAY;AACzB,MAAa,SAAS;;;;;;;;;;;;;;AAetB,IAAa,gBAAb,MAA4C;;CAE1C,UAAU;CAEV;CAEA,YAAY,OAAc;AACxB,OAAK,QAAQ;;;;;;;AAQjB,SAAgB,gBACd,OAC+B;AAC/B,QACE,SAAS,QACT,OAAO,UAAU,YAChB,MAA+B,YAAY"}