@cloudflare/ai-chat 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,7 @@ declare function withDurableChat<TBase extends AIChatAgentLike>(Base: TBase): {
9
9
  new (...args: any[]): {
10
10
  scheduleEvery: <T = string>(intervalSeconds: number, callback: keyof AIChatAgent<Cloudflare.Env, unknown>, payload?: T | undefined, options?: {
11
11
  retry?: agents.RetryOptions;
12
+ _idempotent?: boolean;
12
13
  }) => Promise<agents.Schedule<T>>;
13
14
  cancelSchedule: (id: string) => Promise<boolean>;
14
15
  keepAlive: () => Promise<() => void>;
package/dist/index.js CHANGED
@@ -529,6 +529,7 @@ var AIChatAgent = class AIChatAgent extends Agent {
529
529
  }
530
530
  if (data.type === MessageType.CF_AGENT_STREAM_RESUME_REQUEST) {
531
531
  if (this._resumableStream.hasActiveStream()) this._notifyStreamResuming(connection);
532
+ else connection.send(JSON.stringify({ type: MessageType.CF_AGENT_STREAM_RESUME_NONE }));
532
533
  return;
533
534
  }
534
535
  if (data.type === MessageType.CF_AGENT_STREAM_RESUME_ACK) {