@spotpatch/runtime 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-QY5T4DPA.js → chunk-2WA6XVA4.js} +13 -6
- package/dist/chunk-2WA6XVA4.js.map +1 -0
- package/dist/chunk-RZDOL5BT.js +1 -0
- package/dist/chunk-RZDOL5BT.js.map +1 -0
- package/dist/data-flow-panel.cjs +162 -0
- package/dist/data-flow-panel.cjs.map +1 -1
- package/dist/data-flow-panel.d.cts +4 -2
- package/dist/data-flow-panel.d.ts +4 -2
- package/dist/data-flow-panel.js +26 -0
- package/dist/data-flow-panel.js.map +1 -1
- package/dist/{data-flow-runtime-B3itbieT.d.cts → data-flow-runtime-DMmV0d3E.d.cts} +7 -3
- package/dist/{data-flow-runtime-B3itbieT.d.ts → data-flow-runtime-DMmV0d3E.d.ts} +7 -3
- package/dist/data-flow.cjs +12 -5
- package/dist/data-flow.cjs.map +1 -1
- package/dist/data-flow.d.cts +1 -1
- package/dist/data-flow.d.ts +1 -1
- package/dist/data-flow.js +2 -1
- package/dist/index.cjs +12 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
- package/dist/chunk-QY5T4DPA.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpotPatchRuntimeConfig } from '@spotpatch/shared';
|
|
2
|
-
export { D as DataFlowComponentRegistration, a as DataFlowInvocationToken, b as DataFlowRequestFrame, c as DataFlowRequestMetadata, d as DataFlowRuntime, e as DataFlowTriggerMetadata, f as createDataFlowRuntime, g as getDataFlowRuntime, i as installDataFlowPrelude } from './data-flow-runtime-
|
|
2
|
+
export { D as DataFlowComponentRegistration, a as DataFlowInvocationToken, b as DataFlowRequestFrame, c as DataFlowRequestMetadata, d as DataFlowRuntime, e as DataFlowTriggerMetadata, f as createDataFlowRuntime, g as getDataFlowRuntime, i as installDataFlowPrelude } from './data-flow-runtime-DMmV0d3E.cjs';
|
|
3
3
|
export { mergeComponentDataFlowReport, mergePageDataFlowReport } from './data-flow.cjs';
|
|
4
4
|
import '@spotpatch/shared/data-flow-runtime';
|
|
5
5
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpotPatchRuntimeConfig } from '@spotpatch/shared';
|
|
2
|
-
export { D as DataFlowComponentRegistration, a as DataFlowInvocationToken, b as DataFlowRequestFrame, c as DataFlowRequestMetadata, d as DataFlowRuntime, e as DataFlowTriggerMetadata, f as createDataFlowRuntime, g as getDataFlowRuntime, i as installDataFlowPrelude } from './data-flow-runtime-
|
|
2
|
+
export { D as DataFlowComponentRegistration, a as DataFlowInvocationToken, b as DataFlowRequestFrame, c as DataFlowRequestMetadata, d as DataFlowRuntime, e as DataFlowTriggerMetadata, f as createDataFlowRuntime, g as getDataFlowRuntime, i as installDataFlowPrelude } from './data-flow-runtime-DMmV0d3E.js';
|
|
3
3
|
export { mergeComponentDataFlowReport, mergePageDataFlowReport } from './data-flow.js';
|
|
4
4
|
import '@spotpatch/shared/data-flow-runtime';
|
|
5
5
|
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getDataFlowExtension
|
|
3
|
+
} from "./chunk-NII5OBAN.js";
|
|
1
4
|
import {
|
|
2
5
|
createDataFlowRuntime,
|
|
3
6
|
getDataFlowRuntime,
|
|
4
7
|
installDataFlowPrelude,
|
|
5
8
|
mergeComponentDataFlowReport,
|
|
6
9
|
mergePageDataFlowReport
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
getDataFlowExtension
|
|
10
|
-
} from "./chunk-NII5OBAN.js";
|
|
10
|
+
} from "./chunk-2WA6XVA4.js";
|
|
11
11
|
import {
|
|
12
12
|
getExternalHandoffExtension
|
|
13
13
|
} from "./chunk-BXRMVHNT.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotpatch/runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Browser runtime, collectors, and Shadow DOM UI for SpotPatch.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@spotpatch/react-adapter": "^1.
|
|
89
|
-
"@spotpatch/shared": "^1.
|
|
88
|
+
"@spotpatch/react-adapter": "^1.2.0",
|
|
89
|
+
"@spotpatch/shared": "^1.12.0"
|
|
90
90
|
},
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/data-flow/data-flow-runtime.ts","../src/data-flow/report-merger.ts"],"sourcesContent":["import {\n DATA_FLOW_SCHEMA_VERSION,\n DATA_FLOW_URL_QUERY_KEY_LIMIT,\n SPOTPATCH_API_BASE,\n type NetworkObservation,\n type RuntimeDataFlowConfig,\n type RuntimeDataFlowLimits,\n type SanitizedObservedUrl,\n} from \"@spotpatch/shared/data-flow-runtime\";\n\nexport interface DataFlowComponentRegistration {\n readonly componentSourceId: string;\n readonly sourceVersion: string;\n}\n\nexport interface DataFlowInvocationToken {\n readonly invocationId: string;\n readonly componentSourceId: string;\n readonly triggerCallsiteId: string;\n readonly sourceVersion: string;\n}\n\nexport interface DataFlowRequestFrame {\n readonly requestCallsiteId: string;\n readonly sourceVersion: string;\n readonly invocationToken?: DataFlowInvocationToken;\n}\n\nexport interface DataFlowTriggerMetadata {\n readonly componentSourceId: string;\n readonly triggerCallsiteId: string;\n readonly sourceVersion: string;\n}\n\nexport interface DataFlowRequestMetadata {\n readonly requestCallsiteId: string;\n readonly sourceVersion: string;\n}\n\nexport interface DataFlowRuntime {\n readonly beginInvocation: (\n metadata: DataFlowTriggerMetadata,\n ) => DataFlowInvocationToken;\n readonly bindInvocation: <Arguments extends readonly unknown[], Result>(\n token: DataFlowInvocationToken | undefined,\n callback: (...args: Arguments) => Result,\n ) => (...args: Arguments) => Result;\n readonly bindTrigger: <Callback>(\n metadata: DataFlowTriggerMetadata,\n callback: Callback,\n ) => Callback;\n readonly captureInvocation: () => DataFlowInvocationToken | undefined;\n readonly clear: () => void;\n readonly createTrpcLink: () => DataFlowTrpcLink;\n readonly dispose: () => void;\n readonly getComponentRegistration: (\n component: object,\n ) => DataFlowComponentRegistration | undefined;\n readonly getCurrentRequestFrame: () => DataFlowRequestFrame | undefined;\n readonly observations: () => readonly NetworkObservation[];\n readonly updateRoute: (routeKey: string) => void;\n readonly registerComponent: (\n component: object,\n componentSourceId: string,\n sourceVersion: string,\n ) => void;\n readonly withInvocation: <Result>(\n token: DataFlowInvocationToken | undefined,\n callback: () => Result,\n ) => Result;\n readonly withRequestFrame: <Result>(\n token: DataFlowInvocationToken | undefined,\n metadata: DataFlowRequestMetadata,\n callback: () => Result,\n ) => Result;\n}\n\nexport interface DataFlowTrpcOperation {\n readonly path: unknown;\n readonly type: unknown;\n}\n\nexport interface DataFlowTrpcLinkOptions<\n Operation extends DataFlowTrpcOperation,\n Result,\n> {\n readonly next: (operation: Operation) => Result;\n readonly op: Operation;\n}\n\nexport type DataFlowTrpcLink = (\n runtime: unknown,\n) => <Operation extends DataFlowTrpcOperation, Result>(\n options: DataFlowTrpcLinkOptions<Operation, Result>,\n) => Result;\n\ninterface DataFlowGlobal {\n readonly fetch?: typeof globalThis.fetch;\n readonly location?: Location;\n readonly performance?: Performance;\n readonly XMLHttpRequest?: typeof globalThis.XMLHttpRequest;\n}\n\ninterface MutableDataFlowGlobal extends DataFlowGlobal {\n fetch?: typeof globalThis.fetch;\n}\n\ninterface XhrMetadata {\n readonly method: string;\n readonly url: string;\n}\n\ninterface RingEntry {\n readonly bytes: number;\n readonly observation: NetworkObservation;\n readonly recordedAt: number;\n}\n\nconst RUNTIME_KEY: unique symbol = Symbol.for(\n \"spotpatch.data-flow.runtime.v1\",\n) as never;\nconst REACT_MEMO_TYPE = Symbol.for(\"react.memo\");\nconst REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\");\n\ntype DataFlowRuntimeStore = Partial<Record<symbol, DataFlowRuntime>>;\ntype GlobalWithDataFlow = MutableDataFlowGlobal & DataFlowRuntimeStore;\n\nfunction positiveNow(target: DataFlowGlobal): number {\n return target.performance?.now() ?? Date.now();\n}\n\nfunction createOpaqueSequence(prefix: string): () => string {\n let sequence = 0;\n const randomPrefix = (() => {\n try {\n const bytes = new Uint8Array(8);\n globalThis.crypto.getRandomValues(bytes);\n return Array.from(bytes, (value) => value.toString(36).padStart(2, \"0\")).join(\"\");\n } catch {\n return \"local\";\n }\n })();\n\n return () => {\n sequence += 1;\n return `${prefix}_${randomPrefix}_${sequence.toString(36)}`;\n };\n}\n\nfunction freezeUrl(value: string, baseUrl: string): SanitizedObservedUrl {\n try {\n const url = new URL(value, baseUrl);\n return Object.freeze({\n origin: url.origin,\n pathname: url.pathname,\n queryKeys: Object.freeze(\n [...new Set(url.searchParams.keys())]\n .sort()\n .slice(0, DATA_FLOW_URL_QUERY_KEY_LIMIT),\n ),\n });\n } catch {\n return Object.freeze({\n pathname: value.split(/[?#]/u, 1)[0] ?? \"{invalid}\",\n queryKeys: Object.freeze([]),\n });\n }\n}\n\nfunction readFetchUrl(input: RequestInfo | URL): string {\n if (typeof input === \"string\") return input;\n if (input instanceof URL) return input.toString();\n return input.url;\n}\n\nfunction readFetchMethod(input: RequestInfo | URL, init?: RequestInit): string {\n if (init?.method !== undefined) return init.method.toUpperCase();\n return typeof Request !== \"undefined\" && input instanceof Request\n ? input.method.toUpperCase()\n : \"GET\";\n}\n\nfunction isSpotPatchInternalUrl(value: string, baseUrl: string): boolean {\n try {\n const pathname = new URL(value, baseUrl).pathname;\n return (\n pathname === SPOTPATCH_API_BASE || pathname.startsWith(`${SPOTPATCH_API_BASE}/`)\n );\n } catch {\n return false;\n }\n}\n\nfunction approximateBytes(value: unknown): number {\n return new TextEncoder().encode(JSON.stringify(value)).byteLength;\n}\n\nfunction createRingStore(\n limits: RuntimeDataFlowLimits,\n target: DataFlowGlobal,\n): Readonly<{\n add: (observation: NetworkObservation) => void;\n clear: () => void;\n values: () => readonly NetworkObservation[];\n}> {\n const entries: RingEntry[] = [];\n let totalBytes = 0;\n\n function removeExpired(now: number): void {\n while (\n entries[0] !== undefined &&\n now - entries[0].recordedAt > limits.observationTtlMs\n ) {\n const removed = entries.shift();\n if (removed !== undefined) totalBytes -= removed.bytes;\n }\n }\n\n return Object.freeze({\n add(observation): void {\n const now = positiveNow(target);\n removeExpired(now);\n const bytes = approximateBytes(observation);\n if (bytes > limits.observationMaxBytes) return;\n entries.push(Object.freeze({ bytes, observation, recordedAt: now }));\n totalBytes += bytes;\n\n while (\n entries.length > limits.observationMaxEntries ||\n totalBytes > limits.observationMaxBytes\n ) {\n const removed = entries.shift();\n if (removed !== undefined) totalBytes -= removed.bytes;\n }\n },\n clear(): void {\n entries.length = 0;\n totalBytes = 0;\n },\n values(): readonly NetworkObservation[] {\n removeExpired(positiveNow(target));\n return Object.freeze(entries.map(({ observation }) => observation));\n },\n });\n}\n\nfunction ownPropertyDescriptor(\n target: object,\n key: PropertyKey,\n): PropertyDescriptor | undefined {\n try {\n return Object.getOwnPropertyDescriptor(target, key);\n } catch {\n return undefined;\n }\n}\n\nfunction nestedReactWrapperComponent(candidate: object): object | undefined {\n const marker: unknown = ownPropertyDescriptor(candidate, \"$$typeof\")?.value;\n const key =\n marker === REACT_MEMO_TYPE\n ? \"type\"\n : marker === REACT_FORWARD_REF_TYPE\n ? \"render\"\n : undefined;\n if (key === undefined) return undefined;\n const nested: unknown = ownPropertyDescriptor(candidate, key)?.value;\n return (typeof nested === \"object\" && nested !== null) || typeof nested === \"function\"\n ? nested\n : undefined;\n}\n\nfunction installWritableDataProperty(\n target: object,\n key: PropertyKey,\n replacement: object,\n original: PropertyDescriptor | undefined = ownPropertyDescriptor(target, key),\n): (() => void) | undefined {\n if (original === undefined || !(\"value\" in original) || !original.writable) {\n return undefined;\n }\n\n try {\n Object.defineProperty(target, key, { ...original, value: replacement });\n } catch {\n return undefined;\n }\n\n return (): void => {\n try {\n if (ownPropertyDescriptor(target, key)?.value === replacement) {\n Object.defineProperty(target, key, original);\n }\n } catch {\n // A host or later wrapper can make the property non-configurable.\n }\n };\n}\n\nfunction recordWithoutAffectingHost(record: () => void): void {\n try {\n record();\n } catch {\n // Observation is optional; the host transport result is authoritative.\n }\n}\n\nexport function createDataFlowRuntime(\n config: RuntimeDataFlowConfig,\n target: MutableDataFlowGlobal = globalThis,\n): DataFlowRuntime {\n const componentRegistry = new WeakMap<object, DataFlowComponentRegistration>();\n const xhrMetadata = new WeakMap<object, XhrMetadata>();\n const store = createRingStore(config.limits, target);\n const nextInvocationId = createOpaqueSequence(\"invocation\");\n const nextObservationId = createOpaqueSequence(\"observation\");\n const pageEpoch = createOpaqueSequence(\"page\")();\n const nextRouteEpoch = createOpaqueSequence(\"route\");\n let routeEpoch = nextRouteEpoch();\n let routeKey: string | undefined;\n let currentInvocation: DataFlowInvocationToken | undefined;\n let currentRequestFrame: DataFlowRequestFrame | undefined;\n let disposed = false;\n\n const originalFetch = (() => {\n try {\n return target.fetch;\n } catch {\n return undefined;\n }\n })();\n function spotPatchFetch(\n this: typeof globalThis,\n input: RequestInfo | URL,\n init?: RequestInit,\n ): Promise<Response> {\n if (originalFetch === undefined) {\n throw new TypeError(\"Fetch is unavailable.\");\n }\n const result = Reflect.apply(originalFetch, this, [input, init]);\n recordWithoutAffectingHost(() => {\n const frame = currentRequestFrame;\n const token = frame?.invocationToken;\n const rawUrl = readFetchUrl(input);\n if (\n isSpotPatchInternalUrl(\n rawUrl,\n target.location?.href ?? \"http://spotpatch.invalid/\",\n )\n ) {\n return;\n }\n store.add(\n Object.freeze({\n schemaVersion: DATA_FLOW_SCHEMA_VERSION,\n id: nextObservationId(),\n pageEpoch,\n routeEpoch,\n ...(frame === undefined\n ? {}\n : {\n requestCallsiteId: frame.requestCallsiteId,\n sourceVersion: frame.sourceVersion,\n }),\n ...(token === undefined\n ? {}\n : {\n invocationId: token.invocationId,\n componentSourceId: token.componentSourceId,\n triggerCallsiteId: token.triggerCallsiteId,\n }),\n transport: \"fetch\",\n method: readFetchMethod(input, init),\n url: freezeUrl(rawUrl, target.location?.href ?? \"http://spotpatch.invalid/\"),\n outcome: \"dispatched\",\n freshness: \"current\",\n diagnosticIds: Object.freeze([]),\n }),\n );\n });\n return result;\n }\n\n const restoreFetch =\n originalFetch === undefined\n ? undefined\n : installWritableDataProperty(target, \"fetch\", spotPatchFetch);\n\n const xhrPrototype = (() => {\n try {\n return target.XMLHttpRequest?.prototype;\n } catch {\n return undefined;\n }\n })();\n const originalOpenDescriptor =\n xhrPrototype === undefined\n ? undefined\n : ownPropertyDescriptor(xhrPrototype, \"open\");\n const originalSendDescriptor =\n xhrPrototype === undefined\n ? undefined\n : ownPropertyDescriptor(xhrPrototype, \"send\");\n\n function spotPatchOpen(\n this: XMLHttpRequest,\n method: string,\n url: string | URL,\n ...rest: readonly unknown[]\n ): void {\n const original: unknown = originalOpenDescriptor?.value;\n if (typeof original === \"function\") {\n Reflect.apply(original, this, [method, url, ...rest]);\n }\n recordWithoutAffectingHost(() => {\n xhrMetadata.set(this, Object.freeze({ method, url: String(url) }));\n });\n }\n\n function spotPatchSend(\n this: XMLHttpRequest,\n body?: Document | XMLHttpRequestBodyInit | null,\n ): void {\n const original: unknown = originalSendDescriptor?.value;\n if (typeof original === \"function\") Reflect.apply(original, this, [body]);\n recordWithoutAffectingHost(() => {\n const metadata = xhrMetadata.get(this);\n if (\n metadata === undefined ||\n isSpotPatchInternalUrl(\n metadata.url,\n target.location?.href ?? \"http://spotpatch.invalid/\",\n )\n ) {\n return;\n }\n const frame = currentRequestFrame;\n const token = frame?.invocationToken;\n store.add(\n Object.freeze({\n schemaVersion: DATA_FLOW_SCHEMA_VERSION,\n id: nextObservationId(),\n pageEpoch,\n routeEpoch,\n ...(frame === undefined\n ? {}\n : {\n requestCallsiteId: frame.requestCallsiteId,\n sourceVersion: frame.sourceVersion,\n }),\n ...(token === undefined\n ? {}\n : {\n invocationId: token.invocationId,\n componentSourceId: token.componentSourceId,\n triggerCallsiteId: token.triggerCallsiteId,\n }),\n transport: \"xhr\",\n method: metadata.method.toUpperCase(),\n url: freezeUrl(\n metadata.url,\n target.location?.href ?? \"http://spotpatch.invalid/\",\n ),\n outcome: \"dispatched\",\n freshness: \"current\",\n diagnosticIds: Object.freeze([]),\n }),\n );\n });\n }\n\n const restoreXhrOpen =\n xhrPrototype === undefined || typeof originalOpenDescriptor?.value !== \"function\"\n ? undefined\n : installWritableDataProperty(\n xhrPrototype,\n \"open\",\n spotPatchOpen,\n originalOpenDescriptor,\n );\n const restoreXhrSend =\n xhrPrototype === undefined || typeof originalSendDescriptor?.value !== \"function\"\n ? undefined\n : installWritableDataProperty(\n xhrPrototype,\n \"send\",\n spotPatchSend,\n originalSendDescriptor,\n );\n\n const runtime: DataFlowRuntime = Object.freeze({\n beginInvocation(metadata: DataFlowTriggerMetadata): DataFlowInvocationToken {\n return Object.freeze({\n invocationId: nextInvocationId(),\n componentSourceId: metadata.componentSourceId,\n triggerCallsiteId: metadata.triggerCallsiteId,\n sourceVersion: metadata.sourceVersion,\n });\n },\n bindInvocation<Arguments extends readonly unknown[], Result>(\n token: DataFlowInvocationToken | undefined,\n callback: (...args: Arguments) => Result,\n ): (...args: Arguments) => Result {\n return function boundInvocation(this: unknown, ...args: Arguments): Result {\n return runtime.withInvocation(token, () => Reflect.apply(callback, this, args));\n };\n },\n bindTrigger<Callback>(\n metadata: DataFlowTriggerMetadata,\n callback: Callback,\n ): Callback {\n if (typeof callback !== \"function\") return callback;\n const callable = callback as (...args: readonly unknown[]) => unknown;\n return function boundTrigger(this: unknown, ...args: readonly unknown[]) {\n const token = runtime.beginInvocation(metadata);\n return runtime.withInvocation(token, () => Reflect.apply(callable, this, args));\n } as Callback;\n },\n captureInvocation: () => currentInvocation,\n clear: store.clear,\n createTrpcLink(): DataFlowTrpcLink {\n return () =>\n <Operation extends DataFlowTrpcOperation, Result>(\n options: DataFlowTrpcLinkOptions<Operation, Result>,\n ): Result => {\n recordWithoutAffectingHost(() => {\n const operation = options.op.path;\n const operationType = options.op.type;\n if (\n typeof operation !== \"string\" ||\n operation.length === 0 ||\n operation.length > 512 ||\n (operationType !== \"query\" &&\n operationType !== \"mutation\" &&\n operationType !== \"subscription\")\n ) {\n return;\n }\n const frame = currentRequestFrame;\n const token = frame?.invocationToken;\n store.add(\n Object.freeze({\n schemaVersion: DATA_FLOW_SCHEMA_VERSION,\n id: nextObservationId(),\n pageEpoch,\n routeEpoch,\n ...(frame === undefined\n ? {}\n : {\n requestCallsiteId: frame.requestCallsiteId,\n sourceVersion: frame.sourceVersion,\n }),\n ...(token === undefined\n ? {}\n : {\n invocationId: token.invocationId,\n componentSourceId: token.componentSourceId,\n triggerCallsiteId: token.triggerCallsiteId,\n }),\n transport: \"trpc\",\n method: operationType.toUpperCase(),\n operation,\n url: Object.freeze({\n pathname: operation,\n queryKeys: Object.freeze([]),\n }),\n outcome: \"dispatched\",\n freshness: \"current\",\n diagnosticIds: Object.freeze([]),\n }),\n );\n });\n return options.next(options.op);\n };\n },\n dispose(): void {\n if (disposed) return;\n disposed = true;\n store.clear();\n restoreFetch?.();\n restoreXhrOpen?.();\n restoreXhrSend?.();\n },\n getComponentRegistration: (component: object) => componentRegistry.get(component),\n getCurrentRequestFrame: () => currentRequestFrame,\n observations: () =>\n Object.freeze(\n store\n .values()\n .map((observation) =>\n observation.routeEpoch === routeEpoch\n ? observation\n : Object.freeze({ ...observation, freshness: \"stale-route\" as const }),\n ),\n ),\n registerComponent(\n component: object,\n componentSourceId: string,\n registeredSourceVersion: string,\n ): void {\n const registration = Object.freeze({\n componentSourceId,\n sourceVersion: registeredSourceVersion,\n });\n const pending = [component];\n const registered = new Set<object>();\n while (pending.length > 0) {\n const candidate = pending.pop();\n if (candidate === undefined || registered.has(candidate)) continue;\n registered.add(candidate);\n componentRegistry.set(candidate, registration);\n\n const nested = nestedReactWrapperComponent(candidate);\n if (nested !== undefined) pending.push(nested);\n }\n },\n updateRoute(nextRouteKey: string): void {\n if (routeKey === undefined) {\n routeKey = nextRouteKey;\n } else if (routeKey !== nextRouteKey) {\n routeKey = nextRouteKey;\n routeEpoch = nextRouteEpoch();\n }\n },\n withInvocation<Result>(\n token: DataFlowInvocationToken | undefined,\n callback: () => Result,\n ): Result {\n const parent = currentInvocation;\n currentInvocation = token;\n try {\n return callback();\n } finally {\n currentInvocation = parent;\n }\n },\n withRequestFrame<Result>(\n token: DataFlowInvocationToken | undefined,\n metadata: DataFlowRequestMetadata,\n callback: () => Result,\n ): Result {\n const parent = currentRequestFrame;\n currentRequestFrame = Object.freeze({\n requestCallsiteId: metadata.requestCallsiteId,\n sourceVersion: metadata.sourceVersion,\n ...(token === undefined ? {} : { invocationToken: token }),\n });\n try {\n return callback();\n } finally {\n currentRequestFrame = parent;\n }\n },\n });\n\n return runtime;\n}\n\nexport function installDataFlowPrelude(\n config: RuntimeDataFlowConfig,\n target: GlobalWithDataFlow = globalThis,\n): DataFlowRuntime | undefined {\n if (!config.enabled) return undefined;\n const runtime = target[RUNTIME_KEY] ?? createDataFlowRuntime(config, target);\n target[RUNTIME_KEY] = runtime;\n return runtime;\n}\n\nexport function getDataFlowRuntime(\n target: GlobalWithDataFlow = globalThis,\n): DataFlowRuntime | undefined {\n return target[RUNTIME_KEY];\n}\n","import {\n isSensitiveName,\n limitDataFlowReportCollections,\n type ComponentDataFlowReport,\n type DataDependency,\n type EvidenceRef,\n type NetworkObservation,\n type PageDataFlowReport,\n} from \"@spotpatch/shared\";\n\nfunction observationMatchesDependency(\n observation: NetworkObservation,\n dependency: DataDependency,\n): boolean {\n const origin = dependency.origin;\n const transportMatches =\n dependency.kind === \"rpc\"\n ? observation.transport === \"trpc\" &&\n dependency.operation !== undefined &&\n observation.operation === dependency.operation\n : dependency.kind === \"http\"\n ? observation.transport === \"fetch\" || observation.transport === \"xhr\"\n : false;\n if (\n !transportMatches ||\n observation.freshness !== \"current\" ||\n origin === undefined ||\n observation.requestCallsiteId !== origin.requestCallsiteId ||\n observation.sourceVersion !== origin.sourceVersion ||\n (dependency.method !== undefined &&\n observation.method.toUpperCase() !== dependency.method.toUpperCase()) ||\n (dependency.url !== undefined &&\n observation.url.pathname !== dependency.url.pathname) ||\n (dependency.url?.origin !== undefined &&\n observation.url.origin !== dependency.url.origin) ||\n (origin.componentSourceId !== undefined &&\n observation.componentSourceId !== undefined &&\n observation.componentSourceId !== origin.componentSourceId) ||\n (origin.triggerCallsiteId !== undefined &&\n observation.triggerCallsiteId !== undefined &&\n observation.triggerCallsiteId !== origin.triggerCallsiteId)\n ) {\n return false;\n }\n\n return (\n dependency.association !== \"transitive\" ||\n (observation.componentSourceId === origin.componentSourceId &&\n observation.triggerCallsiteId === origin.triggerCallsiteId)\n );\n}\n\nfunction runtimeEvidence(observation: NetworkObservation): EvidenceRef {\n return Object.freeze({\n id: observation.id,\n kind: \"runtime-observation\",\n summaryKey: \"dataFlow.evidence.runtimeDispatch\",\n });\n}\n\nfunction mergeDependencies(\n dependencies: readonly DataDependency[],\n observations: readonly NetworkObservation[],\n): Readonly<{\n dependencies: readonly DataDependency[];\n matchedObservationIds: ReadonlySet<string>;\n}> {\n const matchedObservationIds = new Set<string>();\n const merged = dependencies.map((dependency) => {\n const matches = observations.filter((observation) =>\n observationMatchesDependency(observation, dependency),\n );\n for (const observation of matches) matchedObservationIds.add(observation.id);\n if (matches.length === 0) return dependency;\n const observedOrigins = [\n ...new Set(\n matches.flatMap(({ url }) => (url.origin === undefined ? [] : [url.origin])),\n ),\n ];\n const observedOrigin =\n observedOrigins.length === 1 ? observedOrigins[0] : undefined;\n return Object.freeze({\n ...dependency,\n ...(dependency.url === undefined ||\n dependency.url.origin !== undefined ||\n observedOrigin === undefined\n ? {}\n : {\n url: Object.freeze({\n ...dependency.url,\n origin: observedOrigin,\n }),\n }),\n execution: \"observed\" as const,\n observationIds: Object.freeze([\n ...new Set([...dependency.observationIds, ...matches.map(({ id }) => id)]),\n ]),\n evidenceIds: Object.freeze([\n ...new Set([...dependency.evidenceIds, ...matches.map(({ id }) => id)]),\n ]),\n });\n });\n return Object.freeze({\n dependencies: Object.freeze(merged),\n matchedObservationIds,\n });\n}\n\nfunction appendRuntimeEvidence(\n evidence: readonly EvidenceRef[],\n observations: readonly NetworkObservation[],\n matchedIds: ReadonlySet<string>,\n): readonly EvidenceRef[] {\n const existing = new Set(evidence.map(({ id }) => id));\n return Object.freeze([\n ...evidence,\n ...observations.flatMap((observation) =>\n matchedIds.has(observation.id) && !existing.has(observation.id)\n ? [runtimeEvidence(observation)]\n : [],\n ),\n ]);\n}\n\nexport function mergeComponentDataFlowReport(\n report: ComponentDataFlowReport,\n observations: readonly NetworkObservation[],\n): ComponentDataFlowReport {\n const componentObservations = observations.filter(\n (observation) =>\n observation.componentSourceId === undefined ||\n observation.componentSourceId === report.component.componentSourceId,\n );\n const merged = mergeDependencies(report.dependencies, componentObservations);\n return limitDataFlowReportCollections(\n Object.freeze({\n ...report,\n dependencies: merged.dependencies,\n evidence: appendRuntimeEvidence(\n report.evidence,\n componentObservations,\n merged.matchedObservationIds,\n ),\n }),\n { mode: \"observation\" },\n );\n}\n\nfunction unassignedDependency(observation: NetworkObservation): DataDependency {\n const isRpc = observation.transport === \"trpc\";\n return Object.freeze({\n id: observation.id,\n kind: isRpc ? \"rpc\" : \"http\",\n direction:\n observation.method === \"GET\" ||\n observation.method === \"HEAD\" ||\n observation.method === \"QUERY\" ||\n observation.method === \"SUBSCRIPTION\"\n ? \"read\"\n : \"write\",\n execution: \"observed\",\n proof: \"unavailable\",\n association: \"unassigned\",\n method: observation.method,\n ...(isRpc\n ? observation.operation === undefined\n ? {}\n : { operation: observation.operation }\n : { url: observation.url }),\n parameters: Object.freeze(\n (isRpc ? [] : observation.url.queryKeys).map((path) =>\n Object.freeze({\n path,\n position: \"query\" as const,\n sensitive: isSensitiveName(path),\n valueState: \"not-collected\" as const,\n evidenceIds: Object.freeze([observation.id]),\n }),\n ),\n ),\n response: Object.freeze({\n consumedFields: Object.freeze([]),\n }),\n suppliedBindings: Object.freeze([]),\n locationIds: Object.freeze([]),\n evidenceIds: Object.freeze([observation.id]),\n observationIds: Object.freeze([observation.id]),\n });\n}\n\nexport function mergePageDataFlowReport(\n report: PageDataFlowReport,\n observations: readonly NetworkObservation[],\n): PageDataFlowReport {\n const currentObservations = observations.filter(\n ({ freshness }) => freshness === \"current\",\n );\n const merged = mergeDependencies(report.dependencies, currentObservations);\n const unassigned = currentObservations\n .filter(({ id }) => !merged.matchedObservationIds.has(id))\n .map(unassignedDependency);\n const allObservationIds = new Set(currentObservations.map(({ id }) => id));\n return limitDataFlowReportCollections(\n Object.freeze({\n ...report,\n dependencies: Object.freeze([...merged.dependencies, ...unassigned]),\n evidence: appendRuntimeEvidence(\n report.evidence,\n currentObservations,\n allObservationIds,\n ),\n }),\n { mode: \"observation\" },\n );\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AA8GP,IAAM,cAA6B,uBAAO;AAAA,EACxC;AACF;AACA,IAAM,kBAAkB,uBAAO,IAAI,YAAY;AAC/C,IAAM,yBAAyB,uBAAO,IAAI,mBAAmB;AAK7D,SAAS,YAAY,QAAgC;AACnD,SAAO,OAAO,aAAa,IAAI,KAAK,KAAK,IAAI;AAC/C;AAEA,SAAS,qBAAqB,QAA8B;AAC1D,MAAI,WAAW;AACf,QAAM,gBAAgB,MAAM;AAC1B,QAAI;AACF,YAAM,QAAQ,IAAI,WAAW,CAAC;AAC9B,iBAAW,OAAO,gBAAgB,KAAK;AACvC,aAAO,MAAM,KAAK,OAAO,CAAC,UAAU,MAAM,SAAS,EAAE,EAAE,SAA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