@kitman-sh/loops 0.0.0-stage → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/index.js +1066 -0
  2. package/package.json +19 -4
  3. package/types/packages/core/src/agent-environment.d.ts +2429 -0
  4. package/types/packages/core/src/agent-sandbox-policy.d.ts +33 -0
  5. package/types/packages/core/src/common.d.ts +6 -0
  6. package/types/packages/core/src/context-pack.d.ts +182 -0
  7. package/types/packages/core/src/extension.d.ts +35 -0
  8. package/types/packages/core/src/kit.d.ts +1489 -0
  9. package/types/packages/core/src/loop-layers.d.ts +59 -0
  10. package/types/packages/core/src/loop-version.d.ts +59 -0
  11. package/types/packages/core/src/loop.d.ts +3076 -0
  12. package/types/packages/core/src/package-declarations.d.ts +435 -0
  13. package/types/packages/core/src/proposal.d.ts +292 -0
  14. package/types/packages/core/src/redaction.d.ts +73 -0
  15. package/types/packages/core/src/run.d.ts +566 -0
  16. package/types/packages/core/src/runtime-type.d.ts +36 -0
  17. package/types/packages/core/src/schedule.d.ts +136 -0
  18. package/types/packages/core/src/schema.d.ts +89 -0
  19. package/types/packages/core/src/trigger-dispatch.d.ts +421 -0
  20. package/types/packages/loops/src/build.d.ts +33 -0
  21. package/types/packages/loops/src/change-request-body.d.ts +14 -0
  22. package/types/packages/loops/src/code-quality-pass.d.ts +50 -0
  23. package/types/packages/loops/src/code-quality.d.ts +26 -0
  24. package/types/packages/loops/src/hello.d.ts +9 -0
  25. package/types/packages/loops/src/incident.d.ts +13 -0
  26. package/types/packages/loops/src/index.d.ts +172 -0
  27. package/types/packages/loops/src/plan.d.ts +37 -0
  28. package/types/packages/loops/src/release.d.ts +21 -0
  29. package/types/packages/loops/src/research.d.ts +8 -0
  30. package/types/packages/loops/src/review.d.ts +38 -0
  31. package/types/packages/sdk/src/loop/activities.d.ts +187 -0
  32. package/types/packages/sdk/src/loop/check.d.ts +39 -0
  33. package/types/packages/sdk/src/loop/config.d.ts +68 -0
  34. package/types/packages/sdk/src/loop/define.d.ts +76 -0
  35. package/types/packages/sdk/src/loop/evidence.d.ts +66 -0
  36. package/types/packages/sdk/src/loop/index.d.ts +9 -0
  37. package/types/packages/sdk/src/loop/plan.d.ts +43 -0
  38. package/types/packages/sdk/src/loop/review.d.ts +86 -0
  39. package/types/packages/sdk/src/loop/steps.d.ts +224 -0
  40. package/types/packages/sdk/src/loop/test-loop.d.ts +112 -0
  41. package/README.md +0 -3
