@open-conduit/sdk 0.0.0-stage → 7.1.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 +21 -0
- package/README.md +12 -2
- package/dist/actions.d.ts +145 -0
- package/dist/actions.js +281 -0
- package/dist/actiontest.d.ts +80 -0
- package/dist/actiontest.js +190 -0
- package/dist/artifactstore.d.ts +133 -0
- package/dist/artifactstore.js +364 -0
- package/dist/backup.d.ts +99 -0
- package/dist/backup.js +178 -0
- package/dist/containertest.d.ts +71 -0
- package/dist/containertest.js +294 -0
- package/dist/errors.d.ts +127 -0
- package/dist/errors.js +180 -0
- package/dist/executor.d.ts +374 -0
- package/dist/executor.js +556 -0
- package/dist/executortest.d.ts +183 -0
- package/dist/executortest.js +534 -0
- package/dist/extension.d.ts +855 -0
- package/dist/extension.js +1822 -0
- package/dist/feed.d.ts +20 -0
- package/dist/feed.js +88 -0
- package/dist/forward.d.ts +38 -0
- package/dist/forward.js +163 -0
- package/dist/forwardca.d.ts +21 -0
- package/dist/forwardca.js +144 -0
- package/dist/hooks.d.ts +108 -0
- package/dist/hooks.js +13 -0
- package/dist/host.d.ts +295 -0
- package/dist/host.js +486 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +31 -0
- package/dist/jsonrpc.d.ts +39 -0
- package/dist/jsonrpc.js +350 -0
- package/dist/probe.d.ts +61 -0
- package/dist/probe.js +92 -0
- package/dist/providertest.d.ts +59 -0
- package/dist/providertest.js +168 -0
- package/dist/resources.d.ts +208 -0
- package/dist/resources.js +303 -0
- package/dist/sandbox.d.ts +84 -0
- package/dist/sandbox.js +85 -0
- package/dist/schema.d.ts +71 -0
- package/dist/schema.js +252 -0
- package/dist/setup.d.ts +145 -0
- package/dist/setup.js +179 -0
- package/dist/setuptest.d.ts +90 -0
- package/dist/setuptest.js +319 -0
- package/dist/storetest.d.ts +64 -0
- package/dist/storetest.js +740 -0
- package/dist/telemetry.d.ts +86 -0
- package/dist/telemetry.js +46 -0
- package/dist/testing.d.ts +756 -0
- package/dist/testing.js +2165 -0
- package/dist/toolbelt.d.ts +91 -0
- package/dist/toolbelt.js +216 -0
- package/dist/tunnel.d.ts +62 -0
- package/dist/tunnel.js +93 -0
- package/dist/wire.d.ts +5359 -0
- package/dist/wire.js +2211 -0
- package/package.json +29 -4
package/dist/wire.js
ADDED
|
@@ -0,0 +1,2211 @@
|
|
|
1
|
+
// The wire messages this SDK uses, as protocol/messages.go, protocol/wire.go
|
|
2
|
+
// and protocol/manifest.go encode them. Each is a schema and a type of the
|
|
3
|
+
// same name: the SDK decodes what the host sends through the schema, so a
|
|
4
|
+
// malformed message is refused instead of reaching extension code as a lie.
|
|
5
|
+
//
|
|
6
|
+
// protocol/typescript_parity_test.go checks every field here against the Go
|
|
7
|
+
// type's JSON fields, so a renamed or removed Go field fails the Go tests.
|
|
8
|
+
//
|
|
9
|
+
// Times are RFC 3339 strings. Bytes ([]byte in Go: KV values, artifact
|
|
10
|
+
// chunks) are base64 strings; the Host client converts them. Go sends a nil
|
|
11
|
+
// slice or map as null, hence the t.nullable on the ones the SDK decodes.
|
|
12
|
+
import { t } from "./schema.js";
|
|
13
|
+
// A newer host may add fields; ignoring them is what keeps old extensions working.
|
|
14
|
+
const open = { open: true };
|
|
15
|
+
/** A versioned payload: data is any JSON value, schema names its shape. */
|
|
16
|
+
export const Payload = t.object({
|
|
17
|
+
schema: t.optional(t.string()),
|
|
18
|
+
data: t.optional(t.any()),
|
|
19
|
+
}, open);
|
|
20
|
+
export const Key = t.object({
|
|
21
|
+
source: t.string(),
|
|
22
|
+
external_id: t.string(),
|
|
23
|
+
}, open);
|
|
24
|
+
export const Event = t.object({
|
|
25
|
+
id: t.optional(t.string()),
|
|
26
|
+
type: t.string(),
|
|
27
|
+
source: t.optional(t.string()),
|
|
28
|
+
delivery_id: t.optional(t.string()),
|
|
29
|
+
occurred_at: t.optional(t.string()),
|
|
30
|
+
received_at: t.optional(t.string()),
|
|
31
|
+
correlation_key: t.optional(Key),
|
|
32
|
+
causation_id: t.optional(t.string()),
|
|
33
|
+
work_id: t.optional(t.string()),
|
|
34
|
+
execution_id: t.optional(t.string()),
|
|
35
|
+
data: t.optional(Payload),
|
|
36
|
+
// Who caused the Event, as kind:id, when the host knows. The host sets
|
|
37
|
+
// it; an Event an extension submits never carries one.
|
|
38
|
+
actor: t.optional(t.string()),
|
|
39
|
+
// The client the actor acted through, as kind:id, when a client
|
|
40
|
+
// credential acted for the actor (a person signed in to it).
|
|
41
|
+
via: t.optional(t.string()),
|
|
42
|
+
}, open);
|
|
43
|
+
export const AcceptedEvent = t.object({
|
|
44
|
+
event: Event,
|
|
45
|
+
sequence: t.integer(),
|
|
46
|
+
routed: t.boolean(),
|
|
47
|
+
routed_work_id: t.optional(t.string()),
|
|
48
|
+
disposition: t.optional(t.string()),
|
|
49
|
+
scope_id: t.optional(t.string()),
|
|
50
|
+
// A tombstone: the Event's payload has left the live log, so empty data
|
|
51
|
+
// says nothing about what it carried.
|
|
52
|
+
retired: t.optional(t.boolean()),
|
|
53
|
+
}, open);
|
|
54
|
+
export const DisplayLink = t.object({
|
|
55
|
+
label: t.string(),
|
|
56
|
+
url: t.string(),
|
|
57
|
+
}, open);
|
|
58
|
+
export const Display = t.object({
|
|
59
|
+
title: t.optional(t.string()),
|
|
60
|
+
ref: t.optional(t.string()),
|
|
61
|
+
requester: t.optional(t.string()),
|
|
62
|
+
links: t.optional(t.array(DisplayLink)),
|
|
63
|
+
}, open);
|
|
64
|
+
export const Work = t.object({
|
|
65
|
+
id: t.string(),
|
|
66
|
+
kind: t.string(),
|
|
67
|
+
scope_id: t.string(),
|
|
68
|
+
state: t.string(),
|
|
69
|
+
correlation_keys: t.nullable(t.array(Key)),
|
|
70
|
+
context: Payload,
|
|
71
|
+
parent_id: t.optional(t.string()),
|
|
72
|
+
display: t.optional(Display),
|
|
73
|
+
// The executor of the Work's latest attempt, when recorded.
|
|
74
|
+
latest_executor: t.optional(t.string()),
|
|
75
|
+
revision: t.integer(),
|
|
76
|
+
created_at: t.string(),
|
|
77
|
+
updated_at: t.string(),
|
|
78
|
+
}, open);
|
|
79
|
+
/** One Event for a Work that no attempt of it has read yet: queued, or accepted and not yet routed (unrouted). */
|
|
80
|
+
export const PendingInput = t.object({
|
|
81
|
+
event_id: t.string(),
|
|
82
|
+
sequence: t.integer(),
|
|
83
|
+
type: t.string(),
|
|
84
|
+
binding: t.optional(t.string()),
|
|
85
|
+
unrouted: t.optional(t.boolean()),
|
|
86
|
+
}, open);
|
|
87
|
+
export const LeaseRef = t.object({
|
|
88
|
+
execution_id: t.string(),
|
|
89
|
+
owner: t.string(),
|
|
90
|
+
epoch: t.integer(),
|
|
91
|
+
}, open);
|
|
92
|
+
/** The authority an operation call runs under: its scope, Work and grant. */
|
|
93
|
+
export const Authority = t.object({
|
|
94
|
+
scope_id: t.string(),
|
|
95
|
+
work_id: t.string(),
|
|
96
|
+
execution_id: t.string(),
|
|
97
|
+
lease: LeaseRef,
|
|
98
|
+
expires_at: t.string(),
|
|
99
|
+
operations: t.optional(t.array(t.string())),
|
|
100
|
+
event_types: t.optional(t.array(t.string())),
|
|
101
|
+
trigger_id: t.optional(t.string()),
|
|
102
|
+
// The connection the execution's binding names, whose secrets the operation may resolve.
|
|
103
|
+
connection: t.optional(t.string()),
|
|
104
|
+
// The kinds of child Work the execution may ask for, each with what to ask it for.
|
|
105
|
+
work_kinds: t.optional(t.array(t.object({ kind: t.string(), description: t.optional(t.string()) }, open))),
|
|
106
|
+
}, open);
|
|
107
|
+
// Lifecycle.
|
|
108
|
+
export const HostInfo = t.object({
|
|
109
|
+
name: t.string(),
|
|
110
|
+
version: t.string(),
|
|
111
|
+
}, open);
|
|
112
|
+
export const InitializeParams = t.object({
|
|
113
|
+
protocol_versions: t.nullable(t.array(t.integer())),
|
|
114
|
+
host: HostInfo,
|
|
115
|
+
state_dir: t.string(),
|
|
116
|
+
// The state directories of the container provider types the
|
|
117
|
+
// extension declares, by type.
|
|
118
|
+
container_dirs: t.optional(t.record(t.string())),
|
|
119
|
+
// The host's container label (extension.ContainerLabelHost).
|
|
120
|
+
container_host: t.optional(t.string()),
|
|
121
|
+
// Labels the host made containers under before: listed as the host's
|
|
122
|
+
// too, never put on a new container.
|
|
123
|
+
container_former_hosts: t.optional(t.array(t.string())),
|
|
124
|
+
// The state directories of the executors the extension declares, by
|
|
125
|
+
// name: an executor keeps its runs under its own.
|
|
126
|
+
executor_dirs: t.optional(t.record(t.string())),
|
|
127
|
+
// The state directories of the resource provider types the extension
|
|
128
|
+
// declares, by type: a provider keeps its leases and workspaces there.
|
|
129
|
+
resource_dirs: t.optional(t.record(t.string())),
|
|
130
|
+
// The directory of the operator's config file, against which a
|
|
131
|
+
// relative path in a config object resolves ("" without a file).
|
|
132
|
+
config_dir: t.optional(t.string()),
|
|
133
|
+
}, open);
|
|
134
|
+
export const InitializeResult = t.object({
|
|
135
|
+
protocol_version: t.integer(),
|
|
136
|
+
manifest: t.any(),
|
|
137
|
+
}, open);
|
|
138
|
+
export const ConnectionEntry = t.object({
|
|
139
|
+
id: t.string(),
|
|
140
|
+
type: t.string(),
|
|
141
|
+
config: t.optional(t.any()),
|
|
142
|
+
secrets: t.optional(t.array(t.string())),
|
|
143
|
+
}, open);
|
|
144
|
+
/** One configured scope entry of one of the extension's types. */
|
|
145
|
+
export const ConfigEntry = t.object({
|
|
146
|
+
scope_id: t.string(),
|
|
147
|
+
type: t.string(),
|
|
148
|
+
config: t.optional(t.any()),
|
|
149
|
+
secrets: t.optional(t.array(t.string())),
|
|
150
|
+
name: t.optional(t.string()),
|
|
151
|
+
connection: t.optional(ConnectionEntry),
|
|
152
|
+
binding_connections: t.optional(t.array(ConnectionEntry)),
|
|
153
|
+
}, open);
|
|
154
|
+
export const KVState = t.object({
|
|
155
|
+
stored: t.integer(),
|
|
156
|
+
declared: t.integer(),
|
|
157
|
+
}, open);
|
|
158
|
+
/** One binding's container: its scope and name, the provider and the binding's whole container config. */
|
|
159
|
+
export const ContainerUse = t.object({
|
|
160
|
+
scope_id: t.string(),
|
|
161
|
+
binding: t.string(),
|
|
162
|
+
provider: t.string(),
|
|
163
|
+
config: t.any(),
|
|
164
|
+
}, open);
|
|
165
|
+
export const ConfigureParams = t.object({
|
|
166
|
+
generation: t.string(),
|
|
167
|
+
entries: t.optional(t.array(ConfigEntry)),
|
|
168
|
+
disabled: t.optional(t.array(ConfigEntry)),
|
|
169
|
+
public_url: t.optional(t.string()),
|
|
170
|
+
dry_run: t.optional(t.boolean()),
|
|
171
|
+
kv: KVState,
|
|
172
|
+
// The enabled scopes' bindings whose container provider is one the
|
|
173
|
+
// extension declares, in config order.
|
|
174
|
+
containers: t.optional(t.array(ContainerUse)),
|
|
175
|
+
}, open);
|
|
176
|
+
export const ValidateParams = t.object({
|
|
177
|
+
kind: t.string(),
|
|
178
|
+
type: t.string(),
|
|
179
|
+
config: t.optional(t.any()),
|
|
180
|
+
secret_names: t.optional(t.array(t.string())),
|
|
181
|
+
// The resource mode the binding's executor requests, for kind resource_sandbox only ("" for the config's default).
|
|
182
|
+
mode: t.optional(t.string()),
|
|
183
|
+
// For kind executor_folder only: the included folder a binding comes from, and whether it has a resource.
|
|
184
|
+
folder: t.optional(t.string()),
|
|
185
|
+
resource: t.optional(t.boolean()),
|
|
186
|
+
}, open);
|
|
187
|
+
// Operations, tasks and checks.
|
|
188
|
+
export const OperationParams = t.object({
|
|
189
|
+
operation: t.string(),
|
|
190
|
+
authority: Authority,
|
|
191
|
+
input: Payload,
|
|
192
|
+
request_id: t.optional(t.string()),
|
|
193
|
+
}, open);
|
|
194
|
+
export const OperationResult = t.object({
|
|
195
|
+
output: Payload,
|
|
196
|
+
}, open);
|
|
197
|
+
export const TaskRunParams = t.object({
|
|
198
|
+
task: t.string(),
|
|
199
|
+
}, open);
|
|
200
|
+
/** What runs a sleeping task before its time. */
|
|
201
|
+
export const TaskWake = t.object({
|
|
202
|
+
families: t.optional(t.array(t.string())),
|
|
203
|
+
work: t.optional(t.boolean()),
|
|
204
|
+
}, open);
|
|
205
|
+
/** What a task says about its next run; empty keeps its declared interval. */
|
|
206
|
+
export const TaskRunResult = t.object({
|
|
207
|
+
next_run_at: t.optional(t.string()),
|
|
208
|
+
wake: t.optional(TaskWake),
|
|
209
|
+
}, open);
|
|
210
|
+
export const CheckRunParams = t.object({
|
|
211
|
+
check: t.string(),
|
|
212
|
+
deep: t.optional(t.boolean()),
|
|
213
|
+
config: t.any(),
|
|
214
|
+
}, open);
|
|
215
|
+
export const CheckRunResult = t.object({
|
|
216
|
+
ok: t.boolean(),
|
|
217
|
+
detail: t.optional(t.string()),
|
|
218
|
+
status: t.optional(t.string()),
|
|
219
|
+
code: t.optional(t.string()),
|
|
220
|
+
items: t.optional(t.array(t.string())),
|
|
221
|
+
}, open);
|
|
222
|
+
// Extension-to-host calls.
|
|
223
|
+
export const KVGetParams = t.object({
|
|
224
|
+
namespace: t.string(),
|
|
225
|
+
key: t.string(),
|
|
226
|
+
}, open);
|
|
227
|
+
export const KVEntry = t.object({
|
|
228
|
+
key: t.string(),
|
|
229
|
+
value: t.nullable(t.string()),
|
|
230
|
+
version: t.string(),
|
|
231
|
+
}, open);
|
|
232
|
+
export const KVGetResult = t.object({
|
|
233
|
+
found: t.boolean(),
|
|
234
|
+
entry: KVEntry,
|
|
235
|
+
}, open);
|
|
236
|
+
export const KVListParams = t.object({
|
|
237
|
+
namespace: t.string(),
|
|
238
|
+
prefix: t.optional(t.string()),
|
|
239
|
+
}, open);
|
|
240
|
+
export const KVListResult = t.object({
|
|
241
|
+
entries: t.nullable(t.array(KVEntry)),
|
|
242
|
+
}, open);
|
|
243
|
+
/** A precondition: the key holds version, or is absent. */
|
|
244
|
+
export const KVCheck = t.object({
|
|
245
|
+
namespace: t.string(),
|
|
246
|
+
key: t.string(),
|
|
247
|
+
version: t.optional(t.string()),
|
|
248
|
+
absent: t.optional(t.boolean()),
|
|
249
|
+
}, open);
|
|
250
|
+
export const KVPut = t.object({
|
|
251
|
+
namespace: t.string(),
|
|
252
|
+
key: t.string(),
|
|
253
|
+
value: t.string(),
|
|
254
|
+
}, open);
|
|
255
|
+
export const KVDelete = t.object({
|
|
256
|
+
namespace: t.string(),
|
|
257
|
+
key: t.string(),
|
|
258
|
+
}, open);
|
|
259
|
+
export const KVCommitParams = t.object({
|
|
260
|
+
checks: t.optional(t.array(KVCheck)),
|
|
261
|
+
puts: t.optional(t.array(KVPut)),
|
|
262
|
+
deletes: t.optional(t.array(KVDelete)),
|
|
263
|
+
}, open);
|
|
264
|
+
/** A Work's position in a state.works order: the next page starts after it. */
|
|
265
|
+
export const WorkCursor = t.object({
|
|
266
|
+
at: t.string(),
|
|
267
|
+
id: t.string(),
|
|
268
|
+
}, open);
|
|
269
|
+
export const StateParams = t.object({
|
|
270
|
+
id: t.optional(t.string()),
|
|
271
|
+
scope_id: t.optional(t.string()),
|
|
272
|
+
after: t.optional(t.integer()),
|
|
273
|
+
limit: t.optional(t.integer()),
|
|
274
|
+
states: t.optional(t.array(t.string())),
|
|
275
|
+
kind: t.optional(t.string()),
|
|
276
|
+
parent_id: t.optional(t.string()),
|
|
277
|
+
sources: t.optional(t.array(t.string())),
|
|
278
|
+
executor: t.optional(t.string()),
|
|
279
|
+
correlation: t.optional(Key),
|
|
280
|
+
updated_since: t.optional(t.string()),
|
|
281
|
+
order: t.optional(t.string()),
|
|
282
|
+
cursor: t.optional(WorkCursor),
|
|
283
|
+
source: t.optional(t.string()),
|
|
284
|
+
delivery_id: t.optional(t.string()),
|
|
285
|
+
}, open);
|
|
286
|
+
export const EventAcceptParams = t.object({
|
|
287
|
+
scope_id: t.string(),
|
|
288
|
+
parent: t.string(),
|
|
289
|
+
event: Event,
|
|
290
|
+
checks: t.optional(t.array(KVCheck)),
|
|
291
|
+
records: t.optional(t.array(KVPut)),
|
|
292
|
+
deletes: t.optional(t.array(KVDelete)),
|
|
293
|
+
}, open);
|
|
294
|
+
export const EventAcceptResult = t.object({
|
|
295
|
+
event: AcceptedEvent,
|
|
296
|
+
// False when the host already had this Event: accepting is idempotent.
|
|
297
|
+
added: t.boolean(),
|
|
298
|
+
}, open);
|
|
299
|
+
export const SecretResolveParams = t.object({
|
|
300
|
+
scope_id: t.string(),
|
|
301
|
+
connection: t.optional(t.string()),
|
|
302
|
+
// A binding in the scope whose executor is one of the extension's own.
|
|
303
|
+
binding: t.optional(t.string()),
|
|
304
|
+
// The grant probe.serve carried, for the secrets of the connection that probe runs through.
|
|
305
|
+
probe_grant: t.optional(t.string()),
|
|
306
|
+
names: t.array(t.string()),
|
|
307
|
+
}, open);
|
|
308
|
+
export const SecretResolveResult = t.object({
|
|
309
|
+
values: t.nullable(t.record(t.string())),
|
|
310
|
+
}, open);
|
|
311
|
+
// credential.verify (protocol/surfaces.go): the host asks a credential
|
|
312
|
+
// verifier package about one bearer credential it didn't issue itself,
|
|
313
|
+
// offered to one trusted issuer. The package answers who it names, or
|
|
314
|
+
// refuses; the host decides what that subject may do.
|
|
315
|
+
export const CredentialVerifyParams = t.object({
|
|
316
|
+
// The declared verifier type.
|
|
317
|
+
type: t.string(),
|
|
318
|
+
// The host's ID for the trusted issuer.
|
|
319
|
+
issuer: t.string(),
|
|
320
|
+
// The issuer's config (schema core.auth.issuer.v1), as the admin gave it.
|
|
321
|
+
config: Payload,
|
|
322
|
+
// The bearer credential exactly as the request carried it.
|
|
323
|
+
token: t.string(),
|
|
324
|
+
}, open);
|
|
325
|
+
export const CredentialVerifyResult = t.object({
|
|
326
|
+
subject: t.string(),
|
|
327
|
+
groups: t.optional(t.array(t.string())),
|
|
328
|
+
// When the credential stops being valid (RFC 3339, required).
|
|
329
|
+
expires_at: t.string(),
|
|
330
|
+
}, open);
|
|
331
|
+
// container_provider.* (protocol/surfaces.go): the host binds a container
|
|
332
|
+
// provider package to an attempt (extension.BindContainer), which merges
|
|
333
|
+
// the protected set into the needs, pins the plan's digest and the
|
|
334
|
+
// container, and keeps stop, reconcile and removal; the package plans,
|
|
335
|
+
// creates and reports containers, and, as it declares, names the
|
|
336
|
+
// toolbelt forward's address, places launches and runs commands at the
|
|
337
|
+
// placement, collects an exited run's output, and reattaches a recovered
|
|
338
|
+
// run.
|
|
339
|
+
export const ResourceOwner = t.object({
|
|
340
|
+
scope_id: t.string(),
|
|
341
|
+
work_id: t.string(),
|
|
342
|
+
execution_id: t.string(),
|
|
343
|
+
}, open);
|
|
344
|
+
export const SandboxNeeds = t.object({
|
|
345
|
+
read: t.optional(t.array(t.string())),
|
|
346
|
+
write: t.optional(t.array(t.string())),
|
|
347
|
+
read_only: t.optional(t.array(t.string())),
|
|
348
|
+
deny: t.optional(t.array(t.string())),
|
|
349
|
+
hosts: t.optional(t.array(t.string())),
|
|
350
|
+
sockets: t.optional(t.array(t.string())),
|
|
351
|
+
}, open);
|
|
352
|
+
export const SandboxLaunch = t.object({
|
|
353
|
+
argv: t.nullable(t.array(t.string())),
|
|
354
|
+
dir: t.optional(t.string()),
|
|
355
|
+
env: t.optional(t.array(t.string())),
|
|
356
|
+
wrapper_env: t.optional(t.array(t.string())),
|
|
357
|
+
run_dir: t.optional(t.string()),
|
|
358
|
+
secrets: t.optional(t.array(t.string())),
|
|
359
|
+
tty: t.optional(t.boolean()),
|
|
360
|
+
}, open);
|
|
361
|
+
/** One attempt's host-set paths (extension.SandboxPaths). */
|
|
362
|
+
export const SandboxPaths = t.object({
|
|
363
|
+
workspace: t.optional(t.string()),
|
|
364
|
+
run: t.optional(t.string()),
|
|
365
|
+
toolbelt: t.optional(t.string()),
|
|
366
|
+
records: t.optional(t.string()),
|
|
367
|
+
home: t.optional(t.string()),
|
|
368
|
+
// Set when the workspace is at the launch's site, not on the host.
|
|
369
|
+
site: t.optional(t.string()),
|
|
370
|
+
}, open);
|
|
371
|
+
export const ContainerRef = t.object({
|
|
372
|
+
id: t.string(),
|
|
373
|
+
labels: t.optional(t.record(t.string())),
|
|
374
|
+
}, open);
|
|
375
|
+
export const ContainerState = t.object({
|
|
376
|
+
ref: ContainerRef,
|
|
377
|
+
daemon: t.optional(t.string()),
|
|
378
|
+
image: t.optional(t.string()),
|
|
379
|
+
running: t.optional(t.boolean()),
|
|
380
|
+
gone: t.optional(t.boolean()),
|
|
381
|
+
exit_code: t.optional(t.integer()),
|
|
382
|
+
// RFC 3339; left out until the container has started.
|
|
383
|
+
started_at: t.optional(t.string()),
|
|
384
|
+
mounts: t.optional(t.array(t.string())),
|
|
385
|
+
}, open);
|
|
386
|
+
export const ContainerPlan = t.object({
|
|
387
|
+
image: t.string(),
|
|
388
|
+
// The host computes the digest itself from image and data.
|
|
389
|
+
digest: t.optional(t.string()),
|
|
390
|
+
summary: t.optional(t.string()),
|
|
391
|
+
data: Payload,
|
|
392
|
+
}, open);
|
|
393
|
+
export const ContainerCreated = t.object({
|
|
394
|
+
ref: ContainerRef,
|
|
395
|
+
daemon: t.optional(t.string()),
|
|
396
|
+
argv: t.nullable(t.array(t.string())),
|
|
397
|
+
env: t.optional(t.array(t.string())),
|
|
398
|
+
// The provider's own record of the container, which the host pins and
|
|
399
|
+
// hands back to container_provider.reattach.
|
|
400
|
+
record: t.optional(Payload),
|
|
401
|
+
}, open);
|
|
402
|
+
/** A segment's pinned container (extension.ContainerPin). */
|
|
403
|
+
export const ContainerPin = t.object({
|
|
404
|
+
provider: t.optional(t.string()),
|
|
405
|
+
digest: t.string(),
|
|
406
|
+
summary: t.optional(t.string()),
|
|
407
|
+
image: t.string(),
|
|
408
|
+
daemon: t.string(),
|
|
409
|
+
id: t.string(),
|
|
410
|
+
run: t.string(),
|
|
411
|
+
at: t.string(),
|
|
412
|
+
workspace: t.optional(t.string()),
|
|
413
|
+
site: t.optional(t.string()),
|
|
414
|
+
cpus: t.optional(t.number()),
|
|
415
|
+
memory: t.optional(t.string()),
|
|
416
|
+
paths: t.optional(SandboxPaths),
|
|
417
|
+
token_file: t.optional(t.string()),
|
|
418
|
+
record: t.optional(Payload),
|
|
419
|
+
instance: t.optional(t.string()),
|
|
420
|
+
}, open);
|
|
421
|
+
export const ContainerProviderPlanParams = t.object({
|
|
422
|
+
type: t.string(),
|
|
423
|
+
owner: ResourceOwner,
|
|
424
|
+
// The binding's whole container config (schema open-conduit.container.v1).
|
|
425
|
+
config: Payload,
|
|
426
|
+
paths: SandboxPaths,
|
|
427
|
+
needs: SandboxNeeds,
|
|
428
|
+
launch: SandboxLaunch,
|
|
429
|
+
// Where a provider declared with place placed the execution.
|
|
430
|
+
placement: t.optional(t.string()),
|
|
431
|
+
}, open);
|
|
432
|
+
export const ContainerProviderCreateParams = t.object({
|
|
433
|
+
type: t.string(),
|
|
434
|
+
plan: ContainerPlan,
|
|
435
|
+
labels: t.nullable(t.record(t.string())),
|
|
436
|
+
}, open);
|
|
437
|
+
/** Names one container: signal, stop, inspect, remove and collect. */
|
|
438
|
+
export const ContainerProviderRefParams = t.object({
|
|
439
|
+
type: t.string(),
|
|
440
|
+
ref: ContainerRef,
|
|
441
|
+
signal: t.optional(t.string()),
|
|
442
|
+
grace_millis: t.optional(t.integer()),
|
|
443
|
+
}, open);
|
|
444
|
+
export const ContainerProviderListParams = t.object({
|
|
445
|
+
type: t.string(),
|
|
446
|
+
// An owner with no execution_id lists every container of the host.
|
|
447
|
+
owner: ResourceOwner,
|
|
448
|
+
}, open);
|
|
449
|
+
export const ContainerList = t.object({
|
|
450
|
+
containers: t.array(ContainerState),
|
|
451
|
+
}, open);
|
|
452
|
+
export const ContainerProviderForwardParams = t.object({
|
|
453
|
+
type: t.string(),
|
|
454
|
+
config: Payload,
|
|
455
|
+
}, open);
|
|
456
|
+
export const ContainerForward = t.object({
|
|
457
|
+
// A literal loopback or private IP; empty when the provider's
|
|
458
|
+
// containers reach the toolbelt's socket itself.
|
|
459
|
+
address: t.optional(t.string()),
|
|
460
|
+
}, open);
|
|
461
|
+
export const ContainerProviderPlaceParams = t.object({
|
|
462
|
+
type: t.string(),
|
|
463
|
+
owner: ResourceOwner,
|
|
464
|
+
config: Payload,
|
|
465
|
+
// The placement the Work last ran at.
|
|
466
|
+
prefer: t.optional(t.string()),
|
|
467
|
+
}, open);
|
|
468
|
+
export const Placement = t.object({
|
|
469
|
+
id: t.string(),
|
|
470
|
+
daemon: t.string(),
|
|
471
|
+
summary: t.optional(t.string()),
|
|
472
|
+
}, open);
|
|
473
|
+
/** A command to run at a placement; stdin, like the result's output, is base64. */
|
|
474
|
+
export const SiteCommand = t.object({
|
|
475
|
+
argv: t.nullable(t.array(t.string())),
|
|
476
|
+
dir: t.optional(t.string()),
|
|
477
|
+
env: t.optional(t.array(t.string())),
|
|
478
|
+
stdin: t.optional(t.string()),
|
|
479
|
+
timeout_millis: t.optional(t.integer()),
|
|
480
|
+
toolbelt: t.optional(t.string()),
|
|
481
|
+
token_file: t.optional(t.string()),
|
|
482
|
+
}, open);
|
|
483
|
+
export const SiteResult = t.object({
|
|
484
|
+
exit_code: t.integer(),
|
|
485
|
+
stdout: t.optional(t.string()),
|
|
486
|
+
stderr: t.optional(t.string()),
|
|
487
|
+
truncated: t.optional(t.boolean()),
|
|
488
|
+
}, open);
|
|
489
|
+
export const ContainerProviderSiteRunParams = t.object({
|
|
490
|
+
type: t.string(),
|
|
491
|
+
placement: t.string(),
|
|
492
|
+
command: SiteCommand,
|
|
493
|
+
}, open);
|
|
494
|
+
export const ContainerProviderReattachParams = t.object({
|
|
495
|
+
type: t.string(),
|
|
496
|
+
ref: ContainerRef,
|
|
497
|
+
pin: ContainerPin,
|
|
498
|
+
// This host's paths for the run.
|
|
499
|
+
paths: SandboxPaths,
|
|
500
|
+
token_file: t.optional(t.string()),
|
|
501
|
+
// Whether this host is the one that launched the run.
|
|
502
|
+
same_host: t.optional(t.boolean()),
|
|
503
|
+
}, open);
|
|
504
|
+
// secret.serve, secret.store and secret.delete (protocol/surfaces.go): the
|
|
505
|
+
// host asks a secret provider package for the value a reference of a
|
|
506
|
+
// scheme it declares names, and a writable scheme's package to store or
|
|
507
|
+
// remove one. A result carries the value or reference, or a safe refusal
|
|
508
|
+
// code, never both.
|
|
509
|
+
export const SecretServeParams = t.object({
|
|
510
|
+
scheme: t.string(),
|
|
511
|
+
// The reference text after "<scheme>:", as the operator wrote it.
|
|
512
|
+
reference: t.string(),
|
|
513
|
+
}, open);
|
|
514
|
+
export const SecretServeResult = t.object({
|
|
515
|
+
value: t.optional(t.string()),
|
|
516
|
+
code: t.optional(t.string()),
|
|
517
|
+
}, open);
|
|
518
|
+
export const SecretStoreParams = t.object({
|
|
519
|
+
scheme: t.string(),
|
|
520
|
+
// The operator's name for the value in the daemon's secret store.
|
|
521
|
+
name: t.string(),
|
|
522
|
+
value: t.string(),
|
|
523
|
+
// The operator's opaque config for the scheme's store (settings.secret_store.config).
|
|
524
|
+
config: t.optional(t.any()),
|
|
525
|
+
// The secret store's stable identity: every host sharing one installation's state has the same.
|
|
526
|
+
owner: t.string(),
|
|
527
|
+
}, open);
|
|
528
|
+
export const SecretStoreResult = t.object({
|
|
529
|
+
reference: t.optional(t.string()),
|
|
530
|
+
code: t.optional(t.string()),
|
|
531
|
+
}, open);
|
|
532
|
+
export const SecretDeleteParams = t.object({
|
|
533
|
+
scheme: t.string(),
|
|
534
|
+
reference: t.string(),
|
|
535
|
+
owner: t.string(),
|
|
536
|
+
}, open);
|
|
537
|
+
export const SecretDeleteResult = t.object({
|
|
538
|
+
code: t.optional(t.string()),
|
|
539
|
+
}, open);
|
|
540
|
+
export const ArtifactCreateParams = t.object({
|
|
541
|
+
media_type: t.string(),
|
|
542
|
+
}, open);
|
|
543
|
+
export const ArtifactCreateResult = t.object({
|
|
544
|
+
writer: t.string(),
|
|
545
|
+
}, open);
|
|
546
|
+
export const ArtifactWriteParams = t.object({
|
|
547
|
+
writer: t.string(),
|
|
548
|
+
chunk: t.string(),
|
|
549
|
+
}, open);
|
|
550
|
+
export const ArtifactTarget = t.object({
|
|
551
|
+
writer: t.string(),
|
|
552
|
+
}, open);
|
|
553
|
+
export const ArtifactRef = t.object({
|
|
554
|
+
id: t.string(),
|
|
555
|
+
size: t.integer(),
|
|
556
|
+
media_type: t.optional(t.string()),
|
|
557
|
+
// The content's SHA-256; return the ref artifact.commit gave unchanged.
|
|
558
|
+
sha256: t.optional(t.string()),
|
|
559
|
+
}, open);
|
|
560
|
+
// backup_destination.* (protocol/surfaces.go): the host stores a backup
|
|
561
|
+
// bundle's files with a package's destination and fetches them back, a
|
|
562
|
+
// file at a time in chunks of at most MaxChunkBytes. Chunks are base64.
|
|
563
|
+
export const BackupTargetParams = t.object({
|
|
564
|
+
// The declared destination type.
|
|
565
|
+
type: t.string(),
|
|
566
|
+
// The operator's name for the destination.
|
|
567
|
+
name: t.string(),
|
|
568
|
+
// Its config (schema core.config.backup_destination.v1), as the operator wrote it.
|
|
569
|
+
config: Payload,
|
|
570
|
+
}, open);
|
|
571
|
+
export const BackupWriteParams = t.object({
|
|
572
|
+
target: BackupTargetParams,
|
|
573
|
+
bundle: t.string(),
|
|
574
|
+
path: t.string(),
|
|
575
|
+
// The whole file's size.
|
|
576
|
+
size: t.integer(),
|
|
577
|
+
// The host's ID for this put.
|
|
578
|
+
upload: t.string(),
|
|
579
|
+
offset: t.integer(),
|
|
580
|
+
chunk: t.optional(t.string()),
|
|
581
|
+
// The last chunk: the answer says the file is stored.
|
|
582
|
+
final: t.optional(t.boolean()),
|
|
583
|
+
}, open);
|
|
584
|
+
export const BackupAbortParams = t.object({
|
|
585
|
+
upload: t.string(),
|
|
586
|
+
}, open);
|
|
587
|
+
export const BackupListParams = t.object({
|
|
588
|
+
target: BackupTargetParams,
|
|
589
|
+
}, open);
|
|
590
|
+
export const BackupListResult = t.object({
|
|
591
|
+
bundles: t.nullable(t.array(t.string())),
|
|
592
|
+
}, open);
|
|
593
|
+
export const BackupFilesParams = t.object({
|
|
594
|
+
target: BackupTargetParams,
|
|
595
|
+
bundle: t.string(),
|
|
596
|
+
}, open);
|
|
597
|
+
export const BackupFileEntry = t.object({
|
|
598
|
+
path: t.string(),
|
|
599
|
+
size: t.integer(),
|
|
600
|
+
}, open);
|
|
601
|
+
export const BackupFilesResult = t.object({
|
|
602
|
+
files: t.nullable(t.array(BackupFileEntry)),
|
|
603
|
+
}, open);
|
|
604
|
+
export const BackupReadParams = t.object({
|
|
605
|
+
target: BackupTargetParams,
|
|
606
|
+
bundle: t.string(),
|
|
607
|
+
path: t.string(),
|
|
608
|
+
offset: t.integer(),
|
|
609
|
+
// At most MaxChunkBytes.
|
|
610
|
+
length: t.integer(),
|
|
611
|
+
}, open);
|
|
612
|
+
export const BackupReadResult = t.object({
|
|
613
|
+
chunk: t.optional(t.string()),
|
|
614
|
+
// The part reaches the file's end.
|
|
615
|
+
eof: t.optional(t.boolean()),
|
|
616
|
+
}, open);
|
|
617
|
+
// The artifact provider protocol (protocol/artifactstore): not the
|
|
618
|
+
// extension protocol, but a store process the state directory's
|
|
619
|
+
// storage.json names, which the host starts and speaks JSON-RPC to.
|
|
620
|
+
// Chunks are base64, at most ArtifactStoreChunk bytes.
|
|
621
|
+
export const ArtifactStoreInitializeParams = t.object({
|
|
622
|
+
version: t.integer(),
|
|
623
|
+
// The store to open, in the provider's own terms.
|
|
624
|
+
location: t.string(),
|
|
625
|
+
}, open);
|
|
626
|
+
export const ArtifactStoreInitializeResult = t.object({
|
|
627
|
+
version: t.integer(),
|
|
628
|
+
// Whether another host can reach what the store holds; left out, no claim either way.
|
|
629
|
+
shared: t.optional(t.boolean()),
|
|
630
|
+
}, open);
|
|
631
|
+
export const ArtifactStoreRef = t.object({
|
|
632
|
+
id: t.string(),
|
|
633
|
+
size: t.integer(),
|
|
634
|
+
media_type: t.string(),
|
|
635
|
+
sha256: t.optional(t.string()),
|
|
636
|
+
}, open);
|
|
637
|
+
export const ArtifactStoreCreateParams = t.object({
|
|
638
|
+
media_type: t.string(),
|
|
639
|
+
}, open);
|
|
640
|
+
export const ArtifactStoreHandle = t.object({
|
|
641
|
+
handle: t.string(),
|
|
642
|
+
}, open);
|
|
643
|
+
export const ArtifactStoreChunkParams = t.object({
|
|
644
|
+
handle: t.string(),
|
|
645
|
+
chunk: t.nullable(t.string()),
|
|
646
|
+
}, open);
|
|
647
|
+
export const ArtifactStoreReadResult = t.object({
|
|
648
|
+
chunk: t.optional(t.string()),
|
|
649
|
+
eof: t.optional(t.boolean()),
|
|
650
|
+
}, open);
|
|
651
|
+
export const ArtifactStoreClaimParams = t.object({
|
|
652
|
+
// The claiming installation's ID.
|
|
653
|
+
installation: t.string(),
|
|
654
|
+
// Replace another installation's claim (an operator's forced takeover).
|
|
655
|
+
take_over: t.optional(t.boolean()),
|
|
656
|
+
}, open);
|
|
657
|
+
export const ArtifactStoreCheckOwnerParams = t.object({
|
|
658
|
+
installation: t.string(),
|
|
659
|
+
}, open);
|
|
660
|
+
export const ArtifactStoreListParams = t.object({
|
|
661
|
+
after: t.optional(t.string()),
|
|
662
|
+
limit: t.integer(),
|
|
663
|
+
}, open);
|
|
664
|
+
export const ArtifactStoreListItem = t.object({
|
|
665
|
+
ref: ArtifactStoreRef,
|
|
666
|
+
// When it was committed (RFC 3339).
|
|
667
|
+
published_at: t.string(),
|
|
668
|
+
}, open);
|
|
669
|
+
export const ArtifactStoreListResult = t.object({
|
|
670
|
+
items: t.nullable(t.array(ArtifactStoreListItem)),
|
|
671
|
+
}, open);
|
|
672
|
+
// Ingress: sources, deliveries, push and reconcile (protocol.Source and on).
|
|
673
|
+
/** A source's namespace (its correlation keys' source) in a scope. */
|
|
674
|
+
export const Source = t.object({
|
|
675
|
+
namespace: t.string(),
|
|
676
|
+
scope_id: t.string(),
|
|
677
|
+
}, open);
|
|
678
|
+
/** One delivery of a push (a webhook's body); body is base64. */
|
|
679
|
+
export const Delivery = t.object({
|
|
680
|
+
id: t.string(),
|
|
681
|
+
received_at: t.string(),
|
|
682
|
+
content_type: t.optional(t.string()),
|
|
683
|
+
body: t.optional(t.string()),
|
|
684
|
+
}, open);
|
|
685
|
+
export const EventFamily = t.object({
|
|
686
|
+
type: t.string(),
|
|
687
|
+
re_derivable: t.boolean(),
|
|
688
|
+
loss: t.optional(t.string()),
|
|
689
|
+
}, open);
|
|
690
|
+
/** What a source holds of one object now: its ID, version and the Event it maps to. */
|
|
691
|
+
export const Observation = t.object({
|
|
692
|
+
id: t.string(),
|
|
693
|
+
version: t.string(),
|
|
694
|
+
event: Event,
|
|
695
|
+
}, open);
|
|
696
|
+
export const PushResult = t.object({
|
|
697
|
+
observations: t.optional(t.array(Observation)),
|
|
698
|
+
// Only for families declared not re-derivable.
|
|
699
|
+
events: t.optional(t.array(Event)),
|
|
700
|
+
}, open);
|
|
701
|
+
export const Scan = t.object({
|
|
702
|
+
source: Source,
|
|
703
|
+
scan_id: t.optional(t.string()),
|
|
704
|
+
cursor: t.optional(t.string()),
|
|
705
|
+
checkpoint: t.optional(t.string()),
|
|
706
|
+
}, open);
|
|
707
|
+
/**
|
|
708
|
+
* One page of a reconcile. complete certifies the scan covered the whole
|
|
709
|
+
* source across its pages; false with no next_cursor is a partial scan,
|
|
710
|
+
* never proof that anything is gone. not_before (an RFC 3339 time) says the
|
|
711
|
+
* provider can't answer this page yet, a rate limit say: such a page has no
|
|
712
|
+
* observations, is not complete and repeats the scan's cursor as next_cursor,
|
|
713
|
+
* and the host asks for it again at that time without counting a failure.
|
|
714
|
+
*/
|
|
715
|
+
export const Snapshot = t.object({
|
|
716
|
+
scan_id: t.string(),
|
|
717
|
+
observations: t.optional(t.array(Observation)),
|
|
718
|
+
next_cursor: t.optional(t.string()),
|
|
719
|
+
complete: t.boolean(),
|
|
720
|
+
checkpoint: t.optional(t.string()),
|
|
721
|
+
not_before: t.optional(t.string()),
|
|
722
|
+
}, open);
|
|
723
|
+
/** A source an entry registers at configure. */
|
|
724
|
+
export const SourceDecl = t.object({
|
|
725
|
+
name: t.string(),
|
|
726
|
+
source: Source,
|
|
727
|
+
interval_seconds: t.integer(),
|
|
728
|
+
families: t.array(EventFamily),
|
|
729
|
+
}, open);
|
|
730
|
+
export const ConfigureResult = t.object({
|
|
731
|
+
sources: t.optional(t.array(SourceDecl)),
|
|
732
|
+
// Each under /<name>/; a path covers the paths beneath it.
|
|
733
|
+
webhook_paths: t.optional(t.array(t.string())),
|
|
734
|
+
kv_version: t.integer(),
|
|
735
|
+
}, open);
|
|
736
|
+
export const IngressPushParams = t.object({
|
|
737
|
+
name: t.string(),
|
|
738
|
+
source: Source,
|
|
739
|
+
delivery: Delivery,
|
|
740
|
+
}, open);
|
|
741
|
+
export const IngressReconcileParams = t.object({
|
|
742
|
+
name: t.string(),
|
|
743
|
+
scan: Scan,
|
|
744
|
+
}, open);
|
|
745
|
+
export const IngressDeliverParams = t.object({
|
|
746
|
+
name: t.string(),
|
|
747
|
+
delivery: Delivery,
|
|
748
|
+
}, open);
|
|
749
|
+
/** A delivery's accepted Events; added[i] is false for one already accepted (a retry). */
|
|
750
|
+
export const IngressDeliverResult = t.object({
|
|
751
|
+
accepted: t.nullable(t.array(AcceptedEvent)),
|
|
752
|
+
added: t.nullable(t.array(t.boolean())),
|
|
753
|
+
}, open);
|
|
754
|
+
/** One HTTP request on a webhook path the extension registered; body is base64. */
|
|
755
|
+
export const WebhookHandleParams = t.object({
|
|
756
|
+
path: t.string(),
|
|
757
|
+
method: t.string(),
|
|
758
|
+
query: t.optional(t.string()),
|
|
759
|
+
header: t.optional(t.record(t.array(t.string()))),
|
|
760
|
+
body: t.optional(t.string()),
|
|
761
|
+
received_at: t.string(),
|
|
762
|
+
forward_id: t.optional(t.string()),
|
|
763
|
+
}, open);
|
|
764
|
+
export const WebhookHandleResult = t.object({
|
|
765
|
+
status: t.integer(),
|
|
766
|
+
header: t.optional(t.record(t.array(t.string()))),
|
|
767
|
+
body: t.optional(t.string()),
|
|
768
|
+
}, open);
|
|
769
|
+
// Routing.
|
|
770
|
+
export const Route = t.object({
|
|
771
|
+
name: t.string(),
|
|
772
|
+
handler: t.string(),
|
|
773
|
+
binding: t.string(),
|
|
774
|
+
active_policy: t.optional(t.string()),
|
|
775
|
+
config: Payload,
|
|
776
|
+
}, open);
|
|
777
|
+
/** A scope as an extension sees it: never its secret references. */
|
|
778
|
+
export const Scope = t.object({
|
|
779
|
+
id: t.string(),
|
|
780
|
+
name: t.string(),
|
|
781
|
+
parent_id: t.optional(t.string()),
|
|
782
|
+
bindings: t.optional(t.array(t.any())),
|
|
783
|
+
routes: t.optional(t.array(Route)),
|
|
784
|
+
config: Payload,
|
|
785
|
+
revision: t.integer(),
|
|
786
|
+
created_at: t.string(),
|
|
787
|
+
updated_at: t.string(),
|
|
788
|
+
}, open);
|
|
789
|
+
export const RouteInput = t.object({
|
|
790
|
+
event: AcceptedEvent,
|
|
791
|
+
scope: Scope,
|
|
792
|
+
work: t.optional(Work),
|
|
793
|
+
route: Route,
|
|
794
|
+
}, open);
|
|
795
|
+
/**
|
|
796
|
+
* A route's answer for one Event. On a match with no work, create_id and
|
|
797
|
+
* kind open new Work; attach_keys add correlation keys to it; display
|
|
798
|
+
* replaces what the Work shows. deliver is absent to queue the Event on
|
|
799
|
+
* the route's binding, "none" to only attach, "current" to queue it on the
|
|
800
|
+
* binding the Work runs on.
|
|
801
|
+
*/
|
|
802
|
+
export const RouteDecision = t.object({
|
|
803
|
+
match: t.boolean(),
|
|
804
|
+
create_id: t.optional(t.string()),
|
|
805
|
+
kind: t.optional(t.string()),
|
|
806
|
+
attach_keys: t.optional(t.array(Key)),
|
|
807
|
+
reason: t.optional(t.string()),
|
|
808
|
+
display: t.optional(Display),
|
|
809
|
+
context: t.optional(Payload),
|
|
810
|
+
grants: t.optional(t.array(t.string())),
|
|
811
|
+
successor: t.optional(t.boolean()),
|
|
812
|
+
deliver: t.optional(t.string()),
|
|
813
|
+
}, open);
|
|
814
|
+
/** A sample Event a route handler offers for a route trace (routes.decisions). */
|
|
815
|
+
export const RouteSample = t.object({
|
|
816
|
+
id: t.string(),
|
|
817
|
+
title: t.string(),
|
|
818
|
+
event: Event,
|
|
819
|
+
}, open);
|
|
820
|
+
export const RouteMatchParams = t.object({
|
|
821
|
+
handler: t.string(),
|
|
822
|
+
input: RouteInput,
|
|
823
|
+
}, open);
|
|
824
|
+
export const RouteSamplesParams = t.object({
|
|
825
|
+
handler: t.string(),
|
|
826
|
+
scope: Scope,
|
|
827
|
+
route: Route,
|
|
828
|
+
now: t.string(),
|
|
829
|
+
}, open);
|
|
830
|
+
export const RouteSamplesResult = t.object({
|
|
831
|
+
samples: t.array(RouteSample),
|
|
832
|
+
}, open);
|
|
833
|
+
export const WorkKindTriggerParams = t.object({
|
|
834
|
+
kind: t.string(),
|
|
835
|
+
inputs: t.nullable(t.array(Event)),
|
|
836
|
+
}, open);
|
|
837
|
+
export const WorkKindTriggerResult = t.object({
|
|
838
|
+
index: t.integer(),
|
|
839
|
+
}, open);
|
|
840
|
+
// Executors (protocol/wire.go, protocol/messages.go, protocol/surfaces.go):
|
|
841
|
+
// the host starts an attempt with executor.run (or adopts one with
|
|
842
|
+
// executor.recover, or carries one on with executor.resume), observes it
|
|
843
|
+
// through executor.wait on the handle the start returned, and drives it
|
|
844
|
+
// with the controls the executor declares. The attempt persists its
|
|
845
|
+
// continuity state through execution.persist_recovery, addressed by the run
|
|
846
|
+
// ID of the call that started it.
|
|
847
|
+
export const Lease = t.object({
|
|
848
|
+
owner: t.string(),
|
|
849
|
+
epoch: t.integer(),
|
|
850
|
+
expires_at: t.string(),
|
|
851
|
+
}, open);
|
|
852
|
+
/** How an attempt ended: completed, failed, waiting or handoff. */
|
|
853
|
+
export const Outcome = t.object({
|
|
854
|
+
kind: t.string(),
|
|
855
|
+
summary: t.optional(t.string()),
|
|
856
|
+
data: Payload,
|
|
857
|
+
}, open);
|
|
858
|
+
/** One attempt of a Work (domain.Execution). */
|
|
859
|
+
export const Execution = t.object({
|
|
860
|
+
id: t.string(),
|
|
861
|
+
work_id: t.string(),
|
|
862
|
+
executor_binding: t.string(),
|
|
863
|
+
executor: t.optional(t.string()),
|
|
864
|
+
attempt: t.integer(),
|
|
865
|
+
state: t.string(),
|
|
866
|
+
trigger_id: t.string(),
|
|
867
|
+
lease: Lease,
|
|
868
|
+
outcome: t.optional(Outcome),
|
|
869
|
+
artifacts: t.optional(t.array(ArtifactRef)),
|
|
870
|
+
// The artifacts the attempt's earlier turns published.
|
|
871
|
+
earlier_artifacts: t.optional(t.array(ArtifactRef)),
|
|
872
|
+
trace_id: t.optional(t.string()),
|
|
873
|
+
started_at: t.optional(t.string()),
|
|
874
|
+
finished_at: t.optional(t.string()),
|
|
875
|
+
revision: t.integer(),
|
|
876
|
+
created_at: t.string(),
|
|
877
|
+
updated_at: t.string(),
|
|
878
|
+
}, open);
|
|
879
|
+
/** What an attempt runs with: its binding's config and secrets, and the host's brokers and toolbelt (extension.ExecutionContext). */
|
|
880
|
+
export const ExecutionContext = t.object({
|
|
881
|
+
config: Payload,
|
|
882
|
+
secrets: t.optional(t.record(t.string())),
|
|
883
|
+
// The binding declares a resource provider: resource.acquire and
|
|
884
|
+
// resource.lookup under the run's ID reach it.
|
|
885
|
+
resources: t.optional(t.boolean()),
|
|
886
|
+
sandbox: t.optional(t.boolean()),
|
|
887
|
+
container: t.optional(t.boolean()),
|
|
888
|
+
container_home: t.optional(t.string()),
|
|
889
|
+
toolbelt_endpoint: t.optional(t.string()),
|
|
890
|
+
toolbelt_token: t.optional(t.string()),
|
|
891
|
+
// The host-kept file holding the current toolbelt token, which the host
|
|
892
|
+
// rotates on recovery: read it at each call rather than keeping a copy.
|
|
893
|
+
toolbelt_token_file: t.optional(t.string()),
|
|
894
|
+
toolbelt_dir: t.optional(t.string()),
|
|
895
|
+
playbook_dir: t.optional(t.string()),
|
|
896
|
+
env: t.optional(t.record(t.string())),
|
|
897
|
+
host_env: t.optional(t.record(t.string())),
|
|
898
|
+
}, open);
|
|
899
|
+
export const RunRequest = t.object({
|
|
900
|
+
work: Work,
|
|
901
|
+
execution: Execution,
|
|
902
|
+
trigger: Event,
|
|
903
|
+
// The acceptance-ordered batch, context preceding a wake included.
|
|
904
|
+
inputs: t.optional(t.array(Event)),
|
|
905
|
+
context: ExecutionContext,
|
|
906
|
+
}, open);
|
|
907
|
+
export const ExecutorRunParams = t.object({
|
|
908
|
+
executor: t.string(),
|
|
909
|
+
run_id: t.string(),
|
|
910
|
+
request: RunRequest,
|
|
911
|
+
// The persisted continuity state, for executor.recover and executor.resume.
|
|
912
|
+
state: t.optional(Payload),
|
|
913
|
+
}, open);
|
|
914
|
+
export const ExecutorRunResult = t.object({
|
|
915
|
+
handle: t.string(),
|
|
916
|
+
}, open);
|
|
917
|
+
export const ExecutorWaitParams = t.object({
|
|
918
|
+
executor: t.string(),
|
|
919
|
+
handle: t.string(),
|
|
920
|
+
}, open);
|
|
921
|
+
/** The target of executor.interrupt, inject, stop, forget, attach and live. */
|
|
922
|
+
export const ExecutorTargetParams = t.object({
|
|
923
|
+
executor: t.string(),
|
|
924
|
+
execution_id: t.optional(t.string()),
|
|
925
|
+
work_id: t.optional(t.string()),
|
|
926
|
+
epoch: t.optional(t.integer()),
|
|
927
|
+
event: t.optional(Event),
|
|
928
|
+
// executor.live's limit: at most the last tail bytes of each output.
|
|
929
|
+
tail: t.optional(t.integer()),
|
|
930
|
+
}, open);
|
|
931
|
+
export const PersistRecoveryParams = t.object({
|
|
932
|
+
run_id: t.string(),
|
|
933
|
+
state: Payload,
|
|
934
|
+
}, open);
|
|
935
|
+
/** What one segment of an attempt consumed, as its executor counts it (extension.Usage). */
|
|
936
|
+
export const Usage = t.object({
|
|
937
|
+
input_tokens: t.optional(t.integer()),
|
|
938
|
+
output_tokens: t.optional(t.integer()),
|
|
939
|
+
cached_tokens: t.optional(t.integer()),
|
|
940
|
+
cost: t.optional(t.number()),
|
|
941
|
+
currency: t.optional(t.string()),
|
|
942
|
+
// Amounts in named units ("usd", "minutes", ...) that budgets are charged in.
|
|
943
|
+
units: t.optional(t.record(t.number())),
|
|
944
|
+
// The executor's opaque description of what did the work.
|
|
945
|
+
attribution: t.optional(t.record(t.string())),
|
|
946
|
+
}, open);
|
|
947
|
+
// Telemetry: exporters (telemetry.export), metrics (telemetry.metrics) and
|
|
948
|
+
// the named telemetry events log (telemetry.capture, telemetry.sink).
|
|
949
|
+
/** What a lifecycle record is about: its Work, Event, Execution, scope, binding and trace (observability.Correlation). */
|
|
950
|
+
export const Correlation = t.object({
|
|
951
|
+
work_id: t.optional(t.string()),
|
|
952
|
+
event_id: t.optional(t.string()),
|
|
953
|
+
execution_id: t.optional(t.string()),
|
|
954
|
+
scope_id: t.optional(t.string()),
|
|
955
|
+
executor_binding: t.optional(t.string()),
|
|
956
|
+
trace_id: t.optional(t.string()),
|
|
957
|
+
}, open);
|
|
958
|
+
/** One lifecycle record of the host's telemetry pipeline (observability.Record). */
|
|
959
|
+
export const TelemetryRecord = t.object({
|
|
960
|
+
name: t.string(),
|
|
961
|
+
// An RFC 3339 time.
|
|
962
|
+
at: t.string(),
|
|
963
|
+
correlation: Correlation,
|
|
964
|
+
// A transition's states, from and to.
|
|
965
|
+
from: t.optional(t.string()),
|
|
966
|
+
to: t.optional(t.string()),
|
|
967
|
+
attributes: t.optional(t.record(t.string())),
|
|
968
|
+
usage: t.optional(Usage),
|
|
969
|
+
}, open);
|
|
970
|
+
/** One batch of lifecycle records for an exporter (telemetry.export). */
|
|
971
|
+
export const TelemetryExportParams = t.object({
|
|
972
|
+
records: t.nullable(t.array(TelemetryRecord)),
|
|
973
|
+
}, open);
|
|
974
|
+
/**
|
|
975
|
+
* One series of a Metric (observability.MetricPoint): value for a sum or
|
|
976
|
+
* gauge, and count, sum, bounds (explicit bucket upper bounds) and buckets
|
|
977
|
+
* (one more count than bounds) for a histogram.
|
|
978
|
+
*/
|
|
979
|
+
export const MetricPoint = t.object({
|
|
980
|
+
attributes: t.optional(t.record(t.string())),
|
|
981
|
+
// When a sum or histogram started accumulating (RFC 3339).
|
|
982
|
+
start: t.optional(t.string()),
|
|
983
|
+
time: t.string(),
|
|
984
|
+
value: t.optional(t.number()),
|
|
985
|
+
count: t.optional(t.integer()),
|
|
986
|
+
sum: t.optional(t.number()),
|
|
987
|
+
bounds: t.optional(t.array(t.number())),
|
|
988
|
+
buckets: t.optional(t.array(t.integer())),
|
|
989
|
+
min: t.optional(t.number()),
|
|
990
|
+
max: t.optional(t.number()),
|
|
991
|
+
}, open);
|
|
992
|
+
/**
|
|
993
|
+
* One instrument's data at one collection of the host's meter
|
|
994
|
+
* (observability.Metric). Sums and histograms are cumulative from each
|
|
995
|
+
* point's start; point attributes never carry an identifier.
|
|
996
|
+
*/
|
|
997
|
+
export const Metric = t.object({
|
|
998
|
+
name: t.string(),
|
|
999
|
+
description: t.optional(t.string()),
|
|
1000
|
+
unit: t.optional(t.string()),
|
|
1001
|
+
// "sum", "gauge" or "histogram"; monotonic marks a sum that only grows.
|
|
1002
|
+
kind: t.string(),
|
|
1003
|
+
monotonic: t.optional(t.boolean()),
|
|
1004
|
+
points: t.nullable(t.array(MetricPoint)),
|
|
1005
|
+
}, open);
|
|
1006
|
+
/** One collection of the host's meter (telemetry.metrics). */
|
|
1007
|
+
export const TelemetryMetricsParams = t.object({
|
|
1008
|
+
metrics: t.nullable(t.array(Metric)),
|
|
1009
|
+
}, open);
|
|
1010
|
+
/**
|
|
1011
|
+
* One named event of the host's telemetry events log: telemetry.capture
|
|
1012
|
+
* writes one and telemetry.sink hands one to an extension. scope_id is the
|
|
1013
|
+
* scope it belongs to, absent for one about the machine; properties never
|
|
1014
|
+
* carry it.
|
|
1015
|
+
*/
|
|
1016
|
+
export const TelemetryEvent = t.object({
|
|
1017
|
+
scope_id: t.optional(t.string()),
|
|
1018
|
+
name: t.string(),
|
|
1019
|
+
// An RFC 3339 time.
|
|
1020
|
+
at: t.string(),
|
|
1021
|
+
properties: t.optional(t.record(t.any())),
|
|
1022
|
+
}, open);
|
|
1023
|
+
// Run environments (run.environment).
|
|
1024
|
+
/** Asks for the extension's environment layer for one run of a Work in a scope that uses it. */
|
|
1025
|
+
export const RunEnvironmentParams = t.object({
|
|
1026
|
+
owner: ResourceOwner,
|
|
1027
|
+
// The connection the run's binding names.
|
|
1028
|
+
connection: t.optional(t.string()),
|
|
1029
|
+
// The run's executor binding.
|
|
1030
|
+
binding: t.optional(t.string()),
|
|
1031
|
+
// Where the host writes the result's files; absent when the run has no directory for them.
|
|
1032
|
+
files_dir: t.optional(t.string()),
|
|
1033
|
+
}, open);
|
|
1034
|
+
export const RunEnvironmentResult = t.object({
|
|
1035
|
+
env: t.optional(t.record(t.string())),
|
|
1036
|
+
// Files for the host to write into files_dir, by name.
|
|
1037
|
+
files: t.optional(t.record(t.string())),
|
|
1038
|
+
}, open);
|
|
1039
|
+
// The host's config service (config.*, permission config.read). The host
|
|
1040
|
+
// keeps config text behind handles and answers only copies with every
|
|
1041
|
+
// secret_refs value "[redacted]"; nothing here applies a configuration.
|
|
1042
|
+
/** The configuration now: its generation and hash, a handle on its file text, the text redacted, and the scopes from included folders. */
|
|
1043
|
+
export const ConfigBaseResult = t.object({
|
|
1044
|
+
generation: t.string(),
|
|
1045
|
+
hash: t.string(),
|
|
1046
|
+
handle: t.string(),
|
|
1047
|
+
text: t.string(),
|
|
1048
|
+
folders: t.optional(t.array(t.string())),
|
|
1049
|
+
}, open);
|
|
1050
|
+
/** One RFC 6902 edit (add, replace or remove) to the text behind handle. */
|
|
1051
|
+
export const ConfigEditParams = t.object({
|
|
1052
|
+
handle: t.string(),
|
|
1053
|
+
op: t.string(),
|
|
1054
|
+
pointer: t.string(),
|
|
1055
|
+
value: t.optional(t.any()),
|
|
1056
|
+
}, open);
|
|
1057
|
+
/** The candidate an edit built: its handle, its text redacted and the value the edit replaced, redacted. */
|
|
1058
|
+
export const ConfigEditResult = t.object({
|
|
1059
|
+
handle: t.string(),
|
|
1060
|
+
text: t.string(),
|
|
1061
|
+
before: t.optional(t.any()),
|
|
1062
|
+
}, open);
|
|
1063
|
+
export const ConfigHandleParams = t.object({
|
|
1064
|
+
handle: t.string(),
|
|
1065
|
+
}, open);
|
|
1066
|
+
/** One validation problem, as `config validate` prints it. */
|
|
1067
|
+
export const ConfigDiagnostic = t.object({
|
|
1068
|
+
path: t.string(),
|
|
1069
|
+
code: t.string(),
|
|
1070
|
+
message: t.string(),
|
|
1071
|
+
}, open);
|
|
1072
|
+
/** The candidate's hash when it is valid, its diagnostics when not. */
|
|
1073
|
+
export const ConfigValidateResult = t.object({
|
|
1074
|
+
hash: t.optional(t.string()),
|
|
1075
|
+
diagnostics: t.optional(t.array(ConfigDiagnostic)),
|
|
1076
|
+
}, open);
|
|
1077
|
+
/** Traces one of a scope's named samples against the candidate behind handle; with no sample it lists the scope's samples. */
|
|
1078
|
+
export const ConfigTraceParams = t.object({
|
|
1079
|
+
handle: t.string(),
|
|
1080
|
+
scope: t.string(),
|
|
1081
|
+
sample: t.optional(t.string()),
|
|
1082
|
+
}, open);
|
|
1083
|
+
export const ConfigTraceSample = t.object({
|
|
1084
|
+
id: t.string(),
|
|
1085
|
+
title: t.string(),
|
|
1086
|
+
}, open);
|
|
1087
|
+
/** What routing would do with the sample, route by route, or the trace's reason (error) when it can't run. */
|
|
1088
|
+
export const ConfigTraceResult = t.object({
|
|
1089
|
+
samples: t.optional(t.array(ConfigTraceSample)),
|
|
1090
|
+
sample: t.optional(t.string()),
|
|
1091
|
+
routes: t.optional(t.array(t.record(t.any()))),
|
|
1092
|
+
effect: t.optional(t.record(t.any())),
|
|
1093
|
+
error: t.optional(t.string()),
|
|
1094
|
+
}, open);
|
|
1095
|
+
// Config candidates (config.candidate, manifest config_candidate).
|
|
1096
|
+
export const ConfigCandidateParams = t.object({
|
|
1097
|
+
work: Work,
|
|
1098
|
+
}, open);
|
|
1099
|
+
/** One proposed change: an edit at a JSON pointer, its state and reason, the redacted value before and after, its problems and the actions that decide it. */
|
|
1100
|
+
export const CandidateChange = t.object({
|
|
1101
|
+
id: t.string(),
|
|
1102
|
+
op: t.string(),
|
|
1103
|
+
pointer: t.string(),
|
|
1104
|
+
state: t.string(),
|
|
1105
|
+
why: t.optional(t.string()),
|
|
1106
|
+
before: t.optional(t.any()),
|
|
1107
|
+
after: t.optional(t.any()),
|
|
1108
|
+
problems: t.optional(t.array(t.string())),
|
|
1109
|
+
approve: t.optional(t.string()),
|
|
1110
|
+
reject: t.optional(t.string()),
|
|
1111
|
+
}, open);
|
|
1112
|
+
export const ConfigCandidateResult = t.object({
|
|
1113
|
+
// False for a Work with nothing proposed.
|
|
1114
|
+
found: t.boolean(),
|
|
1115
|
+
handle: t.optional(t.string()),
|
|
1116
|
+
base_generation: t.optional(t.string()),
|
|
1117
|
+
hash: t.optional(t.string()),
|
|
1118
|
+
changes: t.optional(t.array(CandidateChange)),
|
|
1119
|
+
approve_all: t.optional(t.string()),
|
|
1120
|
+
validate: t.optional(t.string()),
|
|
1121
|
+
}, open);
|
|
1122
|
+
// Setup flows (setup.run, manifest setup): the extension drives the
|
|
1123
|
+
// operator through the setup.* callbacks while it runs, each quoting the
|
|
1124
|
+
// run's ID.
|
|
1125
|
+
export const SetupRunParams = t.object({
|
|
1126
|
+
run: t.string(),
|
|
1127
|
+
type: t.string(),
|
|
1128
|
+
args: t.optional(t.array(t.string())),
|
|
1129
|
+
// The config file's bytes, base64, when there is one.
|
|
1130
|
+
config: t.optional(t.string()),
|
|
1131
|
+
cwd: t.string(),
|
|
1132
|
+
state_dir: t.string(),
|
|
1133
|
+
dry_run: t.optional(t.boolean()),
|
|
1134
|
+
}, open);
|
|
1135
|
+
export const SetupRunResult = t.object({
|
|
1136
|
+
connections: t.optional(t.array(t.any())),
|
|
1137
|
+
scope: t.optional(t.any()),
|
|
1138
|
+
summary: t.optional(t.array(t.string())),
|
|
1139
|
+
next: t.optional(t.array(t.string())),
|
|
1140
|
+
}, open);
|
|
1141
|
+
export const SetupPrintParams = t.object({
|
|
1142
|
+
run: t.string(),
|
|
1143
|
+
text: t.string(),
|
|
1144
|
+
}, open);
|
|
1145
|
+
export const SetupPromptParams = t.object({
|
|
1146
|
+
run: t.string(),
|
|
1147
|
+
question: t.string(),
|
|
1148
|
+
default: t.optional(t.string()),
|
|
1149
|
+
secret: t.optional(t.boolean()),
|
|
1150
|
+
}, open);
|
|
1151
|
+
/** A setup callback's answer: a prompt's value, a choice's index, a stored secret's reference or a found path. */
|
|
1152
|
+
export const SetupAnswer = t.object({
|
|
1153
|
+
value: t.optional(t.string()),
|
|
1154
|
+
index: t.optional(t.integer()),
|
|
1155
|
+
found: t.optional(t.boolean()),
|
|
1156
|
+
}, open);
|
|
1157
|
+
export const SetupChooseParams = t.object({
|
|
1158
|
+
run: t.string(),
|
|
1159
|
+
question: t.string(),
|
|
1160
|
+
options: t.array(t.string()),
|
|
1161
|
+
}, open);
|
|
1162
|
+
export const SetupURLParams = t.object({
|
|
1163
|
+
run: t.string(),
|
|
1164
|
+
url: t.string(),
|
|
1165
|
+
}, open);
|
|
1166
|
+
export const SetupSecretParams = t.object({
|
|
1167
|
+
run: t.string(),
|
|
1168
|
+
name: t.string(),
|
|
1169
|
+
value: t.string(),
|
|
1170
|
+
}, open);
|
|
1171
|
+
export const SetupLookPathParams = t.object({
|
|
1172
|
+
run: t.string(),
|
|
1173
|
+
name: t.string(),
|
|
1174
|
+
}, open);
|
|
1175
|
+
export const SetupCommandParams = t.object({
|
|
1176
|
+
run: t.string(),
|
|
1177
|
+
dir: t.string(),
|
|
1178
|
+
name: t.string(),
|
|
1179
|
+
args: t.optional(t.array(t.string())),
|
|
1180
|
+
}, open);
|
|
1181
|
+
/** The resource an attempt ran in, for history (extension.WorkspaceRecord). */
|
|
1182
|
+
export const WorkspaceRecord = t.object({
|
|
1183
|
+
kind: t.string(),
|
|
1184
|
+
ref: t.string(),
|
|
1185
|
+
dir: t.optional(t.string()),
|
|
1186
|
+
summary: t.optional(t.string()),
|
|
1187
|
+
data: Payload,
|
|
1188
|
+
}, open);
|
|
1189
|
+
/** An attempt's result, executor.wait's answer (extension.Result). */
|
|
1190
|
+
export const Result = t.object({
|
|
1191
|
+
outcome: Outcome,
|
|
1192
|
+
usage: Usage,
|
|
1193
|
+
artifacts: t.optional(t.array(ArtifactRef)),
|
|
1194
|
+
retry_after: t.optional(t.boolean()),
|
|
1195
|
+
retry_reset_at: t.optional(t.string()),
|
|
1196
|
+
permanent: t.optional(t.boolean()),
|
|
1197
|
+
// The injected Events the attempt has evidence it took in.
|
|
1198
|
+
consumed_inputs: t.optional(t.array(t.string())),
|
|
1199
|
+
workspace: t.optional(WorkspaceRecord),
|
|
1200
|
+
}, open);
|
|
1201
|
+
export const ExecutorSweepParams = t.object({
|
|
1202
|
+
executor: t.string(),
|
|
1203
|
+
// Quoted in executor.known while the sweep runs.
|
|
1204
|
+
sweep: t.string(),
|
|
1205
|
+
}, open);
|
|
1206
|
+
/** Asks which of executions the host holds, at most MaxKnownBatch of them. */
|
|
1207
|
+
export const ExecutorKnownParams = t.object({
|
|
1208
|
+
sweep: t.string(),
|
|
1209
|
+
executions: t.array(t.string()),
|
|
1210
|
+
}, open);
|
|
1211
|
+
export const ExecutorKnown = t.object({
|
|
1212
|
+
known: t.optional(t.array(t.string())),
|
|
1213
|
+
}, open);
|
|
1214
|
+
/** State a sweep kept: its execution when known, the executor's own reference to it, and why (in_use, unmapped, remove_failed). */
|
|
1215
|
+
export const StateKept = t.object({
|
|
1216
|
+
execution_id: t.optional(t.string()),
|
|
1217
|
+
ref: t.optional(t.string()),
|
|
1218
|
+
kept: t.string(),
|
|
1219
|
+
}, open);
|
|
1220
|
+
export const StateSweepReport = t.object({
|
|
1221
|
+
removed: t.optional(t.array(t.string())),
|
|
1222
|
+
kept: t.optional(t.array(StateKept)),
|
|
1223
|
+
}, open);
|
|
1224
|
+
/** One output of a running execution, executor.live's answer; content is base64. */
|
|
1225
|
+
export const LiveOutput = t.object({
|
|
1226
|
+
name: t.string(),
|
|
1227
|
+
media_type: t.string(),
|
|
1228
|
+
size: t.integer(),
|
|
1229
|
+
content: t.optional(t.string()),
|
|
1230
|
+
}, open);
|
|
1231
|
+
export const LiveResult = t.object({
|
|
1232
|
+
outputs: t.array(LiveOutput),
|
|
1233
|
+
}, open);
|
|
1234
|
+
/** The command an operator's takeover runs (executor.attach). */
|
|
1235
|
+
export const AttachSpec = t.object({
|
|
1236
|
+
argv: t.array(t.string()),
|
|
1237
|
+
dir: t.optional(t.string()),
|
|
1238
|
+
}, open);
|
|
1239
|
+
/** A resource a run acquired through its binding's provider (extension.Resource). */
|
|
1240
|
+
export const Resource = t.object({
|
|
1241
|
+
kind: t.string(),
|
|
1242
|
+
ref: t.string(),
|
|
1243
|
+
dir: t.optional(t.string()),
|
|
1244
|
+
env: t.optional(t.record(t.string())),
|
|
1245
|
+
data: Payload,
|
|
1246
|
+
summary: t.optional(t.string()),
|
|
1247
|
+
sandbox: t.optional(SandboxNeeds),
|
|
1248
|
+
site: t.optional(t.string()),
|
|
1249
|
+
files: t.optional(t.record(t.string())),
|
|
1250
|
+
}, open);
|
|
1251
|
+
export const ResourceAcquireParams = t.object({
|
|
1252
|
+
run_id: t.string(),
|
|
1253
|
+
mode: t.optional(t.string()),
|
|
1254
|
+
params: Payload,
|
|
1255
|
+
files: t.optional(t.array(t.string())),
|
|
1256
|
+
}, open);
|
|
1257
|
+
export const ResourceLookupParams = t.object({
|
|
1258
|
+
run_id: t.string(),
|
|
1259
|
+
ref: t.string(),
|
|
1260
|
+
}, open);
|
|
1261
|
+
export const ResourceResult = t.object({
|
|
1262
|
+
resource: Resource,
|
|
1263
|
+
// The provider's progress for this acquisition.
|
|
1264
|
+
log: t.optional(t.string()),
|
|
1265
|
+
// The resource exists, returned for inspection, but its setup failed.
|
|
1266
|
+
setup_failed: t.optional(t.boolean()),
|
|
1267
|
+
}, open);
|
|
1268
|
+
// Resource, sandbox and tunnel providers: provider.*, sandbox_provider.*
|
|
1269
|
+
// and tunnel.run (protocol/surfaces.go). The host binds a resource provider
|
|
1270
|
+
// to an attempt (extension.BindResources) and drives its reconcile and
|
|
1271
|
+
// sweep from durable owner state, which the package reads back through
|
|
1272
|
+
// provider.owner_status; a sandbox provider wraps one launch, the host
|
|
1273
|
+
// pinning the plan's digest; a tunnel provider holds tunnel.run open while
|
|
1274
|
+
// the host wants the tunnel, reporting each public URL through tunnel.url.
|
|
1275
|
+
/** The site of one acquisition: its ID, and the call ID site.run quotes to run a command there. */
|
|
1276
|
+
export const AcquireSite = t.object({
|
|
1277
|
+
id: t.string(),
|
|
1278
|
+
call: t.string(),
|
|
1279
|
+
}, open);
|
|
1280
|
+
export const ProviderAcquireParams = t.object({
|
|
1281
|
+
type: t.string(),
|
|
1282
|
+
owner: ResourceOwner,
|
|
1283
|
+
config: Payload,
|
|
1284
|
+
mode: t.optional(t.string()),
|
|
1285
|
+
params: Payload,
|
|
1286
|
+
// The host's values of the variables the binding's resource names in its pass_env.
|
|
1287
|
+
host_env: t.optional(t.record(t.string())),
|
|
1288
|
+
files: t.optional(t.array(t.string())),
|
|
1289
|
+
// Given only to a provider declared with sites.
|
|
1290
|
+
site: t.optional(AcquireSite),
|
|
1291
|
+
}, open);
|
|
1292
|
+
export const ProviderLookupParams = t.object({
|
|
1293
|
+
type: t.string(),
|
|
1294
|
+
owner: ResourceOwner,
|
|
1295
|
+
ref: t.string(),
|
|
1296
|
+
}, open);
|
|
1297
|
+
/** A command a resource provider runs at a site (site.run): at its acquisition's site under call, or at a site it names. */
|
|
1298
|
+
export const SiteRunParams = t.object({
|
|
1299
|
+
type: t.string(),
|
|
1300
|
+
call: t.optional(t.string()),
|
|
1301
|
+
site: t.optional(t.string()),
|
|
1302
|
+
command: SiteCommand,
|
|
1303
|
+
}, open);
|
|
1304
|
+
/** Asks the host for a lease owner's durable status while a reconcile or sweep runs. */
|
|
1305
|
+
export const OwnerStatusParams = t.object({
|
|
1306
|
+
reconcile: t.string(),
|
|
1307
|
+
owner: ResourceOwner,
|
|
1308
|
+
}, open);
|
|
1309
|
+
export const OwnerStatus = t.object({
|
|
1310
|
+
known: t.boolean(),
|
|
1311
|
+
execution_done: t.boolean(),
|
|
1312
|
+
execution_succeeded: t.boolean(),
|
|
1313
|
+
work_done: t.boolean(),
|
|
1314
|
+
work_succeeded: t.boolean(),
|
|
1315
|
+
// Host paths live containers hold.
|
|
1316
|
+
mounts: t.optional(t.array(t.string())),
|
|
1317
|
+
}, open);
|
|
1318
|
+
/** The reconcile (or sweep) ID provider.owner_status quotes while the pass runs. */
|
|
1319
|
+
export const ProviderReconcileParams = t.object({
|
|
1320
|
+
type: t.string(),
|
|
1321
|
+
reconcile: t.string(),
|
|
1322
|
+
}, open);
|
|
1323
|
+
export const ResourceLeaseReport = t.object({
|
|
1324
|
+
ref: t.string(),
|
|
1325
|
+
mode: t.string(),
|
|
1326
|
+
state: t.string(),
|
|
1327
|
+
code: t.optional(t.string()),
|
|
1328
|
+
// RFC 3339; Go's zero time when there is none.
|
|
1329
|
+
retain_until: t.string(),
|
|
1330
|
+
}, open);
|
|
1331
|
+
export const ResourceReport = t.object({
|
|
1332
|
+
active: t.integer(),
|
|
1333
|
+
released: t.integer(),
|
|
1334
|
+
removed: t.integer(),
|
|
1335
|
+
retained: t.integer(),
|
|
1336
|
+
attention: t.optional(t.array(ResourceLeaseReport)),
|
|
1337
|
+
}, open);
|
|
1338
|
+
export const ResourceSpare = t.object({
|
|
1339
|
+
ref: t.string(),
|
|
1340
|
+
mode: t.optional(t.string()),
|
|
1341
|
+
spare: t.string(),
|
|
1342
|
+
kept: t.optional(t.string()),
|
|
1343
|
+
}, open);
|
|
1344
|
+
export const ResourceSweepReport = t.object({
|
|
1345
|
+
removed: t.optional(t.array(ResourceSpare)),
|
|
1346
|
+
kept: t.optional(t.array(ResourceSpare)),
|
|
1347
|
+
}, open);
|
|
1348
|
+
export const ResourceUnsaved = t.object({
|
|
1349
|
+
ref: t.string(),
|
|
1350
|
+
mode: t.optional(t.string()),
|
|
1351
|
+
path: t.optional(t.string()),
|
|
1352
|
+
site: t.optional(t.string()),
|
|
1353
|
+
kept: t.string(),
|
|
1354
|
+
}, open);
|
|
1355
|
+
export const ProviderUnsavedParams = t.object({
|
|
1356
|
+
type: t.string(),
|
|
1357
|
+
}, open);
|
|
1358
|
+
export const ProviderUnsavedResult = t.object({
|
|
1359
|
+
resources: t.optional(t.array(ResourceUnsaved)),
|
|
1360
|
+
}, open);
|
|
1361
|
+
/** A wrapped launch (extension.SandboxPlan); the host computes the digest itself from argv and data. */
|
|
1362
|
+
export const SandboxPlan = t.object({
|
|
1363
|
+
argv: t.nullable(t.array(t.string())),
|
|
1364
|
+
env: t.optional(t.array(t.string())),
|
|
1365
|
+
digest: t.optional(t.string()),
|
|
1366
|
+
// What an interrupt can promise: term or kill.
|
|
1367
|
+
signals: t.optional(t.string()),
|
|
1368
|
+
summary: t.optional(t.string()),
|
|
1369
|
+
data: t.optional(Payload),
|
|
1370
|
+
// Where the wrapper runs the plan's argv, when not the launch's directory.
|
|
1371
|
+
dir: t.optional(t.string()),
|
|
1372
|
+
}, open);
|
|
1373
|
+
export const SandboxProviderPlanParams = t.object({
|
|
1374
|
+
type: t.string(),
|
|
1375
|
+
owner: ResourceOwner,
|
|
1376
|
+
config: Payload,
|
|
1377
|
+
paths: SandboxPaths,
|
|
1378
|
+
needs: SandboxNeeds,
|
|
1379
|
+
launch: SandboxLaunch,
|
|
1380
|
+
}, open);
|
|
1381
|
+
export const SandboxProviderAdoptParams = t.object({
|
|
1382
|
+
type: t.string(),
|
|
1383
|
+
plan: SandboxPlan,
|
|
1384
|
+
parent: t.integer(),
|
|
1385
|
+
root: t.integer(),
|
|
1386
|
+
}, open);
|
|
1387
|
+
/** One run of a tunnel, held open until the host cancels it; tunnel.url quotes run. */
|
|
1388
|
+
export const TunnelRunParams = t.object({
|
|
1389
|
+
type: t.string(),
|
|
1390
|
+
run: t.string(),
|
|
1391
|
+
addr: t.string(),
|
|
1392
|
+
config: Payload,
|
|
1393
|
+
}, open);
|
|
1394
|
+
/** A running tunnel's public URL, "" while it is down. */
|
|
1395
|
+
export const TunnelURLParams = t.object({
|
|
1396
|
+
run: t.string(),
|
|
1397
|
+
url: t.string(),
|
|
1398
|
+
}, open);
|
|
1399
|
+
/** An executor's version probe: the argv to run and the variables it runs with in a container (protocol.Probe). */
|
|
1400
|
+
export const VersionProbe = t.object({
|
|
1401
|
+
argv: t.nullable(t.array(t.string())),
|
|
1402
|
+
env: t.optional(t.array(t.string())),
|
|
1403
|
+
}, open);
|
|
1404
|
+
/**
|
|
1405
|
+
* The answer to validate for the kinds that answer more than a refusal:
|
|
1406
|
+
* the mode (resource_mode, executor_mode), whether a config can only be
|
|
1407
|
+
* made at a site (resource_site), the playbook (executor_playbook), the
|
|
1408
|
+
* version probe (executor_probe) and the adapted config (executor_folder).
|
|
1409
|
+
*/
|
|
1410
|
+
export const ValidateResult = t.object({
|
|
1411
|
+
mode: t.optional(t.string()),
|
|
1412
|
+
site: t.optional(t.boolean()),
|
|
1413
|
+
playbook: t.optional(t.string()),
|
|
1414
|
+
probe: t.optional(VersionProbe),
|
|
1415
|
+
config: t.optional(t.any()),
|
|
1416
|
+
}, open);
|
|
1417
|
+
/** Plans one launch (sandbox.plan) or creates its container (container.launch). */
|
|
1418
|
+
export const LaunchParams = t.object({
|
|
1419
|
+
run_id: t.string(),
|
|
1420
|
+
needs: SandboxNeeds,
|
|
1421
|
+
launch: SandboxLaunch,
|
|
1422
|
+
}, open);
|
|
1423
|
+
/** Proves a recovered segment's wrapper, pid parent, still runs in its sandbox (sandbox.adopt). */
|
|
1424
|
+
export const SandboxAdoptParams = t.object({
|
|
1425
|
+
run_id: t.string(),
|
|
1426
|
+
parent: t.integer(),
|
|
1427
|
+
}, open);
|
|
1428
|
+
/** Proves a recovered segment's container is the one pinned; alive says its wrapper still runs (container.adopt). */
|
|
1429
|
+
export const ContainerAdoptParams = t.object({
|
|
1430
|
+
run_id: t.string(),
|
|
1431
|
+
alive: t.boolean(),
|
|
1432
|
+
}, open);
|
|
1433
|
+
/** Asks for a new wrapper for a recovered segment's pinned container; run is the executor's run directory (container.reattach). */
|
|
1434
|
+
export const ContainerReattachParams = t.object({
|
|
1435
|
+
run_id: t.string(),
|
|
1436
|
+
run: t.string(),
|
|
1437
|
+
}, open);
|
|
1438
|
+
/** How an adopted container's segment ended (extension.ContainerExit). */
|
|
1439
|
+
export const ContainerExit = t.object({
|
|
1440
|
+
exited: t.optional(t.boolean()),
|
|
1441
|
+
exit_code: t.optional(t.integer()),
|
|
1442
|
+
interrupted: t.optional(t.boolean()),
|
|
1443
|
+
}, open);
|
|
1444
|
+
/** executor.container_attach's params: the Work, its binding's config and secrets, and the Work's container home. */
|
|
1445
|
+
export const ContainerAttachParams = t.object({
|
|
1446
|
+
executor: t.string(),
|
|
1447
|
+
work: Work,
|
|
1448
|
+
config: Payload,
|
|
1449
|
+
secrets: t.optional(t.record(t.string())),
|
|
1450
|
+
home: t.string(),
|
|
1451
|
+
}, open);
|
|
1452
|
+
/** The interactive launch executor.container_attach answers, for the host's container broker to plan. */
|
|
1453
|
+
export const ContainerAttachSpec = t.object({
|
|
1454
|
+
needs: SandboxNeeds,
|
|
1455
|
+
launch: SandboxLaunch,
|
|
1456
|
+
}, open);
|
|
1457
|
+
/** executor.interactive_launch's params: what the session starts on (extension.InteractiveLaunchRequest). */
|
|
1458
|
+
export const InteractiveLaunchParams = t.object({
|
|
1459
|
+
executor: t.string(),
|
|
1460
|
+
playbook: t.string(),
|
|
1461
|
+
name: t.string(),
|
|
1462
|
+
summary: t.optional(t.string()),
|
|
1463
|
+
allow: t.optional(t.array(t.string())),
|
|
1464
|
+
dir: t.optional(t.string()),
|
|
1465
|
+
files_dir: t.string(),
|
|
1466
|
+
program: t.optional(t.string()),
|
|
1467
|
+
}, open);
|
|
1468
|
+
/** The command executor.interactive_launch answers for the host to exec. */
|
|
1469
|
+
export const InteractiveLaunchSpec = t.object({
|
|
1470
|
+
argv: t.nullable(t.array(t.string())),
|
|
1471
|
+
dir: t.optional(t.string()),
|
|
1472
|
+
set_env: t.optional(t.record(t.string())),
|
|
1473
|
+
}, open);
|
|
1474
|
+
// Wait and emit operations.
|
|
1475
|
+
/**
|
|
1476
|
+
* What a wait suspends the Work until: an Event of one of types (any, when
|
|
1477
|
+
* empty) on one of keys (every key the Work owns, when empty), or timeout.
|
|
1478
|
+
*/
|
|
1479
|
+
export const WaitRequest = t.object({
|
|
1480
|
+
keys: t.optional(t.array(Key)),
|
|
1481
|
+
types: t.optional(t.array(t.string())),
|
|
1482
|
+
timeout: t.optional(t.string()),
|
|
1483
|
+
after_sequence: t.optional(t.integer()),
|
|
1484
|
+
description: t.optional(t.string()),
|
|
1485
|
+
}, open);
|
|
1486
|
+
/**
|
|
1487
|
+
* A subscription to Events on another key (another Work's, or one no Work
|
|
1488
|
+
* owns yet), aliased into the waiting Work as alias_type Events.
|
|
1489
|
+
*/
|
|
1490
|
+
export const Dependency = t.object({
|
|
1491
|
+
id: t.string(),
|
|
1492
|
+
source_scope_id: t.optional(t.string()),
|
|
1493
|
+
source_key: Key,
|
|
1494
|
+
types: t.optional(t.array(t.string())),
|
|
1495
|
+
alias_type: t.string(),
|
|
1496
|
+
filter: Payload,
|
|
1497
|
+
label: t.optional(t.string()),
|
|
1498
|
+
from_now: t.optional(t.boolean()),
|
|
1499
|
+
}, open);
|
|
1500
|
+
export const WaitPlan = t.object({
|
|
1501
|
+
wait: WaitRequest,
|
|
1502
|
+
dependencies: t.optional(t.array(Dependency)),
|
|
1503
|
+
output: Payload,
|
|
1504
|
+
}, open);
|
|
1505
|
+
export const EmitPlan = t.object({
|
|
1506
|
+
event: Event,
|
|
1507
|
+
cause: t.optional(t.string()),
|
|
1508
|
+
once: t.optional(t.string()),
|
|
1509
|
+
commit_id: t.optional(t.string()),
|
|
1510
|
+
}, open);
|
|
1511
|
+
/** The Event an emission accepted, as its commit receives it. */
|
|
1512
|
+
export const Emitted = t.object({
|
|
1513
|
+
event: AcceptedEvent,
|
|
1514
|
+
added: t.boolean(),
|
|
1515
|
+
root: t.string(),
|
|
1516
|
+
depth: t.integer(),
|
|
1517
|
+
}, open);
|
|
1518
|
+
/** A KV write an emission's commit makes; value is base64. */
|
|
1519
|
+
export const EmitRecord = t.object({
|
|
1520
|
+
namespace: t.string(),
|
|
1521
|
+
key: t.string(),
|
|
1522
|
+
value: t.string(),
|
|
1523
|
+
}, open);
|
|
1524
|
+
export const EmitCommit = t.object({
|
|
1525
|
+
records: t.optional(t.array(EmitRecord)),
|
|
1526
|
+
output: Payload,
|
|
1527
|
+
}, open);
|
|
1528
|
+
export const EmitCommitParams = t.object({
|
|
1529
|
+
commit_id: t.string(),
|
|
1530
|
+
emitted: Emitted,
|
|
1531
|
+
}, open);
|
|
1532
|
+
// The manifest (open-conduit-extension.json): the fields this SDK writes.
|
|
1533
|
+
export const Family = t.object({
|
|
1534
|
+
type: t.string(),
|
|
1535
|
+
// Whether a lost Event can be derived again, which tells the host how to recover.
|
|
1536
|
+
re_derivable: t.boolean(),
|
|
1537
|
+
loss: t.optional(t.string()),
|
|
1538
|
+
// Only the extension's own emit operations may emit it; the builtin emit refuses it.
|
|
1539
|
+
sealed: t.optional(t.boolean()),
|
|
1540
|
+
}, open);
|
|
1541
|
+
/** A payload schema the extension writes and reads: the versions it reads, the highest being the one it writes. */
|
|
1542
|
+
export const SchemaDecl = t.object({
|
|
1543
|
+
name: t.string(),
|
|
1544
|
+
versions: t.array(t.integer()),
|
|
1545
|
+
}, open);
|
|
1546
|
+
export const ExtensionDecl = t.object({
|
|
1547
|
+
type: t.string(),
|
|
1548
|
+
// The entry registers ingress sources at configure.
|
|
1549
|
+
ingress: t.optional(t.boolean()),
|
|
1550
|
+
}, open);
|
|
1551
|
+
export const OperationDecl = t.object({
|
|
1552
|
+
name: t.string(),
|
|
1553
|
+
kind: t.enum(["handler", "wait", "emit"]),
|
|
1554
|
+
commit: t.optional(t.boolean()),
|
|
1555
|
+
summary: t.optional(t.string()),
|
|
1556
|
+
guidance: t.optional(t.string()),
|
|
1557
|
+
input: t.optional(t.record(t.any())),
|
|
1558
|
+
wants: t.optional(t.string()),
|
|
1559
|
+
serves: t.optional(t.string()),
|
|
1560
|
+
}, open);
|
|
1561
|
+
export const RouteDecl = t.object({
|
|
1562
|
+
handler: t.string(),
|
|
1563
|
+
// Its routes carry config, checked through validate with kind route.
|
|
1564
|
+
config: t.optional(t.boolean()),
|
|
1565
|
+
// It offers sample Events for a route trace through route.samples.
|
|
1566
|
+
samples: t.optional(t.boolean()),
|
|
1567
|
+
}, open);
|
|
1568
|
+
export const WorkKindDecl = t.object({
|
|
1569
|
+
kind: t.string(),
|
|
1570
|
+
standing: t.optional(t.boolean()),
|
|
1571
|
+
trigger: t.optional(t.boolean()),
|
|
1572
|
+
timed: t.optional(t.boolean()),
|
|
1573
|
+
run_once: t.optional(t.boolean()),
|
|
1574
|
+
}, open);
|
|
1575
|
+
export const ToolsetOperation = t.object({
|
|
1576
|
+
name: t.string(),
|
|
1577
|
+
// The toolset version the operation joined in (1 when left out).
|
|
1578
|
+
since: t.optional(t.integer()),
|
|
1579
|
+
}, open);
|
|
1580
|
+
// A toolset config grants as "@<name>": the operations (the extension's own
|
|
1581
|
+
// or builtins) an agent playing one of its roles is given.
|
|
1582
|
+
export const ToolsetDecl = t.object({
|
|
1583
|
+
name: t.string(),
|
|
1584
|
+
summary: t.optional(t.string()),
|
|
1585
|
+
operations: t.array(ToolsetOperation),
|
|
1586
|
+
}, open);
|
|
1587
|
+
export const TaskDecl = t.object({
|
|
1588
|
+
name: t.string(),
|
|
1589
|
+
interval_seconds: t.integer(),
|
|
1590
|
+
}, open);
|
|
1591
|
+
export const CheckDecl = t.object({
|
|
1592
|
+
name: t.string(),
|
|
1593
|
+
// Deep checks run only on doctor --deep, so they may be slow or call out.
|
|
1594
|
+
deep: t.optional(t.boolean()),
|
|
1595
|
+
}, open);
|
|
1596
|
+
/** One field of a config a manifest declaration describes (protocol.FieldDecl), for adapters and the config editor. */
|
|
1597
|
+
export const FieldDecl = t.object({
|
|
1598
|
+
name: t.string(),
|
|
1599
|
+
help: t.optional(t.string()),
|
|
1600
|
+
default: t.optional(t.string()),
|
|
1601
|
+
required: t.optional(t.boolean()),
|
|
1602
|
+
options: t.optional(t.array(t.string())),
|
|
1603
|
+
secret: t.optional(t.boolean()),
|
|
1604
|
+
}, open);
|
|
1605
|
+
export const VerifierDecl = t.object({
|
|
1606
|
+
type: t.string(),
|
|
1607
|
+
// The trusted issuer config's fields.
|
|
1608
|
+
fields: t.optional(t.array(FieldDecl)),
|
|
1609
|
+
}, open);
|
|
1610
|
+
export const SecretSchemeDecl = t.object({
|
|
1611
|
+
scheme: t.string(),
|
|
1612
|
+
// One line for the operator: what a reference of the scheme names.
|
|
1613
|
+
summary: t.optional(t.string()),
|
|
1614
|
+
// The package also stores values of the scheme (secret.store and secret.delete).
|
|
1615
|
+
writable: t.optional(t.boolean()),
|
|
1616
|
+
}, open);
|
|
1617
|
+
export const BackupDestinationDecl = t.object({
|
|
1618
|
+
type: t.string(),
|
|
1619
|
+
// The destination config's fields.
|
|
1620
|
+
fields: t.optional(t.array(FieldDecl)),
|
|
1621
|
+
}, open);
|
|
1622
|
+
/** A resource config field safe to show the operator, with its type and default (protocol.SettingDecl). */
|
|
1623
|
+
export const SettingDecl = t.object({
|
|
1624
|
+
field: t.string(),
|
|
1625
|
+
type: t.string(),
|
|
1626
|
+
default: t.optional(t.any()),
|
|
1627
|
+
}, open);
|
|
1628
|
+
export const ResourceDecl = t.object({
|
|
1629
|
+
type: t.string(),
|
|
1630
|
+
modes: t.array(t.string()),
|
|
1631
|
+
// It names the mode a resource config sets as its default (validate resource_mode).
|
|
1632
|
+
mode_default: t.optional(t.boolean()),
|
|
1633
|
+
// It refuses a resource config a sandboxed executor can't use (validate resource_sandbox).
|
|
1634
|
+
sandbox: t.optional(t.boolean()),
|
|
1635
|
+
// It removes spare resources no lease release covers (provider.sweep).
|
|
1636
|
+
sweep: t.optional(t.boolean()),
|
|
1637
|
+
// It reports the resources holding work that exists only there (provider.unsaved).
|
|
1638
|
+
unsaved: t.optional(t.boolean()),
|
|
1639
|
+
// It makes resources at the site a launch is placed at (site.run, validate resource_site).
|
|
1640
|
+
sites: t.optional(t.boolean()),
|
|
1641
|
+
settings: t.optional(t.array(SettingDecl)),
|
|
1642
|
+
fields: t.optional(t.array(FieldDecl)),
|
|
1643
|
+
}, open);
|
|
1644
|
+
export const SandboxDecl = t.object({
|
|
1645
|
+
type: t.string(),
|
|
1646
|
+
}, open);
|
|
1647
|
+
export const TunnelDecl = t.object({
|
|
1648
|
+
type: t.string(),
|
|
1649
|
+
// The tunnel config's fields (settings.webhooks.tunnel.config).
|
|
1650
|
+
fields: t.optional(t.array(FieldDecl)),
|
|
1651
|
+
}, open);
|
|
1652
|
+
export const ContainerDecl = t.object({
|
|
1653
|
+
type: t.string(),
|
|
1654
|
+
// Its containers reach the toolbelt through an address the host serves (container_provider.forward).
|
|
1655
|
+
forward: t.optional(t.boolean()),
|
|
1656
|
+
// Its doctor check runs each of its bindings' version probes in the binding's container.
|
|
1657
|
+
probe: t.optional(t.boolean()),
|
|
1658
|
+
// It chooses the machine a launch runs on and runs commands there (container_provider.place and site_run).
|
|
1659
|
+
place: t.optional(t.boolean()),
|
|
1660
|
+
// It brings back what an exited container wrote when its wrapper didn't (container_provider.collect).
|
|
1661
|
+
collect: t.optional(t.boolean()),
|
|
1662
|
+
// Its containers outlive their wrapper, and a recovered run gets a new one (container_provider.reattach).
|
|
1663
|
+
reattach: t.optional(t.boolean()),
|
|
1664
|
+
}, open);
|
|
1665
|
+
/** The mechanical labels a binding's requires is checked against (protocol.Capabilities). */
|
|
1666
|
+
export const Capabilities = t.object({
|
|
1667
|
+
interrupt: t.optional(t.boolean()),
|
|
1668
|
+
inject: t.optional(t.boolean()),
|
|
1669
|
+
resume: t.optional(t.boolean()),
|
|
1670
|
+
workspace: t.optional(t.boolean()),
|
|
1671
|
+
// How the attempt reaches the toolbelt: none, cli, mcp or sdk.
|
|
1672
|
+
toolbelt: t.string(),
|
|
1673
|
+
sandbox: t.optional(t.boolean()),
|
|
1674
|
+
container: t.optional(t.boolean()),
|
|
1675
|
+
// It runs no process the agent controls, so a scope that requires
|
|
1676
|
+
// isolation accepts its bindings without a sandbox or container.
|
|
1677
|
+
no_process: t.optional(t.boolean()),
|
|
1678
|
+
}, open);
|
|
1679
|
+
/** The optional host-driven executor methods it serves (protocol.Controls). */
|
|
1680
|
+
export const Controls = t.object({
|
|
1681
|
+
stop: t.optional(t.boolean()),
|
|
1682
|
+
forget: t.optional(t.boolean()),
|
|
1683
|
+
sweep: t.optional(t.boolean()),
|
|
1684
|
+
attach: t.optional(t.boolean()),
|
|
1685
|
+
container_attach: t.optional(t.boolean()),
|
|
1686
|
+
live: t.optional(t.boolean()),
|
|
1687
|
+
interactive_launch: t.optional(t.boolean()),
|
|
1688
|
+
}, open);
|
|
1689
|
+
export const ExecutorDecl = t.object({
|
|
1690
|
+
name: t.string(),
|
|
1691
|
+
capabilities: Capabilities,
|
|
1692
|
+
controls: t.optional(Controls),
|
|
1693
|
+
// It names, through validate, the resource mode a binding config
|
|
1694
|
+
// requests (executor_mode), the playbook it starts its turns on
|
|
1695
|
+
// (executor_playbook), the command that shows it is installed
|
|
1696
|
+
// (executor_probe), and a binding config adapted to the included
|
|
1697
|
+
// folder it comes from (executor_folder).
|
|
1698
|
+
resource_mode: t.optional(t.boolean()),
|
|
1699
|
+
playbook: t.optional(t.boolean()),
|
|
1700
|
+
version_probe: t.optional(t.boolean()),
|
|
1701
|
+
folder_config: t.optional(t.boolean()),
|
|
1702
|
+
// Its runs count against settings.job_concurrency ("jobs") rather than settings.concurrency.
|
|
1703
|
+
pool: t.optional(t.string()),
|
|
1704
|
+
// Other names an operator may launch it by interactively (interactive_launch).
|
|
1705
|
+
launch_names: t.optional(t.array(t.string())),
|
|
1706
|
+
// The binding config's fields.
|
|
1707
|
+
fields: t.optional(t.array(FieldDecl)),
|
|
1708
|
+
}, open);
|
|
1709
|
+
// work.actions, work.act, work.requests and view.render
|
|
1710
|
+
// (protocol/surfaces.go): an extension lists the actions available on a
|
|
1711
|
+
// target now, authorises one invocation as the one Event the host accepts
|
|
1712
|
+
// under core.action, reports the requests its actions answer, and shows
|
|
1713
|
+
// panels whose buttons name those actions (extension.ActionProvider,
|
|
1714
|
+
// RequestProvider and PanelProvider).
|
|
1715
|
+
export const ActionTarget = t.object({
|
|
1716
|
+
scope: Scope,
|
|
1717
|
+
work: t.optional(Work),
|
|
1718
|
+
}, open);
|
|
1719
|
+
export const Caller = t.object({
|
|
1720
|
+
kind: t.string(),
|
|
1721
|
+
id: t.string(),
|
|
1722
|
+
}, open);
|
|
1723
|
+
export const WorkActionsParams = t.object({
|
|
1724
|
+
target: ActionTarget,
|
|
1725
|
+
}, open);
|
|
1726
|
+
export const Action = t.object({
|
|
1727
|
+
id: t.string(),
|
|
1728
|
+
label: t.string(),
|
|
1729
|
+
prompt: t.optional(t.string()),
|
|
1730
|
+
choices: t.optional(t.array(t.string())),
|
|
1731
|
+
detail: t.optional(t.string()),
|
|
1732
|
+
// The Work waits for a person to take this action.
|
|
1733
|
+
awaited: t.optional(t.boolean()),
|
|
1734
|
+
// The action asks a person for a secret stored under this name, and is invoked with the name, never the value.
|
|
1735
|
+
secret: t.optional(t.string()),
|
|
1736
|
+
}, open);
|
|
1737
|
+
export const WorkActionsResult = t.object({
|
|
1738
|
+
actions: t.optional(t.array(Action)),
|
|
1739
|
+
}, open);
|
|
1740
|
+
export const WorkActParams = t.object({
|
|
1741
|
+
target: ActionTarget,
|
|
1742
|
+
action: t.string(),
|
|
1743
|
+
input: t.optional(t.string()),
|
|
1744
|
+
caller: Caller,
|
|
1745
|
+
}, open);
|
|
1746
|
+
export const WorkActResult = t.object({
|
|
1747
|
+
// Only type, correlation key and data: the host assigns everything else.
|
|
1748
|
+
event: Event,
|
|
1749
|
+
message: t.optional(t.string()),
|
|
1750
|
+
}, open);
|
|
1751
|
+
export const WorkRequestsParams = t.object({
|
|
1752
|
+
target: ActionTarget,
|
|
1753
|
+
}, open);
|
|
1754
|
+
export const WordingField = t.object({
|
|
1755
|
+
name: t.string(),
|
|
1756
|
+
value: t.string(),
|
|
1757
|
+
}, open);
|
|
1758
|
+
export const ChoiceWording = t.object({
|
|
1759
|
+
choice: t.string(),
|
|
1760
|
+
label: t.optional(t.string()),
|
|
1761
|
+
tone: t.optional(t.string()),
|
|
1762
|
+
confirm: t.optional(t.string()),
|
|
1763
|
+
}, open);
|
|
1764
|
+
export const Wording = t.object({
|
|
1765
|
+
wants: t.optional(t.string()),
|
|
1766
|
+
question: t.optional(t.string()),
|
|
1767
|
+
fields: t.optional(t.array(WordingField)),
|
|
1768
|
+
input: t.optional(t.string()),
|
|
1769
|
+
note: t.optional(t.string()),
|
|
1770
|
+
choices: t.optional(t.array(ChoiceWording)),
|
|
1771
|
+
}, open);
|
|
1772
|
+
export const Request = t.object({
|
|
1773
|
+
id: t.string(),
|
|
1774
|
+
label: t.string(),
|
|
1775
|
+
detail: t.optional(t.string()),
|
|
1776
|
+
action: t.optional(t.string()),
|
|
1777
|
+
responders: t.optional(t.array(t.string())),
|
|
1778
|
+
state: t.string(),
|
|
1779
|
+
by: t.optional(t.string()),
|
|
1780
|
+
settled_at: t.optional(t.string()),
|
|
1781
|
+
wording: t.optional(Wording),
|
|
1782
|
+
}, open);
|
|
1783
|
+
export const WorkRequestsResult = t.object({
|
|
1784
|
+
requests: t.optional(t.array(Request)),
|
|
1785
|
+
}, open);
|
|
1786
|
+
export const ViewRenderParams = t.object({
|
|
1787
|
+
target: ActionTarget,
|
|
1788
|
+
}, open);
|
|
1789
|
+
export const PanelField = t.object({
|
|
1790
|
+
name: t.string(),
|
|
1791
|
+
value: t.string(),
|
|
1792
|
+
}, open);
|
|
1793
|
+
export const PanelTable = t.object({
|
|
1794
|
+
columns: t.array(t.string()),
|
|
1795
|
+
rows: t.optional(t.array(t.array(t.string()))),
|
|
1796
|
+
}, open);
|
|
1797
|
+
export const PanelMessage = t.object({
|
|
1798
|
+
from: t.string(),
|
|
1799
|
+
label: t.optional(t.string()),
|
|
1800
|
+
text: t.string(),
|
|
1801
|
+
at: t.optional(t.string()),
|
|
1802
|
+
choices: t.optional(t.array(t.string())),
|
|
1803
|
+
chosen: t.optional(t.string()),
|
|
1804
|
+
}, open);
|
|
1805
|
+
export const PanelLink = t.object({
|
|
1806
|
+
label: t.string(),
|
|
1807
|
+
url: t.string(),
|
|
1808
|
+
}, open);
|
|
1809
|
+
export const PanelSection = t.object({
|
|
1810
|
+
title: t.optional(t.string()),
|
|
1811
|
+
text: t.optional(t.string()),
|
|
1812
|
+
fields: t.optional(t.array(PanelField)),
|
|
1813
|
+
table: t.optional(PanelTable),
|
|
1814
|
+
messages: t.optional(t.array(PanelMessage)),
|
|
1815
|
+
links: t.optional(t.array(PanelLink)),
|
|
1816
|
+
actions: t.optional(t.array(t.string())),
|
|
1817
|
+
}, open);
|
|
1818
|
+
export const Panel = t.object({
|
|
1819
|
+
id: t.string(),
|
|
1820
|
+
title: t.string(),
|
|
1821
|
+
sections: t.array(PanelSection),
|
|
1822
|
+
}, open);
|
|
1823
|
+
export const ViewRenderResult = t.object({
|
|
1824
|
+
panels: t.optional(t.array(Panel)),
|
|
1825
|
+
}, open);
|
|
1826
|
+
// work.annotate (protocol/surfaces.go): name/value lines an extension adds to a Work's view.
|
|
1827
|
+
export const WorkAnnotateParams = t.object({
|
|
1828
|
+
work: Work,
|
|
1829
|
+
}, open);
|
|
1830
|
+
export const Annotation = t.object({
|
|
1831
|
+
name: t.string(),
|
|
1832
|
+
value: t.string(),
|
|
1833
|
+
}, open);
|
|
1834
|
+
export const WorkAnnotateResult = t.object({
|
|
1835
|
+
annotations: t.optional(t.array(Annotation)),
|
|
1836
|
+
}, open);
|
|
1837
|
+
// probe.serve (protocol/surfaces.go): one run of a read-only setup probe
|
|
1838
|
+
// the extension declares, through a connection when an argument names one.
|
|
1839
|
+
export const ProbeArg = t.object({
|
|
1840
|
+
name: t.string(),
|
|
1841
|
+
summary: t.optional(t.string()),
|
|
1842
|
+
required: t.optional(t.boolean()),
|
|
1843
|
+
// The argument's value is a connection ID.
|
|
1844
|
+
connection: t.optional(t.boolean()),
|
|
1845
|
+
}, open);
|
|
1846
|
+
export const ProbeInfo = t.object({
|
|
1847
|
+
name: t.string(),
|
|
1848
|
+
summary: t.string(),
|
|
1849
|
+
args: t.optional(t.array(ProbeArg)),
|
|
1850
|
+
}, open);
|
|
1851
|
+
export const ProbeRunParams = t.object({
|
|
1852
|
+
name: t.string(),
|
|
1853
|
+
args: t.optional(t.record(t.string())),
|
|
1854
|
+
scope_id: t.optional(t.string()),
|
|
1855
|
+
// The connection a run through one goes through, without reference text, and the grant secret.resolve reads its secrets under until the run ends.
|
|
1856
|
+
connection: t.optional(ConnectionEntry),
|
|
1857
|
+
grant: t.optional(t.string()),
|
|
1858
|
+
}, open);
|
|
1859
|
+
export const ProbeRunResult = t.object({
|
|
1860
|
+
command: t.optional(t.string()),
|
|
1861
|
+
output: t.optional(t.any()),
|
|
1862
|
+
// A probe that ran and failed: its fixed, secret-free reason.
|
|
1863
|
+
error: t.optional(t.string()),
|
|
1864
|
+
}, open);
|
|
1865
|
+
/** A page the extension contributes to the operator's web view (extension.Page). */
|
|
1866
|
+
export const PageDecl = t.object({
|
|
1867
|
+
id: t.string(),
|
|
1868
|
+
title: t.string(),
|
|
1869
|
+
summary: t.optional(t.string()),
|
|
1870
|
+
entry: t.string(),
|
|
1871
|
+
work_kind: t.string(),
|
|
1872
|
+
start: t.string(),
|
|
1873
|
+
compose: t.optional(t.array(t.string())),
|
|
1874
|
+
route: t.optional(t.string()),
|
|
1875
|
+
}, open);
|
|
1876
|
+
/** An `open-conduit init <type>` flow (manifest setup). */
|
|
1877
|
+
export const SetupDecl = t.object({
|
|
1878
|
+
type: t.string(),
|
|
1879
|
+
summary: t.string(),
|
|
1880
|
+
usage: t.optional(t.string()),
|
|
1881
|
+
// The setup whose result, with no flags, is the configuration a daemon with no config runs on.
|
|
1882
|
+
first_run: t.optional(t.boolean()),
|
|
1883
|
+
}, open);
|
|
1884
|
+
export const Provides = t.object({
|
|
1885
|
+
extensions: t.optional(t.array(ExtensionDecl)),
|
|
1886
|
+
families: t.optional(t.array(Family)),
|
|
1887
|
+
schemas: t.optional(t.array(SchemaDecl)),
|
|
1888
|
+
routes: t.optional(t.array(RouteDecl)),
|
|
1889
|
+
work_kinds: t.optional(t.array(WorkKindDecl)),
|
|
1890
|
+
operations: t.optional(t.array(OperationDecl)),
|
|
1891
|
+
toolsets: t.optional(t.array(ToolsetDecl)),
|
|
1892
|
+
tasks: t.optional(t.array(TaskDecl)),
|
|
1893
|
+
webhooks: t.optional(t.boolean()),
|
|
1894
|
+
webhook_max_bytes: t.optional(t.integer()),
|
|
1895
|
+
checks: t.optional(t.array(CheckDecl)),
|
|
1896
|
+
verifiers: t.optional(t.array(VerifierDecl)),
|
|
1897
|
+
secret_schemes: t.optional(t.array(SecretSchemeDecl)),
|
|
1898
|
+
resources: t.optional(t.array(ResourceDecl)),
|
|
1899
|
+
sandboxes: t.optional(t.array(SandboxDecl)),
|
|
1900
|
+
containers: t.optional(t.array(ContainerDecl)),
|
|
1901
|
+
tunnels: t.optional(t.array(TunnelDecl)),
|
|
1902
|
+
backup_destinations: t.optional(t.array(BackupDestinationDecl)),
|
|
1903
|
+
executors: t.optional(t.array(ExecutorDecl)),
|
|
1904
|
+
// A telemetry exporter (telemetry.export).
|
|
1905
|
+
exporters: t.optional(t.boolean()),
|
|
1906
|
+
// Contributes an environment layer to runs in scopes that use it (run.environment).
|
|
1907
|
+
run_environment: t.optional(t.boolean()),
|
|
1908
|
+
annotate: t.optional(t.boolean()),
|
|
1909
|
+
actions: t.optional(t.boolean()),
|
|
1910
|
+
// Some actions ask a person for a secret (Action.secret); it needs actions.
|
|
1911
|
+
secret_actions: t.optional(t.boolean()),
|
|
1912
|
+
panels: t.optional(t.boolean()),
|
|
1913
|
+
// On a scope, the extension goes by the name of its first entry there.
|
|
1914
|
+
entry_named: t.optional(t.boolean()),
|
|
1915
|
+
pages: t.optional(t.array(PageDecl)),
|
|
1916
|
+
// A directory, relative to the manifest, of prompt material the host offers agent executors.
|
|
1917
|
+
playbooks: t.optional(t.string()),
|
|
1918
|
+
probes: t.optional(t.array(ProbeInfo)),
|
|
1919
|
+
// The `open-conduit init <type>` flow (setup.run).
|
|
1920
|
+
setup: t.optional(SetupDecl),
|
|
1921
|
+
// Its Work proposes configuration for the operator to review (config.candidate); it needs config.read.
|
|
1922
|
+
config_candidate: t.optional(t.boolean()),
|
|
1923
|
+
// Calendar recurrence kinds for timer.arm (recurrence.next).
|
|
1924
|
+
recurrences: t.optional(t.array(t.string())),
|
|
1925
|
+
// Its wait operations' dependencies carry a filter it decides (dependency.filter); it needs a wait operation.
|
|
1926
|
+
dependency_filter: t.optional(t.boolean()),
|
|
1927
|
+
// Asked about other extensions' operation calls (operation.gate); it needs the operation.gate permission.
|
|
1928
|
+
operation_gate: t.optional(t.boolean()),
|
|
1929
|
+
// Asked before any Work's first attempt starts (work.admit); it needs the work.start_gate permission.
|
|
1930
|
+
start_gate: t.optional(t.boolean()),
|
|
1931
|
+
// Renders its own families for agent prompts (event.render).
|
|
1932
|
+
render: t.optional(t.boolean()),
|
|
1933
|
+
// Wait target kinds it resolves (target.resolve).
|
|
1934
|
+
targets: t.optional(t.array(t.string())),
|
|
1935
|
+
// Told when an execution's container segment ends (segment.ended).
|
|
1936
|
+
segment_end: t.optional(t.boolean()),
|
|
1937
|
+
}, open);
|
|
1938
|
+
export const Manifest = t.object({
|
|
1939
|
+
protocol: t.array(t.integer()),
|
|
1940
|
+
name: t.string(),
|
|
1941
|
+
version: t.string(),
|
|
1942
|
+
title: t.optional(t.string()),
|
|
1943
|
+
summary: t.optional(t.string()),
|
|
1944
|
+
command: t.array(t.string()),
|
|
1945
|
+
kv_version: t.optional(t.integer()),
|
|
1946
|
+
permissions: t.optional(t.array(t.string())),
|
|
1947
|
+
provides: Provides,
|
|
1948
|
+
}, open);
|
|
1949
|
+
export const OperationCase = t.object({
|
|
1950
|
+
operation: t.string(),
|
|
1951
|
+
input: Payload,
|
|
1952
|
+
output: t.optional(Payload),
|
|
1953
|
+
// The refusal code expected instead of an output.
|
|
1954
|
+
error: t.optional(t.string()),
|
|
1955
|
+
}, open);
|
|
1956
|
+
/**
|
|
1957
|
+
* An issuer config of a declared credential verifier type and whether
|
|
1958
|
+
* validate (kind verifier) must refuse it; under an accepted one,
|
|
1959
|
+
* credential.verify must refuse each of refused_tokens, and the runner adds
|
|
1960
|
+
* one that is no credential at all (verifiers.policy).
|
|
1961
|
+
*/
|
|
1962
|
+
export const VerifierCase = t.object({
|
|
1963
|
+
type: t.string(),
|
|
1964
|
+
config: t.optional(t.any()),
|
|
1965
|
+
refused: t.optional(t.boolean()),
|
|
1966
|
+
refused_tokens: t.optional(t.array(t.string())),
|
|
1967
|
+
}, open);
|
|
1968
|
+
/** A whole container config of a declared container type and whether validate (kind container) must refuse it (containers.policy). */
|
|
1969
|
+
export const ContainerCase = t.object({
|
|
1970
|
+
type: t.string(),
|
|
1971
|
+
config: t.optional(t.any()),
|
|
1972
|
+
refused: t.optional(t.boolean()),
|
|
1973
|
+
}, open);
|
|
1974
|
+
/**
|
|
1975
|
+
* A resource config and the answers config check must get for it
|
|
1976
|
+
* (resources.workspace): mode_default, the mode validate resource_mode
|
|
1977
|
+
* names, and sandbox_refused, whether validate resource_sandbox refuses it
|
|
1978
|
+
* for a binding whose executor requests mode.
|
|
1979
|
+
*/
|
|
1980
|
+
export const ResourceCase = t.object({
|
|
1981
|
+
type: t.string(),
|
|
1982
|
+
config: t.optional(t.any()),
|
|
1983
|
+
mode_default: t.optional(t.string()),
|
|
1984
|
+
mode: t.optional(t.string()),
|
|
1985
|
+
sandbox_refused: t.optional(t.boolean()),
|
|
1986
|
+
}, open);
|
|
1987
|
+
/** A sandbox config of a declared sandbox type and whether validate (kind sandbox) must refuse it (sandboxes.policy). */
|
|
1988
|
+
export const SandboxCase = t.object({
|
|
1989
|
+
type: t.string(),
|
|
1990
|
+
config: t.optional(t.any()),
|
|
1991
|
+
refused: t.optional(t.boolean()),
|
|
1992
|
+
}, open);
|
|
1993
|
+
/** A tunnel config of a declared tunnel type and whether validate (kind tunnel) must refuse it (tunnels.policy). */
|
|
1994
|
+
export const TunnelCase = t.object({
|
|
1995
|
+
type: t.string(),
|
|
1996
|
+
config: t.optional(t.any()),
|
|
1997
|
+
refused: t.optional(t.boolean()),
|
|
1998
|
+
}, open);
|
|
1999
|
+
/** The binding config an attempt of executor.conformance runs with; it must finish on its own. */
|
|
2000
|
+
export const ExecutorCase = t.object({
|
|
2001
|
+
executor: t.string(),
|
|
2002
|
+
config: Payload,
|
|
2003
|
+
}, open);
|
|
2004
|
+
/**
|
|
2005
|
+
* The binding config executor.inject runs an attempt with: it runs until
|
|
2006
|
+
* the runner creates finish_file, and takes input once ready_file exists
|
|
2007
|
+
* ({state} is the extension's state directory).
|
|
2008
|
+
*/
|
|
2009
|
+
export const InjectCase = t.object({
|
|
2010
|
+
executor: t.string(),
|
|
2011
|
+
config: Payload,
|
|
2012
|
+
ready_file: t.optional(t.string()),
|
|
2013
|
+
finish_file: t.string(),
|
|
2014
|
+
}, open);
|
|
2015
|
+
export const Fixture = t.object({
|
|
2016
|
+
entries: t.optional(t.array(ConfigEntry)),
|
|
2017
|
+
secrets: t.optional(t.record(t.string())),
|
|
2018
|
+
scopes: t.optional(t.array(t.string())),
|
|
2019
|
+
operations: t.optional(t.array(OperationCase)),
|
|
2020
|
+
executor: t.optional(ExecutorCase),
|
|
2021
|
+
inject: t.optional(InjectCase),
|
|
2022
|
+
resources: t.optional(t.array(ResourceCase)),
|
|
2023
|
+
sandboxes: t.optional(t.array(SandboxCase)),
|
|
2024
|
+
containers: t.optional(t.array(ContainerCase)),
|
|
2025
|
+
tunnels: t.optional(t.array(TunnelCase)),
|
|
2026
|
+
verifiers: t.optional(t.array(VerifierCase)),
|
|
2027
|
+
}, open);
|
|
2028
|
+
/** A package's certification.json: the fixture `extension certify` runs. */
|
|
2029
|
+
export const CertificationFile = t.object({
|
|
2030
|
+
fixture: t.optional(Fixture),
|
|
2031
|
+
command: t.optional(t.array(t.string())),
|
|
2032
|
+
}, open);
|
|
2033
|
+
// In-transaction and routing hooks (recurrence.next, dependency.filter,
|
|
2034
|
+
// operation.gate, work.admit, target.resolve, segment.ended, event.render)
|
|
2035
|
+
// and the host calls that go with them.
|
|
2036
|
+
/** A one-shot or recurring timer (domain.Timer). */
|
|
2037
|
+
export const Timer = t.object({
|
|
2038
|
+
id: t.string(),
|
|
2039
|
+
fire_at: t.string(),
|
|
2040
|
+
event: Event,
|
|
2041
|
+
revision: t.optional(t.integer()),
|
|
2042
|
+
created_at: t.optional(t.string()),
|
|
2043
|
+
updated_at: t.optional(t.string()),
|
|
2044
|
+
}, open);
|
|
2045
|
+
export const RecurrenceNextParams = t.object({
|
|
2046
|
+
kind: t.string(),
|
|
2047
|
+
// The recurrence's spec as timer.arm gave it: any JSON value.
|
|
2048
|
+
spec: t.optional(t.any()),
|
|
2049
|
+
fired: Timer,
|
|
2050
|
+
now: t.string(),
|
|
2051
|
+
}, open);
|
|
2052
|
+
export const RecurrenceNextResult = t.object({
|
|
2053
|
+
occurrence: t.optional(Event),
|
|
2054
|
+
next: t.optional(Timer),
|
|
2055
|
+
}, open);
|
|
2056
|
+
export const DependencyFilterParams = t.object({
|
|
2057
|
+
filter: Payload,
|
|
2058
|
+
event: Event,
|
|
2059
|
+
}, open);
|
|
2060
|
+
export const DependencyFilterResult = t.object({
|
|
2061
|
+
match: t.boolean(),
|
|
2062
|
+
}, open);
|
|
2063
|
+
export const OperationGateParams = t.object({
|
|
2064
|
+
operation: t.string(),
|
|
2065
|
+
owner: t.string(),
|
|
2066
|
+
authority: Authority,
|
|
2067
|
+
input: Payload,
|
|
2068
|
+
// The capability a client made the call for, absent for the agent's own call.
|
|
2069
|
+
capability: t.optional(t.string()),
|
|
2070
|
+
// The called operation's sentence for a person, absent when it declares none.
|
|
2071
|
+
wants: t.optional(t.string()),
|
|
2072
|
+
}, open);
|
|
2073
|
+
export const OperationGateResult = t.object({
|
|
2074
|
+
wait: t.optional(WaitPlan),
|
|
2075
|
+
}, open);
|
|
2076
|
+
export const WorkAdmitParams = t.object({
|
|
2077
|
+
work: Work,
|
|
2078
|
+
binding: t.string(),
|
|
2079
|
+
event: Event,
|
|
2080
|
+
}, open);
|
|
2081
|
+
export const StartHold = t.object({
|
|
2082
|
+
reason: t.optional(t.string()),
|
|
2083
|
+
}, open);
|
|
2084
|
+
export const WorkAdmitResult = t.object({
|
|
2085
|
+
hold: t.optional(StartHold),
|
|
2086
|
+
}, open);
|
|
2087
|
+
export const WorkSettleHoldParams = t.object({
|
|
2088
|
+
work_id: t.string(),
|
|
2089
|
+
admit: t.boolean(),
|
|
2090
|
+
reason: t.optional(t.string()),
|
|
2091
|
+
key: t.string(),
|
|
2092
|
+
}, open);
|
|
2093
|
+
export const WorkSettleHoldResult = t.object({
|
|
2094
|
+
event_id: t.string(),
|
|
2095
|
+
}, open);
|
|
2096
|
+
export const TargetResolveParams = t.object({
|
|
2097
|
+
scope_id: t.string(),
|
|
2098
|
+
kind: t.string(),
|
|
2099
|
+
name: t.string(),
|
|
2100
|
+
}, open);
|
|
2101
|
+
export const TargetResolveResult = t.object({
|
|
2102
|
+
key: Key,
|
|
2103
|
+
types: t.optional(t.array(t.string())),
|
|
2104
|
+
ok: t.boolean(),
|
|
2105
|
+
}, open);
|
|
2106
|
+
export const SegmentEndedParams = t.object({
|
|
2107
|
+
execution_id: t.string(),
|
|
2108
|
+
}, open);
|
|
2109
|
+
export const EventRenderParams = t.object({
|
|
2110
|
+
event: Event,
|
|
2111
|
+
}, open);
|
|
2112
|
+
export const EventRenderResult = t.object({
|
|
2113
|
+
text: t.optional(t.string()),
|
|
2114
|
+
ok: t.boolean(),
|
|
2115
|
+
}, open);
|
|
2116
|
+
export const EventRenderOwnedParams = t.object({
|
|
2117
|
+
event: Event,
|
|
2118
|
+
}, open);
|
|
2119
|
+
export const ScopeAuthorizeParams = t.object({
|
|
2120
|
+
kind: t.string(),
|
|
2121
|
+
from: t.string(),
|
|
2122
|
+
to: t.string(),
|
|
2123
|
+
}, open);
|
|
2124
|
+
export const ScopeAuthorizeResult = t.object({
|
|
2125
|
+
allowed: t.boolean(),
|
|
2126
|
+
reason: t.optional(t.string()),
|
|
2127
|
+
}, open);
|
|
2128
|
+
export const TimerArmParams = t.object({
|
|
2129
|
+
scope_id: t.string(),
|
|
2130
|
+
timer: Timer,
|
|
2131
|
+
expected: t.integer(),
|
|
2132
|
+
kind: t.string(),
|
|
2133
|
+
spec: t.any(),
|
|
2134
|
+
}, open);
|
|
2135
|
+
export const TimerCancelParams = t.object({
|
|
2136
|
+
id: t.string(),
|
|
2137
|
+
expected: t.integer(),
|
|
2138
|
+
}, open);
|
|
2139
|
+
export const WorkCancelParams = t.object({
|
|
2140
|
+
work_id: t.string(),
|
|
2141
|
+
expected: t.integer(),
|
|
2142
|
+
reason: t.string(),
|
|
2143
|
+
key: t.string(),
|
|
2144
|
+
}, open);
|
|
2145
|
+
export const WorkCancelResult = t.object({
|
|
2146
|
+
event_id: t.string(),
|
|
2147
|
+
}, open);
|
|
2148
|
+
// Actions an extension takes for a person on its own surface (action.*,
|
|
2149
|
+
// request.list; permission action.submit).
|
|
2150
|
+
export const ActionSubmitParams = t.object({
|
|
2151
|
+
scope_id: t.string(),
|
|
2152
|
+
work_id: t.optional(t.string()),
|
|
2153
|
+
provider: t.optional(t.string()),
|
|
2154
|
+
action: t.string(),
|
|
2155
|
+
input: t.optional(t.string()),
|
|
2156
|
+
caller: t.string(),
|
|
2157
|
+
key: t.string(),
|
|
2158
|
+
}, open);
|
|
2159
|
+
export const ActionSubmitResult = t.object({
|
|
2160
|
+
event: AcceptedEvent,
|
|
2161
|
+
added: t.boolean(),
|
|
2162
|
+
message: t.optional(t.string()),
|
|
2163
|
+
}, open);
|
|
2164
|
+
export const ActionListParams = t.object({
|
|
2165
|
+
scope_id: t.string(),
|
|
2166
|
+
work_id: t.optional(t.string()),
|
|
2167
|
+
}, open);
|
|
2168
|
+
export const ActionOffer = t.object({
|
|
2169
|
+
provider: t.string(),
|
|
2170
|
+
id: t.string(),
|
|
2171
|
+
label: t.string(),
|
|
2172
|
+
prompt: t.optional(t.string()),
|
|
2173
|
+
choices: t.optional(t.array(t.string())),
|
|
2174
|
+
detail: t.optional(t.string()),
|
|
2175
|
+
awaited: t.optional(t.boolean()),
|
|
2176
|
+
}, open);
|
|
2177
|
+
export const ActionListResult = t.object({
|
|
2178
|
+
actions: t.nullable(t.array(ActionOffer)),
|
|
2179
|
+
}, open);
|
|
2180
|
+
export const RequestListParams = t.object({
|
|
2181
|
+
scope_id: t.string(),
|
|
2182
|
+
work_id: t.string(),
|
|
2183
|
+
}, open);
|
|
2184
|
+
export const RequestOffer = t.object({
|
|
2185
|
+
provider: t.string(),
|
|
2186
|
+
id: t.string(),
|
|
2187
|
+
label: t.string(),
|
|
2188
|
+
detail: t.optional(t.string()),
|
|
2189
|
+
action: t.optional(t.string()),
|
|
2190
|
+
responders: t.optional(t.array(t.string())),
|
|
2191
|
+
state: t.string(),
|
|
2192
|
+
by: t.optional(t.string()),
|
|
2193
|
+
settled_at: t.optional(t.string()),
|
|
2194
|
+
wording: t.optional(Wording),
|
|
2195
|
+
}, open);
|
|
2196
|
+
export const RequestListResult = t.object({
|
|
2197
|
+
requests: t.nullable(t.array(RequestOffer)),
|
|
2198
|
+
}, open);
|
|
2199
|
+
export const ProbeListResult = t.object({
|
|
2200
|
+
probes: t.nullable(t.array(ProbeInfo)),
|
|
2201
|
+
}, open);
|
|
2202
|
+
export const EntrySandboxParams = t.object({
|
|
2203
|
+
scope: t.string(),
|
|
2204
|
+
entry: t.string(),
|
|
2205
|
+
needs: SandboxNeeds,
|
|
2206
|
+
launch: SandboxLaunch,
|
|
2207
|
+
}, open);
|
|
2208
|
+
export const EntrySandboxResult = t.object({
|
|
2209
|
+
plan: SandboxPlan,
|
|
2210
|
+
dir: t.string(),
|
|
2211
|
+
}, open);
|