ext-apps/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Olivier Chafik eaea3f9e07
feat: store and expose hostContext in App class (#139)
* feat: store and expose hostContext in App class

Fixes #129 - The App class now stores the initial hostContext received
during initialization and exposes it via getHostContext().

Changes:
- Add _hostContext private property to App class
- Store result.hostContext in connect() method
- Add getHostContext() getter method (parallel to getHostCapabilities())
- Update onhostcontextchanged setter to merge partial updates into
  stored context
- Add default notification handler to update context even when
  user hasn't set onhostcontextchanged

This enables apps to:
- Access toolInfo immediately after connection (only in initial context)
- Render with correct theme/locale without waiting for first notification
- Synchronously access viewport, timezone, and other initial state

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: use sendHostContextChange for partial update accumulation test

Address PR review feedback: The test was using setHostContext with full
context spreads which didn't clearly demonstrate partial update
accumulation. Now uses sendHostContextChange directly to send truly
partial updates (only theme, then only viewport), making it clear
the App correctly merges multiple partial notifications.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-12 00:39:58 +01:00
..
generated feat: implement ui/notifications/tool-cancelled + add missing App.onteardown (#120) 2025-12-11 20:31:17 +01:00
react fix: change size-changed to be in correct tense (#83) 2025-12-08 12:14:56 +01:00
app-bridge.test.ts feat: store and expose hostContext in App class (#139) 2025-12-12 00:39:58 +01:00
app-bridge.ts feat: implement ui/notifications/tool-cancelled + add missing App.onteardown (#120) 2025-12-11 20:31:17 +01:00
app.ts feat: store and expose hostContext in App class (#139) 2025-12-12 00:39:58 +01:00
message-transport.ts Add basic-host and basic-server-react examples 2025-12-04 14:28:27 -06:00
spec.types.ts feat: implement ui/notifications/tool-cancelled + add missing App.onteardown (#120) 2025-12-11 20:31:17 +01:00
types.ts feat: implement ui/notifications/tool-cancelled + add missing App.onteardown (#120) 2025-12-11 20:31:17 +01:00