MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / propagateZooGatewayCallback

Function propagateZooGatewayCallback

src/activate/handleUri.ts:21–33  ·  view source on GitHub ↗

* Persist the Zoo Code session token to every active provider instance. * * The profile settings write (handleZooCodeCallback) must run on any active * instance — not just the visible one — so the zoo-gateway zooSessionToken is * persisted even when the sidebar/panel is hidden at callback time.

(token: string)

Source from the content-addressed store, hash-verified

19 * the race.
20 */
21async function propagateZooGatewayCallback(token: string): Promise<void> {
22 const allInstances = ClineProvider.getAllInstances()
23 for (const instance of allInstances) {
24 try {
25 await instance.handleZooCodeCallback(token)
26 } catch (error) {
27 console.error(
28 "Failed to persist Zoo Gateway token for a provider instance:",
29 error instanceof Error ? error.message : error,
30 )
31 }
32 }
33}
34
35export const handleUri = async (uri: vscode.Uri) => {
36 const path = uri.path

Callers 1

handleUriFunction · 0.85

Calls 3

handleZooCodeCallbackMethod · 0.80
errorMethod · 0.65
getAllInstancesMethod · 0.45

Tested by

no test coverage detected