@snack-ai/opencode 0.1.2 → 0.1.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snack-ai/opencode",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Fail-open OpenCode metadata capture for SNACK",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -23,21 +23,65 @@
23
23
  "restrictions"
24
24
  ],
25
25
  "properties": {
26
- "schema_version": { "const": 1 },
27
- "event_id": { "type": "string", "minLength": 1, "maxLength": 200 },
28
- "installation_id": { "type": "string", "minLength": 1, "maxLength": 200 },
29
- "event_type": { "enum": ["prompt_started", "session_idle", "session_error"] },
30
- "source_prompt_id": { "type": "string", "minLength": 1, "maxLength": 200 },
31
- "source_session_id": { "type": "string", "minLength": 1, "maxLength": 200 },
32
- "revision": { "type": "string", "minLength": 1, "maxLength": 200 },
33
- "revision_domain": { "const": "opencode-plugin-v1" },
34
- "parser_version": { "const": "opencode-plugin-v1" },
35
- "occurred_at": { "type": "string", "format": "date-time" },
36
- "provider": { "type": ["string", "null"], "maxLength": 100 },
37
- "model": { "type": ["string", "null"], "maxLength": 200 },
38
- "completion": { "enum": ["provisional", "completed"] },
39
- "outcome": { "enum": ["success", "restricted", "excluded"] },
40
- "usage_slices": { "type": "array", "maxItems": 0 },
26
+ "schema_version": {
27
+ "const": 1
28
+ },
29
+ "event_id": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "maxLength": 200
33
+ },
34
+ "installation_id": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "maxLength": 200
38
+ },
39
+ "event_type": {
40
+ "enum": ["prompt_started", "session_idle", "session_error"]
41
+ },
42
+ "source_prompt_id": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "maxLength": 200
46
+ },
47
+ "source_session_id": {
48
+ "type": "string",
49
+ "minLength": 1,
50
+ "maxLength": 200
51
+ },
52
+ "revision": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "maxLength": 200
56
+ },
57
+ "revision_domain": {
58
+ "const": "opencode-plugin-v1"
59
+ },
60
+ "parser_version": {
61
+ "const": "opencode-plugin-v1"
62
+ },
63
+ "occurred_at": {
64
+ "type": "string",
65
+ "format": "date-time"
66
+ },
67
+ "provider": {
68
+ "type": ["string", "null"],
69
+ "maxLength": 100
70
+ },
71
+ "model": {
72
+ "type": ["string", "null"],
73
+ "maxLength": 200
74
+ },
75
+ "completion": {
76
+ "enum": ["provisional", "completed"]
77
+ },
78
+ "outcome": {
79
+ "enum": ["success", "restricted", "excluded"]
80
+ },
81
+ "usage_slices": {
82
+ "type": "array",
83
+ "maxItems": 0
84
+ },
41
85
  "restrictions": {
42
86
  "type": "array",
43
87
  "maxItems": 20,
@@ -49,9 +93,18 @@
49
93
  "class": {
50
94
  "enum": ["rate_limit", "usage_limit", "capacity_policy", "other_explicit_limit"]
51
95
  },
52
- "source_code": { "type": "string", "minLength": 1, "maxLength": 100 },
53
- "observed_at": { "type": "string", "format": "date-time" },
54
- "classifier_version": { "const": "opencode-plugin-error-v1" }
96
+ "source_code": {
97
+ "type": "string",
98
+ "minLength": 1,
99
+ "maxLength": 100
100
+ },
101
+ "observed_at": {
102
+ "type": "string",
103
+ "format": "date-time"
104
+ },
105
+ "classifier_version": {
106
+ "const": "opencode-plugin-error-v1"
107
+ }
55
108
  }
56
109
  }
57
110
  },
@@ -66,53 +119,119 @@
66
119
  "attachment_count"
67
120
  ],
68
121
  "properties": {
69
- "analyzer_version": { "const": "opencode-input-v1" },
70
- "estimated_input_tokens": { "type": "integer", "minimum": 0 },
71
- "line_count_bucket": { "enum": ["0", "1-10", "11-50", "51-200", "201+"] },
72
- "code_block_count_bucket": { "enum": ["0", "1", "2-4", "5+"] },
73
- "attachment_count": { "type": "integer", "minimum": 0 }
122
+ "analyzer_version": {
123
+ "const": "opencode-input-v1"
124
+ },
125
+ "estimated_input_tokens": {
126
+ "type": "integer",
127
+ "minimum": 0
128
+ },
129
+ "line_count_bucket": {
130
+ "enum": ["0", "1-10", "11-50", "51-200", "201+"]
131
+ },
132
+ "code_block_count_bucket": {
133
+ "enum": ["0", "1", "2-4", "5+"]
134
+ },
135
+ "attachment_count": {
136
+ "type": "integer",
137
+ "minimum": 0
138
+ }
74
139
  }
75
140
  }
76
141
  },
77
142
  "allOf": [
78
143
  {
79
- "if": { "properties": { "event_type": { "const": "prompt_started" } } },
144
+ "if": {
145
+ "properties": {
146
+ "event_type": {
147
+ "const": "prompt_started"
148
+ }
149
+ },
150
+ "type": "object"
151
+ },
80
152
  "then": {
81
153
  "properties": {
82
- "completion": { "const": "provisional" },
83
- "outcome": { "const": "excluded" },
84
- "restrictions": { "maxItems": 0 }
85
- }
154
+ "completion": {
155
+ "const": "provisional"
156
+ },
157
+ "outcome": {
158
+ "const": "excluded"
159
+ },
160
+ "restrictions": {
161
+ "maxItems": 0,
162
+ "type": "array"
163
+ }
164
+ },
165
+ "type": "object"
86
166
  }
87
167
  },
88
168
  {
89
- "if": { "properties": { "event_type": { "const": "session_idle" } } },
169
+ "if": {
170
+ "properties": {
171
+ "event_type": {
172
+ "const": "session_idle"
173
+ }
174
+ },
175
+ "type": "object"
176
+ },
90
177
  "then": {
91
178
  "properties": {
92
- "completion": { "const": "completed" },
93
- "outcome": { "const": "success" },
94
- "restrictions": { "maxItems": 0 }
95
- }
179
+ "completion": {
180
+ "const": "completed"
181
+ },
182
+ "outcome": {
183
+ "const": "success"
184
+ },
185
+ "restrictions": {
186
+ "maxItems": 0,
187
+ "type": "array"
188
+ }
189
+ },
190
+ "type": "object"
96
191
  }
97
192
  },
98
193
  {
99
- "if": { "properties": { "event_type": { "const": "session_error" } } },
194
+ "if": {
195
+ "properties": {
196
+ "event_type": {
197
+ "const": "session_error"
198
+ }
199
+ },
200
+ "type": "object"
201
+ },
100
202
  "then": {
101
- "properties": { "completion": { "const": "completed" } },
203
+ "properties": {
204
+ "completion": {
205
+ "const": "completed"
206
+ }
207
+ },
102
208
  "oneOf": [
103
209
  {
104
210
  "properties": {
105
- "outcome": { "const": "restricted" },
106
- "restrictions": { "minItems": 1 }
107
- }
211
+ "outcome": {
212
+ "const": "restricted"
213
+ },
214
+ "restrictions": {
215
+ "minItems": 1,
216
+ "type": "array"
217
+ }
218
+ },
219
+ "type": "object"
108
220
  },
109
221
  {
110
222
  "properties": {
111
- "outcome": { "const": "excluded" },
112
- "restrictions": { "maxItems": 0 }
113
- }
223
+ "outcome": {
224
+ "const": "excluded"
225
+ },
226
+ "restrictions": {
227
+ "maxItems": 0,
228
+ "type": "array"
229
+ }
230
+ },
231
+ "type": "object"
114
232
  }
115
- ]
233
+ ],
234
+ "type": "object"
116
235
  }
117
236
  }
118
237
  ]