@larkup/marketplace 0.1.25 → 0.2.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/.env.example +3 -0
  2. package/CHANGELOG.md +173 -0
  3. package/README.md +34 -0
  4. package/db/drizzle/0000_hesitant_joseph.sql +69 -0
  5. package/db/drizzle/0001_deep_phil_sheldon.sql +1 -0
  6. package/db/drizzle/0002_jittery_living_mummy.sql +18 -0
  7. package/db/drizzle/meta/0000_snapshot.json +483 -0
  8. package/db/drizzle/meta/0001_snapshot.json +490 -0
  9. package/db/drizzle/meta/0002_snapshot.json +615 -0
  10. package/db/drizzle/meta/_journal.json +27 -0
  11. package/db/drizzle.config.ts +19 -0
  12. package/db/tsconfig.build.json +11 -0
  13. package/db/tsconfig.json +17 -0
  14. package/db/vitest.config.ts +11 -0
  15. package/package.json +31 -4
  16. package/src/db/builtin-tools.ts +613 -0
  17. package/src/db/client.ts +26 -0
  18. package/src/db/repo.test.ts +309 -0
  19. package/src/db/repo.ts +558 -0
  20. package/src/db/schema/audit.ts +27 -0
  21. package/src/db/schema/extensions.ts +73 -0
  22. package/src/db/schema/index.ts +5 -0
  23. package/src/db/schema/installations.ts +23 -0
  24. package/src/db/schema/publishers.ts +13 -0
  25. package/src/db/schema/versions.ts +22 -0
  26. package/src/db/seed.ts +33 -0
  27. package/src/db/validate.test.ts +79 -0
  28. package/src/db/validate.ts +84 -0
  29. package/src/output-sanitizer.test.ts +17 -0
  30. package/src/output-sanitizer.ts +8 -0
  31. package/src/storage-provider-s3.test.ts +110 -0
  32. package/src/storage-provider.ts +164 -13
  33. package/src/tool-extension.ts +247 -0
  34. package/src/tool-installer.ts +80 -109
  35. package/src/tool-loader.test.ts +120 -0
  36. package/src/tool-loader.ts +99 -37
  37. package/src/tool-manifest.schema.ts +89 -32
  38. package/src/tool-registry.ts +34 -111
  39. package/src/types.ts +217 -87
  40. package/vitest.config.ts +13 -0
