Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

Checkpoint: File edits

rUv17b7a3c3b89b
diff --git a/v3/@claude-flow/cli/src/transfer/store/publish.ts b/v3/@claude-flow/cli/src/transfer/store/publish.ts
index d1b06ddef7..6b28f73951 100644
--- a/v3/@claude-flow/cli/src/transfer/store/publish.ts
+++ b/v3/@claude-flow/cli/src/transfer/store/publish.ts
@@ -65,29 +65,61 @@ export class PatternPublisher {
console.log(`[Publish] Content signed`);
}
- // Step 5: Upload to IPFS
- console.log(`[Publish] Uploading to IPFS...`);
- const uploadResult = await uploadToIPFS(contentBuffer, {
- name: `${options.name}.cfp.json`,
- pin: true,
- });
-
- if (!uploadResult.cid) {
- return {
- success: false,
- patternId: '',
- cid: '',
- registryCid: '',
- gatewayUrl: '',
- message: 'Failed to upload to IPFS',
- };
+ // Step 5: Upload to IPFS or GCS
+ let uploadCid: string;
+ let gatewayUrl: string;
+
+ // Check if GCS is configured
+ try {
+ const { hasGCSCredentials, uploadToGCS } = await import('../storage/gcs.js');
+ if (hasGCSCredentials()) {
+ console.log(`[Publish] Uploading to Google Cloud Storage...`);
+ const gcsResult = await uploadToGCS(contentBuffer, {
+ name: `${options.name}.cfp.json`,
+ metadata: {
+ checksum,
+ author: author.id,
+ version: cfp.version,
+ },
+ });
+
+ if (gcsResult.success) {
+ uploadCid = gcsResult.uri; // Use GCS URI as CID
+ gatewayUrl = gcsResult.publicUrl;
+ console.log(`[Publish] Uploaded to GCS: ${gcsResult.uri}`);
+ } else {
+ throw new Error('GCS upload failed');
+ }
+ } else {
+ throw new Error('GCS not configured');
+ }
+ } catch {
+ // Fallback to IPFS
+ console.log(`[Publish] Uploading to IPFS...`);
+ const uploadResult = await uploadToIPFS(contentBuffer, {
+ name: `${options.name}.cfp.json`,
+ pin: true,
+ });
+
+ if (!uploadResult.cid) {
+ return {
+ success: false,
+ patternId: '',
+ cid: '',
+ registryCid: '',
+ gatewayUrl: '',
+ message: 'Failed to upload to IPFS (no IPFS credentials configured)',
+ };
+ }
+
+ uploadCid = uploadResult.cid;
+ gatewayUrl = `${this.config.gateway}/ipfs/${uploadResult.cid}`;
+ console.log(`[Publish] Uploaded to IPFS: ${uploadResult.cid}`);
+
+ // Pin content
+ await pinContent(uploadResult.cid);
}
- console.log(`[Publish] Uploaded to IPFS: ${uploadResult.cid}`);
-
- // Step 6: Pin content
- await pinContent(uploadResult.cid);
-
// Step 7: Create pattern entry
const patternId = generatePatternId(options.name);
const author = this.getAuthor();