-
Notifications
You must be signed in to change notification settings - Fork 1
No SDK Integration Guidance #1
Description
From my agent trying to build but evaluate first:
The biggest gap. The CLI is great for using FOC from a terminal. But an agent building a dApp needs to integrate the
Synapse SDK into application code. The CLI source (upload.ts) reveals the actual SDK pattern:
const synapse = new Synapse({ client, source: 'foc-cli' })
const contexts = await synapse.storage.createContexts({ copies, withCDN })
const prep = await synapse.storage.prepare({ context: contexts, dataSize: BigInt(file.byteLength) })
if (prep.transaction) await prep.transaction.execute()
const result = await synapse.storage.upload(fileStream, { contexts, withCDN })
But none of this is documented in the README or skills. An agent reading the SKILL.md would only know CLI commands, not
how to write a Next.js API route that stores files on FOC. The docs.filecoin.cloud site has SDK docs, but:
- The foc-docs skill only searches by topic — it doesn't proactively guide an agent through SDK setup
- There's no "build a dApp" cookbook or template
- The agent would have to reverse-engineer the CLI source to understand the SDK flow
Recommendation: Add a foc-app skill (or a "Building a dApp" section in foc-cli SKILL.md) that shows:
- How to install @filoz/synapse-sdk + @filoz/synapse-core + viem
- How to create a wallet client (the client.ts pattern)
- The upload flow as application code (not CLI commands)
- A Next.js API route example
- React integration with @filoz/synapse-react hooks