@@ -0,0 +1,566 @@
1
+ import * as Schema from 'effect/Schema';
2
+ export declare const RunContractVersion: Schema.Literal<"run.v1">;
3
+ export type RunContractVersion = (typeof RunContractVersion)['Type'];
4
+ export type SafeJson = null | boolean | number | string | readonly SafeJson[] | {
5
+ readonly [key: string]: SafeJson;
6
+ };
7
+ export declare const SafeJson: Schema.Codec<SafeJson>;
8
+ export declare const RunActorRef: Schema.Struct<{
9
+ readonly actorType: Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>, Schema.Literal<"runner">]>;
10
+ readonly actorId: Schema.String;
11
+ readonly delegatedByUserId: Schema.optionalKey<Schema.String>;
12
+ readonly agentIdentityId: Schema.optionalKey<Schema.String>;
13
+ readonly runnerId: Schema.optionalKey<Schema.String>;
14
+ }>;
15
+ export type RunActorRef = (typeof RunActorRef)['Type'];
16
+ export declare const RunResourceRef: Schema.Struct<{
17
+ readonly kind: Schema.String;
18
+ readonly id: Schema.String;
19
+ }>;
20
+ export type RunResourceRef = (typeof RunResourceRef)['Type'];
21
+ export declare const RunSchemaRef: Schema.Struct<{
22
+ readonly kind: Schema.Literal<"typebox_ref">;
23
+ readonly name: Schema.String;
24
+ readonly version: Schema.String;
25
+ readonly sha256: Schema.String;
26
+ }>;
27
+ export type RunSchemaRef = (typeof RunSchemaRef)['Type'];
28
+ export declare const AgentPinnedKitRef: Schema.Struct<{
29
+ readonly kitId: Schema.String;
30
+ readonly version: Schema.Int;
31
+ readonly sha256: Schema.String;
32
+ readonly precedence: Schema.Int;
33
+ readonly required: Schema.Boolean;
34
+ }>;
35
+ export type AgentPinnedKitRef = (typeof AgentPinnedKitRef)['Type'];
36
+ export declare const AgentSkillRef: Schema.Struct<{
37
+ readonly sourceId: Schema.String;
38
+ readonly name: Schema.String;
39
+ readonly version: Schema.optionalKey<Schema.String>;
40
+ readonly sha256: Schema.optionalKey<Schema.String>;
41
+ readonly required: Schema.Boolean;
42
+ }>;
43
+ export type AgentSkillRef = (typeof AgentSkillRef)['Type'];
44
+ export declare const AgentReference: Schema.Union<readonly [Schema.Struct<{
45
+ readonly agentId: Schema.String;
46
+ readonly alias: Schema.String;
47
+ }>, Schema.Struct<{
48
+ readonly agentId: Schema.String;
49
+ readonly version: Schema.Int;
50
+ readonly digest: Schema.String;
51
+ }>]>;
52
+ export type AgentReference = (typeof AgentReference)['Type'];
53
+ export declare const AgentToolGrant: Schema.Struct<{
54
+ readonly ref: Schema.String;
55
+ readonly inputSchema: Schema.optionalKey<Schema.Struct<{
56
+ readonly kind: Schema.Literal<"typebox_ref">;
57
+ readonly name: Schema.String;
58
+ readonly version: Schema.String;
59
+ readonly sha256: Schema.String;
60
+ }>>;
61
+ readonly scope: Schema.optionalKey<Schema.Struct<{
62
+ readonly kind: Schema.String;
63
+ readonly id: Schema.String;
64
+ }>>;
65
+ readonly approval: Schema.Union<readonly [Schema.Literal<"none">, Schema.Literal<"human_each_call">, Schema.Literal<"human_once">]>;
66
+ readonly delegable: Schema.Boolean;
67
+ }>;
68
+ export type AgentToolGrant = (typeof AgentToolGrant)['Type'];
69
+ export declare const AgentHarnessSelector: Schema.Struct<{
70
+ readonly mode: Schema.Union<readonly [Schema.Literal<"direct_model">, Schema.Literal<"harness_v1">, Schema.Literal<"native">]>;
71
+ readonly harness: Schema.optionalKey<Schema.String>;
72
+ readonly adapterRef: Schema.optionalKey<Schema.String>;
73
+ readonly requiredCapabilities: Schema.$Array<Schema.String>;
74
+ readonly allowedFallbacks: Schema.$Array<Schema.String>;
75
+ }>;
76
+ export type AgentHarnessSelector = (typeof AgentHarnessSelector)['Type'];
77
+ export declare const AgentModelSelector: Schema.Struct<{
78
+ readonly providerRef: Schema.String;
79
+ readonly modelRef: Schema.String;
80
+ readonly profile: Schema.optionalKey<Schema.String>;
81
+ readonly reasoning: Schema.optionalKey<Schema.String>;
82
+ }>;
83
+ export type AgentModelSelector = (typeof AgentModelSelector)['Type'];
84
+ export declare const AgentPolicy: Schema.Struct<{
85
+ readonly requestedCapabilities: Schema.$Array<Schema.String>;
86
+ readonly maxChildDepth: Schema.Int;
87
+ readonly allowSubdelegation: Schema.Boolean;
88
+ readonly maxWallSeconds: Schema.optionalKey<Schema.Int>;
89
+ readonly maxInputTokens: Schema.optionalKey<Schema.Int>;
90
+ readonly maxOutputTokens: Schema.optionalKey<Schema.Int>;
91
+ readonly hardLimit: Schema.Boolean;
92
+ }>;
93
+ export type AgentPolicy = (typeof AgentPolicy)['Type'];
94
+ export declare const AgentProvenance: Schema.Struct<{
95
+ readonly source: Schema.Union<readonly [Schema.Literal<"kitman">, Schema.Literal<"workspace">, Schema.Literal<"project">, Schema.Literal<"git">, Schema.Literal<"package">, Schema.Literal<"import">]>;
96
+ readonly sourceRef: Schema.optionalKey<Schema.String>;
97
+ readonly sourceCommitSha: Schema.optionalKey<Schema.String>;
98
+ readonly contentSha256: Schema.String;
99
+ readonly reviewedBy: Schema.optionalKey<Schema.$Array<Schema.Struct<{
100
+ readonly actorType: Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>, Schema.Literal<"runner">]>;
101
+ readonly actorId: Schema.String;
102
+ readonly delegatedByUserId: Schema.optionalKey<Schema.String>;
103
+ readonly agentIdentityId: Schema.optionalKey<Schema.String>;
104
+ readonly runnerId: Schema.optionalKey<Schema.String>;
105
+ }>>>;
106
+ }>;
107
+ export type AgentProvenance = (typeof AgentProvenance)['Type'];
108
+ export declare const Agent: Schema.Struct<{
109
+ readonly contractVersion: Schema.Literal<"run.v1">;
110
+ readonly id: Schema.String;
111
+ readonly workspaceId: Schema.String;
112
+ readonly projectId: Schema.optionalKey<Schema.String>;
113
+ readonly name: Schema.String;
114
+ readonly slug: Schema.String;
115
+ readonly currentVersion: Schema.optionalKey<Schema.Int>;
116
+ readonly status: Schema.Union<readonly [Schema.Literal<"draft">, Schema.Literal<"published">, Schema.Literal<"deprecated">, Schema.Literal<"disabled">, Schema.Literal<"archived">]>;
117
+ readonly createdBy: Schema.Struct<{
118
+ readonly actorType: Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>, Schema.Literal<"runner">]>;
119
+ readonly actorId: Schema.String;
120
+ readonly delegatedByUserId: Schema.optionalKey<Schema.String>;
121
+ readonly agentIdentityId: Schema.optionalKey<Schema.String>;
122
+ readonly runnerId: Schema.optionalKey<Schema.String>;
123
+ }>;
124
+ readonly createdAt: Schema.String;
125
+ readonly updatedAt: Schema.String;
126
+ }>;
127
+ export type Agent = (typeof Agent)['Type'];
128
+ export declare const RunMessagePayload: Schema.Union<readonly [Schema.Struct<{
129
+ readonly type: Schema.Literal<"progress">;
130
+ readonly summary: Schema.String;
131
+ readonly phase: Schema.optionalKey<Schema.String>;
132
+ readonly percent: Schema.optionalKey<Schema.Finite>;
133
+ readonly evidenceRefs: Schema.optionalKey<Schema.$Array<Schema.Struct<{
134
+ readonly kind: Schema.String;
135
+ readonly id: Schema.String;
136
+ }>>>;
137
+ }>, Schema.Struct<{
138
+ readonly type: Schema.Literal<"question">;
139
+ readonly questionId: Schema.String;
140
+ readonly prompt: Schema.String;
141
+ readonly answerSchema: Schema.Struct<{
142
+ readonly kind: Schema.Literal<"typebox_ref">;
143
+ readonly name: Schema.String;
144
+ readonly version: Schema.String;
145
+ readonly sha256: Schema.String;
146
+ }>;
147
+ readonly urgency: Schema.Union<readonly [Schema.Literal<"normal">, Schema.Literal<"blocking">]>;
148
+ readonly waitId: Schema.String;
149
+ }>, Schema.Struct<{
150
+ readonly type: Schema.Literal<"answer">;
151
+ readonly questionId: Schema.String;
152
+ readonly answer: Schema.Codec<SafeJson, SafeJson, never, never>;
153
+ readonly answerSchema: Schema.Struct<{
154
+ readonly kind: Schema.Literal<"typebox_ref">;
155
+ readonly name: Schema.String;
156
+ readonly version: Schema.String;
157
+ readonly sha256: Schema.String;
158
+ }>;
159
+ readonly waitId: Schema.String;
160
+ }>, Schema.Struct<{
161
+ readonly type: Schema.Literal<"context_request">;
162
+ readonly requestId: Schema.String;
163
+ readonly refs: Schema.$Array<Schema.Struct<{
164
+ readonly kind: Schema.String;
165
+ readonly id: Schema.String;
166
+ }>>;
167
+ readonly reason: Schema.String;
168
+ }>, Schema.Struct<{
169
+ readonly type: Schema.Literal<"context_response">;
170
+ readonly requestId: Schema.String;
171
+ readonly refs: Schema.$Array<Schema.Struct<{
172
+ readonly kind: Schema.String;
173
+ readonly id: Schema.String;
174
+ }>>;
175
+ readonly summaries: Schema.$Array<Schema.Codec<SafeJson, SafeJson, never, never>>;
176
+ }>, Schema.Struct<{
177
+ readonly type: Schema.Literal<"finding">;
178
+ readonly severity: Schema.Union<readonly [Schema.Literal<"info">, Schema.Literal<"low">, Schema.Literal<"medium">, Schema.Literal<"high">, Schema.Literal<"critical">]>;
179
+ readonly category: Schema.String;
180
+ readonly summary: Schema.String;
181
+ readonly evidenceRefs: Schema.$Array<Schema.Struct<{
182
+ readonly kind: Schema.String;
183
+ readonly id: Schema.String;
184
+ }>>;
185
+ }>, Schema.Struct<{
186
+ readonly type: Schema.Literal<"partial_result">;
187
+ readonly outputSchema: Schema.Struct<{
188
+ readonly kind: Schema.Literal<"typebox_ref">;
189
+ readonly name: Schema.String;
190
+ readonly version: Schema.String;
191
+ readonly sha256: Schema.String;
192
+ }>;
193
+ readonly data: Schema.Codec<SafeJson, SafeJson, never, never>;
194
+ readonly complete: Schema.Literal<false>;
195
+ }>, Schema.Struct<{
196
+ readonly type: Schema.Literal<"handoff">;
197
+ readonly summary: Schema.String;
198
+ readonly nextAction: Schema.optionalKey<Schema.String>;
199
+ readonly evidenceRefs: Schema.optionalKey<Schema.$Array<Schema.Struct<{
200
+ readonly kind: Schema.String;
201
+ readonly id: Schema.String;
202
+ }>>>;
203
+ }>, Schema.Struct<{
204
+ readonly type: Schema.Literal<"instruction">;
205
+ readonly instruction: Schema.String;
206
+ readonly authority: Schema.Union<readonly [Schema.Literal<"normal">, Schema.Literal<"operator">]>;
207
+ }>, Schema.Struct<{
208
+ readonly type: Schema.Literal<"notice">;
209
+ readonly code: Schema.String;
210
+ readonly summary: Schema.String;
211
+ }>]>;
212
+ export type RunMessagePayload = (typeof RunMessagePayload)['Type'];
213
+ export declare const RunMessage: Schema.Struct<{
214
+ readonly contractVersion: Schema.Literal<"run.v1">;
215
+ readonly id: Schema.String;
216
+ readonly workspaceId: Schema.String;
217
+ readonly projectId: Schema.optionalKey<Schema.String>;
218
+ readonly rootRunId: Schema.String;
219
+ readonly sender: Schema.Union<readonly [Schema.Struct<{
220
+ readonly kind: Schema.Union<readonly [Schema.Literal<"run">, Schema.Literal<"step_attempt">]>;
221
+ readonly id: Schema.String;
222
+ }>, Schema.Struct<{
223
+ readonly actorType: Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>, Schema.Literal<"runner">]>;
224
+ readonly actorId: Schema.String;
225
+ readonly delegatedByUserId: Schema.optionalKey<Schema.String>;
226
+ readonly agentIdentityId: Schema.optionalKey<Schema.String>;
227
+ readonly runnerId: Schema.optionalKey<Schema.String>;
228
+ }>]>;
229
+ readonly recipient: Schema.Struct<{
230
+ readonly kind: Schema.String;
231
+ readonly id: Schema.String;
232
+ }>;
233
+ readonly type: Schema.Literals<readonly ["progress", "question", "answer", "context_request", "context_response", "finding", "partial_result", "handoff", "instruction", "notice"]>;
234
+ readonly streamKey: Schema.String;
235
+ readonly sequence: Schema.Int;
236
+ readonly correlationId: Schema.optionalKey<Schema.String>;
237
+ readonly causationId: Schema.optionalKey<Schema.String>;
238
+ readonly replyToMessageId: Schema.optionalKey<Schema.String>;
239
+ readonly payloadSchema: Schema.optionalKey<Schema.Struct<{
240
+ readonly kind: Schema.Literal<"typebox_ref">;
241
+ readonly name: Schema.String;
242
+ readonly version: Schema.String;
243
+ readonly sha256: Schema.String;
244
+ }>>;
245
+ readonly payload: Schema.Union<readonly [Schema.Struct<{
246
+ readonly type: Schema.Literal<"progress">;
247
+ readonly summary: Schema.String;
248
+ readonly phase: Schema.optionalKey<Schema.String>;
249
+ readonly percent: Schema.optionalKey<Schema.Finite>;
250
+ readonly evidenceRefs: Schema.optionalKey<Schema.$Array<Schema.Struct<{
251
+ readonly kind: Schema.String;
252
+ readonly id: Schema.String;
253
+ }>>>;
254
+ }>, Schema.Struct<{
255
+ readonly type: Schema.Literal<"question">;
256
+ readonly questionId: Schema.String;
257
+ readonly prompt: Schema.String;
258
+ readonly answerSchema: Schema.Struct<{
259
+ readonly kind: Schema.Literal<"typebox_ref">;
260
+ readonly name: Schema.String;
261
+ readonly version: Schema.String;
262
+ readonly sha256: Schema.String;
263
+ }>;
264
+ readonly urgency: Schema.Union<readonly [Schema.Literal<"normal">, Schema.Literal<"blocking">]>;
265
+ readonly waitId: Schema.String;
266
+ }>, Schema.Struct<{
267
+ readonly type: Schema.Literal<"answer">;
268
+ readonly questionId: Schema.String;
269
+ readonly answer: Schema.Codec<SafeJson, SafeJson, never, never>;
270
+ readonly answerSchema: Schema.Struct<{
271
+ readonly kind: Schema.Literal<"typebox_ref">;
272
+ readonly name: Schema.String;
273
+ readonly version: Schema.String;
274
+ readonly sha256: Schema.String;
275
+ }>;
276
+ readonly waitId: Schema.String;
277
+ }>, Schema.Struct<{
278
+ readonly type: Schema.Literal<"context_request">;
279
+ readonly requestId: Schema.String;
280
+ readonly refs: Schema.$Array<Schema.Struct<{
281
+ readonly kind: Schema.String;
282
+ readonly id: Schema.String;
283
+ }>>;
284
+ readonly reason: Schema.String;
285
+ }>, Schema.Struct<{
286
+ readonly type: Schema.Literal<"context_response">;
287
+ readonly requestId: Schema.String;
288
+ readonly refs: Schema.$Array<Schema.Struct<{
289
+ readonly kind: Schema.String;
290
+ readonly id: Schema.String;
291
+ }>>;
292
+ readonly summaries: Schema.$Array<Schema.Codec<SafeJson, SafeJson, never, never>>;
293
+ }>, Schema.Struct<{
294
+ readonly type: Schema.Literal<"finding">;
295
+ readonly severity: Schema.Union<readonly [Schema.Literal<"info">, Schema.Literal<"low">, Schema.Literal<"medium">, Schema.Literal<"high">, Schema.Literal<"critical">]>;
296
+ readonly category: Schema.String;
297
+ readonly summary: Schema.String;
298
+ readonly evidenceRefs: Schema.$Array<Schema.Struct<{
299
+ readonly kind: Schema.String;
300
+ readonly id: Schema.String;
301
+ }>>;
302
+ }>, Schema.Struct<{
303
+ readonly type: Schema.Literal<"partial_result">;
304
+ readonly outputSchema: Schema.Struct<{
305
+ readonly kind: Schema.Literal<"typebox_ref">;
306
+ readonly name: Schema.String;
307
+ readonly version: Schema.String;
308
+ readonly sha256: Schema.String;
309
+ }>;
310
+ readonly data: Schema.Codec<SafeJson, SafeJson, never, never>;
311
+ readonly complete: Schema.Literal<false>;
312
+ }>, Schema.Struct<{
313
+ readonly type: Schema.Literal<"handoff">;
314
+ readonly summary: Schema.String;
315
+ readonly nextAction: Schema.optionalKey<Schema.String>;
316
+ readonly evidenceRefs: Schema.optionalKey<Schema.$Array<Schema.Struct<{
317
+ readonly kind: Schema.String;
318
+ readonly id: Schema.String;
319
+ }>>>;
320
+ }>, Schema.Struct<{
321
+ readonly type: Schema.Literal<"instruction">;
322
+ readonly instruction: Schema.String;
323
+ readonly authority: Schema.Union<readonly [Schema.Literal<"normal">, Schema.Literal<"operator">]>;
324
+ }>, Schema.Struct<{
325
+ readonly type: Schema.Literal<"notice">;
326
+ readonly code: Schema.String;
327
+ readonly summary: Schema.String;
328
+ }>]>;
329
+ readonly delivery: Schema.Union<readonly [Schema.Literal<"created">, Schema.Literal<"queued">, Schema.Literal<"delivered">, Schema.Literal<"acknowledged">, Schema.Literal<"expired">, Schema.Literal<"failed">]>;
330
+ readonly idempotencyKey: Schema.String;
331
+ readonly expiresAt: Schema.optionalKey<Schema.String>;
332
+ readonly createdAt: Schema.String;
333
+ readonly acknowledgedAt: Schema.optionalKey<Schema.String>;
334
+ }>;
335
+ export type RunMessage = (typeof RunMessage)['Type'];
336
+ export declare const RunResult: Schema.Struct<{
337
+ readonly contractVersion: Schema.Literal<"run.v1">;
338
+ readonly id: Schema.String;
339
+ readonly workspaceId: Schema.String;
340
+ readonly projectId: Schema.optionalKey<Schema.String>;
341
+ readonly runId: Schema.String;
342
+ readonly rootRunId: Schema.String;
343
+ readonly attempt: Schema.Int;
344
+ readonly outcome: Schema.Union<readonly [Schema.Literal<"succeeded">, Schema.Literal<"failed">, Schema.Literal<"canceled">, Schema.Literal<"blocked">, Schema.Literal<"expired">]>;
345
+ readonly output: Schema.optionalKey<Schema.Struct<{
346
+ readonly schema: Schema.Struct<{
347
+ readonly kind: Schema.Literal<"typebox_ref">;
348
+ readonly name: Schema.String;
349
+ readonly version: Schema.String;
350
+ readonly sha256: Schema.String;
351
+ }>;
352
+ readonly data: Schema.Codec<SafeJson, SafeJson, never, never>;
353
+ readonly digest: Schema.String;
354
+ }>>;
355
+ readonly failure: Schema.optionalKey<Schema.Struct<{
356
+ readonly code: Schema.String;
357
+ readonly category: Schema.String;
358
+ readonly summary: Schema.String;
359
+ readonly retryable: Schema.Boolean;
360
+ readonly details: Schema.optionalKey<Schema.Codec<SafeJson, SafeJson, never, never>>;
361
+ }>>;
362
+ readonly evidenceRefs: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
363
+ readonly kind: Schema.String;
364
+ readonly id: Schema.String;
365
+ }>, Schema.Struct<{
366
+ readonly contractVersion: Schema.Literal<"evidence-ref.v1">;
367
+ readonly kind: Schema.String;
368
+ readonly summary: Schema.String;
369
+ readonly sha256: Schema.String;
370
+ readonly redaction: Schema.Literal<"redacted">;
371
+ readonly findingCount: Schema.Int;
372
+ readonly classifications: Schema.$Array<Schema.Union<readonly [Schema.Literal<"secret">, Schema.Literal<"credential">, Schema.Literal<"pii">, Schema.Literal<"source">, Schema.Literal<"log">, Schema.Literal<"diff">, Schema.Literal<"transcript">, Schema.Literal<"provider_payload">, Schema.Literal<"url">, Schema.Literal<"path">, Schema.Literal<"unknown">]>>;
373
+ }>]>>;
374
+ readonly childSummary: Schema.Struct<{
375
+ readonly awaited: Schema.Int;
376
+ readonly detached: Schema.Int;
377
+ readonly succeeded: Schema.Int;
378
+ readonly failed: Schema.Int;
379
+ readonly canceled: Schema.Int;
380
+ }>;
381
+ readonly usage: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<SafeJson, SafeJson, never, never>>>;
382
+ readonly producedBy: Schema.Struct<{
383
+ readonly workUnitId: Schema.optionalKey<Schema.String>;
384
+ readonly leaseId: Schema.optionalKey<Schema.String>;
385
+ readonly fencingTokenDigest: Schema.optionalKey<Schema.String>;
386
+ }>;
387
+ readonly createdAt: Schema.String;
388
+ readonly finalizedAt: Schema.String;
389
+ }>;
390
+ export type RunResult = (typeof RunResult)['Type'];
391
+ export declare const RunEvent: Schema.Struct<{
392
+ readonly contractVersion: Schema.Literal<"run.v1">;
393
+ readonly id: Schema.String;
394
+ readonly eventVersion: Schema.Literal<1>;
395
+ readonly streamId: Schema.String;
396
+ readonly sequence: Schema.Int;
397
+ readonly workspaceId: Schema.String;
398
+ readonly projectId: Schema.optionalKey<Schema.String>;
399
+ readonly subject: Schema.Struct<{
400
+ readonly kind: Schema.String;
401
+ readonly id: Schema.String;
402
+ }>;
403
+ readonly rootRunId: Schema.String;
404
+ readonly type: Schema.String;
405
+ readonly actor: Schema.optionalKey<Schema.Struct<{
406
+ readonly actorType: Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>, Schema.Literal<"runner">]>;
407
+ readonly actorId: Schema.String;
408
+ readonly delegatedByUserId: Schema.optionalKey<Schema.String>;
409
+ readonly agentIdentityId: Schema.optionalKey<Schema.String>;
410
+ readonly runnerId: Schema.optionalKey<Schema.String>;
411
+ }>>;
412
+ readonly correlationId: Schema.optionalKey<Schema.String>;
413
+ readonly causationId: Schema.optionalKey<Schema.String>;
414
+ readonly occurredAt: Schema.String;
415
+ readonly data: Schema.Struct<{
416
+ readonly type: Schema.String;
417
+ readonly value: Schema.Codec<SafeJson, SafeJson, never, never>;
418
+ }>;
419
+ }>;
420
+ export type RunEvent = (typeof RunEvent)['Type'];
421
+ export declare const Wait: Schema.Struct<{
422
+ readonly contractVersion: Schema.Literal<"run.v1">;
423
+ readonly id: Schema.String;
424
+ readonly workspaceId: Schema.String;
425
+ readonly projectId: Schema.optionalKey<Schema.String>;
426
+ readonly runId: Schema.String;
427
+ readonly rootRunId: Schema.String;
428
+ readonly stepKey: Schema.optionalKey<Schema.String>;
429
+ readonly kind: Schema.Literals<readonly ["timer", "message", "child_run", "external_event", "human_approval", "provider_check", "provider_quota", "resource"]>;
430
+ readonly state: Schema.Union<readonly [Schema.Literal<"open">, Schema.Literal<"resolved">, Schema.Literal<"expired">, Schema.Literal<"canceled">]>;
431
+ readonly correlation: Schema.$Record<Schema.String, Schema.Codec<SafeJson, SafeJson, never, never>>;
432
+ readonly expectedSchema: Schema.optionalKey<Schema.Struct<{
433
+ readonly kind: Schema.Literal<"typebox_ref">;
434
+ readonly name: Schema.String;
435
+ readonly version: Schema.String;
436
+ readonly sha256: Schema.String;
437
+ }>>;
438
+ readonly timeout: Schema.Struct<{
439
+ readonly dueAt: Schema.optionalKey<Schema.String>;
440
+ readonly onTimeout: Schema.Union<readonly [Schema.Literal<"fail">, Schema.Literal<"block">, Schema.Literal<"cancel">, Schema.Literal<"default">, Schema.Literal<"escalate">]>;
441
+ readonly defaultValue: Schema.optionalKey<Schema.Codec<SafeJson, SafeJson, never, never>>;
442
+ }>;
443
+ readonly responderScope: Schema.optionalKey<Schema.Struct<{
444
+ readonly kind: Schema.String;
445
+ readonly id: Schema.String;
446
+ }>>;
447
+ readonly resolution: Schema.optionalKey<Schema.Struct<{
448
+ readonly kind: Schema.String;
449
+ readonly data: Schema.optionalKey<Schema.Codec<SafeJson, SafeJson, never, never>>;
450
+ readonly digest: Schema.String;
451
+ readonly actor: Schema.optionalKey<Schema.Struct<{
452
+ readonly actorType: Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>, Schema.Literal<"runner">]>;
453
+ readonly actorId: Schema.String;
454
+ readonly delegatedByUserId: Schema.optionalKey<Schema.String>;
455
+ readonly agentIdentityId: Schema.optionalKey<Schema.String>;
456
+ readonly runnerId: Schema.optionalKey<Schema.String>;
457
+ }>>;
458
+ }>>;
459
+ readonly createdAt: Schema.String;
460
+ readonly resolvedAt: Schema.optionalKey<Schema.String>;
461
+ }>;
462
+ export type Wait = (typeof Wait)['Type'];
463
+ export declare const ControlCommand: Schema.Struct<{
464
+ readonly contractVersion: Schema.Literal<"run.v1">;
465
+ readonly id: Schema.String;
466
+ readonly workspaceId: Schema.String;
467
+ readonly projectId: Schema.optionalKey<Schema.String>;
468
+ readonly target: Schema.Struct<{
469
+ readonly kind: Schema.String;
470
+ readonly id: Schema.String;
471
+ }>;
472
+ readonly kind: Schema.Literals<readonly ["pause", "resume", "extend_budget", "cancel", "retry", "rerun_latest", "takeover", "release_takeover", "answer_wait", "approve_wait", "reject_wait", "refresh_context", "repair_readiness", "sync_agent_environment", "escalate_sandbox", "rotate_secret_ref", "rerun_verification", "create_follow_up", "drain_replica", "discard_cache", "request_status", "request_handoff"]>;
473
+ readonly payload: Schema.Struct<{
474
+ readonly kind: Schema.Literals<readonly ["pause", "resume", "extend_budget", "cancel", "retry", "rerun_latest", "takeover", "release_takeover", "answer_wait", "approve_wait", "reject_wait", "refresh_context", "repair_readiness", "sync_agent_environment", "escalate_sandbox", "rotate_secret_ref", "rerun_verification", "create_follow_up", "drain_replica", "discard_cache", "request_status", "request_handoff"]>;
475
+ readonly data: Schema.Codec<SafeJson, SafeJson, never, never>;
476
+ }>;
477
+ readonly requestedBy: Schema.Struct<{
478
+ readonly actorType: Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>, Schema.Literal<"runner">]>;
479
+ readonly actorId: Schema.String;
480
+ readonly delegatedByUserId: Schema.optionalKey<Schema.String>;
481
+ readonly agentIdentityId: Schema.optionalKey<Schema.String>;
482
+ readonly runnerId: Schema.optionalKey<Schema.String>;
483
+ }>;
484
+ readonly idempotencyKey: Schema.String;
485
+ readonly expectedResourceVersion: Schema.optionalKey<Schema.Int>;
486
+ readonly status: Schema.Union<readonly [Schema.Literal<"accepted">, Schema.Literal<"queued">, Schema.Literal<"applied">, Schema.Literal<"rejected">, Schema.Literal<"expired">, Schema.Literal<"superseded">]>;
487
+ readonly rejection: Schema.optionalKey<Schema.Struct<{
488
+ readonly code: Schema.String;
489
+ readonly summary: Schema.String;
490
+ }>>;
491
+ readonly createdAt: Schema.String;
492
+ readonly appliedAt: Schema.optionalKey<Schema.String>;
493
+ }>;
494
+ export type ControlCommand = (typeof ControlCommand)['Type'];
495
+ export declare const ControlCommandList: Schema.Struct<{
496
+ readonly items: Schema.$Array<Schema.Struct<{
497
+ readonly contractVersion: Schema.Literal<"run.v1">;
498
+ readonly id: Schema.String;
499
+ readonly workspaceId: Schema.String;
500
+ readonly projectId: Schema.optionalKey<Schema.String>;
501
+ readonly target: Schema.Struct<{
502
+ readonly kind: Schema.String;
503
+ readonly id: Schema.String;
504
+ }>;
505
+ readonly kind: Schema.Literals<readonly ["pause", "resume", "extend_budget", "cancel", "retry", "rerun_latest", "takeover", "release_takeover", "answer_wait", "approve_wait", "reject_wait", "refresh_context", "repair_readiness", "sync_agent_environment", "escalate_sandbox", "rotate_secret_ref", "rerun_verification", "create_follow_up", "drain_replica", "discard_cache", "request_status", "request_handoff"]>;
506
+ readonly payload: Schema.Struct<{
507
+ readonly kind: Schema.Literals<readonly ["pause", "resume", "extend_budget", "cancel", "retry", "rerun_latest", "takeover", "release_takeover", "answer_wait", "approve_wait", "reject_wait", "refresh_context", "repair_readiness", "sync_agent_environment", "escalate_sandbox", "rotate_secret_ref", "rerun_verification", "create_follow_up", "drain_replica", "discard_cache", "request_status", "request_handoff"]>;
508
+ readonly data: Schema.Codec<SafeJson, SafeJson, never, never>;
509
+ }>;
510
+ readonly requestedBy: Schema.Struct<{
511
+ readonly actorType: Schema.Union<readonly [Schema.Union<readonly [Schema.Literal<"human">, Schema.Literal<"delegated_agent">, Schema.Literal<"agent">]>, Schema.Literal<"runner">]>;
512
+ readonly actorId: Schema.String;
513
+ readonly delegatedByUserId: Schema.optionalKey<Schema.String>;
514
+ readonly agentIdentityId: Schema.optionalKey<Schema.String>;
515
+ readonly runnerId: Schema.optionalKey<Schema.String>;
516
+ }>;
517
+ readonly idempotencyKey: Schema.String;
518
+ readonly expectedResourceVersion: Schema.optionalKey<Schema.Int>;
519
+ readonly status: Schema.Union<readonly [Schema.Literal<"accepted">, Schema.Literal<"queued">, Schema.Literal<"applied">, Schema.Literal<"rejected">, Schema.Literal<"expired">, Schema.Literal<"superseded">]>;
520
+ readonly rejection: Schema.optionalKey<Schema.Struct<{
521
+ readonly code: Schema.String;
522
+ readonly summary: Schema.String;
523
+ }>>;
524
+ readonly createdAt: Schema.String;
525
+ readonly appliedAt: Schema.optionalKey<Schema.String>;
526
+ }>>;
527
+ }>;
528
+ export type ControlCommandList = (typeof ControlCommandList)['Type'];
529
+ export declare const RunCommandCenterSnapshot: Schema.Struct<{
530
+ readonly source: Schema.Literal<"http_snapshot">;
531
+ readonly collection: Schema.Literal<"run_command_center">;
532
+ readonly scope: Schema.Struct<{
533
+ readonly kind: Schema.Literal<"run">;
534
+ readonly workspaceId: Schema.String;
535
+ readonly projectId: Schema.optionalKey<Schema.String>;
536
+ readonly runId: Schema.String;
537
+ }>;
538
+ readonly capturedAt: Schema.String;
539
+ readonly consistency: Schema.Literal<"lower_bound">;
540
+ readonly lowerBound: Schema.String;
541
+ readonly isComplete: Schema.Literal<true>;
542
+ }>;
543
+ export type RunCommandCenterSnapshot = (typeof RunCommandCenterSnapshot)['Type'];
544
+ type HumanApprovalActor = Extract<RunActorRef, {
545
+ actorType: 'human';
546
+ }>;
547
+ export declare function isHumanApprovalActor(actor: RunActorRef): actor is HumanApprovalActor;
548
+ export declare function assertHumanOnlyWaitApproval(wait: Pick<Wait, 'kind'>, actor: RunActorRef): void;
549
+ export declare function assertBoundedRunData<ValueType>(value: ValueType): void;
550
+ /** Outcome of cancelling a Run's open wait through the public API. */
551
+ export type RunWaitCancellationResult = {
552
+ readonly status: 'completed';
553
+ readonly runId: string;
554
+ readonly waitId: string;
555
+ readonly outcome: 'cancelled' | 'timeout';
556
+ } | {
557
+ readonly status: 'duplicate';
558
+ readonly runId: string;
559
+ readonly waitId: string;
560
+ readonly outcome: 'cancelled' | 'timeout';
561
+ } | {
562
+ readonly status: 'ignored';
563
+ readonly runId: string;
564
+ readonly reason: 'no_open_wait' | 'cancellation_not_configured' | 'wait_closed';
565
+ };
566
+ export {};
@@ -0,0 +1,36 @@
1
+ type RuntimeTypeName = 'bigint' | 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined';
2
+ type JsonPrimitive = null | boolean | number | string;
3
+ export type JsonValue = JsonPrimitive | readonly JsonValue[] | JsonObject;
4
+ export type JsonObject = {
5
+ readonly [key: string]: JsonValue;
6
+ };
7
+ /** In-memory structured data, before normalization for a JSON boundary. */
8
+ export type StructuredValue = JsonValue | undefined | Date | readonly StructuredValue[] | StructuredObject;
9
+ export type StructuredObject = {
10
+ readonly [key: string]: StructuredValue;
11
+ };
12
+ /** Normalize a JavaScript value into data that serializes without information loss. */
13
+ export declare function toJsonValue<ValueType>(value: ValueType): JsonValue;
14
+ /** Narrow a value to one member of a readonly literal list. */
15
+ export declare function isOneOf<const Literal extends string | number, Value>(values: readonly Literal[], value: Value): value is Value & Literal;
16
+ /** Narrow a value to one member of a readonly literal set. */
17
+ export declare function isMemberOf<const Literal extends string | number, Value>(values: ReadonlySet<Literal>, value: Value): value is Value & Literal;
18
+ /** Narrow a property key to an own key of a lookup record. */
19
+ export declare function isKeyOf<Lookup extends object>(record: Lookup, key: PropertyKey): key is keyof Lookup;
20
+ /** Read an own data property of untrusted input as JSON; undefined when missing or not JSON. */
21
+ export declare function jsonProperty<Value extends object>(value: Value, key: string): JsonValue | undefined;
22
+ export declare function toJsonObject<ValueType>(value: ValueType): JsonObject;
23
+ type RuntimeNarrow<Value, Target, Fallback = Target> = [Extract<Value, Target>] extends [never] ? Value & Fallback : Extract<Value, Target>;
24
+ /** Runtime predicates for values entering an untyped boundary. */
25
+ export declare function isBigInt<Value>(value: Value): value is RuntimeNarrow<Value, bigint>;
26
+ export declare function isBoolean<Value>(value: Value): value is RuntimeNarrow<Value, boolean>;
27
+ export declare function isFunction<Value>(value: Value): value is RuntimeNarrow<Value, globalThis.Function>;
28
+ export declare function isNumber<Value>(value: Value): value is RuntimeNarrow<Value, number>;
29
+ export declare function isObject<Value>(value: Value): value is Value & object;
30
+ export declare function isJsonObject(value: JsonValue | undefined): value is JsonObject;
31
+ export declare function isString<Value>(value: Value): value is RuntimeNarrow<Value, string>;
32
+ export declare function isSymbol<Value>(value: Value): value is RuntimeNarrow<Value, symbol>;
33
+ export declare function isUndefined<Value>(value: Value): value is RuntimeNarrow<Value, undefined>;
34
+ /** Return the ECMAScript runtime category after checking every primitive schema. */
35
+ export declare function kindOf<Value>(value: Value): RuntimeTypeName;
36
+ export {};