@chipschat/protocol 0.0.0-stage → 1.0.1

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 (371) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +56 -2
  3. package/dist/generated/types.d.ts +4052 -0
  4. package/dist/generated/types.d.ts.map +1 -0
  5. package/dist/generated/types.js +7 -0
  6. package/dist/generated/types.js.map +1 -0
  7. package/dist/src/address.d.ts +106 -0
  8. package/dist/src/address.d.ts.map +1 -0
  9. package/dist/src/address.js +141 -0
  10. package/dist/src/address.js.map +1 -0
  11. package/dist/src/agent-context-windows.d.ts +235 -0
  12. package/dist/src/agent-context-windows.d.ts.map +1 -0
  13. package/dist/src/agent-context-windows.js +213 -0
  14. package/dist/src/agent-context-windows.js.map +1 -0
  15. package/dist/src/agent-heartbeats.d.ts +106 -0
  16. package/dist/src/agent-heartbeats.d.ts.map +1 -0
  17. package/dist/src/agent-heartbeats.js +111 -0
  18. package/dist/src/agent-heartbeats.js.map +1 -0
  19. package/dist/src/agent-models.d.ts +158 -0
  20. package/dist/src/agent-models.d.ts.map +1 -0
  21. package/dist/src/agent-models.js +171 -0
  22. package/dist/src/agent-models.js.map +1 -0
  23. package/dist/src/agent-place.d.ts +76 -0
  24. package/dist/src/agent-place.d.ts.map +1 -0
  25. package/dist/src/agent-place.js +80 -0
  26. package/dist/src/agent-place.js.map +1 -0
  27. package/dist/src/agents.d.ts +24 -0
  28. package/dist/src/agents.d.ts.map +1 -0
  29. package/dist/src/agents.js +58 -0
  30. package/dist/src/agents.js.map +1 -0
  31. package/dist/src/capabilities.d.ts +121 -0
  32. package/dist/src/capabilities.d.ts.map +1 -0
  33. package/dist/src/capabilities.js +120 -0
  34. package/dist/src/capabilities.js.map +1 -0
  35. package/dist/src/checklist.d.ts +19 -0
  36. package/dist/src/checklist.d.ts.map +1 -0
  37. package/dist/src/checklist.js +22 -0
  38. package/dist/src/checklist.js.map +1 -0
  39. package/dist/src/commands.d.ts +50 -0
  40. package/dist/src/commands.d.ts.map +1 -0
  41. package/dist/src/commands.js +274 -0
  42. package/dist/src/commands.js.map +1 -0
  43. package/dist/src/connectors.d.ts +90 -0
  44. package/dist/src/connectors.d.ts.map +1 -0
  45. package/dist/src/connectors.js +119 -0
  46. package/dist/src/connectors.js.map +1 -0
  47. package/dist/src/context-files.d.ts +304 -0
  48. package/dist/src/context-files.d.ts.map +1 -0
  49. package/dist/src/context-files.js +247 -0
  50. package/dist/src/context-files.js.map +1 -0
  51. package/dist/src/context.d.ts +369 -0
  52. package/dist/src/context.d.ts.map +1 -0
  53. package/dist/src/context.js +526 -0
  54. package/dist/src/context.js.map +1 -0
  55. package/dist/src/direct-asks.d.ts +36 -0
  56. package/dist/src/direct-asks.d.ts.map +1 -0
  57. package/dist/src/direct-asks.js +43 -0
  58. package/dist/src/direct-asks.js.map +1 -0
  59. package/dist/src/envelope.d.ts +70 -0
  60. package/dist/src/envelope.d.ts.map +1 -0
  61. package/dist/src/envelope.js +46 -0
  62. package/dist/src/envelope.js.map +1 -0
  63. package/dist/src/events/catalogue.d.ts +50 -0
  64. package/dist/src/events/catalogue.d.ts.map +1 -0
  65. package/dist/src/events/catalogue.js +70 -0
  66. package/dist/src/events/catalogue.js.map +1 -0
  67. package/dist/src/events/chips-to-harness.d.ts +37 -0
  68. package/dist/src/events/chips-to-harness.d.ts.map +1 -0
  69. package/dist/src/events/chips-to-harness.js +511 -0
  70. package/dist/src/events/chips-to-harness.js.map +1 -0
  71. package/dist/src/events/harness-to-chips.d.ts +38 -0
  72. package/dist/src/events/harness-to-chips.d.ts.map +1 -0
  73. package/dist/src/events/harness-to-chips.js +593 -0
  74. package/dist/src/events/harness-to-chips.js.map +1 -0
  75. package/dist/src/events/index.d.ts +6 -0
  76. package/dist/src/events/index.d.ts.map +1 -0
  77. package/dist/src/events/index.js +5 -0
  78. package/dist/src/events/index.js.map +1 -0
  79. package/dist/src/events/workspace.d.ts +222 -0
  80. package/dist/src/events/workspace.d.ts.map +1 -0
  81. package/dist/src/events/workspace.js +1039 -0
  82. package/dist/src/events/workspace.js.map +1 -0
  83. package/dist/src/exchange.d.ts +262 -0
  84. package/dist/src/exchange.d.ts.map +1 -0
  85. package/dist/src/exchange.js +413 -0
  86. package/dist/src/exchange.js.map +1 -0
  87. package/dist/src/first-names.d.ts +29 -0
  88. package/dist/src/first-names.d.ts.map +1 -0
  89. package/dist/src/first-names.js +80 -0
  90. package/dist/src/first-names.js.map +1 -0
  91. package/dist/src/frames.d.ts +526 -0
  92. package/dist/src/frames.d.ts.map +1 -0
  93. package/dist/src/frames.js +346 -0
  94. package/dist/src/frames.js.map +1 -0
  95. package/dist/src/harness-jobs.d.ts +313 -0
  96. package/dist/src/harness-jobs.d.ts.map +1 -0
  97. package/dist/src/harness-jobs.js +210 -0
  98. package/dist/src/harness-jobs.js.map +1 -0
  99. package/dist/src/ids/index.d.ts +3 -0
  100. package/dist/src/ids/index.d.ts.map +1 -0
  101. package/dist/src/ids/index.js +2 -0
  102. package/dist/src/ids/index.js.map +1 -0
  103. package/dist/src/ids/ulid.d.ts +96 -0
  104. package/dist/src/ids/ulid.d.ts.map +1 -0
  105. package/dist/src/ids/ulid.js +212 -0
  106. package/dist/src/ids/ulid.js.map +1 -0
  107. package/dist/src/index.d.ts +81 -0
  108. package/dist/src/index.d.ts.map +1 -0
  109. package/dist/src/index.js +47 -0
  110. package/dist/src/index.js.map +1 -0
  111. package/dist/src/invite-link.d.ts +64 -0
  112. package/dist/src/invite-link.d.ts.map +1 -0
  113. package/dist/src/invite-link.js +99 -0
  114. package/dist/src/invite-link.js.map +1 -0
  115. package/dist/src/join.d.ts +188 -0
  116. package/dist/src/join.d.ts.map +1 -0
  117. package/dist/src/join.js +190 -0
  118. package/dist/src/join.js.map +1 -0
  119. package/dist/src/limits.d.ts +50 -0
  120. package/dist/src/limits.d.ts.map +1 -0
  121. package/dist/src/limits.js +106 -0
  122. package/dist/src/limits.js.map +1 -0
  123. package/dist/src/matters.d.ts +22 -0
  124. package/dist/src/matters.d.ts.map +1 -0
  125. package/dist/src/matters.js +26 -0
  126. package/dist/src/matters.js.map +1 -0
  127. package/dist/src/mentions.d.ts +63 -0
  128. package/dist/src/mentions.d.ts.map +1 -0
  129. package/dist/src/mentions.js +129 -0
  130. package/dist/src/mentions.js.map +1 -0
  131. package/dist/src/names.d.ts +58 -0
  132. package/dist/src/names.d.ts.map +1 -0
  133. package/dist/src/names.js +192 -0
  134. package/dist/src/names.js.map +1 -0
  135. package/dist/src/no-reply.d.ts +17 -0
  136. package/dist/src/no-reply.d.ts.map +1 -0
  137. package/dist/src/no-reply.js +48 -0
  138. package/dist/src/no-reply.js.map +1 -0
  139. package/dist/src/notifications.d.ts +81 -0
  140. package/dist/src/notifications.d.ts.map +1 -0
  141. package/dist/src/notifications.js +65 -0
  142. package/dist/src/notifications.js.map +1 -0
  143. package/dist/src/pages.d.ts +32 -0
  144. package/dist/src/pages.d.ts.map +1 -0
  145. package/dist/src/pages.js +32 -0
  146. package/dist/src/pages.js.map +1 -0
  147. package/dist/src/pairing.d.ts +99 -0
  148. package/dist/src/pairing.d.ts.map +1 -0
  149. package/dist/src/pairing.js +163 -0
  150. package/dist/src/pairing.js.map +1 -0
  151. package/dist/src/primitives.d.ts +267 -0
  152. package/dist/src/primitives.d.ts.map +1 -0
  153. package/dist/src/primitives.js +279 -0
  154. package/dist/src/primitives.js.map +1 -0
  155. package/dist/src/project.d.ts +335 -0
  156. package/dist/src/project.d.ts.map +1 -0
  157. package/dist/src/project.js +499 -0
  158. package/dist/src/project.js.map +1 -0
  159. package/dist/src/ranges.d.ts +31 -0
  160. package/dist/src/ranges.d.ts.map +1 -0
  161. package/dist/src/ranges.js +51 -0
  162. package/dist/src/ranges.js.map +1 -0
  163. package/dist/src/relay.d.ts +177 -0
  164. package/dist/src/relay.d.ts.map +1 -0
  165. package/dist/src/relay.js +147 -0
  166. package/dist/src/relay.js.map +1 -0
  167. package/dist/src/room-files.d.ts +146 -0
  168. package/dist/src/room-files.d.ts.map +1 -0
  169. package/dist/src/room-files.js +135 -0
  170. package/dist/src/room-files.js.map +1 -0
  171. package/dist/src/room-note.d.ts +213 -0
  172. package/dist/src/room-note.d.ts.map +1 -0
  173. package/dist/src/room-note.js +457 -0
  174. package/dist/src/room-note.js.map +1 -0
  175. package/dist/src/space-icons.d.ts +68 -0
  176. package/dist/src/space-icons.d.ts.map +1 -0
  177. package/dist/src/space-icons.js +142 -0
  178. package/dist/src/space-icons.js.map +1 -0
  179. package/dist/src/spend.d.ts +57 -0
  180. package/dist/src/spend.d.ts.map +1 -0
  181. package/dist/src/spend.js +94 -0
  182. package/dist/src/spend.js.map +1 -0
  183. package/dist/src/visibility.d.ts +170 -0
  184. package/dist/src/visibility.d.ts.map +1 -0
  185. package/dist/src/visibility.js +218 -0
  186. package/dist/src/visibility.js.map +1 -0
  187. package/fixtures/agent.asked.json +15 -0
  188. package/fixtures/agent.attached.json +15 -0
  189. package/fixtures/agent.deleted.json +16 -0
  190. package/fixtures/agent.fork.json +14 -0
  191. package/fixtures/agent.lock_set.json +13 -0
  192. package/fixtures/agent.registered.json +17 -0
  193. package/fixtures/agent.released.json +16 -0
  194. package/fixtures/agent.updated.json +14 -0
  195. package/fixtures/approval.executed.json +16 -0
  196. package/fixtures/approval.request.json +45 -0
  197. package/fixtures/approval.resolved.json +20 -0
  198. package/fixtures/approval.routed.json +20 -0
  199. package/fixtures/artifact.create.json +18 -0
  200. package/fixtures/attachment.fetched.json +15 -0
  201. package/fixtures/attachment.limits_set.json +15 -0
  202. package/fixtures/budget.warning.json +20 -0
  203. package/fixtures/checkpoint.json +16 -0
  204. package/fixtures/context.compacted.json +16 -0
  205. package/fixtures/context.usage.json +17 -0
  206. package/fixtures/exchange.limits_set.json +15 -0
  207. package/fixtures/exchange.set.json +13 -0
  208. package/fixtures/feedback.json +21 -0
  209. package/fixtures/frames/ack.json +6 -0
  210. package/fixtures/frames/context.edit.json +11 -0
  211. package/fixtures/frames/context_window.change.json +9 -0
  212. package/fixtures/frames/context_window.compact.json +8 -0
  213. package/fixtures/frames/error.json +6 -0
  214. package/fixtures/frames/event.json +20 -0
  215. package/fixtures/frames/events.json +39 -0
  216. package/fixtures/frames/folder.open.json +6 -0
  217. package/fixtures/frames/folder.open.page.json +7 -0
  218. package/fixtures/frames/folder.run.json +8 -0
  219. package/fixtures/frames/folder.run_state.json +12 -0
  220. package/fixtures/frames/heartbeat.change.json +10 -0
  221. package/fixtures/frames/hello.json +18 -0
  222. package/fixtures/frames/job.change.json +9 -0
  223. package/fixtures/frames/join.json +19 -0
  224. package/fixtures/frames/model.change.json +10 -0
  225. package/fixtures/frames/ping.json +4 -0
  226. package/fixtures/frames/pong.json +4 -0
  227. package/fixtures/frames/presence.json +12 -0
  228. package/fixtures/frames/receipt.json +5 -0
  229. package/fixtures/frames/restart.json +5 -0
  230. package/fixtures/frames/subscribe.json +6 -0
  231. package/fixtures/handoff.json +20 -0
  232. package/fixtures/harness.removed.json +15 -0
  233. package/fixtures/harness.transferred.json +15 -0
  234. package/fixtures/hello.json +61 -0
  235. package/fixtures/join.allowed.json +20 -0
  236. package/fixtures/join.denied.json +17 -0
  237. package/fixtures/lane.updated.json +17 -0
  238. package/fixtures/membership.added.json +16 -0
  239. package/fixtures/membership.removed.json +14 -0
  240. package/fixtures/membership.replaced.json +15 -0
  241. package/fixtures/message.deleted.json +15 -0
  242. package/fixtures/message.edited.json +15 -0
  243. package/fixtures/message.handed.json +14 -0
  244. package/fixtures/message.heard.json +14 -0
  245. package/fixtures/message.held.json +14 -0
  246. package/fixtures/message.hidden.json +14 -0
  247. package/fixtures/message.new.json +96 -0
  248. package/fixtures/message.overheard.json +22 -0
  249. package/fixtures/message.pinned.json +14 -0
  250. package/fixtures/message.post.json +14 -0
  251. package/fixtures/message.shown.json +14 -0
  252. package/fixtures/message.unpinned.json +14 -0
  253. package/fixtures/person.face_set.json +17 -0
  254. package/fixtures/person.joined.json +16 -0
  255. package/fixtures/person.removed.json +16 -0
  256. package/fixtures/person.renamed.json +14 -0
  257. package/fixtures/policy.updated.json +30 -0
  258. package/fixtures/project.changed.json +21 -0
  259. package/fixtures/question.answered.json +23 -0
  260. package/fixtures/question.ask.json +37 -0
  261. package/fixtures/receipt.json +15 -0
  262. package/fixtures/relay.set.json +12 -0
  263. package/fixtures/role.changed.json +15 -0
  264. package/fixtures/run.cancel.json +15 -0
  265. package/fixtures/run.completed.json +20 -0
  266. package/fixtures/run.failed.json +20 -0
  267. package/fixtures/run.pause.json +15 -0
  268. package/fixtures/run.plan.json +24 -0
  269. package/fixtures/run.requested.json +34 -0
  270. package/fixtures/run.resume.json +15 -0
  271. package/fixtures/run.started.json +33 -0
  272. package/fixtures/run.status.json +17 -0
  273. package/fixtures/run.steer.json +21 -0
  274. package/fixtures/session.ended.json +15 -0
  275. package/fixtures/session.renamed.json +15 -0
  276. package/fixtures/session.started.json +17 -0
  277. package/fixtures/space.claimed.json +15 -0
  278. package/fixtures/space.created.json +14 -0
  279. package/fixtures/space.erased.json +13 -0
  280. package/fixtures/space.lead_set.json +13 -0
  281. package/fixtures/space.lock_set.json +13 -0
  282. package/fixtures/space.spend_ceiling_set.json +13 -0
  283. package/fixtures/space.updated.json +14 -0
  284. package/fixtures/step.log.json +26 -0
  285. package/fixtures/task.json +22 -0
  286. package/fixtures/turn.passed.json +14 -0
  287. package/fixtures/usage.json +21 -0
  288. package/fixtures/workspace.renamed.json +13 -0
  289. package/generated/agent-connect.json +13966 -0
  290. package/generated/schema/agent.asked.json +114 -0
  291. package/generated/schema/agent.attached.json +465 -0
  292. package/generated/schema/agent.deleted.json +127 -0
  293. package/generated/schema/agent.fork.json +107 -0
  294. package/generated/schema/agent.lock_set.json +105 -0
  295. package/generated/schema/agent.registered.json +130 -0
  296. package/generated/schema/agent.released.json +129 -0
  297. package/generated/schema/agent.updated.json +151 -0
  298. package/generated/schema/approval.executed.json +125 -0
  299. package/generated/schema/approval.request.json +279 -0
  300. package/generated/schema/approval.resolved.json +162 -0
  301. package/generated/schema/approval.routed.json +185 -0
  302. package/generated/schema/artifact.create.json +206 -0
  303. package/generated/schema/attachment.fetched.json +114 -0
  304. package/generated/schema/attachment.limits_set.json +136 -0
  305. package/generated/schema/budget.warning.json +152 -0
  306. package/generated/schema/checkpoint.json +111 -0
  307. package/generated/schema/context.compacted.json +124 -0
  308. package/generated/schema/context.usage.json +120 -0
  309. package/generated/schema/exchange.limits_set.json +127 -0
  310. package/generated/schema/exchange.set.json +144 -0
  311. package/generated/schema/feedback.json +173 -0
  312. package/generated/schema/handoff.json +122 -0
  313. package/generated/schema/harness.removed.json +122 -0
  314. package/generated/schema/harness.transferred.json +117 -0
  315. package/generated/schema/hello.json +509 -0
  316. package/generated/schema/join.allowed.json +176 -0
  317. package/generated/schema/join.denied.json +150 -0
  318. package/generated/schema/lane.updated.json +223 -0
  319. package/generated/schema/membership.added.json +153 -0
  320. package/generated/schema/membership.removed.json +126 -0
  321. package/generated/schema/membership.replaced.json +106 -0
  322. package/generated/schema/message.deleted.json +105 -0
  323. package/generated/schema/message.edited.json +107 -0
  324. package/generated/schema/message.handed.json +111 -0
  325. package/generated/schema/message.heard.json +100 -0
  326. package/generated/schema/message.held.json +181 -0
  327. package/generated/schema/message.hidden.json +100 -0
  328. package/generated/schema/message.new.json +1369 -0
  329. package/generated/schema/message.overheard.json +701 -0
  330. package/generated/schema/message.pinned.json +100 -0
  331. package/generated/schema/message.post.json +290 -0
  332. package/generated/schema/message.shown.json +100 -0
  333. package/generated/schema/message.unpinned.json +100 -0
  334. package/generated/schema/person.face_set.json +134 -0
  335. package/generated/schema/person.joined.json +128 -0
  336. package/generated/schema/person.removed.json +133 -0
  337. package/generated/schema/person.renamed.json +114 -0
  338. package/generated/schema/policy.updated.json +277 -0
  339. package/generated/schema/project.changed.json +199 -0
  340. package/generated/schema/question.answered.json +154 -0
  341. package/generated/schema/question.ask.json +194 -0
  342. package/generated/schema/receipt.json +109 -0
  343. package/generated/schema/relay.set.json +99 -0
  344. package/generated/schema/role.changed.json +116 -0
  345. package/generated/schema/run.cancel.json +106 -0
  346. package/generated/schema/run.completed.json +139 -0
  347. package/generated/schema/run.failed.json +135 -0
  348. package/generated/schema/run.pause.json +106 -0
  349. package/generated/schema/run.plan.json +128 -0
  350. package/generated/schema/run.requested.json +309 -0
  351. package/generated/schema/run.resume.json +106 -0
  352. package/generated/schema/run.started.json +142 -0
  353. package/generated/schema/run.status.json +120 -0
  354. package/generated/schema/run.steer.json +163 -0
  355. package/generated/schema/session.ended.json +106 -0
  356. package/generated/schema/session.renamed.json +108 -0
  357. package/generated/schema/session.started.json +116 -0
  358. package/generated/schema/space.claimed.json +107 -0
  359. package/generated/schema/space.created.json +148 -0
  360. package/generated/schema/space.erased.json +129 -0
  361. package/generated/schema/space.lead_set.json +108 -0
  362. package/generated/schema/space.lock_set.json +99 -0
  363. package/generated/schema/space.spend_ceiling_set.json +102 -0
  364. package/generated/schema/space.updated.json +112 -0
  365. package/generated/schema/step.log.json +187 -0
  366. package/generated/schema/task.json +268 -0
  367. package/generated/schema/turn.passed.json +99 -0
  368. package/generated/schema/usage.json +155 -0
  369. package/generated/schema/workspace.renamed.json +107 -0
  370. package/generated/types.ts +4178 -0
  371. package/package.json +38 -3
