Skip to content

feat: add addContext method for injecting client-side context into se…#179

Merged
ao-anam merged 1 commit intomainfrom
oz/9495-implement-add-co
Mar 17, 2026
Merged

feat: add addContext method for injecting client-side context into se…#179
ao-anam merged 1 commit intomainfrom
oz/9495-implement-add-co

Conversation

@ao-anam
Copy link
Copy Markdown
Contributor

@ao-anam ao-anam commented Mar 12, 2026

…ssions

Abstracts the data channel context message into a first-class SDK method, allowing users to easily inject DOM state, user actions, and other client-side context that the persona can use to inform its responses.


Summary by cubic

Adds a first-class addContext(content) method on AnamClient to inject client-side context into an active streaming session, improving response relevance. Enables sending DOM state, user actions, and other runtime signals to the persona.

  • New Features
    • AnamClient.addContext(content: string) sends a message_type: 'context' with session_id and content over the data channel.
    • Validates state and throws if not streaming or no active session.

Written for commit fdb5876. Summary will update on new commits.

…ssions

Abstracts the data channel context message into a first-class SDK method,
allowing users to easily inject DOM state, user actions, and other
client-side context that the persona can use to inform its responses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@ao-anam ao-anam merged commit 1eddf60 into main Mar 17, 2026
4 checks passed
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.

2 participants