MCPcopy Create free account
hub / github.com/codeaashu/claude-code / makeXaaFetch

Function makeXaaFetch

src/services/mcp/xaa.ts:42–52  ·  view source on GitHub ↗

* Creates a fetch wrapper that enforces the XAA request timeout and optionally * composes a caller-provided abort signal. Using AbortSignal.any ensures the * user's cancel (e.g. Esc in the auth menu) actually aborts in-flight requests * rather than being clobbered by the timeout signal.

(abortSignal?: AbortSignal)

Source from the content-addressed store, hash-verified

40 * rather than being clobbered by the timeout signal.
41 */
42function makeXaaFetch(abortSignal?: AbortSignal): FetchLike {
43 return (url, init) => {
44 const timeout = AbortSignal.timeout(XAA_REQUEST_TIMEOUT_MS)
45 const signal = abortSignal
46 ? // eslint-disable-next-line eslint-plugin-n/no-unsupported-features/node-builtins
47 AbortSignal.any([timeout, abortSignal])
48 : timeout
49 // eslint-disable-next-line eslint-plugin-n/no-unsupported-features/node-builtins
50 return fetch(url, { ...init, signal })
51 }
52}
53
54const defaultFetch = makeXaaFetch()
55

Callers 2

xaa.tsFile · 0.85
performCrossAppAccessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected