@osstack/protocol 0.20.0 → 0.22.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 (52) hide show
  1. package/dist/attention.d.ts +863 -0
  2. package/dist/attention.d.ts.map +1 -0
  3. package/dist/attention.js +112 -0
  4. package/dist/attention.js.map +1 -0
  5. package/dist/autonomy.d.ts +14 -14
  6. package/dist/delivery-contract.d.ts +734 -0
  7. package/dist/delivery-contract.d.ts.map +1 -0
  8. package/dist/delivery-contract.js +111 -0
  9. package/dist/delivery-contract.js.map +1 -0
  10. package/dist/envelope.d.ts +42 -42
  11. package/dist/event.d.ts +4 -4
  12. package/dist/follow-up-delivery.d.ts +1831 -0
  13. package/dist/follow-up-delivery.d.ts.map +1 -0
  14. package/dist/follow-up-delivery.js +174 -0
  15. package/dist/follow-up-delivery.js.map +1 -0
  16. package/dist/follow-up.d.ts +1100 -0
  17. package/dist/follow-up.d.ts.map +1 -0
  18. package/dist/follow-up.js +28 -0
  19. package/dist/follow-up.js.map +1 -0
  20. package/dist/generate.d.ts.map +1 -1
  21. package/dist/generate.js +18 -0
  22. package/dist/generate.js.map +1 -1
  23. package/dist/graph-checkpoint.d.ts +6 -6
  24. package/dist/graph-worker.d.ts +26 -26
  25. package/dist/graph.d.ts +886 -592
  26. package/dist/graph.d.ts.map +1 -1
  27. package/dist/graph.js +4 -0
  28. package/dist/graph.js.map +1 -1
  29. package/dist/index.d.ts +4 -0
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +4 -0
  32. package/dist/index.js.map +1 -1
  33. package/dist/policy.d.ts +10 -10
  34. package/dist/run.d.ts +4 -4
  35. package/dist/session-continuation-grant.d.ts +36 -36
  36. package/dist/session-continuation.d.ts +26 -26
  37. package/dist/task.d.ts +2 -2
  38. package/package.json +10 -9
  39. package/schemas/attention-inbox.schema.json +271 -0
  40. package/schemas/attention-status.schema.json +434 -0
  41. package/schemas/delivery-contract-v2.schema.json +238 -0
  42. package/schemas/delivery-verification-receipt-v2.schema.json +223 -0
  43. package/schemas/follow-up-create-params.schema.json +78 -0
  44. package/schemas/follow-up-draft-params.schema.json +39 -0
  45. package/schemas/follow-up-list-params.schema.json +42 -0
  46. package/schemas/follow-up-list-result.schema.json +241 -0
  47. package/schemas/follow-up-mutation-result.schema.json +361 -0
  48. package/schemas/follow-up-obligation.schema.json +343 -0
  49. package/schemas/follow-up-resolve-params.schema.json +53 -0
  50. package/schemas/frozen-delivery-contract-v2.schema.json +258 -0
  51. package/schemas/graph.schema.json +30 -0
  52. package/LICENSE +0 -21
