@chipschat/protocol 1.0.3 → 1.0.5

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 (46) hide show
  1. package/dist/generated/types.d.ts +50 -3
  2. package/dist/generated/types.d.ts.map +1 -1
  3. package/dist/src/commands.d.ts +15 -4
  4. package/dist/src/commands.d.ts.map +1 -1
  5. package/dist/src/commands.js +25 -5
  6. package/dist/src/commands.js.map +1 -1
  7. package/dist/src/connectors.d.ts +94 -0
  8. package/dist/src/connectors.d.ts.map +1 -1
  9. package/dist/src/connectors.js +51 -0
  10. package/dist/src/connectors.js.map +1 -1
  11. package/dist/src/events/chips-to-harness.js +1 -1
  12. package/dist/src/events/chips-to-harness.js.map +1 -1
  13. package/dist/src/events/harness-to-chips.d.ts.map +1 -1
  14. package/dist/src/events/harness-to-chips.js +4 -0
  15. package/dist/src/events/harness-to-chips.js.map +1 -1
  16. package/dist/src/events/workspace.d.ts +11 -1
  17. package/dist/src/events/workspace.d.ts.map +1 -1
  18. package/dist/src/events/workspace.js +33 -2
  19. package/dist/src/events/workspace.js.map +1 -1
  20. package/dist/src/frames.d.ts +7 -2
  21. package/dist/src/frames.d.ts.map +1 -1
  22. package/dist/src/frames.js +7 -2
  23. package/dist/src/frames.js.map +1 -1
  24. package/dist/src/index.d.ts +8 -8
  25. package/dist/src/index.d.ts.map +1 -1
  26. package/dist/src/index.js +4 -4
  27. package/dist/src/index.js.map +1 -1
  28. package/dist/src/notifications.d.ts +6 -6
  29. package/dist/src/room-note.d.ts +42 -0
  30. package/dist/src/room-note.d.ts.map +1 -1
  31. package/dist/src/room-note.js +87 -0
  32. package/dist/src/room-note.js.map +1 -1
  33. package/dist/src/spend.d.ts +50 -7
  34. package/dist/src/spend.d.ts.map +1 -1
  35. package/dist/src/spend.js +24 -7
  36. package/dist/src/spend.js.map +1 -1
  37. package/fixtures/space.spend_ceiling_lifted.json +12 -0
  38. package/generated/agent-connect.json +165 -3
  39. package/generated/schema/hello.json +1 -1
  40. package/generated/schema/message.handed.json +22 -1
  41. package/generated/schema/message.new.json +40 -0
  42. package/generated/schema/run.status.json +4 -0
  43. package/generated/schema/space.spend_ceiling_lifted.json +94 -0
  44. package/generated/schema/space.spend_ceiling_set.json +1 -1
  45. package/generated/types.ts +51 -3
  46. package/package.json +1 -1
@@ -117,7 +117,7 @@
117
117
  "description": "The server's own version."
118
118
  },
119
119
  "takes": {
120
- "description": "What this server keeps of what a person's client may send beyond the base set, by the names in `SERVER_TAKES`. `held_yes` is `for_minutes` and `until_stopped` on `approval.resolved`. A server older than the field says nothing, and drops those fields, so a client offers neither to it (ADR 0281).",
120
+ "description": "What this server keeps of what a person's client may send beyond the base set, by the names in `SERVER_TAKES`. `held_yes` is `for_minutes` and `until_stopped` on `approval.resolved`. A server older than the field says nothing, and drops those fields, so a client offers neither to it (ADR 0281). `spend_no_cap` is No cap and amounts past $100 on a room's Spend per job (ADR 0292).",
121
121
  "maxItems": 32,
122
122
  "type": "array",
123
123
  "items": {
@@ -90,9 +90,30 @@
90
90
  "description": "Who it is handed to."
91
91
  },
92
92
  "lead": {
93
- "description": "Handed to the room's lead because it was nobody's turn and the room went still (ADR 0104), rather than held by the referee.",
93
+ "description": "Handed to the room's lead because it was nobody's turn and the room went still (ADR 0104), or because the agent it was for did not pick it up (`unanswered_by`), rather than held by the referee.",
94
94
  "type": "boolean",
95
95
  "const": true
96
+ },
97
+ "unanswered_by": {
98
+ "description": "The agent the message was for that did not pick it up (ADR 0291): no turn of its on it, no word and no pass, a minute after it was said. The message is handed to the room's lead, or, when the lead said it or is the one that did not pick it up, back to the agent that said it.",
99
+ "type": "string",
100
+ "pattern": "^(?:agt|hrn)_[0-7][0-9A-HJKMNP-TV-Z]{25}$"
101
+ },
102
+ "why": {
103
+ "description": "With `unanswered_by`, why: its harness is `offline`, or says something is wrong (`trouble`); its turn on the message `failed`; or it is connected and nothing has been heard from it (`silent`).",
104
+ "type": "string",
105
+ "enum": [
106
+ "offline",
107
+ "trouble",
108
+ "failed",
109
+ "silent"
110
+ ]
111
+ },
112
+ "reason": {
113
+ "description": "For `trouble`, what its harness said is wrong; for `failed`, the run's error.",
114
+ "type": "string",
115
+ "minLength": 1,
116
+ "maxLength": 200
96
117
  }
97
118
  },
