@burdenoff/sdk-libs
v2026.825.2
Published
Modular SDK library shared across all Burdenoff product SDKs (vibecontrols, botlit, fluidgrids, bigconsole, healthybowl, devportal, workspaces). Each module exports an SdkModule contract with attach(ctx) returning a typed API; product SDKs become thin she
Maintainers
Readme
@burdenoff/sdk-libs
Modular SDK library shared across all Burdenoff product SDKs (Node/TypeScript).
Each module under src/modules/<name>/ exports an SdkModule with attach(ctx) -> API. Product SDKs (@vibecontrols/sdk-node, @botlit/sdk-node, etc.) become thin shells that pick which modules to mount. Sister to @burdenoff/cli-sdk.
Architecture
- Core (
src/core/):SdkContextprop bag,SdkModulecontract,BaseGraphQLClient(dual workspace+global gateway),AuthStorewith pluggableTokenStore(InMemory,File,Env), error hierarchy with token redaction,ModuleRegistryfor cross-module access. - Modules (
src/modules/<name>/):index.ts(default-exportsSdkModule),operations.ts(hand-writtengqlstrings),api.ts(the class returned byattach),types.ts(re-exports from__generated__/),__generated__/types.ts(codegen output, gitignored). - Hard rules: Modules NEVER import each other directly — use
ctx.modules.get<API>('id'). Modules NEVER callprocess.exitor write secrets to logs.
Build
- tsup dual ESM+CJS, multi-entry,
dts: true. Entries:src/index.ts,src/core/index.ts,src/modules/*/index.ts. external:graphql,graphql-request,graphql-ws(peer deps).- Subpath imports:
@burdenoff/sdk-libs/core,@burdenoff/sdk-libs/modules/<name>.
Commands
bun install
bun run dev # tsup watch
bun run build # tsup once
bun run sanity # format:check + lint + typecheck + build + test
bun run test # vitest run
bun run codegen # GraphQL types from pinned Hive supergraph
bun run parity:check # cross-language manifest diff vs sdk-libs-python
bun run publish:verdaccio # alpha tag to internal VerdaccioAdding a module
mkdir src/modules/<name>withindex.ts,operations.ts,api.ts,types.ts.- Default-export an
SdkModule<API>fromindex.ts. - Add the module to
schema/modules.yaml(operations + dependsOn). - Mirror in
~/products/sdk-libs-python/in the same PR pair. - tsup picks it up automatically (
src/modules/*/index.tsglob).
Testing
- Unit (
tests/unit/): pure logic — arg parsers, response transformers, gql doc builders. No HTTP. Vitest, <5s. - Integration (
tests/integration/): MSW intercepts GraphQL requests. Mock factories derived from__generated__/types. Schema rename breaks mock = test fail. - E2E (
tests/e2e/): real svc + state, run nightly. Mirrors~/products/vibecontrols/vibecontrols-doctor/scripts/test-*-crud.sh. - Parity (
tests/parity/<scenario>.yaml): same scenario file run by node + python. CI fails if shapes diverge.
Reference
~/products/burdenoff-be-sdk-node/— reference for tsup multi-entry + verdaccio publish.~/products/cli-sdk/— sister CLI SDK.~/products/vibecontrols/vibecontrols-sdk-node/— first consumer (thin shell).~/products/dev/audit/index/vibecontrols.md— 23-module ground-truth.