@@ -58,7 +58,6 @@ export declare const ContinuationGrantStep: z.ZodObject<{
58
58
  max_retries: z.ZodDefault<z.ZodNumber>;
59
59
  }, "strict", z.ZodTypeAny, {
60
60
  phase: string;
61
- instruction: string;
62
61
  checks: ({
63
62
  expected: string;
64
63
  kind: "text_equals";
@@ -67,11 +66,11 @@ export declare const ContinuationGrantStep: z.ZodObject<{
67
66
  expected: string | number | boolean | null;
68
67
  kind: "json_value_equals";
69
68
  })[];
69
+ instruction: string;
70
70
  max_retries: number;
71
71
  retry_instruction?: string | undefined;
72
72
  }, {
73
73
  phase: string;
74
- instruction: string;
75
74
  checks: ({
76
75
  expected: string;
77
76
  kind: "text_equals";
@@ -80,6 +79,7 @@ export declare const ContinuationGrantStep: z.ZodObject<{
80
79
  expected: string | number | boolean | null;
81
80
  kind: "json_value_equals";
82
81
  })[];
82
+ instruction: string;
83
83
  retry_instruction?: string | undefined;
84
84
  max_retries?: number | undefined;
85
85
  }>;
@@ -134,7 +134,6 @@ export declare const ContinuationGrantBody: z.ZodObject<{
134
134
  max_retries: z.ZodDefault<z.ZodNumber>;
135
135
  }, "strict", z.ZodTypeAny, {
136
136
  phase: string;
137
- instruction: string;
138
137
  checks: ({
139
138
  expected: string;
140
139
  kind: "text_equals";
@@ -143,11 +142,11 @@ export declare const ContinuationGrantBody: z.ZodObject<{
143
142
  expected: string | number | boolean | null;
144
143
  kind: "json_value_equals";
145
144
  })[];
145
+ instruction: string;
146
146
  max_retries: number;
147
147
  retry_instruction?: string | undefined;
148
148
  }, {
149
149
  phase: string;
150
- instruction: string;
151
150
  checks: ({
152
151
  expected: string;
153
152
  kind: "text_equals";
@@ -156,18 +155,19 @@ export declare const ContinuationGrantBody: z.ZodObject<{
156
155
  expected: string | number | boolean | null;
157
156
  kind: "json_value_equals";
158
157
  })[];
158
+ instruction: string;
159
159
  retry_instruction?: string | undefined;
160
160
  max_retries?: number | undefined;
161
161
  }>, "many">;
162
162
  }, "strict", z.ZodTypeAny, {
163
- expires_at: string;
164
- issued_at: string;
165
- session_id: string;
166
163
  version: 1;
167
164
  grant_id: string;
165
+ session_id: string;
166
+ repo_path: string;
167
+ expires_at: string;
168
+ issued_at: string;
168
169
  runtime_id: string;
169
170
  runtime_policy_sha256: string;
170
- repo_path: string;
171
171
  initial_turn_id: string;
172
172
  initial_version: number;
173
173
  max_resumes: number;
@@ -175,7 +175,6 @@ export declare const ContinuationGrantBody: z.ZodObject<{
175
175
  turn_timeout_ms: number;
176
176
  steps: {
177
177
  phase: string;
178
- instruction: string;
179
178
  checks: ({
180
179
  expected: string;
181
180
  kind: "text_equals";
@@ -184,18 +183,19 @@ export declare const ContinuationGrantBody: z.ZodObject<{
184
183
  expected: string | number | boolean | null;
185
184
  kind: "json_value_equals";
186
185
  })[];
186
+ instruction: string;
187
187
  max_retries: number;
188
188
  retry_instruction?: string | undefined;
189
189
  }[];
190
190
  }, {
191
- expires_at: string;
192
- issued_at: string;
193
- session_id: string;
194
191
  version: 1;
195
192
  grant_id: string;
193
+ session_id: string;
194
+ repo_path: string;
195
+ expires_at: string;
196
+ issued_at: string;
196
197
  runtime_id: string;
197
198
  runtime_policy_sha256: string;
198
- repo_path: string;
199
199
  initial_turn_id: string;
200
200
  initial_version: number;
201
201
  max_resumes: number;
@@ -203,7 +203,6 @@ export declare const ContinuationGrantBody: z.ZodObject<{
203
203
  turn_timeout_ms: number;
204
204
  steps: {
205
205
  phase: string;
206
- instruction: string;
207
206
  checks: ({
208
207
  expected: string;
209
208
  kind: "text_equals";
@@ -212,6 +211,7 @@ export declare const ContinuationGrantBody: z.ZodObject<{
212
211
  expected: string | number | boolean | null;
213
212
  kind: "json_value_equals";
214
213
  })[];
214
+ instruction: string;
215
215
  retry_instruction?: string | undefined;
216
216
  max_retries?: number | undefined;
217
217
  }[];
@@ -261,7 +261,6 @@ export declare const SignedContinuationGrant: z.ZodObject<{
261
261
  max_retries: z.ZodDefault<z.ZodNumber>;
262
262
  }, "strict", z.ZodTypeAny, {
263
263
  phase: string;
264
- instruction: string;
265
264
  checks: ({
266
265
  expected: string;
267
266
  kind: "text_equals";
@@ -270,11 +269,11 @@ export declare const SignedContinuationGrant: z.ZodObject<{
270
269
  expected: string | number | boolean | null;
271
270
  kind: "json_value_equals";
272
271
  })[];
272
+ instruction: string;
273
273
  max_retries: number;
274
274
  retry_instruction?: string | undefined;
275
275
  }, {
276
276
  phase: string;
277
- instruction: string;
278
277
  checks: ({
279
278
  expected: string;
280
279
  kind: "text_equals";
@@ -283,18 +282,19 @@ export declare const SignedContinuationGrant: z.ZodObject<{
283
282
  expected: string | number | boolean | null;
284
283
  kind: "json_value_equals";
285
284
  })[];
285
+ instruction: string;
286
286
  retry_instruction?: string | undefined;
287
287
  max_retries?: number | undefined;
288
288
  }>, "many">;
289
289
  }, "strict", z.ZodTypeAny, {
290
- expires_at: string;
291
- issued_at: string;
292
- session_id: string;
293
290
  version: 1;
294
291
  grant_id: string;
292
+ session_id: string;
293
+ repo_path: string;
294
+ expires_at: string;
295
+ issued_at: string;
295
296
  runtime_id: string;
296
297
  runtime_policy_sha256: string;
297
- repo_path: string;
298
298
  initial_turn_id: string;
299
299
  initial_version: number;
300
300
  max_resumes: number;
@@ -302,7 +302,6 @@ export declare const SignedContinuationGrant: z.ZodObject<{
302
302
  turn_timeout_ms: number;
303
303
  steps: {
304
304
  phase: string;
305
- instruction: string;
306
305
  checks: ({
307
306
  expected: string;
308
307
  kind: "text_equals";
@@ -311,18 +310,19 @@ export declare const SignedContinuationGrant: z.ZodObject<{
311
310
  expected: string | number | boolean | null;
312
311
  kind: "json_value_equals";
313
312
  })[];
313
+ instruction: string;
314
314
  max_retries: number;
315
315
  retry_instruction?: string | undefined;
316
316
  }[];
317
317
  }, {
318
- expires_at: string;
319
- issued_at: string;
320
- session_id: string;
321
318
  version: 1;
322
319
  grant_id: string;
320
+ session_id: string;
321
+ repo_path: string;
322
+ expires_at: string;
323
+ issued_at: string;
323
324
  runtime_id: string;
324
325
  runtime_policy_sha256: string;
325
- repo_path: string;
326
326
  initial_turn_id: string;
327
327
  initial_version: number;
328
328
  max_resumes: number;
@@ -330,7 +330,6 @@ export declare const SignedContinuationGrant: z.ZodObject<{
330
330
  turn_timeout_ms: number;
331
331
  steps: {
332
332
  phase: string;
333
- instruction: string;
334
333
  checks: ({
335
334
  expected: string;
336
335
  kind: "text_equals";
@@ -339,6 +338,7 @@ export declare const SignedContinuationGrant: z.ZodObject<{
339
338
  expected: string | number | boolean | null;
340
339
  kind: "json_value_equals";
341
340
  })[];
341
+ instruction: string;
342
342
  retry_instruction?: string | undefined;
343
343
  max_retries?: number | undefined;
344
344
  }[];
@@ -349,14 +349,14 @@ export declare const SignedContinuationGrant: z.ZodObject<{
349
349
  key_id: string;
350
350
  signature: string;
351
351
  body: {
352
- expires_at: string;
353
- issued_at: string;
354
- session_id: string;
355
352
  version: 1;
356
353
  grant_id: string;
354
+ session_id: string;
355
+ repo_path: string;
356
+ expires_at: string;
357
+ issued_at: string;
357
358
  runtime_id: string;
358
359
  runtime_policy_sha256: string;
359
- repo_path: string;
360
360
  initial_turn_id: string;
361
361
  initial_version: number;
362
362
  max_resumes: number;
@@ -364,7 +364,6 @@ export declare const SignedContinuationGrant: z.ZodObject<{
364
364
  turn_timeout_ms: number;
365
365
  steps: {
366
366
  phase: string;
367
- instruction: string;
368
367
  checks: ({
369
368
  expected: string;
370
369
  kind: "text_equals";
@@ -373,6 +372,7 @@ export declare const SignedContinuationGrant: z.ZodObject<{
373
372
  expected: string | number | boolean | null;
374
373
  kind: "json_value_equals";
375
374
  })[];
375
+ instruction: string;
376
376
  max_retries: number;
377
377
  retry_instruction?: string | undefined;
378
378
  }[];
@@ -381,14 +381,14 @@ export declare const SignedContinuationGrant: z.ZodObject<{
381
381
  key_id: string;
382
382
  signature: string;
383
383
  body: {
384
- expires_at: string;
385
- issued_at: string;
386
- session_id: string;
387
384
  version: 1;
388
385
  grant_id: string;
386
+ session_id: string;
387
+ repo_path: string;
388
+ expires_at: string;
389
+ issued_at: string;
389
390
  runtime_id: string;
390
391
  runtime_policy_sha256: string;
391
- repo_path: string;
392
392
  initial_turn_id: string;
393
393
  initial_version: number;
394
394
  max_resumes: number;
@@ -396,7 +396,6 @@ export declare const SignedContinuationGrant: z.ZodObject<{
396
396
  turn_timeout_ms: number;
397
397
  steps: {
398
398
  phase: string;
399
- instruction: string;
400
399
  checks: ({
401
400
  expected: string;
402
401
  kind: "text_equals";
@@ -405,6 +404,7 @@ export declare const SignedContinuationGrant: z.ZodObject<{
405
404
  expected: string | number | boolean | null;
406
405
  kind: "json_value_equals";
407
406
  })[];
407
+ instruction: string;
408
408
  retry_instruction?: string | undefined;
409
409
  max_retries?: number | undefined;
410
410
  }[];
@@ -11,30 +11,30 @@ export declare const SessionContinuationRequest: z.ZodObject<{
11
11
  evidence_id: z.ZodString;
12
12
  sha256: z.ZodString;
13
13
  }, "strict", z.ZodTypeAny, {
14
- sha256: string;
15
14
  evidence_id: string;
16
- }, {
17
15
  sha256: string;
16
+ }, {
18
17
  evidence_id: string;
18
+ sha256: string;
19
19
  }>, "many">;
20
20
  }, "strict", z.ZodTypeAny, {
21
+ version: 1;
22
+ gate_kind: "phase_continue" | "task_authorization" | "risk_approval" | "external_input";
21
23
  phase: string;
24
+ next_action: string;
22
25
  evidence_refs: {
23
- sha256: string;
24
26
  evidence_id: string;
27
+ sha256: string;
25
28
  }[];
29
+ }, {
26
30
  version: 1;
27
31
  gate_kind: "phase_continue" | "task_authorization" | "risk_approval" | "external_input";
28
- next_action: string;
29
- }, {
30
32
  phase: string;
33
+ next_action: string;
31
34
  evidence_refs: {
32
- sha256: string;
33
35
  evidence_id: string;
36
+ sha256: string;
34
37
  }[];
35
- version: 1;
36
- gate_kind: "phase_continue" | "task_authorization" | "risk_approval" | "external_input";
37
- next_action: string;
38
38
  }>;
39
39
  export type SessionContinuationRequest = z.infer<typeof SessionContinuationRequest>;
40
40
  export declare const SessionDecision: z.ZodObject<{
@@ -65,30 +65,30 @@ export declare const SessionDecision: z.ZodObject<{
65
65
  evidence_id: z.ZodString;
66
66
  sha256: z.ZodString;
67
67
  }, "strict", z.ZodTypeAny, {
68
- sha256: string;
69
68
  evidence_id: string;
70
- }, {
71
69
  sha256: string;
70
+ }, {
72
71
  evidence_id: string;
72
+ sha256: string;
73
73
  }>, "many">;
74
74
  }, "strict", z.ZodTypeAny, {
75
+ version: 1;
76
+ gate_kind: "phase_continue" | "task_authorization" | "risk_approval" | "external_input";
75
77
  phase: string;
78
+ next_action: string;
76
79
  evidence_refs: {
77
- sha256: string;
78
80
  evidence_id: string;
81
+ sha256: string;
79
82
  }[];
83
+ }, {
80
84
  version: 1;
81
85
  gate_kind: "phase_continue" | "task_authorization" | "risk_approval" | "external_input";
82
- next_action: string;
83
- }, {
84
86
  phase: string;
87
+ next_action: string;
85
88
  evidence_refs: {
86
- sha256: string;
87
89
  evidence_id: string;
90
+ sha256: string;
88
91
  }[];
89
- version: 1;
90
- gate_kind: "phase_continue" | "task_authorization" | "risk_approval" | "external_input";
91
- next_action: string;
92
92
  }>>;
93
93
  }, "strict", z.ZodTypeAny, {
94
94
  decision_id: string;
@@ -98,14 +98,14 @@ export declare const SessionDecision: z.ZodObject<{
98
98
  label: string;
99
99
  }[];
100
100
  continuation?: {
101
+ version: 1;
102
+ gate_kind: "phase_continue" | "task_authorization" | "risk_approval" | "external_input";
101
103
  phase: string;
104
+ next_action: string;
102
105
  evidence_refs: {
103
- sha256: string;
104
106
  evidence_id: string;
107
+ sha256: string;
105
108
  }[];
106
- version: 1;
107
- gate_kind: "phase_continue" | "task_authorization" | "risk_approval" | "external_input";
108
- next_action: string;
109
109
  } | undefined;
110
110
  }, {
111
111
  decision_id: string;
@@ -115,14 +115,14 @@ export declare const SessionDecision: z.ZodObject<{
115
115
  label: string;
116
116
  }[];
117
117
  continuation?: {
118
+ version: 1;
119
+ gate_kind: "phase_continue" | "task_authorization" | "risk_approval" | "external_input";
118
120
  phase: string;
121
+ next_action: string;
119
122
  evidence_refs: {
120
- sha256: string;
121
123
  evidence_id: string;
124
+ sha256: string;
122
125
  }[];
123
- version: 1;
124
- gate_kind: "phase_continue" | "task_authorization" | "risk_approval" | "external_input";
125
- next_action: string;
126
126
  } | undefined;
127
127
  }>;
128
128
  export type SessionDecision = z.infer<typeof SessionDecision>;
package/dist/task.d.ts CHANGED
@@ -20,16 +20,16 @@ export declare const Task: z.ZodObject<{
20
20
  */
21
21
  evaluation: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
22
22
  }, "strict", z.ZodTypeAny, {
23
- source: "git_diff" | "gh_issue" | "github_branch" | "ci_log" | "task_queue" | "manual";
24
23
  task_id: string;
24
+ source: "manual" | "git_diff" | "gh_issue" | "github_branch" | "ci_log" | "task_queue";
25
25
  capability: string;
26
26
  prompt: string;
27
27
  priority: number;
28
28
  context?: Record<string, unknown> | undefined;
29
29
  evaluation?: unknown[] | undefined;
30
30
  }, {
31
- source: "git_diff" | "gh_issue" | "github_branch" | "ci_log" | "task_queue" | "manual";
32
31
  task_id: string;
32
+ source: "manual" | "git_diff" | "gh_issue" | "github_branch" | "ci_log" | "task_queue";
33
33
  capability: string;
34
34
  prompt: string;
35
35
  priority?: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osstack/protocol",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Stable cross-product / cross-process / cross-agent kernel contracts for osstack (Task, Run, Event, Evidence, Approval, Policy, Agent command envelope) with JSON Schema artifacts and a versioned protocol.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -10,6 +10,14 @@
10
10
  "dist",
11
11
  "schemas"
12
12
  ],
13
+ "scripts": {
14
+ "build": "tsc -p .",
15
+ "prepack": "node ../../scripts/prepare-npm-package.mjs",
16
+ "test": "vitest run",
17
+ "typecheck": "tsc --noEmit",
18
+ "generate:schemas": "node scripts/generate-schemas.mjs",
19
+ "check:schemas": "node scripts/generate-schemas.mjs --check"
20
+ },
13
21
  "dependencies": {
14
22
  "zod": "^3.25.76"
15
23
  },
@@ -27,12 +35,5 @@
27
35
  },
28
36
  "engines": {
29
37
  "node": ">=20"
30
- },
31
- "scripts": {
32
- "build": "tsc -p .",
33
- "test": "vitest run",
34
- "typecheck": "tsc --noEmit",
35
- "generate:schemas": "node scripts/generate-schemas.mjs",
36
- "check:schemas": "node scripts/generate-schemas.mjs --check"
37
38
  }
38
- }
39
+ }