@culture.dev/agents 0.0.0-stage → 0.15.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.
- package/LICENSE +201 -0
- package/README.md +59 -2
- package/dist/contract-schemas/agent.json +128 -0
- package/dist/contract-schemas/allowlist.json +25 -0
- package/dist/contract-schemas/api.json +501 -0
- package/dist/contract-schemas/capabilities.json +208 -0
- package/dist/contract-schemas/common.json +123 -0
- package/dist/contract-schemas/control-action.json +279 -0
- package/dist/contract-schemas/error.json +269 -0
- package/dist/contract-schemas/event.json +316 -0
- package/dist/contract-schemas/run.json +336 -0
- package/dist/contract-schemas/session.json +77 -0
- package/dist/contract-schemas/version.json +22 -0
- package/dist/src/contract/api.d.ts +41 -0
- package/dist/src/contract/api.js +35 -0
- package/dist/src/contract/api.js.map +1 -0
- package/dist/src/contract/errors.d.ts +21 -0
- package/dist/src/contract/errors.js +25 -0
- package/dist/src/contract/errors.js.map +1 -0
- package/dist/src/contract/generated/agent.d.ts +31 -0
- package/dist/src/contract/generated/agent.js +3 -0
- package/dist/src/contract/generated/agent.js.map +1 -0
- package/dist/src/contract/generated/allowlist.d.ts +10 -0
- package/dist/src/contract/generated/allowlist.js +3 -0
- package/dist/src/contract/generated/allowlist.js.map +1 -0
- package/dist/src/contract/generated/capabilities.d.ts +46 -0
- package/dist/src/contract/generated/capabilities.js +3 -0
- package/dist/src/contract/generated/capabilities.js.map +1 -0
- package/dist/src/contract/generated/common.d.ts +40 -0
- package/dist/src/contract/generated/common.js +3 -0
- package/dist/src/contract/generated/common.js.map +1 -0
- package/dist/src/contract/generated/control-action.d.ts +73 -0
- package/dist/src/contract/generated/control-action.js +3 -0
- package/dist/src/contract/generated/control-action.js.map +1 -0
- package/dist/src/contract/generated/error.d.ts +25 -0
- package/dist/src/contract/generated/error.js +3 -0
- package/dist/src/contract/generated/error.js.map +1 -0
- package/dist/src/contract/generated/event.d.ts +80 -0
- package/dist/src/contract/generated/event.js +3 -0
- package/dist/src/contract/generated/event.js.map +1 -0
- package/dist/src/contract/generated/index.d.ts +81 -0
- package/dist/src/contract/generated/index.js +3 -0
- package/dist/src/contract/generated/index.js.map +1 -0
- package/dist/src/contract/generated/run.d.ts +63 -0
- package/dist/src/contract/generated/run.js +3 -0
- package/dist/src/contract/generated/run.js.map +1 -0
- package/dist/src/contract/generated/session.d.ts +12 -0
- package/dist/src/contract/generated/session.js +3 -0
- package/dist/src/contract/generated/session.js.map +1 -0
- package/dist/src/contract/generated/version.d.ts +9 -0
- package/dist/src/contract/generated/version.js +3 -0
- package/dist/src/contract/generated/version.js.map +1 -0
- package/dist/src/contract/ids.d.ts +36 -0
- package/dist/src/contract/ids.js +85 -0
- package/dist/src/contract/ids.js.map +1 -0
- package/dist/src/contract/index.d.ts +17 -0
- package/dist/src/contract/index.js +13 -0
- package/dist/src/contract/index.js.map +1 -0
- package/dist/src/contract/run-state.d.ts +13 -0
- package/dist/src/contract/run-state.js +24 -0
- package/dist/src/contract/run-state.js.map +1 -0
- package/dist/src/contract/schemas.d.ts +18 -0
- package/dist/src/contract/schemas.js +37 -0
- package/dist/src/contract/schemas.js.map +1 -0
- package/dist/src/contract/validate.d.ts +17 -0
- package/dist/src/contract/validate.js +68 -0
- package/dist/src/contract/validate.js.map +1 -0
- package/dist/src/daemon/allowlist.d.ts +23 -0
- package/dist/src/daemon/allowlist.js +57 -0
- package/dist/src/daemon/allowlist.js.map +1 -0
- package/dist/src/daemon/daemon.d.ts +31 -0
- package/dist/src/daemon/daemon.js +141 -0
- package/dist/src/daemon/daemon.js.map +1 -0
- package/dist/src/daemon/errors.d.ts +14 -0
- package/dist/src/daemon/errors.js +26 -0
- package/dist/src/daemon/errors.js.map +1 -0
- package/dist/src/daemon/harness-catalog.d.ts +11 -0
- package/dist/src/daemon/harness-catalog.js +21 -0
- package/dist/src/daemon/harness-catalog.js.map +1 -0
- package/dist/src/daemon/http.d.ts +15 -0
- package/dist/src/daemon/http.js +76 -0
- package/dist/src/daemon/http.js.map +1 -0
- package/dist/src/daemon/lock.d.ts +47 -0
- package/dist/src/daemon/lock.js +167 -0
- package/dist/src/daemon/lock.js.map +1 -0
- package/dist/src/daemon/main.d.ts +32 -0
- package/dist/src/daemon/main.js +204 -0
- package/dist/src/daemon/main.js.map +1 -0
- package/dist/src/daemon/paths.d.ts +29 -0
- package/dist/src/daemon/paths.js +26 -0
- package/dist/src/daemon/paths.js.map +1 -0
- package/dist/src/daemon/ports.d.ts +58 -0
- package/dist/src/daemon/ports.js +2 -0
- package/dist/src/daemon/ports.js.map +1 -0
- package/dist/src/daemon/routes.d.ts +15 -0
- package/dist/src/daemon/routes.js +259 -0
- package/dist/src/daemon/routes.js.map +1 -0
- package/dist/src/daemon/sse.d.ts +8 -0
- package/dist/src/daemon/sse.js +56 -0
- package/dist/src/daemon/sse.js.map +1 -0
- package/dist/src/harness/availability.d.ts +9 -0
- package/dist/src/harness/availability.js +52 -0
- package/dist/src/harness/availability.js.map +1 -0
- package/dist/src/harness/claude-code/agent.d.ts +4 -0
- package/dist/src/harness/claude-code/agent.js +33 -0
- package/dist/src/harness/claude-code/agent.js.map +1 -0
- package/dist/src/harness/claude-code/backend.d.ts +48 -0
- package/dist/src/harness/claude-code/backend.js +83 -0
- package/dist/src/harness/claude-code/backend.js.map +1 -0
- package/dist/src/harness/claude-code/capabilities.d.ts +7 -0
- package/dist/src/harness/claude-code/capabilities.js +11 -0
- package/dist/src/harness/claude-code/capabilities.js.map +1 -0
- package/dist/src/harness/claude-code/index.d.ts +15 -0
- package/dist/src/harness/claude-code/index.js +20 -0
- package/dist/src/harness/claude-code/index.js.map +1 -0
- package/dist/src/harness/claude-code/map.d.ts +30 -0
- package/dist/src/harness/claude-code/map.js +108 -0
- package/dist/src/harness/claude-code/map.js.map +1 -0
- package/dist/src/harness/common/capabilities.d.ts +34 -0
- package/dist/src/harness/common/capabilities.js +60 -0
- package/dist/src/harness/common/capabilities.js.map +1 -0
- package/dist/src/harness/common/guard.d.ts +18 -0
- package/dist/src/harness/common/guard.js +31 -0
- package/dist/src/harness/common/guard.js.map +1 -0
- package/dist/src/harness/common/processes.d.ts +21 -0
- package/dist/src/harness/common/processes.js +46 -0
- package/dist/src/harness/common/processes.js.map +1 -0
- package/dist/src/harness/common/queue.d.ts +20 -0
- package/dist/src/harness/common/queue.js +76 -0
- package/dist/src/harness/common/queue.js.map +1 -0
- package/dist/src/harness/common/run-driver.d.ts +88 -0
- package/dist/src/harness/common/run-driver.js +317 -0
- package/dist/src/harness/common/run-driver.js.map +1 -0
- package/dist/src/harness/common/sandbox-workspace.d.ts +72 -0
- package/dist/src/harness/common/sandbox-workspace.js +155 -0
- package/dist/src/harness/common/sandbox-workspace.js.map +1 -0
- package/dist/src/harness/common/text.d.ts +9 -0
- package/dist/src/harness/common/text.js +49 -0
- package/dist/src/harness/common/text.js.map +1 -0
- package/dist/src/harness/common/types.d.ts +111 -0
- package/dist/src/harness/common/types.js +2 -0
- package/dist/src/harness/common/types.js.map +1 -0
- package/dist/src/harness/config.d.ts +43 -0
- package/dist/src/harness/config.js +200 -0
- package/dist/src/harness/config.js.map +1 -0
- package/dist/src/harness/index.d.ts +21 -0
- package/dist/src/harness/index.js +89 -0
- package/dist/src/harness/index.js.map +1 -0
- package/dist/src/harness/opencode/backend.d.ts +37 -0
- package/dist/src/harness/opencode/backend.js +114 -0
- package/dist/src/harness/opencode/backend.js.map +1 -0
- package/dist/src/harness/opencode/capabilities.d.ts +8 -0
- package/dist/src/harness/opencode/capabilities.js +11 -0
- package/dist/src/harness/opencode/capabilities.js.map +1 -0
- package/dist/src/harness/opencode/client.d.ts +70 -0
- package/dist/src/harness/opencode/client.js +189 -0
- package/dist/src/harness/opencode/client.js.map +1 -0
- package/dist/src/harness/opencode/index.d.ts +13 -0
- package/dist/src/harness/opencode/index.js +19 -0
- package/dist/src/harness/opencode/index.js.map +1 -0
- package/dist/src/harness/opencode/lines.d.ts +14 -0
- package/dist/src/harness/opencode/lines.js +99 -0
- package/dist/src/harness/opencode/lines.js.map +1 -0
- package/dist/src/harness/opencode/map.d.ts +13 -0
- package/dist/src/harness/opencode/map.js +84 -0
- package/dist/src/harness/opencode/map.js.map +1 -0
- package/dist/src/harness/opencode/turn.d.ts +23 -0
- package/dist/src/harness/opencode/turn.js +143 -0
- package/dist/src/harness/opencode/turn.js.map +1 -0
- package/dist/src/harness/reclaim.d.ts +13 -0
- package/dist/src/harness/reclaim.js +18 -0
- package/dist/src/harness/reclaim.js.map +1 -0
- package/dist/src/harness/stub/backend.d.ts +11 -0
- package/dist/src/harness/stub/backend.js +125 -0
- package/dist/src/harness/stub/backend.js.map +1 -0
- package/dist/src/harness/stub/index.d.ts +18 -0
- package/dist/src/harness/stub/index.js +21 -0
- package/dist/src/harness/stub/index.js.map +1 -0
- package/dist/src/harness/stub/workspace.d.ts +29 -0
- package/dist/src/harness/stub/workspace.js +92 -0
- package/dist/src/harness/stub/workspace.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/runs/agents.d.ts +10 -0
- package/dist/src/runs/agents.js +49 -0
- package/dist/src/runs/agents.js.map +1 -0
- package/dist/src/runs/control.d.ts +31 -0
- package/dist/src/runs/control.js +105 -0
- package/dist/src/runs/control.js.map +1 -0
- package/dist/src/runs/index.d.ts +8 -0
- package/dist/src/runs/index.js +7 -0
- package/dist/src/runs/index.js.map +1 -0
- package/dist/src/runs/ports.d.ts +31 -0
- package/dist/src/runs/ports.js +5 -0
- package/dist/src/runs/ports.js.map +1 -0
- package/dist/src/runs/scan.d.ts +38 -0
- package/dist/src/runs/scan.js +149 -0
- package/dist/src/runs/scan.js.map +1 -0
- package/dist/src/runs/service.d.ts +70 -0
- package/dist/src/runs/service.js +239 -0
- package/dist/src/runs/service.js.map +1 -0
- package/dist/src/sandbox/harness-session.d.ts +11 -0
- package/dist/src/sandbox/harness-session.js +170 -0
- package/dist/src/sandbox/harness-session.js.map +1 -0
- package/dist/src/sandbox/host-command.d.ts +19 -0
- package/dist/src/sandbox/host-command.js +41 -0
- package/dist/src/sandbox/host-command.js.map +1 -0
- package/dist/src/sandbox/index.d.ts +11 -0
- package/dist/src/sandbox/index.js +15 -0
- package/dist/src/sandbox/index.js.map +1 -0
- package/dist/src/sandbox/naming.d.ts +49 -0
- package/dist/src/sandbox/naming.js +106 -0
- package/dist/src/sandbox/naming.js.map +1 -0
- package/dist/src/sandbox/openshell-client.d.ts +81 -0
- package/dist/src/sandbox/openshell-client.js +49 -0
- package/dist/src/sandbox/openshell-client.js.map +1 -0
- package/dist/src/sandbox/policy.d.ts +26 -0
- package/dist/src/sandbox/policy.js +100 -0
- package/dist/src/sandbox/policy.js.map +1 -0
- package/dist/src/sandbox/run-sandbox.d.ts +38 -0
- package/dist/src/sandbox/run-sandbox.js +247 -0
- package/dist/src/sandbox/run-sandbox.js.map +1 -0
- package/dist/src/sandbox/run-sandboxes.d.ts +18 -0
- package/dist/src/sandbox/run-sandboxes.js +225 -0
- package/dist/src/sandbox/run-sandboxes.js.map +1 -0
- package/dist/src/sandbox/timeout.d.ts +12 -0
- package/dist/src/sandbox/timeout.js +39 -0
- package/dist/src/sandbox/timeout.js.map +1 -0
- package/dist/src/sandbox/types.d.ts +125 -0
- package/dist/src/sandbox/types.js +15 -0
- package/dist/src/sandbox/types.js.map +1 -0
- package/dist/src/sandbox/worktree.d.ts +72 -0
- package/dist/src/sandbox/worktree.js +157 -0
- package/dist/src/sandbox/worktree.js.map +1 -0
- package/dist/src/store/derive.d.ts +39 -0
- package/dist/src/store/derive.js +68 -0
- package/dist/src/store/derive.js.map +1 -0
- package/dist/src/store/event-log.d.ts +79 -0
- package/dist/src/store/event-log.js +202 -0
- package/dist/src/store/event-log.js.map +1 -0
- package/dist/src/store/files.d.ts +51 -0
- package/dist/src/store/files.js +103 -0
- package/dist/src/store/files.js.map +1 -0
- package/dist/src/store/index.d.ts +15 -0
- package/dist/src/store/index.js +11 -0
- package/dist/src/store/index.js.map +1 -0
- package/dist/src/store/liveness.d.ts +61 -0
- package/dist/src/store/liveness.js +150 -0
- package/dist/src/store/liveness.js.map +1 -0
- package/dist/src/store/run-store.d.ts +67 -0
- package/dist/src/store/run-store.js +211 -0
- package/dist/src/store/run-store.js.map +1 -0
- package/dist/src/util/sequence.d.ts +58 -0
- package/dist/src/util/sequence.js +119 -0
- package/dist/src/util/sequence.js.map +1 -0
- package/dist/src/worker/control.d.ts +60 -0
- package/dist/src/worker/control.js +205 -0
- package/dist/src/worker/control.js.map +1 -0
- package/dist/src/worker/delivery.d.ts +17 -0
- package/dist/src/worker/delivery.js +43 -0
- package/dist/src/worker/delivery.js.map +1 -0
- package/dist/src/worker/driver.d.ts +88 -0
- package/dist/src/worker/driver.js +6 -0
- package/dist/src/worker/driver.js.map +1 -0
- package/dist/src/worker/fake-driver.d.ts +65 -0
- package/dist/src/worker/fake-driver.js +123 -0
- package/dist/src/worker/fake-driver.js.map +1 -0
- package/dist/src/worker/index.d.ts +15 -0
- package/dist/src/worker/index.js +11 -0
- package/dist/src/worker/index.js.map +1 -0
- package/dist/src/worker/main.d.ts +1 -0
- package/dist/src/worker/main.js +57 -0
- package/dist/src/worker/main.js.map +1 -0
- package/dist/src/worker/retained.d.ts +13 -0
- package/dist/src/worker/retained.js +40 -0
- package/dist/src/worker/retained.js.map +1 -0
- package/dist/src/worker/run-loop.d.ts +63 -0
- package/dist/src/worker/run-loop.js +325 -0
- package/dist/src/worker/run-loop.js.map +1 -0
- package/dist/src/worker/spawn.d.ts +68 -0
- package/dist/src/worker/spawn.js +201 -0
- package/dist/src/worker/spawn.js.map +1 -0
- package/image/Dockerfile +81 -0
- package/image/build.sh +62 -0
- package/image/pnpm-shim.sh +25 -0
- package/package.json +54 -4
- package/policy/profiles/culture-agents-claude-subscription.yaml +59 -0
- package/policy/profiles/culture-agents-local-gateway.yaml +49 -0
- package/policy/run-sandbox.policy.json +10 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://culture.dev/contract/agents/common.json",
|
|
4
|
+
"title": "Shared definitions",
|
|
5
|
+
"description": "Identifiers, timestamps and small value types shared by every contract schema. See contract/README.md for semantics.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"node": {
|
|
8
|
+
"description": "Mesh node name, the `<node>` part of a `<node>-<agent>` identity. No hyphen, so the first hyphen of a mesh id always ends the node.",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"pattern": "^[a-z0-9]{1,32}$"
|
|
11
|
+
},
|
|
12
|
+
"suffix": {
|
|
13
|
+
"description": "Agent suffix, the `<agent>` part of a `<node>-<agent>` identity (culture.yaml `suffix`).",
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 1,
|
|
16
|
+
"maxLength": 63,
|
|
17
|
+
"pattern": "^[a-z0-9_]+(-[a-z0-9_]+)*$"
|
|
18
|
+
},
|
|
19
|
+
"mesh_id": {
|
|
20
|
+
"description": "A mesh identity in `<node>-<agent>` form, used for agents and for principals (operators and agents). The node is 1 to 32 characters and the whole id at most 96.",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"maxLength": 96,
|
|
23
|
+
"pattern": "^[a-z0-9]{1,32}-[a-z0-9_]+(-[a-z0-9_]+)*$"
|
|
24
|
+
},
|
|
25
|
+
"ulid": {
|
|
26
|
+
"description": "A ULID: 26 Crockford base32 characters, uppercase.",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"pattern": "^[0-9A-HJKMNP-TV-Z]{26}$"
|
|
29
|
+
},
|
|
30
|
+
"run_id": {
|
|
31
|
+
"description": "Stable run id: `<node>-<agent>.run.<ULID>`, where `<node>-<agent>` is the executing agent's mesh id. At most 127 characters: a mesh id of at most 96, then the 31 of `.run.<ULID>`.",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"maxLength": 127,
|
|
34
|
+
"pattern": "^[a-z0-9]{1,32}-[a-z0-9_]+(-[a-z0-9_]+)*\\.run\\.[0-9A-HJKMNP-TV-Z]{26}$"
|
|
35
|
+
},
|
|
36
|
+
"session_id": {
|
|
37
|
+
"description": "Stable session id: `<node>-<agent>.ses.<ULID>`. At most 127 characters: a mesh id of at most 96, then the 31 of `.ses.<ULID>`.",
|
|
38
|
+
"type": "string",
|
|
39
|
+
"maxLength": 127,
|
|
40
|
+
"pattern": "^[a-z0-9]{1,32}-[a-z0-9_]+(-[a-z0-9_]+)*\\.ses\\.[0-9A-HJKMNP-TV-Z]{26}$"
|
|
41
|
+
},
|
|
42
|
+
"action_id": {
|
|
43
|
+
"description": "Stable control-action id: `<node>-<agent>.act.<ULID>`, using the target run's agent. At most 127 characters: a mesh id of at most 96, then the 31 of `.act.<ULID>`.",
|
|
44
|
+
"type": "string",
|
|
45
|
+
"maxLength": 127,
|
|
46
|
+
"pattern": "^[a-z0-9]{1,32}-[a-z0-9_]+(-[a-z0-9_]+)*\\.act\\.[0-9A-HJKMNP-TV-Z]{26}$"
|
|
47
|
+
},
|
|
48
|
+
"harness_id": {
|
|
49
|
+
"description": "Harness identifier, a free lowercase string (for example `claude-code`, `opencode`). Deliberately not an enum.",
|
|
50
|
+
"type": "string",
|
|
51
|
+
"maxLength": 64,
|
|
52
|
+
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
|
|
53
|
+
},
|
|
54
|
+
"timestamp": {
|
|
55
|
+
"description": "RFC 3339 timestamp in UTC with a `Z` suffix and optional fractional seconds.",
|
|
56
|
+
"type": "string",
|
|
57
|
+
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,9})?Z$"
|
|
58
|
+
},
|
|
59
|
+
"nullable_timestamp": {
|
|
60
|
+
"description": "A timestamp (same pattern as `timestamp`) or null.",
|
|
61
|
+
"type": [
|
|
62
|
+
"string",
|
|
63
|
+
"null"
|
|
64
|
+
],
|
|
65
|
+
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,9})?Z$"
|
|
66
|
+
},
|
|
67
|
+
"repo_path": {
|
|
68
|
+
"description": "Absolute POSIX path of a repository on the core's host, with no `.` or `..` segments, no trailing slash and no control characters (a newline would hide a `..` segment from the pattern).",
|
|
69
|
+
"type": "string",
|
|
70
|
+
"maxLength": 4096,
|
|
71
|
+
"pattern": "^(?![\\s\\S]*[\\u0000-\\u001f])(?!.*/\\.\\.?(/|$))(/[^/]+)+$"
|
|
72
|
+
},
|
|
73
|
+
"idempotency_key": {
|
|
74
|
+
"description": "Caller-chosen key, recorded and returned. D1 does not deduplicate on it (see README).",
|
|
75
|
+
"type": "string",
|
|
76
|
+
"pattern": "^[A-Za-z0-9._:-]{1,128}$"
|
|
77
|
+
},
|
|
78
|
+
"cursor": {
|
|
79
|
+
"description": "Per-run event cursor: the first event is 1 and each next event is exactly 1 higher.",
|
|
80
|
+
"type": "integer",
|
|
81
|
+
"minimum": 1
|
|
82
|
+
},
|
|
83
|
+
"api_version": {
|
|
84
|
+
"description": "API version `MAJOR.MINOR`.",
|
|
85
|
+
"type": "string",
|
|
86
|
+
"pattern": "^[0-9]+\\.[0-9]+$"
|
|
87
|
+
},
|
|
88
|
+
"text": {
|
|
89
|
+
"description": "Free text from a caller (task, steer message). Untrusted data, never a control command.",
|
|
90
|
+
"type": "string",
|
|
91
|
+
"minLength": 1,
|
|
92
|
+
"maxLength": 100000
|
|
93
|
+
},
|
|
94
|
+
"git_sha": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"pattern": "^[0-9a-f]{40}$"
|
|
97
|
+
},
|
|
98
|
+
"principal": {
|
|
99
|
+
"description": "Who asked: an operator or an agent, by mesh id. In D1 the core records it as supplied; authority comes from the owner-only socket and the allow-list, not from this field.",
|
|
100
|
+
"type": "object",
|
|
101
|
+
"additionalProperties": false,
|
|
102
|
+
"required": [
|
|
103
|
+
"kind",
|
|
104
|
+
"id"
|
|
105
|
+
],
|
|
106
|
+
"properties": {
|
|
107
|
+
"kind": {
|
|
108
|
+
"enum": [
|
|
109
|
+
"operator",
|
|
110
|
+
"agent"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"id": {
|
|
114
|
+
"$ref": "#/$defs/mesh_id"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"extension": {
|
|
119
|
+
"description": "The single opaque field for harness-specific data. Consumers must not depend on its contents, must not branch control flow on it, and must treat it as untrusted. Its shape is outside the contract and is not versioned.",
|
|
120
|
+
"type": "object"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://culture.dev/contract/agents/control-action.json",
|
|
4
|
+
"title": "Control action",
|
|
5
|
+
"description": "Requests that create or control a run, their responses, and the record of a control action against an existing run. The root schema is that record.",
|
|
6
|
+
"$ref": "#/$defs/action_record",
|
|
7
|
+
"$defs": {
|
|
8
|
+
"action_kind": {
|
|
9
|
+
"description": "Control actions against an existing run. pause, resume and answer are deferred: always refused with `unsupported` in this API version.",
|
|
10
|
+
"enum": [
|
|
11
|
+
"steer",
|
|
12
|
+
"cancel",
|
|
13
|
+
"pause",
|
|
14
|
+
"resume",
|
|
15
|
+
"answer"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"action_record": {
|
|
19
|
+
"description": "One control action against a run, as recorded in the run's event log and returned by an accepting route.",
|
|
20
|
+
"type": "object",
|
|
21
|
+
"additionalProperties": false,
|
|
22
|
+
"required": [
|
|
23
|
+
"id",
|
|
24
|
+
"run_id",
|
|
25
|
+
"kind",
|
|
26
|
+
"caller",
|
|
27
|
+
"requested_at",
|
|
28
|
+
"idempotency_key",
|
|
29
|
+
"outcome",
|
|
30
|
+
"error"
|
|
31
|
+
],
|
|
32
|
+
"properties": {
|
|
33
|
+
"id": {
|
|
34
|
+
"$ref": "common.json#/$defs/action_id"
|
|
35
|
+
},
|
|
36
|
+
"run_id": {
|
|
37
|
+
"$ref": "common.json#/$defs/run_id"
|
|
38
|
+
},
|
|
39
|
+
"kind": {
|
|
40
|
+
"$ref": "#/$defs/action_kind"
|
|
41
|
+
},
|
|
42
|
+
"caller": {
|
|
43
|
+
"$ref": "common.json#/$defs/principal"
|
|
44
|
+
},
|
|
45
|
+
"requested_at": {
|
|
46
|
+
"$ref": "common.json#/$defs/timestamp"
|
|
47
|
+
},
|
|
48
|
+
"idempotency_key": {
|
|
49
|
+
"oneOf": [
|
|
50
|
+
{
|
|
51
|
+
"$ref": "common.json#/$defs/idempotency_key"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "null"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"outcome": {
|
|
59
|
+
"description": "accepted: delivered to the run's worker. It does not promise any effect on the harness's behaviour. refused: not delivered; `error` says why.",
|
|
60
|
+
"enum": [
|
|
61
|
+
"accepted",
|
|
62
|
+
"refused"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"error": {
|
|
66
|
+
"oneOf": [
|
|
67
|
+
{
|
|
68
|
+
"$ref": "error.json#/$defs/error"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"type": "null"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"if": {
|
|
77
|
+
"required": [
|
|
78
|
+
"outcome"
|
|
79
|
+
],
|
|
80
|
+
"properties": {
|
|
81
|
+
"outcome": {
|
|
82
|
+
"const": "refused"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"then": {
|
|
87
|
+
"properties": {
|
|
88
|
+
"error": {
|
|
89
|
+
"$ref": "error.json#/$defs/error"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"else": {
|
|
94
|
+
"properties": {
|
|
95
|
+
"error": {
|
|
96
|
+
"type": "null"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"submit_request": {
|
|
102
|
+
"description": "Body of POST /v1/runs. Optional fields are omitted, never null. Setting `session_id` asks for `continue_session` and setting `parent_run_id` asks for `delegate`; both are refused with `unsupported` in this API version, as is an `agent_id` whose node is not the core's node (`placement`).",
|
|
103
|
+
"type": "object",
|
|
104
|
+
"additionalProperties": false,
|
|
105
|
+
"required": [
|
|
106
|
+
"agent_id",
|
|
107
|
+
"harness",
|
|
108
|
+
"repo",
|
|
109
|
+
"task",
|
|
110
|
+
"caller"
|
|
111
|
+
],
|
|
112
|
+
"properties": {
|
|
113
|
+
"agent_id": {
|
|
114
|
+
"$ref": "common.json#/$defs/mesh_id"
|
|
115
|
+
},
|
|
116
|
+
"harness": {
|
|
117
|
+
"$ref": "common.json#/$defs/harness_id"
|
|
118
|
+
},
|
|
119
|
+
"repo": {
|
|
120
|
+
"$ref": "common.json#/$defs/repo_path"
|
|
121
|
+
},
|
|
122
|
+
"task": {
|
|
123
|
+
"$ref": "common.json#/$defs/text"
|
|
124
|
+
},
|
|
125
|
+
"caller": {
|
|
126
|
+
"$ref": "common.json#/$defs/principal"
|
|
127
|
+
},
|
|
128
|
+
"idempotency_key": {
|
|
129
|
+
"$ref": "common.json#/$defs/idempotency_key"
|
|
130
|
+
},
|
|
131
|
+
"deadline": {
|
|
132
|
+
"description": "Absolute UTC time by which the run must be terminal; must be later than the core's clock at submit.",
|
|
133
|
+
"$ref": "common.json#/$defs/timestamp"
|
|
134
|
+
},
|
|
135
|
+
"session_id": {
|
|
136
|
+
"$ref": "common.json#/$defs/session_id"
|
|
137
|
+
},
|
|
138
|
+
"parent_run_id": {
|
|
139
|
+
"$ref": "common.json#/$defs/run_id"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"submit_response": {
|
|
144
|
+
"description": "201 response of POST /v1/runs. The run is in state `queued` and its worker's PID, event log and cursor are on disk.",
|
|
145
|
+
"type": "object",
|
|
146
|
+
"additionalProperties": false,
|
|
147
|
+
"required": [
|
|
148
|
+
"run"
|
|
149
|
+
],
|
|
150
|
+
"properties": {
|
|
151
|
+
"run": {
|
|
152
|
+
"$ref": "run.json",
|
|
153
|
+
"properties": {
|
|
154
|
+
"state": {
|
|
155
|
+
"const": "queued"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"steer_request": {
|
|
162
|
+
"description": "Body of POST /v1/runs/{run_id}/steer: a mid-run instruction delivered to the harness as user input.",
|
|
163
|
+
"type": "object",
|
|
164
|
+
"additionalProperties": false,
|
|
165
|
+
"required": [
|
|
166
|
+
"caller",
|
|
167
|
+
"message"
|
|
168
|
+
],
|
|
169
|
+
"properties": {
|
|
170
|
+
"caller": {
|
|
171
|
+
"$ref": "common.json#/$defs/principal"
|
|
172
|
+
},
|
|
173
|
+
"message": {
|
|
174
|
+
"$ref": "common.json#/$defs/text"
|
|
175
|
+
},
|
|
176
|
+
"idempotency_key": {
|
|
177
|
+
"$ref": "common.json#/$defs/idempotency_key"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"cancel_request": {
|
|
182
|
+
"description": "Body of POST /v1/runs/{run_id}/cancel.",
|
|
183
|
+
"type": "object",
|
|
184
|
+
"additionalProperties": false,
|
|
185
|
+
"required": [
|
|
186
|
+
"caller"
|
|
187
|
+
],
|
|
188
|
+
"properties": {
|
|
189
|
+
"caller": {
|
|
190
|
+
"$ref": "common.json#/$defs/principal"
|
|
191
|
+
},
|
|
192
|
+
"reason": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"minLength": 1,
|
|
195
|
+
"maxLength": 2000
|
|
196
|
+
},
|
|
197
|
+
"idempotency_key": {
|
|
198
|
+
"$ref": "common.json#/$defs/idempotency_key"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"pause_request": {
|
|
203
|
+
"description": "Body of POST /v1/runs/{run_id}/pause (deferred; always refused with `unsupported`, capability `pause`).",
|
|
204
|
+
"type": "object",
|
|
205
|
+
"additionalProperties": false,
|
|
206
|
+
"required": [
|
|
207
|
+
"caller"
|
|
208
|
+
],
|
|
209
|
+
"properties": {
|
|
210
|
+
"caller": {
|
|
211
|
+
"$ref": "common.json#/$defs/principal"
|
|
212
|
+
},
|
|
213
|
+
"idempotency_key": {
|
|
214
|
+
"$ref": "common.json#/$defs/idempotency_key"
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"resume_request": {
|
|
219
|
+
"description": "Body of POST /v1/runs/{run_id}/resume (deferred; always refused with `unsupported`, capability `resume`).",
|
|
220
|
+
"type": "object",
|
|
221
|
+
"additionalProperties": false,
|
|
222
|
+
"required": [
|
|
223
|
+
"caller"
|
|
224
|
+
],
|
|
225
|
+
"properties": {
|
|
226
|
+
"caller": {
|
|
227
|
+
"$ref": "common.json#/$defs/principal"
|
|
228
|
+
},
|
|
229
|
+
"idempotency_key": {
|
|
230
|
+
"$ref": "common.json#/$defs/idempotency_key"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"answer_request": {
|
|
235
|
+
"description": "Body of POST /v1/runs/{run_id}/answer (deferred; always refused with `unsupported`, capability `answer`).",
|
|
236
|
+
"type": "object",
|
|
237
|
+
"additionalProperties": false,
|
|
238
|
+
"required": [
|
|
239
|
+
"caller",
|
|
240
|
+
"question_id",
|
|
241
|
+
"answer"
|
|
242
|
+
],
|
|
243
|
+
"properties": {
|
|
244
|
+
"caller": {
|
|
245
|
+
"$ref": "common.json#/$defs/principal"
|
|
246
|
+
},
|
|
247
|
+
"question_id": {
|
|
248
|
+
"type": "string",
|
|
249
|
+
"minLength": 1,
|
|
250
|
+
"maxLength": 128
|
|
251
|
+
},
|
|
252
|
+
"answer": {
|
|
253
|
+
"$ref": "common.json#/$defs/text"
|
|
254
|
+
},
|
|
255
|
+
"idempotency_key": {
|
|
256
|
+
"$ref": "common.json#/$defs/idempotency_key"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"accepted_response": {
|
|
261
|
+
"description": "202 response of steer and cancel: the recorded, accepted action.",
|
|
262
|
+
"type": "object",
|
|
263
|
+
"additionalProperties": false,
|
|
264
|
+
"required": [
|
|
265
|
+
"action"
|
|
266
|
+
],
|
|
267
|
+
"properties": {
|
|
268
|
+
"action": {
|
|
269
|
+
"$ref": "#/$defs/action_record",
|
|
270
|
+
"properties": {
|
|
271
|
+
"outcome": {
|
|
272
|
+
"const": "accepted"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://culture.dev/contract/agents/error.json",
|
|
4
|
+
"title": "Error response",
|
|
5
|
+
"description": "Body of every non-2xx response. HTTP status, CLI exit code and retryability per code are fixed in api.json `errors` and README.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"error"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"error": {
|
|
13
|
+
"$ref": "#/$defs/error"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"$defs": {
|
|
17
|
+
"code": {
|
|
18
|
+
"enum": [
|
|
19
|
+
"invalid",
|
|
20
|
+
"denied",
|
|
21
|
+
"not_found",
|
|
22
|
+
"busy",
|
|
23
|
+
"conflict",
|
|
24
|
+
"unsupported",
|
|
25
|
+
"incompatible_version",
|
|
26
|
+
"unavailable",
|
|
27
|
+
"internal"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"error": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"required": [
|
|
34
|
+
"code",
|
|
35
|
+
"message",
|
|
36
|
+
"retryable"
|
|
37
|
+
],
|
|
38
|
+
"properties": {
|
|
39
|
+
"code": {
|
|
40
|
+
"$ref": "#/$defs/code"
|
|
41
|
+
},
|
|
42
|
+
"message": {
|
|
43
|
+
"description": "One human-readable sentence; for environment errors it includes a remediation hint.",
|
|
44
|
+
"type": "string",
|
|
45
|
+
"minLength": 1,
|
|
46
|
+
"maxLength": 2000
|
|
47
|
+
},
|
|
48
|
+
"retryable": {
|
|
49
|
+
"type": "boolean"
|
|
50
|
+
},
|
|
51
|
+
"capability": {
|
|
52
|
+
"description": "unsupported only: the capability that was refused.",
|
|
53
|
+
"$ref": "capabilities.json#/$defs/capability_name"
|
|
54
|
+
},
|
|
55
|
+
"field": {
|
|
56
|
+
"description": "invalid only (optional): JSON Pointer to the offending request field, or a query/path parameter name.",
|
|
57
|
+
"type": "string",
|
|
58
|
+
"maxLength": 200
|
|
59
|
+
},
|
|
60
|
+
"run_id": {
|
|
61
|
+
"description": "The run the error concerns, when there is one. Required for conflict.",
|
|
62
|
+
"$ref": "common.json#/$defs/run_id"
|
|
63
|
+
},
|
|
64
|
+
"active_run_id": {
|
|
65
|
+
"description": "busy only: the active run holding the repository.",
|
|
66
|
+
"$ref": "common.json#/$defs/run_id"
|
|
67
|
+
},
|
|
68
|
+
"repo": {
|
|
69
|
+
"description": "busy only: the canonical repository path that is busy.",
|
|
70
|
+
"$ref": "common.json#/$defs/repo_path"
|
|
71
|
+
},
|
|
72
|
+
"client_api_version": {
|
|
73
|
+
"$ref": "common.json#/$defs/api_version"
|
|
74
|
+
},
|
|
75
|
+
"server_api_version": {
|
|
76
|
+
"$ref": "common.json#/$defs/api_version"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"allOf": [
|
|
80
|
+
{
|
|
81
|
+
"if": {
|
|
82
|
+
"required": [
|
|
83
|
+
"code"
|
|
84
|
+
],
|
|
85
|
+
"properties": {
|
|
86
|
+
"code": {
|
|
87
|
+
"const": "unsupported"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"then": {
|
|
92
|
+
"required": [
|
|
93
|
+
"capability"
|
|
94
|
+
],
|
|
95
|
+
"properties": {
|
|
96
|
+
"retryable": {
|
|
97
|
+
"const": false
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"else": {
|
|
102
|
+
"not": {
|
|
103
|
+
"required": [
|
|
104
|
+
"capability"
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"if": {
|
|
111
|
+
"required": [
|
|
112
|
+
"code"
|
|
113
|
+
],
|
|
114
|
+
"properties": {
|
|
115
|
+
"code": {
|
|
116
|
+
"const": "busy"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"then": {
|
|
121
|
+
"required": [
|
|
122
|
+
"active_run_id",
|
|
123
|
+
"repo"
|
|
124
|
+
],
|
|
125
|
+
"properties": {
|
|
126
|
+
"retryable": {
|
|
127
|
+
"const": true
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"else": {
|
|
132
|
+
"not": {
|
|
133
|
+
"anyOf": [
|
|
134
|
+
{
|
|
135
|
+
"required": [
|
|
136
|
+
"active_run_id"
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"required": [
|
|
141
|
+
"repo"
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"if": {
|
|
150
|
+
"required": [
|
|
151
|
+
"code"
|
|
152
|
+
],
|
|
153
|
+
"properties": {
|
|
154
|
+
"code": {
|
|
155
|
+
"const": "incompatible_version"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"then": {
|
|
160
|
+
"required": [
|
|
161
|
+
"client_api_version",
|
|
162
|
+
"server_api_version"
|
|
163
|
+
],
|
|
164
|
+
"properties": {
|
|
165
|
+
"retryable": {
|
|
166
|
+
"const": false
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"else": {
|
|
171
|
+
"not": {
|
|
172
|
+
"anyOf": [
|
|
173
|
+
{
|
|
174
|
+
"required": [
|
|
175
|
+
"client_api_version"
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"required": [
|
|
180
|
+
"server_api_version"
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"if": {
|
|
189
|
+
"required": [
|
|
190
|
+
"code"
|
|
191
|
+
],
|
|
192
|
+
"properties": {
|
|
193
|
+
"code": {
|
|
194
|
+
"const": "invalid"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"else": {
|
|
199
|
+
"not": {
|
|
200
|
+
"required": [
|
|
201
|
+
"field"
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"if": {
|
|
208
|
+
"required": [
|
|
209
|
+
"code"
|
|
210
|
+
],
|
|
211
|
+
"properties": {
|
|
212
|
+
"code": {
|
|
213
|
+
"const": "conflict"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"then": {
|
|
218
|
+
"required": [
|
|
219
|
+
"run_id"
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"if": {
|
|
225
|
+
"required": [
|
|
226
|
+
"code"
|
|
227
|
+
],
|
|
228
|
+
"properties": {
|
|
229
|
+
"code": {
|
|
230
|
+
"const": "unavailable"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"then": {
|
|
235
|
+
"properties": {
|
|
236
|
+
"retryable": {
|
|
237
|
+
"const": true
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"if": {
|
|
244
|
+
"required": [
|
|
245
|
+
"code"
|
|
246
|
+
],
|
|
247
|
+
"properties": {
|
|
248
|
+
"code": {
|
|
249
|
+
"enum": [
|
|
250
|
+
"invalid",
|
|
251
|
+
"denied",
|
|
252
|
+
"not_found",
|
|
253
|
+
"internal"
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"then": {
|
|
259
|
+
"properties": {
|
|
260
|
+
"retryable": {
|
|
261
|
+
"const": false
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|