@chipschat/protocol 0.0.0-stage → 1.0.0

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 (423) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +56 -2
  3. package/dist/envelope.d.ts +54 -0
  4. package/dist/envelope.d.ts.map +1 -0
  5. package/dist/envelope.js +48 -0
  6. package/dist/envelope.js.map +1 -0
  7. package/dist/events/agent-to-chips.d.ts +27 -0
  8. package/dist/events/agent-to-chips.d.ts.map +1 -0
  9. package/dist/events/agent-to-chips.js +392 -0
  10. package/dist/events/agent-to-chips.js.map +1 -0
  11. package/dist/events/catalogue.d.ts +48 -0
  12. package/dist/events/catalogue.d.ts.map +1 -0
  13. package/dist/events/catalogue.js +67 -0
  14. package/dist/events/catalogue.js.map +1 -0
  15. package/dist/events/chips-to-agent.d.ts +24 -0
  16. package/dist/events/chips-to-agent.d.ts.map +1 -0
  17. package/dist/events/chips-to-agent.js +324 -0
  18. package/dist/events/chips-to-agent.js.map +1 -0
  19. package/dist/events/chips-to-harness.d.ts +24 -0
  20. package/dist/events/chips-to-harness.d.ts.map +1 -0
  21. package/dist/events/chips-to-harness.js +324 -0
  22. package/dist/events/chips-to-harness.js.map +1 -0
  23. package/dist/events/harness-to-chips.d.ts +27 -0
  24. package/dist/events/harness-to-chips.d.ts.map +1 -0
  25. package/dist/events/harness-to-chips.js +390 -0
  26. package/dist/events/harness-to-chips.js.map +1 -0
  27. package/dist/events/index.d.ts +6 -0
  28. package/dist/events/index.d.ts.map +1 -0
  29. package/dist/events/index.js +5 -0
  30. package/dist/events/index.js.map +1 -0
  31. package/dist/events/workspace.d.ts +19 -0
  32. package/dist/events/workspace.d.ts.map +1 -0
  33. package/dist/events/workspace.js +79 -0
  34. package/dist/events/workspace.js.map +1 -0
  35. package/dist/frames.d.ts +175 -0
  36. package/dist/frames.d.ts.map +1 -0
  37. package/dist/frames.js +161 -0
  38. package/dist/frames.js.map +1 -0
  39. package/dist/generated/types.d.ts +4052 -0
  40. package/dist/generated/types.d.ts.map +1 -0
  41. package/dist/generated/types.js +7 -0
  42. package/dist/generated/types.js.map +1 -0
  43. package/dist/ids/index.d.ts +3 -0
  44. package/dist/ids/index.d.ts.map +1 -0
  45. package/dist/ids/index.js +2 -0
  46. package/dist/ids/index.js.map +1 -0
  47. package/dist/ids/ulid.d.ts +83 -0
  48. package/dist/ids/ulid.d.ts.map +1 -0
  49. package/dist/ids/ulid.js +199 -0
  50. package/dist/ids/ulid.js.map +1 -0
  51. package/dist/index.d.ts +18 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +13 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/primitives.d.ts +194 -0
  56. package/dist/primitives.d.ts.map +1 -0
  57. package/dist/primitives.js +193 -0
  58. package/dist/primitives.js.map +1 -0
  59. package/dist/src/address.d.ts +106 -0
  60. package/dist/src/address.d.ts.map +1 -0
  61. package/dist/src/address.js +141 -0
  62. package/dist/src/address.js.map +1 -0
  63. package/dist/src/agent-context-windows.d.ts +235 -0
  64. package/dist/src/agent-context-windows.d.ts.map +1 -0
  65. package/dist/src/agent-context-windows.js +213 -0
  66. package/dist/src/agent-context-windows.js.map +1 -0
  67. package/dist/src/agent-heartbeats.d.ts +106 -0
  68. package/dist/src/agent-heartbeats.d.ts.map +1 -0
  69. package/dist/src/agent-heartbeats.js +111 -0
  70. package/dist/src/agent-heartbeats.js.map +1 -0
  71. package/dist/src/agent-models.d.ts +158 -0
  72. package/dist/src/agent-models.d.ts.map +1 -0
  73. package/dist/src/agent-models.js +171 -0
  74. package/dist/src/agent-models.js.map +1 -0
  75. package/dist/src/agent-place.d.ts +76 -0
  76. package/dist/src/agent-place.d.ts.map +1 -0
  77. package/dist/src/agent-place.js +80 -0
  78. package/dist/src/agent-place.js.map +1 -0
  79. package/dist/src/agents.d.ts +24 -0
  80. package/dist/src/agents.d.ts.map +1 -0
  81. package/dist/src/agents.js +58 -0
  82. package/dist/src/agents.js.map +1 -0
  83. package/dist/src/capabilities.d.ts +121 -0
  84. package/dist/src/capabilities.d.ts.map +1 -0
  85. package/dist/src/capabilities.js +120 -0
  86. package/dist/src/capabilities.js.map +1 -0
  87. package/dist/src/checklist.d.ts +19 -0
  88. package/dist/src/checklist.d.ts.map +1 -0
  89. package/dist/src/checklist.js +22 -0
  90. package/dist/src/checklist.js.map +1 -0
  91. package/dist/src/commands.d.ts +50 -0
  92. package/dist/src/commands.d.ts.map +1 -0
  93. package/dist/src/commands.js +274 -0
  94. package/dist/src/commands.js.map +1 -0
  95. package/dist/src/connectors.d.ts +90 -0
  96. package/dist/src/connectors.d.ts.map +1 -0
  97. package/dist/src/connectors.js +119 -0
  98. package/dist/src/connectors.js.map +1 -0
  99. package/dist/src/context-files.d.ts +304 -0
  100. package/dist/src/context-files.d.ts.map +1 -0
  101. package/dist/src/context-files.js +247 -0
  102. package/dist/src/context-files.js.map +1 -0
  103. package/dist/src/context.d.ts +369 -0
  104. package/dist/src/context.d.ts.map +1 -0
  105. package/dist/src/context.js +526 -0
  106. package/dist/src/context.js.map +1 -0
  107. package/dist/src/direct-asks.d.ts +36 -0
  108. package/dist/src/direct-asks.d.ts.map +1 -0
  109. package/dist/src/direct-asks.js +43 -0
  110. package/dist/src/direct-asks.js.map +1 -0
  111. package/dist/src/envelope.d.ts +70 -0
  112. package/dist/src/envelope.d.ts.map +1 -0
  113. package/dist/src/envelope.js +46 -0
  114. package/dist/src/envelope.js.map +1 -0
  115. package/dist/src/events/catalogue.d.ts +50 -0
  116. package/dist/src/events/catalogue.d.ts.map +1 -0
  117. package/dist/src/events/catalogue.js +70 -0
  118. package/dist/src/events/catalogue.js.map +1 -0
  119. package/dist/src/events/chips-to-harness.d.ts +37 -0
  120. package/dist/src/events/chips-to-harness.d.ts.map +1 -0
  121. package/dist/src/events/chips-to-harness.js +511 -0
  122. package/dist/src/events/chips-to-harness.js.map +1 -0
  123. package/dist/src/events/harness-to-chips.d.ts +38 -0
  124. package/dist/src/events/harness-to-chips.d.ts.map +1 -0
  125. package/dist/src/events/harness-to-chips.js +593 -0
  126. package/dist/src/events/harness-to-chips.js.map +1 -0
  127. package/dist/src/events/index.d.ts +6 -0
  128. package/dist/src/events/index.d.ts.map +1 -0
  129. package/dist/src/events/index.js +5 -0
  130. package/dist/src/events/index.js.map +1 -0
  131. package/dist/src/events/workspace.d.ts +222 -0
  132. package/dist/src/events/workspace.d.ts.map +1 -0
  133. package/dist/src/events/workspace.js +1039 -0
  134. package/dist/src/events/workspace.js.map +1 -0
  135. package/dist/src/exchange.d.ts +262 -0
  136. package/dist/src/exchange.d.ts.map +1 -0
  137. package/dist/src/exchange.js +413 -0
  138. package/dist/src/exchange.js.map +1 -0
  139. package/dist/src/first-names.d.ts +29 -0
  140. package/dist/src/first-names.d.ts.map +1 -0
  141. package/dist/src/first-names.js +80 -0
  142. package/dist/src/first-names.js.map +1 -0
  143. package/dist/src/frames.d.ts +526 -0
  144. package/dist/src/frames.d.ts.map +1 -0
  145. package/dist/src/frames.js +346 -0
  146. package/dist/src/frames.js.map +1 -0
  147. package/dist/src/harness-jobs.d.ts +313 -0
  148. package/dist/src/harness-jobs.d.ts.map +1 -0
  149. package/dist/src/harness-jobs.js +210 -0
  150. package/dist/src/harness-jobs.js.map +1 -0
  151. package/dist/src/ids/index.d.ts +3 -0
  152. package/dist/src/ids/index.d.ts.map +1 -0
  153. package/dist/src/ids/index.js +2 -0
  154. package/dist/src/ids/index.js.map +1 -0
  155. package/dist/src/ids/ulid.d.ts +96 -0
  156. package/dist/src/ids/ulid.d.ts.map +1 -0
  157. package/dist/src/ids/ulid.js +212 -0
  158. package/dist/src/ids/ulid.js.map +1 -0
  159. package/dist/src/index.d.ts +81 -0
  160. package/dist/src/index.d.ts.map +1 -0
  161. package/dist/src/index.js +47 -0
  162. package/dist/src/index.js.map +1 -0
  163. package/dist/src/invite-link.d.ts +64 -0
  164. package/dist/src/invite-link.d.ts.map +1 -0
  165. package/dist/src/invite-link.js +99 -0
  166. package/dist/src/invite-link.js.map +1 -0
  167. package/dist/src/join.d.ts +188 -0
  168. package/dist/src/join.d.ts.map +1 -0
  169. package/dist/src/join.js +190 -0
  170. package/dist/src/join.js.map +1 -0
  171. package/dist/src/limits.d.ts +50 -0
  172. package/dist/src/limits.d.ts.map +1 -0
  173. package/dist/src/limits.js +106 -0
  174. package/dist/src/limits.js.map +1 -0
  175. package/dist/src/matters.d.ts +22 -0
  176. package/dist/src/matters.d.ts.map +1 -0
  177. package/dist/src/matters.js +26 -0
  178. package/dist/src/matters.js.map +1 -0
  179. package/dist/src/mentions.d.ts +63 -0
  180. package/dist/src/mentions.d.ts.map +1 -0
  181. package/dist/src/mentions.js +129 -0
  182. package/dist/src/mentions.js.map +1 -0
  183. package/dist/src/names.d.ts +58 -0
  184. package/dist/src/names.d.ts.map +1 -0
  185. package/dist/src/names.js +192 -0
  186. package/dist/src/names.js.map +1 -0
  187. package/dist/src/no-reply.d.ts +17 -0
  188. package/dist/src/no-reply.d.ts.map +1 -0
  189. package/dist/src/no-reply.js +48 -0
  190. package/dist/src/no-reply.js.map +1 -0
  191. package/dist/src/notifications.d.ts +81 -0
  192. package/dist/src/notifications.d.ts.map +1 -0
  193. package/dist/src/notifications.js +65 -0
  194. package/dist/src/notifications.js.map +1 -0
  195. package/dist/src/pages.d.ts +32 -0
  196. package/dist/src/pages.d.ts.map +1 -0
  197. package/dist/src/pages.js +32 -0
  198. package/dist/src/pages.js.map +1 -0
  199. package/dist/src/pairing.d.ts +99 -0
  200. package/dist/src/pairing.d.ts.map +1 -0
  201. package/dist/src/pairing.js +163 -0
  202. package/dist/src/pairing.js.map +1 -0
  203. package/dist/src/primitives.d.ts +267 -0
  204. package/dist/src/primitives.d.ts.map +1 -0
  205. package/dist/src/primitives.js +279 -0
  206. package/dist/src/primitives.js.map +1 -0
  207. package/dist/src/project.d.ts +335 -0
  208. package/dist/src/project.d.ts.map +1 -0
  209. package/dist/src/project.js +499 -0
  210. package/dist/src/project.js.map +1 -0
  211. package/dist/src/ranges.d.ts +31 -0
  212. package/dist/src/ranges.d.ts.map +1 -0
  213. package/dist/src/ranges.js +51 -0
  214. package/dist/src/ranges.js.map +1 -0
  215. package/dist/src/relay.d.ts +177 -0
  216. package/dist/src/relay.d.ts.map +1 -0
  217. package/dist/src/relay.js +147 -0
  218. package/dist/src/relay.js.map +1 -0
  219. package/dist/src/room-files.d.ts +146 -0
  220. package/dist/src/room-files.d.ts.map +1 -0
  221. package/dist/src/room-files.js +135 -0
  222. package/dist/src/room-files.js.map +1 -0
  223. package/dist/src/room-note.d.ts +213 -0
  224. package/dist/src/room-note.d.ts.map +1 -0
  225. package/dist/src/room-note.js +457 -0
  226. package/dist/src/room-note.js.map +1 -0
  227. package/dist/src/space-icons.d.ts +68 -0
  228. package/dist/src/space-icons.d.ts.map +1 -0
  229. package/dist/src/space-icons.js +142 -0
  230. package/dist/src/space-icons.js.map +1 -0
  231. package/dist/src/spend.d.ts +57 -0
  232. package/dist/src/spend.d.ts.map +1 -0
  233. package/dist/src/spend.js +94 -0
  234. package/dist/src/spend.js.map +1 -0
  235. package/dist/src/visibility.d.ts +170 -0
  236. package/dist/src/visibility.d.ts.map +1 -0
  237. package/dist/src/visibility.js +218 -0
  238. package/dist/src/visibility.js.map +1 -0
  239. package/fixtures/agent.asked.json +15 -0
  240. package/fixtures/agent.attached.json +15 -0
  241. package/fixtures/agent.deleted.json +16 -0
  242. package/fixtures/agent.fork.json +14 -0
  243. package/fixtures/agent.lock_set.json +13 -0
  244. package/fixtures/agent.registered.json +17 -0
  245. package/fixtures/agent.released.json +16 -0
  246. package/fixtures/agent.updated.json +14 -0
  247. package/fixtures/approval.executed.json +16 -0
  248. package/fixtures/approval.request.json +45 -0
  249. package/fixtures/approval.resolved.json +20 -0
  250. package/fixtures/approval.routed.json +20 -0
  251. package/fixtures/artifact.create.json +18 -0
  252. package/fixtures/attachment.fetched.json +15 -0
  253. package/fixtures/attachment.limits_set.json +15 -0
  254. package/fixtures/budget.warning.json +20 -0
  255. package/fixtures/checkpoint.json +16 -0
  256. package/fixtures/context.compacted.json +16 -0
  257. package/fixtures/context.usage.json +17 -0
  258. package/fixtures/exchange.limits_set.json +15 -0
  259. package/fixtures/exchange.set.json +13 -0
  260. package/fixtures/feedback.json +21 -0
  261. package/fixtures/frames/ack.json +6 -0
  262. package/fixtures/frames/context.edit.json +11 -0
  263. package/fixtures/frames/context_window.change.json +9 -0
  264. package/fixtures/frames/context_window.compact.json +8 -0
  265. package/fixtures/frames/error.json +6 -0
  266. package/fixtures/frames/event.json +20 -0
  267. package/fixtures/frames/events.json +39 -0
  268. package/fixtures/frames/folder.open.json +6 -0
  269. package/fixtures/frames/folder.open.page.json +7 -0
  270. package/fixtures/frames/folder.run.json +8 -0
  271. package/fixtures/frames/folder.run_state.json +12 -0
  272. package/fixtures/frames/heartbeat.change.json +10 -0
  273. package/fixtures/frames/hello.json +18 -0
  274. package/fixtures/frames/job.change.json +9 -0
  275. package/fixtures/frames/join.json +19 -0
  276. package/fixtures/frames/model.change.json +10 -0
  277. package/fixtures/frames/ping.json +4 -0
  278. package/fixtures/frames/pong.json +4 -0
  279. package/fixtures/frames/presence.json +12 -0
  280. package/fixtures/frames/receipt.json +5 -0
  281. package/fixtures/frames/restart.json +5 -0
  282. package/fixtures/frames/subscribe.json +6 -0
  283. package/fixtures/handoff.json +20 -0
  284. package/fixtures/harness.removed.json +15 -0
  285. package/fixtures/harness.transferred.json +15 -0
  286. package/fixtures/hello.json +61 -0
  287. package/fixtures/join.allowed.json +20 -0
  288. package/fixtures/join.denied.json +17 -0
  289. package/fixtures/lane.updated.json +17 -0
  290. package/fixtures/membership.added.json +16 -0
  291. package/fixtures/membership.removed.json +14 -0
  292. package/fixtures/membership.replaced.json +15 -0
  293. package/fixtures/message.deleted.json +15 -0
  294. package/fixtures/message.edited.json +15 -0
  295. package/fixtures/message.handed.json +14 -0
  296. package/fixtures/message.heard.json +14 -0
  297. package/fixtures/message.held.json +14 -0
  298. package/fixtures/message.hidden.json +14 -0
  299. package/fixtures/message.new.json +96 -0
  300. package/fixtures/message.overheard.json +22 -0
  301. package/fixtures/message.pinned.json +14 -0
  302. package/fixtures/message.post.json +14 -0
  303. package/fixtures/message.shown.json +14 -0
  304. package/fixtures/message.unpinned.json +14 -0
  305. package/fixtures/person.face_set.json +17 -0
  306. package/fixtures/person.joined.json +16 -0
  307. package/fixtures/person.removed.json +16 -0
  308. package/fixtures/person.renamed.json +14 -0
  309. package/fixtures/policy.updated.json +30 -0
  310. package/fixtures/project.changed.json +21 -0
  311. package/fixtures/question.answered.json +23 -0
  312. package/fixtures/question.ask.json +37 -0
  313. package/fixtures/receipt.json +15 -0
  314. package/fixtures/relay.set.json +12 -0
  315. package/fixtures/role.changed.json +15 -0
  316. package/fixtures/run.cancel.json +15 -0
  317. package/fixtures/run.completed.json +20 -0
  318. package/fixtures/run.failed.json +20 -0
  319. package/fixtures/run.pause.json +15 -0
  320. package/fixtures/run.plan.json +24 -0
  321. package/fixtures/run.requested.json +34 -0
  322. package/fixtures/run.resume.json +15 -0
  323. package/fixtures/run.started.json +33 -0
  324. package/fixtures/run.status.json +17 -0
  325. package/fixtures/run.steer.json +21 -0
  326. package/fixtures/session.ended.json +15 -0
  327. package/fixtures/session.renamed.json +15 -0
  328. package/fixtures/session.started.json +17 -0
  329. package/fixtures/space.claimed.json +15 -0
  330. package/fixtures/space.created.json +14 -0
  331. package/fixtures/space.erased.json +13 -0
  332. package/fixtures/space.lead_set.json +13 -0
  333. package/fixtures/space.lock_set.json +13 -0
  334. package/fixtures/space.spend_ceiling_set.json +13 -0
  335. package/fixtures/space.updated.json +14 -0
  336. package/fixtures/step.log.json +26 -0
  337. package/fixtures/task.json +22 -0
  338. package/fixtures/turn.passed.json +14 -0
  339. package/fixtures/usage.json +21 -0
  340. package/fixtures/workspace.renamed.json +13 -0
  341. package/generated/agent-connect.json +13966 -0
  342. package/generated/schema/agent.asked.json +114 -0
  343. package/generated/schema/agent.attached.json +465 -0
  344. package/generated/schema/agent.deleted.json +127 -0
  345. package/generated/schema/agent.fork.json +107 -0
  346. package/generated/schema/agent.lock_set.json +105 -0
  347. package/generated/schema/agent.registered.json +130 -0
  348. package/generated/schema/agent.released.json +129 -0
  349. package/generated/schema/agent.updated.json +151 -0
  350. package/generated/schema/approval.executed.json +125 -0
  351. package/generated/schema/approval.request.json +279 -0
  352. package/generated/schema/approval.resolved.json +162 -0
  353. package/generated/schema/approval.routed.json +185 -0
  354. package/generated/schema/artifact.create.json +206 -0
  355. package/generated/schema/attachment.fetched.json +114 -0
  356. package/generated/schema/attachment.limits_set.json +136 -0
  357. package/generated/schema/budget.warning.json +152 -0
  358. package/generated/schema/checkpoint.json +111 -0
  359. package/generated/schema/context.compacted.json +124 -0
  360. package/generated/schema/context.usage.json +120 -0
  361. package/generated/schema/exchange.limits_set.json +127 -0
  362. package/generated/schema/exchange.set.json +144 -0
  363. package/generated/schema/feedback.json +173 -0
  364. package/generated/schema/handoff.json +122 -0
  365. package/generated/schema/harness.removed.json +122 -0
  366. package/generated/schema/harness.transferred.json +117 -0
  367. package/generated/schema/hello.json +509 -0
  368. package/generated/schema/join.allowed.json +176 -0
  369. package/generated/schema/join.denied.json +150 -0
  370. package/generated/schema/lane.updated.json +223 -0
  371. package/generated/schema/membership.added.json +153 -0
  372. package/generated/schema/membership.removed.json +126 -0
  373. package/generated/schema/membership.replaced.json +106 -0
  374. package/generated/schema/message.deleted.json +105 -0
  375. package/generated/schema/message.edited.json +107 -0
  376. package/generated/schema/message.handed.json +111 -0
  377. package/generated/schema/message.heard.json +100 -0
  378. package/generated/schema/message.held.json +181 -0
  379. package/generated/schema/message.hidden.json +100 -0
  380. package/generated/schema/message.new.json +1369 -0
  381. package/generated/schema/message.overheard.json +701 -0
  382. package/generated/schema/message.pinned.json +100 -0
  383. package/generated/schema/message.post.json +290 -0
  384. package/generated/schema/message.shown.json +100 -0
  385. package/generated/schema/message.unpinned.json +100 -0
  386. package/generated/schema/person.face_set.json +134 -0
  387. package/generated/schema/person.joined.json +128 -0
  388. package/generated/schema/person.removed.json +133 -0
  389. package/generated/schema/person.renamed.json +114 -0
  390. package/generated/schema/policy.updated.json +277 -0
  391. package/generated/schema/project.changed.json +199 -0
  392. package/generated/schema/question.answered.json +154 -0
  393. package/generated/schema/question.ask.json +194 -0
  394. package/generated/schema/receipt.json +109 -0
  395. package/generated/schema/relay.set.json +99 -0
  396. package/generated/schema/role.changed.json +116 -0
  397. package/generated/schema/run.cancel.json +106 -0
  398. package/generated/schema/run.completed.json +139 -0
  399. package/generated/schema/run.failed.json +135 -0
  400. package/generated/schema/run.pause.json +106 -0
  401. package/generated/schema/run.plan.json +128 -0
  402. package/generated/schema/run.requested.json +309 -0
  403. package/generated/schema/run.resume.json +106 -0
  404. package/generated/schema/run.started.json +142 -0
  405. package/generated/schema/run.status.json +120 -0
  406. package/generated/schema/run.steer.json +163 -0
  407. package/generated/schema/session.ended.json +106 -0
  408. package/generated/schema/session.renamed.json +108 -0
  409. package/generated/schema/session.started.json +116 -0
  410. package/generated/schema/space.claimed.json +107 -0
  411. package/generated/schema/space.created.json +148 -0
  412. package/generated/schema/space.erased.json +129 -0
  413. package/generated/schema/space.lead_set.json +108 -0
  414. package/generated/schema/space.lock_set.json +99 -0
  415. package/generated/schema/space.spend_ceiling_set.json +102 -0
  416. package/generated/schema/space.updated.json +112 -0
  417. package/generated/schema/step.log.json +187 -0
  418. package/generated/schema/task.json +268 -0
  419. package/generated/schema/turn.passed.json +99 -0
  420. package/generated/schema/usage.json +155 -0
  421. package/generated/schema/workspace.renamed.json +107 -0
  422. package/generated/types.ts +4178 -0
  423. package/package.json +37 -3
