@fabric-harness/connectors
v1.2.3
Published
Connector recipes (sandbox, mcp, data) for Fabric Harness — markdown-based provider integrations.
Maintainers
Readme
@fabric-harness/connectors
Modular connector helpers and recipes for Fabric Harness.
Three ways to use this package:
- Concrete data sources on dedicated subpath exports (
@fabric-harness/connectors/s3,/azure-blob,/gcs,/github,/databricks-volume,/k8s). Each peer-deps the vendor SDK so you only install what you use. - Sandbox adapters for Daytona, E2B, Modal, plus the structural
remoteSandboxfor any provider-owned remote sandbox (s3FilesystemSource,azureBlobFilesystemSourcefrom the root export are the older structural sources for advanced cases). - Markdown recipes via
fh add <name>that you pipe into your coding agent to scaffold a project-local adapter.
Install
npm install @fabric-harness/connectorsInstall only the optional provider SDK you use. Fabric publishes bounded compatibility ranges and compiles/tests against these versions:
| Provider | Package | Compatible range | Contract version |
|---|---|---|---|
| Daytona | @daytona/sdk | >=0.195.0 <1 | 0.195.0 |
| E2B | @e2b/code-interpreter | >=2.6.1 <3 | 2.6.1 |
| Modal | modal | >=0.9.0 <1 | 0.9.0 native SDK adapter |
| Vercel | @vercel/sandbox | >=1.10.1 <2 | 1.10.1 |
| Kubernetes | @kubernetes/client-node | >=0.21.0 <0.22 | 0.21.0 |
Data sources
Mount external services as files inside the sandbox. The agent's built-in
read, glob, grep, and bash tools then operate over the mounted prefix.
import { s3Source } from '@fabric-harness/connectors/s3';
const fabric = await init({ sandbox: 'local' });
const session = await fabric.session();
// `@aws-sdk/client-s3` is a peer dependency — install it explicitly.
await session.mount('/mnt/logs', s3Source({ bucket: 'my-logs', prefix: '2026/' }));Each source is a FilesystemSource that yields (path, content) pairs;
session.mount(mountAt, source) writes them into the sandbox at the given
path. Absolute mount paths outside the sandbox cwd are rerooted under it.
Available subpath exports (peer-dep'd vendor SDKs):
| Export | Functions | Peer dependency |
|---|---|---|
| @fabric-harness/connectors/s3 | s3Source, s3Writer | @aws-sdk/client-s3 |
| @fabric-harness/connectors/azure-blob | azureBlobSource, azureBlobWriter | @azure/storage-blob |
| @fabric-harness/connectors/gcs | gcsSource, gcsWriter | @google-cloud/storage |
| @fabric-harness/connectors/github | githubSource | octokit |
| @fabric-harness/connectors/databricks-volume | databricksVolumeSource, databricksVolumeWriter | (none — uses fetch) |
| @fabric-harness/connectors/k8s | kubernetesSandbox, createKubernetesPod | @kubernetes/client-node |
Sandbox adapters
import { daytonaSandbox } from '@fabric-harness/connectors';
import { Daytona } from '@daytona/sdk';
const client = new Daytona({ apiKey: process.env.DAYTONA_API_KEY });
const sandbox = await client.create();
const env = daytonaSandbox(sandbox, { cleanup: true });
const agent = await init({ sandbox: env });The adapters are structural and dependency-free: your app owns provider SDK clients and credentials; Fabric only sees the narrow file/shell SandboxEnv contract.
Command output uses the common sandbox callback contract. E2B, Vercel, and Kubernetes forward provider chunks as they arrive. Daytona emits the collected output before the command promise settles because its compatible process API returns a collected response.
await env.exec('npm test', {
cwd: '/workspace/app',
env: { CI: '1' },
timeout: 120_000,
signal: abortController.signal,
onStdout: (chunk) => process.stdout.write(chunk),
onStderr: (chunk) => process.stderr.write(chunk),
});Provider IDs are encoded automatically when available. Reattach in another process by registering a decoder and passing a JSON-safe ref:
const ref = await session.sandboxRef({ portable: true });
registerStandardSandboxRefDecoders({
e2b: { connect: ({ sandboxId }) => Sandbox.connect(sandboxId) },
});
const attached = await init({ sandbox: attachSandbox(ref) });Certification
assertSandboxCertification() exercises shell, binary files, cwd/env, timeout, abort, output callbacks, cleanup, portable refs, and reconnect. Its JSON report contains provider/version/check results but no credentials or file contents.
const report = await assertSandboxCertification(env, {
provider: 'e2b',
sdkPackage: '@e2b/code-interpreter',
sdkVersion: '2.6.1',
credentialed: true,
reconnect: async (ref) => e2bSandbox(
await Sandbox.connect((ref.providerData as { sandboxId: string }).sandboxId),
),
verifyCleanup: async () => { /* assert the provider resource is gone */ },
});Browse recipes
fh add
fh add daytona | claude
fh add https://e2b.dev --category sandbox | claudeCategories shipped today: sandbox (Daytona, E2B, Modal), mcp (GitHub), data (Postgres).
License
Apache-2.0
