@osstack/protocol 0.15.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 (73) 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 +1 -0
  21. package/dist/generate.d.ts.map +1 -1
  22. package/dist/generate.js +61 -1
  23. package/dist/generate.js.map +1 -1
  24. package/dist/graph-checkpoint.d.ts +409 -0
  25. package/dist/graph-checkpoint.d.ts.map +1 -0
  26. package/dist/graph-checkpoint.js +91 -0
  27. package/dist/graph-checkpoint.js.map +1 -0
  28. package/dist/graph-worker.d.ts +1663 -0
  29. package/dist/graph-worker.d.ts.map +1 -0
  30. package/dist/graph-worker.js +152 -0
  31. package/dist/graph-worker.js.map +1 -0
  32. package/dist/graph.d.ts +13169 -0
  33. package/dist/graph.d.ts.map +1 -0
  34. package/dist/graph.js +427 -0
  35. package/dist/graph.js.map +1 -0
  36. package/dist/index.d.ts +11 -0
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +11 -2
  39. package/dist/index.js.map +1 -1
  40. package/dist/policy.d.ts +10 -10
  41. package/dist/run.d.ts +4 -4
  42. package/dist/session-continuation-grant.d.ts +414 -0
  43. package/dist/session-continuation-grant.d.ts.map +1 -0
  44. package/dist/session-continuation-grant.js +59 -0
  45. package/dist/session-continuation-grant.js.map +1 -0
  46. package/dist/session-continuation.d.ts +129 -0
  47. package/dist/session-continuation.d.ts.map +1 -0
  48. package/dist/session-continuation.js +30 -0
  49. package/dist/session-continuation.js.map +1 -0
  50. package/dist/task.d.ts +2 -2
  51. package/package.json +11 -10
  52. package/schemas/attention-inbox.schema.json +271 -0
  53. package/schemas/attention-status.schema.json +434 -0
  54. package/schemas/continuation-grant-body.schema.json +189 -0
  55. package/schemas/continuation-output-check.schema.json +65 -0
  56. package/schemas/delivery-contract-v2.schema.json +238 -0
  57. package/schemas/delivery-verification-receipt-v2.schema.json +223 -0
  58. package/schemas/follow-up-create-params.schema.json +78 -0
  59. package/schemas/follow-up-draft-params.schema.json +39 -0
  60. package/schemas/follow-up-list-params.schema.json +42 -0
  61. package/schemas/follow-up-list-result.schema.json +241 -0
  62. package/schemas/follow-up-mutation-result.schema.json +361 -0
  63. package/schemas/follow-up-obligation.schema.json +343 -0
  64. package/schemas/follow-up-resolve-params.schema.json +53 -0
  65. package/schemas/frozen-delivery-contract-v2.schema.json +258 -0
  66. package/schemas/graph-checkpoint-request.schema.json +222 -0
  67. package/schemas/graph-checkpoint-response.schema.json +258 -0
  68. package/schemas/graph-worker.schema.json +546 -0
  69. package/schemas/graph.schema.json +1798 -0
  70. package/schemas/session-continuation-request.schema.json +62 -0
  71. package/schemas/session-decision.schema.json +107 -0
  72. package/schemas/signed-continuation-grant.schema.json +209 -0
  73. package/LICENSE +0 -21
