@larkup/marketplace 0.4.0 → 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.
- package/README.md +2 -0
- package/package.json +2 -2
- package/src/db/builtin-tools.ts +2 -2
- package/src/tool-extension.ts +21 -0
- package/src/tool-registry.test.ts +1 -1
- package/db/dist/builtin-tools.d.ts +0 -2
- package/db/dist/builtin-tools.js +0 -116
- package/db/dist/client.d.ts +0 -7
- package/db/dist/client.js +0 -20
- package/db/dist/repo.d.ts +0 -67
- package/db/dist/repo.js +0 -236
- package/db/dist/schema/audit.d.ts +0 -128
- package/db/dist/schema/audit.js +0 -18
- package/db/dist/schema/extensions.d.ts +0 -326
- package/db/dist/schema/extensions.js +0 -36
- package/db/dist/schema/index.d.ts +0 -5
- package/db/dist/schema/index.js +0 -5
- package/db/dist/schema/installations.d.ts +0 -93
- package/db/dist/schema/installations.js +0 -15
- package/db/dist/schema/publishers.d.ts +0 -110
- package/db/dist/schema/publishers.js +0 -12
- package/db/dist/schema/versions.d.ts +0 -127
- package/db/dist/schema/versions.js +0 -17
- package/db/dist/seed.d.ts +0 -2
- package/db/dist/seed.js +0 -31
- package/db/dist/validate.d.ts +0 -6
- package/db/dist/validate.js +0 -51
|
@@ -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
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
|
-
});
|
package/db/dist/validate.d.ts
DELETED
package/db/dist/validate.js
DELETED
|
@@ -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
|
-
}
|