@ank1015/llm-sdk-adapters
v0.0.2
Published
Node.js adapter implementations for @ank1015/llm-sdk with file-system and in-memory keys/session storage
Downloads
155
Maintainers
Readme
@ank1015/llm-sdk-adapters
Concrete Node.js adapters for @ank1015/llm-sdk.
This package provides ready-made implementations for the adapter contracts defined in @ank1015/llm-types and consumed by @ank1015/llm-sdk:
- encrypted file-system key storage
- JSONL file-system session storage
- in-memory keys/session adapters for tests and lightweight local flows
It no longer includes usage-tracking adapters or key-management UI utilities.
Install
npm install @ank1015/llm-sdk-adaptersMain Exports
import {
FileKeysAdapter,
FileSessionsAdapter,
InMemoryKeysAdapter,
InMemorySessionsAdapter,
createFileKeysAdapter,
createFileSessionsAdapter,
} from '@ank1015/llm-sdk-adapters';Quick Start
import { createSessionManager } from '@ank1015/llm-sdk';
import { createFileKeysAdapter, createFileSessionsAdapter } from '@ank1015/llm-sdk-adapters';
const keysAdapter = createFileKeysAdapter();
const sessionsAdapter = createFileSessionsAdapter();
const sessionManager = createSessionManager(sessionsAdapter);Included Adapters
File-system adapters
FileKeysAdapter- stores encrypted credentials under
~/.llm/global/keys/ - supports both legacy
apiKeystorage and multi-field credential bundles
- stores encrypted credentials under
FileSessionsAdapter- stores append-only JSONL sessions under
~/.llm/sessions/ - supports branching, custom nodes, and session summaries
- stores append-only JSONL sessions under
In-memory adapters
InMemoryKeysAdapterInMemorySessionsAdapter
These are useful in tests or small local flows where persistence is not needed.
Package Boundary
@ank1015/llm-typesdefines the adapter contracts and shared errors@ank1015/llm-sdkprovides the higher-level wrappers that consume these adapters@ank1015/llm-sdk-adaptersowns the concrete Node-oriented implementations
Docs
Development
pnpm buildpnpm testpnpm test:unitpnpm test:integrationpnpm test:coveragepnpm typecheckpnpm lint
