@kb-labs/marketplace-registry-contracts 2.96.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.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @kb-labs/marketplace-registry-contracts
2
+
3
+ > Part of [KB Labs](https://github.com/KirillBaranov/kb-labs) ecosystem.
4
+
5
+ Public types and schemas for the marketplace registry plugin.
@@ -0,0 +1,129 @@
1
+ import { EntityKind, EntitySignature } from '@kb-labs/core-discovery';
2
+
3
+ /**
4
+ * @module @kb-labs/marketplace-registry-contracts
5
+ * Shared types for the KB Labs Marketplace Registry.
6
+ */
7
+
8
+ interface PackageAuthor {
9
+ name: string;
10
+ email?: string;
11
+ url?: string;
12
+ }
13
+ interface PackageRepository {
14
+ type: string;
15
+ url: string;
16
+ }
17
+ /** Fields read from package.json and stored in the registry. */
18
+ interface PackageMeta {
19
+ name: string;
20
+ version: string;
21
+ description?: string;
22
+ author?: PackageAuthor | string;
23
+ repository?: PackageRepository | string;
24
+ keywords?: string[];
25
+ license?: string;
26
+ homepage?: string;
27
+ /** README.md content captured at publish time (markdown). */
28
+ readme?: string;
29
+ /** Permissions declared in kb.manifest.permissions. */
30
+ permissions?: string[];
31
+ /** Environment variables declared in kb.manifest.envVars. */
32
+ envVars?: string[];
33
+ /** Allowed network hosts declared in kb.manifest.allowedHosts. */
34
+ allowedHosts?: string[];
35
+ /** CLI command IDs registered by the plugin. */
36
+ commands?: string[];
37
+ }
38
+ type RegistryVisibility = 'public' | 'private';
39
+ type RegistryTrust = 'trusted' | 'untrusted';
40
+ interface RegistryVersionEntry {
41
+ version: string;
42
+ publishedAt: string;
43
+ /** SRI integrity hash of the tarball */
44
+ integrity: string;
45
+ /** Platform signature (present for trusted/public packages) */
46
+ signature?: EntitySignature;
47
+ yanked?: boolean;
48
+ yankReason?: string;
49
+ }
50
+ interface RegistryEntry {
51
+ /** Package name (from package.json) */
52
+ name: string;
53
+ /** Author handle (e.g. "kirill") */
54
+ authorHandle: string;
55
+ /** Primary entity kind declared at publish time */
56
+ primaryKind: EntityKind;
57
+ /** Author namespaceId (from gateway auth) */
58
+ authorNamespaceId: string;
59
+ /** Visibility: public (listed in catalog) or private (allowlist only) */
60
+ visibility: RegistryVisibility;
61
+ /** Trust level: trusted = signed by KB Labs Platform */
62
+ trust: RegistryTrust;
63
+ /** namespaceIds allowed to install (private packages) */
64
+ allowlist: string[];
65
+ /** All published versions */
66
+ versions: RegistryVersionEntry[];
67
+ /** Whether the package is archived (deprecated) */
68
+ deprecated: boolean;
69
+ deprecateMessage?: string;
70
+ /** Discoverable in catalog and search */
71
+ featured: boolean;
72
+ /** Badges (e.g. 'beta-contributor') */
73
+ badges: string[];
74
+ /** Tags for filtering */
75
+ tags: string[];
76
+ /** Metadata from latest version's package.json */
77
+ meta: PackageMeta;
78
+ createdAt: string;
79
+ updatedAt: string;
80
+ }
81
+ interface PublishRequest {
82
+ /** package.json metadata */
83
+ meta: PackageMeta;
84
+ visibility: RegistryVisibility;
85
+ /** Primary entity kind (plugin, adapter, studio-widget, …) */
86
+ primaryKind: EntityKind;
87
+ }
88
+ interface PublishResponse {
89
+ handle: string;
90
+ name: string;
91
+ version: string;
92
+ visibility: RegistryVisibility;
93
+ trust: RegistryTrust;
94
+ signature?: EntitySignature;
95
+ installCommand: string;
96
+ pageUrl?: string;
97
+ }
98
+ interface ShareToken {
99
+ token: string;
100
+ pkg: string;
101
+ expiresAt: string;
102
+ }
103
+ interface RegistryPackageSummary {
104
+ handle: string;
105
+ name: string;
106
+ fullName: string;
107
+ version: string;
108
+ description?: string;
109
+ author?: PackageAuthor | string;
110
+ keywords?: string[];
111
+ primaryKind: EntityKind;
112
+ featured: boolean;
113
+ badges: string[];
114
+ trust: RegistryTrust;
115
+ installs: number;
116
+ publishedAt: string;
117
+ }
118
+ interface RegistryConfig {
119
+ url: string;
120
+ publishKey?: string;
121
+ /** Embedded Ed25519 public key for signature verification (bundled at build time) */
122
+ signingPublicKey?: string;
123
+ }
124
+ interface PackageStats {
125
+ installs: number;
126
+ }
127
+ type RegistryErrorCode = 'PACKAGE_NOT_FOUND' | 'VERSION_NOT_FOUND' | 'VERSION_ALREADY_EXISTS' | 'VERSION_YANKED' | 'PACKAGE_DEPRECATED' | 'ACCESS_DENIED' | 'HANDLE_NOT_FOUND' | 'SIGNATURE_INVALID' | 'TARBALL_TOO_LARGE' | (string & {});
128
+
129
+ export type { PackageAuthor, PackageMeta, PackageRepository, PackageStats, PublishRequest, PublishResponse, RegistryConfig, RegistryEntry, RegistryErrorCode, RegistryPackageSummary, RegistryTrust, RegistryVersionEntry, RegistryVisibility, ShareToken };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@kb-labs/marketplace-registry-contracts",
3
+ "description": "Shared types and interfaces for KB Labs Marketplace Registry",
4
+ "version": "2.96.0",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md",
17
+ "LICENSE"
18
+ ],
19
+ "dependencies": {
20
+ "@kb-labs/core-discovery": "2.96.0"
21
+ },
22
+ "devDependencies": {
23
+ "tsup": "^8.5.0",
24
+ "typescript": "^5",
25
+ "vitest": "^3.2.6",
26
+ "@kb-labs/devkit": "2.96.0"
27
+ },
28
+ "engines": {
29
+ "node": ">=20.0.0",
30
+ "pnpm": ">=9.0.0"
31
+ },
32
+ "sideEffects": false,
33
+ "scripts": {
34
+ "build": "tsup",
35
+ "clean": "rimraf dist",
36
+ "dev": "tsup --watch",
37
+ "lint": "eslint src --ext .ts",
38
+ "lint:fix": "eslint src --ext .ts --fix",
39
+ "test": "vitest run --passWithNoTests -c ../../vitest.config.ts",
40
+ "test:watch": "vitest -c ../../vitest.config.ts",
41
+ "type-check": "tsc --noEmit"
42
+ }
43
+ }