@specverse/engine-registry 4.0.2 → 4.0.4

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 (55) hide show
  1. package/package.json +1 -1
  2. package/dist/cache/cache-manager.d.ts +0 -132
  3. package/dist/cache/cache-manager.d.ts.map +0 -1
  4. package/dist/cache/cache-manager.js +0 -218
  5. package/dist/cache/cache-manager.js.map +0 -1
  6. package/dist/client/registry-client.d.ts +0 -129
  7. package/dist/client/registry-client.d.ts.map +0 -1
  8. package/dist/client/registry-client.js +0 -317
  9. package/dist/client/registry-client.js.map +0 -1
  10. package/dist/formatters/error-formatter.d.ts +0 -100
  11. package/dist/formatters/error-formatter.d.ts.map +0 -1
  12. package/dist/formatters/error-formatter.js +0 -290
  13. package/dist/formatters/error-formatter.js.map +0 -1
  14. package/dist/formatters/index.d.ts +0 -8
  15. package/dist/formatters/index.d.ts.map +0 -1
  16. package/dist/formatters/index.js +0 -7
  17. package/dist/formatters/index.js.map +0 -1
  18. package/dist/index.d.ts +0 -19
  19. package/dist/index.js +0 -22
  20. package/dist/index.js.map +0 -1
  21. package/dist/offline/offline-handler.d.ts +0 -150
  22. package/dist/offline/offline-handler.d.ts.map +0 -1
  23. package/dist/offline/offline-handler.js +0 -290
  24. package/dist/offline/offline-handler.js.map +0 -1
  25. package/dist/types/index.d.ts +0 -13
  26. package/dist/types/index.d.ts.map +0 -1
  27. package/dist/types/index.js +0 -11
  28. package/dist/types/index.js.map +0 -1
  29. package/dist/types/registry.d.ts +0 -220
  30. package/dist/types/registry.d.ts.map +0 -1
  31. package/dist/types/registry.js +0 -55
  32. package/dist/types/registry.js.map +0 -1
  33. package/dist/types/validation.d.ts +0 -197
  34. package/dist/types/validation.d.ts.map +0 -1
  35. package/dist/types/validation.js +0 -140
  36. package/dist/types/validation.js.map +0 -1
  37. package/dist/utils/manifest-adapter.d.ts +0 -42
  38. package/dist/utils/manifest-adapter.js +0 -182
  39. package/dist/utils/manifest-adapter.js.map +0 -1
  40. package/dist/validators/index.d.ts +0 -12
  41. package/dist/validators/index.d.ts.map +0 -1
  42. package/dist/validators/index.js +0 -9
  43. package/dist/validators/index.js.map +0 -1
  44. package/dist/validators/installation-validator.d.ts +0 -75
  45. package/dist/validators/installation-validator.d.ts.map +0 -1
  46. package/dist/validators/installation-validator.js +0 -142
  47. package/dist/validators/installation-validator.js.map +0 -1
  48. package/dist/validators/manifest-validator.d.ts +0 -82
  49. package/dist/validators/manifest-validator.d.ts.map +0 -1
  50. package/dist/validators/manifest-validator.js +0 -213
  51. package/dist/validators/manifest-validator.js.map +0 -1
  52. package/dist/validators/validator.d.ts +0 -113
  53. package/dist/validators/validator.d.ts.map +0 -1
  54. package/dist/validators/validator.js +0 -165
  55. package/dist/validators/validator.js.map +0 -1