@@ -0,0 +1,346 @@
1
+ /**
2
+ * The WebSocket frames of Appendix B. Frames are the envelope around events on `/v1/ws`:
3
+ * they carry the handshake, subscription, acknowledgement and liveness that the event
4
+ * vocabulary itself does not.
5
+ *
6
+ * One endpoint serves people and harnesses (decision 5). Every client-originated `event` frame
7
+ * carries an idempotency key and is answered with `ack {key, seq}`, which is what makes a
8
+ * reconnect safe: replaying a frame the server already applied changes nothing.
9
+ */
10
+ import { z } from "zod";
11
+ import { windowChangeFrame, windowCompactFrame } from "./agent-context-windows.js";
12
+ import { heartbeatChangeFrame } from "./agent-heartbeats.js";
13
+ import { modelChangeFrame } from "./agent-models.js";
14
+ import { contextBudget } from "./context.js";
15
+ import { contextEditFrame } from "./context-files.js";
16
+ import { PROTOCOL_VERSION } from "./envelope.js";
17
+ import { jobChangeFrame } from "./harness-jobs.js";
18
+ import { joinRequestView } from "./join.js";
19
+ import { autonomyLevel, id, isoTimestamp } from "./primitives.js";
20
+ import { heldRun } from "./project.js";
21
+ /** The client's half of the handshake. The server answers with a `hello` event. */
22
+ /**
23
+ * The names a client may give in its `hello`'s `accepts`, and what each brings. Any other name is
24
+ * taken and ignored: a client built for a newer server says what it understands, and an older
25
+ * server, which sends none of it, still answers the hello (ADR 0211, Phase 3). Until then a name
26
+ * the server did not know refused the whole hello, which would have cut every new app off from
27
+ * every older server.
28
+ */
29
+ export const SERVER_EXTENSIONS = [
30
+ "events",
31
+ "presence",
32
+ "restart",
33
+ "join",
34
+ "context",
35
+ "models",
36
+ "heartbeats",
37
+ "context_windows",
38
+ "jobs",
39
+ "folders",
40
+ "folder_runs",
41
+ ];
42
+ export const clientHelloFrame = z
43
+ .object({
44
+ frame: z.literal("hello"),
45
+ protocol: z
46
+ .object({
47
+ min: z.int().positive().describe("Oldest major version the client accepts."),
48
+ max: z.int().positive().describe("Newest major version the client speaks."),
49
+ })
50
+ .describe("The client's range. The server picks the highest version both sides support."),
51
+ client: z
52
+ .object({
53
+ name: z.string().min(1).max(120).describe("The harness or app name."),
54
+ version: z.string().min(1).max(60),
55
+ })
56
+ .describe("Who is connecting, for the connection list and for support."),
57
+ harnesses: z
58
+ .array(z.object({
59
+ harness_id: id("harness"),
60
+ autonomy: autonomyLevel.optional().describe("The level the harness believes it has."),
61
+ }))
62
+ .max(64)
63
+ .optional()
64
+ .describe("Not read by Chips: a connection is its token's, and the server's `hello` names the token's harness and its agents (ADR 0087). Absent for a person's client."),
65
+ since: z
66
+ .int()
67
+ .nonnegative()
68
+ .optional()
69
+ .describe("Not read by Chips: a stream resumes from `subscribe`'s `since`."),
70
+ accepts: z
71
+ .array(z.string().min(1).max(40))
72
+ .max(32)
73
+ .optional()
74
+ .describe("Server frames beyond the base set this client understands, by the names in `SERVER_EXTENSIONS`. A name the server does not know is ignored rather than refused, so a client may name a frame a newer server sends and still be answered by an older one (ADR 0211, Phase 3). A client that says `events` is sent its replay in pages rather than one frame per event; one that says `presence` is sent an agent's state as it changes (ADR 0083); a harness's socket that says `restart` is sent `restart` when a person asks it to restart (ADR 0094); an owner's or admin's that says `join` is sent each join request as it changes (ADR 0122); a harness's that says `context` is sent `context.edit` when a person changes one of its context files (ADR 0134); a harness's that says `models` is sent `model.change` when a person changes an agent's model or effort (ADR 0140); a harness's that says `heartbeats` is sent `heartbeat.change` when a person switches an agent's heartbeat or changes how often it beats (ADR 0143); a harness's that says `context_windows` is sent `context_window.compact` and `context_window.change` when a person asks an agent to compact now or changes the limit it compacts itself at (ADR 0146); a harness's that says `jobs` is sent `job.change` when a person switches one of the jobs it runs on its own (ADR 0252); a person's that says `folders` is sent `folder.open` when they ask, from another of their devices, for a room's folder to be opened in Finder (ADR 0225), and `folder.run` when they ask for its project to be run or stopped there (ADR 0226); a person's that says `folder_runs` is sent `folder.run_state` when their Mac says how a run of theirs stands (ADR 0226); one that says nothing is sent what it was always sent, since an unknown frame is dropped in silence."),
75
+ context: contextBudget
76
+ .optional()
77
+ .describe("How much of a room a harness is handed with each message for it (ADR 0088): 40 lines and 16,000 characters when absent, 200 and 32,000 at most. For this connection. A person's client is handed none."),
78
+ })
79
+ .describe("The first frame a client sends.");
80
+ export const subscribeFrame = z
81
+ .object({
82
+ frame: z.literal("subscribe"),
83
+ workspace_id: id("workspace"),
84
+ space_ids: z
85
+ .array(id("space"))
86
+ .max(200)
87
+ .optional()
88
+ .describe("Narrow to these spaces. Absent means the whole workspace."),
89
+ since: z
90
+ .int()
91
+ .nonnegative()
92
+ .optional()
93
+ .describe("Replay from this `seq` before streaming live."),
94
+ })
95
+ .describe("Ask for a stream. Subscriptions are keyed by workspace and space.");
96
+ export const eventFrame = z
97
+ .object({
98
+ frame: z.literal("event"),
99
+ /** Validated against the catalogue, not here: the frame layer only routes. */
100
+ event: z.record(z.string(), z.unknown()).describe("Any Agent Connect event."),
101
+ })
102
+ .describe("Carries one event in either direction.");
103
+ export const eventsFrame = z
104
+ .object({
105
+ frame: z.literal("events"),
106
+ events: z
107
+ .array(z.record(z.string(), z.unknown()))
108
+ .max(500)
109
+ .describe("A page of events, in `seq` order. One store page, as the replay reads them."),
110
+ })
111
+ .describe("A page of a replay, for a client that asked for them in `hello`. Live events are always single `event` frames.");
112
+ export const ackFrame = z
113
+ .object({
114
+ frame: z.literal("ack"),
115
+ idempotency_key: z
116
+ .string()
117
+ .min(1)
118
+ .max(200)
119
+ .describe("The key from the frame being acknowledged."),
120
+ seq: z.int().positive().describe("The sequence number the event was appended at."),
121
+ duplicate: z
122
+ .boolean()
123
+ .default(false)
124
+ .describe("True when this key had already been applied, so nothing changed."),
125
+ lane: z
126
+ .object({
127
+ lane_id: z.string().min(1).max(120),
128
+ run_id: z.string().min(1).max(120).describe("The specialist's run, which the lane is."),
129
+ space_id: z.string().min(1).max(120).describe("The lane's home."),
130
+ })
131
+ .optional()
132
+ .describe("For a `task` that opened a lane: where it lives and which run it is, so a lead that drives the lane itself — a subagent, a Space handed down to — knows where to post. Absent when the task was flattened into a step."),
133
+ held: z
134
+ .literal(true)
135
+ .optional()
136
+ .describe("The message is in the room, but Chips held it from the agents it named (ADR 0097): the agents have sent each other `exchange.allowance` messages since a person last acted, or a person paused them. Tell the model, so it stops and says what is done and what is blocked rather than waiting on them."),
137
+ exchange: z
138
+ .object({
139
+ count: z.int().nonnegative(),
140
+ allowance: z.int().positive().optional(),
141
+ })
142
+ .optional()
143
+ .describe("With `held`: the messages between agents since the reset, and the workspace's hold (ADR 0187), absent when it holds them only on a pause."),
144
+ })
145
+ .describe("The server's answer to a client-originated event.");
146
+ export const receiptFrame = z
147
+ .object({
148
+ frame: z.literal("receipt"),
149
+ idempotency_key: z.string().min(1).max(200),
150
+ disposition: z
151
+ .enum(["queued", "steered"])
152
+ .describe("What Chips did with a message sent mid-run."),
153
+ })
154
+ .describe("Tells a sender whether their mid-run message was queued or steered.");
155
+ /**
156
+ * What Chips knows now of a harness (ADR 0083): whether a socket of it is open, and any trouble it
157
+ * reported. State, not history: chipsd keeps it in memory and writes none of it to the log.
158
+ */
159
+ export const agentState = z
160
+ .object({
161
+ connected: z
162
+ .boolean()
163
+ .describe("Whether a socket of it is open. Offline only after 15 seconds without one, so a reconnect never flashes."),
164
+ since: isoTimestamp.describe("When it connected, or when it went offline."),
165
+ trouble: z
166
+ .object({
167
+ reason: z.string().min(1).max(200).describe("What it said is wrong, in one line."),
168
+ since: isoTimestamp.describe("When it first said so."),
169
+ })
170
+ .optional()
171
+ .describe("What the harness says is wrong on its side (`PUT /v1/harnesses/:id/status`). Gone when it says it is fine, or when it goes offline."),
172
+ restarting: z
173
+ .object({
174
+ since: isoTimestamp.describe("When a person asked."),
175
+ by: id("person").describe("Who asked."),
176
+ })
177
+ .optional()
178
+ .describe("A person asked it to restart (`POST /v1/harnesses/:id/restart`, ADR 0094). Gone at its next word, a socket that opens or a status it reports, or three minutes after the ask."),
179
+ })
180
+ .describe("Whether an agent can answer: connected, not in trouble, and not restarting.");
181
+ export const presenceFrame = z
182
+ .object({
183
+ frame: z.literal("presence"),
184
+ participant_id: id("harness"),
185
+ state: agentState,
186
+ })
187
+ .describe("An agent's state changed (ADR 0083). Sent to a person's socket that said `presence` in its `hello`.");
188
+ export const restartFrame = z
189
+ .object({
190
+ frame: z.literal("restart"),
191
+ asked_by: id("person").describe("The person who asked."),
192
+ asked_at: isoTimestamp.describe("When they asked."),
193
+ })
194
+ .describe("A person asks the harness to restart (ADR 0094). Sent to a harness's socket that said `restart` in its `hello`, now or never: it is not in the log, so a reconnect never hears it again. What runs is the harness's own restart.");
195
+ export const folderOpenFrame = z
196
+ .object({
197
+ frame: z.literal("folder.open"),
198
+ space_id: id("space").describe("The room whose folder, or page, to open."),
199
+ what: z
200
+ .enum(["folder", "page"])
201
+ .optional()
202
+ .describe("`page`: open the room's start page, or its one document, in Chips for Mac (ADR 0227). Left out, the folder in Finder."),
203
+ asked_from: z.string().min(1).max(120).describe("The name of the device that asked: `iPhone`."),
204
+ asked_at: isoTimestamp.describe("When they asked."),
205
+ })
206
+ .describe("A person asks their own Mac to open a room's folder in Finder (ADR 0225), or its page in Chips for Mac (ADR 0227), from another of their devices. Sent to that person's sockets that said `folders` in their `hello`, now or never: it is not in the log. The Mac finds the folder and the page itself: nothing here is a path.");
207
+ export const folderRunFrame = z
208
+ .object({
209
+ frame: z.literal("folder.run"),
210
+ space_id: id("space").describe("The room whose project to run, or stop."),
211
+ op: z.enum(["run", "stop"]),
212
+ command: z
213
+ .string()
214
+ .min(1)
215
+ .max(1100)
216
+ .optional()
217
+ .describe("For `run`, what the asking device showed would run: the Mac runs nothing else, and says so when its folder's run file says something different."),
218
+ asked_from: z.string().min(1).max(120).describe("The name of the device that asked: `iPhone`."),
219
+ asked_at: isoTimestamp.describe("When they asked."),
220
+ })
221
+ .describe("A person asks their own Mac to run a room's project as its run file says, or to stop it (ADR 0226), from another of their devices. Sent to that person's sockets that said `folders` in their `hello`, now or never: it is not in the log. Nothing here is a command: the Mac reads it from the room's folder.");
222
+ export const folderRunStateFrame = z
223
+ .object({
224
+ frame: z.literal("folder.run_state"),
225
+ space_id: id("space"),
226
+ run: heldRun,
227
+ })
228
+ .describe("How a person's run of a room's project on their Mac stands (ADR 0226), as that Mac said it. Sent to that person's sockets that said `folder_runs` in their `hello`, never to anyone else's, now or never: `GET /v1/spaces/:id/project/run` reads it again.");
229
+ export const joinFrame = z
230
+ .object({
231
+ frame: z.literal("join"),
232
+ request: joinRequestView,
233
+ })
234
+ .describe("A join request is waiting, or changed (ADR 0122): asked, allowed, refused, expired or redeemed. Sent to an owner's or admin's socket that said `join` in its `hello`, now or never; `GET /v1/join` reads what is waiting after a reconnect.");
235
+ export const pingFrame = z
236
+ .object({
237
+ frame: z.literal("ping"),
238
+ ts: z
239
+ .int()
240
+ .nonnegative()
241
+ .describe("Sender's clock, in milliseconds, for a round-trip estimate."),
242
+ })
243
+ .describe("Heartbeat. Every twenty seconds; a silent socket is closed at sixty.");
244
+ export const pongFrame = z
245
+ .object({ frame: z.literal("pong"), ts: z.int().nonnegative() })
246
+ .describe("The answer to a ping, echoing its timestamp.");
247
+ /** Error codes are a closed set so a client can branch on them without parsing prose. */
248
+ export const errorCode = z.enum([
249
+ "protocol_unsupported",
250
+ "unauthorized",
251
+ "forbidden",
252
+ "not_found",
253
+ "invalid_event",
254
+ "invalid_frame",
255
+ "rate_limited",
256
+ "payload_too_large",
257
+ "too_far_behind",
258
+ "budget_exhausted",
259
+ "stale_file",
260
+ "stale_context",
261
+ "internal",
262
+ ]);
263
+ export const errorFrame = z
264
+ .object({
265
+ frame: z.literal("error"),
266
+ code: errorCode,
267
+ message: z.string().min(1).max(2000).describe("What went wrong, in the product voice."),
268
+ idempotency_key: z
269
+ .string()
270
+ .max(200)
271
+ .optional()
272
+ .describe("The frame at fault, when there was one."),
273
+ retry_after_seconds: z.int().nonnegative().optional().describe("When rate limited."),
274
+ refusal: z
275
+ .string()
276
+ .min(1)
277
+ .max(60)
278
+ .optional()
279
+ .describe("Which rule refused the event, for a client that offers a way on: `agent_elsewhere`, `lead_room`, `agent_archived`, `room_closed` (ADR 0087), `agent_deleted` (ADR 0095)."),
280
+ space_id: z
281
+ .string()
282
+ .min(1)
283
+ .max(120)
284
+ .optional()
285
+ .describe("For `agent_elsewhere`: the room the agent is in, where Move takes it from."),
286
+ })
287
+ .describe("Something went wrong. `too_far_behind` means resume with `since`.");
288
+ export const clientFrame = z
289
+ .discriminatedUnion("frame", [clientHelloFrame, subscribeFrame, eventFrame, pingFrame, pongFrame])
290
+ .describe("Anything a client may send.");
291
+ export const serverFrame = z
292
+ .discriminatedUnion("frame", [
293
+ eventFrame,
294
+ eventsFrame,
295
+ ackFrame,
296
+ receiptFrame,
297
+ presenceFrame,
298
+ restartFrame,
299
+ joinFrame,
300
+ folderOpenFrame,
301
+ folderRunFrame,
302
+ folderRunStateFrame,
303
+ contextEditFrame,
304
+ modelChangeFrame,
305
+ heartbeatChangeFrame,
306
+ windowCompactFrame,
307
+ windowChangeFrame,
308
+ jobChangeFrame,
309
+ pingFrame,
310
+ pongFrame,
311
+ errorFrame,
312
+ ])
313
+ .describe("Anything the server may send.");
314
+ export const FRAME_NAMES = [
315
+ "hello",
316
+ "subscribe",
317
+ "event",
318
+ "events",
319
+ "ack",
320
+ "receipt",
321
+ "presence",
322
+ "restart",
323
+ "join",
324
+ "folder.open",
325
+ "folder.run",
326
+ "folder.run_state",
327
+ "context.edit",
328
+ "model.change",
329
+ "heartbeat.change",
330
+ "context_window.compact",
331
+ "context_window.change",
332
+ "job.change",
333
+ "ping",
334
+ "pong",
335
+ "error",
336
+ ];
337
+ /**
338
+ * Pick the version both sides speak, or nothing when the ranges do not overlap.
339
+ * `hello` negotiates `{min, max}` (decision 7).
340
+ */
341
+ export function negotiateProtocol(client, server = { min: PROTOCOL_VERSION, max: PROTOCOL_VERSION }) {
342
+ const highest = Math.min(client.max, server.max);
343
+ const lowest = Math.max(client.min, server.min);
344
+ return highest >= lowest ? highest : undefined;
345
+ }
346
+ //# sourceMappingURL=frames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frames.js","sourceRoot":"","sources":["../../src/frames.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7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AAS;IACT,eAAe;IACf,cAAc;IACd,mBAAmB;IACnB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,kBAAkB;IAClB,iBAAiB;IACjB,cAAc;IACd,SAAS;IACT,SAAS;IACT,UAAU;CACX,CAAC;KACD,QAAQ,CAAC,+BAA+B,CAAC,CAAC;AAG7C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO;IACP,WAAW;IACX,OAAO;IACP,QAAQ;IACR,KAAK;IACL,SAAS;IACT,UAAU;IACV,SAAS;IACT,MAAM;IACN,aAAa;IACb,YAAY;IACZ,kBAAkB;IAClB,cAAc;IACd,cAAc;IACd,kBAAkB;IAClB,wBAAwB;IACxB,uBAAuB;IACvB,YAAY;IACZ,MAAM;IACN,MAAM;IACN,OAAO;CACC,CAAC;AAEX;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAoC,EACpC,SAAuC,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,EAAE;IAEvF,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAChD,OAAO,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC"}
@@ -0,0 +1,313 @@
1
+ /**
2
+ * A harness's own jobs (ADR 0252): what it runs by itself, outside any space, on a schedule of its
3
+ * own. OpenClaw's are its Main agent's Heartbeat, Dreaming and a Skill review for each agent.
4
+ *
5
+ * Nothing about a job is Chips'. A harness that declares `jobs` sends a copy of all of them
6
+ * (`PUT /v1/harnesses/:id/jobs`), whole, and posts each run it finishes (`POST …/jobs/runs`),
7
+ * which Chips keeps for `JOB_RUNS_KEPT_DAYS`. A person's change goes down the harness's socket as
8
+ * a `job.change` frame, and is done when the harness sends its copy again, answering it.
9
+ */
10
+ import { z } from "zod";
11
+ /** The most jobs a harness's copy lists. */
12
+ export declare const HARNESS_JOBS_MAX = 24;
13
+ /** The most intervals a job offers a person. */
14
+ export declare const JOB_CHOICES_MAX = 12;
15
+ /** The longest interval, in minutes: a year. */
16
+ export declare const JOB_EVERY_MAX = 525600;
17
+ /** The most runs one post carries. */
18
+ export declare const JOB_RUNS_POST_MAX = 200;
19
+ /** The most runs one read gives. */
20
+ export declare const JOB_RUNS_READ_MAX = 500;
21
+ /** How long Chips keeps a run, in days: a harness that keeps a week can still be read for two. */
22
+ export declare const JOB_RUNS_KEPT_DAYS = 90;
23
+ /**
24
+ * How long a change waits for its harness's answer, as a heartbeat's does (ADR 0143). After it the
25
+ * change reads as missed; an answer after it still counts, and a new change may be asked.
26
+ */
27
+ export declare const JOB_CHANGE_WAIT_MS = 60000;
28
+ /** What a job does, for the mark its row wears. */
29
+ export declare const JOB_KINDS: readonly ["heartbeat", "memory", "skills", "other"];
30
+ export declare const jobKind: z.ZodEnum<{
31
+ memory: "memory";
32
+ other: "other";
33
+ heartbeat: "heartbeat";
34
+ skills: "skills";
35
+ }>;
36
+ export type JobKind = z.infer<typeof jobKind>;
37
+ /** How a run ended. */
38
+ export declare const JOB_RUN_OUTCOMES: readonly ["done", "failed", "stopped"];
39
+ export declare const jobRunOutcome: z.ZodEnum<{
40
+ failed: "failed";
41
+ done: "done";
42
+ stopped: "stopped";
43
+ }>;
44
+ export type JobRunOutcome = z.infer<typeof jobRunOutcome>;
45
+ export declare const jobId: z.ZodString;
46
+ export declare const harnessJob: z.ZodObject<{
47
+ job_id: z.ZodString;
48
+ name: z.ZodString;
49
+ about: z.ZodString;
50
+ kind: z.ZodEnum<{
51
+ memory: "memory";
52
+ other: "other";
53
+ heartbeat: "heartbeat";
54
+ skills: "skills";
55
+ }>;
56
+ every: z.ZodOptional<z.ZodInt>;
57
+ when: z.ZodOptional<z.ZodString>;
58
+ next_at: z.ZodOptional<z.ZodISODateTime>;
59
+ for_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
+ on: z.ZodBoolean;
61
+ editable: z.ZodBoolean;
62
+ why_read_only: z.ZodOptional<z.ZodString>;
63
+ choices: z.ZodOptional<z.ZodArray<z.ZodInt>>;
64
+ }, z.core.$strip>;
65
+ export type HarnessJob = z.infer<typeof harnessJob>;
66
+ export declare const harnessJobsPut: z.ZodObject<{
67
+ jobs: z.ZodArray<z.ZodObject<{
68
+ job_id: z.ZodString;
69
+ name: z.ZodString;
70
+ about: z.ZodString;
71
+ kind: z.ZodEnum<{
72
+ memory: "memory";
73
+ other: "other";
74
+ heartbeat: "heartbeat";
75
+ skills: "skills";
76
+ }>;
77
+ every: z.ZodOptional<z.ZodInt>;
78
+ when: z.ZodOptional<z.ZodString>;
79
+ next_at: z.ZodOptional<z.ZodISODateTime>;
80
+ for_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
81
+ on: z.ZodBoolean;
82
+ editable: z.ZodBoolean;
83
+ why_read_only: z.ZodOptional<z.ZodString>;
84
+ choices: z.ZodOptional<z.ZodArray<z.ZodInt>>;
85
+ }, z.core.$strip>>;
86
+ answers: z.ZodOptional<z.ZodString>;
87
+ refuses: z.ZodOptional<z.ZodObject<{
88
+ change_id: z.ZodString;
89
+ message: z.ZodOptional<z.ZodString>;
90
+ }, z.core.$strip>>;
91
+ }, z.core.$strip>;
92
+ export type HarnessJobsPut = z.infer<typeof harnessJobsPut>;
93
+ /** The copy as Chips keeps it: what the harness sent, without what it answered. */
94
+ export type HarnessJobsCopy = Omit<HarnessJobsPut, "answers" | "refuses">;
95
+ export declare const jobRun: z.ZodObject<{
96
+ job_id: z.ZodString;
97
+ run_id: z.ZodString;
98
+ started_at: z.ZodISODateTime;
99
+ ended_at: z.ZodISODateTime;
100
+ outcome: z.ZodEnum<{
101
+ failed: "failed";
102
+ done: "done";
103
+ stopped: "stopped";
104
+ }>;
105
+ quiet: z.ZodOptional<z.ZodBoolean>;
106
+ waited: z.ZodOptional<z.ZodBoolean>;
107
+ error: z.ZodOptional<z.ZodString>;
108
+ agent_id: z.ZodOptional<z.ZodString>;
109
+ cost_usd: z.ZodOptional<z.ZodNumber>;
110
+ tokens: z.ZodOptional<z.ZodInt>;
111
+ model: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strip>;
113
+ export type JobRun = z.infer<typeof jobRun>;
114
+ export declare const jobRunsPost: z.ZodObject<{
115
+ runs: z.ZodArray<z.ZodObject<{
116
+ job_id: z.ZodString;
117
+ run_id: z.ZodString;
118
+ started_at: z.ZodISODateTime;
119
+ ended_at: z.ZodISODateTime;
120
+ outcome: z.ZodEnum<{
121
+ failed: "failed";
122
+ done: "done";
123
+ stopped: "stopped";
124
+ }>;
125
+ quiet: z.ZodOptional<z.ZodBoolean>;
126
+ waited: z.ZodOptional<z.ZodBoolean>;
127
+ error: z.ZodOptional<z.ZodString>;
128
+ agent_id: z.ZodOptional<z.ZodString>;
129
+ cost_usd: z.ZodOptional<z.ZodNumber>;
130
+ tokens: z.ZodOptional<z.ZodInt>;
131
+ model: z.ZodOptional<z.ZodString>;
132
+ }, z.core.$strip>>;
133
+ }, z.core.$strip>;
134
+ export type JobRunsPost = z.infer<typeof jobRunsPost>;
135
+ export declare const jobChangeAsk: z.ZodObject<{
136
+ on: z.ZodBoolean;
137
+ every: z.ZodOptional<z.ZodInt>;
138
+ }, z.core.$strip>;
139
+ export type JobChangeAsk = z.infer<typeof jobChangeAsk>;
140
+ export declare const JOB_CHANGE_STATES: readonly ["waiting", "saved", "failed", "missed"];
141
+ export declare const jobChangeState: z.ZodEnum<{
142
+ waiting: "waiting";
143
+ saved: "saved";
144
+ failed: "failed";
145
+ missed: "missed";
146
+ }>;
147
+ export type JobChangeState = z.infer<typeof jobChangeState>;
148
+ export declare const jobChangeView: z.ZodObject<{
149
+ change_id: z.ZodString;
150
+ state: z.ZodEnum<{
151
+ waiting: "waiting";
152
+ saved: "saved";
153
+ failed: "failed";
154
+ missed: "missed";
155
+ }>;
156
+ on: z.ZodBoolean;
157
+ every: z.ZodOptional<z.ZodInt>;
158
+ asked_at: z.ZodISODateTime;
159
+ answered_at: z.ZodOptional<z.ZodISODateTime>;
160
+ message: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>;
162
+ export type JobChangeView = z.infer<typeof jobChangeView>;
163
+ export declare const harnessJobView: z.ZodObject<{
164
+ week_usd: z.ZodOptional<z.ZodNumber>;
165
+ week_runs: z.ZodInt;
166
+ runs_total: z.ZodInt;
167
+ last_run: z.ZodOptional<z.ZodObject<{
168
+ job_id: z.ZodString;
169
+ run_id: z.ZodString;
170
+ started_at: z.ZodISODateTime;
171
+ ended_at: z.ZodISODateTime;
172
+ outcome: z.ZodEnum<{
173
+ failed: "failed";
174
+ done: "done";
175
+ stopped: "stopped";
176
+ }>;
177
+ quiet: z.ZodOptional<z.ZodBoolean>;
178
+ waited: z.ZodOptional<z.ZodBoolean>;
179
+ error: z.ZodOptional<z.ZodString>;
180
+ agent_id: z.ZodOptional<z.ZodString>;
181
+ cost_usd: z.ZodOptional<z.ZodNumber>;
182
+ tokens: z.ZodOptional<z.ZodInt>;
183
+ model: z.ZodOptional<z.ZodString>;
184
+ }, z.core.$strip>>;
185
+ change: z.ZodOptional<z.ZodObject<{
186
+ change_id: z.ZodString;
187
+ state: z.ZodEnum<{
188
+ waiting: "waiting";
189
+ saved: "saved";
190
+ failed: "failed";
191
+ missed: "missed";
192
+ }>;
193
+ on: z.ZodBoolean;
194
+ every: z.ZodOptional<z.ZodInt>;
195
+ asked_at: z.ZodISODateTime;
196
+ answered_at: z.ZodOptional<z.ZodISODateTime>;
197
+ message: z.ZodOptional<z.ZodString>;
198
+ }, z.core.$strip>>;
199
+ job_id: z.ZodString;
200
+ name: z.ZodString;
201
+ about: z.ZodString;
202
+ kind: z.ZodEnum<{
203
+ memory: "memory";
204
+ other: "other";
205
+ heartbeat: "heartbeat";
206
+ skills: "skills";
207
+ }>;
208
+ every: z.ZodOptional<z.ZodInt>;
209
+ when: z.ZodOptional<z.ZodString>;
210
+ next_at: z.ZodOptional<z.ZodISODateTime>;
211
+ for_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
212
+ on: z.ZodBoolean;
213
+ editable: z.ZodBoolean;
214
+ why_read_only: z.ZodOptional<z.ZodString>;
215
+ choices: z.ZodOptional<z.ZodArray<z.ZodInt>>;
216
+ }, z.core.$strip>;
217
+ export type HarnessJobView = z.infer<typeof harnessJobView>;
218
+ export declare const harnessJobsView: z.ZodObject<{
219
+ harness_id: z.ZodString;
220
+ jobs: z.ZodArray<z.ZodObject<{
221
+ week_usd: z.ZodOptional<z.ZodNumber>;
222
+ week_runs: z.ZodInt;
223
+ runs_total: z.ZodInt;
224
+ last_run: z.ZodOptional<z.ZodObject<{
225
+ job_id: z.ZodString;
226
+ run_id: z.ZodString;
227
+ started_at: z.ZodISODateTime;
228
+ ended_at: z.ZodISODateTime;
229
+ outcome: z.ZodEnum<{
230
+ failed: "failed";
231
+ done: "done";
232
+ stopped: "stopped";
233
+ }>;
234
+ quiet: z.ZodOptional<z.ZodBoolean>;
235
+ waited: z.ZodOptional<z.ZodBoolean>;
236
+ error: z.ZodOptional<z.ZodString>;
237
+ agent_id: z.ZodOptional<z.ZodString>;
238
+ cost_usd: z.ZodOptional<z.ZodNumber>;
239
+ tokens: z.ZodOptional<z.ZodInt>;
240
+ model: z.ZodOptional<z.ZodString>;
241
+ }, z.core.$strip>>;
242
+ change: z.ZodOptional<z.ZodObject<{
243
+ change_id: z.ZodString;
244
+ state: z.ZodEnum<{
245
+ waiting: "waiting";
246
+ saved: "saved";
247
+ failed: "failed";
248
+ missed: "missed";
249
+ }>;
250
+ on: z.ZodBoolean;
251
+ every: z.ZodOptional<z.ZodInt>;
252
+ asked_at: z.ZodISODateTime;
253
+ answered_at: z.ZodOptional<z.ZodISODateTime>;
254
+ message: z.ZodOptional<z.ZodString>;
255
+ }, z.core.$strip>>;
256
+ job_id: z.ZodString;
257
+ name: z.ZodString;
258
+ about: z.ZodString;
259
+ kind: z.ZodEnum<{
260
+ memory: "memory";
261
+ other: "other";
262
+ heartbeat: "heartbeat";
263
+ skills: "skills";
264
+ }>;
265
+ every: z.ZodOptional<z.ZodInt>;
266
+ when: z.ZodOptional<z.ZodString>;
267
+ next_at: z.ZodOptional<z.ZodISODateTime>;
268
+ for_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
269
+ on: z.ZodBoolean;
270
+ editable: z.ZodBoolean;
271
+ why_read_only: z.ZodOptional<z.ZodString>;
272
+ choices: z.ZodOptional<z.ZodArray<z.ZodInt>>;
273
+ }, z.core.$strip>>;
274
+ read_at: z.ZodISODateTime;
275
+ away: z.ZodBoolean;
276
+ }, z.core.$strip>;
277
+ export type HarnessJobsView = z.infer<typeof harnessJobsView>;
278
+ export declare const jobRunsView: z.ZodObject<{
279
+ harness_id: z.ZodString;
280
+ job_id: z.ZodString;
281
+ runs: z.ZodArray<z.ZodObject<{
282
+ job_id: z.ZodString;
283
+ run_id: z.ZodString;
284
+ started_at: z.ZodISODateTime;
285
+ ended_at: z.ZodISODateTime;
286
+ outcome: z.ZodEnum<{
287
+ failed: "failed";
288
+ done: "done";
289
+ stopped: "stopped";
290
+ }>;
291
+ quiet: z.ZodOptional<z.ZodBoolean>;
292
+ waited: z.ZodOptional<z.ZodBoolean>;
293
+ error: z.ZodOptional<z.ZodString>;
294
+ agent_id: z.ZodOptional<z.ZodString>;
295
+ cost_usd: z.ZodOptional<z.ZodNumber>;
296
+ tokens: z.ZodOptional<z.ZodInt>;
297
+ model: z.ZodOptional<z.ZodString>;
298
+ }, z.core.$strip>>;
299
+ more: z.ZodBoolean;
300
+ }, z.core.$strip>;
301
+ export type JobRunsView = z.infer<typeof jobRunsView>;
302
+ export declare const jobChangeFrame: z.ZodObject<{
303
+ frame: z.ZodLiteral<"job.change">;
304
+ change_id: z.ZodString;
305
+ harness_id: z.ZodString;
306
+ job_id: z.ZodString;
307
+ on: z.ZodBoolean;
308
+ every: z.ZodOptional<z.ZodInt>;
309
+ asked_by: z.ZodString;
310
+ asked_at: z.ZodISODateTime;
311
+ }, z.core.$strip>;
312
+ export type JobChangeFrame = z.infer<typeof jobChangeFrame>;
313
+ //# sourceMappingURL=harness-jobs.d.ts.map