@sealkeeper/schema 0.4.6 → 0.4.8
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/README.md +2 -2
- package/dist/api.d.ts +787 -35
- package/dist/api.js +357 -44
- package/dist/conformance.d.ts +4 -0
- package/dist/conformance.js +7 -0
- package/dist/credential.d.ts +196 -27
- package/dist/credential.js +128 -80
- package/dist/dimensions.d.ts +16 -3
- package/dist/dimensions.js +48 -2
- package/dist/events.d.ts +1 -0
- package/dist/events.js +13 -1
- package/dist/fingerprint-conformance.d.ts +17 -0
- package/dist/fingerprint-conformance.js +83 -0
- package/dist/fingerprint.d.ts +132 -0
- package/dist/fingerprint.js +166 -0
- package/dist/goal.d.ts +16 -1
- package/dist/goal.js +29 -6
- package/dist/handshake-conformance.d.ts +18 -0
- package/dist/handshake-conformance.js +276 -0
- package/dist/handshake.d.ts +66 -0
- package/dist/handshake.js +187 -0
- package/dist/hidden.d.ts +1 -0
- package/dist/hidden.js +5 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/moderation.js +1 -4
- package/dist/policy.d.ts +1 -1
- package/dist/policy.js +1 -1
- package/dist/seal-conformance.js +148 -4
- package/dist/seal-verify.d.ts +21 -0
- package/dist/seal-verify.js +63 -0
- package/dist/standing.d.ts +61 -0
- package/dist/standing.js +132 -4
- package/dist/task-templates.d.ts +46 -0
- package/dist/task-templates.js +501 -0
- package/dist/tasks.d.ts +43 -0
- package/dist/tasks.js +103 -0
- package/dist/template-conformance.d.ts +10 -0
- package/dist/template-conformance.js +298 -0
- package/dist/top-dimensions.d.ts +3 -3
- package/dist/top-dimensions.js +12 -6
- package/package.json +4 -8
- package/dist/db/agent-milestones.d.ts +0 -75
- package/dist/db/agent-milestones.js +0 -16
- package/dist/db/agent-renames.d.ts +0 -126
- package/dist/db/agent-renames.js +0 -20
- package/dist/db/agents.d.ts +0 -351
- package/dist/db/agents.js +0 -99
- package/dist/db/client.d.ts +0 -2561
- package/dist/db/client.js +0 -61
- package/dist/db/credentials.d.ts +0 -143
- package/dist/db/credentials.js +0 -16
- package/dist/db/deleted-operators.d.ts +0 -75
- package/dist/db/deleted-operators.js +0 -13
- package/dist/db/events.d.ts +0 -160
- package/dist/db/events.js +0 -41
- package/dist/db/feed-items.d.ts +0 -109
- package/dist/db/feed-items.js +0 -21
- package/dist/db/index.d.ts +0 -76
- package/dist/db/index.js +0 -28
- package/dist/db/migrate.d.ts +0 -1
- package/dist/db/migrate.js +0 -34
- package/dist/db/migrator.d.ts +0 -6
- package/dist/db/migrator.js +0 -36
- package/dist/db/operator-identities.d.ts +0 -211
- package/dist/db/operator-identities.js +0 -49
- package/dist/db/operator-level-grants.d.ts +0 -109
- package/dist/db/operator-level-grants.js +0 -30
- package/dist/db/operator-slugs.d.ts +0 -92
- package/dist/db/operator-slugs.js +0 -25
- package/dist/db/operators.d.ts +0 -228
- package/dist/db/operators.js +0 -39
- package/dist/db/quota-counters.d.ts +0 -109
- package/dist/db/quota-counters.js +0 -17
- package/dist/db/ratings.d.ts +0 -160
- package/dist/db/ratings.js +0 -27
- package/dist/db/scores.d.ts +0 -160
- package/dist/db/scores.js +0 -15
- package/dist/db/standing.d.ts +0 -264
- package/dist/db/standing.js +0 -34
- package/dist/db/task-claim-failures.d.ts +0 -143
- package/dist/db/task-claim-failures.js +0 -37
- package/dist/db/task-outcomes.d.ts +0 -145
- package/dist/db/task-outcomes.js +0 -25
- package/dist/db/tasks.d.ts +0 -381
- package/dist/db/tasks.js +0 -106
- package/dist/db/timestamps.d.ts +0 -4
- package/dist/db/timestamps.js +0 -24
- package/dist/db/url.d.ts +0 -12
- package/dist/db/url.js +0 -25
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
const DEDUPE_INSTRUCTION = 'Remove duplicate lines from the text in input.';
|
|
2
|
+
const DEDUPE_OUTPUT = 'Lines are separated by a line feed. Keep each distinct line once, in the order it first appears. Compare lines exactly, so case and spaces matter. Join the kept lines with a line feed and end with exactly one line feed.';
|
|
3
|
+
const SORT_INSTRUCTION = 'Sort the lines of the text in input.';
|
|
4
|
+
const SORT_OUTPUT = 'Lines are separated by a line feed. Sort them in ascending Unicode code point order, so every capital letter comes before every lower case letter. Keep duplicate lines and change nothing inside a line. Join the lines with a line feed and end with exactly one line feed.';
|
|
5
|
+
const SHAPE_INSTRUCTION = 'Turn the sentence in input into one JSON object.';
|
|
6
|
+
const SHAPE_OUTPUT_1 = "Return one JSON object with exactly these fields and no others, guest (string), nights (integer), city (string), breakfast (boolean). Take every value from the sentence, and give a fact that is either so or not so as a boolean. It must validate against the task's JSON schema.";
|
|
7
|
+
const SHAPE_OUTPUT_2 = "Return one JSON object with exactly these fields and no others, orderId (integer), customer (string), items (integer), total (number), express (boolean). Take every value from the sentence, and give a fact that is either so or not so as a boolean. It must validate against the task's JSON schema.";
|
|
8
|
+
const SHAPE_OUTPUT_3 = "Return one JSON object with exactly these fields and no others, station (string), tempC (number), humidity (integer), raining (boolean). Take every value from the sentence, and give a fact that is either so or not so as a boolean. It must validate against the task's JSON schema.";
|
|
9
|
+
export const TEMPLATE_VECTORS = [
|
|
10
|
+
{
|
|
11
|
+
name: 'text_dedupe keeps the first of each line',
|
|
12
|
+
taskType: 'text_dedupe',
|
|
13
|
+
spec: {
|
|
14
|
+
instruction: DEDUPE_INSTRUCTION,
|
|
15
|
+
input: 'b\na\nb',
|
|
16
|
+
output: DEDUPE_OUTPUT,
|
|
17
|
+
},
|
|
18
|
+
answer: 'b\na\n',
|
|
19
|
+
sha256: 'aea8a04c2f293417e499bf5de2def8ebb1ed40264d128a67180ea56fbe4600ff',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'text_dedupe compares case and spaces exactly',
|
|
23
|
+
taskType: 'text_dedupe',
|
|
24
|
+
spec: {
|
|
25
|
+
instruction: DEDUPE_INSTRUCTION,
|
|
26
|
+
input: 'a b\na b\na b\nA b',
|
|
27
|
+
output: DEDUPE_OUTPUT,
|
|
28
|
+
},
|
|
29
|
+
answer: 'a b\na b\nA b\n',
|
|
30
|
+
sha256: 'fb7bd1b067ab306aeab777deb88f8141f2f03263a7f0955905d7e7ce4995cfb9',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'text_dedupe keeps a composed and a decomposed letter apart',
|
|
34
|
+
taskType: 'text_dedupe',
|
|
35
|
+
spec: {
|
|
36
|
+
instruction: DEDUPE_INSTRUCTION,
|
|
37
|
+
input: 'caf\u00e9\ncafe\u0301\ncaf\u00e9\n\ud83d\ude00\n\ud83d\ude00',
|
|
38
|
+
output: DEDUPE_OUTPUT,
|
|
39
|
+
},
|
|
40
|
+
answer: 'caf\u00e9\ncafe\u0301\n\ud83d\ude00\n',
|
|
41
|
+
sha256: '649edf74b6a808475fe64e29f3cd9b98e528bf9f86289188b7a306ce635c0975',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'text_dedupe drawn',
|
|
45
|
+
taskType: 'text_dedupe',
|
|
46
|
+
spec: {
|
|
47
|
+
instruction: DEDUPE_INSTRUCTION,
|
|
48
|
+
input: 'birch\nsummit\nsummit\nsummit\nglade\nBirch\nsummit\nglade\nglade\nbirch',
|
|
49
|
+
output: DEDUPE_OUTPUT,
|
|
50
|
+
},
|
|
51
|
+
answer: 'birch\nsummit\nglade\nBirch\n',
|
|
52
|
+
sha256: '64466fd7b6ccc6445c2adbfeac0c48b510c151ec391e35ce0685cb0788f94163',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'text_dedupe keeps a line that starts with a byte order mark',
|
|
56
|
+
taskType: 'text_dedupe',
|
|
57
|
+
spec: {
|
|
58
|
+
instruction: DEDUPE_INSTRUCTION,
|
|
59
|
+
input: '\ufeffb\na\n\ufeffb\nb',
|
|
60
|
+
output: DEDUPE_OUTPUT,
|
|
61
|
+
},
|
|
62
|
+
answer: '\ufeffb\na\nb\n',
|
|
63
|
+
sha256: '1b7fbe602895eac2063df17a614b47fa561c2b8be1835c94c933be226176c9a7',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'line_sort puts capitals first',
|
|
67
|
+
taskType: 'line_sort',
|
|
68
|
+
spec: {
|
|
69
|
+
instruction: SORT_INSTRUCTION,
|
|
70
|
+
input: 'pear\nApple\nbanana\napple',
|
|
71
|
+
output: SORT_OUTPUT,
|
|
72
|
+
},
|
|
73
|
+
answer: 'Apple\napple\nbanana\npear\n',
|
|
74
|
+
sha256: '63244b1e6793cf80e4b0b0977511f1f5565e2dc7e8e8a83efad8f0fac27bf03e',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'line_sort orders by code point, not UTF-16 unit, and keeps duplicates',
|
|
78
|
+
taskType: 'line_sort',
|
|
79
|
+
spec: {
|
|
80
|
+
instruction: SORT_INSTRUCTION,
|
|
81
|
+
input: '\uff5e\n\ud83d\ude00\na\nZ\n\ud83d\ude00',
|
|
82
|
+
output: SORT_OUTPUT,
|
|
83
|
+
},
|
|
84
|
+
answer: 'Z\na\n\uff5e\n\ud83d\ude00\n\ud83d\ude00\n',
|
|
85
|
+
sha256: 'fd5d08a5c98c060413cf15bfe23c8bb6bb88e230ed08d97176b55617daff64b8',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'line_sort compares digits as text',
|
|
89
|
+
taskType: 'line_sort',
|
|
90
|
+
spec: {
|
|
91
|
+
instruction: SORT_INSTRUCTION,
|
|
92
|
+
input: 'b 10\nb 9\nb 1',
|
|
93
|
+
output: SORT_OUTPUT,
|
|
94
|
+
},
|
|
95
|
+
answer: 'b 1\nb 10\nb 9\n',
|
|
96
|
+
sha256: '8e3daa107a4634994df4aa192ac34e9cc7f45817c90c27dee84399f7b62e581f',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'line_sort drawn',
|
|
100
|
+
taskType: 'line_sort',
|
|
101
|
+
spec: {
|
|
102
|
+
instruction: SORT_INSTRUCTION,
|
|
103
|
+
input: 'birch 417\nSummit 444\nglade 814\ntundra 63\nmeadow 625\ncedar 421\nfjord 635\nriver 742',
|
|
104
|
+
output: SORT_OUTPUT,
|
|
105
|
+
},
|
|
106
|
+
answer: 'Summit 444\nbirch 417\ncedar 421\nfjord 635\nglade 814\nmeadow 625\nriver 742\ntundra 63\n',
|
|
107
|
+
sha256: '01503d6c6666daf055f294c5061472a9530fa2dea9b74a29ea49b71aeec6fbd2',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'line_sort sorts a byte order mark as a character',
|
|
111
|
+
taskType: 'line_sort',
|
|
112
|
+
spec: {
|
|
113
|
+
instruction: SORT_INSTRUCTION,
|
|
114
|
+
input: '\ufeffpear\nApple',
|
|
115
|
+
output: SORT_OUTPUT,
|
|
116
|
+
},
|
|
117
|
+
answer: 'Apple\n\ufeffpear\n',
|
|
118
|
+
sha256: 'cc16d27a6e19248be0fe05d8f4db040d8f22b659e102e065e0d935ebddb5d837',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'json_shape booking with breakfast',
|
|
122
|
+
taskType: 'json_shape',
|
|
123
|
+
spec: {
|
|
124
|
+
instruction: SHAPE_INSTRUCTION,
|
|
125
|
+
input: 'Alice booked 1 nights in Accra, breakfast included.',
|
|
126
|
+
output: SHAPE_OUTPUT_1,
|
|
127
|
+
},
|
|
128
|
+
answer: '{"guest":"Alice","nights":1,"city":"Accra","breakfast":true}',
|
|
129
|
+
sha256: '8e3f3bae5bdfc8bbb148b05216589db1ff55aeff6664ca172b2b146d8623c7ce',
|
|
130
|
+
jsonSchema: {
|
|
131
|
+
type: 'object',
|
|
132
|
+
properties: {
|
|
133
|
+
guest: { type: 'string', const: 'Alice' },
|
|
134
|
+
nights: { type: 'integer', const: 1 },
|
|
135
|
+
city: { type: 'string', const: 'Accra' },
|
|
136
|
+
breakfast: { type: 'boolean', const: true },
|
|
137
|
+
},
|
|
138
|
+
required: ['guest', 'nights', 'city', 'breakfast'],
|
|
139
|
+
additionalProperties: false,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'json_shape booking without breakfast',
|
|
144
|
+
taskType: 'json_shape',
|
|
145
|
+
spec: {
|
|
146
|
+
instruction: SHAPE_INSTRUCTION,
|
|
147
|
+
input: 'Ivan booked 13 nights in Lagos, breakfast not included.',
|
|
148
|
+
output: SHAPE_OUTPUT_1,
|
|
149
|
+
},
|
|
150
|
+
answer: '{"guest":"Ivan","nights":13,"city":"Lagos","breakfast":false}',
|
|
151
|
+
sha256: '4e1ac75c0fc4c35f5476b4e0a7df49580cf5898ed3e4462705990f3386f1ccb7',
|
|
152
|
+
jsonSchema: {
|
|
153
|
+
type: 'object',
|
|
154
|
+
properties: {
|
|
155
|
+
guest: { type: 'string', const: 'Ivan' },
|
|
156
|
+
nights: { type: 'integer', const: 13 },
|
|
157
|
+
city: { type: 'string', const: 'Lagos' },
|
|
158
|
+
breakfast: { type: 'boolean', const: false },
|
|
159
|
+
},
|
|
160
|
+
required: ['guest', 'nights', 'city', 'breakfast'],
|
|
161
|
+
additionalProperties: false,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'json_shape express order with a whole total',
|
|
166
|
+
taskType: 'json_shape',
|
|
167
|
+
spec: {
|
|
168
|
+
instruction: SHAPE_INSTRUCTION,
|
|
169
|
+
input: 'Order 1000 was placed by Judy for 12 items, total 1.00, with express shipping.',
|
|
170
|
+
output: SHAPE_OUTPUT_2,
|
|
171
|
+
},
|
|
172
|
+
answer: '{"orderId":1000,"customer":"Judy","items":12,"total":1,"express":true}',
|
|
173
|
+
sha256: '2410664d0ece991201868f56c4edb8b7316d0d99422ace443e3a8ebff7cdf0bb',
|
|
174
|
+
jsonSchema: {
|
|
175
|
+
type: 'object',
|
|
176
|
+
properties: {
|
|
177
|
+
orderId: { type: 'integer', const: 1000 },
|
|
178
|
+
customer: { type: 'string', const: 'Judy' },
|
|
179
|
+
items: { type: 'integer', const: 12 },
|
|
180
|
+
total: { type: 'number', const: 1 },
|
|
181
|
+
express: { type: 'boolean', const: true },
|
|
182
|
+
},
|
|
183
|
+
required: ['orderId', 'customer', 'items', 'total', 'express'],
|
|
184
|
+
additionalProperties: false,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: 'json_shape standard order',
|
|
189
|
+
taskType: 'json_shape',
|
|
190
|
+
spec: {
|
|
191
|
+
instruction: SHAPE_INSTRUCTION,
|
|
192
|
+
input: 'Order 78592 was placed by Carol for 1 items, total 465.16, with standard shipping.',
|
|
193
|
+
output: SHAPE_OUTPUT_2,
|
|
194
|
+
},
|
|
195
|
+
answer: '{"orderId":78592,"customer":"Carol","items":1,"total":465.16,"express":false}',
|
|
196
|
+
sha256: '6c51416d6c141bbaf3e6f87b4a2f71e8a6b439ff8433e515ede780092914f05d',
|
|
197
|
+
jsonSchema: {
|
|
198
|
+
type: 'object',
|
|
199
|
+
properties: {
|
|
200
|
+
orderId: { type: 'integer', const: 78592 },
|
|
201
|
+
customer: { type: 'string', const: 'Carol' },
|
|
202
|
+
items: { type: 'integer', const: 1 },
|
|
203
|
+
total: { type: 'number', const: 465.16 },
|
|
204
|
+
express: { type: 'boolean', const: false },
|
|
205
|
+
},
|
|
206
|
+
required: ['orderId', 'customer', 'items', 'total', 'express'],
|
|
207
|
+
additionalProperties: false,
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: 'json_shape station raining at a whole temperature',
|
|
212
|
+
taskType: 'json_shape',
|
|
213
|
+
spec: {
|
|
214
|
+
instruction: SHAPE_INSTRUCTION,
|
|
215
|
+
input: 'The Vienna station reads 42.0 C with 100 percent humidity, and it is raining.',
|
|
216
|
+
output: SHAPE_OUTPUT_3,
|
|
217
|
+
},
|
|
218
|
+
answer: '{"station":"Vienna","tempC":42,"humidity":100,"raining":true}',
|
|
219
|
+
sha256: '98ca8812f15404b81cd12653dff3ae03bce6a804c19451ca34c12ea8f68a95cc',
|
|
220
|
+
jsonSchema: {
|
|
221
|
+
type: 'object',
|
|
222
|
+
properties: {
|
|
223
|
+
station: { type: 'string', const: 'Vienna' },
|
|
224
|
+
tempC: { type: 'number', const: 42 },
|
|
225
|
+
humidity: { type: 'integer', const: 100 },
|
|
226
|
+
raining: { type: 'boolean', const: true },
|
|
227
|
+
},
|
|
228
|
+
required: ['station', 'tempC', 'humidity', 'raining'],
|
|
229
|
+
additionalProperties: false,
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: 'json_shape station below zero',
|
|
234
|
+
taskType: 'json_shape',
|
|
235
|
+
spec: {
|
|
236
|
+
instruction: SHAPE_INSTRUCTION,
|
|
237
|
+
input: 'The Oslo station reads -5.5 C with 5 percent humidity, and it is not raining.',
|
|
238
|
+
output: SHAPE_OUTPUT_3,
|
|
239
|
+
},
|
|
240
|
+
answer: '{"station":"Oslo","tempC":-5.5,"humidity":5,"raining":false}',
|
|
241
|
+
sha256: '83d7dc3d181de56c688d8d24d40d4e1ad0904b3531bb361c77b56a6eecd5be68',
|
|
242
|
+
jsonSchema: {
|
|
243
|
+
type: 'object',
|
|
244
|
+
properties: {
|
|
245
|
+
station: { type: 'string', const: 'Oslo' },
|
|
246
|
+
tempC: { type: 'number', const: -5.5 },
|
|
247
|
+
humidity: { type: 'integer', const: 5 },
|
|
248
|
+
raining: { type: 'boolean', const: false },
|
|
249
|
+
},
|
|
250
|
+
required: ['station', 'tempC', 'humidity', 'raining'],
|
|
251
|
+
additionalProperties: false,
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: 'json_shape station at zero',
|
|
256
|
+
taskType: 'json_shape',
|
|
257
|
+
spec: {
|
|
258
|
+
instruction: SHAPE_INSTRUCTION,
|
|
259
|
+
input: 'The Oslo station reads 0.0 C with 50 percent humidity, and it is raining.',
|
|
260
|
+
output: SHAPE_OUTPUT_3,
|
|
261
|
+
},
|
|
262
|
+
answer: '{"station":"Oslo","tempC":0,"humidity":50,"raining":true}',
|
|
263
|
+
sha256: '90e2aebf3a32bc59b0d28dd139ffc236145d5587f6c6fba06a90b581fb1b872b',
|
|
264
|
+
jsonSchema: {
|
|
265
|
+
type: 'object',
|
|
266
|
+
properties: {
|
|
267
|
+
station: { type: 'string', const: 'Oslo' },
|
|
268
|
+
tempC: { type: 'number', const: 0 },
|
|
269
|
+
humidity: { type: 'integer', const: 50 },
|
|
270
|
+
raining: { type: 'boolean', const: true },
|
|
271
|
+
},
|
|
272
|
+
required: ['station', 'tempC', 'humidity', 'raining'],
|
|
273
|
+
additionalProperties: false,
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: 'json_shape station at the coldest draw',
|
|
278
|
+
taskType: 'json_shape',
|
|
279
|
+
spec: {
|
|
280
|
+
instruction: SHAPE_INSTRUCTION,
|
|
281
|
+
input: 'The Accra station reads -15.0 C with 99 percent humidity, and it is not raining.',
|
|
282
|
+
output: SHAPE_OUTPUT_3,
|
|
283
|
+
},
|
|
284
|
+
answer: '{"station":"Accra","tempC":-15,"humidity":99,"raining":false}',
|
|
285
|
+
sha256: '3e70b7c72ca7dabf20ac5b4f6b40cf35b9217a0fe4a0580f58953c21217017b7',
|
|
286
|
+
jsonSchema: {
|
|
287
|
+
type: 'object',
|
|
288
|
+
properties: {
|
|
289
|
+
station: { type: 'string', const: 'Accra' },
|
|
290
|
+
tempC: { type: 'number', const: -15 },
|
|
291
|
+
humidity: { type: 'integer', const: 99 },
|
|
292
|
+
raining: { type: 'boolean', const: false },
|
|
293
|
+
},
|
|
294
|
+
required: ['station', 'tempC', 'humidity', 'raining'],
|
|
295
|
+
additionalProperties: false,
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
];
|
package/dist/top-dimensions.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Dimension } from './dimensions.js';
|
|
2
2
|
export type TopDimension = {
|
|
3
|
-
dimension:
|
|
3
|
+
dimension: Dimension;
|
|
4
4
|
value: number;
|
|
5
5
|
};
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function topDimensions(scores: readonly {
|
|
7
7
|
dimension: string;
|
|
8
8
|
value: number | null;
|
|
9
9
|
}[], count: number): TopDimension[];
|
package/dist/top-dimensions.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { BaseDimension } from './dimensions.js';
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
|
|
1
|
+
import { BaseDimension, COMPETENCE_DIMENSIONS, } from './dimensions.js';
|
|
2
|
+
// Every dimension a ranking looks at, in the fixed order ties keep. The base
|
|
3
|
+
// dimensions first, then the seven competence categories (RT-3). A key the
|
|
4
|
+
// issuer no longer writes, competence per task type, is never ranked.
|
|
5
|
+
const RANKED = [
|
|
6
|
+
...BaseDimension.options,
|
|
7
|
+
...COMPETENCE_DIMENSIONS,
|
|
8
|
+
];
|
|
9
|
+
// Dimensions with a value, highest first. Ties keep the order of RANKED.
|
|
10
|
+
// Callers that want trust only filter with isTrustDimension first.
|
|
11
|
+
export function topDimensions(scores, count) {
|
|
6
12
|
const ranked = [];
|
|
7
|
-
for (const d of
|
|
13
|
+
for (const d of RANKED) {
|
|
8
14
|
const value = scores.find((s) => s.dimension === d)?.value;
|
|
9
15
|
if (typeof value === 'number')
|
|
10
16
|
ranked.push({ dimension: d, value });
|
package/package.json
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealkeeper/schema",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Zod schemas, event taxonomy and signing helpers for SealKeeper.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"homepage": "https://sealkeeper.run/seal/standard",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/sealkeeper-dev/sealkeeper.git",
|
|
11
|
-
"directory": "packages/schema"
|
|
12
|
-
},
|
|
13
8
|
"bugs": {
|
|
14
9
|
"url": "https://github.com/sealkeeper-dev/cli/issues"
|
|
15
10
|
},
|
|
@@ -23,8 +18,8 @@
|
|
|
23
18
|
"default": "./dist/index.js"
|
|
24
19
|
},
|
|
25
20
|
"./conformance": {
|
|
26
|
-
"types": "./dist/
|
|
27
|
-
"default": "./dist/
|
|
21
|
+
"types": "./dist/conformance.d.ts",
|
|
22
|
+
"default": "./dist/conformance.js"
|
|
28
23
|
},
|
|
29
24
|
"./db": {
|
|
30
25
|
"types": "./dist/db/index.d.ts",
|
|
@@ -33,6 +28,7 @@
|
|
|
33
28
|
},
|
|
34
29
|
"files": [
|
|
35
30
|
"dist",
|
|
31
|
+
"!dist/db",
|
|
36
32
|
"README.md",
|
|
37
33
|
"LICENSE",
|
|
38
34
|
"NOTICE"
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export declare const agentMilestones: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
2
|
-
name: "agent_milestones";
|
|
3
|
-
schema: undefined;
|
|
4
|
-
columns: {
|
|
5
|
-
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
6
|
-
name: "created_at";
|
|
7
|
-
tableName: "agent_milestones";
|
|
8
|
-
dataType: "date";
|
|
9
|
-
columnType: "PgTimestamp";
|
|
10
|
-
data: Date;
|
|
11
|
-
driverParam: string;
|
|
12
|
-
notNull: true;
|
|
13
|
-
hasDefault: true;
|
|
14
|
-
isPrimaryKey: false;
|
|
15
|
-
isAutoincrement: false;
|
|
16
|
-
hasRuntimeDefault: false;
|
|
17
|
-
enumValues: undefined;
|
|
18
|
-
baseColumn: never;
|
|
19
|
-
identity: undefined;
|
|
20
|
-
generated: undefined;
|
|
21
|
-
}, {}, {}>;
|
|
22
|
-
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
|
-
name: "updated_at";
|
|
24
|
-
tableName: "agent_milestones";
|
|
25
|
-
dataType: "date";
|
|
26
|
-
columnType: "PgTimestamp";
|
|
27
|
-
data: Date;
|
|
28
|
-
driverParam: string;
|
|
29
|
-
notNull: true;
|
|
30
|
-
hasDefault: true;
|
|
31
|
-
isPrimaryKey: false;
|
|
32
|
-
isAutoincrement: false;
|
|
33
|
-
hasRuntimeDefault: false;
|
|
34
|
-
enumValues: undefined;
|
|
35
|
-
baseColumn: never;
|
|
36
|
-
identity: undefined;
|
|
37
|
-
generated: undefined;
|
|
38
|
-
}, {}, {}>;
|
|
39
|
-
agentId: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
|
-
name: "agent_id";
|
|
41
|
-
tableName: "agent_milestones";
|
|
42
|
-
dataType: "string";
|
|
43
|
-
columnType: "PgText";
|
|
44
|
-
data: string;
|
|
45
|
-
driverParam: string;
|
|
46
|
-
notNull: true;
|
|
47
|
-
hasDefault: false;
|
|
48
|
-
isPrimaryKey: false;
|
|
49
|
-
isAutoincrement: false;
|
|
50
|
-
hasRuntimeDefault: false;
|
|
51
|
-
enumValues: [string, ...string[]];
|
|
52
|
-
baseColumn: never;
|
|
53
|
-
identity: undefined;
|
|
54
|
-
generated: undefined;
|
|
55
|
-
}, {}, {}>;
|
|
56
|
-
milestone: import("drizzle-orm/pg-core").PgColumn<{
|
|
57
|
-
name: "milestone";
|
|
58
|
-
tableName: "agent_milestones";
|
|
59
|
-
dataType: "string";
|
|
60
|
-
columnType: "PgText";
|
|
61
|
-
data: string;
|
|
62
|
-
driverParam: string;
|
|
63
|
-
notNull: true;
|
|
64
|
-
hasDefault: false;
|
|
65
|
-
isPrimaryKey: false;
|
|
66
|
-
isAutoincrement: false;
|
|
67
|
-
hasRuntimeDefault: false;
|
|
68
|
-
enumValues: [string, ...string[]];
|
|
69
|
-
baseColumn: never;
|
|
70
|
-
identity: undefined;
|
|
71
|
-
generated: undefined;
|
|
72
|
-
}, {}, {}>;
|
|
73
|
-
};
|
|
74
|
-
dialect: 'pg';
|
|
75
|
-
}>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { pgTable, primaryKey, text } from 'drizzle-orm/pg-core';
|
|
2
|
-
import { agents } from './agents.js';
|
|
3
|
-
import { timestamps } from './timestamps.js';
|
|
4
|
-
// The feed milestones an agent has reached, one row per (agent, milestone).
|
|
5
|
-
// The scoring run writes a milestone to the feed only when it has no row
|
|
6
|
-
// here, so each is written once per agent, ever. Migration 0019 seeded it
|
|
7
|
-
// from standing, so an agent that already stood above none, or already
|
|
8
|
-
// passed a verified task count, before milestones existed is not told it
|
|
9
|
-
// did so for the first time.
|
|
10
|
-
export const agentMilestones = pgTable('agent_milestones', {
|
|
11
|
-
agentId: text('agent_id')
|
|
12
|
-
.notNull()
|
|
13
|
-
.references(() => agents.id),
|
|
14
|
-
milestone: text('milestone').notNull(),
|
|
15
|
-
...timestamps,
|
|
16
|
-
}, (t) => [primaryKey({ columns: [t.agentId, t.milestone] })]);
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
export declare const agentRenames: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
2
|
-
name: "agent_renames";
|
|
3
|
-
schema: undefined;
|
|
4
|
-
columns: {
|
|
5
|
-
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
6
|
-
name: "created_at";
|
|
7
|
-
tableName: "agent_renames";
|
|
8
|
-
dataType: "date";
|
|
9
|
-
columnType: "PgTimestamp";
|
|
10
|
-
data: Date;
|
|
11
|
-
driverParam: string;
|
|
12
|
-
notNull: true;
|
|
13
|
-
hasDefault: true;
|
|
14
|
-
isPrimaryKey: false;
|
|
15
|
-
isAutoincrement: false;
|
|
16
|
-
hasRuntimeDefault: false;
|
|
17
|
-
enumValues: undefined;
|
|
18
|
-
baseColumn: never;
|
|
19
|
-
identity: undefined;
|
|
20
|
-
generated: undefined;
|
|
21
|
-
}, {}, {}>;
|
|
22
|
-
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
|
-
name: "updated_at";
|
|
24
|
-
tableName: "agent_renames";
|
|
25
|
-
dataType: "date";
|
|
26
|
-
columnType: "PgTimestamp";
|
|
27
|
-
data: Date;
|
|
28
|
-
driverParam: string;
|
|
29
|
-
notNull: true;
|
|
30
|
-
hasDefault: true;
|
|
31
|
-
isPrimaryKey: false;
|
|
32
|
-
isAutoincrement: false;
|
|
33
|
-
hasRuntimeDefault: false;
|
|
34
|
-
enumValues: undefined;
|
|
35
|
-
baseColumn: never;
|
|
36
|
-
identity: undefined;
|
|
37
|
-
generated: undefined;
|
|
38
|
-
}, {}, {}>;
|
|
39
|
-
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
40
|
-
name: "id";
|
|
41
|
-
tableName: "agent_renames";
|
|
42
|
-
dataType: "number";
|
|
43
|
-
columnType: "PgBigSerial53";
|
|
44
|
-
data: number;
|
|
45
|
-
driverParam: number;
|
|
46
|
-
notNull: true;
|
|
47
|
-
hasDefault: true;
|
|
48
|
-
isPrimaryKey: true;
|
|
49
|
-
isAutoincrement: false;
|
|
50
|
-
hasRuntimeDefault: false;
|
|
51
|
-
enumValues: undefined;
|
|
52
|
-
baseColumn: never;
|
|
53
|
-
identity: undefined;
|
|
54
|
-
generated: undefined;
|
|
55
|
-
}, {}, {}>;
|
|
56
|
-
agentId: import("drizzle-orm/pg-core").PgColumn<{
|
|
57
|
-
name: "agent_id";
|
|
58
|
-
tableName: "agent_renames";
|
|
59
|
-
dataType: "string";
|
|
60
|
-
columnType: "PgText";
|
|
61
|
-
data: string;
|
|
62
|
-
driverParam: string;
|
|
63
|
-
notNull: true;
|
|
64
|
-
hasDefault: false;
|
|
65
|
-
isPrimaryKey: false;
|
|
66
|
-
isAutoincrement: false;
|
|
67
|
-
hasRuntimeDefault: false;
|
|
68
|
-
enumValues: [string, ...string[]];
|
|
69
|
-
baseColumn: never;
|
|
70
|
-
identity: undefined;
|
|
71
|
-
generated: undefined;
|
|
72
|
-
}, {}, {}>;
|
|
73
|
-
oldName: import("drizzle-orm/pg-core").PgColumn<{
|
|
74
|
-
name: "old_name";
|
|
75
|
-
tableName: "agent_renames";
|
|
76
|
-
dataType: "string";
|
|
77
|
-
columnType: "PgText";
|
|
78
|
-
data: string;
|
|
79
|
-
driverParam: string;
|
|
80
|
-
notNull: true;
|
|
81
|
-
hasDefault: false;
|
|
82
|
-
isPrimaryKey: false;
|
|
83
|
-
isAutoincrement: false;
|
|
84
|
-
hasRuntimeDefault: false;
|
|
85
|
-
enumValues: [string, ...string[]];
|
|
86
|
-
baseColumn: never;
|
|
87
|
-
identity: undefined;
|
|
88
|
-
generated: undefined;
|
|
89
|
-
}, {}, {}>;
|
|
90
|
-
newName: import("drizzle-orm/pg-core").PgColumn<{
|
|
91
|
-
name: "new_name";
|
|
92
|
-
tableName: "agent_renames";
|
|
93
|
-
dataType: "string";
|
|
94
|
-
columnType: "PgText";
|
|
95
|
-
data: string;
|
|
96
|
-
driverParam: string;
|
|
97
|
-
notNull: true;
|
|
98
|
-
hasDefault: false;
|
|
99
|
-
isPrimaryKey: false;
|
|
100
|
-
isAutoincrement: false;
|
|
101
|
-
hasRuntimeDefault: false;
|
|
102
|
-
enumValues: [string, ...string[]];
|
|
103
|
-
baseColumn: never;
|
|
104
|
-
identity: undefined;
|
|
105
|
-
generated: undefined;
|
|
106
|
-
}, {}, {}>;
|
|
107
|
-
issuedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
108
|
-
name: "issued_at";
|
|
109
|
-
tableName: "agent_renames";
|
|
110
|
-
dataType: "date";
|
|
111
|
-
columnType: "PgTimestamp";
|
|
112
|
-
data: Date;
|
|
113
|
-
driverParam: string;
|
|
114
|
-
notNull: true;
|
|
115
|
-
hasDefault: false;
|
|
116
|
-
isPrimaryKey: false;
|
|
117
|
-
isAutoincrement: false;
|
|
118
|
-
hasRuntimeDefault: false;
|
|
119
|
-
enumValues: undefined;
|
|
120
|
-
baseColumn: never;
|
|
121
|
-
identity: undefined;
|
|
122
|
-
generated: undefined;
|
|
123
|
-
}, {}, {}>;
|
|
124
|
-
};
|
|
125
|
-
dialect: 'pg';
|
|
126
|
-
}>;
|
package/dist/db/agent-renames.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { bigserial, index, pgTable, text, timestamp, } from 'drizzle-orm/pg-core';
|
|
2
|
-
import { agents } from './agents.js';
|
|
3
|
-
import { timestamps } from './timestamps.js';
|
|
4
|
-
// One row per rename. An old handle keeps resolving, as a redirect, for
|
|
5
|
-
// RENAME_REDIRECT_DAYS after the rename, and the profile shows the old name
|
|
6
|
-
// for as long. issued_at is the signed issuedAt of the rename, so an older
|
|
7
|
-
// envelope sent again is refused.
|
|
8
|
-
//
|
|
9
|
-
// bigserial is a bigint filled from its own sequence. mode 'number' reads it
|
|
10
|
-
// as a JS number, which is safe well past any count of renames.
|
|
11
|
-
export const agentRenames = pgTable('agent_renames', {
|
|
12
|
-
id: bigserial('id', { mode: 'number' }).primaryKey(),
|
|
13
|
-
agentId: text('agent_id')
|
|
14
|
-
.notNull()
|
|
15
|
-
.references(() => agents.id),
|
|
16
|
-
oldName: text('old_name').notNull(),
|
|
17
|
-
newName: text('new_name').notNull(),
|
|
18
|
-
issuedAt: timestamp('issued_at', { withTimezone: true }).notNull(),
|
|
19
|
-
...timestamps,
|
|
20
|
-
}, (t) => [index('agent_renames_agent_created_idx').on(t.agentId, t.createdAt)]);
|