@@ -1,290 +0,0 @@
1
- /**
2
- * Registry Offline Handler
3
- *
4
- * Implements cache-first strategy with graceful fallback for offline scenarios.
5
- * Wraps RegistryClient and CacheManager to provide unified online/offline access.
6
- *
7
- * @module registry/offline/offline-handler
8
- * @version 2.0.0
9
- */
10
- import { RegistryClient, RegistryFetchError } from '../client/registry-client.js';
11
- import { CacheManager } from '../cache/cache-manager.js';
12
- import { createIssue, withSuggestions, ErrorCodes } from '../types/index.js';
13
- /**
14
- * Registry Offline Handler
15
- *
16
- * Provides unified access to registry metadata with offline-first strategy:
17
- * 1. Try to fetch from network
18
- * 2. If network fails, use fresh cache
19
- * 3. If no fresh cache, use stale cache as fallback (with warning)
20
- * 4. If no cache at all, throw error
21
- */
22
- export class OfflineHandler {
23
- client;
24
- cache;
25
- config;
26
- constructor(config = {}) {
27
- this.config = {
28
- registryClient: config.registryClient || {},
29
- cache: config.cache || {},
30
- offlineMode: config.offlineMode || false,
31
- allowStaleCache: config.allowStaleCache !== undefined ? config.allowStaleCache : true
32
- };
33
- this.client = new RegistryClient(this.config.registryClient);
34
- this.cache = new CacheManager(this.config.cache);
35
- }
36
- /**
37
- * Fetch all factories with offline-first strategy
38
- *
39
- * @returns Fetch result with data, source, and issues
40
- */
41
- async fetchFactories() {
42
- const issues = [];
43
- // Step 1: Try network (unless in offline mode)
44
- if (!this.config.offlineMode) {
45
- try {
46
- const data = await this.client.fetchFactories();
47
- // Cache successful response
48
- await this.cache.write(data, this.client.getEndpoint());
49
- return {
50
- data,
51
- source: 'network',
52
- issues: []
53
- };
54
- }
55
- catch (error) {
56
- // Network failed, add diagnostic issue
57
- if (error instanceof RegistryFetchError) {
58
- if (error.isTimeout()) {
59
- issues.push(createIssue(ErrorCodes.NETWORK_ERROR, 'warning', 'manifest', 'Registry request timed out', 'The registry request timed out. Falling back to cached metadata.'));
60
- }
61
- else if (error.isNetworkError()) {
62
- issues.push(createIssue(ErrorCodes.NETWORK_ERROR, 'warning', 'manifest', 'Network error', 'Failed to connect to registry. Falling back to cached metadata.'));
63
- }
64
- else {
65
- issues.push(createIssue(ErrorCodes.NETWORK_ERROR, 'warning', 'manifest', 'Registry fetch failed', `Registry returned error: ${error.message}. Falling back to cached metadata.`));
66
- }
67
- }
68
- }
69
- }
70
- else {
71
- // Offline mode - intentionally skip network
72
- issues.push(createIssue('OFFLINE-001', 'info', 'manifest', 'Offline mode enabled', 'Running in offline mode. Using cached metadata only.'));
73
- }
74
- // Step 2: Try fresh cache
75
- const cached = await this.cache.read();
76
- if (cached) {
77
- if (this.cache.isValid(cached)) {
78
- return {
79
- data: cached.data,
80
- source: 'cache-fresh',
81
- issues
82
- };
83
- }
84
- // Step 3: Try stale cache (if allowed)
85
- if (this.config.allowStaleCache) {
86
- const age = this.cache.getAge(cached);
87
- const ageHours = Math.floor(age / (1000 * 60 * 60));
88
- const ageMinutes = Math.floor((age % (1000 * 60 * 60)) / (1000 * 60));
89
- issues.push(withSuggestions(createIssue(ErrorCodes.STALE_CACHE, 'warning', 'manifest', 'Using stale cache', `Cache is ${ageHours}h ${ageMinutes}m old. Metadata may be outdated.`), [
90
- 'Run with network access to refresh cache',
91
- 'Check if factory versions have been updated',
92
- 'Consider factory deprecation warnings'
93
- ]));
94
- return {
95
- data: cached.data,
96
- source: 'cache-stale',
97
- issues
98
- };
99
- }
100
- }
101
- // Step 4: No cache available - fail
102
- throw new OfflineError('No registry metadata available', 'network-unavailable-no-cache', issues);
103
- }
104
- /**
105
- * Get specific factory by name
106
- *
107
- * @param name - Factory name
108
- * @returns Factory metadata or null if not found
109
- */
110
- async getFactory(name) {
111
- const result = await this.fetchFactories();
112
- // Search for factory in results
113
- const factory = result.data.results.find(f => f.name === name);
114
- return factory || null;
115
- }
116
- /**
117
- * Search factories
118
- *
119
- * Note: Search functionality requires network access.
120
- * Falls back to local filtering of cached data when offline.
121
- *
122
- * @param query - Search query
123
- * @returns Search results
124
- */
125
- async search(query) {
126
- // Try network search first (unless offline mode)
127
- if (!this.config.offlineMode) {
128
- try {
129
- return await this.client.search(query);
130
- }
131
- catch (error) {
132
- // Network failed, fall back to local search
133
- }
134
- }
135
- // Offline fallback: simple local search
136
- const result = await this.fetchFactories();
137
- const lowerQuery = query.toLowerCase();
138
- const matches = result.data.results.filter(factory => {
139
- return (factory.name.toLowerCase().includes(lowerQuery) ||
140
- factory.displayName.toLowerCase().includes(lowerQuery) ||
141
- factory.description.toLowerCase().includes(lowerQuery) ||
142
- factory.tags.some(tag => tag.toLowerCase().includes(lowerQuery)));
143
- });
144
- return {
145
- query,
146
- results: matches.map(factory => ({
147
- factory,
148
- score: 1.0, // Local search doesn't have scoring
149
- match: 'fuzzy'
150
- })),
151
- suggestions: []
152
- };
153
- }
154
- /**
155
- * Get all capabilities
156
- *
157
- * @returns Capabilities response
158
- */
159
- async getCapabilities() {
160
- // Try network first (unless offline mode)
161
- if (!this.config.offlineMode) {
162
- try {
163
- return await this.client.getCapabilities();
164
- }
165
- catch (error) {
166
- // Network failed, fall back to extracting from cache
167
- }
168
- }
169
- // Offline fallback: extract capabilities from cached factories
170
- const result = await this.fetchFactories();
171
- // Map capabilities to factories
172
- const capabilityMap = new Map();
173
- for (const factory of result.data.results) {
174
- for (const capability of factory.capabilities) {
175
- if (!capabilityMap.has(capability)) {
176
- capabilityMap.set(capability, []);
177
- }
178
- capabilityMap.get(capability).push(factory.name);
179
- }
180
- }
181
- return {
182
- capabilities: Array.from(capabilityMap.entries()).map(([name, factories]) => ({
183
- name,
184
- factories,
185
- count: factories.length
186
- }))
187
- };
188
- }
189
- /**
190
- * Check if registry is accessible
191
- *
192
- * @returns True if network access is available
193
- */
194
- async checkHealth() {
195
- if (this.config.offlineMode) {
196
- return false;
197
- }
198
- return await this.client.checkHealth();
199
- }
200
- /**
201
- * Clear cache
202
- */
203
- async clearCache() {
204
- await this.cache.clear();
205
- }
206
- /**
207
- * Get cache status
208
- *
209
- * @returns Cache status information
210
- */
211
- async getCacheStatus() {
212
- const exists = await this.cache.exists();
213
- if (!exists) {
214
- return { exists: false, valid: false };
215
- }
216
- const cached = await this.cache.read();
217
- if (!cached) {
218
- return { exists: true, valid: false };
219
- }
220
- return {
221
- exists: true,
222
- valid: this.cache.isValid(cached),
223
- age: this.cache.getAge(cached),
224
- timeToExpiration: this.cache.getTimeToExpiration(cached),
225
- createdAt: cached.metadata.createdAt,
226
- expiresAt: cached.metadata.expiresAt
227
- };
228
- }
229
- /**
230
- * Get registry client endpoint
231
- *
232
- * @returns Registry endpoint URL
233
- */
234
- getEndpoint() {
235
- return this.client.getEndpoint();
236
- }
237
- /**
238
- * Get cache file path
239
- *
240
- * @returns Absolute path to cache file
241
- */
242
- getCacheFile() {
243
- return this.cache.getCacheFile();
244
- }
245
- /**
246
- * Enable offline mode
247
- */
248
- enableOfflineMode() {
249
- this.config.offlineMode = true;
250
- }
251
- /**
252
- * Disable offline mode
253
- */
254
- disableOfflineMode() {
255
- this.config.offlineMode = false;
256
- }
257
- /**
258
- * Check if offline mode is enabled
259
- *
260
- * @returns True if offline mode is enabled
261
- */
262
- isOfflineMode() {
263
- return this.config.offlineMode;
264
- }
265
- }
266
- /**
267
- * Offline error
268
- *
269
- * Thrown when registry data is unavailable both from network and cache.
270
- */
271
- export class OfflineError extends Error {
272
- code;
273
- issues;
274
- constructor(message, code, issues) {
275
- super(message);
276
- this.code = code;
277
- this.issues = issues;
278
- this.name = 'OfflineError';
279
- if (Error.captureStackTrace) {
280
- Error.captureStackTrace(this, OfflineError);
281
- }
282
- }
283
- /**
284
- * Get user-friendly error message
285
- */
286
- getUserMessage() {
287
- return `${this.message}\n\nSuggestions:\n- Check your internet connection\n- Run with network access to populate cache\n- Use --offline flag with existing cache`;
288
- }
289
- }
290
- //# sourceMappingURL=offline-handler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"offline-handler.js","sourceRoot":"","sources":["../../src/offline/offline-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AASzD,OAAO,EACL,WAAW,EACX,eAAe,EACf,UAAU,EACX,MAAM,mBAAmB,CAAC;AAyC3B;;;;;;;;GAQG;AACH,MAAM,OAAO,cAAc;IACjB,MAAM,CAAiB;IACvB,KAAK,CAAe;IACpB,MAAM,CAAiC;IAE/C,YAAY,SAA+B,EAAE;QAC3C,IAAI,CAAC,MAAM,GAAG;YACZ,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,EAAE;YAC3C,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE;YACzB,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,KAAK;YACxC,eAAe,EAAE,MAAM,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI;SACtF,CAAC;QAEF,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,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,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;IACjC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAG5B;IACA;IAHT,YACE,OAAe,EACR,IAAY,EACZ,MAAyB;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAmB;QAGhC,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAE3B,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO,GAAG,IAAI,CAAC,OAAO,2IAA2I,CAAC;IACpK,CAAC;CACF"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Registry Types
3
- *
4
- * Type definitions for SpecVerse Registry integration.
5
- *
6
- * @module registry/types
7
- * @version 2.0.0
8
- */
9
- export type { SourceType, FactorySource, FactoryStats, RegistryFactoryMetadata, RegistryResponse, SearchMatchType, SearchResult, SearchResponse, CapabilityInfo, CapabilitiesResponse, FactoryDetailResponse, FetchFactoriesOptions, SearchFactoriesOptions } from './registry.js';
10
- export { isNpmSource, isGitSource, isUrlSource, isDeprecated, getInstallCommand, providesCapability, supportsFramework } from './registry.js';
11
- export type { ValidationSeverity, ValidationStage, ValidationIssue, ValidationResult, ValidationRule, ManifestValidationOptions, InstallationValidationOptions, ValidationOptions, ErrorCode } from './validation.js';
12
- export { isError, isWarning, isInfo, filterBySeverity, filterByStage, hasErrors, hasWarnings, getTotalIssues, mergeResults, createIssue, withSuggestions, withFix, withLearnMore, ErrorCodes, LearnMoreUrls } from './validation.js';
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,UAAU,EACV,aAAa,EACb,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,6BAA6B,EAC7B,iBAAiB,EACjB,SAAS,EACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,OAAO,EACP,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,eAAe,EACf,OAAO,EACP,aAAa,EACb,UAAU,EACV,aAAa,EACd,MAAM,iBAAiB,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Registry Types
3
- *
4
- * Type definitions for SpecVerse Registry integration.
5
- *
6
- * @module registry/types
7
- * @version 2.0.0
8
- */
9
- export { isNpmSource, isGitSource, isUrlSource, isDeprecated, getInstallCommand, providesCapability, supportsFramework } from './registry.js';
10
- export { isError, isWarning, isInfo, filterBySeverity, filterByStage, hasErrors, hasWarnings, getTotalIssues, mergeResults, createIssue, withSuggestions, withFix, withLearnMore, ErrorCodes, LearnMoreUrls } from './validation.js';
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAmBH,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAevB,OAAO,EACL,OAAO,EACP,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,eAAe,EACf,OAAO,EACP,aAAa,EACb,UAAU,EACV,aAAa,EACd,MAAM,iBAAiB,CAAC"}
@@ -1,220 +0,0 @@
1
- /**
2
- * Registry Type Definitions
3
- *
4
- * Types for interacting with the SpecVerse Registry API for instance factory metadata.
5
- *
6
- * @module registry/types/registry
7
- * @version 2.0.0
8
- */
9
- /**
10
- * Source type for instance factory
11
- */
12
- export type SourceType = 'npm' | 'git' | 'url';
13
- /**
14
- * Instance factory source information
15
- * Points to WHERE the actual factory definition is located
16
- */
17
- export interface FactorySource {
18
- /** Source type (npm package, git repo, or direct URL) */
19
- type: SourceType;
20
- /** npm package name (for type="npm") */
21
- package?: string;
22
- /** Package version or git tag (for type="npm" or type="git") */
23
- version?: string;
24
- /** Path to factory YAML file within package/repo */
25
- entrypoint: string;
26
- /** Git repository URL (for type="git") or direct download URL (for type="url") */
27
- url?: string;
28
- /** SHA-256 checksum for verification (for type="url") */
29
- checksum?: string;
30
- }
31
- /**
32
- * Statistics about factory usage
33
- */
34
- export interface FactoryStats {
35
- /** Total download count */
36
- downloads: number;
37
- /** Star/favorite count */
38
- stars: number;
39
- }
40
- /**
41
- * Instance factory metadata from registry
42
- *
43
- * This represents the metadata stored in the registry about an instance factory.
44
- * The registry does NOT store the actual factory YAML file - it stores metadata
45
- * that points to where the factory can be found (npm, git, etc.).
46
- */
47
- export interface RegistryFactoryMetadata {
48
- /** Factory name (e.g., "PrismaPostgres") */
49
- name: string;
50
- /** Display name for UI (e.g., "Prisma PostgreSQL") */
51
- displayName: string;
52
- /** Category (e.g., "storage.database") */
53
- category: string;
54
- /** Capabilities advertised by this factory (e.g., ["storage.database", "orm"]) */
55
- capabilities: string[];
56
- /** Framework compatibility (e.g., "fastify", "nestjs", or null for framework-agnostic) */
57
- framework: string | null;
58
- /** Whether this factory is deprecated */
59
- deprecated: boolean;
60
- /** Reason for deprecation (if deprecated) */
61
- deprecationReason?: string;
62
- /** Name of factory that replaces this one (if deprecated) */
63
- replacedBy?: string;
64
- /** Names of alternative factories users might consider */
65
- alternatives: string[];
66
- /** Source information - WHERE to get the actual factory */
67
- source: FactorySource;
68
- /** Tags for categorization and search */
69
- tags: string[];
70
- /** Factory description */
71
- description: string;
72
- /** License (e.g., "MIT") */
73
- license?: string;
74
- /** Repository URL for source code */
75
- repository?: string;
76
- /** Usage statistics */
77
- stats?: FactoryStats;
78
- /** When this metadata was created */
79
- createdAt: string;
80
- /** When this metadata was last updated */
81
- updatedAt: string;
82
- }
83
- /**
84
- * Registry API response for listing factories
85
- */
86
- export interface RegistryResponse {
87
- /** Array of factory metadata */
88
- results: RegistryFactoryMetadata[];
89
- /** Total number of factories matching query */
90
- total: number;
91
- /** Current page number */
92
- page: number;
93
- /** Number of results per page */
94
- pageSize: number;
95
- }
96
- /**
97
- * Match type for search results
98
- */
99
- export type SearchMatchType = 'exact' | 'partial' | 'fuzzy';
100
- /**
101
- * Search result with scoring
102
- */
103
- export interface SearchResult {
104
- /** Factory metadata */
105
- factory: RegistryFactoryMetadata;
106
- /** Similarity score (0-1) */
107
- score: number;
108
- /** Type of match */
109
- match: SearchMatchType;
110
- }
111
- /**
112
- * Search response from registry
113
- */
114
- export interface SearchResponse {
115
- /** Original search query */
116
- query: string;
117
- /** Matching factories with scores */
118
- results: SearchResult[];
119
- /** Suggested corrections for query */
120
- suggestions: string[];
121
- }
122
- /**
123
- * Capability information
124
- */
125
- export interface CapabilityInfo {
126
- /** Capability name (e.g., "storage.database") */
127
- name: string;
128
- /** Factories that provide this capability */
129
- factories: string[];
130
- /** Number of factories providing this capability */
131
- count: number;
132
- /** Optional description of the capability */
133
- description?: string;
134
- }
135
- /**
136
- * Capabilities response from registry
137
- */
138
- export interface CapabilitiesResponse {
139
- /** List of capabilities with their factories */
140
- capabilities: CapabilityInfo[];
141
- }
142
- /**
143
- * Factory detail response (for GET /api/factories/:name)
144
- */
145
- export interface FactoryDetailResponse {
146
- /** Primary factory metadata */
147
- factory: RegistryFactoryMetadata;
148
- /** Alternative factories */
149
- alternatives: RegistryFactoryMetadata[];
150
- /** Related factories (similar tags/category) */
151
- relatedFactories: RegistryFactoryMetadata[];
152
- }
153
- /**
154
- * Options for fetching factories
155
- */
156
- export interface FetchFactoriesOptions {
157
- /** Filter by capability */
158
- capability?: string;
159
- /** Filter by framework */
160
- framework?: string;
161
- /** Filter by tags */
162
- tags?: string[];
163
- /** Include deprecated factories */
164
- deprecated?: boolean;
165
- /** Page number (for pagination) */
166
- page?: number;
167
- /** Results per page */
168
- pageSize?: number;
169
- }
170
- /**
171
- * Options for searching factories
172
- */
173
- export interface SearchFactoriesOptions {
174
- /** Filter by capability */
175
- capability?: string;
176
- /** Filter by framework */
177
- framework?: string;
178
- /** Filter by tags */
179
- tags?: string[];
180
- }
181
- /**
182
- * Type guard to check if source is npm
183
- */
184
- export declare function isNpmSource(source: FactorySource): source is FactorySource & {
185
- package: string;
186
- version: string;
187
- };
188
- /**
189
- * Type guard to check if source is git
190
- */
191
- export declare function isGitSource(source: FactorySource): source is FactorySource & {
192
- url: string;
193
- version?: string;
194
- };
195
- /**
196
- * Type guard to check if source is URL
197
- */
198
- export declare function isUrlSource(source: FactorySource): source is FactorySource & {
199
- url: string;
200
- checksum?: string;
201
- };
202
- /**
203
- * Type guard to check if factory is deprecated
204
- */
205
- export declare function isDeprecated(factory: RegistryFactoryMetadata): factory is RegistryFactoryMetadata & {
206
- deprecationReason: string;
207
- };
208
- /**
209
- * Helper to get npm install command for a factory
210
- */
211
- export declare function getInstallCommand(factory: RegistryFactoryMetadata): string | null;
212
- /**
213
- * Helper to check if factory provides a specific capability
214
- */
215
- export declare function providesCapability(factory: RegistryFactoryMetadata, capability: string): boolean;
216
- /**
217
- * Helper to check if factory supports a specific framework
218
- */
219
- export declare function supportsFramework(factory: RegistryFactoryMetadata, framework: string): boolean;
220
- //# sourceMappingURL=registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/types/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,IAAI,EAAE,UAAU,CAAC;IAEjB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IAEnB,kFAAkF;IAClF,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;IAElB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IAEb,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IAEpB,0CAA0C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AC;IAEnB,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,IAAI,aAAa,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAEjH;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,IAAI,aAAa,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAE9G;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,IAAI,aAAa,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAE/G;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,IAAI,uBAAuB,GAAG;IAAE,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAEjI;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,IAAI,CAKjF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAEhG;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAG9F"}
@@ -1,55 +0,0 @@
1
- /**
2
- * Registry Type Definitions
3
- *
4
- * Types for interacting with the SpecVerse Registry API for instance factory metadata.
5
- *
6
- * @module registry/types/registry
7
- * @version 2.0.0
8
- */
9
- /**
10
- * Type guard to check if source is npm
11
- */
12
- export function isNpmSource(source) {
13
- return source.type === 'npm' && typeof source.package === 'string' && typeof source.version === 'string';
14
- }
15
- /**
16
- * Type guard to check if source is git
17
- */
18
- export function isGitSource(source) {
19
- return source.type === 'git' && typeof source.url === 'string';
20
- }
21
- /**
22
- * Type guard to check if source is URL
23
- */
24
- export function isUrlSource(source) {
25
- return source.type === 'url' && typeof source.url === 'string';
26
- }
27
- /**
28
- * Type guard to check if factory is deprecated
29
- */
30
- export function isDeprecated(factory) {
31
- return factory.deprecated === true;
32
- }
33
- /**
34
- * Helper to get npm install command for a factory
35
- */
36
- export function getInstallCommand(factory) {
37
- if (isNpmSource(factory.source)) {
38
- return `npm install ${factory.source.package}@${factory.source.version}`;
39
- }
40
- return null;
41
- }
42
- /**
43
- * Helper to check if factory provides a specific capability
44
- */
45
- export function providesCapability(factory, capability) {
46
- return factory.capabilities.includes(capability);
47
- }
48
- /**
49
- * Helper to check if factory supports a specific framework
50
- */
51
- export function supportsFramework(factory, framework) {
52
- // Framework-agnostic factories (null) support all frameworks
53
- return factory.framework === null || factory.framework === framework;
54
- }
55
- //# sourceMappingURL=registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/types/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAoOH;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAAqB;IAC/C,OAAO,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC;AAC3G,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAAqB;IAC/C,OAAO,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAAqB;IAC/C,OAAO,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,CAAC;AACjE,CAAC;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