@spotpatch/runtime 1.11.0 → 1.13.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-BXRMVHNT.js → chunk-ASRUAKA5.js} +1 -1
- package/dist/chunk-ASRUAKA5.js.map +1 -0
- package/dist/{chunk-7ES63LA7.js → chunk-P6X75LO5.js} +11 -1
- package/dist/chunk-P6X75LO5.js.map +1 -0
- package/dist/chunk-P7W3F4UA.js +115 -0
- package/dist/chunk-P7W3F4UA.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 +171 -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 +27 -1
- 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/external-handoff-panel.cjs +29 -9
- package/dist/external-handoff-panel.cjs.map +1 -1
- package/dist/external-handoff-panel.d.cts +3 -3
- package/dist/external-handoff-panel.d.ts +3 -3
- package/dist/external-handoff-panel.js +22 -11
- package/dist/external-handoff-panel.js.map +1 -1
- package/dist/index.cjs +1204 -279
- 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 +1164 -355
- package/dist/index.js.map +1 -1
- package/dist/motion.cjs +1251 -0
- package/dist/motion.cjs.map +1 -0
- package/dist/motion.d.cts +79 -0
- package/dist/motion.d.ts +79 -0
- package/dist/motion.js +1092 -0
- package/dist/motion.js.map +1 -0
- package/package.json +19 -4
- package/dist/chunk-7ES63LA7.js.map +0 -1
- package/dist/chunk-BXRMVHNT.js.map +0 -1
- package/dist/chunk-QY5T4DPA.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/motion-controller.ts","../src/ui/execution-island.ts","../src/motion-entry.ts"],"sourcesContent":["import { gsap } from \"gsap\";\n\nimport type {\n FloatingSurfaceMotionController,\n FloatingSurfaceMotionElements,\n FloatingSurfaceProjection,\n} from \"./motion-extension-contract.js\";\n\nconst MOTION = Object.freeze({\n contentMilliseconds: 220,\n detailRevealDelaySeconds: 0.1,\n detailRevealSeconds: 0.3,\n detailRetireSeconds: 0.15,\n dispatchSeconds: 0.54,\n expandSeconds: 0.54,\n morphSeconds: 0.48,\n pressSeconds: 0.12,\n revealSeconds: 0.26,\n sceneRevealDelaySeconds: 0.06,\n sweepSeconds: 0.68,\n targetFeedbackDelaySeconds: 0.08,\n targetFeedbackSeconds: 0.22,\n});\n\nconst ISLAND_SIZE = Object.freeze({\n checkingWidth: 440,\n compactHeight: 62,\n dispatchingWidth: 448,\n expandedHeight: 164,\n expandedWidth: 520,\n failedWidth: 440,\n receivingWidth: 430,\n runningWidth: 468,\n successWidth: 356,\n});\n\ninterface PendingProjection {\n readonly projection: FloatingSurfaceProjection;\n readonly renderContent: () => void;\n}\n\ninterface SurfaceGeometry {\n readonly borderRadius: string;\n readonly rect: DOMRect;\n}\n\ninterface ElementOffset {\n readonly x: number;\n readonly y: number;\n}\n\ninterface SurfaceLayout {\n readonly geometry: SurfaceGeometry;\n readonly sharedOffsets: ReadonlyMap<HTMLElement, ElementOffset>;\n}\n\ntype DetailTransition = \"collapse\" | \"expand\" | undefined;\n\ntype SurfaceLayer = \"execution\" | \"pill\" | \"planner\";\n\nfunction surfaceLayer(scene: FloatingSurfaceProjection[\"scene\"]): SurfaceLayer {\n if (scene === \"pill\" || scene === \"capturing\") return \"pill\";\n if (scene === \"planner\") return \"planner\";\n return \"execution\";\n}\n\nfunction setSceneVisibility(\n elements: FloatingSurfaceMotionElements,\n projection: FloatingSurfaceProjection,\n): HTMLElement {\n const pillActive = projection.scene === \"pill\" || projection.scene === \"capturing\";\n const plannerActive = projection.scene === \"planner\";\n const executionActive = !pillActive && !plannerActive;\n\n elements.pill.hidden = !pillActive;\n elements.pill.inert = !pillActive;\n elements.planner.hidden = !plannerActive;\n elements.planner.inert = !plannerActive;\n elements.planner.setAttribute(\"aria-hidden\", String(!plannerActive));\n elements.execution.root.hidden = !executionActive;\n elements.execution.root.inert = !executionActive;\n elements.execution.root.setAttribute(\"aria-hidden\", String(!executionActive));\n\n return pillActive\n ? elements.pill\n : plannerActive\n ? elements.planner\n : elements.execution.root;\n}\n\nfunction supportsMotion(document: Document): boolean {\n return (\n document.defaultView?.matchMedia(\"(prefers-reduced-motion: reduce)\").matches !==\n true\n );\n}\n\nfunction finiteRect(rect: DOMRect): boolean {\n return (\n Number.isFinite(rect.left) &&\n Number.isFinite(rect.top) &&\n rect.width > 0 &&\n rect.height > 0\n );\n}\n\nfunction geometryChanged(previous: DOMRect, next: DOMRect): boolean {\n return (\n Math.abs(previous.left - next.left) > 0.5 ||\n Math.abs(previous.top - next.top) > 0.5 ||\n Math.abs(previous.width - next.width) > 0.5 ||\n Math.abs(previous.height - next.height) > 0.5\n );\n}\n\nfunction visibleBorderRadius(value: string | undefined, rect: DOMRect): string {\n if (value === undefined || value.length === 0) return \"0px\";\n const radius = Number.parseFloat(value);\n if (!Number.isFinite(radius) || !finiteRect(rect)) return value;\n return `${String(Math.min(radius, rect.width / 2, rect.height / 2))}px`;\n}\n\nfunction compactIslandWidth(projection: FloatingSurfaceProjection): number {\n if (projection.scene === \"agent-charging\") return ISLAND_SIZE.receivingWidth;\n if (projection.scene === \"handoff\") return ISLAND_SIZE.dispatchingWidth;\n if (projection.scene === \"success\") return ISLAND_SIZE.successWidth;\n if (projection.scene === \"failed\") return ISLAND_SIZE.failedWidth;\n if (projection.scene === \"running\" && projection.activity?.kind === \"check\") {\n return ISLAND_SIZE.checkingWidth;\n }\n return ISLAND_SIZE.runningWidth;\n}\n\nexport function createFloatingSurfaceMotionStyles(\n document: Document,\n): HTMLStyleElement {\n const style = document.createElement(\"style\");\n style.textContent = `\n .spotpatch-floating-surface {\n --spotpatch-island-surface: #050608;\n --spotpatch-island-primary: #f7f7fb;\n --spotpatch-island-subtle: #5f646e;\n --spotpatch-island-line: rgb(255 255 255 / 10%);\n --spotpatch-island-violet: #8b67ff;\n --spotpatch-island-cyan: #4dc8ff;\n --spotpatch-island-mint: #59dcb6;\n --spotpatch-island-error: #ef6f88;\n --spotpatch-island-compact-height: ${String(ISLAND_SIZE.compactHeight)}px;\n --spotpatch-island-compact-width: ${String(ISLAND_SIZE.runningWidth)}px;\n --spotpatch-island-expanded-height: ${String(ISLAND_SIZE.expandedHeight)}px;\n --spotpatch-island-expanded-width: ${String(ISLAND_SIZE.expandedWidth)}px;\n --spotpatch-island-ease: cubic-bezier(.22, 1, .36, 1);\n position: fixed;\n box-sizing: border-box;\n color-scheme: dark;\n -webkit-font-smoothing: antialiased;\n overflow: hidden;\n border: 1px solid var(--spotpatch-island-line);\n background:\n linear-gradient(180deg, rgb(255 255 255 / 2.8%), transparent 24%),\n rgb(5 6 8 / 98.8%);\n box-shadow:\n 0 24px 60px rgb(13 17 28 / 18%),\n 0 3px 10px rgb(13 17 28 / 10%),\n inset 0 1px rgb(255 255 255 / 6.5%),\n inset 0 0 0 1px rgb(255 255 255 / 1.2%);\n transform-origin: 100% 100%;\n }\n .spotpatch-floating-surface::before {\n position: absolute;\n z-index: 0;\n inset: 0;\n background:\n radial-gradient(180px 70px at 0% 50%, rgb(139 103 255 / 7%), transparent 72%),\n radial-gradient(180px 70px at 100% 50%, rgb(77 200 255 / 4.5%), transparent 72%);\n content: \"\";\n opacity: 0;\n pointer-events: none;\n }\n .spotpatch-floating-surface[data-scene=\"pill\"],\n .spotpatch-floating-surface[data-scene=\"capturing\"] {\n width: max-content;\n border-radius: 999px;\n }\n .spotpatch-floating-surface[data-scene=\"planner\"] { border-radius: 18px; }\n .spotpatch-floating-surface[data-scene=\"agent-charging\"],\n .spotpatch-floating-surface[data-scene=\"handoff\"],\n .spotpatch-floating-surface[data-scene=\"running\"],\n .spotpatch-floating-surface[data-scene=\"success\"],\n .spotpatch-floating-surface[data-scene=\"failed\"] {\n width: min(var(--spotpatch-island-compact-width), calc(100vw - 32px));\n height: var(--spotpatch-island-compact-height);\n max-width: calc(100vw - 32px);\n border-radius: 31px;\n }\n .spotpatch-floating-surface[data-scene=\"agent-charging\"]::before,\n .spotpatch-floating-surface[data-scene=\"handoff\"]::before,\n .spotpatch-floating-surface[data-scene=\"running\"]::before,\n .spotpatch-floating-surface[data-scene=\"success\"]::before,\n .spotpatch-floating-surface[data-scene=\"failed\"]::before { opacity: .82; }\n .spotpatch-floating-surface:has(.spotpatch-execution-island[data-expanded=\"true\"]) {\n width: min(var(--spotpatch-island-expanded-width), calc(100vw - 32px));\n height: min(var(--spotpatch-island-expanded-height), calc(100vh - 32px));\n border-radius: 30px;\n }\n .spotpatch-floating-surface > .spotpatch-trigger,\n .spotpatch-floating-surface > .spotpatch-dialog,\n .spotpatch-floating-surface > .spotpatch-execution-island {\n position: relative;\n z-index: 1;\n }\n .spotpatch-floating-surface > .spotpatch-trigger {\n display: inline-flex;\n min-height: 44px;\n align-items: center;\n gap: 10px;\n border: 0;\n border-radius: 999px;\n padding: 10px 17px;\n color: #f8fafc;\n background: transparent;\n box-shadow: none;\n cursor: pointer;\n font-size: 14px;\n font-weight: 650;\n touch-action: none;\n user-select: none;\n }\n .spotpatch-trigger::before {\n width: 9px;\n height: 9px;\n border-radius: 999px;\n background: var(--spotpatch-accent);\n box-shadow: 0 0 0 4px rgb(99 102 241 / 10%);\n content: \"\";\n }\n .spotpatch-trigger:hover { transform: translateY(-1px); }\n .spotpatch-trigger[aria-pressed=\"true\"] { background: rgb(139 123 255 / 14%); }\n .spotpatch-trigger[aria-pressed=\"true\"]::before {\n animation: spotpatch-motion-pill-pulse 1.8s ease-in-out infinite;\n }\n .spotpatch-trigger[data-dragging=\"true\"] {\n cursor: grabbing;\n transform: scale(.98);\n }\n .spotpatch-floating-surface .spotpatch-dialog { filter: none; }\n .spotpatch-floating-surface .spotpatch-shell {\n border: 0;\n border-radius: 0;\n background: transparent;\n box-shadow: none;\n }\n .spotpatch-brand-name {\n color: #fff;\n font-size: 13.5px;\n font-weight: 680;\n letter-spacing: -.01em;\n }\n .spotpatch-brand-context {\n color: #8e98aa;\n font-size: 10.5px;\n font-weight: 560;\n letter-spacing: .02em;\n }\n .spotpatch-title {\n margin: 0;\n color: #fff;\n font-size: 18px;\n font-weight: 680;\n letter-spacing: -.015em;\n }\n .spotpatch-subtitle {\n max-width: 390px;\n margin: 4px 0 0;\n color: var(--spotpatch-text-secondary);\n font-size: 12.5px;\n line-height: 1.5;\n }\n .spotpatch-execution-island {\n position: relative;\n display: grid;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n grid-template-columns: auto minmax(0, 1fr) auto;\n align-items: center;\n gap: 12px;\n overflow: hidden;\n border: 0;\n border-radius: inherit;\n padding: 0 18px;\n color: var(--spotpatch-island-primary);\n background: transparent;\n cursor: pointer;\n text-align: left;\n touch-action: none;\n }\n .spotpatch-execution-island[data-expanded=\"true\"] {\n min-height: var(--spotpatch-island-expanded-height);\n grid-template-columns: auto minmax(0, 1fr) auto;\n grid-template-rows: auto 1fr;\n align-items: start;\n row-gap: 16px;\n border-radius: 30px;\n padding: 18px 20px 16px;\n }\n .spotpatch-execution-mark {\n display: grid;\n width: 23px;\n height: 23px;\n flex: none;\n place-items: center;\n }\n .spotpatch-execution-logo {\n width: 22px;\n height: 22px;\n overflow: visible;\n filter: drop-shadow(0 0 7px rgb(139 103 255 / 16%));\n }\n .spotpatch-execution-content {\n display: flex;\n min-width: 0;\n align-items: baseline;\n gap: 8px;\n }\n [data-expanded=\"true\"] .spotpatch-execution-content {\n display: grid;\n gap: 4px;\n }\n .spotpatch-execution-headline-wrap,\n .spotpatch-execution-action-wrap {\n position: relative;\n display: block;\n min-width: 0;\n }\n .spotpatch-execution-headline,\n .spotpatch-execution-headline-outgoing,\n .spotpatch-execution-action,\n .spotpatch-execution-action-outgoing {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .spotpatch-execution-headline,\n .spotpatch-execution-headline-outgoing {\n color: var(--spotpatch-island-primary);\n font-size: 15px;\n font-weight: 690;\n letter-spacing: -.018em;\n line-height: 1.35;\n }\n .spotpatch-execution-action,\n .spotpatch-execution-action-outgoing {\n color: #696f79;\n font-size: 11px;\n font-weight: 400;\n line-height: 1.35;\n }\n .spotpatch-execution-headline-outgoing,\n .spotpatch-execution-action-outgoing {\n position: absolute;\n inset: 0;\n opacity: 0;\n pointer-events: none;\n }\n .spotpatch-execution-copy-changing .spotpatch-execution-headline,\n .spotpatch-execution-copy-changing .spotpatch-execution-action {\n animation: spotpatch-motion-copy-in ${String(MOTION.contentMilliseconds)}ms var(--spotpatch-island-ease) both;\n }\n .spotpatch-execution-copy-changing .spotpatch-execution-headline-outgoing,\n .spotpatch-execution-copy-changing .spotpatch-execution-action-outgoing {\n animation: spotpatch-motion-copy-out ${String(MOTION.contentMilliseconds)}ms ease-in both;\n }\n .spotpatch-execution-meta {\n display: inline-flex;\n align-items: center;\n justify-content: flex-end;\n gap: 10px;\n flex: none;\n color: #989da8;\n font-size: 11px;\n font-weight: 620;\n white-space: nowrap;\n }\n .spotpatch-execution-meta-dot {\n width: 6px;\n height: 6px;\n flex: none;\n border-radius: 50%;\n background: var(--spotpatch-island-violet);\n box-shadow: 0 0 8px rgb(139 103 255 / 38%);\n }\n [data-execution-scene=\"agent-charging\"] .spotpatch-execution-meta-dot,\n [data-execution-scene=\"handoff\"] .spotpatch-execution-meta-dot,\n [data-execution-scene=\"running\"] .spotpatch-execution-meta-dot {\n animation: spotpatch-motion-status-breathe 1.8s ease-in-out infinite;\n }\n .spotpatch-execution-meta[data-tone=\"success\"] .spotpatch-execution-meta-dot {\n background: var(--spotpatch-island-mint);\n box-shadow: 0 0 8px rgb(89 220 182 / 24%);\n }\n .spotpatch-execution-meta[data-tone=\"danger\"] .spotpatch-execution-meta-dot {\n background: var(--spotpatch-island-error);\n box-shadow: 0 0 8px rgb(239 111 136 / 22%);\n }\n .spotpatch-execution-timer {\n width: 34px;\n color: #737985;\n font: 400 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;\n text-align: right;\n }\n .spotpatch-execution-more {\n display: grid;\n width: 24px;\n height: 24px;\n padding: 0;\n border: 0;\n background: transparent;\n color: #686e78;\n font-size: 15px;\n line-height: 1;\n place-items: center;\n }\n [data-expanded=\"true\"] .spotpatch-execution-meta-dot,\n [data-expanded=\"true\"] .spotpatch-execution-meta-label,\n [data-expanded=\"true\"] .spotpatch-execution-timer { display: none; }\n [data-expanded=\"true\"] .spotpatch-execution-more {\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgb(255 255 255 / 4.5%);\n color: #828894;\n }\n .spotpatch-execution-recent {\n position: absolute;\n top: 62px;\n right: 20px;\n left: 20px;\n display: grid;\n margin-top: 0;\n }\n .spotpatch-execution-recent[hidden] { display: none; }\n .spotpatch-execution-recent-item {\n display: grid;\n min-height: 28px;\n grid-template-columns: 52px minmax(0, 1fr) auto;\n align-items: center;\n border-top: 1px solid rgb(255 255 255 / 5.5%);\n }\n .spotpatch-execution-recent-item:first-child { border-top: 0; }\n .spotpatch-execution-recent-kind {\n color: #666c76;\n font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;\n text-transform: uppercase;\n }\n .spotpatch-execution-recent-detail {\n overflow: hidden;\n color: #b2b6bf;\n font-size: 11px;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .spotpatch-execution-recent-state {\n color: #626974;\n font: 500 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;\n }\n .spotpatch-execution-recent-item[data-state=\"active\"] .spotpatch-execution-recent-kind {\n color: var(--spotpatch-island-violet);\n }\n .spotpatch-execution-recent-item[data-state=\"active\"] .spotpatch-execution-recent-detail {\n color: #f2f3f7;\n }\n .spotpatch-execution-recent-item[data-state=\"failure\"] .spotpatch-execution-recent-kind {\n color: var(--spotpatch-island-error);\n }\n .spotpatch-island-sweep {\n position: absolute;\n z-index: 2;\n bottom: 0;\n left: 44px;\n width: 20%;\n height: 1px;\n border-radius: 999px;\n background: linear-gradient(90deg, transparent, var(--spotpatch-island-violet), var(--spotpatch-island-cyan), transparent);\n box-shadow: 0 0 7px rgb(139 103 255 / 18%);\n opacity: 0;\n pointer-events: none;\n transform: translate3d(-160%, 0, 0);\n }\n @keyframes spotpatch-motion-copy-in {\n from { opacity: 0; filter: blur(2px); transform: translate3d(0, 3px, 0); }\n to { opacity: 1; filter: blur(0); transform: translate3d(0, 0, 0); }\n }\n @keyframes spotpatch-motion-copy-out {\n from { opacity: 1; filter: blur(0); transform: translate3d(0, 0, 0); }\n to { opacity: 0; filter: blur(2px); transform: translate3d(0, -3px, 0); }\n }\n @keyframes spotpatch-motion-status-breathe {\n 50% { opacity: .42; transform: scale(.82); }\n }\n @keyframes spotpatch-motion-pill-pulse {\n 50% { box-shadow: 0 0 0 6px rgb(99 102 241 / 5%); opacity: .72; }\n }\n .spotpatch-floating-surface[data-motion-paused=\"true\"] .spotpatch-execution-meta-dot,\n .spotpatch-floating-surface[data-motion-paused=\"true\"] .spotpatch-trigger::before {\n animation-play-state: paused;\n }\n @media (prefers-reduced-motion: reduce) {\n .spotpatch-trigger::before,\n .spotpatch-execution-meta-dot,\n .spotpatch-execution-headline,\n .spotpatch-execution-headline-outgoing,\n .spotpatch-execution-action,\n .spotpatch-execution-action-outgoing {\n animation: none !important;\n filter: none !important;\n transform: none !important;\n }\n .spotpatch-island-sweep { display: none; }\n }\n @media (max-width: 520px) {\n .spotpatch-execution-island {\n grid-template-columns: auto minmax(0, 1fr) auto;\n gap: 10px;\n padding-right: 14px;\n padding-left: 14px;\n }\n .spotpatch-execution-action-wrap { display: none; }\n .spotpatch-execution-recent-item { grid-template-columns: 48px minmax(0, 1fr); }\n .spotpatch-execution-recent-state { display: none; }\n }\n `;\n return style;\n}\n\nexport function createFloatingSurfaceMotionController(\n document: Document,\n elements: FloatingSurfaceMotionElements,\n reconcile: () => void,\n): FloatingSurfaceMotionController {\n let currentScene: FloatingSurfaceProjection[\"scene\"] | undefined;\n let currentActivityKey: string | undefined;\n let morphTimeline: gsap.core.Timeline | undefined;\n let dispatchTimeline: gsap.core.Timeline | undefined;\n let pendingProjection: PendingProjection | undefined;\n let dispatchSource: HTMLElement | undefined;\n let dispatchTarget: HTMLElement | undefined;\n let disposed = false;\n\n const handleVisibility = (): void => {\n elements.surface.dataset.motionPaused = String(document.hidden);\n };\n document.addEventListener(\"visibilitychange\", handleVisibility);\n handleVisibility();\n\n const morphElements = [\n elements.surface,\n elements.pill,\n elements.planner,\n elements.execution.root,\n elements.execution.mark,\n elements.execution.content,\n elements.execution.meta,\n elements.execution.recent,\n ];\n\n const sharedExecutionElements = [\n elements.execution.mark,\n elements.execution.content,\n elements.execution.meta,\n ];\n\n function captureSurfaceLayout(includeSharedOffsets = false): SurfaceLayout {\n const surfaceRect = elements.surface.getBoundingClientRect();\n const computedRadius = document.defaultView\n ?.getComputedStyle(elements.surface)\n .borderRadius.trim();\n\n const sharedOffsets = new Map<HTMLElement, ElementOffset>();\n if (includeSharedOffsets && finiteRect(surfaceRect)) {\n for (const element of sharedExecutionElements) {\n const elementRect = element.getBoundingClientRect();\n if (!finiteRect(elementRect)) continue;\n sharedOffsets.set(\n element,\n Object.freeze({\n x: elementRect.left - surfaceRect.left,\n y: elementRect.top - surfaceRect.top,\n }),\n );\n }\n }\n\n return Object.freeze({\n geometry: Object.freeze({\n borderRadius: visibleBorderRadius(computedRadius, surfaceRect),\n rect: surfaceRect,\n }),\n sharedOffsets,\n });\n }\n\n function syncRecentVisibility(): void {\n elements.execution.recent.hidden =\n elements.execution.root.dataset.expanded !== \"true\";\n }\n\n function clearMorphProperties(): void {\n gsap.set(morphElements, {\n clearProps:\n \"borderRadius,filter,height,opacity,transform,visibility,width,willChange\",\n });\n delete elements.surface.dataset.motionMorphing;\n syncRecentVisibility();\n }\n\n function clearMorph(): void {\n morphTimeline?.kill();\n morphTimeline = undefined;\n gsap.killTweensOf(morphElements);\n clearMorphProperties();\n }\n\n function interruptMorph(includeSharedOffsets = false): SurfaceLayout {\n morphTimeline?.kill();\n morphTimeline = undefined;\n gsap.killTweensOf(morphElements);\n const layout = captureSurfaceLayout(includeSharedOffsets);\n clearMorphProperties();\n return layout;\n }\n\n function clearDispatch(): void {\n dispatchTimeline?.kill();\n dispatchTimeline = undefined;\n if (dispatchSource !== undefined) {\n gsap.killTweensOf(dispatchSource);\n gsap.set(dispatchSource, { clearProps: \"filter,transform\" });\n dispatchSource = undefined;\n }\n if (dispatchTarget !== undefined) {\n gsap.killTweensOf(dispatchTarget);\n gsap.set(dispatchTarget, { clearProps: \"boxShadow\" });\n dispatchTarget = undefined;\n }\n elements.surface.dataset.agentCharging = \"false\";\n }\n\n function completeDispatch(): void {\n dispatchTimeline = undefined;\n if (dispatchSource !== undefined) {\n gsap.set(dispatchSource, { clearProps: \"filter,transform\" });\n dispatchSource = undefined;\n }\n if (dispatchTarget !== undefined) {\n gsap.set(dispatchTarget, { clearProps: \"boxShadow\" });\n dispatchTarget = undefined;\n }\n elements.surface.dataset.agentCharging = \"false\";\n }\n\n function sweepOnce(): void {\n if (!supportsMotion(document) || document.hidden) return;\n gsap.killTweensOf(elements.execution.sweep);\n gsap.fromTo(\n elements.execution.sweep,\n { autoAlpha: 0, xPercent: -160 },\n {\n autoAlpha: 0.72,\n xPercent: 620,\n duration: MOTION.sweepSeconds,\n ease: \"power2.inOut\",\n onComplete: () => {\n gsap.set(elements.execution.sweep, {\n clearProps: \"opacity,transform,visibility\",\n });\n },\n },\n );\n }\n\n function animateGeometry(\n previous: SurfaceLayout,\n next: SurfaceLayout,\n activeScene: HTMLElement,\n reveal: boolean,\n detailTransition?: DetailTransition,\n ): void {\n const geometryHasChanged =\n geometryChanged(previous.geometry.rect, next.geometry.rect) ||\n previous.geometry.borderRadius !== next.geometry.borderRadius;\n const sharedLayoutHasChanged = sharedExecutionElements.some((element) => {\n const previousOffset = previous.sharedOffsets.get(element);\n const nextOffset = next.sharedOffsets.get(element);\n return (\n previousOffset !== undefined &&\n nextOffset !== undefined &&\n (Math.abs(previousOffset.x - nextOffset.x) > 0.5 ||\n Math.abs(previousOffset.y - nextOffset.y) > 0.5)\n );\n });\n\n if (\n !supportsMotion(document) ||\n !finiteRect(previous.geometry.rect) ||\n !finiteRect(next.geometry.rect) ||\n (!geometryHasChanged && !sharedLayoutHasChanged && detailTransition === undefined)\n ) {\n clearMorphProperties();\n return;\n }\n\n const morphDuration =\n detailTransition === \"expand\" ? MOTION.expandSeconds : MOTION.morphSeconds;\n elements.surface.dataset.motionMorphing = \"true\";\n morphTimeline = gsap.timeline({\n defaults: { overwrite: \"auto\" },\n onComplete: () => {\n clearMorphProperties();\n reconcile();\n morphTimeline = undefined;\n },\n });\n\n if (geometryHasChanged) {\n morphTimeline.fromTo(\n elements.surface,\n {\n borderRadius: previous.geometry.borderRadius,\n height: previous.geometry.rect.height,\n width: previous.geometry.rect.width,\n x: previous.geometry.rect.left - next.geometry.rect.left,\n y: previous.geometry.rect.top - next.geometry.rect.top,\n willChange: \"width,height,transform\",\n },\n {\n borderRadius: next.geometry.borderRadius,\n height: next.geometry.rect.height,\n width: next.geometry.rect.width,\n x: 0,\n y: 0,\n duration: morphDuration,\n ease: \"expo.inOut\",\n },\n 0,\n );\n }\n\n for (const element of sharedExecutionElements) {\n const previousOffset = previous.sharedOffsets.get(element);\n const nextOffset = next.sharedOffsets.get(element);\n if (previousOffset === undefined || nextOffset === undefined) continue;\n const x = previousOffset.x - nextOffset.x;\n const y = previousOffset.y - nextOffset.y;\n if (Math.abs(x) <= 0.5 && Math.abs(y) <= 0.5) continue;\n morphTimeline.fromTo(\n element,\n { x, y, willChange: \"transform\" },\n {\n x: 0,\n y: 0,\n duration: morphDuration,\n ease: \"expo.inOut\",\n },\n 0,\n );\n }\n\n if (detailTransition === \"expand\") {\n morphTimeline.fromTo(\n elements.execution.recent,\n { autoAlpha: 0, filter: \"blur(4px)\", y: 6 },\n {\n autoAlpha: 1,\n filter: \"blur(0px)\",\n y: 0,\n duration: MOTION.detailRevealSeconds,\n ease: \"power3.out\",\n },\n MOTION.detailRevealDelaySeconds,\n );\n } else if (detailTransition === \"collapse\") {\n morphTimeline.fromTo(\n elements.execution.recent,\n { autoAlpha: 1, filter: \"blur(0px)\", y: 0 },\n {\n autoAlpha: 0,\n filter: \"blur(3px)\",\n y: -4,\n duration: MOTION.detailRetireSeconds,\n ease: \"power2.in\",\n },\n 0,\n );\n }\n\n if (reveal) {\n morphTimeline.fromTo(\n activeScene,\n { autoAlpha: 0, y: 4 },\n {\n autoAlpha: 1,\n y: 0,\n duration: MOTION.revealSeconds,\n ease: \"power2.out\",\n clearProps: \"transform,opacity,visibility\",\n },\n MOTION.sceneRevealDelaySeconds,\n );\n }\n }\n\n function applyProjection(\n projection: FloatingSurfaceProjection,\n renderContent: () => void,\n ): void {\n if (disposed) return;\n const previousScene = currentScene;\n const sceneChanged = previousScene !== projection.scene;\n const layerChanged =\n previousScene === undefined ||\n surfaceLayer(previousScene) !== surfaceLayer(projection.scene);\n const wasExpanded = elements.execution.root.dataset.expanded === \"true\";\n const executionRemainsActive =\n previousScene !== undefined &&\n surfaceLayer(previousScene) === \"execution\" &&\n surfaceLayer(projection.scene) === \"execution\";\n const preserveInterruptedSharedLayout =\n executionRemainsActive && (wasExpanded || morphTimeline?.isActive() === true);\n const previousGeometry = interruptMorph(preserveInterruptedSharedLayout);\n const activityChanged = currentActivityKey !== projection.activity?.key;\n\n elements.surface.dataset.scene = projection.scene;\n elements.surface.dataset.tone = projection.tone;\n elements.surface.style.setProperty(\n \"--spotpatch-island-compact-width\",\n `${String(compactIslandWidth(projection))}px`,\n );\n renderContent();\n const activeScene = setSceneVisibility(elements, projection);\n const isExpanded = elements.execution.root.dataset.expanded === \"true\";\n const detailTransition: DetailTransition =\n executionRemainsActive && wasExpanded && !isExpanded ? \"collapse\" : undefined;\n if (detailTransition === \"collapse\") {\n elements.execution.recent.hidden = false;\n }\n reconcile();\n const nextGeometry = captureSurfaceLayout(\n preserveInterruptedSharedLayout || detailTransition !== undefined,\n );\n currentScene = projection.scene;\n currentActivityKey = projection.activity?.key;\n animateGeometry(\n previousGeometry,\n nextGeometry,\n activeScene,\n layerChanged,\n detailTransition,\n );\n\n const executionActive =\n projection.scene === \"handoff\" ||\n projection.scene === \"running\" ||\n projection.scene === \"success\" ||\n projection.scene === \"failed\";\n if (executionActive && (sceneChanged || activityChanged)) sweepOnce();\n }\n\n function updateLayout(updateContent: () => void): void {\n if (disposed) return;\n const wasExpanded = elements.execution.root.dataset.expanded === \"true\";\n const previousGeometry = interruptMorph(true);\n updateContent();\n const isExpanded = elements.execution.root.dataset.expanded === \"true\";\n const detailTransition: DetailTransition = wasExpanded\n ? isExpanded\n ? undefined\n : \"collapse\"\n : isExpanded\n ? \"expand\"\n : undefined;\n if (detailTransition === \"collapse\") {\n elements.execution.recent.hidden = false;\n }\n reconcile();\n const nextGeometry = captureSurfaceLayout(true);\n const activeScene = elements.execution.root.hidden\n ? elements.planner.hidden\n ? elements.pill\n : elements.planner\n : elements.execution.root;\n animateGeometry(\n previousGeometry,\n nextGeometry,\n activeScene,\n false,\n detailTransition,\n );\n }\n\n function cancel(): void {\n pendingProjection = undefined;\n clearMorph();\n clearDispatch();\n gsap.killTweensOf(elements.execution.sweep);\n gsap.set(elements.execution.sweep, {\n clearProps: \"opacity,transform,visibility\",\n });\n }\n\n function render(\n projection: FloatingSurfaceProjection,\n renderContent: () => void,\n ): void {\n if (disposed) return;\n const dispatchActive = dispatchTimeline?.isActive() === true;\n const leavesChargingScene =\n projection.scene !== \"planner\" && projection.scene !== \"agent-charging\";\n\n if (dispatchActive && currentScene === \"agent-charging\" && leavesChargingScene) {\n pendingProjection = Object.freeze({ projection, renderContent });\n return;\n }\n\n if (dispatchActive && projection.scene !== \"agent-charging\") {\n pendingProjection = undefined;\n clearDispatch();\n }\n\n applyProjection(projection, renderContent);\n }\n\n function dispatch(source: HTMLElement, target: HTMLElement): void {\n if (disposed || dispatchTimeline?.isActive() === true) return;\n if (!supportsMotion(document)) return;\n\n clearDispatch();\n dispatchSource = source;\n dispatchTarget = target;\n elements.surface.dataset.agentCharging = \"true\";\n dispatchTimeline = gsap.timeline({\n onComplete: () => {\n const nextProjection = pendingProjection;\n pendingProjection = undefined;\n completeDispatch();\n if (nextProjection !== undefined) {\n applyProjection(nextProjection.projection, nextProjection.renderContent);\n }\n },\n });\n dispatchTimeline.fromTo(\n source,\n { filter: \"brightness(1)\", scaleX: 1, scaleY: 1 },\n {\n filter: \"brightness(1.06)\",\n scaleX: 0.995,\n scaleY: 0.97,\n duration: MOTION.pressSeconds,\n ease: \"power2.out\",\n yoyo: true,\n repeat: 1,\n clearProps: \"filter,transform\",\n },\n 0,\n );\n dispatchTimeline.fromTo(\n target,\n { boxShadow: \"0 0 0 rgb(100 120 255 / 0%)\" },\n {\n boxShadow: \"0 0 18px rgb(100 120 255 / 14%)\",\n duration: MOTION.targetFeedbackSeconds,\n yoyo: true,\n repeat: 1,\n clearProps: \"boxShadow\",\n },\n MOTION.targetFeedbackDelaySeconds,\n );\n dispatchTimeline.to({}, { duration: MOTION.dispatchSeconds }, 0);\n }\n\n return Object.freeze({\n cancel,\n dispatch,\n render,\n updateLayout,\n dispose(): void {\n if (disposed) return;\n disposed = true;\n cancel();\n document.removeEventListener(\"visibilitychange\", handleVisibility);\n },\n });\n}\n","import { createButton, createMarkedElement } from \"./dom.js\";\nimport { BRAND_MARK_CONTENT } from \"./brand-mark-content.js\";\nimport { createBrandMark } from \"./brand-mark.js\";\nimport type {\n FloatingSurfaceProjection,\n MotionExecutionIsland,\n} from \"./motion-extension-contract.js\";\n\nconst TIMER_INTERVAL_MS = 1_000;\n\nexport type { ExecutionActivityKind } from \"./motion-extension-contract.js\";\n\nfunction formatElapsed(milliseconds: number): string {\n const totalSeconds = Math.max(0, Math.floor(milliseconds / TIMER_INTERVAL_MS));\n const seconds = totalSeconds % 60;\n const totalMinutes = Math.floor(totalSeconds / 60);\n const minutes = totalMinutes % 60;\n const hours = Math.floor(totalMinutes / 60);\n const twoDigits = (value: number): string => String(value).padStart(2, \"0\");\n\n return hours > 0\n ? `${twoDigits(hours)}:${twoDigits(minutes)}:${twoDigits(seconds)}`\n : `${twoDigits(totalMinutes)}:${twoDigits(seconds)}`;\n}\n\nfunction validTimestamp(value: string | undefined): number | undefined {\n if (value === undefined) return undefined;\n const timestamp = Date.parse(value);\n return Number.isFinite(timestamp) ? timestamp : undefined;\n}\n\nfunction prefersReducedMotion(window: Window): boolean {\n const matchMedia: unknown = Reflect.get(window, \"matchMedia\");\n if (typeof matchMedia !== \"function\") return false;\n const result: unknown = Reflect.apply(matchMedia, window, [\n \"(prefers-reduced-motion: reduce)\",\n ]);\n return (\n typeof result === \"object\" &&\n result !== null &&\n \"matches\" in result &&\n result.matches === true\n );\n}\n\nexport function createExecutionIsland(\n document: Document,\n now: () => number = Date.now,\n): MotionExecutionIsland {\n const window = document.defaultView;\n\n if (window === null) {\n throw new Error(\"SpotPatch Execution Island requires an associated window.\");\n }\n\n const root = createButton(document, \"\", \"spotpatch-execution-island\");\n root.hidden = true;\n root.setAttribute(\"aria-hidden\", \"true\");\n root.setAttribute(\"aria-expanded\", \"false\");\n\n const logo = createBrandMark(\n document,\n BRAND_MARK_CONTENT,\n \"spotpatch-execution-island\",\n );\n logo.classList.add(\"spotpatch-execution-logo\");\n const mark = createMarkedElement(document, \"span\");\n mark.className = \"spotpatch-execution-mark\";\n mark.append(logo);\n\n const content = createMarkedElement(document, \"span\");\n content.className = \"spotpatch-execution-content\";\n content.setAttribute(\"role\", \"status\");\n content.setAttribute(\"aria-live\", \"polite\");\n content.setAttribute(\"aria-atomic\", \"true\");\n const headlineWrap = createMarkedElement(document, \"span\");\n headlineWrap.className = \"spotpatch-execution-headline-wrap\";\n const headline = createMarkedElement(document, \"strong\");\n headline.className = \"spotpatch-execution-headline\";\n const headlineOutgoing = createMarkedElement(document, \"strong\");\n headlineOutgoing.className = \"spotpatch-execution-headline-outgoing\";\n headlineOutgoing.setAttribute(\"aria-hidden\", \"true\");\n headlineWrap.append(headlineOutgoing, headline);\n const actionWrap = createMarkedElement(document, \"span\");\n actionWrap.className = \"spotpatch-execution-action-wrap\";\n const action = createMarkedElement(document, \"span\");\n action.className = \"spotpatch-execution-action\";\n const actionOutgoing = createMarkedElement(document, \"span\");\n actionOutgoing.className = \"spotpatch-execution-action-outgoing\";\n actionOutgoing.setAttribute(\"aria-hidden\", \"true\");\n actionWrap.append(actionOutgoing, action);\n const recent = createMarkedElement(document, \"span\");\n recent.className = \"spotpatch-execution-recent\";\n content.append(headlineWrap, actionWrap);\n\n const meta = createMarkedElement(document, \"span\");\n meta.className = \"spotpatch-execution-meta\";\n const metaDot = createMarkedElement(document, \"span\");\n metaDot.className = \"spotpatch-execution-meta-dot\";\n metaDot.setAttribute(\"aria-hidden\", \"true\");\n const metaLabel = createMarkedElement(document, \"span\");\n metaLabel.className = \"spotpatch-execution-meta-label\";\n const timer = createMarkedElement(document, \"span\");\n timer.className = \"spotpatch-execution-timer\";\n timer.hidden = true;\n meta.append(metaDot, metaLabel, timer);\n\n const more = createMarkedElement(document, \"span\");\n more.className = \"spotpatch-execution-more\";\n more.textContent = \"•••\";\n more.setAttribute(\"aria-hidden\", \"true\");\n meta.append(more);\n\n const sweep = createMarkedElement(document, \"span\");\n sweep.className = \"spotpatch-island-sweep\";\n sweep.setAttribute(\"aria-hidden\", \"true\");\n root.append(mark, content, meta, recent, sweep);\n\n const elements = Object.freeze({\n action,\n actionOutgoing,\n content,\n headline,\n headlineOutgoing,\n logo,\n mark,\n meta,\n metaDot,\n metaLabel,\n more,\n recent,\n root,\n sweep,\n timer,\n });\n let currentProjection: FloatingSurfaceProjection | undefined;\n let expandable = false;\n let expanded = false;\n let timerHandle: number | undefined;\n let startedAt: number | undefined;\n let disposed = false;\n\n const updateExpandedState = (): void => {\n expanded = expandable && expanded;\n root.dataset.expandable = String(expandable);\n root.dataset.expanded = String(expanded);\n root.setAttribute(\"aria-expanded\", String(expanded));\n more.textContent = expanded ? \"×\" : \"•••\";\n recent.hidden = !expanded;\n };\n\n const animateCopyChange = (\n element: HTMLElement,\n outgoing: HTMLElement,\n value: string,\n ): void => {\n if (element.textContent === value) return;\n outgoing.textContent = element.textContent;\n element.textContent = value;\n root.classList.remove(\"spotpatch-execution-copy-changing\");\n if (!prefersReducedMotion(window)) {\n void root.offsetWidth;\n root.classList.add(\"spotpatch-execution-copy-changing\");\n }\n };\n const syncProjectionCopy = (projection: FloatingSurfaceProjection): void => {\n const visibleHeadline = expanded\n ? (projection.expandedHeadline ?? projection.headline)\n : projection.headline;\n const visibleAction = expanded\n ? (projection.expandedAction ?? projection.action)\n : projection.action;\n animateCopyChange(headline, headlineOutgoing, visibleHeadline);\n animateCopyChange(action, actionOutgoing, visibleAction);\n root.setAttribute(\n \"aria-label\",\n [visibleHeadline, visibleAction, projection.meta].filter(Boolean).join(\". \"),\n );\n };\n\n const stopTimer = (): void => {\n if (timerHandle === undefined) return;\n window.clearInterval(timerHandle);\n timerHandle = undefined;\n };\n const updateTimer = (): void => {\n if (startedAt === undefined) return;\n timer.textContent = formatElapsed(now() - startedAt);\n };\n const startTimer = (): void => {\n if (timerHandle !== undefined || startedAt === undefined || document.hidden) {\n return;\n }\n updateTimer();\n timerHandle = window.setInterval(updateTimer, TIMER_INTERVAL_MS);\n };\n const syncTimer = (projection: FloatingSurfaceProjection): void => {\n stopTimer();\n startedAt =\n projection.scene === \"running\" ? validTimestamp(projection.startedAt) : undefined;\n const timed = startedAt !== undefined;\n timer.hidden = !timed;\n metaLabel.textContent = projection.meta;\n if (timed) startTimer();\n };\n const handleVisibility = (): void => {\n if (document.hidden) {\n stopTimer();\n } else if (currentProjection !== undefined) {\n syncTimer(currentProjection);\n }\n };\n document.addEventListener(\"visibilitychange\", handleVisibility);\n\n return Object.freeze({\n canExpand: () => expandable,\n elements,\n isExpanded: () => expanded,\n root,\n setExpanded(nextExpanded: boolean): void {\n expanded = nextExpanded;\n updateExpandedState();\n if (currentProjection !== undefined) syncProjectionCopy(currentProjection);\n },\n render(projection: FloatingSurfaceProjection): void {\n if (disposed) return;\n currentProjection = projection;\n root.dataset.executionScene = projection.scene;\n meta.dataset.tone = projection.tone;\n syncTimer(projection);\n\n recent.replaceChildren(\n ...projection.recentActivities.slice(-3).map((item) => {\n const row = createMarkedElement(document, \"span\");\n row.className = \"spotpatch-execution-recent-item\";\n row.dataset.state = item.state;\n const kind = createMarkedElement(document, \"span\");\n kind.className = \"spotpatch-execution-recent-kind\";\n kind.textContent = item.kind;\n const detail = createMarkedElement(document, \"span\");\n detail.className = \"spotpatch-execution-recent-detail\";\n detail.textContent = item.detail ?? item.label;\n const state = createMarkedElement(document, \"span\");\n state.className = \"spotpatch-execution-recent-state\";\n state.textContent = item.state;\n row.append(kind, detail, state);\n return row;\n }),\n );\n expandable = projection.recentActivities.length > 0;\n if (projection.scene === \"success\" || projection.scene === \"failed\") {\n expanded = false;\n }\n updateExpandedState();\n syncProjectionCopy(projection);\n },\n dispose(): void {\n if (disposed) return;\n disposed = true;\n stopTimer();\n document.removeEventListener(\"visibilitychange\", handleVisibility);\n },\n });\n}\n","import {\n createFloatingSurfaceMotionController,\n createFloatingSurfaceMotionStyles,\n} from \"./ui/motion-controller.js\";\nimport { createExecutionIsland } from \"./ui/execution-island.js\";\nimport {\n registerFloatingSurfaceMotionExtension,\n type FloatingSurfaceMotionExtension,\n} from \"./ui/motion-extension-contract.js\";\n\nconst FLOATING_SURFACE_MOTION_EXTENSION = Object.freeze({\n createExecutionIsland,\n createController: createFloatingSurfaceMotionController,\n createStyles: createFloatingSurfaceMotionStyles,\n}) satisfies FloatingSurfaceMotionExtension;\n\nexport function installFloatingSurfaceMotionExtension(): void {\n registerFloatingSurfaceMotionExtension(FLOATING_SURFACE_MOTION_EXTENSION);\n}\n\nexport {\n createExecutionIsland,\n createFloatingSurfaceMotionController,\n createFloatingSurfaceMotionStyles,\n};\nexport {\n getFloatingSurfaceMotionExtension,\n registerFloatingSurfaceMotionExtension,\n type FloatingSurfaceMotionController,\n type FloatingSurfaceMotionElements,\n type FloatingSurfaceMotionExtension,\n type FloatingSurfaceProjection,\n type FloatingSurfaceScene,\n type FloatingSurfaceTone,\n type MotionExecutionIsland,\n} from \"./ui/motion-extension-contract.js\";\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,YAAY;AAQrB,IAAM,SAAS,OAAO,OAAO;AAAA,EAC3B,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,cAAc;AAAA,EACd,eAAe;AAAA,EACf,yBAAyB;AAAA,EACzB,cAAc;AAAA,EACd,4BAA4B;AAAA,EAC5B,uBAAuB;AACzB,CAAC;AAED,IAAM,cAAc,OAAO,OAAO;AAAA,EAChC,eAAe;AAAA,EACf,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,cAAc;AAChB,CAAC;AA0BD,SAAS,aAAa,OAAyD;AAC7E,MAAI,UAAU,UAAU,UAAU,YAAa,QAAO;AACtD,MAAI,UAAU,UAAW,QAAO;AAChC,SAAO;AACT;AAEA,SAAS,mBACP,UACA,YACa;AACb,QAAM,aAAa,WAAW,UAAU,UAA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UAAI,WAAW,UAAU,aAAa,WAAW,UAAU,UAAU;AACnE,mBAAW;AAAA,MACb;AACA,0BAAoB;AACpB,yBAAmB,UAAU;AAAA,IAC/B;AAAA,IACA,UAAgB;AACd,UAAI,SAAU;AACd,iBAAW;AACX,gBAAU;AACV,eAAS,oBAAoB,oBAAoB,gBAAgB;AAAA,IACnE;AAAA,EACF,CAAC;AACH;;;AC7PA,IAAM,oCAAoC,OAAO,OAAO;AAAA,EACtD;AAAA,EACA,kBAAkB;AAAA,EAClB,cAAc;AAChB,CAAC;AAEM,SAAS,wCAA8C;AAC5D,yCAAuC,iCAAiC;AAC1E;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spotpatch/runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Browser runtime, collectors, and Shadow DOM UI for SpotPatch.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -69,6 +69,16 @@
|
|
|
69
69
|
"types": "./dist/external-handoff-panel.d.cts",
|
|
70
70
|
"default": "./dist/external-handoff-panel.cjs"
|
|
71
71
|
}
|
|
72
|
+
},
|
|
73
|
+
"./motion": {
|
|
74
|
+
"import": {
|
|
75
|
+
"types": "./dist/motion.d.ts",
|
|
76
|
+
"default": "./dist/motion.js"
|
|
77
|
+
},
|
|
78
|
+
"require": {
|
|
79
|
+
"types": "./dist/motion.d.cts",
|
|
80
|
+
"default": "./dist/motion.cjs"
|
|
81
|
+
}
|
|
72
82
|
}
|
|
73
83
|
},
|
|
74
84
|
"typesVersions": {
|
|
@@ -81,20 +91,25 @@
|
|
|
81
91
|
],
|
|
82
92
|
"external-handoff-panel": [
|
|
83
93
|
"dist/external-handoff-panel.d.ts"
|
|
94
|
+
],
|
|
95
|
+
"motion": [
|
|
96
|
+
"dist/motion.d.ts"
|
|
84
97
|
]
|
|
85
98
|
}
|
|
86
99
|
},
|
|
87
100
|
"dependencies": {
|
|
88
|
-
"
|
|
89
|
-
"@spotpatch/
|
|
101
|
+
"gsap": "3.15.0",
|
|
102
|
+
"@spotpatch/react-adapter": "^1.2.0",
|
|
103
|
+
"@spotpatch/shared": "^1.12.0"
|
|
90
104
|
},
|
|
91
105
|
"publishConfig": {
|
|
92
106
|
"access": "public",
|
|
93
107
|
"registry": "https://registry.npmjs.org/"
|
|
94
108
|
},
|
|
95
109
|
"scripts": {
|
|
96
|
-
"build": "tsup --config tsup.config.ts",
|
|
110
|
+
"build": "pnpm clean && tsup --config tsup.config.ts",
|
|
97
111
|
"clean": "node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\"",
|
|
112
|
+
"dev": "tsup --config tsup.config.ts --watch",
|
|
98
113
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
99
114
|
}
|
|
100
115
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/ui-constants.ts","../src/ui/dom.ts"],"sourcesContent":["export const UI_MARKER_ATTRIBUTE = \"data-spotpatch-ui\" as const;\n\nexport const UI_Z_INDEX = Object.freeze({\n highlight: 2_147_483_646,\n controls: 2_147_483_647,\n});\n","import { UI_MARKER_ATTRIBUTE } from \"./ui-constants.js\";\n\nexport function createMarkedElement<K extends keyof HTMLElementTagNameMap>(\n document: Document,\n tagName: K,\n): HTMLElementTagNameMap[K] {\n const element = document.createElement(tagName);\n element.setAttribute(UI_MARKER_ATTRIBUTE, \"\");\n return element;\n}\n\nexport function createButton(\n document: Document,\n label: string,\n className = \"\",\n): HTMLButtonElement {\n const button = createMarkedElement(document, \"button\");\n button.type = \"button\";\n button.className = className;\n button.textContent = label;\n return button;\n}\n"],"mappings":";AAAO,IAAM,sBAAsB;AAE5B,IAAM,aAAa,OAAO,OAAO;AAAA,EACtC,WAAW;AAAA,EACX,UAAU;AACZ,CAAC;;;ACHM,SAAS,oBACd,UACA,SAC0B;AAC1B,QAAM,UAAU,SAAS,cAAc,OAAO;AAC9C,UAAQ,aAAa,qBAAqB,EAAE;AAC5C,SAAO;AACT;AAEO,SAAS,aACd,UACA,OACA,YAAY,IACO;AACnB,QAAM,SAAS,oBAAoB,UAAU,QAAQ;AACrD,SAAO,OAAO;AACd,SAAO,YAAY;AACnB,SAAO,cAAc;AACrB,SAAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/external-handoff-contract.ts"],"sourcesContent":["import type {\n ErrorCode,\n ExternalAgentControlStatus,\n ExternalAgentManagedResult,\n ExternalHandoffCapability,\n ExternalHandoffPublishResult,\n ExternalHandoffStatusResult,\n ExternalHandoffFramework,\n SpotAnnotation,\n SpotPatchLocale,\n} from \"@spotpatch/shared/external-handoff-browser\";\n\nexport interface ExternalHandoffPanel {\n readonly cancelManagedButton: HTMLButtonElement;\n readonly connectButton: HTMLButtonElement;\n readonly disconnectButton: HTMLButtonElement;\n readonly refreshButton: HTMLButtonElement;\n readonly root: HTMLElement;\n readonly sendButton: HTMLButtonElement;\n readonly styles: HTMLStyleElement;\n readonly confirmDisclosure: (annotation: SpotAnnotation) => Promise<boolean>;\n readonly dispose: () => void;\n readonly renderCapability: (capability: ExternalHandoffCapability) => void;\n readonly renderControlUnavailable: () => void;\n readonly renderControlStatus: (status: ExternalAgentControlStatus) => void;\n readonly renderError: (code?: ErrorCode, retryable?: boolean) => void;\n readonly renderPublishResult: (result: ExternalHandoffPublishResult) => void;\n readonly renderPublishing: () => void;\n readonly renderManagedResult: (result: ExternalAgentManagedResult) => void;\n readonly renderStatus: (result: ExternalHandoffStatusResult) => void;\n readonly resolveButton: HTMLButtonElement;\n readonly revokeButton: HTMLButtonElement;\n readonly setBusy: (busy: boolean) => void;\n readonly setControlBusy: (busy: boolean) => void;\n readonly setContextReady: (ready: boolean) => void;\n readonly setSelectionVisible: (visible: boolean) => void;\n}\n\nexport interface ExternalHandoffWorkflow {\n readonly cancelPending: () => void;\n readonly dispose: () => void;\n readonly mount: () => void;\n}\n\nexport interface ExternalHandoffExtension {\n readonly createPanel: (\n document: Document,\n framework: ExternalHandoffFramework,\n locale: () => SpotPatchLocale,\n sessionId: string,\n subscribeLocale: (listener: () => void) => () => void,\n onViewChange: () => void,\n ) => ExternalHandoffPanel;\n readonly createWorkflow: (\n fetch: typeof globalThis.fetch,\n panel: ExternalHandoffPanel,\n selectedAnnotation: () => SpotAnnotation | undefined,\n sessionToken: string,\n window: Window,\n ) => ExternalHandoffWorkflow;\n}\n\nconst EXTERNAL_HANDOFF_EXTENSION_KEY = Symbol.for(\"spotpatch.external-handoff.v1\");\ntype ExtensionStore = Partial<Record<symbol, ExternalHandoffExtension>>;\n\nexport function registerExternalHandoffExtension(\n extension: ExternalHandoffExtension,\n): void {\n (globalThis as ExtensionStore)[EXTERNAL_HANDOFF_EXTENSION_KEY] = extension;\n}\n\nexport function getExternalHandoffExtension(): ExternalHandoffExtension | undefined {\n return (globalThis as ExtensionStore)[EXTERNAL_HANDOFF_EXTENSION_KEY];\n}\n"],"mappings":";AA8DA,IAAM,iCAAiC,uBAAO,IAAI,+BAA+B;AAG1E,SAAS,iCACd,WACM;AACN,EAAC,WAA8B,8BAA8B,IAAI;AACnE;AAEO,SAAS,8BAAoE;AAClF,SAAQ,WAA8B,8BAA8B;AACtE;","names":[]}
|
|
@@ -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,mBAA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