Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
cc4efaa
chore: Bump version to 0.1.0-alpha.10
nolnol3 Jan 13, 2026
78cc5ab
fix: Sync workspace dependency versions to fix npm ci
nolnol3 Jan 13, 2026
5e11069
feat(agent-core): Add retry mechanism for failed requests
nolnol3 Jan 13, 2026
8c525c7
feat(sdk): Add PayloadData support for gas-optimized payload handling
nolnol3 Jan 14, 2026
ddbfce6
test(sdk): Add comprehensive PayloadData test cases
nolnol3 Jan 14, 2026
1a069be
test(sdk): Add EVM-SDK integration test framework
nolnol3 Jan 14, 2026
65d3ee1
test(sdk): Add E2E PayloadData integration tests
nolnol3 Jan 14, 2026
7a01db6
Merge main into 1-noosphere-payload
nolnol3 Jan 15, 2026
50b38d5
feat(agent-core): Add PayloadResolver and storage adapters for URI-ba…
nolnol3 Jan 16, 2026
46e9e0c
feat: Add Verdaccio local registry and publish script
nolnol3 Jan 16, 2026
0543411
feat: Add npm public registry publish script
nolnol3 Jan 16, 2026
974af93
feat: Add version bump and help to npm publish script
nolnol3 Jan 16, 2026
dbca8a1
fix: Remove npm authentication step from publish-local.sh
nolnol3 Jan 16, 2026
36893c1
feat(agent-core): Add S3-compatible storage support for PayloadResolver
nolnol3 Jan 16, 2026
3376f97
fix: Update PayloadUtils tests for hex-encoded URIs
nolnol3 Jan 16, 2026
8663f33
chore: Bump all packages to version 0.2.0-alpha.1
nolnol3 Jan 17, 2026
af26a66
docs: Add PayloadResolver and storage backends to README
nolnol3 Jan 17, 2026
f4b525e
feat: Add payload package and migrate to vitest
nolnol3 Jan 18, 2026
903fbaa
fix: WebSocket access for ethers v6 and retry event data
nolnol3 Jan 18, 2026
d19dcf9
fix: Update Node.js version requirements for CI
nolnol3 Jan 19, 2026
aec9817
fix: Add tsup to workspace package devDependencies
nolnol3 Jan 19, 2026
8c400d5
fix: Add npm ci retry logic for intermittent failures
nolnol3 Jan 19, 2026
af18b1f
fix: Use npx for build tools in workspace packages
nolnol3 Jan 19, 2026
da7a05a
style: Fix prettier formatting issues
nolnol3 Jan 19, 2026
158fd93
fix: Add build tools to root devDependencies and disable npm cache
nolnol3 Jan 19, 2026
aa728a0
fix: Add robust npm install with fallback and verification
nolnol3 Jan 19, 2026
487e9fd
fix: Switch to yarn for CI to avoid npm internal errors
nolnol3 Jan 19, 2026
b1236f3
chore: Enable yarn.lock for CI
nolnol3 Jan 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [20.x, 22.x]

steps:
- name: Checkout repository
Expand All @@ -22,10 +22,9 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci
run: yarn install --frozen-lockfile || yarn install

- name: Build
run: npm run build
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Dependencies
node_modules/
yarn.lock

# Build outputs
dist/
Expand Down
96 changes: 95 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Noosphere SDK enables you to build and run compute agents that participate in th
npm install @noosphere/sdk

# Or install individual packages
npm install @noosphere/agent-core @noosphere/crypto @noosphere/contracts @noosphere/registry
npm install @noosphere/agent-core @noosphere/crypto @noosphere/contracts @noosphere/registry @noosphere/payload
```

### Basic Example
Expand Down Expand Up @@ -94,6 +94,14 @@ await agent.start();
│ ├── EventMonitor (blockchain events) │
│ └── ContainerManager (Docker execution) │
├─────────────────────────────────────────────────────────┤
│ @noosphere/payload (browser & Node.js) │
│ ├── PayloadResolver (URI-based payload handling) │
│ └── Storage providers │
│ ├── IpfsStorage (IPFS/Pinata) │
│ ├── S3Storage (S3/R2/MinIO) │
│ ├── DataUriStorage (inline data) │
│ └── HttpStorage (HTTP/HTTPS) │
├─────────────────────────────────────────────────────────┤
│ @noosphere/contracts │
│ ├── ABIs (contract interfaces) │
│ ├── TypeChain types (type-safe wrappers) │
Expand Down Expand Up @@ -127,6 +135,32 @@ await agent.start();
- `EventMonitor` - Blockchain event listener with WebSocket support
- `ContainerManager` - Docker container execution

### [@noosphere/payload](./packages/payload) · [npm](https://www.npmjs.com/package/@noosphere/payload)

PayloadData utilities for URI-based payload handling. Works in both browser and Node.js environments.

```typescript
import { PayloadResolver, createDataUriPayload } from '@noosphere/payload';

// Create PayloadData
const payload = createDataUriPayload('{"action": "ping"}');

// Resolve PayloadData
const resolver = new PayloadResolver({ ipfs: { gateway: 'https://ipfs.io/ipfs/' } });
const { content, verified } = await resolver.resolve(payload);
```

**Key Components:**
- `PayloadResolver` - Resolves and encodes PayloadData with verification
- `IpfsStorage` - IPFS/Pinata storage provider
- `S3Storage` - S3/R2/MinIO storage provider
- `DataUriStorage` - Inline base64 data URI provider

**Supported URI Schemes:**
- `data:` - Inline base64-encoded data
- `ipfs://` - IPFS content addressing
- `https://` / `http://` - HTTP(S) URLs

