warpmetal 0.8.13 → 0.9.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/README.md +98 -4
- package/docs/agent-insights-cli.md +123 -0
- package/docs/agent-work-cli.md +72 -0
- package/docs/session-handoff-transport.md +68 -0
- package/package.json +5 -3
- package/skills/warpmetal/SKILL.md +54 -1
- package/skills/warpmetal/references/cli-reference.md +150 -2
- package/skills/warpmetal/references/runtime.md +19 -0
- package/src/account-gateway.js +217 -0
- package/src/account-session.js +209 -0
- package/src/agent-insights.js +638 -0
- package/src/agent-management.js +146 -0
- package/src/agent-work.js +800 -0
- package/src/api.js +10 -4
- package/src/cli.js +398 -11
- package/src/contracts/agent-manager-control-v1.schema.json +563 -0
- package/src/contracts/http.js +3 -0
- package/src/contracts/insights.js +133 -0
- package/src/contracts/manager.js +86 -0
- package/src/contracts/session-handoff.js +49 -0
- package/src/contracts/sources.json +12 -0
- package/src/contracts/work-handoff.js +73 -0
- package/src/contracts/work.js +310 -0
- package/src/customer-auth.js +329 -0
- package/src/installer.js +5 -5
- package/src/models.js +85 -0
- package/src/runtime.js +76 -3
- package/src/session-handoff.js +915 -0
- package/src/state.js +20 -4
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://warpmetal.com/contracts/agent-manager-control-v1.schema.json",
|
|
4
|
+
"title": "WarpMetal Agent Manager control plane v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"policyPatch": {"$ref": "#/$defs/policyPatch"},
|
|
9
|
+
"policy": {"$ref": "#/$defs/policy"},
|
|
10
|
+
"managerTarget": {"$ref": "#/$defs/managerTarget"},
|
|
11
|
+
"reservationRequest": {"$ref": "#/$defs/reservationRequest"},
|
|
12
|
+
"recheckRequest": {"$ref": "#/$defs/recheckRequest"},
|
|
13
|
+
"reservation": {"$ref": "#/$defs/reservation"},
|
|
14
|
+
"runReport": {"$ref": "#/$defs/runReport"},
|
|
15
|
+
"activity": {"$ref": "#/$defs/activity"},
|
|
16
|
+
"activityList": {"$ref": "#/$defs/activityList"},
|
|
17
|
+
"takeoverRequest": {"$ref": "#/$defs/takeoverRequest"},
|
|
18
|
+
"resumeRequest": {"$ref": "#/$defs/resumeRequest"},
|
|
19
|
+
"takeover": {"$ref": "#/$defs/takeover"},
|
|
20
|
+
"takeoverList": {"$ref": "#/$defs/takeoverList"},
|
|
21
|
+
"policyManifest": {"$ref": "#/$defs/policyManifest"},
|
|
22
|
+
"policyReport": {"$ref": "#/$defs/policyReport"},
|
|
23
|
+
"reviewManifest": {"$ref": "#/$defs/reviewManifest"},
|
|
24
|
+
"takeoverManifest": {"$ref": "#/$defs/takeoverManifest"},
|
|
25
|
+
"takeoverReport": {"$ref": "#/$defs/takeoverReport"}
|
|
26
|
+
},
|
|
27
|
+
"required": [
|
|
28
|
+
"policyPatch", "policy", "managerTarget", "reservationRequest",
|
|
29
|
+
"recheckRequest", "reservation", "runReport", "activity", "activityList",
|
|
30
|
+
"takeoverRequest", "resumeRequest", "takeover", "takeoverList",
|
|
31
|
+
"policyManifest", "policyReport", "reviewManifest", "takeoverManifest",
|
|
32
|
+
"takeoverReport"
|
|
33
|
+
],
|
|
34
|
+
"$defs": {
|
|
35
|
+
"id": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{3,159}$"},
|
|
36
|
+
"providerId": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"},
|
|
37
|
+
"modelId": {"type": "string", "pattern": "^(?!.*://)[A-Za-z0-9][A-Za-z0-9._:/-]{0,159}$"},
|
|
38
|
+
"digest": {"type": "string", "pattern": "^sha256:[a-f0-9]{64}$"},
|
|
39
|
+
"rule": {"type": "string", "enum": ["repeated_identical_failure@1", "repeated_identical_call@1", "empty_result_loop@1", "suspected_stall@1"]},
|
|
40
|
+
"recipe": {"type": "string", "enum": ["inspect_first_failure@1", "check_repeated_operation@1", "refine_query@1", "inspect_active_phase@1"]},
|
|
41
|
+
"capabilityReason": {"type": ["string", "null"], "enum": [null, "native_guard_unqualified", "budget_isolation_unavailable", "source_unavailable", "policy_off", "policy_expired", "runtime_unavailable", "target_stale", "takeover_pending", "review_pending", "cooldown_active", "budget_exhausted", "binding_not_verified", "task_stale", "manager_session_pending", "manager_session_unavailable"]},
|
|
42
|
+
"rationaleCode": {"type": "string", "enum": ["unchanged_failure_repeated", "repeated_call_detected", "query_refinement_available", "active_phase_stalled", "no_safe_action"]},
|
|
43
|
+
"errorCode": {"type": ["string", "null"], "enum": [null, "policy_off", "policy_expired", "source_stale", "target_stale", "budget_exhausted", "capability_unavailable", "provider_failed", "provider_timeout", "usage_uncertain", "report_invalid", "superseded", "pending_input_unknown", "runtime_unavailable"]},
|
|
44
|
+
"capability": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"properties": {"available": {"type": "boolean"}, "reason": {"$ref": "#/$defs/capabilityReason"}},
|
|
48
|
+
"required": ["available", "reason"]
|
|
49
|
+
},
|
|
50
|
+
"budget": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"properties": {
|
|
54
|
+
"modelRequests": {"type": "integer", "minimum": 1, "maximum": 2},
|
|
55
|
+
"inputTokens": {"type": "integer", "minimum": 1, "maximum": 16000},
|
|
56
|
+
"outputTokens": {"type": "integer", "minimum": 1, "maximum": 2000}
|
|
57
|
+
},
|
|
58
|
+
"required": ["modelRequests", "inputTokens", "outputTokens"]
|
|
59
|
+
},
|
|
60
|
+
"usage": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"additionalProperties": false,
|
|
63
|
+
"properties": {
|
|
64
|
+
"modelRequests": {"type": "integer", "minimum": 0, "maximum": 2},
|
|
65
|
+
"inputTokens": {"type": "integer", "minimum": 0, "maximum": 16000},
|
|
66
|
+
"outputTokens": {"type": "integer", "minimum": 0, "maximum": 2000},
|
|
67
|
+
"usageCertain": {"type": "boolean"},
|
|
68
|
+
"unusedProof": {"type": "string", "enum": ["none", "trusted_zero_start", "trusted_exact_usage"]}
|
|
69
|
+
},
|
|
70
|
+
"required": ["modelRequests", "inputTokens", "outputTokens", "usageCertain", "unusedProof"]
|
|
71
|
+
},
|
|
72
|
+
"source": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"additionalProperties": false,
|
|
75
|
+
"properties": {
|
|
76
|
+
"registeredSourceId": {"$ref": "#/$defs/id"},
|
|
77
|
+
"workspaceEpoch": {"$ref": "#/$defs/id"},
|
|
78
|
+
"nativeSessionId": {"$ref": "#/$defs/id"},
|
|
79
|
+
"serviceRegistrationId": {"$ref": "#/$defs/id"},
|
|
80
|
+
"serviceGeneration": {"type": "integer", "minimum": 1},
|
|
81
|
+
"sandboxGeneration": {"type": "integer", "minimum": 1},
|
|
82
|
+
"profileRevision": {"type": "integer", "minimum": 1},
|
|
83
|
+
"instructionRevision": {"type": "integer", "minimum": 1}
|
|
84
|
+
},
|
|
85
|
+
"required": ["registeredSourceId", "workspaceEpoch", "nativeSessionId", "serviceRegistrationId", "serviceGeneration", "sandboxGeneration", "profileRevision", "instructionRevision"]
|
|
86
|
+
},
|
|
87
|
+
"managerProfile": {
|
|
88
|
+
"type": "object", "additionalProperties": false,
|
|
89
|
+
"properties": {"profileId": {"const": "warpmetal-insights-manager"}, "profileRevision": {"type": "integer", "minimum": 1}, "profileDigest": {"$ref": "#/$defs/digest"}},
|
|
90
|
+
"required": ["profileId", "profileRevision", "profileDigest"]
|
|
91
|
+
},
|
|
92
|
+
"managerSession": {
|
|
93
|
+
"oneOf": [
|
|
94
|
+
{"type": "null"},
|
|
95
|
+
{
|
|
96
|
+
"type": "object", "additionalProperties": false,
|
|
97
|
+
"properties": {"nativeSessionId": {"$ref": "#/$defs/id"}, "nativeProjectId": {"type": "string", "pattern": "^(global|[a-f0-9]{40})$"}, "nativeLocationDigest": {"$ref": "#/$defs/digest"}, "serviceRegistrationId": {"$ref": "#/$defs/id"}, "serviceGeneration": {"type": "integer", "minimum": 1}, "providerRouteDigest": {"$ref": "#/$defs/digest"}, "managerProfile": {"$ref": "#/$defs/managerProfile"}},
|
|
98
|
+
"required": ["nativeSessionId", "nativeProjectId", "nativeLocationDigest", "serviceRegistrationId", "serviceGeneration", "providerRouteDigest", "managerProfile"]
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"target": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"additionalProperties": false,
|
|
105
|
+
"properties": {
|
|
106
|
+
"teamId": {"$ref": "#/$defs/id"},
|
|
107
|
+
"memberId": {"$ref": "#/$defs/id"},
|
|
108
|
+
"taskId": {"oneOf": [{"$ref": "#/$defs/id"}, {"type": "null"}]},
|
|
109
|
+
"taskAttempt": {"type": ["integer", "null"], "minimum": 1},
|
|
110
|
+
"workId": {"oneOf": [{"$ref": "#/$defs/id"}, {"type": "null"}]},
|
|
111
|
+
"workRevision": {"type": ["integer", "null"], "minimum": 1},
|
|
112
|
+
"bindingId": {"oneOf": [{"$ref": "#/$defs/id"}, {"type": "null"}]},
|
|
113
|
+
"bindingRevision": {"type": ["integer", "null"], "minimum": 1}
|
|
114
|
+
},
|
|
115
|
+
"required": ["teamId", "memberId", "taskId", "taskAttempt", "workId", "workRevision", "bindingId", "bindingRevision"],
|
|
116
|
+
"allOf": [
|
|
117
|
+
{"oneOf": [
|
|
118
|
+
{"properties": {"taskId": {"type": "null"}, "taskAttempt": {"type": "null"}}},
|
|
119
|
+
{"properties": {"taskId": {"$ref": "#/$defs/id"}, "taskAttempt": {"type": "integer", "minimum": 1}}}
|
|
120
|
+
]},
|
|
121
|
+
{"oneOf": [
|
|
122
|
+
{"properties": {"workId": {"type": "null"}, "workRevision": {"type": "null"}, "bindingId": {"type": "null"}, "bindingRevision": {"type": "null"}}},
|
|
123
|
+
{"properties": {"workId": {"$ref": "#/$defs/id"}, "workRevision": {"type": "integer", "minimum": 1}, "bindingId": {"$ref": "#/$defs/id"}, "bindingRevision": {"type": "integer", "minimum": 1}}}
|
|
124
|
+
]}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"effectiveLimits": {
|
|
128
|
+
"type": "object",
|
|
129
|
+
"additionalProperties": false,
|
|
130
|
+
"properties": {
|
|
131
|
+
"sandboxDailyRuns": {"const": 30},
|
|
132
|
+
"sandboxHourlyRuns": {"const": 10},
|
|
133
|
+
"sessionRuns24h": {"const": 3},
|
|
134
|
+
"sessionCooldownSeconds": {"const": 300},
|
|
135
|
+
"serverConcurrentRuns": {"const": 2},
|
|
136
|
+
"serverHourlyStarts": {"const": 20},
|
|
137
|
+
"perRunModelRequests": {"const": 2},
|
|
138
|
+
"perRunInputTokens": {"const": 16000},
|
|
139
|
+
"perRunOutputTokens": {"const": 2000}
|
|
140
|
+
},
|
|
141
|
+
"required": ["sandboxDailyRuns", "sandboxHourlyRuns", "sessionRuns24h", "sessionCooldownSeconds", "serverConcurrentRuns", "serverHourlyStarts", "perRunModelRequests", "perRunInputTokens", "perRunOutputTokens"]
|
|
142
|
+
},
|
|
143
|
+
"modelRoute": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"additionalProperties": false,
|
|
146
|
+
"properties": {
|
|
147
|
+
"registeredSourceId": {"$ref": "#/$defs/id"},
|
|
148
|
+
"providerRouteDigest": {"$ref": "#/$defs/digest"},
|
|
149
|
+
"providerId": {"$ref": "#/$defs/providerId"},
|
|
150
|
+
"modelId": {"$ref": "#/$defs/modelId"},
|
|
151
|
+
"protocol": {"const": "opencode-supervisor/1"},
|
|
152
|
+
"recipeIds": {"type": "array", "maxItems": 4, "uniqueItems": true, "items": {"$ref": "#/$defs/recipe"}},
|
|
153
|
+
"available": {"type": "boolean"},
|
|
154
|
+
"reason": {"$ref": "#/$defs/capabilityReason"}
|
|
155
|
+
},
|
|
156
|
+
"required": ["registeredSourceId", "providerRouteDigest", "providerId", "modelId", "protocol", "recipeIds", "available", "reason"]
|
|
157
|
+
},
|
|
158
|
+
"policyPatch": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"additionalProperties": false,
|
|
161
|
+
"properties": {
|
|
162
|
+
"version": {"const": 1},
|
|
163
|
+
"requestId": {"$ref": "#/$defs/id"},
|
|
164
|
+
"expectedRevision": {"type": "integer", "minimum": 1},
|
|
165
|
+
"mode": {"type": "string", "enum": ["off", "recommend", "auto_steer"]},
|
|
166
|
+
"allowedRules": {"type": "array", "maxItems": 4, "uniqueItems": true, "items": {"$ref": "#/$defs/rule"}},
|
|
167
|
+
"dailyRunLimit": {"type": "integer", "minimum": 0, "maximum": 30},
|
|
168
|
+
"dailyInputTokenLimit": {"type": "integer", "minimum": 0, "maximum": 480000},
|
|
169
|
+
"dailyOutputTokenLimit": {"type": "integer", "minimum": 0, "maximum": 60000},
|
|
170
|
+
"authorizationValidSeconds": {"type": "integer", "minimum": 30, "maximum": 120}
|
|
171
|
+
},
|
|
172
|
+
"required": ["version", "requestId", "expectedRevision", "mode", "allowedRules", "dailyRunLimit", "dailyInputTokenLimit", "dailyOutputTokenLimit", "authorizationValidSeconds"]
|
|
173
|
+
},
|
|
174
|
+
"policy": {
|
|
175
|
+
"type": "object",
|
|
176
|
+
"additionalProperties": false,
|
|
177
|
+
"properties": {
|
|
178
|
+
"formatVersion": {"const": 1},
|
|
179
|
+
"sandboxId": {"$ref": "#/$defs/id"},
|
|
180
|
+
"revision": {"type": "integer", "minimum": 1},
|
|
181
|
+
"mode": {"type": "string", "enum": ["off", "recommend", "auto_steer"]},
|
|
182
|
+
"allowedRules": {"type": "array", "maxItems": 4, "uniqueItems": true, "items": {"$ref": "#/$defs/rule"}},
|
|
183
|
+
"dailyRunLimit": {"type": "integer", "minimum": 0, "maximum": 30},
|
|
184
|
+
"dailyInputTokenLimit": {"type": "integer", "minimum": 0, "maximum": 480000},
|
|
185
|
+
"dailyOutputTokenLimit": {"type": "integer", "minimum": 0, "maximum": 60000},
|
|
186
|
+
"effectiveLimits": {"$ref": "#/$defs/effectiveLimits"},
|
|
187
|
+
"authorizationExpiresAt": {"type": ["string", "null"], "format": "date-time"},
|
|
188
|
+
"appliedRevision": {"type": ["integer", "null"], "minimum": 1},
|
|
189
|
+
"status": {"type": "string", "enum": ["awaiting_runtime", "applied", "expired", "unavailable"]},
|
|
190
|
+
"recommend": {"$ref": "#/$defs/capability"},
|
|
191
|
+
"modelRoutes": {"type": "array", "maxItems": 8, "items": {"$ref": "#/$defs/modelRoute"}},
|
|
192
|
+
"autoSteer": {"$ref": "#/$defs/capability"},
|
|
193
|
+
"updatedAt": {"type": "string", "format": "date-time"}
|
|
194
|
+
},
|
|
195
|
+
"required": ["formatVersion", "sandboxId", "revision", "mode", "allowedRules", "dailyRunLimit", "dailyInputTokenLimit", "dailyOutputTokenLimit", "effectiveLimits", "authorizationExpiresAt", "appliedRevision", "status", "recommend", "modelRoutes", "autoSteer", "updatedAt"]
|
|
196
|
+
},
|
|
197
|
+
"managerTarget": {
|
|
198
|
+
"type": "object",
|
|
199
|
+
"additionalProperties": false,
|
|
200
|
+
"properties": {
|
|
201
|
+
"formatVersion": {"const": 1},
|
|
202
|
+
"findingId": {"$ref": "#/$defs/id"},
|
|
203
|
+
"findingRevision": {"type": "integer", "minimum": 1},
|
|
204
|
+
"source": {"$ref": "#/$defs/source"},
|
|
205
|
+
"target": {"$ref": "#/$defs/target"},
|
|
206
|
+
"remaining": {"$ref": "#/$defs/remaining"},
|
|
207
|
+
"capabilities": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"additionalProperties": false,
|
|
210
|
+
"properties": {"recommend": {"$ref": "#/$defs/capability"}, "takeover": {"$ref": "#/$defs/capability"}, "autoSteer": {"$ref": "#/$defs/capability"}},
|
|
211
|
+
"required": ["recommend", "takeover", "autoSteer"]
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"required": ["formatVersion", "findingId", "findingRevision", "source", "target", "remaining", "capabilities"]
|
|
215
|
+
},
|
|
216
|
+
"reservationRequest": {
|
|
217
|
+
"type": "object",
|
|
218
|
+
"additionalProperties": false,
|
|
219
|
+
"properties": {
|
|
220
|
+
"formatVersion": {"const": 1},
|
|
221
|
+
"reservationId": {"$ref": "#/$defs/id"},
|
|
222
|
+
"requestId": {"$ref": "#/$defs/id"},
|
|
223
|
+
"manual": {"const": false},
|
|
224
|
+
"findingId": {"$ref": "#/$defs/id"},
|
|
225
|
+
"findingRevision": {"type": "integer", "minimum": 1},
|
|
226
|
+
"policyRevision": {"type": "integer", "minimum": 1},
|
|
227
|
+
"ruleId": {"$ref": "#/$defs/rule"},
|
|
228
|
+
"recipeId": {"$ref": "#/$defs/recipe"},
|
|
229
|
+
"providerRouteDigest": {"$ref": "#/$defs/digest"},
|
|
230
|
+
"source": {"$ref": "#/$defs/source"},
|
|
231
|
+
"target": {"$ref": "#/$defs/target"},
|
|
232
|
+
"budget": {"$ref": "#/$defs/budget"},
|
|
233
|
+
"expiresInSeconds": {"type": "integer", "minimum": 30, "maximum": 120}
|
|
234
|
+
},
|
|
235
|
+
"required": ["formatVersion", "reservationId", "requestId", "manual", "findingId", "findingRevision", "policyRevision", "ruleId", "recipeId", "providerRouteDigest", "source", "target", "budget", "expiresInSeconds"]
|
|
236
|
+
},
|
|
237
|
+
"recheckRequest": {
|
|
238
|
+
"type": "object",
|
|
239
|
+
"additionalProperties": false,
|
|
240
|
+
"properties": {
|
|
241
|
+
"version": {"const": 1},
|
|
242
|
+
"requestId": {"$ref": "#/$defs/id"},
|
|
243
|
+
"manual": {"const": true},
|
|
244
|
+
"expectedFindingRevision": {"type": "integer", "minimum": 1},
|
|
245
|
+
"expectedPolicyRevision": {"type": "integer", "minimum": 1},
|
|
246
|
+
"recipeId": {"$ref": "#/$defs/recipe"},
|
|
247
|
+
"source": {"$ref": "#/$defs/source"},
|
|
248
|
+
"target": {"$ref": "#/$defs/target"},
|
|
249
|
+
"budget": {"$ref": "#/$defs/budget"},
|
|
250
|
+
"expiresInSeconds": {"type": "integer", "minimum": 30, "maximum": 120}
|
|
251
|
+
},
|
|
252
|
+
"required": ["version", "requestId", "manual", "expectedFindingRevision", "expectedPolicyRevision", "recipeId", "source", "target", "budget", "expiresInSeconds"]
|
|
253
|
+
},
|
|
254
|
+
"remaining": {
|
|
255
|
+
"type": "object",
|
|
256
|
+
"additionalProperties": false,
|
|
257
|
+
"properties": {
|
|
258
|
+
"sandboxDailyRuns": {"type": "integer", "minimum": 0},
|
|
259
|
+
"sandboxHourlyRuns": {"type": "integer", "minimum": 0},
|
|
260
|
+
"sandboxDailyInputTokens": {"type": "integer", "minimum": 0},
|
|
261
|
+
"sandboxDailyOutputTokens": {"type": "integer", "minimum": 0},
|
|
262
|
+
"sessionRuns24h": {"type": "integer", "minimum": 0},
|
|
263
|
+
"sessionCooldownSeconds": {"type": "integer", "minimum": 0},
|
|
264
|
+
"serverConcurrentRuns": {"type": "integer", "minimum": 0},
|
|
265
|
+
"serverHourlyStarts": {"type": "integer", "minimum": 0}
|
|
266
|
+
},
|
|
267
|
+
"required": ["sandboxDailyRuns", "sandboxHourlyRuns", "sandboxDailyInputTokens", "sandboxDailyOutputTokens", "sessionRuns24h", "sessionCooldownSeconds", "serverConcurrentRuns", "serverHourlyStarts"]
|
|
268
|
+
},
|
|
269
|
+
"reservation": {
|
|
270
|
+
"type": "object",
|
|
271
|
+
"additionalProperties": false,
|
|
272
|
+
"properties": {
|
|
273
|
+
"formatVersion": {"const": 1},
|
|
274
|
+
"reservationId": {"$ref": "#/$defs/id"},
|
|
275
|
+
"runId": {"$ref": "#/$defs/id"},
|
|
276
|
+
"requestId": {"$ref": "#/$defs/id"},
|
|
277
|
+
"manual": {"type": "boolean"},
|
|
278
|
+
"state": {"type": "string", "enum": ["reserved", "reviewing", "recommended", "no_action", "needs_owner", "failed", "expired"]},
|
|
279
|
+
"findingId": {"$ref": "#/$defs/id"},
|
|
280
|
+
"findingRevision": {"type": "integer", "minimum": 1},
|
|
281
|
+
"policyRevision": {"type": "integer", "minimum": 1},
|
|
282
|
+
"source": {"$ref": "#/$defs/source"},
|
|
283
|
+
"target": {"$ref": "#/$defs/target"},
|
|
284
|
+
"expiresAt": {"type": "string", "format": "date-time"},
|
|
285
|
+
"reservedBudget": {"$ref": "#/$defs/budget"},
|
|
286
|
+
"execution": {"type": "object", "additionalProperties": false, "properties": {"providerRouteDigest": {"$ref": "#/$defs/digest"}, "managerProfile": {"$ref": "#/$defs/managerProfile"}}, "required": ["providerRouteDigest", "managerProfile"]},
|
|
287
|
+
"remaining": {"$ref": "#/$defs/remaining"}
|
|
288
|
+
},
|
|
289
|
+
"required": ["formatVersion", "reservationId", "runId", "requestId", "manual", "state", "findingId", "findingRevision", "policyRevision", "source", "target", "expiresAt", "reservedBudget", "execution", "remaining"]
|
|
290
|
+
},
|
|
291
|
+
"proposal": {
|
|
292
|
+
"oneOf": [
|
|
293
|
+
{"type": "null"},
|
|
294
|
+
{
|
|
295
|
+
"type": "object",
|
|
296
|
+
"additionalProperties": false,
|
|
297
|
+
"properties": {
|
|
298
|
+
"recipeId": {"$ref": "#/$defs/recipe"},
|
|
299
|
+
"outcome": {"type": "string", "enum": ["recommendation", "no_action", "needs_owner"]},
|
|
300
|
+
"rationaleCode": {"$ref": "#/$defs/rationaleCode"},
|
|
301
|
+
"firstSequence": {"type": "integer", "minimum": 1},
|
|
302
|
+
"lastSequence": {"type": "integer", "minimum": 1},
|
|
303
|
+
"guidanceDigest": {"oneOf": [{"$ref": "#/$defs/digest"}, {"type": "null"}]}
|
|
304
|
+
},
|
|
305
|
+
"required": ["recipeId", "outcome", "rationaleCode", "firstSequence", "lastSequence", "guidanceDigest"]
|
|
306
|
+
}
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
"runReport": {
|
|
310
|
+
"type": "object",
|
|
311
|
+
"additionalProperties": false,
|
|
312
|
+
"properties": {
|
|
313
|
+
"formatVersion": {"const": 1},
|
|
314
|
+
"reservationId": {"$ref": "#/$defs/id"},
|
|
315
|
+
"runId": {"$ref": "#/$defs/id"},
|
|
316
|
+
"manual": {"type": "boolean"},
|
|
317
|
+
"state": {"type": "string", "enum": ["reviewing", "recommended", "no_action", "needs_owner", "failed"]},
|
|
318
|
+
"policyRevision": {"type": "integer", "minimum": 1},
|
|
319
|
+
"source": {"$ref": "#/$defs/source"},
|
|
320
|
+
"target": {"$ref": "#/$defs/target"},
|
|
321
|
+
"proposal": {"$ref": "#/$defs/proposal"},
|
|
322
|
+
"managerSession": {"$ref": "#/$defs/managerSession"},
|
|
323
|
+
"usage": {"$ref": "#/$defs/usage"},
|
|
324
|
+
"receiptDigest": {"$ref": "#/$defs/digest"},
|
|
325
|
+
"errorCode": {"$ref": "#/$defs/errorCode"}
|
|
326
|
+
},
|
|
327
|
+
"required": ["formatVersion", "reservationId", "runId", "manual", "state", "policyRevision", "source", "target", "proposal", "managerSession", "usage", "receiptDigest", "errorCode"]
|
|
328
|
+
},
|
|
329
|
+
"activity": {
|
|
330
|
+
"type": "object",
|
|
331
|
+
"additionalProperties": false,
|
|
332
|
+
"properties": {
|
|
333
|
+
"runId": {"$ref": "#/$defs/id"},
|
|
334
|
+
"reservationId": {"$ref": "#/$defs/id"},
|
|
335
|
+
"requestId": {"$ref": "#/$defs/id"},
|
|
336
|
+
"manual": {"type": "boolean"},
|
|
337
|
+
"findingId": {"$ref": "#/$defs/id"},
|
|
338
|
+
"ruleId": {"$ref": "#/$defs/rule"},
|
|
339
|
+
"recipeId": {"$ref": "#/$defs/recipe"},
|
|
340
|
+
"source": {"$ref": "#/$defs/source"},
|
|
341
|
+
"target": {"$ref": "#/$defs/target"},
|
|
342
|
+
"state": {"type": "string", "enum": ["reserved", "reviewing", "recommended", "no_action", "needs_owner", "failed", "expired"]},
|
|
343
|
+
"rationaleCode": {"oneOf": [{"$ref": "#/$defs/rationaleCode"}, {"type": "null"}]},
|
|
344
|
+
"errorCode": {"$ref": "#/$defs/errorCode"},
|
|
345
|
+
"modelRequests": {"type": "integer", "minimum": 0, "maximum": 2},
|
|
346
|
+
"inputTokens": {"type": "integer", "minimum": 0, "maximum": 16000},
|
|
347
|
+
"outputTokens": {"type": "integer", "minimum": 0, "maximum": 2000},
|
|
348
|
+
"managerSession": {"type": "object", "additionalProperties": false, "properties": {"capability": {"type": "string", "enum": ["exact_session", "unavailable"]}, "reason": {"$ref": "#/$defs/capabilityReason"}}, "required": ["capability", "reason"]},
|
|
349
|
+
"createdAt": {"type": "string", "format": "date-time"},
|
|
350
|
+
"updatedAt": {"type": "string", "format": "date-time"}
|
|
351
|
+
},
|
|
352
|
+
"required": ["runId", "reservationId", "requestId", "manual", "findingId", "ruleId", "recipeId", "source", "target", "state", "rationaleCode", "errorCode", "modelRequests", "inputTokens", "outputTokens", "managerSession", "createdAt", "updatedAt"]
|
|
353
|
+
},
|
|
354
|
+
"activityList": {
|
|
355
|
+
"type": "object", "additionalProperties": false,
|
|
356
|
+
"properties": {"runs": {"type": "array", "maxItems": 100, "items": {"$ref": "#/$defs/activity"}}, "nextCursor": {"oneOf": [{"$ref": "#/$defs/id"}, {"type": "null"}]}},
|
|
357
|
+
"required": ["runs", "nextCursor"]
|
|
358
|
+
},
|
|
359
|
+
"takeoverRequest": {
|
|
360
|
+
"type": "object", "additionalProperties": false,
|
|
361
|
+
"properties": {"version": {"const": 1}, "operationId": {"$ref": "#/$defs/id"}, "requestId": {"$ref": "#/$defs/id"}, "action": {"const": "pause_manager_and_hold_member"}, "expectedFindingRevision": {"type": "integer", "minimum": 1}, "expectedPolicyRevision": {"type": "integer", "minimum": 1}, "source": {"$ref": "#/$defs/source"}, "target": {"$ref": "#/$defs/target"}},
|
|
362
|
+
"required": ["version", "operationId", "requestId", "action", "expectedFindingRevision", "expectedPolicyRevision", "source", "target"]
|
|
363
|
+
},
|
|
364
|
+
"resumeRequest": {
|
|
365
|
+
"type": "object", "additionalProperties": false,
|
|
366
|
+
"properties": {"version": {"const": 1}, "resumeOperationId": {"$ref": "#/$defs/id"}, "requestId": {"$ref": "#/$defs/id"}, "action": {"const": "resume_manager_and_release_member"}, "expectedTakeoverRevision": {"type": "integer", "minimum": 1}, "expectedPolicyRevision": {"type": "integer", "minimum": 1}, "expectedHoldRevision": {"type": "integer", "minimum": 1}, "restoreMode": {"type": "string", "enum": ["off", "recommend"]}, "source": {"$ref": "#/$defs/source"}, "target": {"$ref": "#/$defs/target"}},
|
|
367
|
+
"required": ["version", "resumeOperationId", "requestId", "action", "expectedTakeoverRevision", "expectedPolicyRevision", "expectedHoldRevision", "restoreMode", "source", "target"]
|
|
368
|
+
},
|
|
369
|
+
"takeover": {
|
|
370
|
+
"type": "object", "additionalProperties": false,
|
|
371
|
+
"properties": {
|
|
372
|
+
"formatVersion": {"const": 1}, "operationId": {"$ref": "#/$defs/id"}, "predecessorOperationId": {"oneOf": [{"$ref": "#/$defs/id"}, {"type": "null"}]}, "requestId": {"$ref": "#/$defs/id"}, "revision": {"type": "integer", "minimum": 1}, "action": {"type": "string", "enum": ["pause_manager_and_hold_member", "resume_manager_and_release_member"]}, "state": {"type": "string", "enum": ["awaiting_runtime", "ready", "unsettled", "superseded", "failed", "resumed"]}, "findingId": {"$ref": "#/$defs/id"}, "source": {"$ref": "#/$defs/source"}, "target": {"$ref": "#/$defs/target"},
|
|
373
|
+
"monitorPolicy": {"type": "object", "additionalProperties": false, "properties": {"desiredMode": {"type": "string", "enum": ["off", "recommend"]}, "desiredRevision": {"type": "integer", "minimum": 1}, "appliedRevision": {"type": ["integer", "null"], "minimum": 1}}, "required": ["desiredMode", "desiredRevision", "appliedRevision"]},
|
|
374
|
+
"memberHold": {"type": "object", "additionalProperties": false, "properties": {"holdId": {"$ref": "#/$defs/id"}, "desiredState": {"type": "string", "enum": ["active", "released"]}, "desiredRevision": {"type": "integer", "minimum": 1}, "brokerApplied": {"type": "boolean"}, "nodeAppliedRevision": {"type": ["integer", "null"], "minimum": 1}}, "required": ["holdId", "desiredState", "desiredRevision", "brokerApplied", "nodeAppliedRevision"]},
|
|
375
|
+
"pendingInput": {"type": "object", "additionalProperties": false, "properties": {"state": {"type": "string", "enum": ["awaiting_runtime", "none_pending", "canceled", "already_available_to_worker", "unknown"]}, "alreadyConsumed": {"type": "boolean"}}, "required": ["state", "alreadyConsumed"]},
|
|
376
|
+
"handoff": {"type": "object", "additionalProperties": false, "properties": {"capability": {"type": "string", "enum": ["exact_session", "inspection_only", "unavailable"]}, "reason": {"$ref": "#/$defs/capabilityReason"}}, "required": ["capability", "reason"]},
|
|
377
|
+
"createdAt": {"type": "string", "format": "date-time"}, "updatedAt": {"type": "string", "format": "date-time"}
|
|
378
|
+
},
|
|
379
|
+
"required": ["formatVersion", "operationId", "predecessorOperationId", "requestId", "revision", "action", "state", "findingId", "source", "target", "monitorPolicy", "memberHold", "pendingInput", "handoff", "createdAt", "updatedAt"]
|
|
380
|
+
},
|
|
381
|
+
"takeoverList": {
|
|
382
|
+
"type": "object", "additionalProperties": false,
|
|
383
|
+
"properties": {"takeovers": {"type": "array", "maxItems": 100, "items": {"$ref": "#/$defs/takeover"}}, "nextCursor": {"oneOf": [{"$ref": "#/$defs/id"}, {"type": "null"}]}},
|
|
384
|
+
"required": ["takeovers", "nextCursor"]
|
|
385
|
+
},
|
|
386
|
+
"policyManifest": {
|
|
387
|
+
"type": "object", "additionalProperties": false,
|
|
388
|
+
"properties": {"formatVersion": {"const": 1}, "sandboxId": {"$ref": "#/$defs/id"}, "sandboxGeneration": {"type": "integer", "minimum": 1}, "policyRevision": {"type": "integer", "minimum": 1}, "mode": {"type": "string", "enum": ["off", "recommend", "auto_steer"]}, "allowedRules": {"type": "array", "maxItems": 4, "items": {"$ref": "#/$defs/rule"}}, "dailyRunLimit": {"type": "integer", "minimum": 0, "maximum": 30}, "dailyInputTokenLimit": {"type": "integer", "minimum": 0, "maximum": 480000}, "dailyOutputTokenLimit": {"type": "integer", "minimum": 0, "maximum": 60000}, "effectiveLimits": {"$ref": "#/$defs/effectiveLimits"}, "managerProfile": {"$ref": "#/$defs/managerProfile"}, "validUntil": {"type": "string", "format": "date-time"}, "runGeneration": {"type": "integer", "minimum": 1}, "autoSteerAvailable": {"type": "boolean"}},
|
|
389
|
+
"required": ["formatVersion", "sandboxId", "sandboxGeneration", "policyRevision", "mode", "allowedRules", "dailyRunLimit", "dailyInputTokenLimit", "dailyOutputTokenLimit", "effectiveLimits", "managerProfile", "validUntil", "runGeneration", "autoSteerAvailable"]
|
|
390
|
+
},
|
|
391
|
+
"policyReport": {
|
|
392
|
+
"type": "object", "additionalProperties": false,
|
|
393
|
+
"properties": {"formatVersion": {"const": 1}, "sandboxId": {"$ref": "#/$defs/id"}, "sandboxGeneration": {"type": "integer", "minimum": 1}, "policyRevision": {"type": "integer", "minimum": 1}, "runGeneration": {"type": "integer", "minimum": 1}, "status": {"type": "string", "enum": ["applied", "failed"]}, "recommend": {"$ref": "#/$defs/capability"}, "recommendCapabilities": {"type": "array", "maxItems": 8, "items": {"$ref": "#/$defs/recommendCapabilityReport"}}, "receiptDigest": {"$ref": "#/$defs/digest"}, "errorCode": {"$ref": "#/$defs/errorCode"}},
|
|
394
|
+
"required": ["formatVersion", "sandboxId", "sandboxGeneration", "policyRevision", "runGeneration", "status", "recommend", "recommendCapabilities", "receiptDigest", "errorCode"]
|
|
395
|
+
},
|
|
396
|
+
"recommendCapabilityReport": {
|
|
397
|
+
"type": "object", "additionalProperties": false,
|
|
398
|
+
"properties": {"source": {"$ref": "#/$defs/source"}, "providerRouteDigest": {"$ref": "#/$defs/digest"}, "providerId": {"$ref": "#/$defs/providerId"}, "modelId": {"$ref": "#/$defs/modelId"}, "protocol": {"const": "opencode-supervisor/1"}, "recipeIds": {"type": "array", "maxItems": 4, "uniqueItems": true, "items": {"$ref": "#/$defs/recipe"}}, "maxInputTokens": {"const": 8000}, "maxOutputTokens": {"const": 1000}, "toolsAllowed": {"const": false}, "mediaAllowed": {"const": false}, "managerProfile": {"$ref": "#/$defs/managerProfile"}, "available": {"type": "boolean"}, "reason": {"$ref": "#/$defs/capabilityReason"}},
|
|
399
|
+
"required": ["source", "providerRouteDigest", "providerId", "modelId", "protocol", "recipeIds", "maxInputTokens", "maxOutputTokens", "toolsAllowed", "mediaAllowed", "managerProfile", "available", "reason"]
|
|
400
|
+
},
|
|
401
|
+
"reviewManifest": {
|
|
402
|
+
"type": "object",
|
|
403
|
+
"additionalProperties": false,
|
|
404
|
+
"properties": {
|
|
405
|
+
"formatVersion": {
|
|
406
|
+
"const": 1
|
|
407
|
+
},
|
|
408
|
+
"reservationId": {
|
|
409
|
+
"$ref": "#/$defs/id"
|
|
410
|
+
},
|
|
411
|
+
"runId": {
|
|
412
|
+
"$ref": "#/$defs/id"
|
|
413
|
+
},
|
|
414
|
+
"manual": {
|
|
415
|
+
"const": true
|
|
416
|
+
},
|
|
417
|
+
"findingId": {
|
|
418
|
+
"$ref": "#/$defs/id"
|
|
419
|
+
},
|
|
420
|
+
"findingRevision": {
|
|
421
|
+
"type": "integer",
|
|
422
|
+
"minimum": 1
|
|
423
|
+
},
|
|
424
|
+
"policyRevision": {
|
|
425
|
+
"type": "integer",
|
|
426
|
+
"minimum": 1
|
|
427
|
+
},
|
|
428
|
+
"ruleId": {
|
|
429
|
+
"$ref": "#/$defs/rule"
|
|
430
|
+
},
|
|
431
|
+
"recipeId": {
|
|
432
|
+
"$ref": "#/$defs/recipe"
|
|
433
|
+
},
|
|
434
|
+
"providerRouteDigest": {
|
|
435
|
+
"$ref": "#/$defs/digest"
|
|
436
|
+
},
|
|
437
|
+
"managerProfile": {
|
|
438
|
+
"$ref": "#/$defs/managerProfile"
|
|
439
|
+
},
|
|
440
|
+
"source": {
|
|
441
|
+
"$ref": "#/$defs/source"
|
|
442
|
+
},
|
|
443
|
+
"target": {
|
|
444
|
+
"$ref": "#/$defs/target"
|
|
445
|
+
},
|
|
446
|
+
"budget": {
|
|
447
|
+
"$ref": "#/$defs/budget"
|
|
448
|
+
},
|
|
449
|
+
"validUntil": {
|
|
450
|
+
"type": "string",
|
|
451
|
+
"format": "date-time"
|
|
452
|
+
},
|
|
453
|
+
"findingEvidence": {
|
|
454
|
+
"$ref": "#/$defs/findingEvidence"
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
"required": [
|
|
458
|
+
"formatVersion",
|
|
459
|
+
"reservationId",
|
|
460
|
+
"runId",
|
|
461
|
+
"manual",
|
|
462
|
+
"findingId",
|
|
463
|
+
"findingRevision",
|
|
464
|
+
"policyRevision",
|
|
465
|
+
"ruleId",
|
|
466
|
+
"recipeId",
|
|
467
|
+
"providerRouteDigest",
|
|
468
|
+
"managerProfile",
|
|
469
|
+
"source",
|
|
470
|
+
"target",
|
|
471
|
+
"budget",
|
|
472
|
+
"validUntil"
|
|
473
|
+
]
|
|
474
|
+
},
|
|
475
|
+
"takeoverManifest": {
|
|
476
|
+
"type": "object", "additionalProperties": false,
|
|
477
|
+
"properties": {"formatVersion": {"const": 1}, "operationId": {"$ref": "#/$defs/id"}, "predecessorOperationId": {"oneOf": [{"$ref": "#/$defs/id"}, {"type": "null"}]}, "action": {"type": "string", "enum": ["pause_manager_and_hold_member", "resume_manager_and_release_member"]}, "findingId": {"$ref": "#/$defs/id"}, "findingRevision": {"type": "integer", "minimum": 1}, "policyRevision": {"type": "integer", "minimum": 1}, "runGeneration": {"type": "integer", "minimum": 1}, "holdId": {"$ref": "#/$defs/id"}, "holdRevision": {"type": "integer", "minimum": 1}, "holdState": {"type": "string", "enum": ["active", "released"]}, "source": {"$ref": "#/$defs/source"}, "target": {"$ref": "#/$defs/target"}, "validUntil": {"type": "string", "format": "date-time"}},
|
|
478
|
+
"required": ["formatVersion", "operationId", "predecessorOperationId", "action", "findingId", "findingRevision", "policyRevision", "runGeneration", "holdId", "holdRevision", "holdState", "source", "target", "validUntil"]
|
|
479
|
+
},
|
|
480
|
+
"takeoverReport": {
|
|
481
|
+
"type": "object", "additionalProperties": false,
|
|
482
|
+
"properties": {"formatVersion": {"const": 1}, "operationId": {"$ref": "#/$defs/id"}, "predecessorOperationId": {"oneOf": [{"$ref": "#/$defs/id"}, {"type": "null"}]}, "action": {"type": "string", "enum": ["pause_manager_and_hold_member", "resume_manager_and_release_member"]}, "findingId": {"$ref": "#/$defs/id"}, "findingRevision": {"type": "integer", "minimum": 1}, "policyRevision": {"type": "integer", "minimum": 1}, "runGeneration": {"type": "integer", "minimum": 1}, "holdId": {"$ref": "#/$defs/id"}, "holdRevision": {"type": "integer", "minimum": 1}, "holdState": {"type": "string", "enum": ["active", "released"]}, "source": {"$ref": "#/$defs/source"}, "target": {"$ref": "#/$defs/target"}, "status": {"type": "string", "enum": ["ready", "unsettled", "failed"]}, "pendingInput": {"type": "object", "additionalProperties": false, "properties": {"state": {"type": "string", "enum": ["none_pending", "canceled", "already_available_to_worker", "unknown"]}, "alreadyConsumed": {"type": "boolean"}}, "required": ["state", "alreadyConsumed"]}, "receiptDigest": {"$ref": "#/$defs/digest"}, "errorCode": {"$ref": "#/$defs/errorCode"}},
|
|
483
|
+
"required": ["formatVersion", "operationId", "predecessorOperationId", "action", "findingId", "findingRevision", "policyRevision", "runGeneration", "holdId", "holdRevision", "holdState", "source", "target", "status", "pendingInput", "receiptDigest", "errorCode"]
|
|
484
|
+
},
|
|
485
|
+
"findingEvidence": {
|
|
486
|
+
"type": "object",
|
|
487
|
+
"additionalProperties": false,
|
|
488
|
+
"properties": {
|
|
489
|
+
"findingId": {
|
|
490
|
+
"$ref": "#/$defs/id"
|
|
491
|
+
},
|
|
492
|
+
"findingRevision": {
|
|
493
|
+
"type": "integer",
|
|
494
|
+
"minimum": 1
|
|
495
|
+
},
|
|
496
|
+
"journalGeneration": {
|
|
497
|
+
"$ref": "#/$defs/id"
|
|
498
|
+
},
|
|
499
|
+
"ruleId": {
|
|
500
|
+
"type": "string"
|
|
501
|
+
},
|
|
502
|
+
"nativeSessionId": {
|
|
503
|
+
"$ref": "#/$defs/id"
|
|
504
|
+
},
|
|
505
|
+
"firstSequence": {
|
|
506
|
+
"type": "integer",
|
|
507
|
+
"minimum": 1
|
|
508
|
+
},
|
|
509
|
+
"lastSequence": {
|
|
510
|
+
"type": "integer",
|
|
511
|
+
"minimum": 1
|
|
512
|
+
},
|
|
513
|
+
"count": {
|
|
514
|
+
"type": "integer",
|
|
515
|
+
"minimum": 1
|
|
516
|
+
},
|
|
517
|
+
"matchedCallIds": {
|
|
518
|
+
"type": "array",
|
|
519
|
+
"maxItems": 16,
|
|
520
|
+
"uniqueItems": true,
|
|
521
|
+
"items": {
|
|
522
|
+
"$ref": "#/$defs/id"
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
"coverage": {
|
|
526
|
+
"const": "complete"
|
|
527
|
+
},
|
|
528
|
+
"firstObservedAt": {
|
|
529
|
+
"type": "string",
|
|
530
|
+
"format": "date-time"
|
|
531
|
+
},
|
|
532
|
+
"lastObservedAt": {
|
|
533
|
+
"type": "string",
|
|
534
|
+
"format": "date-time"
|
|
535
|
+
},
|
|
536
|
+
"toolCategory": {
|
|
537
|
+
"type": "string",
|
|
538
|
+
"maxLength": 32
|
|
539
|
+
},
|
|
540
|
+
"phase": {
|
|
541
|
+
"type": "string",
|
|
542
|
+
"maxLength": 32
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
"required": [
|
|
546
|
+
"findingId",
|
|
547
|
+
"findingRevision",
|
|
548
|
+
"journalGeneration",
|
|
549
|
+
"ruleId",
|
|
550
|
+
"nativeSessionId",
|
|
551
|
+
"firstSequence",
|
|
552
|
+
"lastSequence",
|
|
553
|
+
"count",
|
|
554
|
+
"matchedCallIds",
|
|
555
|
+
"coverage",
|
|
556
|
+
"firstObservedAt",
|
|
557
|
+
"lastObservedAt",
|
|
558
|
+
"toolCategory",
|
|
559
|
+
"phase"
|
|
560
|
+
]
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|