Skip to content

Commit 8127205

Browse files
committed
feat: trustless fetch + support for multiformat base64
1 parent c64dec9 commit 8127205

File tree

11 files changed

+427
-120
lines changed

11 files changed

+427
-120
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"cors": "^2.8.5",
5353
"dotenv": "^16.4.7",
5454
"express": "^4.21.2",
55+
"ipfs-unixfs-exporter": "^13.6.2",
5556
"multiformats": "^13.3.2",
5657
"zod": "^3.24.2"
5758
},

pnpm-lock.yaml

Lines changed: 175 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/server/tools/retrieve.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { z } from 'zod';
22
import { StorachaClient } from '../../storage/client.js';
33
import { StorageConfig } from 'src/core/storage/types.js';
4+
import * as dagJSON from '@ipld/dag-json';
45

56
type RetrieveInput = {
67
filepath: string;
@@ -31,7 +32,7 @@ export const retrieveTool = (storageConfig: StorageConfig) => ({
3132
content: [
3233
{
3334
type: 'text' as const,
34-
text: JSON.stringify(result),
35+
text: dagJSON.stringify(result),
3536
},
3637
],
3738
};

0 commit comments

Comments
 (0)