### [@noosphere/contracts](./packages/contracts) · [npm](https://www.npmjs.com/package/@noosphere/contracts)

Type-safe contract interfaces and ABIs.
Expand Down Expand Up @@ -205,6 +239,54 @@ if (verifier.requiresProof && verifier.proofService) {
}
```

### Payload Resolution

The SDK includes `PayloadResolver` for handling URI-based payload data with multiple storage backends.

```typescript
import { PayloadResolver } from '@noosphere/agent-core';

const resolver = new PayloadResolver({
// IPFS configuration
ipfs: {
gateway: 'https://gateway.pinata.cloud/ipfs/',
apiEndpoint: 'https://api.pinata.cloud',
apiKey: process.env.PINATA_API_KEY,
apiSecret: process.env.PINATA_API_SECRET,
},
// S3-compatible storage (R2, S3, MinIO)
s3: {
endpoint: process.env.R2_ENDPOINT,
accessKeyId: process.env.R2_ACCESS_KEY_ID,
secretAccessKey: process.env.R2_SECRET_ACCESS_KEY,
bucket: process.env.R2_BUCKET,
publicUrlBase: process.env.R2_PUBLIC_URL,
},
// Auto-upload threshold (bytes)
uploadThreshold: 1024,
// Default storage for large payloads
defaultStorage: 's3', // 'ipfs' | 's3' | 'data'
});

// Resolve PayloadData from various URI schemes
const { content, verified } = await resolver.resolve(payloadData);
// Supports: data:, ipfs://, https://, http://

// Encode output (auto-uploads if > threshold)
const outputPayload = await resolver.encode(outputContent);
```

**Supported URI Schemes:**
- `data:` - Inline base64-encoded data
- `ipfs://` - IPFS content addressing
- `https://` / `http://` - HTTP(S) URLs

**Storage Backends:**
- `IpfsStorage` - Pinata IPFS pinning service
- `S3Storage` - S3-compatible storage (AWS S3, Cloudflare R2, MinIO)
- `DataUriStorage` - Inline data URI encoding
- `HttpStorage` - HTTP(S) fetch

## Usage Examples

### Running a Compute Agent
Expand Down Expand Up @@ -324,6 +406,18 @@ RPC_URL=https://...
# Optional
WS_URL=wss://...
WALLET_FACTORY_ADDRESS=0x...

# Payload Storage (S3/R2)
R2_ENDPOINT=https://xxx.r2.cloudflarestorage.com
R2_ACCESS_KEY_ID=your-access-key
R2_SECRET_ACCESS_KEY=your-secret-key
R2_BUCKET=your-bucket
R2_PUBLIC_URL=https://pub-xxx.r2.dev

# Payload Storage (IPFS/Pinata)
PINATA_API_KEY=your-api-key
PINATA_API_SECRET=your-api-secret
IPFS_GATEWAY=https://gateway.pinata.cloud/ipfs/
```

### Keystore Structure
Expand Down
40 changes: 40 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# =============================================================================
# Noosphere SDK - Local Verdaccio Registry
# =============================================================================
#
# Local npm registry for SDK development and testing.
# Allows publishing @noosphere/* packages locally before pushing to npm.
#
# Usage:
# # Start Verdaccio
# docker compose -f docker/docker-compose.yml up -d
#
# # Publish SDK packages
# ./scripts/publish-local.sh
#
# # Stop Verdaccio
# docker compose -f docker/docker-compose.yml down
#
# Access:
# Registry: http://localhost:4873
# Web UI: http://localhost:4873 (browser)
#
# =============================================================================

services:
verdaccio:
image: verdaccio/verdaccio:5
container_name: noosphere-verdaccio
ports:
- "4873:4873"
volumes:
- ./verdaccio/config.yaml:/verdaccio/conf/config.yaml:ro
- verdaccio-storage:/verdaccio/storage
healthcheck:
test: ["CMD", "sh", "-c", "wget -q --spider http://localhost:4873/-/ping || exit 1"]
interval: 10s
timeout: 5s
retries: 3

volumes:
verdaccio-storage:
51 changes: 51 additions & 0 deletions docker/verdaccio/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# =============================================================================
# Verdaccio - Local npm Registry Configuration
# =============================================================================
#
# This configuration enables a local npm registry for development/testing.
# @noosphere/* packages are served locally, all others proxy to npmjs.
#
# =============================================================================

storage: /verdaccio/storage
plugins: /verdaccio/plugins

web:
title: Noosphere Local Registry
enable: true

auth:
htpasswd:
file: /verdaccio/storage/htpasswd
max_users: 100

uplinks:
npmjs:
url: https://registry.npmjs.org/
cache: true

packages:
# @noosphere/* packages - local only, no proxy
'@noosphere/*':
access: $all
publish: $all
unpublish: $all
# Don't proxy to npmjs - use local only

# All other packages - proxy to npmjs
'**':
access: $all
publish: $authenticated
unpublish: $authenticated
proxy: npmjs

# Logging
logs:
- { type: stdout, format: pretty, level: info }

# Listen on all interfaces
listen:
- 0.0.0.0:4873

# Max body size for publishing
max_body_size: 100mb
Loading