@@ -0,0 +1,490 @@
1
+ {
2
+ "id": "9a51f664-6160-43f4-91b9-a0c1d47575b7",
3
+ "prevId": "dda5848c-2976-44b4-aafc-8181bee6984d",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.publishers": {
8
+ "name": "publishers",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "name": {
18
+ "name": "name",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "contact_email": {
24
+ "name": "contact_email",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": false
28
+ },
29
+ "verification": {
30
+ "name": "verification",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true,
34
+ "default": "'unverified'"
35
+ },
36
+ "created_at": {
37
+ "name": "created_at",
38
+ "type": "timestamp with time zone",
39
+ "primaryKey": false,
40
+ "notNull": true,
41
+ "default": "now()"
42
+ },
43
+ "updated_at": {
44
+ "name": "updated_at",
45
+ "type": "timestamp with time zone",
46
+ "primaryKey": false,
47
+ "notNull": true,
48
+ "default": "now()"
49
+ }
50
+ },
51
+ "indexes": {},
52
+ "foreignKeys": {},
53
+ "compositePrimaryKeys": {},
54
+ "uniqueConstraints": {},
55
+ "policies": {},
56
+ "checkConstraints": {},
57
+ "isRLSEnabled": false
58
+ },
59
+ "public.extension_workspace_grants": {
60
+ "name": "extension_workspace_grants",
61
+ "schema": "",
62
+ "columns": {
63
+ "id": {
64
+ "name": "id",
65
+ "type": "text",
66
+ "primaryKey": true,
67
+ "notNull": true
68
+ },
69
+ "extension_id": {
70
+ "name": "extension_id",
71
+ "type": "text",
72
+ "primaryKey": false,
73
+ "notNull": true
74
+ },
75
+ "workspace_id": {
76
+ "name": "workspace_id",
77
+ "type": "text",
78
+ "primaryKey": false,
79
+ "notNull": true
80
+ },
81
+ "granted_at": {
82
+ "name": "granted_at",
83
+ "type": "timestamp with time zone",
84
+ "primaryKey": false,
85
+ "notNull": true,
86
+ "default": "now()"
87
+ }
88
+ },
89
+ "indexes": {},
90
+ "foreignKeys": {
91
+ "extension_workspace_grants_extension_id_extensions_id_fk": {
92
+ "name": "extension_workspace_grants_extension_id_extensions_id_fk",
93
+ "tableFrom": "extension_workspace_grants",
94
+ "tableTo": "extensions",
95
+ "columnsFrom": [
96
+ "extension_id"
97
+ ],
98
+ "columnsTo": [
99
+ "id"
100
+ ],
101
+ "onDelete": "no action",
102
+ "onUpdate": "no action"
103
+ }
104
+ },
105
+ "compositePrimaryKeys": {},
106
+ "uniqueConstraints": {},
107
+ "policies": {},
108
+ "checkConstraints": {},
109
+ "isRLSEnabled": false
110
+ },
111
+ "public.extensions": {
112
+ "name": "extensions",
113
+ "schema": "",
114
+ "columns": {
115
+ "id": {
116
+ "name": "id",
117
+ "type": "text",
118
+ "primaryKey": true,
119
+ "notNull": true
120
+ },
121
+ "publisher_id": {
122
+ "name": "publisher_id",
123
+ "type": "text",
124
+ "primaryKey": false,
125
+ "notNull": true
126
+ },
127
+ "kind": {
128
+ "name": "kind",
129
+ "type": "text",
130
+ "primaryKey": false,
131
+ "notNull": true,
132
+ "default": "'tool'"
133
+ },
134
+ "name": {
135
+ "name": "name",
136
+ "type": "text",
137
+ "primaryKey": false,
138
+ "notNull": true
139
+ },
140
+ "description": {
141
+ "name": "description",
142
+ "type": "text",
143
+ "primaryKey": false,
144
+ "notNull": true
145
+ },
146
+ "category": {
147
+ "name": "category",
148
+ "type": "text",
149
+ "primaryKey": false,
150
+ "notNull": true
151
+ },
152
+ "package_name": {
153
+ "name": "package_name",
154
+ "type": "text",
155
+ "primaryKey": false,
156
+ "notNull": true
157
+ },
158
+ "requires_sandbox": {
159
+ "name": "requires_sandbox",
160
+ "type": "boolean",
161
+ "primaryKey": false,
162
+ "notNull": true,
163
+ "default": true
164
+ },
165
+ "distribution": {
166
+ "name": "distribution",
167
+ "type": "text",
168
+ "primaryKey": false,
169
+ "notNull": true,
170
+ "default": "'public'"
171
+ },
172
+ "repository_url": {
173
+ "name": "repository_url",
174
+ "type": "text",
175
+ "primaryKey": false,
176
+ "notNull": false
177
+ },
178
+ "license": {
179
+ "name": "license",
180
+ "type": "text",
181
+ "primaryKey": false,
182
+ "notNull": false
183
+ },
184
+ "deprecated_at": {
185
+ "name": "deprecated_at",
186
+ "type": "timestamp with time zone",
187
+ "primaryKey": false,
188
+ "notNull": false
189
+ },
190
+ "created_at": {
191
+ "name": "created_at",
192
+ "type": "timestamp with time zone",
193
+ "primaryKey": false,
194
+ "notNull": true,
195
+ "default": "now()"
196
+ },
197
+ "updated_at": {
198
+ "name": "updated_at",
199
+ "type": "timestamp with time zone",
200
+ "primaryKey": false,
201
+ "notNull": true,
202
+ "default": "now()"
203
+ }
204
+ },
205
+ "indexes": {},
206
+ "foreignKeys": {
207
+ "extensions_publisher_id_publishers_id_fk": {
208
+ "name": "extensions_publisher_id_publishers_id_fk",
209
+ "tableFrom": "extensions",
210
+ "tableTo": "publishers",
211
+ "columnsFrom": [
212
+ "publisher_id"
213
+ ],
214
+ "columnsTo": [
215
+ "id"
216
+ ],
217
+ "onDelete": "no action",
218
+ "onUpdate": "no action"
219
+ }
220
+ },
221
+ "compositePrimaryKeys": {},
222
+ "uniqueConstraints": {},
223
+ "policies": {},
224
+ "checkConstraints": {},
225
+ "isRLSEnabled": false
226
+ },
227
+ "public.extension_versions": {
228
+ "name": "extension_versions",
229
+ "schema": "",
230
+ "columns": {
231
+ "id": {
232
+ "name": "id",
233
+ "type": "text",
234
+ "primaryKey": true,
235
+ "notNull": true
236
+ },
237
+ "extension_id": {
238
+ "name": "extension_id",
239
+ "type": "text",
240
+ "primaryKey": false,
241
+ "notNull": true
242
+ },
243
+ "version": {
244
+ "name": "version",
245
+ "type": "text",
246
+ "primaryKey": false,
247
+ "notNull": true
248
+ },
249
+ "manifest": {
250
+ "name": "manifest",
251
+ "type": "jsonb",
252
+ "primaryKey": false,
253
+ "notNull": true
254
+ },
255
+ "integrity": {
256
+ "name": "integrity",
257
+ "type": "text",
258
+ "primaryKey": false,
259
+ "notNull": true
260
+ },
261
+ "published_by": {
262
+ "name": "published_by",
263
+ "type": "text",
264
+ "primaryKey": false,
265
+ "notNull": true
266
+ },
267
+ "published_at": {
268
+ "name": "published_at",
269
+ "type": "timestamp with time zone",
270
+ "primaryKey": false,
271
+ "notNull": true,
272
+ "default": "now()"
273
+ }
274
+ },
275
+ "indexes": {
276
+ "extension_versions_extension_id_idx": {
277
+ "name": "extension_versions_extension_id_idx",
278
+ "columns": [
279
+ {
280
+ "expression": "extension_id",
281
+ "isExpression": false,
282
+ "asc": true,
283
+ "nulls": "last"
284
+ }
285
+ ],
286
+ "isUnique": false,
287
+ "concurrently": false,
288
+ "method": "btree",
289
+ "with": {}
290
+ }
291
+ },
292
+ "foreignKeys": {
293
+ "extension_versions_extension_id_extensions_id_fk": {
294
+ "name": "extension_versions_extension_id_extensions_id_fk",
295
+ "tableFrom": "extension_versions",
296
+ "tableTo": "extensions",
297
+ "columnsFrom": [
298
+ "extension_id"
299
+ ],
300
+ "columnsTo": [
301
+ "id"
302
+ ],
303
+ "onDelete": "no action",
304
+ "onUpdate": "no action"
305
+ }
306
+ },
307
+ "compositePrimaryKeys": {},
308
+ "uniqueConstraints": {
309
+ "extension_versions_extension_version_unique": {
310
+ "name": "extension_versions_extension_version_unique",
311
+ "nullsNotDistinct": false,
312
+ "columns": [
313
+ "extension_id",
314
+ "version"
315
+ ]
316
+ }
317
+ },
318
+ "policies": {},
319
+ "checkConstraints": {},
320
+ "isRLSEnabled": false
321
+ },
322
+ "public.workspace_installations": {
323
+ "name": "workspace_installations",
324
+ "schema": "",
325
+ "columns": {
326
+ "id": {
327
+ "name": "id",
328
+ "type": "text",
329
+ "primaryKey": true,
330
+ "notNull": true
331
+ },
332
+ "extension_id": {
333
+ "name": "extension_id",
334
+ "type": "text",
335
+ "primaryKey": false,
336
+ "notNull": true
337
+ },
338
+ "workspace_id": {
339
+ "name": "workspace_id",
340
+ "type": "text",
341
+ "primaryKey": false,
342
+ "notNull": true
343
+ },
344
+ "installed_at": {
345
+ "name": "installed_at",
346
+ "type": "timestamp with time zone",
347
+ "primaryKey": false,
348
+ "notNull": true,
349
+ "default": "now()"
350
+ },
351
+ "updated_at": {
352
+ "name": "updated_at",
353
+ "type": "timestamp with time zone",
354
+ "primaryKey": false,
355
+ "notNull": true,
356
+ "default": "now()"
357
+ }
358
+ },
359
+ "indexes": {
360
+ "workspace_installations_extension_id_idx": {
361
+ "name": "workspace_installations_extension_id_idx",
362
+ "columns": [
363
+ {
364
+ "expression": "extension_id",
365
+ "isExpression": false,
366
+ "asc": true,
367
+ "nulls": "last"
368
+ }
369
+ ],
370
+ "isUnique": false,
371
+ "concurrently": false,
372
+ "method": "btree",
373
+ "with": {}
374
+ }
375
+ },
376
+ "foreignKeys": {
377
+ "workspace_installations_extension_id_extensions_id_fk": {
378
+ "name": "workspace_installations_extension_id_extensions_id_fk",
379
+ "tableFrom": "workspace_installations",
380
+ "tableTo": "extensions",
381
+ "columnsFrom": [
382
+ "extension_id"
383
+ ],
384
+ "columnsTo": [
385
+ "id"
386
+ ],
387
+ "onDelete": "no action",
388
+ "onUpdate": "no action"
389
+ }
390
+ },
391
+ "compositePrimaryKeys": {},
392
+ "uniqueConstraints": {
393
+ "workspace_installations_extension_workspace_unique": {
394
+ "name": "workspace_installations_extension_workspace_unique",
395
+ "nullsNotDistinct": false,
396
+ "columns": [
397
+ "extension_id",
398
+ "workspace_id"
399
+ ]
400
+ }
401
+ },
402
+ "policies": {},
403
+ "checkConstraints": {},
404
+ "isRLSEnabled": false
405
+ },
406
+ "public.audit_events": {
407
+ "name": "audit_events",
408
+ "schema": "",
409
+ "columns": {
410
+ "id": {
411
+ "name": "id",
412
+ "type": "text",
413
+ "primaryKey": true,
414
+ "notNull": true
415
+ },
416
+ "actor": {
417
+ "name": "actor",
418
+ "type": "text",
419
+ "primaryKey": false,
420
+ "notNull": true
421
+ },
422
+ "action": {
423
+ "name": "action",
424
+ "type": "text",
425
+ "primaryKey": false,
426
+ "notNull": true
427
+ },
428
+ "extension_id": {
429
+ "name": "extension_id",
430
+ "type": "text",
431
+ "primaryKey": false,
432
+ "notNull": false
433
+ },
434
+ "workspace_id": {
435
+ "name": "workspace_id",
436
+ "type": "text",
437
+ "primaryKey": false,
438
+ "notNull": false
439
+ },
440
+ "metadata": {
441
+ "name": "metadata",
442
+ "type": "jsonb",
443
+ "primaryKey": false,
444
+ "notNull": false
445
+ },
446
+ "created_at": {
447
+ "name": "created_at",
448
+ "type": "timestamp with time zone",
449
+ "primaryKey": false,
450
+ "notNull": true,
451
+ "default": "now()"
452
+ }
453
+ },
454
+ "indexes": {
455
+ "audit_events_extension_id_idx": {
456
+ "name": "audit_events_extension_id_idx",
457
+ "columns": [
458
+ {
459
+ "expression": "extension_id",
460
+ "isExpression": false,
461
+ "asc": true,
462
+ "nulls": "last"
463
+ }
464
+ ],
465
+ "isUnique": false,
466
+ "concurrently": false,
467
+ "method": "btree",
468
+ "with": {}
469
+ }
470
+ },
471
+ "foreignKeys": {},
472
+ "compositePrimaryKeys": {},
473
+ "uniqueConstraints": {},
474
+ "policies": {},
475
+ "checkConstraints": {},
476
+ "isRLSEnabled": false
477
+ }
478
+ },
479
+ "enums": {},
480
+ "schemas": {},
481
+ "sequences": {},
482
+ "roles": {},
483
+ "policies": {},
484
+ "views": {},
485
+ "_meta": {
486
+ "columns": {},
487
+ "schemas": {},
488
+ "tables": {}
489
+ }
490
+ }