@osstack/protocol 0.13.0 → 0.20.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/generate.d.ts +1 -0
  2. package/dist/generate.d.ts.map +1 -1
  3. package/dist/generate.js +43 -1
  4. package/dist/generate.js.map +1 -1
  5. package/dist/graph-checkpoint.d.ts +409 -0
  6. package/dist/graph-checkpoint.d.ts.map +1 -0
  7. package/dist/graph-checkpoint.js +91 -0
  8. package/dist/graph-checkpoint.js.map +1 -0
  9. package/dist/graph-worker.d.ts +1663 -0
  10. package/dist/graph-worker.d.ts.map +1 -0
  11. package/dist/graph-worker.js +152 -0
  12. package/dist/graph-worker.js.map +1 -0
  13. package/dist/graph.d.ts +12875 -0
  14. package/dist/graph.d.ts.map +1 -0
  15. package/dist/graph.js +423 -0
  16. package/dist/graph.js.map +1 -0
  17. package/dist/index.d.ts +7 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +7 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/run.d.ts +2 -2
  22. package/dist/session-continuation-grant.d.ts +414 -0
  23. package/dist/session-continuation-grant.d.ts.map +1 -0
  24. package/dist/session-continuation-grant.js +59 -0
  25. package/dist/session-continuation-grant.js.map +1 -0
  26. package/dist/session-continuation.d.ts +129 -0
  27. package/dist/session-continuation.d.ts.map +1 -0
  28. package/dist/session-continuation.js +30 -0
  29. package/dist/session-continuation.js.map +1 -0
  30. package/dist/task.d.ts +2 -2
  31. package/package.json +2 -2
  32. package/schemas/continuation-grant-body.schema.json +189 -0
  33. package/schemas/continuation-output-check.schema.json +65 -0
  34. package/schemas/graph-checkpoint-request.schema.json +222 -0
  35. package/schemas/graph-checkpoint-response.schema.json +258 -0
  36. package/schemas/graph-worker.schema.json +546 -0
  37. package/schemas/graph.schema.json +1768 -0
  38. package/schemas/session-continuation-request.schema.json +62 -0
  39. package/schemas/session-decision.schema.json +107 -0
  40. package/schemas/signed-continuation-grant.schema.json +209 -0
  41. package/dist/autonomy.test.d.ts +0 -2
  42. package/dist/autonomy.test.d.ts.map +0 -1
  43. package/dist/autonomy.test.js +0 -201
  44. package/dist/autonomy.test.js.map +0 -1
  45. package/dist/protocol.test.d.ts +0 -2
  46. package/dist/protocol.test.d.ts.map +0 -1
  47. package/dist/protocol.test.js +0 -251
  48. package/dist/protocol.test.js.map +0 -1
  49. package/dist/schemas.test.d.ts +0 -2
  50. package/dist/schemas.test.d.ts.map +0 -1
  51. package/dist/schemas.test.js +0 -39
  52. package/dist/schemas.test.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osstack/protocol",
3
- "version": "0.13.0",
3
+ "version": "0.20.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",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "https://github.com/gilosbornhello/osstack.git",
25
+ "url": "https://github.com/osborn-studio/osstack.git",
26
26
  "directory": "packages/protocol"
27
27
  },
