Skip to content

refactor: replace singleton with createAssemblyKit() and add workspaceId support - #17

Merged
priosshrsth merged 3 commits into
mainfrom
refactor/createAssemblyKit-multi-workspace
Mar 28, 2026
Merged

refactor: replace singleton with createAssemblyKit() and add workspaceId support#17
priosshrsth merged 3 commits into
mainfrom
refactor/createAssemblyKit-multi-workspace

Conversation

@priosshrsth

@priosshrsth priosshrsth commented Mar 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Remove AssemblyKit.new() static singleton (AsyncLocalStorage-based) in favor of a plain createAssemblyKit() factory function — users manage their own instances (e.g. via React cache() or a Map)
  • Add workspaceId option as an alternative to token — at least one must be provided. When only workspaceId is given, the SDK sets ASSEMBLY_ENV=local at runtime and builds the compound key as workspaceId/apiKey. If both are provided, token takes precedence
  • Update README with multi-workspace usage guide (React cache() recommended, plain Map as fallback)

Test plan

  • All 167 existing + new tests pass
  • vp check --fix passes (lint, format, types)
  • Verify createAssemblyKit({ apiKey, workspaceId }) works against a real workspace
  • Verify createAssemblyKit({ apiKey, token }) still works as before
  • Verify createAssemblyKit({ apiKey, token, workspaceId }) ignores workspaceId

🤖 Generated with Claude Code

priosshrsth and others added 3 commits March 28, 2026 16:37
…orkspaceId support

Remove the AsyncLocalStorage-based `AssemblyKit.new()` singleton in favor of a
plain `createAssemblyKit()` factory function. Users now manage their own instances
(e.g. via React `cache()` or a Map). Also adds `workspaceId` as an alternative to
`token` — when only workspaceId is provided, the SDK sets ASSEMBLY_ENV=local at
runtime and builds the compound key as `workspaceId/apiKey`. If both are provided,
token takes precedence.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move the contributor-focused CLAUDE.md to .claude/CLAUDE.md (still read by
Claude Code for repo development) and create a new consumer-focused CLAUDE.md
at the root that ships with the npm package. This gives AI assistants working
in consumer projects instant context about the SDK's API surface, resource
namespaces, error handling, and entry points without scanning dist files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@priosshrsth
priosshrsth merged commit f41a46a into main Mar 28, 2026
6 checks passed
@priosshrsth
priosshrsth deleted the refactor/createAssemblyKit-multi-workspace branch March 28, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant