@claude-flow/cli 3.0.0-alpha.55 → 3.0.0-alpha.57
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/.claude/settings.json +2 -2
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +45 -5
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +80 -9
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +221 -2
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/plugins.d.ts +1 -0
- package/dist/src/commands/plugins.d.ts.map +1 -1
- package/dist/src/commands/plugins.js +439 -89
- package/dist/src/commands/plugins.js.map +1 -1
- package/dist/src/commands/transfer-store.d.ts +13 -0
- package/dist/src/commands/transfer-store.d.ts.map +1 -0
- package/dist/src/commands/transfer-store.js +428 -0
- package/dist/src/commands/transfer-store.js.map +1 -0
- package/dist/src/init/mcp-generator.d.ts +9 -0
- package/dist/src/init/mcp-generator.d.ts.map +1 -1
- package/dist/src/init/mcp-generator.js +57 -28
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +4 -2
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +1 -0
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +1 -0
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/transfer-tools.d.ts +14 -0
- package/dist/src/mcp-tools/transfer-tools.d.ts.map +1 -0
- package/dist/src/mcp-tools/transfer-tools.js +396 -0
- package/dist/src/mcp-tools/transfer-tools.js.map +1 -0
- package/dist/src/plugins/store/discovery.d.ts +73 -0
- package/dist/src/plugins/store/discovery.d.ts.map +1 -0
- package/dist/src/plugins/store/discovery.js +568 -0
- package/dist/src/plugins/store/discovery.js.map +1 -0
- package/dist/src/plugins/store/index.d.ts +76 -0
- package/dist/src/plugins/store/index.d.ts.map +1 -0
- package/dist/src/plugins/store/index.js +141 -0
- package/dist/src/plugins/store/index.js.map +1 -0
- package/dist/src/plugins/store/search.d.ts +46 -0
- package/dist/src/plugins/store/search.d.ts.map +1 -0
- package/dist/src/plugins/store/search.js +230 -0
- package/dist/src/plugins/store/search.js.map +1 -0
- package/dist/src/plugins/store/types.d.ts +274 -0
- package/dist/src/plugins/store/types.d.ts.map +1 -0
- package/dist/src/plugins/store/types.js +7 -0
- package/dist/src/plugins/store/types.js.map +1 -0
- package/dist/src/plugins/tests/demo-plugin-store.d.ts +7 -0
- package/dist/src/plugins/tests/demo-plugin-store.d.ts.map +1 -0
- package/dist/src/plugins/tests/demo-plugin-store.js +126 -0
- package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -0
- package/dist/src/plugins/tests/standalone-test.d.ts +12 -0
- package/dist/src/plugins/tests/standalone-test.d.ts.map +1 -0
- package/dist/src/plugins/tests/standalone-test.js +188 -0
- package/dist/src/plugins/tests/standalone-test.js.map +1 -0
- package/dist/src/plugins/tests/test-plugin-store.d.ts +7 -0
- package/dist/src/plugins/tests/test-plugin-store.d.ts.map +1 -0
- package/dist/src/plugins/tests/test-plugin-store.js +206 -0
- package/dist/src/plugins/tests/test-plugin-store.js.map +1 -0
- package/dist/src/transfer/anonymization/index.d.ts +25 -0
- package/dist/src/transfer/anonymization/index.d.ts.map +1 -0
- package/dist/src/transfer/anonymization/index.js +175 -0
- package/dist/src/transfer/anonymization/index.js.map +1 -0
- package/dist/src/transfer/deploy-seraphine.d.ts +13 -0
- package/dist/src/transfer/deploy-seraphine.d.ts.map +1 -0
- package/dist/src/transfer/deploy-seraphine.js +205 -0
- package/dist/src/transfer/deploy-seraphine.js.map +1 -0
- package/dist/src/transfer/export.d.ts +25 -0
- package/dist/src/transfer/export.d.ts.map +1 -0
- package/dist/src/transfer/export.js +113 -0
- package/dist/src/transfer/export.js.map +1 -0
- package/dist/src/transfer/index.d.ts +12 -0
- package/dist/src/transfer/index.d.ts.map +1 -0
- package/dist/src/transfer/index.js +31 -0
- package/dist/src/transfer/index.js.map +1 -0
- package/dist/src/transfer/ipfs/client.d.ts +31 -0
- package/dist/src/transfer/ipfs/client.d.ts.map +1 -0
- package/dist/src/transfer/ipfs/client.js +74 -0
- package/dist/src/transfer/ipfs/client.js.map +1 -0
- package/dist/src/transfer/ipfs/upload.d.ts +85 -0
- package/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
- package/dist/src/transfer/ipfs/upload.js +319 -0
- package/dist/src/transfer/ipfs/upload.js.map +1 -0
- package/dist/src/transfer/models/seraphine.d.ts +72 -0
- package/dist/src/transfer/models/seraphine.d.ts.map +1 -0
- package/dist/src/transfer/models/seraphine.js +373 -0
- package/dist/src/transfer/models/seraphine.js.map +1 -0
- package/dist/src/transfer/serialization/cfp.d.ts +49 -0
- package/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
- package/dist/src/transfer/serialization/cfp.js +180 -0
- package/dist/src/transfer/serialization/cfp.js.map +1 -0
- package/dist/src/transfer/store/discovery.d.ts +84 -0
- package/dist/src/transfer/store/discovery.d.ts.map +1 -0
- package/dist/src/transfer/store/discovery.js +275 -0
- package/dist/src/transfer/store/discovery.js.map +1 -0
- package/dist/src/transfer/store/download.d.ts +70 -0
- package/dist/src/transfer/store/download.d.ts.map +1 -0
- package/dist/src/transfer/store/download.js +295 -0
- package/dist/src/transfer/store/download.js.map +1 -0
- package/dist/src/transfer/store/index.d.ts +84 -0
- package/dist/src/transfer/store/index.d.ts.map +1 -0
- package/dist/src/transfer/store/index.js +153 -0
- package/dist/src/transfer/store/index.js.map +1 -0
- package/dist/src/transfer/store/publish.d.ts +76 -0
- package/dist/src/transfer/store/publish.d.ts.map +1 -0
- package/dist/src/transfer/store/publish.js +262 -0
- package/dist/src/transfer/store/publish.js.map +1 -0
- package/dist/src/transfer/store/registry.d.ts +58 -0
- package/dist/src/transfer/store/registry.d.ts.map +1 -0
- package/dist/src/transfer/store/registry.js +285 -0
- package/dist/src/transfer/store/registry.js.map +1 -0
- package/dist/src/transfer/store/search.d.ts +54 -0
- package/dist/src/transfer/store/search.d.ts.map +1 -0
- package/dist/src/transfer/store/search.js +232 -0
- package/dist/src/transfer/store/search.js.map +1 -0
- package/dist/src/transfer/store/tests/standalone-test.d.ts +12 -0
- package/dist/src/transfer/store/tests/standalone-test.d.ts.map +1 -0
- package/dist/src/transfer/store/tests/standalone-test.js +190 -0
- package/dist/src/transfer/store/tests/standalone-test.js.map +1 -0
- package/dist/src/transfer/store/types.d.ts +193 -0
- package/dist/src/transfer/store/types.d.ts.map +1 -0
- package/dist/src/transfer/store/types.js +6 -0
- package/dist/src/transfer/store/types.js.map +1 -0
- package/dist/src/transfer/test-seraphine.d.ts +6 -0
- package/dist/src/transfer/test-seraphine.d.ts.map +1 -0
- package/dist/src/transfer/test-seraphine.js +105 -0
- package/dist/src/transfer/test-seraphine.js.map +1 -0
- package/dist/src/transfer/tests/test-store.d.ts +7 -0
- package/dist/src/transfer/tests/test-store.d.ts.map +1 -0
- package/dist/src/transfer/tests/test-store.js +214 -0
- package/dist/src/transfer/tests/test-store.js.map +1 -0
- package/dist/src/transfer/types.d.ts +245 -0
- package/dist/src/transfer/types.d.ts.map +1 -0
- package/dist/src/transfer/types.js +6 -0
- package/dist/src/transfer/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern Publish Service
|
|
3
|
+
* Publish and contribute patterns to decentralized registry
|
|
4
|
+
*/
|
|
5
|
+
import * as fs from 'fs';
|
|
6
|
+
import * as crypto from 'crypto';
|
|
7
|
+
import { DEFAULT_STORE_CONFIG, generatePatternId } from './registry.js';
|
|
8
|
+
import { anonymizeCFP } from '../anonymization/index.js';
|
|
9
|
+
import { uploadToIPFS, pinContent } from '../ipfs/upload.js';
|
|
10
|
+
/**
|
|
11
|
+
* Pattern Publisher
|
|
12
|
+
* Handles publishing patterns to IPFS and registry
|
|
13
|
+
*/
|
|
14
|
+
export class PatternPublisher {
|
|
15
|
+
config;
|
|
16
|
+
constructor(config = {}) {
|
|
17
|
+
this.config = { ...DEFAULT_STORE_CONFIG, ...config };
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Publish a pattern to IPFS and registry
|
|
21
|
+
*/
|
|
22
|
+
async publishPattern(cfp, options) {
|
|
23
|
+
console.log(`[Publish] Starting publish: ${options.name}`);
|
|
24
|
+
try {
|
|
25
|
+
// Step 1: Anonymize if needed
|
|
26
|
+
const anonymized = anonymizeCFP(cfp, options.anonymize);
|
|
27
|
+
console.log(`[Publish] Anonymization level: ${options.anonymize}`);
|
|
28
|
+
// Step 2: Serialize content
|
|
29
|
+
const content = JSON.stringify(anonymized, null, 2);
|
|
30
|
+
const contentBuffer = Buffer.from(content);
|
|
31
|
+
// Step 3: Calculate checksum
|
|
32
|
+
const checksum = crypto
|
|
33
|
+
.createHash('sha256')
|
|
34
|
+
.update(contentBuffer)
|
|
35
|
+
.digest('hex');
|
|
36
|
+
// Step 4: Sign if private key provided
|
|
37
|
+
let signature;
|
|
38
|
+
let publicKey;
|
|
39
|
+
if (options.privateKeyPath && fs.existsSync(options.privateKeyPath)) {
|
|
40
|
+
const signResult = this.signContent(contentBuffer, options.privateKeyPath);
|
|
41
|
+
signature = signResult.signature;
|
|
42
|
+
publicKey = signResult.publicKey;
|
|
43
|
+
console.log(`[Publish] Content signed`);
|
|
44
|
+
}
|
|
45
|
+
// Step 5: Upload to IPFS
|
|
46
|
+
console.log(`[Publish] Uploading to IPFS...`);
|
|
47
|
+
const uploadResult = await uploadToIPFS(contentBuffer, {
|
|
48
|
+
name: `${options.name}.cfp.json`,
|
|
49
|
+
pin: true,
|
|
50
|
+
});
|
|
51
|
+
if (!uploadResult.cid) {
|
|
52
|
+
return {
|
|
53
|
+
success: false,
|
|
54
|
+
patternId: '',
|
|
55
|
+
cid: '',
|
|
56
|
+
registryCid: '',
|
|
57
|
+
gatewayUrl: '',
|
|
58
|
+
message: 'Failed to upload to IPFS',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
console.log(`[Publish] Uploaded to IPFS: ${uploadResult.cid}`);
|
|
62
|
+
// Step 6: Pin content
|
|
63
|
+
await pinContent(uploadResult.cid);
|
|
64
|
+
// Step 7: Create pattern entry
|
|
65
|
+
const patternId = generatePatternId(options.name);
|
|
66
|
+
const author = this.getAuthor();
|
|
67
|
+
const patternEntry = {
|
|
68
|
+
id: patternId,
|
|
69
|
+
name: options.name,
|
|
70
|
+
displayName: options.displayName,
|
|
71
|
+
description: options.description,
|
|
72
|
+
version: cfp.version,
|
|
73
|
+
cid: uploadResult.cid,
|
|
74
|
+
size: contentBuffer.length,
|
|
75
|
+
checksum,
|
|
76
|
+
author,
|
|
77
|
+
license: options.license,
|
|
78
|
+
categories: options.categories,
|
|
79
|
+
tags: options.tags,
|
|
80
|
+
language: options.language,
|
|
81
|
+
framework: options.framework,
|
|
82
|
+
downloads: 0,
|
|
83
|
+
rating: 0,
|
|
84
|
+
ratingCount: 0,
|
|
85
|
+
lastUpdated: new Date().toISOString(),
|
|
86
|
+
createdAt: new Date().toISOString(),
|
|
87
|
+
minClaudeFlowVersion: '3.0.0',
|
|
88
|
+
verified: author.verified,
|
|
89
|
+
trustLevel: author.verified ? 'verified' : 'community',
|
|
90
|
+
signature,
|
|
91
|
+
publicKey,
|
|
92
|
+
};
|
|
93
|
+
// Step 8: Add to registry (in production: submit to registry maintainers)
|
|
94
|
+
console.log(`[Publish] Pattern entry created: ${patternId}`);
|
|
95
|
+
// Generate gateway URL
|
|
96
|
+
const gatewayUrl = `${this.config.gateway}/ipfs/${uploadResult.cid}`;
|
|
97
|
+
return {
|
|
98
|
+
success: true,
|
|
99
|
+
patternId,
|
|
100
|
+
cid: uploadResult.cid,
|
|
101
|
+
registryCid: '', // Would be updated after registry update
|
|
102
|
+
gatewayUrl,
|
|
103
|
+
message: `Pattern '${options.displayName}' published successfully!`,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
console.error(`[Publish] Failed:`, error);
|
|
108
|
+
return {
|
|
109
|
+
success: false,
|
|
110
|
+
patternId: '',
|
|
111
|
+
cid: '',
|
|
112
|
+
registryCid: '',
|
|
113
|
+
gatewayUrl: '',
|
|
114
|
+
message: `Publish failed: ${error}`,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Sign content with private key
|
|
120
|
+
*/
|
|
121
|
+
signContent(content, privateKeyPath) {
|
|
122
|
+
// In production: Use actual Ed25519 signing
|
|
123
|
+
// For demo: Generate mock signature
|
|
124
|
+
const privateKey = fs.readFileSync(privateKeyPath, 'utf-8').trim();
|
|
125
|
+
const signature = crypto
|
|
126
|
+
.createHmac('sha256', privateKey)
|
|
127
|
+
.update(content)
|
|
128
|
+
.digest('hex');
|
|
129
|
+
const publicKey = 'ed25519:' +
|
|
130
|
+
crypto.createHash('sha256').update(privateKey).digest('hex').slice(0, 32);
|
|
131
|
+
return {
|
|
132
|
+
signature: `ed25519:${signature}`,
|
|
133
|
+
publicKey,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get current author info
|
|
138
|
+
*/
|
|
139
|
+
getAuthor() {
|
|
140
|
+
if (this.config.authorId) {
|
|
141
|
+
return {
|
|
142
|
+
id: this.config.authorId,
|
|
143
|
+
displayName: this.config.authorId,
|
|
144
|
+
verified: false,
|
|
145
|
+
patterns: 0,
|
|
146
|
+
totalDownloads: 0,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
// Anonymous author
|
|
150
|
+
return {
|
|
151
|
+
id: `anon-${crypto.randomBytes(8).toString('hex')}`,
|
|
152
|
+
verified: false,
|
|
153
|
+
patterns: 0,
|
|
154
|
+
totalDownloads: 0,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Validate pattern before publish
|
|
159
|
+
*/
|
|
160
|
+
validateForPublish(cfp, options) {
|
|
161
|
+
const errors = [];
|
|
162
|
+
// Check required fields
|
|
163
|
+
if (!options.name || options.name.length < 3) {
|
|
164
|
+
errors.push('Name must be at least 3 characters');
|
|
165
|
+
}
|
|
166
|
+
if (!options.displayName || options.displayName.length < 3) {
|
|
167
|
+
errors.push('Display name must be at least 3 characters');
|
|
168
|
+
}
|
|
169
|
+
if (!options.description || options.description.length < 20) {
|
|
170
|
+
errors.push('Description must be at least 20 characters');
|
|
171
|
+
}
|
|
172
|
+
if (!options.categories || options.categories.length === 0) {
|
|
173
|
+
errors.push('At least one category is required');
|
|
174
|
+
}
|
|
175
|
+
if (!options.tags || options.tags.length < 3) {
|
|
176
|
+
errors.push('At least 3 tags are required');
|
|
177
|
+
}
|
|
178
|
+
// Check valid license
|
|
179
|
+
const validLicenses = ['MIT', 'Apache-2.0', 'GPL-3.0', 'BSD-3-Clause', 'CC-BY-4.0', 'Unlicense'];
|
|
180
|
+
if (!validLicenses.includes(options.license)) {
|
|
181
|
+
errors.push(`License must be one of: ${validLicenses.join(', ')}`);
|
|
182
|
+
}
|
|
183
|
+
// Check pattern content
|
|
184
|
+
if (cfp.magic !== 'CFP1') {
|
|
185
|
+
errors.push('Invalid CFP format (missing magic header)');
|
|
186
|
+
}
|
|
187
|
+
const totalPatterns = cfp.statistics.totalPatterns;
|
|
188
|
+
if (totalPatterns === 0) {
|
|
189
|
+
errors.push('Pattern must contain at least one pattern');
|
|
190
|
+
}
|
|
191
|
+
return errors;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Create publish preview
|
|
195
|
+
*/
|
|
196
|
+
createPreview(cfp, options) {
|
|
197
|
+
return {
|
|
198
|
+
name: options.name,
|
|
199
|
+
displayName: options.displayName,
|
|
200
|
+
description: options.description,
|
|
201
|
+
categories: options.categories,
|
|
202
|
+
tags: options.tags,
|
|
203
|
+
license: options.license,
|
|
204
|
+
language: options.language,
|
|
205
|
+
framework: options.framework,
|
|
206
|
+
anonymization: options.anonymize,
|
|
207
|
+
statistics: cfp.statistics,
|
|
208
|
+
estimatedSize: JSON.stringify(cfp).length,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Submit a contribution to the registry
|
|
214
|
+
*/
|
|
215
|
+
export async function submitContribution(request) {
|
|
216
|
+
console.log(`[Contribute] Submitting contribution: ${request.name}`);
|
|
217
|
+
// In production: Submit to registry governance system
|
|
218
|
+
// For demo: Generate mock submission ID
|
|
219
|
+
const submissionId = `contrib-${crypto.randomBytes(8).toString('hex')}`;
|
|
220
|
+
console.log(`[Contribute] Submission ID: ${submissionId}`);
|
|
221
|
+
console.log(`[Contribute] Pattern CID: ${request.patternCid}`);
|
|
222
|
+
console.log(`[Contribute] Author: ${request.authorId}`);
|
|
223
|
+
return {
|
|
224
|
+
success: true,
|
|
225
|
+
submissionId,
|
|
226
|
+
message: `Contribution submitted for review. Track status with ID: ${submissionId}`,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Check contribution status
|
|
231
|
+
*/
|
|
232
|
+
export async function checkContributionStatus(submissionId) {
|
|
233
|
+
// In production: Query registry governance system
|
|
234
|
+
// For demo: Return mock status
|
|
235
|
+
return {
|
|
236
|
+
status: 'pending',
|
|
237
|
+
message: 'Your contribution is pending review',
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Create publisher with default config
|
|
242
|
+
*/
|
|
243
|
+
export function createPublisher(config) {
|
|
244
|
+
return new PatternPublisher(config);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Quick publish helper
|
|
248
|
+
*/
|
|
249
|
+
export async function quickPublish(cfp, name, description, tags, config) {
|
|
250
|
+
const publisher = new PatternPublisher(config);
|
|
251
|
+
const options = {
|
|
252
|
+
name,
|
|
253
|
+
displayName: name.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase()),
|
|
254
|
+
description,
|
|
255
|
+
categories: ['custom'],
|
|
256
|
+
tags,
|
|
257
|
+
license: 'MIT',
|
|
258
|
+
anonymize: 'standard',
|
|
259
|
+
};
|
|
260
|
+
return publisher.publishPattern(cfp, options);
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=publish.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../../src/transfer/store/publish.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AASjC,OAAO,EAAE,oBAAoB,EAAwB,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE9F,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IACnB,MAAM,CAAc;IAE5B,YAAY,SAA+B,EAAE;QAC3C,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,EAAE,CAAC;IACvD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAClB,GAAc,EACd,OAAuB;QAEvB,OAAO,CAAC,GAAG,CAAC,+BAA+B,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAE3D,IAAI,CAAC;YACH,8BAA8B;YAC9B,MAAM,UAAU,GAAG,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;YACxD,OAAO,CAAC,GAAG,CAAC,kCAAkC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;YAEnE,4BAA4B;YAC5B,MAAM,OAAO,GAAG,I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E,WAAW;QACX,UAAU,EAAE,CAAC,QAAQ,CAAC;QACtB,IAAI;QACJ,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,UAAU;KACtB,CAAC;IAEF,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decentralized Pattern Registry
|
|
3
|
+
* IPFS-based registry with IPNS for mutable references
|
|
4
|
+
*/
|
|
5
|
+
import type { PatternRegistry, PatternEntry, PatternCategory, KnownRegistry, StoreConfig } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Registry version
|
|
8
|
+
*/
|
|
9
|
+
export declare const REGISTRY_VERSION = "1.0.0";
|
|
10
|
+
/**
|
|
11
|
+
* Default bootstrap registries for discovery
|
|
12
|
+
*/
|
|
13
|
+
export declare const BOOTSTRAP_REGISTRIES: KnownRegistry[];
|
|
14
|
+
/**
|
|
15
|
+
* Default store configuration
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_STORE_CONFIG: StoreConfig;
|
|
18
|
+
/**
|
|
19
|
+
* Create a new empty registry
|
|
20
|
+
*/
|
|
21
|
+
export declare function createRegistry(ipnsName: string): PatternRegistry;
|
|
22
|
+
/**
|
|
23
|
+
* Default pattern categories
|
|
24
|
+
*/
|
|
25
|
+
export declare function getDefaultCategories(): PatternCategory[];
|
|
26
|
+
/**
|
|
27
|
+
* Add a pattern to the registry
|
|
28
|
+
*/
|
|
29
|
+
export declare function addPatternToRegistry(registry: PatternRegistry, entry: PatternEntry): PatternRegistry;
|
|
30
|
+
/**
|
|
31
|
+
* Remove a pattern from the registry
|
|
32
|
+
*/
|
|
33
|
+
export declare function removePatternFromRegistry(registry: PatternRegistry, patternId: string): PatternRegistry;
|
|
34
|
+
/**
|
|
35
|
+
* Serialize registry to JSON
|
|
36
|
+
*/
|
|
37
|
+
export declare function serializeRegistry(registry: PatternRegistry): string;
|
|
38
|
+
/**
|
|
39
|
+
* Deserialize registry from JSON
|
|
40
|
+
*/
|
|
41
|
+
export declare function deserializeRegistry(json: string): PatternRegistry;
|
|
42
|
+
/**
|
|
43
|
+
* Sign registry with private key
|
|
44
|
+
*/
|
|
45
|
+
export declare function signRegistry(registry: PatternRegistry, privateKey: string): PatternRegistry;
|
|
46
|
+
/**
|
|
47
|
+
* Verify registry signature
|
|
48
|
+
*/
|
|
49
|
+
export declare function verifyRegistrySignature(registry: PatternRegistry): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Merge two registries (for sync)
|
|
52
|
+
*/
|
|
53
|
+
export declare function mergeRegistries(local: PatternRegistry, remote: PatternRegistry): PatternRegistry;
|
|
54
|
+
/**
|
|
55
|
+
* Generate pattern ID from name
|
|
56
|
+
*/
|
|
57
|
+
export declare function generatePatternId(name: string): string;
|
|
58
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/transfer/store/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,eAAe,EAEf,aAAa,EACb,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAAa,EAiB/C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAWlC,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CAkBhE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,eAAe,EAAE,CA6ExD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,eAAe,EACzB,KAAK,EAAE,YAAY,GAClB,eAAe,CA4CjB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,MAAM,GAChB,eAAe,CAMjB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAEnE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CASjE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CAmB3F;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAQ1E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,eAAe,GACtB,eAAe,CA+BjB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAItD"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decentralized Pattern Registry
|
|
3
|
+
* IPFS-based registry with IPNS for mutable references
|
|
4
|
+
*/
|
|
5
|
+
import * as crypto from 'crypto';
|
|
6
|
+
/**
|
|
7
|
+
* Registry version
|
|
8
|
+
*/
|
|
9
|
+
export const REGISTRY_VERSION = '1.0.0';
|
|
10
|
+
/**
|
|
11
|
+
* Default bootstrap registries for discovery
|
|
12
|
+
*/
|
|
13
|
+
export const BOOTSTRAP_REGISTRIES = [
|
|
14
|
+
{
|
|
15
|
+
name: 'claude-flow-official',
|
|
16
|
+
description: 'Official Claude Flow pattern registry',
|
|
17
|
+
ipnsName: 'k51qzi5uqu5dj0w8q1xvqn8ql2g4p7x8qpk9vz3xm1y2n3o4p5q6r7s8t9u0v',
|
|
18
|
+
gateway: 'https://w3s.link',
|
|
19
|
+
publicKey: 'ed25519:claude-flow-registry-key',
|
|
20
|
+
trusted: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'community-patterns',
|
|
24
|
+
description: 'Community-contributed patterns',
|
|
25
|
+
ipnsName: 'k51qzi5uqu5dkkph0w8q1xvqn8ql2g4p7x8qpk9vz3xm1y2n3o4p5q6r7s8',
|
|
26
|
+
gateway: 'https://dweb.link',
|
|
27
|
+
publicKey: 'ed25519:community-registry-key',
|
|
28
|
+
trusted: false,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Default store configuration
|
|
33
|
+
*/
|
|
34
|
+
export const DEFAULT_STORE_CONFIG = {
|
|
35
|
+
registries: BOOTSTRAP_REGISTRIES,
|
|
36
|
+
defaultRegistry: 'claude-flow-official',
|
|
37
|
+
gateway: 'https://w3s.link',
|
|
38
|
+
timeout: 30000,
|
|
39
|
+
cacheDir: '.claude-flow/patterns/cache',
|
|
40
|
+
cacheExpiry: 3600000, // 1 hour
|
|
41
|
+
requireVerification: false,
|
|
42
|
+
minTrustLevel: 'unverified',
|
|
43
|
+
trustedAuthors: [],
|
|
44
|
+
blockedPatterns: [],
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Create a new empty registry
|
|
48
|
+
*/
|
|
49
|
+
export function createRegistry(ipnsName) {
|
|
50
|
+
return {
|
|
51
|
+
version: REGISTRY_VERSION,
|
|
52
|
+
updatedAt: new Date().toISOString(),
|
|
53
|
+
ipnsName,
|
|
54
|
+
patterns: [],
|
|
55
|
+
categories: getDefaultCategories(),
|
|
56
|
+
authors: [],
|
|
57
|
+
totalPatterns: 0,
|
|
58
|
+
totalDownloads: 0,
|
|
59
|
+
totalAuthors: 0,
|
|
60
|
+
featured: [],
|
|
61
|
+
trending: [],
|
|
62
|
+
newest: [],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Default pattern categories
|
|
67
|
+
*/
|
|
68
|
+
export function getDefaultCategories() {
|
|
69
|
+
return [
|
|
70
|
+
{
|
|
71
|
+
id: 'routing',
|
|
72
|
+
name: 'Task Routing',
|
|
73
|
+
description: 'Patterns for routing tasks to appropriate agents',
|
|
74
|
+
patternCount: 0,
|
|
75
|
+
icon: '🔀',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'coordination',
|
|
79
|
+
name: 'Swarm Coordination',
|
|
80
|
+
description: 'Multi-agent coordination and communication patterns',
|
|
81
|
+
patternCount: 0,
|
|
82
|
+
icon: '🐝',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'security',
|
|
86
|
+
name: 'Security',
|
|
87
|
+
description: 'Security analysis and vulnerability detection patterns',
|
|
88
|
+
patternCount: 0,
|
|
89
|
+
icon: '🔒',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'performance',
|
|
93
|
+
name: 'Performance',
|
|
94
|
+
description: 'Performance optimization and profiling patterns',
|
|
95
|
+
patternCount: 0,
|
|
96
|
+
icon: '⚡',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 'testing',
|
|
100
|
+
name: 'Testing',
|
|
101
|
+
description: 'Test generation and quality assurance patterns',
|
|
102
|
+
patternCount: 0,
|
|
103
|
+
icon: '🧪',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 'documentation',
|
|
107
|
+
name: 'Documentation',
|
|
108
|
+
description: 'Documentation generation and maintenance patterns',
|
|
109
|
+
patternCount: 0,
|
|
110
|
+
icon: '📚',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: 'refactoring',
|
|
114
|
+
name: 'Refactoring',
|
|
115
|
+
description: 'Code refactoring and improvement patterns',
|
|
116
|
+
patternCount: 0,
|
|
117
|
+
icon: '🔧',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 'language',
|
|
121
|
+
name: 'Language-Specific',
|
|
122
|
+
description: 'Patterns optimized for specific programming languages',
|
|
123
|
+
patternCount: 0,
|
|
124
|
+
icon: '💻',
|
|
125
|
+
subcategories: [
|
|
126
|
+
{ id: 'typescript', name: 'TypeScript', description: 'TypeScript patterns', patternCount: 0 },
|
|
127
|
+
{ id: 'python', name: 'Python', description: 'Python patterns', patternCount: 0 },
|
|
128
|
+
{ id: 'rust', name: 'Rust', description: 'Rust patterns', patternCount: 0 },
|
|
129
|
+
{ id: 'go', name: 'Go', description: 'Go patterns', patternCount: 0 },
|
|
130
|
+
],
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: 'framework',
|
|
134
|
+
name: 'Framework-Specific',
|
|
135
|
+
description: 'Patterns for specific frameworks',
|
|
136
|
+
patternCount: 0,
|
|
137
|
+
icon: '🏗️',
|
|
138
|
+
subcategories: [
|
|
139
|
+
{ id: 'react', name: 'React', description: 'React patterns', patternCount: 0 },
|
|
140
|
+
{ id: 'nextjs', name: 'Next.js', description: 'Next.js patterns', patternCount: 0 },
|
|
141
|
+
{ id: 'node', name: 'Node.js', description: 'Node.js patterns', patternCount: 0 },
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
];
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Add a pattern to the registry
|
|
148
|
+
*/
|
|
149
|
+
export function addPatternToRegistry(registry, entry) {
|
|
150
|
+
const updated = { ...registry };
|
|
151
|
+
// Check for existing pattern with same name
|
|
152
|
+
const existingIndex = updated.patterns.findIndex(p => p.name === entry.name);
|
|
153
|
+
if (existingIndex >= 0) {
|
|
154
|
+
// Update existing
|
|
155
|
+
updated.patterns[existingIndex] = entry;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
// Add new
|
|
159
|
+
updated.patterns.push(entry);
|
|
160
|
+
}
|
|
161
|
+
// Update author
|
|
162
|
+
const authorIndex = updated.authors.findIndex(a => a.id === entry.author.id);
|
|
163
|
+
if (authorIndex >= 0) {
|
|
164
|
+
updated.authors[authorIndex].patterns++;
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
updated.authors.push(entry.author);
|
|
168
|
+
}
|
|
169
|
+
// Update category counts
|
|
170
|
+
for (const cat of updated.categories) {
|
|
171
|
+
cat.patternCount = updated.patterns.filter(p => p.categories.includes(cat.id)).length;
|
|
172
|
+
}
|
|
173
|
+
// Update stats
|
|
174
|
+
updated.totalPatterns = updated.patterns.length;
|
|
175
|
+
updated.totalAuthors = updated.authors.length;
|
|
176
|
+
updated.updatedAt = new Date().toISOString();
|
|
177
|
+
// Update newest
|
|
178
|
+
updated.newest = updated.patterns
|
|
179
|
+
.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())
|
|
180
|
+
.slice(0, 10)
|
|
181
|
+
.map(p => p.id);
|
|
182
|
+
// Update trending (by recent downloads - simplified)
|
|
183
|
+
updated.trending = updated.patterns
|
|
184
|
+
.sort((a, b) => b.downloads - a.downloads)
|
|
185
|
+
.slice(0, 10)
|
|
186
|
+
.map(p => p.id);
|
|
187
|
+
return updated;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Remove a pattern from the registry
|
|
191
|
+
*/
|
|
192
|
+
export function removePatternFromRegistry(registry, patternId) {
|
|
193
|
+
const updated = { ...registry };
|
|
194
|
+
updated.patterns = updated.patterns.filter(p => p.id !== patternId);
|
|
195
|
+
updated.totalPatterns = updated.patterns.length;
|
|
196
|
+
updated.updatedAt = new Date().toISOString();
|
|
197
|
+
return updated;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Serialize registry to JSON
|
|
201
|
+
*/
|
|
202
|
+
export function serializeRegistry(registry) {
|
|
203
|
+
return JSON.stringify(registry, null, 2);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Deserialize registry from JSON
|
|
207
|
+
*/
|
|
208
|
+
export function deserializeRegistry(json) {
|
|
209
|
+
const registry = JSON.parse(json);
|
|
210
|
+
// Validate version
|
|
211
|
+
if (!registry.version) {
|
|
212
|
+
throw new Error('Invalid registry: missing version');
|
|
213
|
+
}
|
|
214
|
+
return registry;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Sign registry with private key
|
|
218
|
+
*/
|
|
219
|
+
export function signRegistry(registry, privateKey) {
|
|
220
|
+
const content = JSON.stringify({
|
|
221
|
+
version: registry.version,
|
|
222
|
+
updatedAt: registry.updatedAt,
|
|
223
|
+
patterns: registry.patterns.map(p => p.cid),
|
|
224
|
+
totalPatterns: registry.totalPatterns,
|
|
225
|
+
});
|
|
226
|
+
// In production: Use actual Ed25519 signing
|
|
227
|
+
const signature = crypto
|
|
228
|
+
.createHmac('sha256', privateKey)
|
|
229
|
+
.update(content)
|
|
230
|
+
.digest('hex');
|
|
231
|
+
return {
|
|
232
|
+
...registry,
|
|
233
|
+
registrySignature: signature,
|
|
234
|
+
registryPublicKey: 'ed25519:' + crypto.createHash('sha256').update(privateKey).digest('hex').slice(0, 32),
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Verify registry signature
|
|
239
|
+
*/
|
|
240
|
+
export function verifyRegistrySignature(registry) {
|
|
241
|
+
if (!registry.registrySignature || !registry.registryPublicKey) {
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
// In production: Use actual Ed25519 verification
|
|
245
|
+
// For now, just check signature exists
|
|
246
|
+
return registry.registrySignature.length === 64;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Merge two registries (for sync)
|
|
250
|
+
*/
|
|
251
|
+
export function mergeRegistries(local, remote) {
|
|
252
|
+
const merged = createRegistry(local.ipnsName);
|
|
253
|
+
// Combine patterns, preferring newer versions
|
|
254
|
+
const patternMap = new Map();
|
|
255
|
+
for (const pattern of [...local.patterns, ...remote.patterns]) {
|
|
256
|
+
const existing = patternMap.get(pattern.name);
|
|
257
|
+
if (!existing || new Date(pattern.lastUpdated) > new Date(existing.lastUpdated)) {
|
|
258
|
+
patternMap.set(pattern.name, pattern);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
merged.patterns = Array.from(patternMap.values());
|
|
262
|
+
// Combine authors
|
|
263
|
+
const authorMap = new Map();
|
|
264
|
+
for (const author of [...local.authors, ...remote.authors]) {
|
|
265
|
+
const existing = authorMap.get(author.id);
|
|
266
|
+
if (!existing || author.patterns > existing.patterns) {
|
|
267
|
+
authorMap.set(author.id, author);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
merged.authors = Array.from(authorMap.values());
|
|
271
|
+
// Update stats
|
|
272
|
+
merged.totalPatterns = merged.patterns.length;
|
|
273
|
+
merged.totalAuthors = merged.authors.length;
|
|
274
|
+
merged.totalDownloads = merged.patterns.reduce((sum, p) => sum + p.downloads, 0);
|
|
275
|
+
return merged;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Generate pattern ID from name
|
|
279
|
+
*/
|
|
280
|
+
export function generatePatternId(name) {
|
|
281
|
+
const normalized = name.toLowerCase().replace(/[^a-z0-9-]/g, '-');
|
|
282
|
+
const hash = crypto.createHash('sha256').update(name + Date.now()).digest('hex').slice(0, 8);
|
|
283
|
+
return `${normalized}-${hash}`;
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/transfer/store/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAUjC;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAoB;IACnD;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,uCAAuC;QACpD,QAAQ,EAAE,+DAA+D;QACzE,OAAO,EAAE,kBAAkB;QAC3B,SAAS,EAAE,kCAAkC;QAC7C,OAAO,EAAE,IAAI;KACd;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,gCAAgC;QAC7C,QAAQ,EAAE,6DAA6D;QACvE,OAAO,EAAE,mBA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