@@ -0,0 +1,24 @@
1
+ /**
2
+ * What a harness that has not learnt agents is shown (ADR 0087's addendum of 29 September).
3
+ *
4
+ * A harness takes part in rooms as its agents. One written before agents knows only itself: it
5
+ * reads `from.kind === "harness"` as another agent, looks for its own id in `addressed_to` and
6
+ * `mentions`, and learns whose agent is whose from `/v1/participants`. Until it declares
7
+ * `agents`, everything Chips hands it is put back into those terms, on the socket and over HTTP
8
+ * alike, so it goes on answering unchanged: its own agents are its own id, any other agent is a
9
+ * harness, and nothing says `for`. The server and the conformance fake both hand it over through
10
+ * this, so the two cannot drift.
11
+ */
12
+ /** Events a harness that has not learnt agents is never handed: it has no words for them. */
13
+ export declare const AGENT_EVENTS: ReadonlySet<string>;
14
+ /** Who is looking: the harness, and the agents it speaks for without knowing it. */
15
+ export interface LegacyView {
16
+ readonly harnessId: string;
17
+ readonly own: ReadonlySet<string>;
18
+ }
19
+ /**
20
+ * An event, a page of them or any body a harness reads, as a harness that has not declared
21
+ * `agents` knows it. The value given is not changed.
22
+ */
23
+ export declare function inLegacyView<T>(value: T, view: LegacyView): T;
24
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,6FAA6F;AAC7F,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAS3C,CAAC;AAEH,oFAAoF;AACpF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACnC;AA8BD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,CAAC,CAE7D"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * What a harness that has not learnt agents is shown (ADR 0087's addendum of 29 September).
3
+ *
4
+ * A harness takes part in rooms as its agents. One written before agents knows only itself: it
5
+ * reads `from.kind === "harness"` as another agent, looks for its own id in `addressed_to` and
6
+ * `mentions`, and learns whose agent is whose from `/v1/participants`. Until it declares
7
+ * `agents`, everything Chips hands it is put back into those terms, on the socket and over HTTP
8
+ * alike, so it goes on answering unchanged: its own agents are its own id, any other agent is a
9
+ * harness, and nothing says `for`. The server and the conformance fake both hand it over through
10
+ * this, so the two cannot drift.
11
+ */
12
+ /** Events a harness that has not learnt agents is never handed: it has no words for them. */
13
+ export const AGENT_EVENTS = new Set([
14
+ "agent.registered",
15
+ "agent.updated",
16
+ "membership.replaced",
17
+ "agent.attached",
18
+ "agent.released",
19
+ "agent.fork",
20
+ "agent.asked",
21
+ "message.held",
22
+ ]);
23
+ /** Whether a key names a kind of participant: `kind`, `participant_kind`. */
24
+ function namesAKind(key) {
25
+ return key === "kind" || key.endsWith("_kind");
26
+ }
27
+ function seen(value, view, key) {
28
+ if (typeof value === "string")
29
+ return word(value, view, key);
30
+ if (Array.isArray(value)) {
31
+ const each = value.map((item) => seen(item, view, key));
32
+ // Two of its agents named in one list are the harness once: `addressed_to`, `mentions`.
33
+ return each.every((item) => typeof item === "string") ? [...new Set(each)] : each;
34
+ }
35
+ if (typeof value !== "object" || value === null)
36
+ return value;
37
+ const out = {};
38
+ for (const [field, inner] of Object.entries(value)) {
39
+ // A record keyed by participant, as the room note's `notes` is: its own agent's key is its own.
40
+ if (field !== "for")
41
+ out[view.own.has(field) ? view.harnessId : field] = seen(inner, view, field);
42
+ }
43
+ return out;
44
+ }
45
+ /** One string: its own agent's id is its own, and the kind `agent` is a harness. */
46
+ function word(value, view, key) {
47
+ if (view.own.has(value))
48
+ return view.harnessId;
49
+ return value === "agent" && namesAKind(key) ? "harness" : value;
50
+ }
51
+ /**
52
+ * An event, a page of them or any body a harness reads, as a harness that has not declared
53
+ * `agents` knows it. The value given is not changed.
54
+ */
55
+ export function inLegacyView(value, view) {
56
+ return seen(value, view, "");
57
+ }
58
+ //# sourceMappingURL=agents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,6FAA6F;AAC7F,MAAM,CAAC,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC;IACvD,kBAAkB;IAClB,eAAe;IACf,qBAAqB;IACrB,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,cAAc;CACf,CAAC,CAAC;AAQH,6EAA6E;AAC7E,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,KAAK,MAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,IAAI,CAAC,KAAc,EAAE,IAAgB,EAAE,GAAW;IACzD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;QACxD,wFAAwF;QACxF,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpF,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACnD,gGAAgG;QAChG,IAAI,KAAK,KAAK,KAAK;YACjB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,oFAAoF;AACpF,SAAS,IAAI,CAAC,KAAa,EAAE,IAAgB,EAAE,GAAW;IACxD,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC;IAC/C,OAAO,KAAK,KAAK,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;AAClE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAI,KAAQ,EAAE,IAAgB;IACxD,OAAO,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAM,CAAC;AACpC,CAAC"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * What a harness declares it takes, beyond the events it sends.
3
+ *
4
+ * A harness's manifest carries `capabilities`, "what the harness can do", stored when it is
5
+ * registered and presented back to it in `hello`. Most entries name tools — `email.send`,
6
+ * `drive.read` — and are the harness's own business. A few are read by the clients, because
7
+ * they decide whether a control is drawn at all: a control that cannot keep its promise is
8
+ * worse than none ([ADR 0046](../../../docs/decisions/0046-a-harness-declares-that-it-takes-the-dial.md)).
9
+ */
10
+ export declare const HARNESS_CAPABILITIES: {
11
+ /**
12
+ * The harness reads the level and the rules Chips sends it — `hello.autonomy`, `policy.updated`
13
+ * — and asks accordingly, so the L0–L3 dial on its profile and in its run panel changes
14
+ * something. A harness on `@chipschat/sdk-ts` does; one with a permission model of its own — per
15
+ * tool, per connector — does not, and gets no dial.
16
+ */
17
+ readonly autonomy: "autonomy";
18
+ /**
19
+ * The harness takes a room a person opens and asks it into — `space.created` with `asked_of`
20
+ * naming it — makes its own thing for it, and claims the room with a key of its own. What makes
21
+ * the + for a new space worth drawing: a room asked of a harness that does not do this would
22
+ * wait for an answer that never comes.
23
+ */
24
+ readonly newSpaces: "new_spaces";
25
+ /**
26
+ * The harness keeps its own side of a room it opened under a key in step with the room: a
27
+ * person's archive and unarchive here are carried to the thing it keeps for the room, and a
28
+ * delete (`space.erased`) deletes that thing, or puts it away for its owner when the person
29
+ * deleting does not own the harness (ADR 0066, ADR 0069). What lets the sheets that ask first
30
+ * promise so. A harness that does not declare it is not bound by any of that — `moved_by` and
31
+ * the tombstone are there for it to read — and the sheets promise nothing on its behalf.
32
+ */
33
+ readonly followsRooms: "follows_rooms";
34
+ /**
35
+ * The harness speaks agents (ADR 0087): it reads `hello.agents` and `for`, and names one of its
36
+ * agents as the `actor` of what it sends. Until it declares this, everything Chips hands it, on
37
+ * the socket and over HTTP, is the view it knew before agents: its own agents are its own id,
38
+ * any other agent a harness, and nothing says `for` (ADR 0087's addendum of 29 September).
39
+ */
40
+ readonly agents: "agents";
41
+ /**
42
+ * The harness copies one of its agents when a person asks (ADR 0087, Fork): it hears
43
+ * `agent.fork`, makes a copy that remembers everything the agent did up to then, and registers
44
+ * it with `forked_from` and the room it was asked for, where Chips puts it. After that the two
45
+ * remember separately. Fork is offered only for a harness that declares this, because a room
46
+ * asked for a copy that never comes says so after a minute and nothing more.
47
+ */
48
+ readonly forks: "forks";
49
+ /**
50
+ * The harness makes a new agent when a person asks for one in a room (ADR 0108): it hears
51
+ * `agent.asked`, makes an agent that remembers nothing from elsewhere, called what the ask says,
52
+ * and registers it with `made_for` and the room, where Chips puts it. Only a harness that
53
+ * declares this is offered on a room's Add page, because a room asked for an agent that never
54
+ * comes says so after a minute and nothing more.
55
+ */
56
+ readonly newAgents: "new_agents";
57
+ /**
58
+ * The harness has a restart of its own and runs it when a person asks (ADR 0094): a socket of it
59
+ * says `restart` in its `hello`, hears the `restart` frame, and runs what the harness keeps for
60
+ * that — a process restarting itself, or a bridge starting what is behind it again. What makes
61
+ * Restart worth drawing on its page.
62
+ */
63
+ readonly restarts: "restarts";
64
+ /**
65
+ * The harness sends Chips a copy of each of its agents' context files and of its own set, keeps
66
+ * them current, and takes a person's edits (ADR 0134): a socket of it says `context` in its
67
+ * `hello`, hears `context.edit`, saves the file in its own way, and answers with its copy. What
68
+ * makes an agent's Context group, and its harness's shared files, worth drawing.
69
+ */
70
+ readonly contextFiles: "context_files";
71
+ /**
72
+ * The harness sends Chips a copy of each agent's model and effort, what it may run on instead
73
+ * and the words for each, keeps them current, and takes a person's changes (ADR 0140): a socket
74
+ * of it says `models` in its `hello`, hears `model.change`, sets the agent's model and effort in
75
+ * its own way, and answers with its copy. What makes an agent's Model group worth drawing.
76
+ */
77
+ readonly models: "models";
78
+ /**
79
+ * The harness sends Chips a copy of each agent's heartbeat, the turn it starts on its own every
80
+ * so often, keeps it current, and takes a person's changes (ADR 0143): a socket of it says
81
+ * `heartbeats` in its `hello`, hears `heartbeat.change`, switches or times the agent's heartbeat
82
+ * in its own way, and answers with its copy. What makes an agent's Heartbeat group worth drawing.
83
+ */
84
+ readonly heartbeats: "heartbeats";
85
+ /**
86
+ * The harness sends Chips a copy of each agent's context window, how full it is and the limit it
87
+ * compacts itself at, keeps it current, and takes a person's Compact now and new limit (ADR
88
+ * 0146): a socket of it says `context_windows` in its `hello`, hears `context_window.compact`
89
+ * and `context_window.change`, does them in its own way, and answers with its copy. What makes
90
+ * an agent's Context window group worth drawing.
91
+ */
92
+ readonly contextWindows: "context_windows";
93
+ /**
94
+ * The harness sends Chips a copy of the jobs it runs on its own, outside any space, and posts
95
+ * each run with what it cost, and takes a person's switch (ADR 0252): a socket of it says `jobs`
96
+ * in its `hello`, hears `job.change`, switches the job in its own way, and answers with its
97
+ * copy. What makes the harness page's "Its own jobs" group worth drawing.
98
+ */
99
+ readonly jobs: "jobs";
100
+ };
101
+ /**
102
+ * How long a room waits for a fork's copy (ADR 0087, Fork): a copy registered within it joins the
103
+ * room the person asked for; after it the room says the harness didn't make the copy, and one
104
+ * registered later is free, for a person to put in a room. The clients time it from the ask, as
105
+ * the server does, so nothing about the wait is stored.
106
+ */
107
+ export declare const FORK_WAIT_MS = 60000;
108
+ /**
109
+ * How long a room waits for a new agent a person asked a harness for (ADR 0108): the minute a
110
+ * fork's copy has. One registered within it joins the room; after it the room says the harness
111
+ * didn't make it, and one registered later is free.
112
+ */
113
+ export declare const NEW_AGENT_WAIT_MS = 60000;
114
+ export type HarnessCapability = (typeof HARNESS_CAPABILITIES)[keyof typeof HARNESS_CAPABILITIES];
115
+ /**
116
+ * How long a harness stays restarting without a word from it (ADR 0094): after this the state says
117
+ * again whatever is true then, and Restart is offered again. The server keeps it; a client that
118
+ * draws a count reads it from here.
119
+ */
120
+ export declare const RESTART_WAIT_MS = 180000;
121
+ //# sourceMappingURL=capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,oBAAoB;IAC/B;;;;;OAKG;;IAEH;;;;;OAKG;;IAEH;;;;;;;OAOG;;IAEH;;;;;OAKG;;IAEH;;;;;;OAMG;;IAEH;;;;;;OAMG;;IAEH;;;;;OAKG;;IAEH;;;;;OAKG;;IAEH;;;;;OAKG;;IAEH;;;;;OAKG;;IAEH;;;;;;OAMG;;IAEH;;;;;OAKG;;CAEK,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,YAAY,QAAS,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAe,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEjG;;;;GAIG;AACH,eAAO,MAAM,eAAe,SAAU,CAAC"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * What a harness declares it takes, beyond the events it sends.
3
+ *
4
+ * A harness's manifest carries `capabilities`, "what the harness can do", stored when it is
5
+ * registered and presented back to it in `hello`. Most entries name tools — `email.send`,
6
+ * `drive.read` — and are the harness's own business. A few are read by the clients, because
7
+ * they decide whether a control is drawn at all: a control that cannot keep its promise is
8
+ * worse than none ([ADR 0046](../../../docs/decisions/0046-a-harness-declares-that-it-takes-the-dial.md)).
9
+ */
10
+ export const HARNESS_CAPABILITIES = {
11
+ /**
12
+ * The harness reads the level and the rules Chips sends it — `hello.autonomy`, `policy.updated`
13
+ * — and asks accordingly, so the L0–L3 dial on its profile and in its run panel changes
14
+ * something. A harness on `@chipschat/sdk-ts` does; one with a permission model of its own — per
15
+ * tool, per connector — does not, and gets no dial.
16
+ */
17
+ autonomy: "autonomy",
18
+ /**
19
+ * The harness takes a room a person opens and asks it into — `space.created` with `asked_of`
20
+ * naming it — makes its own thing for it, and claims the room with a key of its own. What makes
21
+ * the + for a new space worth drawing: a room asked of a harness that does not do this would
22
+ * wait for an answer that never comes.
23
+ */
24
+ newSpaces: "new_spaces",
25
+ /**
26
+ * The harness keeps its own side of a room it opened under a key in step with the room: a
27
+ * person's archive and unarchive here are carried to the thing it keeps for the room, and a
28
+ * delete (`space.erased`) deletes that thing, or puts it away for its owner when the person
29
+ * deleting does not own the harness (ADR 0066, ADR 0069). What lets the sheets that ask first
30
+ * promise so. A harness that does not declare it is not bound by any of that — `moved_by` and
31
+ * the tombstone are there for it to read — and the sheets promise nothing on its behalf.
32
+ */
33
+ followsRooms: "follows_rooms",
34
+ /**
35
+ * The harness speaks agents (ADR 0087): it reads `hello.agents` and `for`, and names one of its
36
+ * agents as the `actor` of what it sends. Until it declares this, everything Chips hands it, on
37
+ * the socket and over HTTP, is the view it knew before agents: its own agents are its own id,
38
+ * any other agent a harness, and nothing says `for` (ADR 0087's addendum of 29 September).
39
+ */
40
+ agents: "agents",
41
+ /**
42
+ * The harness copies one of its agents when a person asks (ADR 0087, Fork): it hears
43
+ * `agent.fork`, makes a copy that remembers everything the agent did up to then, and registers
44
+ * it with `forked_from` and the room it was asked for, where Chips puts it. After that the two
45
+ * remember separately. Fork is offered only for a harness that declares this, because a room
46
+ * asked for a copy that never comes says so after a minute and nothing more.
47
+ */
48
+ forks: "forks",
49
+ /**
50
+ * The harness makes a new agent when a person asks for one in a room (ADR 0108): it hears
51
+ * `agent.asked`, makes an agent that remembers nothing from elsewhere, called what the ask says,
52
+ * and registers it with `made_for` and the room, where Chips puts it. Only a harness that
53
+ * declares this is offered on a room's Add page, because a room asked for an agent that never
54
+ * comes says so after a minute and nothing more.
55
+ */
56
+ newAgents: "new_agents",
57
+ /**
58
+ * The harness has a restart of its own and runs it when a person asks (ADR 0094): a socket of it
59
+ * says `restart` in its `hello`, hears the `restart` frame, and runs what the harness keeps for
60
+ * that — a process restarting itself, or a bridge starting what is behind it again. What makes
61
+ * Restart worth drawing on its page.
62
+ */
63
+ restarts: "restarts",
64
+ /**
65
+ * The harness sends Chips a copy of each of its agents' context files and of its own set, keeps
66
+ * them current, and takes a person's edits (ADR 0134): a socket of it says `context` in its
67
+ * `hello`, hears `context.edit`, saves the file in its own way, and answers with its copy. What
68
+ * makes an agent's Context group, and its harness's shared files, worth drawing.
69
+ */
70
+ contextFiles: "context_files",
71
+ /**
72
+ * The harness sends Chips a copy of each agent's model and effort, what it may run on instead
73
+ * and the words for each, keeps them current, and takes a person's changes (ADR 0140): a socket
74
+ * of it says `models` in its `hello`, hears `model.change`, sets the agent's model and effort in
75
+ * its own way, and answers with its copy. What makes an agent's Model group worth drawing.
76
+ */
77
+ models: "models",
78
+ /**
79
+ * The harness sends Chips a copy of each agent's heartbeat, the turn it starts on its own every
80
+ * so often, keeps it current, and takes a person's changes (ADR 0143): a socket of it says
81
+ * `heartbeats` in its `hello`, hears `heartbeat.change`, switches or times the agent's heartbeat
82
+ * in its own way, and answers with its copy. What makes an agent's Heartbeat group worth drawing.
83
+ */
84
+ heartbeats: "heartbeats",
85
+ /**
86
+ * The harness sends Chips a copy of each agent's context window, how full it is and the limit it
87
+ * compacts itself at, keeps it current, and takes a person's Compact now and new limit (ADR
88
+ * 0146): a socket of it says `context_windows` in its `hello`, hears `context_window.compact`
89
+ * and `context_window.change`, does them in its own way, and answers with its copy. What makes
90
+ * an agent's Context window group worth drawing.
91
+ */
92
+ contextWindows: "context_windows",
93
+ /**
94
+ * The harness sends Chips a copy of the jobs it runs on its own, outside any space, and posts
95
+ * each run with what it cost, and takes a person's switch (ADR 0252): a socket of it says `jobs`
96
+ * in its `hello`, hears `job.change`, switches the job in its own way, and answers with its
97
+ * copy. What makes the harness page's "Its own jobs" group worth drawing.
98
+ */
99
+ jobs: "jobs",
100
+ };
101
+ /**
102
+ * How long a room waits for a fork's copy (ADR 0087, Fork): a copy registered within it joins the
103
+ * room the person asked for; after it the room says the harness didn't make the copy, and one
104
+ * registered later is free, for a person to put in a room. The clients time it from the ask, as
105
+ * the server does, so nothing about the wait is stored.
106
+ */
107
+ export const FORK_WAIT_MS = 60_000;
108
+ /**
109
+ * How long a room waits for a new agent a person asked a harness for (ADR 0108): the minute a
110
+ * fork's copy has. One registered within it joins the room; after it the room says the harness
111
+ * didn't make it, and one registered later is free.
112
+ */
113
+ export const NEW_AGENT_WAIT_MS = FORK_WAIT_MS;
114
+ /**
115
+ * How long a harness stays restarting without a word from it (ADR 0094): after this the state says
116
+ * again whatever is true then, and Restart is offered again. The server keeps it; a client that
117
+ * draws a count reads it from here.
118
+ */
119
+ export const RESTART_WAIT_MS = 180_000;
120
+ //# sourceMappingURL=capabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC;;;;;OAKG;IACH,QAAQ,EAAE,UAAU;IACpB;;;;;OAKG;IACH,SAAS,EAAE,YAAY;IACvB;;;;;;;OAOG;IACH,YAAY,EAAE,eAAe;IAC7B;;;;;OAKG;IACH,MAAM,EAAE,QAAQ;IAChB;;;;;;OAMG;IACH,KAAK,EAAE,OAAO;IACd;;;;;;OAMG;IACH,SAAS,EAAE,YAAY;IACvB;;;;;OAKG;IACH,QAAQ,EAAE,UAAU;IACpB;;;;;OAKG;IACH,YAAY,EAAE,eAAe;IAC7B;;;;;OAKG;IACH,MAAM,EAAE,QAAQ;IAChB;;;;;OAKG;IACH,UAAU,EAAE,YAAY;IACxB;;;;;;OAMG;IACH,cAAc,EAAE,iBAAiB;IACjC;;;;;OAKG;IACH,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AAEnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAI9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The connection checklist: which event lights which part of the interface.
3
+ *
4
+ * Agent Connect is progressive (blueprint, Connect). The minimum is three events — a run
5
+ * started, a message, a run completed — and every further event a harness sends earns it
6
+ * another part of the UI. This list is that promise, written down once: the Harnesses tab lights
7
+ * a row as the type arrives, and `chips conformance` prints the same rows for an adapter, so the
8
+ * two cannot say different things about what a harness has earned.
9
+ */
10
+ export interface ChecklistRow {
11
+ /** The event types that light this row. The first is the one the row names. */
12
+ readonly types: readonly string[];
13
+ readonly label: string;
14
+ /** What sending it gets you, in the words the unlit row uses: "send X for <gives>". */
15
+ readonly gives: string;
16
+ }
17
+ /** The rows, in the order the interface upgrades. */
18
+ export declare const CONNECTION_CHECKLIST: readonly ChecklistRow[];
19
+ //# sourceMappingURL=checklist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checklist.d.ts","sourceRoot":"","sources":["../../src/checklist.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,EAAE,SAAS,YAAY,EAUvD,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The connection checklist: which event lights which part of the interface.
3
+ *
4
+ * Agent Connect is progressive (blueprint, Connect). The minimum is three events — a run
5
+ * started, a message, a run completed — and every further event a harness sends earns it
6
+ * another part of the UI. This list is that promise, written down once: the Harnesses tab lights
7
+ * a row as the type arrives, and `chips conformance` prints the same rows for an adapter, so the
8
+ * two cannot say different things about what a harness has earned.
9
+ */
10
+ /** The rows, in the order the interface upgrades. */
11
+ export const CONNECTION_CHECKLIST = [
12
+ { types: ["message.post"], label: "Messages", gives: "a bubble in the space" },
13
+ { types: ["run.started"], label: "Runs", gives: "a status pill and a run panel" },
14
+ { types: ["step.log"], label: "Steps", gives: "a timeline and a receipt" },
15
+ { types: ["approval.request"], label: "Approvals", gives: "an approval card in the space" },
16
+ { types: ["question.ask"], label: "Questions", gives: "a question card with options" },
17
+ { types: ["context.usage"], label: "Context", gives: "the context ring" },
18
+ { types: ["usage"], label: "Cost", gives: "the cost meter" },
19
+ { types: ["run.completed", "run.failed"], label: "Finished", gives: "a summary card" },
20
+ { types: ["task"], label: "Lanes", gives: "a route card, and a task card where the work goes" },
21
+ ];
22
+ //# sourceMappingURL=checklist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checklist.js","sourceRoot":"","sources":["../../src/checklist.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,qDAAqD;AACrD,MAAM,CAAC,MAAM,oBAAoB,GAA4B;IAC3D,EAAE,KAAK,EAAE,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,uBAAuB,EAAE;IAC9E,EAAE,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,+BAA+B,EAAE;IACjF,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE;IAC1E,EAAE,KAAK,EAAE,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,+BAA+B,EAAE;IAC3F,EAAE,KAAK,EAAE,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,8BAA8B,EAAE;IACtF,EAAE,KAAK,EAAE,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE;IACzE,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE;IAC5D,EAAE,KAAK,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACtF,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,mDAAmD,EAAE;CAChG,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * A command an ask carries, read the way a shell would read it (ADR 0239), so that a standing yes
3
+ * remembers how each part of it starts rather than the whole kind of action. Here, so the server,
4
+ * the conformance kit's fake and the apps read a command the same way.
5
+ *
6
+ * A command is the ask's `input.command`: a string a shell runs, or an array of words a program
7
+ * runs as given. A string is split into parts at `&&`, `||`, `;`, `|` and new lines outside
8
+ * quotes, and each part into words, quotes taken off. A command that does more than this reader
9
+ * can follow is not read at all: a redirection (`>`, `<`), something run inside it (`$(`,
10
+ * backticks, `$`, parentheses, braces), a part run in the background (`&`), a variable set before
11
+ * the program (`FOO=1 node`), a comment, or an empty part. Its ask is answered each time.
12
+ *
13
+ * Chips still never sees the tool call itself; it reads the words the harness sent in its ask.
14
+ */
15
+ /** The parts of a command, each as its words; nothing for one this reader can't follow. */
16
+ export type CommandParts = readonly (readonly string[])[];
17
+ /** What a command is, from an ask's input: its string or its words, or nothing. */
18
+ export declare function askedCommand(input: unknown): string | readonly string[] | undefined;
19
+ /** The command's parts, each as its words; nothing for a command this reader can't follow. */
20
+ export declare function commandParts(command: string | readonly string[]): CommandParts | undefined;
21
+ /**
22
+ * The commands a standing yes is never given for (ADR 0239): they can't be undone, leave the
23
+ * machine, act as somebody else, or run whatever code or command they are given. A part matches
24
+ * an entry of one word when its program is that word, and an entry of two when its program is the
25
+ * first and the second is among its words, wherever it stands (`git -C dir push`).
26
+ */
27
+ export declare const NEVER_STANDING: readonly (readonly string[])[];
28
+ /** The listed command a part uses, in words (`rm`, `git push`); nothing for one not listed. */
29
+ export declare function neverStanding(parts: CommandParts): string | undefined;
30
+ /** How a part starts, as a standing yes remembers it: its first two words, or its one. */
31
+ export declare function startOf(part: readonly string[]): readonly string[];
32
+ /** Each part's start, once each, in the command's order. */
33
+ export declare function commandStarts(parts: CommandParts): readonly (readonly string[])[];
34
+ /** Whether the part begins with these words, each exactly. */
35
+ export declare function startsWith(part: readonly string[], start: readonly string[]): boolean;
36
+ /**
37
+ * What a standing yes on this ask would remember, or why there is none: the starts, or that the
38
+ * command can't be read, or the listed command it uses. Nothing for an ask with no command.
39
+ */
40
+ export type StandingOffer = {
41
+ readonly kind: "starts";
42
+ readonly starts: readonly (readonly string[])[];
43
+ } | {
44
+ readonly kind: "unreadable";
45
+ } | {
46
+ readonly kind: "never";
47
+ readonly command: string;
48
+ };
49
+ export declare function standingOffer(input: unknown): StandingOffer | undefined;
50
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,2FAA2F;AAC3F,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;AAK1D,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAYnF;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,YAAY,GAAG,SAAS,CAW1F;AA2HD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EA+CxD,CAAC;AAOF,+FAA+F;AAC/F,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAUrE;AAED,0FAA0F;AAC1F,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAElE;AAED,4DAA4D;AAC5D,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAOjF;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAErF;AAMD;;;GAGG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAA;CAAE,GAC5E;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAC/B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAQvE"}