98
119
  "required": [
@@ -1161,6 +1161,46 @@
1161
1161
  "minutes"
1162
1162
  ]
1163
1163
  }
1164
+ },
1165
+ "away": {
1166
+ "description": "The room's agents that can't answer as Chips sends this turn (ADR 0291): offline, or their harness says something is wrong. Work handed to one of them waits.",
1167
+ "maxItems": 500,
1168
+ "type": "array",
1169
+ "items": {
1170
+ "type": "object",
1171
+ "properties": {
1172
+ "participant_id": {
1173
+ "type": "string",
1174
+ "minLength": 1,
1175
+ "maxLength": 120
1176
+ },
1177
+ "why": {
1178
+ "type": "string",
1179
+ "enum": [
1180
+ "offline",
1181
+ "trouble"
1182
+ ],
1183
+ "description": "`offline`: no connection of its harness is open. `trouble`: its harness is connected and says something is wrong on its side (ADR 0083)."
1184
+ },
1185
+ "reason": {
1186
+ "description": "For `trouble`: what its harness said is wrong, in its own words.",
1187
+ "type": "string",
1188
+ "minLength": 1,
1189
+ "maxLength": 200
1190
+ },
1191
+ "minutes": {
1192
+ "type": "integer",
1193
+ "minimum": 0,
1194
+ "maximum": 9007199254740991,
1195
+ "description": "For how long, in whole minutes."
1196
+ }
1197
+ },
1198
+ "required": [
1199
+ "participant_id",
1200
+ "why",
1201
+ "minutes"
1202
+ ]
1203
+ }
1164
1204
  }
1165
1205
  },
1166
1206
  "required": [
@@ -102,6 +102,10 @@
102
102
  "type": "integer",
103
103
  "minimum": 0,
104
104
  "maximum": 9007199254740991
105
+ },
106
+ "pausable": {
107
+ "description": "This run holds where it is when a person pauses it (ADR 0293): on `run.pause` the harness stops the run's work within a few seconds without ending it, on `run.resume` it carries on in the same conversation, and on `run.cancel` while paused it ends quietly. Said once, on any status of the run; clients offer Pause only on a run that said it.",
108
+ "type": "boolean"
105
109
  }
106
110
  },
