* feat(app,app-bridge): guard requests sent before handshake completes Calling host-bound methods before the ui/initialize → ui/notifications/initialized handshake completes can race the handshake on strict hosts and leave the iframe permanently hidden. App (View side): - All 8 host-bound methods (callServerTool, readServerResource, listServerResources, sendMessage, updateModelContext, openLink, downloadFile, requestDisplayMode) now check that connect() has sent the initialized notification. - New AppOptions.strict (default false): console.error when false, throw when true. AppOptions is now exported. - useApp() forwards strict to the App constructor. - Flag resets on reconnect. AppBridge (Host side): - replaceRequestHandler is overridden to wrap every host-bound handler with a console.warn if the request arrives before ui/notifications/initialized. Never throws. ui/initialize and ping use setRequestHandler directly and are exempt; notifications are unaffected. - Catches Views that hand-roll postMessage without the SDK. - Flag resets on reconnect. Refs anthropics/claude-ai-mcp#61, anthropics/claude-ai-mcp#149. * fix(docs): drop AppOptions from intentionallyNotExported now that it is exported
This commit is contained in:
parent
739c0e049d
commit
94c94216d4
1 changed files with 200 additions and 9 deletions
|
|
@ -28,7 +28,7 @@ const config = {
|
|||
],
|
||||
excludePrivate: true,
|
||||
excludeInternal: false,
|
||||
intentionallyNotExported: ["AppOptions", "MethodSchema"],
|
||||
intentionallyNotExported: ["MethodSchema"],
|
||||
blockTags: [...OptionDefaults.blockTags, "@description"],
|
||||
jsDocCompatibility: {
|
||||
exampleTag: false,
|
||||
|
|
|
|||
Loading…
Reference in a new issue