@@ -0,0 +1,434 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "OSStack Attention Snapshot",
4
+ "type": "object",
5
+ "properties": {
6
+ "schema_version": {
7
+ "type": "number",
8
+ "const": 1
9
+ },
10
+ "mode": {
11
+ "type": "string",
12
+ "const": "snapshot_only"
13
+ },
14
+ "scope": {
15
+ "type": "object",
16
+ "properties": {
17
+ "scope_id": {
18
+ "type": "string",
19
+ "minLength": 1,
20
+ "maxLength": 512
21
+ },
22
+ "task_id": {
23
+ "type": "string",
24
+ "minLength": 1,
25
+ "maxLength": 512
26
+ },
27
+ "tenant_id": {
28
+ "type": "null"
29
+ },
30
+ "repo_path": {
31
+ "type": "string",
32
+ "maxLength": 4096
33
+ }
34
+ },
35
+ "required": [
36
+ "scope_id",
37
+ "task_id",
38
+ "tenant_id",
39
+ "repo_path"
40
+ ],
41
+ "additionalProperties": false
42
+ },
43
+ "sampled_at_ms": {
44
+ "type": "number",
45
+ "minimum": 0
46
+ },
47
+ "coverage": {
48
+ "type": "object",
49
+ "properties": {
50
+ "state": {
51
+ "type": "string",
52
+ "const": "not_monitored"
53
+ }
54
+ },
55
+ "required": [
56
+ "state"
57
+ ],
58
+ "additionalProperties": false
59
+ },
60
+ "runs": {
61
+ "type": "array",
62
+ "items": {
63
+ "type": "object",
64
+ "properties": {
65
+ "run_id": {
66
+ "type": "string",
67
+ "minLength": 1,
68
+ "maxLength": 512
69
+ },
70
+ "phase": {
71
+ "type": "string",
72
+ "maxLength": 120
73
+ },
74
+ "outcome": {
75
+ "anyOf": [
76
+ {
77
+ "type": "string",
78
+ "maxLength": 120
79
+ },
80
+ {
81
+ "type": "null"
82
+ }
83
+ ]
84
+ },
85
+ "repo_binding": {
86
+ "type": "string",
87
+ "const": "unverified"
88
+ }
89
+ },
90
+ "required": [
91
+ "run_id",
92
+ "phase",
93
+ "outcome",
94
+ "repo_binding"
95
+ ],
96
+ "additionalProperties": false
97
+ },
98
+ "maxItems": 100
99
+ },
100
+ "sessions": {
101
+ "type": "array",
102
+ "items": {
103
+ "type": "object",
104
+ "properties": {
105
+ "session_id": {
106
+ "type": "string",
107
+ "minLength": 1,
108
+ "maxLength": 512
109
+ },
110
+ "run_id": {
111
+ "type": "string",
112
+ "minLength": 1,
113
+ "maxLength": 512
114
+ },
115
+ "state": {
116
+ "type": "string",
117
+ "maxLength": 80
118
+ },
119
+ "version": {
120
+ "type": "integer",
121
+ "exclusiveMinimum": 0
122
+ },
123
+ "turn_id": {
124
+ "anyOf": [
125
+ {
126
+ "type": "string",
127
+ "minLength": 1,
128
+ "maxLength": 512
129
+ },
130
+ {
131
+ "type": "null"
132
+ }
133
+ ]
134
+ },
135
+ "turn_state": {
136
+ "anyOf": [
137
+ {
138
+ "type": "string",
139
+ "maxLength": 80
140
+ },
141
+ {
142
+ "type": "null"
143
+ }
144
+ ]
145
+ },
146
+ "decision": {
147
+ "anyOf": [
148
+ {
149
+ "type": "object",
150
+ "properties": {
151
+ "decision_id": {
152
+ "type": "string",
153
+ "minLength": 1,
154
+ "maxLength": 256
155
+ },
156
+ "question": {
157
+ "type": "string",
158
+ "minLength": 1,
159
+ "maxLength": 1000
160
+ },
161
+ "choices": {
162
+ "type": "array",
163
+ "items": {
164
+ "type": "object",
165
+ "properties": {
166
+ "choice_id": {
167
+ "type": "string",
168
+ "minLength": 1,
169
+ "maxLength": 256
170
+ },
171
+ "label": {
172
+ "type": "string",
173
+ "minLength": 1,
174
+ "maxLength": 160
175
+ }
176
+ },
177
+ "required": [
178
+ "choice_id",
179
+ "label"
180
+ ],
181
+ "additionalProperties": false
182
+ },
183
+ "maxItems": 8
184
+ },
185
+ "continuation": {
186
+ "type": "object",
187
+ "properties": {
188
+ "version": {
189
+ "type": "number",
190
+ "const": 1
191
+ },
192
+ "gate_kind": {
193
+ "type": "string",
194
+ "enum": [
195
+ "phase_continue",
196
+ "task_authorization",
197
+ "risk_approval",
198
+ "external_input"
199
+ ]
200
+ },
201
+ "phase": {
202
+ "type": "string",
203
+ "minLength": 1,
204
+ "maxLength": 256
205
+ },
206
+ "next_action": {
207
+ "type": "string",
208
+ "minLength": 1,
209
+ "maxLength": 1000
210
+ },
211
+ "evidence_refs": {
212
+ "type": "array",
213
+ "items": {
214
+ "type": "object",
215
+ "properties": {
216
+ "evidence_id": {
217
+ "type": "string",
218
+ "minLength": 1,
219
+ "maxLength": 256
220
+ },
221
+ "sha256": {
222
+ "type": "string",
223
+ "pattern": "^[a-f0-9]{64}$"
224
+ }
225
+ },
226
+ "required": [
227
+ "evidence_id",
228
+ "sha256"
229
+ ],
230
+ "additionalProperties": false
231
+ },
232
+ "maxItems": 32
233
+ }
234
+ },
235
+ "required": [
236
+ "version",
237
+ "gate_kind",
238
+ "phase",
239
+ "next_action",
240
+ "evidence_refs"
241
+ ],
242
+ "additionalProperties": false
243
+ }
244
+ },
245
+ "required": [
246
+ "decision_id",
247
+ "question",
248
+ "choices"
249
+ ],
250
+ "additionalProperties": false
251
+ },
252
+ {
253
+ "type": "null"
254
+ }
255
+ ]
256
+ },
257
+ "decision_hash": {
258
+ "anyOf": [
259
+ {
260
+ "type": "string",
261
+ "minLength": 64,
262
+ "maxLength": 64
263
+ },
264
+ {
265
+ "type": "null"
266
+ }
267
+ ]
268
+ },
269
+ "process_liveness": {
270
+ "type": "string",
271
+ "const": "unknown"
272
+ },
273
+ "wait": {
274
+ "type": "object",
275
+ "properties": {
276
+ "reason": {
277
+ "type": "string",
278
+ "minLength": 1,
279
+ "maxLength": 120
280
+ },
281
+ "owner": {
282
+ "type": "string",
283
+ "enum": [
284
+ "human",
285
+ "system",
286
+ "unknown",
287
+ "none"
288
+ ]
289
+ },
290
+ "grant_id": {
291
+ "anyOf": [
292
+ {
293
+ "type": "string",
294
+ "minLength": 1,
295
+ "maxLength": 512
296
+ },
297
+ {
298
+ "type": "null"
299
+ }
300
+ ]
301
+ },
302
+ "message_id": {
303
+ "anyOf": [
304
+ {
305
+ "type": "string",
306
+ "minLength": 1,
307
+ "maxLength": 512
308
+ },
309
+ {
310
+ "type": "null"
311
+ }
312
+ ]
313
+ }
314
+ },
315
+ "required": [
316
+ "reason",
317
+ "owner",
318
+ "grant_id",
319
+ "message_id"
320
+ ],
321
+ "additionalProperties": false
322
+ },
323
+ "updated_at": {
324
+ "type": "number"
325
+ }
326
+ },
327
+ "required": [
328
+ "session_id",
329
+ "run_id",
330
+ "state",
331
+ "version",
332
+ "turn_id",
333
+ "turn_state",
334
+ "decision",
335
+ "decision_hash",
336
+ "process_liveness",
337
+ "wait",
338
+ "updated_at"
339
+ ],
340
+ "additionalProperties": false
341
+ },
342
+ "maxItems": 100
343
+ },
344
+ "completeness": {
345
+ "type": "object",
346
+ "properties": {
347
+ "latest_turn_only": {
348
+ "type": "boolean",
349
+ "const": true
350
+ },
351
+ "truncated": {
352
+ "type": "boolean"
353
+ },
354
+ "omitted_binding_unknown": {
355
+ "type": "integer",
356
+ "minimum": 0
357
+ },
358
+ "next_cursor": {
359
+ "anyOf": [
360
+ {
361
+ "type": "string",
362
+ "maxLength": 4096
363
+ },
364
+ {
365
+ "type": "null"
366
+ }
367
+ ]
368
+ },
369
+ "next_after": {
370
+ "type": "object",
371
+ "properties": {
372
+ "run": {
373
+ "anyOf": [
374
+ {
375
+ "type": "string",
376
+ "minLength": 1,
377
+ "maxLength": 512
378
+ },
379
+ {
380
+ "type": "null"
381
+ }
382
+ ]
383
+ },
384
+ "session": {
385
+ "anyOf": [
386
+ {
387
+ "type": "string",
388
+ "minLength": 1,
389
+ "maxLength": 512
390
+ },
391
+ {
392
+ "type": "null"
393
+ }
394
+ ]
395
+ }
396
+ },
397
+ "required": [
398
+ "run",
399
+ "session"
400
+ ],
401
+ "additionalProperties": false
402
+ }
403
+ },
404
+ "required": [
405
+ "latest_turn_only",
406
+ "truncated",
407
+ "omitted_binding_unknown",
408
+ "next_cursor",
409
+ "next_after"
410
+ ],
411
+ "additionalProperties": false
412
+ },
413
+ "limitations": {
414
+ "type": "array",
415
+ "items": {
416
+ "type": "string",
417
+ "maxLength": 700
418
+ },
419
+ "maxItems": 500
420
+ }
421
+ },
422
+ "required": [
423
+ "schema_version",
424
+ "mode",
425
+ "scope",
426
+ "sampled_at_ms",
427
+ "coverage",
428
+ "runs",
429
+ "sessions",
430
+ "completeness",
431
+ "limitations"
432
+ ],
433
+ "additionalProperties": false
434
+ }
@@ -0,0 +1,189 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Osstack Session Continuation Grant Body",
4
+ "$comment": "Frozen finite instructions bound to a session and runtime policy. Zod additionally rejects NUL in repo_path and whitespace-only instructions without trimming their contents. Each step checks persisted output before sending its instruction. Completion means the delegated instructions finished, not that the user's whole task succeeded. Runtime verification enforces issued_at <= now < expires_at and a positive validity interval of at most 24 hours; durable consumption belongs to the session control plane.",
5
+ "type": "object",
6
+ "properties": {
7
+ "version": {
8
+ "type": "number",
9
+ "const": 1
10
+ },
11
+ "grant_id": {
12
+ "type": "string",
13
+ "minLength": 1,
14
+ "maxLength": 256
15
+ },
16
+ "session_id": {
17
+ "type": "string",
18
+ "minLength": 1,
19
+ "maxLength": 256
20
+ },
21
+ "runtime_id": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "maxLength": 256
25
+ },
26
+ "runtime_policy_sha256": {
27
+ "type": "string",
28
+ "pattern": "^[a-f0-9]{64}$"
29
+ },
30
+ "repo_path": {
31
+ "type": "string",
32
+ "maxLength": 4096,
33
+ "pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\/]+[\\\\/][^\\\\/]+(?:[\\\\/]|$))"
34
+ },
35
+ "initial_turn_id": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "maxLength": 256
39
+ },
40
+ "initial_version": {
41
+ "type": "integer",
42
+ "minimum": 1
43
+ },
44
+ "issued_at": {
45
+ "type": "string",
46
+ "format": "date-time"
47
+ },
48
+ "expires_at": {
49
+ "type": "string",
50
+ "format": "date-time"
51
+ },
52
+ "max_resumes": {
53
+ "type": "integer",
54
+ "minimum": 1,
55
+ "maximum": 32
56
+ },
57
+ "max_checks": {
58
+ "type": "integer",
59
+ "minimum": 1,
60
+ "maximum": 64
61
+ },
62
+ "turn_timeout_ms": {
63
+ "type": "integer",
64
+ "minimum": 100,
65
+ "maximum": 300000
66
+ },
67
+ "steps": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "object",
71
+ "properties": {
72
+ "phase": {
73
+ "type": "string",
74
+ "minLength": 1,
75
+ "maxLength": 256
76
+ },
77
+ "instruction": {
78
+ "type": "string",
79
+ "minLength": 1,
80
+ "maxLength": 16000
81
+ },
82
+ "checks": {
83
+ "type": "array",
84
+ "items": {
85
+ "anyOf": [
86
+ {
87
+ "type": "object",
88
+ "properties": {
89
+ "kind": {
90
+ "type": "string",
91
+ "const": "text_equals"
92
+ },
93
+ "expected": {
94
+ "type": "string",
95
+ "maxLength": 4000
96
+ }
97
+ },
98
+ "required": [
99
+ "kind",
100
+ "expected"
101
+ ],
102
+ "additionalProperties": false
103
+ },
104
+ {
105
+ "type": "object",
106
+ "properties": {
107
+ "kind": {
108
+ "type": "string",
109
+ "const": "json_value_equals"
110
+ },
111
+ "path": {
112
+ "type": "array",
113
+ "items": {
114
+ "type": "string",
115
+ "maxLength": 256
116
+ },
117
+ "maxItems": 8
118
+ },
119
+ "expected": {
120
+ "anyOf": [
121
+ {
122
+ "type": "null"
123
+ },
124
+ {
125
+ "type": "string",
126
+ "maxLength": 4000
127
+ },
128
+ {
129
+ "type": "number"
130
+ },
131
+ {
132
+ "type": "boolean"
133
+ }
134
+ ]
135
+ }
136
+ },
137
+ "required": [
138
+ "kind",
139
+ "path",
140
+ "expected"
141
+ ],
142
+ "additionalProperties": false
143
+ }
144
+ ]
145
+ },
146
+ "minItems": 1,
147
+ "maxItems": 16
148
+ },
149
+ "retry_instruction": {
150
+ "type": "string",
151
+ "minLength": 1,
152
+ "maxLength": 16000
153
+ },
154
+ "max_retries": {
155
+ "type": "integer",
156
+ "minimum": 0,
157
+ "maximum": 3,
158
+ "default": 0
159
+ }
160
+ },
161
+ "required": [
162
+ "phase",
163
+ "instruction",
164
+ "checks"
165
+ ],
166
+ "additionalProperties": false
167
+ },
168
+ "minItems": 1,
169
+ "maxItems": 16
170
+ }
171
+ },
172
+ "required": [
173
+ "version",
174
+ "grant_id",
175
+ "session_id",
176
+ "runtime_id",
177
+ "runtime_policy_sha256",
178
+ "repo_path",
179
+ "initial_turn_id",
180
+ "initial_version",
181
+ "issued_at",
182
+ "expires_at",
183
+ "max_resumes",
184
+ "max_checks",
185
+ "turn_timeout_ms",
186
+ "steps"
187
+ ],
188
+ "additionalProperties": false
189
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Osstack Continuation Persisted Output Check",
4
+ "$comment": "Checks only a declared equality contract against persisted assistant_text. JSON paths use literal own-property keys; an empty path selects the root primitive. This is not proof of open-ended quality or permission to execute scripts.",
5
+ "anyOf": [
6
+ {
7
+ "type": "object",
8
+ "properties": {
9
+ "kind": {
10
+ "type": "string",
11
+ "const": "text_equals"
12
+ },
13
+ "expected": {
14
+ "type": "string",
15
+ "maxLength": 4000
16
+ }
17
+ },
18
+ "required": [
19
+ "kind",
20
+ "expected"
21
+ ],
22
+ "additionalProperties": false
23
+ },
24
+ {
25
+ "type": "object",
26
+ "properties": {
27
+ "kind": {
28
+ "type": "string",
29
+ "const": "json_value_equals"
30
+ },
31
+ "path": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string",
35
+ "maxLength": 256
36
+ },
37
+ "maxItems": 8
38
+ },
39
+ "expected": {
40
+ "anyOf": [
41
+ {
42
+ "type": "null"
43
+ },
44
+ {
45
+ "type": "string",
46
+ "maxLength": 4000
47
+ },
48
+ {
49
+ "type": "number"
50
+ },
51
+ {
52
+ "type": "boolean"
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ "required": [
58
+ "kind",
59
+ "path",
60
+ "expected"
61
+ ],
62
+ "additionalProperties": false
63
+ }
64
+ ]
65
+ }