@frockbot/protocol 0.3.4 → 0.3.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frockbot/protocol",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
package/src/index.ts CHANGED
@@ -9,7 +9,12 @@ export interface PromptRequest {
9
9
  */
10
10
  export const BOT_STATE_CHANNEL_VERSION = 1 as const;
11
11
 
12
- export type BotStateTopicV1 = "computer";
12
+ /**
13
+ * What a frame says has moved. `computer` is the Computer projection;
14
+ * `runs` is this Bot's durable run records — a Turn started, said more, or
15
+ * settled — so a client that is not holding the Turn's POST still learns.
16
+ */
17
+ export type BotStateTopicV1 = "computer" | "runs";
13
18
 
14
19
  export type BotStateChannelFrameV1 =
15
20
  | {
@@ -84,7 +89,10 @@ export function decodeBotStateChannelFrameV1(
84
89
  "cursor",
85
90
  "topic",
86
91
  ]);
87
- if (frame.schemaVersion !== 1 || frame.topic !== "computer") {
92
+ if (
93
+ frame.schemaVersion !== 1 ||
94
+ (frame.topic !== "computer" && frame.topic !== "runs")
95
+ ) {
88
96
  throw new Error("invalid Bot-state frame");
89
97
  }
90
98
  return {