107
111
  "required": [
@@ -0,0 +1,94 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "v": {
6
+ "type": "number",
7
+ "const": 1,
8
+ "description": "Protocol major version."
9
+ },
10
+ "type": {
11
+ "type": "string",
12
+ "const": "space.spend_ceiling_lifted"
13
+ },
14
+ "id": {
15
+ "type": "string",
16
+ "pattern": "^evt_[0-7][0-9A-HJKMNP-TV-Z]{25}$",
17
+ "description": "The event's own id. Stable across a retry of the same event."
18
+ },
19
+ "ts": {
20
+ "type": "string",
21
+ "format": "date-time",
22
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
23
+ "description": "When it happened, by Chips' clock. Stamped on the way in; a value the sender writes is replaced."
24
+ },
25
+ "workspace_id": {
26
+ "type": "string",
27
+ "pattern": "^ws_[0-7][0-9A-HJKMNP-TV-Z]{25}$",
28
+ "description": "A workspace identifier: `ws_` followed by a ULID."
29
+ },
30
+ "space_id": {
31
+ "description": "The space, when the event belongs to one.",
32
+ "type": "string",
33
+ "pattern": "^spc_[0-7][0-9A-HJKMNP-TV-Z]{25}$"
34
+ },
35
+ "run_id": {
36
+ "description": "The run, when the event belongs to one.",
37
+ "type": "string",
38
+ "pattern": "^run_[0-7][0-9A-HJKMNP-TV-Z]{25}$"
39
+ },
40
+ "seq": {
41
+ "description": "Assigned by the server on append, monotonic per workspace. Absent on the way in.",
42
+ "type": "integer",
43
+ "exclusiveMinimum": 0,
44
+ "maximum": 9007199254740991
45
+ },
46
+ "idempotency_key": {
47
+ "description": "Required on every client-originated write. Sending the same key twice is a no-op.",
48
+ "type": "string",
49
+ "minLength": 1,
50
+ "maxLength": 200
51
+ },
52
+ "actor": {
53
+ "type": "object",
54
+ "properties": {
55
+ "kind": {
56
+ "type": "string",
57
+ "enum": [
58
+ "person",
59
+ "harness",
60
+ "agent",
61
+ "system"
62
+ ],
63
+ "description": "Whether a person, a harness, one of a harness's agents or Chips itself acted."
64
+ },
65
+ "id": {
66
+ "type": "string",
67
+ "minLength": 1,
68
+ "description": "The participant id, or `system` for Chips."
69
+ },
70
+ "harness_id": {
71
+ "description": "For an agent: the harness it speaks through, whose budget and runs are the agent's (ADR 0087). Filled in by Chips.",
72
+ "type": "string",
73
+ "pattern": "^hrn_[0-7][0-9A-HJKMNP-TV-Z]{25}$"
74
+ }
75
+ },
76
+ "required": [
77
+ "kind",
78
+ "id"
79
+ ],
80
+ "description": "The participant an event is attributed to."
81
+ }
82
+ },
83
+ "required": [
84
+ "v",
85
+ "type",
86
+ "id",
87
+ "ts",
88
+ "workspace_id",
89
+ "actor"
90
+ ],
91
+ "description": "A room's cap on what a job may spend was taken off: No cap.",
92
+ "$id": "https://chipschat.ai/schema/v1/space.spend_ceiling_lifted.json",
93
+ "title": "SpaceSpendCeilingLifted"
94
+ }
@@ -80,7 +80,7 @@
80
80
  "description": "The participant an event is attributed to."
81
81
  },