28
28
  "engines": {
@@ -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
+ }
@@ -0,0 +1,222 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Graph Checkpoint Request",
4
+ "$comment": "Opaque bounded codec data; transport caps raw frames at 8 MiB. Host binds authenticated run and fences transaction before reads, writes and replay. No JSON field confers authority.",
5
+ "anyOf": [
6
+ {
7
+ "type": "object",
8
+ "properties": {
9
+ "kind": {
10
+ "type": "string",
11
+ "const": "get"
12
+ },
13
+ "threadId": {
14
+ "type": "string",
15
+ "minLength": 1,
16
+ "maxLength": 256
17
+ },
18
+ "namespace": {
19
+ "type": "string",
20
+ "maxLength": 1024
21
+ },
22
+ "checkpointId": {
23
+ "type": "string",
24
+ "minLength": 1,
25
+ "maxLength": 256
26
+ }
27
+ },
28
+ "required": [
29
+ "kind",
30
+ "threadId",
31
+ "namespace"
32
+ ],
33
+ "additionalProperties": false
34
+ },
35
+ {
36
+ "type": "object",
37
+ "properties": {
38
+ "kind": {
39
+ "type": "string",
40
+ "const": "list"
41
+ },
42
+ "threadId": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "maxLength": 256
46
+ },
47
+ "namespace": {
48
+ "type": "string",
49
+ "maxLength": 1024
50
+ },
51
+ "checkpointId": {
52
+ "type": "string",
53
+ "minLength": 1,
54
+ "maxLength": 256
55
+ },
56
+ "before": {
57
+ "type": "string",
58
+ "minLength": 1,
59
+ "maxLength": 256
60
+ },
61
+ "cursor": {
62
+ "type": "object",
63
+ "properties": {
64
+ "namespace": {
65
+ "type": "string",
66
+ "maxLength": 1024
67
+ },
68
+ "checkpointId": {
69
+ "type": "string",
70
+ "minLength": 1,
71
+ "maxLength": 256
72
+ }
73
+ },
74
+ "required": [
75
+ "namespace",
76
+ "checkpointId"
77
+ ],
78
+ "additionalProperties": false
79
+ },
80
+ "pageSize": {
81
+ "type": "integer",
82
+ "minimum": 1,
83
+ "maximum": 16
84
+ }
85
+ },
86
+ "required": [
87
+ "kind",
88
+ "threadId",
89
+ "pageSize"
90
+ ],
91
+ "additionalProperties": false
92
+ },
93
+ {
94
+ "type": "object",
95
+ "properties": {
96
+ "kind": {
97
+ "type": "string",
98
+ "const": "put"
99
+ },
100
+ "requestId": {
101
+ "type": "string",
102
+ "minLength": 1,
103
+ "maxLength": 256
104
+ },
105
+ "threadId": {
106
+ "type": "string",
107
+ "minLength": 1,
108
+ "maxLength": 256
109
+ },
110
+ "namespace": {
111
+ "type": "string",
112
+ "maxLength": 1024
113
+ },
114
+ "checkpointId": {
115
+ "type": "string",
116
+ "minLength": 1,
117
+ "maxLength": 256
118
+ },
119
+ "parentCheckpointId": {
120
+ "type": "string",
121
+ "minLength": 1,
122
+ "maxLength": 256
123
+ },
124
+ "checkpoint": {
125
+ "type": "string",
126
+ "maxLength": 1048576
127
+ },
128
+ "metadata": {
129
+ "type": "string",
130
+ "maxLength": 1048576
131
+ },
132
+ "newVersions": {
133
+ "type": "string",
134
+ "maxLength": 1048576
135
+ }
136
+ },
137
+ "required": [
138
+ "kind",
139
+ "requestId",
140
+ "threadId",
141
+ "namespace",
142
+ "checkpointId",
143
+ "checkpoint",
144
+ "metadata",
145
+ "newVersions"
146
+ ],
147
+ "additionalProperties": false
148
+ },
149
+ {
150
+ "type": "object",
151
+ "properties": {
152
+ "kind": {
153
+ "type": "string",
154
+ "const": "writes"
155
+ },
156
+ "requestId": {
157
+ "type": "string",
158
+ "minLength": 1,
159
+ "maxLength": 256
160
+ },
161
+ "threadId": {
162
+ "type": "string",
163
+ "minLength": 1,
164
+ "maxLength": 256
165
+ },
166
+ "namespace": {
167
+ "type": "string",
168
+ "maxLength": 1024
169
+ },
170
+ "checkpointId": {
171
+ "type": "string",
172
+ "minLength": 1,
173
+ "maxLength": 256
174
+ },
175
+ "taskId": {
176
+ "type": "string",
177
+ "minLength": 1,
178
+ "maxLength": 256
179
+ },
180
+ "writes": {
181
+ "type": "array",
182
+ "items": {
183
+ "type": "object",
184
+ "properties": {
185
+ "channel": {
186
+ "type": "string",
187
+ "minLength": 1,
188
+ "maxLength": 256
189
+ },
190
+ "index": {
191
+ "type": "integer",
192
+ "minimum": -4,
193
+ "maximum": 4095
194
+ },
195
+ "value": {
196
+ "type": "string",
197
+ "maxLength": 1048576
198
+ }
199
+ },
200
+ "required": [
201
+ "channel",
202
+ "index",
203
+ "value"
204
+ ],
205
+ "additionalProperties": false
206
+ },
207
+ "maxItems": 4096
208
+ }
209
+ },
210
+ "required": [
211
+ "kind",
212
+ "requestId",
213
+ "threadId",
214
+ "namespace",
215
+ "checkpointId",
216
+ "taskId",
217
+ "writes"
218
+ ],
219
+ "additionalProperties": false
220
+ }
221
+ ]
222
+ }