@osstack/protocol 0.15.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 (40) 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
@@ -0,0 +1,62 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Osstack Session Continuation Request",
4
+ "$comment": "Agent-reported request only. Evidence references must be independently verified and this object never authorizes an action.",
5
+ "type": "object",
6
+ "properties": {
7
+ "version": {
8
+ "type": "number",
9
+ "const": 1
10
+ },
11
+ "gate_kind": {
12
+ "type": "string",
13
+ "enum": [
14
+ "phase_continue",
15
+ "task_authorization",
16
+ "risk_approval",
17
+ "external_input"
18
+ ]
19
+ },
20
+ "phase": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "maxLength": 256
24
+ },
25
+ "next_action": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "maxLength": 1000
29
+ },
30
+ "evidence_refs": {
31
+ "type": "array",
32
+ "items": {
33
+ "type": "object",
34
+ "properties": {
35
+ "evidence_id": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "maxLength": 256
39
+ },
40
+ "sha256": {
41
+ "type": "string",
42
+ "pattern": "^[a-f0-9]{64}$"
43
+ }
44
+ },
45
+ "required": [
46
+ "evidence_id",
47
+ "sha256"
48
+ ],
49
+ "additionalProperties": false
50
+ },
51
+ "maxItems": 32
52
+ }
53
+ },
54
+ "required": [
55
+ "version",
56
+ "gate_kind",
57
+ "phase",
58
+ "next_action",
59
+ "evidence_refs"
60
+ ],
61
+ "additionalProperties": false
62
+ }
@@ -0,0 +1,107 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Osstack Session Decision Request",
4
+ "$comment": "Choice ID uniqueness is additionally enforced by Zod. The optional continuation is an untrusted request, not an approval.",
5
+ "type": "object",
6
+ "properties": {
7
+ "decision_id": {
8
+ "type": "string",
9
+ "minLength": 1,
10
+ "maxLength": 256
11
+ },
12
+ "question": {
13
+ "type": "string",
14
+ "minLength": 1,
15
+ "maxLength": 1000
16
+ },
17
+ "choices": {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "object",
21
+ "properties": {
22
+ "choice_id": {
23
+ "type": "string",
24
+ "minLength": 1,
25
+ "maxLength": 256
26
+ },
27
+ "label": {
28
+ "type": "string",
29
+ "minLength": 1,
30
+ "maxLength": 160
31
+ }
32
+ },
33
+ "required": [
34
+ "choice_id",
35
+ "label"
36
+ ],
37
+ "additionalProperties": false
38
+ },
39
+ "maxItems": 8
40
+ },
41
+ "continuation": {
42
+ "type": "object",
43
+ "properties": {
44
+ "version": {
45
+ "type": "number",
46
+ "const": 1
47
+ },
48
+ "gate_kind": {
49
+ "type": "string",
50
+ "enum": [
51
+ "phase_continue",
52
+ "task_authorization",
53
+ "risk_approval",
54
+ "external_input"
55
+ ]
56
+ },
57
+ "phase": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "maxLength": 256
61
+ },
62
+ "next_action": {
63
+ "type": "string",
64
+ "minLength": 1,
65
+ "maxLength": 1000
66
+ },
67
+ "evidence_refs": {
68
+ "type": "array",
69
+ "items": {
70
+ "type": "object",
71
+ "properties": {
72
+ "evidence_id": {
73
+ "type": "string",
74
+ "minLength": 1,
75
+ "maxLength": 256
76
+ },
77
+ "sha256": {
78
+ "type": "string",
79
+ "pattern": "^[a-f0-9]{64}$"
80
+ }
81
+ },
82
+ "required": [
83
+ "evidence_id",
84
+ "sha256"
85
+ ],
86
+ "additionalProperties": false
87
+ },
88
+ "maxItems": 32
89
+ }
90
+ },
91
+ "required": [
92
+ "version",
93
+ "gate_kind",
94
+ "phase",
95
+ "next_action",
96
+ "evidence_refs"
97
+ ],
98
+ "additionalProperties": false
99
+ }
100
+ },
101
+ "required": [
102
+ "decision_id",
103
+ "question",
104
+ "choices"
105
+ ],
106
+ "additionalProperties": false
107
+ }
@@ -0,0 +1,209 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Osstack Signed Session Continuation Grant",
4
+ "$comment": "Ed25519 signs UTF-8 canonical JSON of the strictly parsed body (defaults included, object keys sorted, array order preserved). Zod additionally rejects NUL in repo_path and whitespace-only instructions without rewriting their contents. Signature and trusted-key verification are required at runtime. This grant carries no R3 or GitHub approval authority.",
5
+ "type": "object",
6
+ "properties": {
7
+ "body": {
8
+ "type": "object",
9
+ "properties": {
10
+ "version": {
11
+ "type": "number",
12
+ "const": 1
13
+ },
14
+ "grant_id": {
15
+ "type": "string",
16
+ "minLength": 1,
17
+ "maxLength": 256
18
+ },
19
+ "session_id": {
20
+ "type": "string",
21
+ "minLength": 1,
22
+ "maxLength": 256
23
+ },
24
+ "runtime_id": {
25
+ "type": "string",
26
+ "minLength": 1,
27
+ "maxLength": 256
28
+ },
29
+ "runtime_policy_sha256": {
30
+ "type": "string",
31
+ "pattern": "^[a-f0-9]{64}$"
32
+ },
33
+ "repo_path": {
34
+ "type": "string",
35
+ "maxLength": 4096,
36
+ "pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\[^\\\\/]+[\\\\/][^\\\\/]+(?:[\\\\/]|$))"
37
+ },
38
+ "initial_turn_id": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "maxLength": 256
42
+ },
43
+ "initial_version": {
44
+ "type": "integer",
45
+ "minimum": 1
46
+ },
47
+ "issued_at": {
48
+ "type": "string",
49
+ "format": "date-time"
50
+ },
51
+ "expires_at": {
52
+ "type": "string",
53
+ "format": "date-time"
54
+ },
55
+ "max_resumes": {
56
+ "type": "integer",
57
+ "minimum": 1,
58
+ "maximum": 32
59
+ },
60
+ "max_checks": {
61
+ "type": "integer",
62
+ "minimum": 1,
63
+ "maximum": 64
64
+ },
65
+ "turn_timeout_ms": {
66
+ "type": "integer",
67
+ "minimum": 100,
68
+ "maximum": 300000
69
+ },
70
+ "steps": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "object",
74
+ "properties": {
75
+ "phase": {
76
+ "type": "string",
77
+ "minLength": 1,
78
+ "maxLength": 256
79
+ },
80
+ "instruction": {
81
+ "type": "string",
82
+ "minLength": 1,
83
+ "maxLength": 16000
84
+ },
85
+ "checks": {
86
+ "type": "array",
87
+ "items": {
88
+ "anyOf": [
89
+ {
90
+ "type": "object",
91
+ "properties": {
92
+ "kind": {
93
+ "type": "string",
94
+ "const": "text_equals"
95
+ },
96
+ "expected": {
97
+ "type": "string",
98
+ "maxLength": 4000
99
+ }
100
+ },
101
+ "required": [
102
+ "kind",
103
+ "expected"
104
+ ],
105
+ "additionalProperties": false
106
+ },
107
+ {
108
+ "type": "object",
109
+ "properties": {
110
+ "kind": {
111
+ "type": "string",
112
+ "const": "json_value_equals"
113
+ },
114
+ "path": {
115
+ "type": "array",
116
+ "items": {
117
+ "type": "string",
118
+ "maxLength": 256
119
+ },
120
+ "maxItems": 8
121
+ },
122
+ "expected": {
123
+ "anyOf": [
124
+ {
125
+ "type": "null"
126
+ },
127
+ {
128
+ "type": "string",
129
+ "maxLength": 4000
130
+ },
131
+ {
132
+ "type": "number"
133
+ },
134
+ {
135
+ "type": "boolean"
136
+ }
137
+ ]
138
+ }
139
+ },
140
+ "required": [
141
+ "kind",
142
+ "path",
143
+ "expected"
144
+ ],
145
+ "additionalProperties": false
146
+ }
147
+ ]
148
+ },
149
+ "minItems": 1,
150
+ "maxItems": 16
151
+ },
152
+ "retry_instruction": {
153
+ "type": "string",
154
+ "minLength": 1,
155
+ "maxLength": 16000
156
+ },
157
+ "max_retries": {
158
+ "type": "integer",
159
+ "minimum": 0,
160
+ "maximum": 3,
161
+ "default": 0
162
+ }
163
+ },
164
+ "required": [
165
+ "phase",
166
+ "instruction",
167
+ "checks"
168
+ ],
169
+ "additionalProperties": false
170
+ },
171
+ "minItems": 1,
172
+ "maxItems": 16
173
+ }
174
+ },
175
+ "required": [
176
+ "version",
177
+ "grant_id",
178
+ "session_id",
179
+ "runtime_id",
180
+ "runtime_policy_sha256",
181
+ "repo_path",
182
+ "initial_turn_id",
183
+ "initial_version",
184
+ "issued_at",
185
+ "expires_at",
186
+ "max_resumes",
187
+ "max_checks",
188
+ "turn_timeout_ms",
189
+ "steps"
190
+ ],
191
+ "additionalProperties": false
192
+ },
193
+ "key_id": {
194
+ "type": "string",
195
+ "minLength": 1,
196
+ "maxLength": 256
197
+ },
198
+ "signature": {
199
+ "type": "string",
200
+ "pattern": "^[A-Za-z0-9+/]{85}[AQgw]==$"
201
+ }
202
+ },
203
+ "required": [
204
+ "body",
205
+ "key_id",
206
+ "signature"
207
+ ],
208
+ "additionalProperties": false
209
+ }