82
82
  "usd": {
83
- "description": "What the room allows a job now, in US dollars, from 0.25 to 100 in steps of 0.25; `null` for the default (3).",
83
+ "description": "What the room allows a job now, in US dollars, from 0.25 to 1000 in steps of 0.25; `null` for the default (3).",
84
84
  "type": [
85
85
  "number",
86
86
  "null"
@@ -191,6 +191,8 @@ export interface RunStatus {
191
191
  progress?: number;
192
192
  /** Seconds remaining, when the harness knows. */
193
193
  estimate_seconds?: number;
194
+ /** This run holds where it is when a person pauses it (ADR 0293): on `run.pause` the harness stops the run's work within a few seconds without ending it, on `run.resume` it carries on in the same conversation, and on `run.cancel` while paused it ends quietly. Said once, on any status of the run; clients offer Pause only on a run that said it. */
195
+ pausable?: boolean;
194
196
  }
195
197
 
196
198
  /** `run.plan` — The plan changed. Replaces the steps not yet done; the ones already done or failed keep their place. */
@@ -1015,7 +1017,7 @@ export interface Hello {
1015
1017
  name: string;
1016
1018
  /** The server's own version. */
1017
1019
  version: string;
1018
- /** What this server keeps of what a person's client may send beyond the base set, by the names in `SERVER_TAKES`. `held_yes` is `for_minutes` and `until_stopped` on `approval.resolved`. A server older than the field says nothing, and drops those fields, so a client offers neither to it (ADR 0281). */
1020
+ /** What this server keeps of what a person's client may send beyond the base set, by the names in `SERVER_TAKES`. `held_yes` is `for_minutes` and `until_stopped` on `approval.resolved`. A server older than the field says nothing, and drops those fields, so a client offers neither to it (ADR 0281). `spend_no_cap` is No cap and amounts past $100 on a room's Spend per job (ADR 0292). */
1019
1021
  takes?: string[];
1020
1022
  };
1021
1023
  /** The harness the token belongs to, and only that one. One connection speaks for all of the harness's agents (ADR 0087), which `agents` lists. A harness running inside another is a lane, not a duplicate. */
@@ -1443,6 +1445,16 @@ export interface MessageNew {
1443
1445
  /** How long since its last turn here ended, in whole minutes. */
1444
1446
  minutes: number;
1445
1447
  }[];
1448
+ /** The room's agents that can't answer as Chips sends this turn (ADR 0291): offline, or their harness says something is wrong. Work handed to one of them waits. */
1449
+ away?: {
1450
+ participant_id: string;
1451
+ /** `offline`: no connection of its harness is open. `trouble`: its harness is connected and says something is wrong on its side (ADR 0083). */
1452
+ why: "offline" | "trouble";
1453
+ /** For `trouble`: what its harness said is wrong, in its own words. */
1454
+ reason?: string;
1455
+ /** For how long, in whole minutes. */
1456
+ minutes: number;
1457
+ }[];
1446
1458
  };
1447
1459
  /** How the agents' talk in the room stands, once it is worth a word (ADR 0097): from eight messages between agents since a person last acted or an agent last made something new. A harness puts `note` at the top of the turn, as Chips's, ahead of the room's note. Absent below that, and worked out from the log, so a replay hands over the same facts. */
1448
1460
  exchange?: {
@@ -3122,8 +3134,14 @@ export interface MessageHanded {
3122
3134
  message_id: string;
3123
3135
  /** Who it is handed to. */
3124
3136
  agent_id: string;
3125
- /** Handed to the room's lead because it was nobody's turn and the room went still (ADR 0104), rather than held by the referee. */
3137
+ /** Handed to the room's lead because it was nobody's turn and the room went still (ADR 0104), or because the agent it was for did not pick it up (`unanswered_by`), rather than held by the referee. */
3126
3138
  lead?: true;
3139
+ /** The agent the message was for that did not pick it up (ADR 0291): no turn of its on it, no word and no pass, a minute after it was said. The message is handed to the room's lead, or, when the lead said it or is the one that did not pick it up, back to the agent that said it. */
3140
+ unanswered_by?: string;
3141
+ /** With `unanswered_by`, why: its harness is `offline`, or says something is wrong (`trouble`); its turn on the message `failed`; or it is connected and nothing has been heard from it (`silent`). */
3142
+ why?: "offline" | "trouble" | "failed" | "silent";
3143
+ /** For `trouble`, what its harness said is wrong; for `failed`, the run's error. */
3144
+ reason?: string;
3127
3145
  }
3128
3146
 
3129
3147
  /** `space.lead_set` — A room's lead was chosen, or taken away. */
@@ -3186,10 +3204,40 @@ export interface SpaceSpendCeilingSet {
3186
3204
  /** For an agent: the harness it speaks through, whose budget and runs are the agent's (ADR 0087). Filled in by Chips. */
3187
3205
  harness_id?: string;
3188
3206
  };
3189
- /** What the room allows a job now, in US dollars, from 0.25 to 100 in steps of 0.25; `null` for the default (3). */
3207
+ /** What the room allows a job now, in US dollars, from 0.25 to 1000 in steps of 0.25; `null` for the default (3). */
3190
3208
  usd: unknown;
3191
3209
  }
3192
3210
 
3211
+ /** `space.spend_ceiling_lifted` — A room's cap on what a job may spend was taken off: No cap. */
3212
+ export interface SpaceSpendCeilingLifted {
3213
+ /** Protocol major version. */
3214
+ v: 1;
3215
+ type: "space.spend_ceiling_lifted";
3216
+ /** The event's own id. Stable across a retry of the same event. */
3217
+ id: string;
3218
+ /** When it happened, by Chips' clock. Stamped on the way in; a value the sender writes is replaced. */
3219
+ ts: string;
3220
+ /** A workspace identifier: `ws_` followed by a ULID. */
3221
+ workspace_id: string;
3222
+ /** The space, when the event belongs to one. */
3223
+ space_id?: string;
3224
+ /** The run, when the event belongs to one. */
3225
+ run_id?: string;
3226
+ /** Assigned by the server on append, monotonic per workspace. Absent on the way in. */
3227
+ seq?: number;
3228
+ /** Required on every client-originated write. Sending the same key twice is a no-op. */
3229
+ idempotency_key?: string;
3230
+ /** The participant an event is attributed to. */
3231
+ actor: {
3232
+ /** Whether a person, a harness, one of a harness's agents or Chips itself acted. */
3233
+ kind: "person" | "harness" | "agent" | "system";
3234
+ /** The participant id, or `system` for Chips. */
3235
+ id: string;
3236
+ /** For an agent: the harness it speaks through, whose budget and runs are the agent's (ADR 0087). Filled in by Chips. */
3237
+ harness_id?: string;
3238
+ };
3239
+ }
3240
+
3193
3241
  /** `space.lock_set` — A room's changes were locked, or let go: while locked, no person renames, archives or deletes it. */
3194
3242
  export interface SpaceLockSet {
3195
3243
  /** Protocol major version. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chipschat/protocol",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Agent Connect: the canonical Zod schemas, the identifier vocabulary, and everything generated from them.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://chipschat.ai/reference/",