@culture.dev/agents 0.0.0-stage → 0.15.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 (290) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +59 -2
  3. package/dist/contract-schemas/agent.json +128 -0
  4. package/dist/contract-schemas/allowlist.json +25 -0
  5. package/dist/contract-schemas/api.json +501 -0
  6. package/dist/contract-schemas/capabilities.json +208 -0
  7. package/dist/contract-schemas/common.json +123 -0
  8. package/dist/contract-schemas/control-action.json +279 -0
  9. package/dist/contract-schemas/error.json +269 -0
  10. package/dist/contract-schemas/event.json +316 -0
  11. package/dist/contract-schemas/run.json +336 -0
  12. package/dist/contract-schemas/session.json +77 -0
  13. package/dist/contract-schemas/version.json +22 -0
  14. package/dist/src/contract/api.d.ts +41 -0
  15. package/dist/src/contract/api.js +35 -0
  16. package/dist/src/contract/api.js.map +1 -0
  17. package/dist/src/contract/errors.d.ts +21 -0
  18. package/dist/src/contract/errors.js +25 -0
  19. package/dist/src/contract/errors.js.map +1 -0
  20. package/dist/src/contract/generated/agent.d.ts +31 -0
  21. package/dist/src/contract/generated/agent.js +3 -0
  22. package/dist/src/contract/generated/agent.js.map +1 -0
  23. package/dist/src/contract/generated/allowlist.d.ts +10 -0
  24. package/dist/src/contract/generated/allowlist.js +3 -0
  25. package/dist/src/contract/generated/allowlist.js.map +1 -0
  26. package/dist/src/contract/generated/capabilities.d.ts +46 -0
  27. package/dist/src/contract/generated/capabilities.js +3 -0
  28. package/dist/src/contract/generated/capabilities.js.map +1 -0
  29. package/dist/src/contract/generated/common.d.ts +40 -0
  30. package/dist/src/contract/generated/common.js +3 -0
  31. package/dist/src/contract/generated/common.js.map +1 -0
  32. package/dist/src/contract/generated/control-action.d.ts +73 -0
  33. package/dist/src/contract/generated/control-action.js +3 -0
  34. package/dist/src/contract/generated/control-action.js.map +1 -0
  35. package/dist/src/contract/generated/error.d.ts +25 -0
  36. package/dist/src/contract/generated/error.js +3 -0
  37. package/dist/src/contract/generated/error.js.map +1 -0
  38. package/dist/src/contract/generated/event.d.ts +80 -0
  39. package/dist/src/contract/generated/event.js +3 -0
  40. package/dist/src/contract/generated/event.js.map +1 -0
  41. package/dist/src/contract/generated/index.d.ts +81 -0
  42. package/dist/src/contract/generated/index.js +3 -0
  43. package/dist/src/contract/generated/index.js.map +1 -0
  44. package/dist/src/contract/generated/run.d.ts +63 -0
  45. package/dist/src/contract/generated/run.js +3 -0
  46. package/dist/src/contract/generated/run.js.map +1 -0
  47. package/dist/src/contract/generated/session.d.ts +12 -0
  48. package/dist/src/contract/generated/session.js +3 -0
  49. package/dist/src/contract/generated/session.js.map +1 -0
  50. package/dist/src/contract/generated/version.d.ts +9 -0
  51. package/dist/src/contract/generated/version.js +3 -0
  52. package/dist/src/contract/generated/version.js.map +1 -0
  53. package/dist/src/contract/ids.d.ts +36 -0
  54. package/dist/src/contract/ids.js +85 -0
  55. package/dist/src/contract/ids.js.map +1 -0
  56. package/dist/src/contract/index.d.ts +17 -0
  57. package/dist/src/contract/index.js +13 -0
  58. package/dist/src/contract/index.js.map +1 -0
  59. package/dist/src/contract/run-state.d.ts +13 -0
  60. package/dist/src/contract/run-state.js +24 -0
  61. package/dist/src/contract/run-state.js.map +1 -0
  62. package/dist/src/contract/schemas.d.ts +18 -0
  63. package/dist/src/contract/schemas.js +37 -0
  64. package/dist/src/contract/schemas.js.map +1 -0
  65. package/dist/src/contract/validate.d.ts +17 -0
  66. package/dist/src/contract/validate.js +68 -0
  67. package/dist/src/contract/validate.js.map +1 -0
  68. package/dist/src/daemon/allowlist.d.ts +23 -0
  69. package/dist/src/daemon/allowlist.js +57 -0
  70. package/dist/src/daemon/allowlist.js.map +1 -0
  71. package/dist/src/daemon/daemon.d.ts +31 -0
  72. package/dist/src/daemon/daemon.js +141 -0
  73. package/dist/src/daemon/daemon.js.map +1 -0
  74. package/dist/src/daemon/errors.d.ts +14 -0
  75. package/dist/src/daemon/errors.js +26 -0
  76. package/dist/src/daemon/errors.js.map +1 -0
  77. package/dist/src/daemon/harness-catalog.d.ts +11 -0
  78. package/dist/src/daemon/harness-catalog.js +21 -0
  79. package/dist/src/daemon/harness-catalog.js.map +1 -0
  80. package/dist/src/daemon/http.d.ts +15 -0
  81. package/dist/src/daemon/http.js +76 -0
  82. package/dist/src/daemon/http.js.map +1 -0
  83. package/dist/src/daemon/lock.d.ts +47 -0
  84. package/dist/src/daemon/lock.js +167 -0
  85. package/dist/src/daemon/lock.js.map +1 -0
  86. package/dist/src/daemon/main.d.ts +32 -0
  87. package/dist/src/daemon/main.js +204 -0
  88. package/dist/src/daemon/main.js.map +1 -0
  89. package/dist/src/daemon/paths.d.ts +29 -0
  90. package/dist/src/daemon/paths.js +26 -0
  91. package/dist/src/daemon/paths.js.map +1 -0
  92. package/dist/src/daemon/ports.d.ts +58 -0
  93. package/dist/src/daemon/ports.js +2 -0
  94. package/dist/src/daemon/ports.js.map +1 -0
  95. package/dist/src/daemon/routes.d.ts +15 -0
  96. package/dist/src/daemon/routes.js +259 -0
  97. package/dist/src/daemon/routes.js.map +1 -0
  98. package/dist/src/daemon/sse.d.ts +8 -0
  99. package/dist/src/daemon/sse.js +56 -0
  100. package/dist/src/daemon/sse.js.map +1 -0
  101. package/dist/src/harness/availability.d.ts +9 -0
  102. package/dist/src/harness/availability.js +52 -0
  103. package/dist/src/harness/availability.js.map +1 -0
  104. package/dist/src/harness/claude-code/agent.d.ts +4 -0
  105. package/dist/src/harness/claude-code/agent.js +33 -0
  106. package/dist/src/harness/claude-code/agent.js.map +1 -0
  107. package/dist/src/harness/claude-code/backend.d.ts +48 -0
  108. package/dist/src/harness/claude-code/backend.js +83 -0
  109. package/dist/src/harness/claude-code/backend.js.map +1 -0
  110. package/dist/src/harness/claude-code/capabilities.d.ts +7 -0
  111. package/dist/src/harness/claude-code/capabilities.js +11 -0
  112. package/dist/src/harness/claude-code/capabilities.js.map +1 -0
  113. package/dist/src/harness/claude-code/index.d.ts +15 -0
  114. package/dist/src/harness/claude-code/index.js +20 -0
  115. package/dist/src/harness/claude-code/index.js.map +1 -0
  116. package/dist/src/harness/claude-code/map.d.ts +30 -0
  117. package/dist/src/harness/claude-code/map.js +108 -0
  118. package/dist/src/harness/claude-code/map.js.map +1 -0
  119. package/dist/src/harness/common/capabilities.d.ts +34 -0
  120. package/dist/src/harness/common/capabilities.js +60 -0
  121. package/dist/src/harness/common/capabilities.js.map +1 -0
  122. package/dist/src/harness/common/guard.d.ts +18 -0
  123. package/dist/src/harness/common/guard.js +31 -0
  124. package/dist/src/harness/common/guard.js.map +1 -0
  125. package/dist/src/harness/common/processes.d.ts +21 -0
  126. package/dist/src/harness/common/processes.js +46 -0
  127. package/dist/src/harness/common/processes.js.map +1 -0
  128. package/dist/src/harness/common/queue.d.ts +20 -0
  129. package/dist/src/harness/common/queue.js +76 -0
  130. package/dist/src/harness/common/queue.js.map +1 -0
  131. package/dist/src/harness/common/run-driver.d.ts +88 -0
  132. package/dist/src/harness/common/run-driver.js +317 -0
  133. package/dist/src/harness/common/run-driver.js.map +1 -0
  134. package/dist/src/harness/common/sandbox-workspace.d.ts +72 -0
  135. package/dist/src/harness/common/sandbox-workspace.js +155 -0
  136. package/dist/src/harness/common/sandbox-workspace.js.map +1 -0
  137. package/dist/src/harness/common/text.d.ts +9 -0
  138. package/dist/src/harness/common/text.js +49 -0
  139. package/dist/src/harness/common/text.js.map +1 -0
  140. package/dist/src/harness/common/types.d.ts +111 -0
  141. package/dist/src/harness/common/types.js +2 -0
  142. package/dist/src/harness/common/types.js.map +1 -0
  143. package/dist/src/harness/config.d.ts +43 -0
  144. package/dist/src/harness/config.js +200 -0
  145. package/dist/src/harness/config.js.map +1 -0
  146. package/dist/src/harness/index.d.ts +21 -0
  147. package/dist/src/harness/index.js +89 -0
  148. package/dist/src/harness/index.js.map +1 -0
  149. package/dist/src/harness/opencode/backend.d.ts +37 -0
  150. package/dist/src/harness/opencode/backend.js +114 -0
  151. package/dist/src/harness/opencode/backend.js.map +1 -0
  152. package/dist/src/harness/opencode/capabilities.d.ts +8 -0
  153. package/dist/src/harness/opencode/capabilities.js +11 -0
  154. package/dist/src/harness/opencode/capabilities.js.map +1 -0
  155. package/dist/src/harness/opencode/client.d.ts +70 -0
  156. package/dist/src/harness/opencode/client.js +189 -0
  157. package/dist/src/harness/opencode/client.js.map +1 -0
  158. package/dist/src/harness/opencode/index.d.ts +13 -0
  159. package/dist/src/harness/opencode/index.js +19 -0
  160. package/dist/src/harness/opencode/index.js.map +1 -0
  161. package/dist/src/harness/opencode/lines.d.ts +14 -0
  162. package/dist/src/harness/opencode/lines.js +99 -0
  163. package/dist/src/harness/opencode/lines.js.map +1 -0
  164. package/dist/src/harness/opencode/map.d.ts +13 -0
  165. package/dist/src/harness/opencode/map.js +84 -0
  166. package/dist/src/harness/opencode/map.js.map +1 -0
  167. package/dist/src/harness/opencode/turn.d.ts +23 -0
  168. package/dist/src/harness/opencode/turn.js +143 -0
  169. package/dist/src/harness/opencode/turn.js.map +1 -0
  170. package/dist/src/harness/reclaim.d.ts +13 -0
  171. package/dist/src/harness/reclaim.js +18 -0
  172. package/dist/src/harness/reclaim.js.map +1 -0
  173. package/dist/src/harness/stub/backend.d.ts +11 -0
  174. package/dist/src/harness/stub/backend.js +125 -0
  175. package/dist/src/harness/stub/backend.js.map +1 -0
  176. package/dist/src/harness/stub/index.d.ts +18 -0
  177. package/dist/src/harness/stub/index.js +21 -0
  178. package/dist/src/harness/stub/index.js.map +1 -0
  179. package/dist/src/harness/stub/workspace.d.ts +29 -0
  180. package/dist/src/harness/stub/workspace.js +92 -0
  181. package/dist/src/harness/stub/workspace.js.map +1 -0
  182. package/dist/src/index.d.ts +2 -0
  183. package/dist/src/index.js +3 -0
  184. package/dist/src/index.js.map +1 -0
  185. package/dist/src/runs/agents.d.ts +10 -0
  186. package/dist/src/runs/agents.js +49 -0
  187. package/dist/src/runs/agents.js.map +1 -0
  188. package/dist/src/runs/control.d.ts +31 -0
  189. package/dist/src/runs/control.js +105 -0
  190. package/dist/src/runs/control.js.map +1 -0
  191. package/dist/src/runs/index.d.ts +8 -0
  192. package/dist/src/runs/index.js +7 -0
  193. package/dist/src/runs/index.js.map +1 -0
  194. package/dist/src/runs/ports.d.ts +31 -0
  195. package/dist/src/runs/ports.js +5 -0
  196. package/dist/src/runs/ports.js.map +1 -0
  197. package/dist/src/runs/scan.d.ts +38 -0
  198. package/dist/src/runs/scan.js +149 -0
  199. package/dist/src/runs/scan.js.map +1 -0
  200. package/dist/src/runs/service.d.ts +70 -0
  201. package/dist/src/runs/service.js +239 -0
  202. package/dist/src/runs/service.js.map +1 -0
  203. package/dist/src/sandbox/harness-session.d.ts +11 -0
  204. package/dist/src/sandbox/harness-session.js +170 -0
  205. package/dist/src/sandbox/harness-session.js.map +1 -0
  206. package/dist/src/sandbox/host-command.d.ts +19 -0
  207. package/dist/src/sandbox/host-command.js +41 -0
  208. package/dist/src/sandbox/host-command.js.map +1 -0
  209. package/dist/src/sandbox/index.d.ts +11 -0
  210. package/dist/src/sandbox/index.js +15 -0
  211. package/dist/src/sandbox/index.js.map +1 -0
  212. package/dist/src/sandbox/naming.d.ts +49 -0
  213. package/dist/src/sandbox/naming.js +106 -0
  214. package/dist/src/sandbox/naming.js.map +1 -0
  215. package/dist/src/sandbox/openshell-client.d.ts +81 -0
  216. package/dist/src/sandbox/openshell-client.js +49 -0
  217. package/dist/src/sandbox/openshell-client.js.map +1 -0
  218. package/dist/src/sandbox/policy.d.ts +26 -0
  219. package/dist/src/sandbox/policy.js +100 -0
  220. package/dist/src/sandbox/policy.js.map +1 -0
  221. package/dist/src/sandbox/run-sandbox.d.ts +38 -0
  222. package/dist/src/sandbox/run-sandbox.js +247 -0
  223. package/dist/src/sandbox/run-sandbox.js.map +1 -0
  224. package/dist/src/sandbox/run-sandboxes.d.ts +18 -0
  225. package/dist/src/sandbox/run-sandboxes.js +225 -0
  226. package/dist/src/sandbox/run-sandboxes.js.map +1 -0
  227. package/dist/src/sandbox/timeout.d.ts +12 -0
  228. package/dist/src/sandbox/timeout.js +39 -0
  229. package/dist/src/sandbox/timeout.js.map +1 -0
  230. package/dist/src/sandbox/types.d.ts +125 -0
  231. package/dist/src/sandbox/types.js +15 -0
  232. package/dist/src/sandbox/types.js.map +1 -0
  233. package/dist/src/sandbox/worktree.d.ts +72 -0
  234. package/dist/src/sandbox/worktree.js +157 -0
  235. package/dist/src/sandbox/worktree.js.map +1 -0
  236. package/dist/src/store/derive.d.ts +39 -0
  237. package/dist/src/store/derive.js +68 -0
  238. package/dist/src/store/derive.js.map +1 -0
  239. package/dist/src/store/event-log.d.ts +79 -0
  240. package/dist/src/store/event-log.js +202 -0
  241. package/dist/src/store/event-log.js.map +1 -0
  242. package/dist/src/store/files.d.ts +51 -0
  243. package/dist/src/store/files.js +103 -0
  244. package/dist/src/store/files.js.map +1 -0
  245. package/dist/src/store/index.d.ts +15 -0
  246. package/dist/src/store/index.js +11 -0
  247. package/dist/src/store/index.js.map +1 -0
  248. package/dist/src/store/liveness.d.ts +61 -0
  249. package/dist/src/store/liveness.js +150 -0
  250. package/dist/src/store/liveness.js.map +1 -0
  251. package/dist/src/store/run-store.d.ts +67 -0
  252. package/dist/src/store/run-store.js +211 -0
  253. package/dist/src/store/run-store.js.map +1 -0
  254. package/dist/src/util/sequence.d.ts +58 -0
  255. package/dist/src/util/sequence.js +119 -0
  256. package/dist/src/util/sequence.js.map +1 -0
  257. package/dist/src/worker/control.d.ts +60 -0
  258. package/dist/src/worker/control.js +205 -0
  259. package/dist/src/worker/control.js.map +1 -0
  260. package/dist/src/worker/delivery.d.ts +17 -0
  261. package/dist/src/worker/delivery.js +43 -0
  262. package/dist/src/worker/delivery.js.map +1 -0
  263. package/dist/src/worker/driver.d.ts +88 -0
  264. package/dist/src/worker/driver.js +6 -0
  265. package/dist/src/worker/driver.js.map +1 -0
  266. package/dist/src/worker/fake-driver.d.ts +65 -0
  267. package/dist/src/worker/fake-driver.js +123 -0
  268. package/dist/src/worker/fake-driver.js.map +1 -0
  269. package/dist/src/worker/index.d.ts +15 -0
  270. package/dist/src/worker/index.js +11 -0
  271. package/dist/src/worker/index.js.map +1 -0
  272. package/dist/src/worker/main.d.ts +1 -0
  273. package/dist/src/worker/main.js +57 -0
  274. package/dist/src/worker/main.js.map +1 -0
  275. package/dist/src/worker/retained.d.ts +13 -0
  276. package/dist/src/worker/retained.js +40 -0
  277. package/dist/src/worker/retained.js.map +1 -0
  278. package/dist/src/worker/run-loop.d.ts +63 -0
  279. package/dist/src/worker/run-loop.js +325 -0
  280. package/dist/src/worker/run-loop.js.map +1 -0
  281. package/dist/src/worker/spawn.d.ts +68 -0
  282. package/dist/src/worker/spawn.js +201 -0
  283. package/dist/src/worker/spawn.js.map +1 -0
  284. package/image/Dockerfile +81 -0
  285. package/image/build.sh +62 -0
  286. package/image/pnpm-shim.sh +25 -0
  287. package/package.json +54 -4
  288. package/policy/profiles/culture-agents-claude-subscription.yaml +59 -0
  289. package/policy/profiles/culture-agents-local-gateway.yaml +49 -0
  290. package/policy/run-sandbox.policy.json +10 -0
