@larkup/marketplace 0.3.17 → 0.4.2

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.
@@ -1,110 +0,0 @@
1
- /** Marketplace publisher identities. */
2
- export declare const publishers: import("drizzle-orm/pg-core").PgTableWithColumns<{
3
- name: "publishers";
4
- schema: undefined;
5
- columns: {
6
- id: import("drizzle-orm/pg-core").PgColumn<{
7
- name: "id";
8
- tableName: "publishers";
9
- dataType: "string";
10
- columnType: "PgText";
11
- data: string;
12
- driverParam: string;
13
- notNull: true;
14
- hasDefault: false;
15
- isPrimaryKey: true;
16
- isAutoincrement: false;
17
- hasRuntimeDefault: false;
18
- enumValues: [string, ...string[]];
19
- baseColumn: never;
20
- identity: undefined;
21
- generated: undefined;
22
- }, {}, {}>;
23
- name: import("drizzle-orm/pg-core").PgColumn<{
24
- name: "name";
25
- tableName: "publishers";
26
- dataType: "string";
27
- columnType: "PgText";
28
- data: string;
29
- driverParam: string;
30
- notNull: true;
31
- hasDefault: false;
32
- isPrimaryKey: false;
33
- isAutoincrement: false;
34
- hasRuntimeDefault: false;
35
- enumValues: [string, ...string[]];
36
- baseColumn: never;
37
- identity: undefined;
38
- generated: undefined;
39
- }, {}, {}>;
40
- contactEmail: import("drizzle-orm/pg-core").PgColumn<{
41
- name: "contact_email";
42
- tableName: "publishers";
43
- dataType: "string";
44
- columnType: "PgText";
45
- data: string;
46
- driverParam: string;
47
- notNull: false;
48
- hasDefault: false;
49
- isPrimaryKey: false;
50
- isAutoincrement: false;
51
- hasRuntimeDefault: false;
52
- enumValues: [string, ...string[]];
53
- baseColumn: never;
54
- identity: undefined;
55
- generated: undefined;
56
- }, {}, {}>;
57
- verification: import("drizzle-orm/pg-core").PgColumn<{
58
- name: "verification";
59
- tableName: "publishers";
60
- dataType: "string";
61
- columnType: "PgText";
62
- data: "unverified" | "verified";
63
- driverParam: string;
64
- notNull: true;
65
- hasDefault: true;
66
- isPrimaryKey: false;
67
- isAutoincrement: false;
68
- hasRuntimeDefault: false;
69
- enumValues: ["unverified", "verified"];
70
- baseColumn: never;
71
- identity: undefined;
72
- generated: undefined;
73
- }, {}, {}>;
74
- createdAt: import("drizzle-orm/pg-core").PgColumn<{
75
- name: "created_at";
76
- tableName: "publishers";
77
- dataType: "date";
78
- columnType: "PgTimestamp";
79
- data: Date;
80
- driverParam: string;
81
- notNull: true;
82
- hasDefault: true;
83
- isPrimaryKey: false;
84
- isAutoincrement: false;
85
- hasRuntimeDefault: false;
86
- enumValues: undefined;
87
- baseColumn: never;
88
- identity: undefined;
89
- generated: undefined;
90
- }, {}, {}>;
91
- updatedAt: import("drizzle-orm/pg-core").PgColumn<{
92
- name: "updated_at";
93
- tableName: "publishers";
94
- dataType: "date";
95
- columnType: "PgTimestamp";
96
- data: Date;
97
- driverParam: string;
98
- notNull: true;
99
- hasDefault: true;
100
- isPrimaryKey: false;
101
- isAutoincrement: false;
102
- hasRuntimeDefault: false;
103
- enumValues: undefined;
104
- baseColumn: never;
105
- identity: undefined;
106
- generated: undefined;
107
- }, {}, {}>;
108
- };
109
- dialect: "pg";
110
- }>;
@@ -1,12 +0,0 @@
1
- import { pgTable, text, timestamp } from 'drizzle-orm/pg-core';
2
- /** Marketplace publisher identities. */
3
- export const publishers = pgTable('publishers', {
4
- id: text('id').primaryKey(),
5
- name: text('name').notNull(),
6
- contactEmail: text('contact_email'),
7
- verification: text('verification', { enum: ['unverified', 'verified'] })
8
- .notNull()
9
- .default('unverified'),
10
- createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
11
- updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(),
12
- });
@@ -1,127 +0,0 @@
1
- /** Immutable published extension versions. */
2
- export declare const extensionVersions: import("drizzle-orm/pg-core").PgTableWithColumns<{
3
- name: "extension_versions";
4
- schema: undefined;
5
- columns: {
6
- id: import("drizzle-orm/pg-core").PgColumn<{
7
- name: "id";
8
- tableName: "extension_versions";
9
- dataType: "string";
10
- columnType: "PgText";
11
- data: string;
12
- driverParam: string;
13
- notNull: true;
14
- hasDefault: false;
15
- isPrimaryKey: true;
16
- isAutoincrement: false;
17
- hasRuntimeDefault: false;
18
- enumValues: [string, ...string[]];
19
- baseColumn: never;
20
- identity: undefined;
21
- generated: undefined;
22
- }, {}, {}>;
23
- extensionId: import("drizzle-orm/pg-core").PgColumn<{
24
- name: "extension_id";
25
- tableName: "extension_versions";
26
- dataType: "string";
27
- columnType: "PgText";
28
- data: string;
29
- driverParam: string;
30
- notNull: true;
31
- hasDefault: false;
32
- isPrimaryKey: false;
33
- isAutoincrement: false;
34
- hasRuntimeDefault: false;
35
- enumValues: [string, ...string[]];
36
- baseColumn: never;
37
- identity: undefined;
38
- generated: undefined;
39
- }, {}, {}>;
40
- version: import("drizzle-orm/pg-core").PgColumn<{
41
- name: "version";
42
- tableName: "extension_versions";
43
- dataType: "string";
44
- columnType: "PgText";
45
- data: string;
46
- driverParam: string;
47
- notNull: true;
48
- hasDefault: false;
49
- isPrimaryKey: false;
50
- isAutoincrement: false;
51
- hasRuntimeDefault: false;
52
- enumValues: [string, ...string[]];
53
- baseColumn: never;
54
- identity: undefined;
55
- generated: undefined;
56
- }, {}, {}>;
57
- manifest: import("drizzle-orm/pg-core").PgColumn<{
58
- name: "manifest";
59
- tableName: "extension_versions";
60
- dataType: "json";
61
- columnType: "PgJsonb";
62
- data: unknown;
63
- driverParam: unknown;
64
- notNull: true;
65
- hasDefault: false;
66
- isPrimaryKey: false;
67
- isAutoincrement: false;
68
- hasRuntimeDefault: false;
69
- enumValues: undefined;
70
- baseColumn: never;
71
- identity: undefined;
72
- generated: undefined;
73
- }, {}, {}>;
74
- integrity: import("drizzle-orm/pg-core").PgColumn<{
75
- name: "integrity";
76
- tableName: "extension_versions";
77
- dataType: "string";
78
- columnType: "PgText";
79
- data: string;
80
- driverParam: string;
81
- notNull: true;
82
- hasDefault: false;
83
- isPrimaryKey: false;
84
- isAutoincrement: false;
85
- hasRuntimeDefault: false;
86
- enumValues: [string, ...string[]];
87
- baseColumn: never;
88
- identity: undefined;
89
- generated: undefined;
90
- }, {}, {}>;
91
- publishedBy: import("drizzle-orm/pg-core").PgColumn<{
92
- name: "published_by";
93
- tableName: "extension_versions";
94
- dataType: "string";
95
- columnType: "PgText";
96
- data: string;
97
- driverParam: string;
98
- notNull: true;
99
- hasDefault: false;
100
- isPrimaryKey: false;
101
- isAutoincrement: false;
102
- hasRuntimeDefault: false;
103
- enumValues: [string, ...string[]];
104
- baseColumn: never;
105
- identity: undefined;
106
- generated: undefined;
107
- }, {}, {}>;
108
- publishedAt: import("drizzle-orm/pg-core").PgColumn<{
109
- name: "published_at";
110
- tableName: "extension_versions";
111
- dataType: "date";
112
- columnType: "PgTimestamp";
113
- data: Date;
114
- driverParam: string;
115
- notNull: true;
116
- hasDefault: true;
117
- isPrimaryKey: false;
118
- isAutoincrement: false;
119
- hasRuntimeDefault: false;
120
- enumValues: undefined;
121
- baseColumn: never;
122
- identity: undefined;
123
- generated: undefined;
124
- }, {}, {}>;
125
- };
126
- dialect: "pg";
127
- }>;
@@ -1,17 +0,0 @@
1
- import { index, jsonb, pgTable, text, timestamp, unique } from 'drizzle-orm/pg-core';
2
- import { extensions } from './extensions.js';
3
- /** Immutable published extension versions. */
4
- export const extensionVersions = pgTable('extension_versions', {
5
- id: text('id').primaryKey(),
6
- extensionId: text('extension_id')
7
- .notNull()
8
- .references(() => extensions.id),
9
- version: text('version').notNull(),
10
- manifest: jsonb('manifest').notNull(),
11
- integrity: text('integrity').notNull(),
12
- publishedBy: text('published_by').notNull(),
13
- publishedAt: timestamp('published_at', { withTimezone: true }).notNull().defaultNow(),
14
- }, (table) => [
15
- unique('extension_versions_extension_version_unique').on(table.extensionId, table.version),
16
- index('extension_versions_extension_id_idx').on(table.extensionId),
17
- ]);
package/db/dist/seed.d.ts DELETED
@@ -1,2 +0,0 @@
1
- /** Seeds built-in Marketplace tools. */
2
- import 'dotenv/config';
package/db/dist/seed.js DELETED
@@ -1,31 +0,0 @@
1
- /** Seeds built-in Marketplace tools. */
2
- import 'dotenv/config';
3
- import { BUILTIN_TOOLS } from './builtin-tools.js';
4
- import { getMarketplaceDb } from './client.js';
5
- import { publishExtension, VersionExistsError } from './repo.js';
6
- async function main() {
7
- const db = getMarketplaceDb();
8
- for (const manifest of BUILTIN_TOOLS) {
9
- try {
10
- await publishExtension(db, {
11
- manifest,
12
- publisherId: 'larkup',
13
- publisherName: 'Larkup',
14
- });
15
- console.log(`seeded ${manifest.id}@${manifest.version}`);
16
- }
17
- catch (err) {
18
- if (err instanceof VersionExistsError) {
19
- console.log(`already seeded: ${manifest.id}@${manifest.version}`);
20
- continue;
21
- }
22
- throw err;
23
- }
24
- }
25
- }
26
- main()
27
- .then(() => process.exit(0))
28
- .catch((err) => {
29
- console.error(err);
30
- process.exit(1);
31
- });
@@ -1,6 +0,0 @@
1
- /** Validates Marketplace tool manifests. */
2
- export interface ManifestValidationResult {
3
- valid: boolean;
4
- errors: string[];
5
- }
6
- export declare function validateToolManifest(manifest: unknown): ManifestValidationResult;
@@ -1,51 +0,0 @@
1
- /** Validates Marketplace tool manifests. */
2
- const ID_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
3
- const VERSION_PATTERN = /^\d+\.\d+\.\d+/;
4
- const CATEGORIES = [
5
- 'media',
6
- 'search',
7
- 'analytics',
8
- 'integration',
9
- 'embedding',
10
- 'ai',
11
- 'automation',
12
- 'utility',
13
- ];
14
- const PRICING = ['free', 'pro', 'enterprise'];
15
- export function validateToolManifest(manifest) {
16
- const errors = [];
17
- if (!manifest || typeof manifest !== 'object') {
18
- return { valid: false, errors: ['manifest must be an object'] };
19
- }
20
- const m = manifest;
21
- const requireString = (key) => {
22
- if (typeof m[key] !== 'string' || !m[key])
23
- errors.push(`"${key}" is required`);
24
- };
25
- requireString('id');
26
- if (typeof m.id === 'string' && !ID_PATTERN.test(m.id)) {
27
- errors.push('"id" must be lowercase alphanumeric with hyphens, e.g. "video-audio"');
28
- }
29
- requireString('name');
30
- requireString('description');
31
- requireString('icon');
32
- requireString('packageName');
33
- requireString('installSize');
34
- requireString('author');
35
- if (typeof m.category !== 'string' || !CATEGORIES.includes(m.category)) {
36
- errors.push(`"category" must be one of: ${CATEGORIES.join(', ')}`);
37
- }
38
- if (typeof m.pricing !== 'string' || !PRICING.includes(m.pricing)) {
39
- errors.push(`"pricing" must be one of: ${PRICING.join(', ')}`);
40
- }
41
- if (typeof m.version !== 'string' || !VERSION_PATTERN.test(m.version)) {
42
- errors.push('"version" must be semver, e.g. "1.0.0"');
43
- }
44
- if (!Array.isArray(m.capabilities) || m.capabilities.length === 0) {
45
- errors.push('"capabilities" must be a non-empty array');
46
- }
47
- if (m.requiresSandbox !== undefined && typeof m.requiresSandbox !== 'boolean') {
48
- errors.push('"requiresSandbox" must be a boolean when provided');
49
- }
50
- return { valid: errors.length === 0, errors };
51
- }