Skip to content

refactor(sdk): remove ctx.yavio injection in favor of yavio singleton#3

Merged
johannmachemer merged 2 commits intomainfrom
refactor/remove-ctx-yavio-injection
Feb 26, 2026
Merged

refactor(sdk): remove ctx.yavio injection in favor of yavio singleton#3
johannmachemer merged 2 commits intomainfrom
refactor/remove-ctx-yavio-injection

Conversation

@johannmachemer
Copy link
Contributor

@johannmachemer johannmachemer commented Feb 26, 2026

Summary

  • Remove ctx.yavio injection from tool handler's extra parameter in proxy.ts
  • Establish the yavio module singleton (via AsyncLocalStorage) as the single access pattern for tracking context
  • Update all docs, specs, and tests to reflect the new API

Breaking Change

ctx.yavio is no longer available in tool handlers. Use import { yavio } from "@yavio/sdk" instead.

Test plan

  • SDK build, typecheck, lint, and tests all pass (pnpm turbo run build typecheck lint test --filter=@yavio/sdk)
  • Verify docs render correctly with updated code examples

The SDK previously offered two ways to access the tracking context:
`ctx.yavio` (injected into the tool handler's extra parameter) and the
`yavio` module singleton. Both resolved to the same AsyncLocalStorage
store, making ctx.yavio redundant. This removes the injection and
establishes the singleton as the single access pattern.

BREAKING CHANGE: `ctx.yavio` is no longer injected into tool handlers.
Use `import { yavio } from "@yavio/sdk"` instead.
Add pnpm.overrides to bump transitive deps hono (>=4.12.2) and
rollup (>=4.59.0) to resolve newly disclosed CVEs (GHSA-xh87-mx6m-69f3,
GHSA-mw96-cpmx-2vgc).
@johannmachemer johannmachemer merged commit 61e99f3 into main Feb 26, 2026
11 checks passed
@johannmachemer johannmachemer deleted the refactor/remove-ctx-yavio-injection branch February 26, 2026 19:14
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