@axtary/adapters
v0.1.0
Published
Deterministic local adapters for Axtary proxy demos and tests.
Maintainers
Readme
@axtary/adapters
Tool adapters for Axtary proxy demos, tests, and early real-provider wiring.
Early 0.x release: the runtime path is real and tested, but the API is not stable yet and may change between minor versions. Fake adapters remain the safe default, and real GitHub, Slack, Linear, AWS, GCP, and local docs handlers are available behind explicit config.
npm install @axtary/adaptersWhat It Does
- Provides fake GitHub PR and content-read handlers.
- Provides a fake Slack message handler.
- Provides fake Linear and Jira issue/comment/update handlers.
- Wraps handlers with ActionPass verification so adapter-side effects require a valid payload-bound pass.
- Provides real GitHub REST handlers for content reads, branch creation, content writes, and PR creation.
- Provides a real Slack Web API handler for
chat.postMessage. - Provides real Linear GraphQL handlers for issue reads, comments, and updates.
- Provides read-only AWS REST handlers for STS identity and S3 object listing.
- Provides read-only GCP REST handlers for project reads and Cloud Storage object listing.
- Provides local docs search/read handlers with configured roots, result/byte caps, path traversal protection, and redaction.
- Provides non-destructive smoke helpers for GitHub
/user, Slackauth.test, Linearviewer, AWS STSGetCallerIdentity, GCP project access, and local docs roots. - Classifies provider rate limits, server errors, auth errors, and provider errors for retries and diagnostics.
- Captures adapter state in memory for tests and local demos.
- Returns predictable JSON payloads from proxy handlers.
Smoke Helpers
The smoke helpers exercise the same provider clients as the real handlers, but only call read/auth endpoints:
smokeGitHubRestCredentialssmokeSlackWebCredentialssmokeLinearGraphqlCredentialssmokeAwsRestCredentialssmokeGcpRestCredentialssmokeLocalDocsRoots
They are used by axtary smoke to validate credentials before running a real integration.
Quickstart
This example runs as-is with Node 20+:
import { createFakeHandlers, createLocalDocsHandlers, getConnectorCapabilities } from "@axtary/adapters";
// Fake handlers cover the full demo workflow without credentials.
console.log(Object.keys(createFakeHandlers()));
// Real handlers are created the same way, behind explicit config.
const docs = createLocalDocsHandlers({
roots: [{ name: "docs", path: "./docs" }],
});
console.log(Object.keys(docs));
// The capability registry says which capabilities are real vs demo-only.
console.log(getConnectorCapabilities().filter((c) => c.status === "supported").length, "supported capabilities");Design Notes
The fake adapters let us prove the authorization flow without credentials. Real adapters should still be wrapped with ActionPass verification so the proxy and adapter boundary both enforce the same action hash, audience, issuer, and expiration.