@@ -0,0 +1,501 @@
1
+ {
2
+ "api_version": "2.0",
3
+ "schema_base": "https://culture.dev/contract/agents/",
4
+ "description": "Index of the culture-agents control-plane API. Semantics live in contract/README.md; payload shapes in the schema files named here, resolved against schema_base.",
5
+ "transport": {
6
+ "kind": "http/1.1 over a Unix domain socket",
7
+ "socket": "${XDG_RUNTIME_DIR}/culture-agents/core.sock",
8
+ "socket_fallback": "${XDG_STATE_HOME:-$HOME/.local/state}/culture-agents/core.sock",
9
+ "socket_override_env": "CULTURE_AGENTS_SOCKET",
10
+ "socket_mode": "0600",
11
+ "version_header": "Agents-Api-Version"
12
+ },
13
+ "compatibility": "Client and core are compatible when their MAJOR numbers are equal and the core's MINOR is greater than or equal to the client's MINOR.",
14
+ "state_machine": {
15
+ "initial": "queued",
16
+ "active": [
17
+ "queued",
18
+ "running",
19
+ "cancelling"
20
+ ],
21
+ "terminal": [
22
+ "succeeded",
23
+ "failed",
24
+ "cancelled",
25
+ "timed_out",
26
+ "unknown"
27
+ ],
28
+ "transitions": {
29
+ "queued": [
30
+ "running",
31
+ "cancelling",
32
+ "failed",
33
+ "unknown"
34
+ ],
35
+ "running": [
36
+ "cancelling",
37
+ "succeeded",
38
+ "failed",
39
+ "unknown"
40
+ ],
41
+ "cancelling": [
42
+ "cancelled",
43
+ "timed_out",
44
+ "succeeded",
45
+ "failed",
46
+ "unknown"
47
+ ],
48
+ "succeeded": [],
49
+ "failed": [],
50
+ "cancelled": [],
51
+ "timed_out": [],
52
+ "unknown": []
53
+ }
54
+ },
55
+ "errors": {
56
+ "invalid": {
57
+ "http_status": 400,
58
+ "exit_code": 1,
59
+ "retryable": false
60
+ },
61
+ "denied": {
62
+ "http_status": 403,
63
+ "exit_code": 1,
64
+ "retryable": false
65
+ },
66
+ "not_found": {
67
+ "http_status": 404,
68
+ "exit_code": 1,
69
+ "retryable": false
70
+ },
71
+ "busy": {
72
+ "http_status": 409,
73
+ "exit_code": 1,
74
+ "retryable": true
75
+ },
76
+ "conflict": {
77
+ "http_status": 409,
78
+ "exit_code": 1,
79
+ "retryable": null
80
+ },
81
+ "unsupported": {
82
+ "http_status": 422,
83
+ "exit_code": 1,
84
+ "retryable": false
85
+ },
86
+ "incompatible_version": {
87
+ "http_status": 412,
88
+ "exit_code": 2,
89
+ "retryable": false
90
+ },
91
+ "unavailable": {
92
+ "http_status": 503,
93
+ "exit_code": 2,
94
+ "retryable": true
95
+ },
96
+ "internal": {
97
+ "http_status": 500,
98
+ "exit_code": 2,
99
+ "retryable": false
100
+ }
101
+ },
102
+ "routes": [
103
+ {
104
+ "id": "version",
105
+ "method": "GET",
106
+ "path": "/v1/version",
107
+ "summary": "API version, core version and node. Never refused for version mismatch.",
108
+ "cli": "(every verb, on connect)",
109
+ "d1": "supported",
110
+ "request": null,
111
+ "response": "version.json",
112
+ "status": 200,
113
+ "stream": false,
114
+ "content_type": "application/json",
115
+ "params": {},
116
+ "query": {},
117
+ "errors": [
118
+ "internal"
119
+ ]
120
+ },
121
+ {
122
+ "id": "agents.list",
123
+ "method": "GET",
124
+ "path": "/v1/agents",
125
+ "summary": "Every known agent plus every harness capability document.",
126
+ "cli": "agents agents list",
127
+ "d1": "supported",
128
+ "request": null,
129
+ "response": "agent.json#/$defs/agent_list",
130
+ "status": 200,
131
+ "stream": false,
132
+ "content_type": "application/json",
133
+ "params": {},
134
+ "query": {},
135
+ "errors": [
136
+ "invalid",
137
+ "incompatible_version",
138
+ "internal"
139
+ ]
140
+ },
141
+ {
142
+ "id": "agents.status",
143
+ "method": "GET",
144
+ "path": "/v1/agents/{agent_id}",
145
+ "summary": "One agent.",
146
+ "cli": "agents agents status",
147
+ "d1": "supported",
148
+ "request": null,
149
+ "response": "agent.json",
150
+ "status": 200,
151
+ "stream": false,
152
+ "content_type": "application/json",
153
+ "params": {
154
+ "agent_id": "common.json#/$defs/mesh_id"
155
+ },
156
+ "query": {},
157
+ "errors": [
158
+ "invalid",
159
+ "incompatible_version",
160
+ "internal",
161
+ "not_found"
162
+ ]
163
+ },
164
+ {
165
+ "id": "harnesses.list",
166
+ "method": "GET",
167
+ "path": "/v1/harnesses",
168
+ "summary": "Every harness capability document.",
169
+ "cli": "agents agents list",
170
+ "d1": "supported",
171
+ "request": null,
172
+ "response": "capabilities.json#/$defs/capabilities_list",
173
+ "status": 200,
174
+ "stream": false,
175
+ "content_type": "application/json",
176
+ "params": {},
177
+ "query": {},
178
+ "errors": [
179
+ "invalid",
180
+ "incompatible_version",
181
+ "internal"
182
+ ]
183
+ },
184
+ {
185
+ "id": "harnesses.show",
186
+ "method": "GET",
187
+ "path": "/v1/harnesses/{harness}",
188
+ "summary": "One harness capability document.",
189
+ "cli": "agents agents status",
190
+ "d1": "supported",
191
+ "request": null,
192
+ "response": "capabilities.json",
193
+ "status": 200,
194
+ "stream": false,
195
+ "content_type": "application/json",
196
+ "params": {
197
+ "harness": "common.json#/$defs/harness_id"
198
+ },
199
+ "query": {},
200
+ "errors": [
201
+ "invalid",
202
+ "incompatible_version",
203
+ "internal",
204
+ "not_found"
205
+ ]
206
+ },
207
+ {
208
+ "id": "runs.submit",
209
+ "method": "POST",
210
+ "path": "/v1/runs",
211
+ "summary": "Create a run; returns once the worker's PID, event log and cursor are on disk.",
212
+ "cli": "agents runs submit",
213
+ "d1": "supported",
214
+ "request": "control-action.json#/$defs/submit_request",
215
+ "response": "control-action.json#/$defs/submit_response",
216
+ "status": 201,
217
+ "stream": false,
218
+ "content_type": "application/json",
219
+ "params": {},
220
+ "query": {},
221
+ "errors": [
222
+ "invalid",
223
+ "incompatible_version",
224
+ "internal",
225
+ "denied",
226
+ "not_found",
227
+ "unsupported",
228
+ "busy",
229
+ "unavailable"
230
+ ]
231
+ },
232
+ {
233
+ "id": "runs.list",
234
+ "method": "GET",
235
+ "path": "/v1/runs",
236
+ "summary": "Runs, newest first, optionally filtered.",
237
+ "cli": "agents runs list",
238
+ "d1": "supported",
239
+ "request": null,
240
+ "response": "run.json#/$defs/run_list",
241
+ "status": 200,
242
+ "stream": false,
243
+ "content_type": "application/json",
244
+ "params": {},
245
+ "query": {
246
+ "state": {
247
+ "$ref": "run.json#/$defs/state"
248
+ },
249
+ "agent_id": {
250
+ "$ref": "common.json#/$defs/mesh_id"
251
+ },
252
+ "limit": {
253
+ "type": "integer",
254
+ "minimum": 1,
255
+ "maximum": 500,
256
+ "default": 50
257
+ }
258
+ },
259
+ "errors": [
260
+ "invalid",
261
+ "incompatible_version",
262
+ "internal"
263
+ ]
264
+ },
265
+ {
266
+ "id": "runs.show",
267
+ "method": "GET",
268
+ "path": "/v1/runs/{run_id}",
269
+ "summary": "One run.",
270
+ "cli": "agents runs show",
271
+ "d1": "supported",
272
+ "request": null,
273
+ "response": "run.json",
274
+ "status": 200,
275
+ "stream": false,
276
+ "content_type": "application/json",
277
+ "params": {
278
+ "run_id": "common.json#/$defs/run_id"
279
+ },
280
+ "query": {},
281
+ "errors": [
282
+ "invalid",
283
+ "incompatible_version",
284
+ "internal",
285
+ "not_found"
286
+ ]
287
+ },
288
+ {
289
+ "id": "runs.attach",
290
+ "method": "GET",
291
+ "path": "/v1/runs/{run_id}/attach",
292
+ "summary": "SSE: replay events with cursor > after, then follow live; closes after the terminal run.state event.",
293
+ "cli": "agents runs attach",
294
+ "d1": "supported",
295
+ "request": null,
296
+ "response": "event.json",
297
+ "status": 200,
298
+ "stream": true,
299
+ "content_type": "text/event-stream",
300
+ "params": {
301
+ "run_id": "common.json#/$defs/run_id"
302
+ },
303
+ "query": {
304
+ "after": {
305
+ "type": "integer",
306
+ "minimum": 0,
307
+ "default": 0
308
+ }
309
+ },
310
+ "errors": [
311
+ "invalid",
312
+ "incompatible_version",
313
+ "internal",
314
+ "not_found"
315
+ ]
316
+ },
317
+ {
318
+ "id": "runs.logs",
319
+ "method": "GET",
320
+ "path": "/v1/runs/{run_id}/events",
321
+ "summary": "A page of stored events with cursor > after, oldest first.",
322
+ "cli": "agents runs logs",
323
+ "d1": "supported",
324
+ "request": null,
325
+ "response": "event.json#/$defs/event_page",
326
+ "status": 200,
327
+ "stream": false,
328
+ "content_type": "application/json",
329
+ "params": {
330
+ "run_id": "common.json#/$defs/run_id"
331
+ },
332
+ "query": {
333
+ "after": {
334
+ "type": "integer",
335
+ "minimum": 0,
336
+ "default": 0
337
+ },
338
+ "limit": {
339
+ "type": "integer",
340
+ "minimum": 1,
341
+ "maximum": 5000,
342
+ "default": 500
343
+ }
344
+ },
345
+ "errors": [
346
+ "invalid",
347
+ "incompatible_version",
348
+ "internal",
349
+ "not_found"
350
+ ]
351
+ },
352
+ {
353
+ "id": "runs.result",
354
+ "method": "GET",
355
+ "path": "/v1/runs/{run_id}/result",
356
+ "summary": "Outcome of a terminal run; conflict while the run is active.",
357
+ "cli": "agents runs result",
358
+ "d1": "supported",
359
+ "request": null,
360
+ "response": "run.json#/$defs/run_result",
361
+ "status": 200,
362
+ "stream": false,
363
+ "content_type": "application/json",
364
+ "params": {
365
+ "run_id": "common.json#/$defs/run_id"
366
+ },
367
+ "query": {},
368
+ "errors": [
369
+ "invalid",
370
+ "incompatible_version",
371
+ "internal",
372
+ "not_found",
373
+ "conflict"
374
+ ]
375
+ },
376
+ {
377
+ "id": "runs.steer",
378
+ "method": "POST",
379
+ "path": "/v1/runs/{run_id}/steer",
380
+ "summary": "Deliver a mid-run instruction to a running run.",
381
+ "cli": "agents runs steer",
382
+ "d1": "supported",
383
+ "request": "control-action.json#/$defs/steer_request",
384
+ "response": "control-action.json#/$defs/accepted_response",
385
+ "status": 202,
386
+ "stream": false,
387
+ "content_type": "application/json",
388
+ "params": {
389
+ "run_id": "common.json#/$defs/run_id"
390
+ },
391
+ "query": {},
392
+ "errors": [
393
+ "invalid",
394
+ "incompatible_version",
395
+ "internal",
396
+ "not_found",
397
+ "conflict",
398
+ "unsupported",
399
+ "unavailable"
400
+ ]
401
+ },
402
+ {
403
+ "id": "runs.cancel",
404
+ "method": "POST",
405
+ "path": "/v1/runs/{run_id}/cancel",
406
+ "summary": "Start cancellation; the run moves to cancelling, then a terminal state.",
407
+ "cli": "agents runs cancel",
408
+ "d1": "supported",
409
+ "request": "control-action.json#/$defs/cancel_request",
410
+ "response": "control-action.json#/$defs/accepted_response",
411
+ "status": 202,
412
+ "stream": false,
413
+ "content_type": "application/json",
414
+ "params": {
415
+ "run_id": "common.json#/$defs/run_id"
416
+ },
417
+ "query": {},
418
+ "errors": [
419
+ "invalid",
420
+ "incompatible_version",
421
+ "internal",
422
+ "not_found",
423
+ "conflict",
424
+ "unsupported",
425
+ "unavailable"
426
+ ]
427
+ },
428
+ {
429
+ "id": "runs.pause",
430
+ "method": "POST",
431
+ "path": "/v1/runs/{run_id}/pause",
432
+ "summary": "Deferred: always refused with unsupported, capability pause, after validation and not_found checks.",
433
+ "cli": "(none in D1)",
434
+ "d1": "unsupported",
435
+ "request": "control-action.json#/$defs/pause_request",
436
+ "response": "control-action.json#/$defs/accepted_response",
437
+ "status": 202,
438
+ "stream": false,
439
+ "content_type": "application/json",
440
+ "params": {
441
+ "run_id": "common.json#/$defs/run_id"
442
+ },
443
+ "query": {},
444
+ "errors": [
445
+ "invalid",
446
+ "incompatible_version",
447
+ "internal",
448
+ "not_found",
449
+ "unsupported"
450
+ ]
451
+ },
452
+ {
453
+ "id": "runs.resume",
454
+ "method": "POST",
455
+ "path": "/v1/runs/{run_id}/resume",
456
+ "summary": "Deferred: always refused with unsupported, capability resume, after validation and not_found checks.",
457
+ "cli": "(none in D1)",
458
+ "d1": "unsupported",
459
+ "request": "control-action.json#/$defs/resume_request",
460
+ "response": "control-action.json#/$defs/accepted_response",
461
+ "status": 202,
462
+ "stream": false,
463
+ "content_type": "application/json",
464
+ "params": {
465
+ "run_id": "common.json#/$defs/run_id"
466
+ },
467
+ "query": {},
468
+ "errors": [
469
+ "invalid",
470
+ "incompatible_version",
471
+ "internal",
472
+ "not_found",
473
+ "unsupported"
474
+ ]
475
+ },
476
+ {
477
+ "id": "runs.answer",
478
+ "method": "POST",
479
+ "path": "/v1/runs/{run_id}/answer",
480
+ "summary": "Deferred: always refused with unsupported, capability answer, after validation and not_found checks.",
481
+ "cli": "(none in D1)",
482
+ "d1": "unsupported",
483
+ "request": "control-action.json#/$defs/answer_request",
484
+ "response": "control-action.json#/$defs/accepted_response",
485
+ "status": 202,
486
+ "stream": false,
487
+ "content_type": "application/json",
488
+ "params": {
489
+ "run_id": "common.json#/$defs/run_id"
490
+ },
491
+ "query": {},
492
+ "errors": [
493
+ "invalid",
494
+ "incompatible_version",
495
+ "internal",
496
+ "not_found",
497
+ "unsupported"
498
+ ]
499
+ }
500
+ ]
501
+ }
@@ -0,0 +1,208 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://culture.dev/contract/agents/capabilities.json",
4
+ "title": "Harness capability document",
5
+ "description": "What one harness can do through this core, stated honestly. Every capability name is always present. A control action whose capability is not supported is refused with an `unsupported` error naming it, never dropped or simulated.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "harness",
10
+ "available",
11
+ "version",
12
+ "transport",
13
+ "capabilities"
14
+ ],
15
+ "properties": {
16
+ "harness": {
17
+ "$ref": "common.json#/$defs/harness_id"
18
+ },
19
+ "available": {
20
+ "description": "Whether the core can start this harness right now (binary, credentials and sandbox present).",
21
+ "type": "boolean"
22
+ },
23
+ "version": {
24
+ "description": "The harness's own version string as detected, or null if unknown.",
25
+ "type": [
26
+ "string",
27
+ "null"
28
+ ],
29
+ "maxLength": 128
30
+ },
31
+ "transport": {
32
+ "description": "Neutral one-line description of how the core drives the harness (for example `interactive session over a local bridge`). Informational only.",
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "maxLength": 200
36
+ },
37
+ "capabilities": {
38
+ "$ref": "#/$defs/capability_set"
39
+ },
40
+ "extension": {
41
+ "$ref": "common.json#/$defs/extension"
42
+ }
43
+ },
44
+ "$defs": {
45
+ "capability_name": {
46
+ "description": "Every capability the contract can name in a capability document or an `unsupported` error.",
47
+ "enum": [
48
+ "submit",
49
+ "stream",
50
+ "steer",
51
+ "cancel",
52
+ "pause",
53
+ "resume",
54
+ "answer",
55
+ "continue_session",
56
+ "delegate",
57
+ "placement",
58
+ "reconnect",
59
+ "worktree_isolation"
60
+ ]
61
+ },
62
+ "capability": {
63
+ "type": "object",
64
+ "additionalProperties": false,
65
+ "required": [
66
+ "supported",
67
+ "reason",
68
+ "caveats"
69
+ ],
70
+ "properties": {
71
+ "supported": {
72
+ "type": "boolean"
73
+ },
74
+ "reason": {
75
+ "description": "Why it is unsupported (required then), or null when supported.",
76
+ "type": [
77
+ "string",
78
+ "null"
79
+ ],
80
+ "maxLength": 500
81
+ },
82
+ "caveats": {
83
+ "description": "Known limits of a supported capability, for example that cancel can leave a harness child process running until the sandbox is deleted.",
84
+ "type": "array",
85
+ "items": {
86
+ "type": "string",
87
+ "minLength": 1,
88
+ "maxLength": 500
89
+ }
90
+ }
91
+ },
92
+ "if": {
93
+ "required": [
94
+ "supported"
95
+ ],
96
+ "properties": {
97
+ "supported": {
98
+ "const": false
99
+ }
100
+ }
101
+ },
102
+ "then": {
103
+ "properties": {
104
+ "reason": {
105
+ "type": "string",
106
+ "minLength": 1
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "deferred": {
112
+ "description": "A capability no harness supports in this API version. Changing it to supportable is a schema change (README: versioning).",
113
+ "type": "object",
114
+ "additionalProperties": false,
115
+ "required": [
116
+ "supported",
117
+ "reason",
118
+ "caveats"
119
+ ],
120
+ "properties": {
121
+ "supported": {
122
+ "const": false
123
+ },
124
+ "reason": {
125
+ "type": "string",
126
+ "minLength": 1,
127
+ "maxLength": 500
128
+ },
129
+ "caveats": {
130
+ "type": "array",
131
+ "maxItems": 0
132
+ }
133
+ }
134
+ },
135
+ "capability_set": {
136
+ "type": "object",
137
+ "additionalProperties": false,
138
+ "required": [
139
+ "submit",
140
+ "stream",
141
+ "steer",
142
+ "cancel",
143
+ "pause",
144
+ "resume",
145
+ "answer",
146
+ "continue_session",
147
+ "delegate",
148
+ "placement",
149
+ "reconnect",
150
+ "worktree_isolation"
151
+ ],
152
+ "properties": {
153
+ "submit": {
154
+ "$ref": "#/$defs/capability"
155
+ },
156
+ "stream": {
157
+ "$ref": "#/$defs/capability"
158
+ },
159
+ "steer": {
160
+ "$ref": "#/$defs/capability"
161
+ },
162
+ "cancel": {
163
+ "$ref": "#/$defs/capability"
164
+ },
165
+ "pause": {
166
+ "$ref": "#/$defs/deferred"
167
+ },
168
+ "resume": {
169
+ "$ref": "#/$defs/deferred"
170
+ },
171
+ "answer": {
172
+ "$ref": "#/$defs/deferred"
173
+ },
174
+ "continue_session": {
175
+ "$ref": "#/$defs/deferred"
176
+ },
177
+ "delegate": {
178
+ "$ref": "#/$defs/deferred"
179
+ },
180
+ "placement": {
181
+ "$ref": "#/$defs/deferred"
182
+ },
183
+ "reconnect": {
184
+ "$ref": "#/$defs/deferred"
185
+ },
186
+ "worktree_isolation": {
187
+ "$ref": "#/$defs/deferred"
188
+ }
189
+ }
190
+ },
191
+ "capabilities_list": {
192
+ "description": "Response of GET /v1/harnesses.",
193
+ "type": "object",
194
+ "additionalProperties": false,
195
+ "required": [
196
+ "harnesses"
197
+ ],
198
+ "properties": {
199
+ "harnesses": {
200
+ "type": "array",
201
+ "items": {
202
+ "$ref": "#"
203
+ }
204
+ }
205
+ }
206
+ }
207
+ }
208
+ }