@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.
- 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,316 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://culture.dev/contract/agents/event.json",
|
|
4
|
+
"title": "Run event",
|
|
5
|
+
"description": "One entry of a run's event log, identical whether read from disk, replayed by attach, or streamed live. The cursor is the transport-independent position (README: cursor and replay).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"run_id",
|
|
10
|
+
"cursor",
|
|
11
|
+
"time",
|
|
12
|
+
"kind",
|
|
13
|
+
"data"
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"run_id": {
|
|
17
|
+
"$ref": "common.json#/$defs/run_id"
|
|
18
|
+
},
|
|
19
|
+
"cursor": {
|
|
20
|
+
"$ref": "common.json#/$defs/cursor"
|
|
21
|
+
},
|
|
22
|
+
"time": {
|
|
23
|
+
"$ref": "common.json#/$defs/timestamp"
|
|
24
|
+
},
|
|
25
|
+
"kind": {
|
|
26
|
+
"$ref": "#/$defs/kind"
|
|
27
|
+
},
|
|
28
|
+
"data": {
|
|
29
|
+
"description": "Kind-specific payload; the allOf below pins which one each kind carries.",
|
|
30
|
+
"anyOf": [
|
|
31
|
+
{
|
|
32
|
+
"$ref": "#/$defs/state_data"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"$ref": "#/$defs/output_data"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"$ref": "#/$defs/control_data"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"$ref": "#/$defs/refused_data"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"$ref": "#/$defs/error_data"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"allOf": [
|
|
50
|
+
{
|
|
51
|
+
"if": {
|
|
52
|
+
"required": [
|
|
53
|
+
"kind"
|
|
54
|
+
],
|
|
55
|
+
"properties": {
|
|
56
|
+
"kind": {
|
|
57
|
+
"const": "run.state"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"then": {
|
|
62
|
+
"properties": {
|
|
63
|
+
"data": {
|
|
64
|
+
"$ref": "#/$defs/state_data"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"if": {
|
|
71
|
+
"required": [
|
|
72
|
+
"kind"
|
|
73
|
+
],
|
|
74
|
+
"properties": {
|
|
75
|
+
"kind": {
|
|
76
|
+
"const": "run.output"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"then": {
|
|
81
|
+
"properties": {
|
|
82
|
+
"data": {
|
|
83
|
+
"$ref": "#/$defs/output_data"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"if": {
|
|
90
|
+
"required": [
|
|
91
|
+
"kind"
|
|
92
|
+
],
|
|
93
|
+
"properties": {
|
|
94
|
+
"kind": {
|
|
95
|
+
"const": "run.control"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"then": {
|
|
100
|
+
"properties": {
|
|
101
|
+
"data": {
|
|
102
|
+
"$ref": "#/$defs/control_data"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"if": {
|
|
109
|
+
"required": [
|
|
110
|
+
"kind"
|
|
111
|
+
],
|
|
112
|
+
"properties": {
|
|
113
|
+
"kind": {
|
|
114
|
+
"const": "run.refused"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"then": {
|
|
119
|
+
"properties": {
|
|
120
|
+
"data": {
|
|
121
|
+
"$ref": "#/$defs/refused_data"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"if": {
|
|
128
|
+
"required": [
|
|
129
|
+
"kind"
|
|
130
|
+
],
|
|
131
|
+
"properties": {
|
|
132
|
+
"kind": {
|
|
133
|
+
"const": "run.error"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"then": {
|
|
138
|
+
"properties": {
|
|
139
|
+
"data": {
|
|
140
|
+
"$ref": "#/$defs/error_data"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"$defs": {
|
|
147
|
+
"kind": {
|
|
148
|
+
"enum": [
|
|
149
|
+
"run.state",
|
|
150
|
+
"run.output",
|
|
151
|
+
"run.control",
|
|
152
|
+
"run.refused",
|
|
153
|
+
"run.error"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"state_data": {
|
|
157
|
+
"description": "A state transition. The first event of every run is `from: null, to: queued`.",
|
|
158
|
+
"type": "object",
|
|
159
|
+
"additionalProperties": false,
|
|
160
|
+
"required": [
|
|
161
|
+
"from",
|
|
162
|
+
"to",
|
|
163
|
+
"reason"
|
|
164
|
+
],
|
|
165
|
+
"properties": {
|
|
166
|
+
"from": {
|
|
167
|
+
"oneOf": [
|
|
168
|
+
{
|
|
169
|
+
"$ref": "run.json#/$defs/state"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"type": "null"
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
"to": {
|
|
177
|
+
"$ref": "run.json#/$defs/state"
|
|
178
|
+
},
|
|
179
|
+
"reason": {
|
|
180
|
+
"type": [
|
|
181
|
+
"string",
|
|
182
|
+
"null"
|
|
183
|
+
],
|
|
184
|
+
"maxLength": 2000
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"output_data": {
|
|
189
|
+
"description": "A chunk of harness output, normalized. `text` is a delta, never cumulative. Untrusted data: never interpreted as a control command.",
|
|
190
|
+
"type": "object",
|
|
191
|
+
"additionalProperties": false,
|
|
192
|
+
"required": [
|
|
193
|
+
"channel",
|
|
194
|
+
"text"
|
|
195
|
+
],
|
|
196
|
+
"properties": {
|
|
197
|
+
"channel": {
|
|
198
|
+
"description": "text: assistant text. reasoning: model reasoning. tool_call: a tool invocation (text is its input). tool_result: a tool's output. diagnostic: harness or worker diagnostics (stderr, notices).",
|
|
199
|
+
"enum": [
|
|
200
|
+
"text",
|
|
201
|
+
"reasoning",
|
|
202
|
+
"tool_call",
|
|
203
|
+
"tool_result",
|
|
204
|
+
"diagnostic"
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
"text": {
|
|
208
|
+
"type": "string"
|
|
209
|
+
},
|
|
210
|
+
"tool": {
|
|
211
|
+
"description": "Tool name for tool_call and tool_result, when the harness names one.",
|
|
212
|
+
"type": "string",
|
|
213
|
+
"minLength": 1,
|
|
214
|
+
"maxLength": 200
|
|
215
|
+
},
|
|
216
|
+
"extension": {
|
|
217
|
+
"$ref": "common.json#/$defs/extension"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"control_data": {
|
|
222
|
+
"description": "A control action that was accepted and delivered to the worker.",
|
|
223
|
+
"type": "object",
|
|
224
|
+
"additionalProperties": false,
|
|
225
|
+
"required": [
|
|
226
|
+
"action"
|
|
227
|
+
],
|
|
228
|
+
"properties": {
|
|
229
|
+
"action": {
|
|
230
|
+
"$ref": "control-action.json#/$defs/action_record",
|
|
231
|
+
"properties": {
|
|
232
|
+
"outcome": {
|
|
233
|
+
"const": "accepted"
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"refused_data": {
|
|
240
|
+
"description": "A control action refused against this (non-terminal) run, recorded when the core controls the run's worker: a capability refusal (`unsupported`) or a state conflict.",
|
|
241
|
+
"type": "object",
|
|
242
|
+
"additionalProperties": false,
|
|
243
|
+
"required": [
|
|
244
|
+
"action"
|
|
245
|
+
],
|
|
246
|
+
"properties": {
|
|
247
|
+
"action": {
|
|
248
|
+
"$ref": "control-action.json#/$defs/action_record",
|
|
249
|
+
"properties": {
|
|
250
|
+
"outcome": {
|
|
251
|
+
"const": "refused"
|
|
252
|
+
},
|
|
253
|
+
"error": {
|
|
254
|
+
"$ref": "error.json#/$defs/error",
|
|
255
|
+
"properties": {
|
|
256
|
+
"code": {
|
|
257
|
+
"enum": [
|
|
258
|
+
"unsupported",
|
|
259
|
+
"conflict"
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"error_data": {
|
|
269
|
+
"description": "An error during the run. fatal: true means a `run.state` event to `failed` or `unknown` follows.",
|
|
270
|
+
"type": "object",
|
|
271
|
+
"additionalProperties": false,
|
|
272
|
+
"required": [
|
|
273
|
+
"error",
|
|
274
|
+
"fatal"
|
|
275
|
+
],
|
|
276
|
+
"properties": {
|
|
277
|
+
"error": {
|
|
278
|
+
"$ref": "error.json#/$defs/error"
|
|
279
|
+
},
|
|
280
|
+
"fatal": {
|
|
281
|
+
"type": "boolean"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"event_page": {
|
|
286
|
+
"description": "Response of GET /v1/runs/{run_id}/events (non-streaming logs).",
|
|
287
|
+
"type": "object",
|
|
288
|
+
"additionalProperties": false,
|
|
289
|
+
"required": [
|
|
290
|
+
"run_id",
|
|
291
|
+
"events",
|
|
292
|
+
"last_cursor",
|
|
293
|
+
"more"
|
|
294
|
+
],
|
|
295
|
+
"properties": {
|
|
296
|
+
"run_id": {
|
|
297
|
+
"$ref": "common.json#/$defs/run_id"
|
|
298
|
+
},
|
|
299
|
+
"events": {
|
|
300
|
+
"type": "array",
|
|
301
|
+
"items": {
|
|
302
|
+
"$ref": "#"
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
"last_cursor": {
|
|
306
|
+
"description": "The run's newest cursor at the time of the read.",
|
|
307
|
+
"$ref": "common.json#/$defs/cursor"
|
|
308
|
+
},
|
|
309
|
+
"more": {
|
|
310
|
+
"description": "True when events after the last returned one exist (page was truncated by `limit`).",
|
|
311
|
+
"type": "boolean"
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://culture.dev/contract/agents/run.json",
|
|
4
|
+
"title": "Run",
|
|
5
|
+
"description": "One submitted unit of work executed by one agent through one harness. State is authoritative only as read from the run's on-disk event log or its live worker (README: state machine, restart).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"id",
|
|
10
|
+
"agent_id",
|
|
11
|
+
"session_id",
|
|
12
|
+
"harness",
|
|
13
|
+
"repo",
|
|
14
|
+
"task",
|
|
15
|
+
"owner",
|
|
16
|
+
"idempotency_key",
|
|
17
|
+
"deadline",
|
|
18
|
+
"state",
|
|
19
|
+
"state_reason",
|
|
20
|
+
"terminal",
|
|
21
|
+
"created_at",
|
|
22
|
+
"updated_at",
|
|
23
|
+
"started_at",
|
|
24
|
+
"ended_at",
|
|
25
|
+
"cursor",
|
|
26
|
+
"live_control",
|
|
27
|
+
"worker_pid",
|
|
28
|
+
"branch"
|
|
29
|
+
],
|
|
30
|
+
"properties": {
|
|
31
|
+
"id": {
|
|
32
|
+
"$ref": "common.json#/$defs/run_id"
|
|
33
|
+
},
|
|
34
|
+
"agent_id": {
|
|
35
|
+
"$ref": "common.json#/$defs/mesh_id"
|
|
36
|
+
},
|
|
37
|
+
"session_id": {
|
|
38
|
+
"$ref": "common.json#/$defs/session_id"
|
|
39
|
+
},
|
|
40
|
+
"harness": {
|
|
41
|
+
"$ref": "common.json#/$defs/harness_id"
|
|
42
|
+
},
|
|
43
|
+
"repo": {
|
|
44
|
+
"$ref": "common.json#/$defs/repo_path"
|
|
45
|
+
},
|
|
46
|
+
"task": {
|
|
47
|
+
"$ref": "common.json#/$defs/text"
|
|
48
|
+
},
|
|
49
|
+
"owner": {
|
|
50
|
+
"description": "The principal that submitted the run (the submit request's caller).",
|
|
51
|
+
"$ref": "common.json#/$defs/principal"
|
|
52
|
+
},
|
|
53
|
+
"idempotency_key": {
|
|
54
|
+
"oneOf": [
|
|
55
|
+
{
|
|
56
|
+
"$ref": "common.json#/$defs/idempotency_key"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "null"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"deadline": {
|
|
64
|
+
"$ref": "common.json#/$defs/nullable_timestamp"
|
|
65
|
+
},
|
|
66
|
+
"state": {
|
|
67
|
+
"$ref": "#/$defs/state"
|
|
68
|
+
},
|
|
69
|
+
"state_reason": {
|
|
70
|
+
"description": "Human-readable reason for the current state, or null.",
|
|
71
|
+
"type": [
|
|
72
|
+
"string",
|
|
73
|
+
"null"
|
|
74
|
+
],
|
|
75
|
+
"maxLength": 2000
|
|
76
|
+
},
|
|
77
|
+
"terminal": {
|
|
78
|
+
"type": "boolean"
|
|
79
|
+
},
|
|
80
|
+
"created_at": {
|
|
81
|
+
"$ref": "common.json#/$defs/timestamp"
|
|
82
|
+
},
|
|
83
|
+
"updated_at": {
|
|
84
|
+
"$ref": "common.json#/$defs/timestamp"
|
|
85
|
+
},
|
|
86
|
+
"started_at": {
|
|
87
|
+
"description": "When the harness session started; null until the run first enters `running`.",
|
|
88
|
+
"$ref": "common.json#/$defs/nullable_timestamp"
|
|
89
|
+
},
|
|
90
|
+
"ended_at": {
|
|
91
|
+
"$ref": "common.json#/$defs/nullable_timestamp"
|
|
92
|
+
},
|
|
93
|
+
"cursor": {
|
|
94
|
+
"description": "Cursor of the newest event in the run's event log.",
|
|
95
|
+
"$ref": "common.json#/$defs/cursor"
|
|
96
|
+
},
|
|
97
|
+
"live_control": {
|
|
98
|
+
"description": "True when this core can deliver steer and cancel to the run's worker. False for every terminal run and for a run whose worker survived a core restart (D1 cannot reconnect).",
|
|
99
|
+
"type": "boolean"
|
|
100
|
+
},
|
|
101
|
+
"worker_pid": {
|
|
102
|
+
"description": "PID of the run's worker process, or null once no worker is known.",
|
|
103
|
+
"type": [
|
|
104
|
+
"integer",
|
|
105
|
+
"null"
|
|
106
|
+
],
|
|
107
|
+
"minimum": 1
|
|
108
|
+
},
|
|
109
|
+
"branch": {
|
|
110
|
+
"description": "Host branch holding the run's commits, `runs/<run_id>`, or null when there are none yet. At most 132 characters: `runs/` and a run id of at most 127.",
|
|
111
|
+
"type": [
|
|
112
|
+
"string",
|
|
113
|
+
"null"
|
|
114
|
+
],
|
|
115
|
+
"maxLength": 132,
|
|
116
|
+
"pattern": "^runs/[a-z0-9]{1,32}-[a-z0-9_]+(-[a-z0-9_]+)*\\.run\\.[0-9A-HJKMNP-TV-Z]{26}$"
|
|
117
|
+
},
|
|
118
|
+
"extension": {
|
|
119
|
+
"$ref": "common.json#/$defs/extension"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"allOf": [
|
|
123
|
+
{
|
|
124
|
+
"if": {
|
|
125
|
+
"required": [
|
|
126
|
+
"state"
|
|
127
|
+
],
|
|
128
|
+
"properties": {
|
|
129
|
+
"state": {
|
|
130
|
+
"$ref": "#/$defs/terminal_state"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"then": {
|
|
135
|
+
"properties": {
|
|
136
|
+
"terminal": {
|
|
137
|
+
"const": true
|
|
138
|
+
},
|
|
139
|
+
"live_control": {
|
|
140
|
+
"const": false
|
|
141
|
+
},
|
|
142
|
+
"ended_at": {
|
|
143
|
+
"$ref": "common.json#/$defs/timestamp"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"else": {
|
|
148
|
+
"properties": {
|
|
149
|
+
"terminal": {
|
|
150
|
+
"const": false
|
|
151
|
+
},
|
|
152
|
+
"ended_at": {
|
|
153
|
+
"type": "null"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"if": {
|
|
160
|
+
"required": [
|
|
161
|
+
"state"
|
|
162
|
+
],
|
|
163
|
+
"properties": {
|
|
164
|
+
"state": {
|
|
165
|
+
"const": "running"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"then": {
|
|
170
|
+
"properties": {
|
|
171
|
+
"started_at": {
|
|
172
|
+
"$ref": "common.json#/$defs/timestamp"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"if": {
|
|
179
|
+
"required": [
|
|
180
|
+
"state"
|
|
181
|
+
],
|
|
182
|
+
"properties": {
|
|
183
|
+
"state": {
|
|
184
|
+
"const": "queued"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"then": {
|
|
189
|
+
"properties": {
|
|
190
|
+
"started_at": {
|
|
191
|
+
"type": "null"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"$defs": {
|
|
198
|
+
"state": {
|
|
199
|
+
"description": "Run state. Legal transitions are in api.json `state_machine` and README.",
|
|
200
|
+
"enum": [
|
|
201
|
+
"queued",
|
|
202
|
+
"running",
|
|
203
|
+
"cancelling",
|
|
204
|
+
"succeeded",
|
|
205
|
+
"failed",
|
|
206
|
+
"cancelled",
|
|
207
|
+
"timed_out",
|
|
208
|
+
"unknown"
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
"active_state": {
|
|
212
|
+
"enum": [
|
|
213
|
+
"queued",
|
|
214
|
+
"running",
|
|
215
|
+
"cancelling"
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
"terminal_state": {
|
|
219
|
+
"enum": [
|
|
220
|
+
"succeeded",
|
|
221
|
+
"failed",
|
|
222
|
+
"cancelled",
|
|
223
|
+
"timed_out",
|
|
224
|
+
"unknown"
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
"run_list": {
|
|
228
|
+
"description": "Response of GET /v1/runs: newest first by created_at.",
|
|
229
|
+
"type": "object",
|
|
230
|
+
"additionalProperties": false,
|
|
231
|
+
"required": [
|
|
232
|
+
"runs"
|
|
233
|
+
],
|
|
234
|
+
"properties": {
|
|
235
|
+
"runs": {
|
|
236
|
+
"type": "array",
|
|
237
|
+
"items": {
|
|
238
|
+
"$ref": "#"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"run_result": {
|
|
244
|
+
"description": "Response of GET /v1/runs/{run_id}/result; only served for a terminal run.",
|
|
245
|
+
"type": "object",
|
|
246
|
+
"additionalProperties": false,
|
|
247
|
+
"required": [
|
|
248
|
+
"run_id",
|
|
249
|
+
"state",
|
|
250
|
+
"summary",
|
|
251
|
+
"branch",
|
|
252
|
+
"commits",
|
|
253
|
+
"ended_at",
|
|
254
|
+
"error"
|
|
255
|
+
],
|
|
256
|
+
"properties": {
|
|
257
|
+
"run_id": {
|
|
258
|
+
"$ref": "common.json#/$defs/run_id"
|
|
259
|
+
},
|
|
260
|
+
"state": {
|
|
261
|
+
"$ref": "#/$defs/terminal_state"
|
|
262
|
+
},
|
|
263
|
+
"summary": {
|
|
264
|
+
"description": "The harness's final assistant text, or null if it produced none.",
|
|
265
|
+
"type": [
|
|
266
|
+
"string",
|
|
267
|
+
"null"
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
"branch": {
|
|
271
|
+
"$ref": "#/properties/branch"
|
|
272
|
+
},
|
|
273
|
+
"commits": {
|
|
274
|
+
"description": "Commits on `branch`, oldest first. Empty when there are none.",
|
|
275
|
+
"type": "array",
|
|
276
|
+
"items": {
|
|
277
|
+
"$ref": "common.json#/$defs/git_sha"
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
"ended_at": {
|
|
281
|
+
"$ref": "common.json#/$defs/timestamp"
|
|
282
|
+
},
|
|
283
|
+
"error": {
|
|
284
|
+
"oneOf": [
|
|
285
|
+
{
|
|
286
|
+
"$ref": "error.json#/$defs/error"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"type": "null"
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"allOf": [
|
|
295
|
+
{
|
|
296
|
+
"if": {
|
|
297
|
+
"required": [
|
|
298
|
+
"state"
|
|
299
|
+
],
|
|
300
|
+
"properties": {
|
|
301
|
+
"state": {
|
|
302
|
+
"const": "failed"
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"then": {
|
|
307
|
+
"properties": {
|
|
308
|
+
"error": {
|
|
309
|
+
"$ref": "error.json#/$defs/error"
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"if": {
|
|
316
|
+
"required": [
|
|
317
|
+
"state"
|
|
318
|
+
],
|
|
319
|
+
"properties": {
|
|
320
|
+
"state": {
|
|
321
|
+
"const": "succeeded"
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"then": {
|
|
326
|
+
"properties": {
|
|
327
|
+
"error": {
|
|
328
|
+
"type": "null"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|