forge-openclaw-plugin 0.2.59 → 0.2.61
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/README.md +93 -46
- package/dist/assets/{board-BAxNp060.js → board-DThHV1D8.js} +1 -2
- package/dist/assets/index-7gvVCqnV.css +1 -0
- package/dist/assets/index-_Cn6Prym.js +90 -0
- package/dist/assets/knowledge-graph-layout.worker-DRvzPxhP.js +0 -1
- package/dist/assets/{motion-B9BeeSmV.js → motion-BtTJtHCw.js} +1 -2
- package/dist/assets/{table-kY1tUKX5.js → table-Bnw6pcwN.js} +1 -2
- package/dist/assets/{ui-FaWfAb5Q.js → ui-CnVxFkj0.js} +1 -2
- package/dist/assets/{vendor-CUxVKN94.js → vendor-BgZ3YrRd.js} +212 -208
- package/dist/gamification-previews/dark-fantasy-item-trophy-tasks-anvil-marathon.webp +0 -0
- package/dist/gamification-previews/dark-fantasy-item-trophy-xp-levels-the-first-heat.webp +0 -0
- package/dist/gamification-previews/dark-fantasy-item-unlock-streaks-molten-crown-fire.webp +0 -0
- package/dist/gamification-previews/dark-fantasy-mascot.webp +0 -0
- package/dist/gamification-previews/dramatic-smithie-item-trophy-tasks-anvil-marathon.webp +0 -0
- package/dist/gamification-previews/dramatic-smithie-item-trophy-xp-levels-the-first-heat.webp +0 -0
- package/dist/gamification-previews/dramatic-smithie-item-unlock-streaks-molten-crown-fire.webp +0 -0
- package/dist/gamification-previews/dramatic-smithie-mascot.webp +0 -0
- package/dist/gamification-previews/mind-locksmith-item-trophy-tasks-anvil-marathon.webp +0 -0
- package/dist/gamification-previews/mind-locksmith-item-trophy-xp-levels-the-first-heat.webp +0 -0
- package/dist/gamification-previews/mind-locksmith-item-unlock-streaks-molten-crown-fire.webp +0 -0
- package/dist/gamification-previews/mind-locksmith-mascot.webp +0 -0
- package/dist/index.html +7 -7
- package/dist/openclaw/parity.js +27 -0
- package/dist/openclaw/plugin-entry-shared.js +2 -2
- package/dist/openclaw/plugin-sdk-types.d.ts +2 -1
- package/dist/openclaw/routes.d.ts +4 -0
- package/dist/openclaw/routes.js +112 -3
- package/dist/openclaw/tools.js +32 -4
- package/dist/server/server/migrations/058_gamification_theme_preference.sql +1 -1
- package/dist/server/server/migrations/059_data_backup_retention.sql +2 -0
- package/dist/server/server/src/app.js +152 -43
- package/dist/server/server/src/data-management-types.js +2 -0
- package/dist/server/server/src/health.js +40 -0
- package/dist/server/server/src/openapi.js +398 -7
- package/dist/server/server/src/repositories/rewards.js +60 -0
- package/dist/server/server/src/repositories/settings.js +1 -1
- package/dist/server/server/src/services/data-management.js +32 -2
- package/dist/server/server/src/services/doctor.js +762 -0
- package/dist/server/server/src/services/gamification-assets.js +231 -0
- package/dist/server/server/src/services/gamification.js +75 -3
- package/dist/server/server/src/types.js +1 -1
- package/dist/server/server/src/web.js +7 -104
- package/dist/server/src/lib/api.js +18 -0
- package/dist/server/src/lib/gamification-catalog.js +1 -1
- package/dist/server/src/lib/schemas.js +1 -1
- package/openclaw.plugin.json +85 -3
- package/package.json +8 -4
- package/server/migrations/058_gamification_theme_preference.sql +1 -1
- package/server/migrations/059_data_backup_retention.sql +2 -0
- package/skills/forge-openclaw/SKILL.md +38 -19
- package/skills/forge-openclaw/entity_conversation_playbooks.md +66 -8
- package/skills/forge-openclaw/psyche_entity_playbooks.md +23 -0
- package/dist/assets/board-BAxNp060.js.map +0 -1
- package/dist/assets/index-B5Yt4i07.css +0 -1
- package/dist/assets/index-NZwTuYPs.js +0 -91
- package/dist/assets/index-NZwTuYPs.js.map +0 -1
- package/dist/assets/knowledge-graph-layout.worker-DRvzPxhP.js.map +0 -1
- package/dist/assets/motion-B9BeeSmV.js.map +0 -1
- package/dist/assets/table-kY1tUKX5.js.map +0 -1
- package/dist/assets/ui-FaWfAb5Q.js.map +0 -1
- package/dist/assets/vendor-CUxVKN94.js.map +0 -1
- package/dist/gamification/sprites.zip +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-graph-layout.worker-DRvzPxhP.js","sources":["../src/components/knowledge-graph/knowledge-graph-layout-model.ts","../src/components/knowledge-graph/knowledge-graph-layout.worker.ts"],"sourcesContent":["export type KnowledgeGraphSimulationPhase =\n | \"global\"\n | \"focus-enter\"\n | \"focused\"\n | \"focus-exit\"\n | \"dragging\";\n\nexport type FocusSourceState = {\n nodeId: string;\n index: number;\n strength: number;\n targetStrength: number;\n enteredAt: number;\n lastUpdatedAt: number;\n hopLevels: Int16Array;\n};\n\nexport type FocusSourceSnapshot = {\n nodeId: string;\n strength: number;\n targetStrength: number;\n state: \"entering\" | \"active\" | \"exiting\";\n};\n\nexport type KnowledgeGraphCentroid = {\n x: number;\n y: number;\n};\n\nexport type DampedValueState = {\n value: number;\n velocity: number;\n};\n\nconst HOP_ATTENUATION = [1, 0.65, 0.35, 0.18, 0.08] as const;\nconst DEFAULT_MAX_SOURCES = 6;\nconst DEFAULT_ENTER_DURATION_MS = 600;\nconst DEFAULT_EXIT_DURATION_MS = 900;\nconst DEFAULT_REMOVAL_EPSILON = 0.001;\nconst HISTORICAL_SOURCE_WEIGHT = 0.52;\nexport const KNOWLEDGE_GRAPH_MAX_FOCUS_REPULSION = 6;\nexport const KNOWLEDGE_GRAPH_MAX_FOCUS_DIFFUSION = 5;\nexport const KNOWLEDGE_GRAPH_MAX_FOCUS_SPRING_REDUCTION = 0.92;\nexport const KNOWLEDGE_GRAPH_MAX_FOCUS_SPRING_DIFFUSION = 5;\nexport const KNOWLEDGE_GRAPH_MIN_EDGE_SPRING_STRENGTH = 0.15;\nexport const KNOWLEDGE_GRAPH_MAX_EDGE_SPRING_STRENGTH = 2.4;\nexport const KNOWLEDGE_GRAPH_MAX_GRAVITY_STRENGTH = 2;\nexport const KNOWLEDGE_GRAPH_MIN_FOCUS_SHELL_SPACING = 0.8;\nexport const KNOWLEDGE_GRAPH_MAX_FOCUS_SHELL_SPACING = 3;\n\nexport type KnowledgeGraphPhysicsSettings = {\n focusRepulsion: number;\n focusDiffusion: number;\n focusSpringReductionMax: number;\n focusSpringReductionDiffusion: number;\n edgeSpringStrength: number;\n gravityStrength: number;\n focusShellSpacing: number;\n};\n\nexport const DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS: KnowledgeGraphPhysicsSettings = {\n focusRepulsion: 2.25,\n focusDiffusion: 1.95,\n focusSpringReductionMax: 0.34,\n focusSpringReductionDiffusion: 1.85,\n edgeSpringStrength: 1,\n gravityStrength: 1,\n focusShellSpacing: 1\n};\n\nfunction clamp(value: number, minimum: number, maximum: number) {\n return Math.min(Math.max(value, minimum), maximum);\n}\n\nexport function sanitizeKnowledgeGraphPhysicsSettings(\n settings: Partial<KnowledgeGraphPhysicsSettings> | null | undefined\n) {\n return {\n focusRepulsion: clamp(\n settings?.focusRepulsion ?? DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS.focusRepulsion,\n 0.6,\n KNOWLEDGE_GRAPH_MAX_FOCUS_REPULSION\n ),\n focusDiffusion: clamp(\n settings?.focusDiffusion ?? DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS.focusDiffusion,\n 0.6,\n KNOWLEDGE_GRAPH_MAX_FOCUS_DIFFUSION\n ),\n focusSpringReductionMax: clamp(\n settings?.focusSpringReductionMax ??\n DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS.focusSpringReductionMax,\n 0,\n KNOWLEDGE_GRAPH_MAX_FOCUS_SPRING_REDUCTION\n ),\n focusSpringReductionDiffusion: clamp(\n settings?.focusSpringReductionDiffusion ??\n DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS.focusSpringReductionDiffusion,\n 0.6,\n KNOWLEDGE_GRAPH_MAX_FOCUS_SPRING_DIFFUSION\n ),\n edgeSpringStrength: clamp(\n settings?.edgeSpringStrength ??\n DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS.edgeSpringStrength,\n KNOWLEDGE_GRAPH_MIN_EDGE_SPRING_STRENGTH,\n KNOWLEDGE_GRAPH_MAX_EDGE_SPRING_STRENGTH\n ),\n gravityStrength: clamp(\n settings?.gravityStrength ??\n DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS.gravityStrength,\n 0,\n KNOWLEDGE_GRAPH_MAX_GRAVITY_STRENGTH\n ),\n focusShellSpacing: clamp(\n settings?.focusShellSpacing ??\n DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS.focusShellSpacing,\n KNOWLEDGE_GRAPH_MIN_FOCUS_SHELL_SPACING,\n KNOWLEDGE_GRAPH_MAX_FOCUS_SHELL_SPACING\n )\n } satisfies KnowledgeGraphPhysicsSettings;\n}\n\nexport function resolveKnowledgeGraphFocusEnterDurationMs(\n settings: KnowledgeGraphPhysicsSettings\n) {\n return Math.round(DEFAULT_ENTER_DURATION_MS + settings.focusDiffusion * 420);\n}\n\nexport function resolveKnowledgeGraphFocusExitDurationMs(\n settings: KnowledgeGraphPhysicsSettings\n) {\n return Math.round(DEFAULT_EXIT_DURATION_MS + settings.focusDiffusion * 620);\n}\n\nexport function resolveKnowledgeGraphHistoricalSourceWeight(\n settings: KnowledgeGraphPhysicsSettings\n) {\n return clamp(\n HISTORICAL_SOURCE_WEIGHT + (settings.focusDiffusion - 1) * 0.16,\n 0.28,\n 0.72\n );\n}\n\nexport function getKnowledgeGraphHopAttenuation(\n hopLevel: number,\n diffusion = 1\n) {\n if (hopLevel < 0) {\n return 0;\n }\n if (hopLevel >= HOP_ATTENUATION.length) {\n const terminal = HOP_ATTENUATION[HOP_ATTENUATION.length - 1] ?? 0;\n return hopLevel === 0 ? 1 : Math.pow(terminal, 1 / Math.max(diffusion, 0.1));\n }\n const base = HOP_ATTENUATION[hopLevel] ?? 0;\n return hopLevel === 0 ? base : Math.pow(base, 1 / Math.max(diffusion, 0.1));\n}\n\nexport function getKnowledgeGraphSpringReduction({\n hopLevel,\n maxReduction,\n diffusion\n}: {\n hopLevel: number;\n maxReduction: number;\n diffusion: number;\n}) {\n if (hopLevel < 0 || maxReduction <= 0) {\n return 0;\n }\n\n return clamp(\n maxReduction * getKnowledgeGraphHopAttenuation(hopLevel, diffusion),\n 0,\n KNOWLEDGE_GRAPH_MAX_FOCUS_SPRING_REDUCTION\n );\n}\n\nexport function reconcileKnowledgeGraphFocusSources({\n sources,\n nodeIndexById,\n focusNodeId,\n hopLevels,\n nowMs,\n maxSources = DEFAULT_MAX_SOURCES\n}: {\n sources: FocusSourceState[];\n nodeIndexById: Map<string, number>;\n focusNodeId: string | null;\n hopLevels: number[];\n nowMs: number;\n maxSources?: number;\n}) {\n const nextSources = sources.map((source) => ({\n ...source,\n targetStrength: 0\n }));\n\n if (focusNodeId) {\n const nextIndex = nodeIndexById.get(focusNodeId);\n if (nextIndex !== undefined) {\n const existingIndex = nextSources.findIndex(\n (source) => source.nodeId === focusNodeId\n );\n const nextHopLevels = new Int16Array(\n hopLevels.map((level) => Math.max(-1, Math.trunc(level)))\n );\n if (existingIndex >= 0) {\n const existing = nextSources.splice(existingIndex, 1)[0]!;\n nextSources.unshift({\n ...existing,\n index: nextIndex,\n targetStrength: 1,\n enteredAt: nowMs,\n lastUpdatedAt: nowMs,\n hopLevels: nextHopLevels\n });\n } else {\n nextSources.unshift({\n nodeId: focusNodeId,\n index: nextIndex,\n strength: 0,\n targetStrength: 1,\n enteredAt: nowMs,\n lastUpdatedAt: nowMs,\n hopLevels: nextHopLevels\n });\n }\n }\n }\n\n return nextSources.slice(0, maxSources);\n}\n\nexport function advanceKnowledgeGraphFocusSources({\n sources,\n nowMs,\n enterDurationMs = DEFAULT_ENTER_DURATION_MS,\n exitDurationMs = DEFAULT_EXIT_DURATION_MS,\n removalEpsilon = DEFAULT_REMOVAL_EPSILON\n}: {\n sources: FocusSourceState[];\n nowMs: number;\n enterDurationMs?: number;\n exitDurationMs?: number;\n removalEpsilon?: number;\n}) {\n const advanced = sources\n .map((source) => {\n const elapsed = Math.max(0, nowMs - source.lastUpdatedAt);\n const duration =\n source.targetStrength > source.strength\n ? enterDurationMs\n : exitDurationMs;\n const delta = duration <= 0 ? 1 : elapsed / duration;\n const nextStrength =\n source.targetStrength > source.strength\n ? Math.min(source.targetStrength, source.strength + delta)\n : Math.max(source.targetStrength, source.strength - delta);\n\n return {\n ...source,\n strength: clamp(nextStrength, 0, 1),\n lastUpdatedAt: nowMs\n };\n })\n .filter(\n (source) =>\n source.targetStrength > 0 || source.strength > removalEpsilon\n );\n\n return advanced;\n}\n\nexport function computeKnowledgeGraphFocusPressure({\n nodeCount,\n sources,\n settings = DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS\n}: {\n nodeCount: number;\n sources: FocusSourceState[];\n settings?: KnowledgeGraphPhysicsSettings;\n}) {\n const pressure = new Float32Array(nodeCount);\n const historicalWeight = resolveKnowledgeGraphHistoricalSourceWeight(settings);\n\n sources.forEach((source, sourceIndex) => {\n const sourceWeight =\n sourceIndex === 0 ? source.strength : source.strength * historicalWeight;\n if (sourceWeight <= 0) {\n return;\n }\n for (let index = 0; index < nodeCount; index += 1) {\n const attenuation = getKnowledgeGraphHopAttenuation(\n source.hopLevels[index] ?? -1,\n settings.focusDiffusion\n );\n if (attenuation <= 0) {\n continue;\n }\n pressure[index] = clamp(\n pressure[index]! + attenuation * sourceWeight,\n 0,\n 1.25\n );\n }\n });\n\n return pressure;\n}\n\nexport function buildKnowledgeGraphFocusSourceSnapshots(\n sources: FocusSourceState[]\n) {\n return sources.map((source) => ({\n nodeId: source.nodeId,\n strength: Number(source.strength.toFixed(4)),\n targetStrength: source.targetStrength,\n state:\n source.targetStrength > source.strength\n ? \"entering\"\n : source.targetStrength < source.strength\n ? \"exiting\"\n : \"active\"\n })) satisfies FocusSourceSnapshot[];\n}\n\nexport function computeKnowledgeGraphCentroid({\n x,\n y,\n mass\n}: {\n x: Float32Array;\n y: Float32Array;\n mass?: Float32Array;\n}) {\n let totalMass = 0;\n let sumX = 0;\n let sumY = 0;\n\n for (let index = 0; index < x.length; index += 1) {\n const weight = mass?.[index] ?? 1;\n totalMass += weight;\n sumX += x[index]! * weight;\n sumY += y[index]! * weight;\n }\n\n if (totalMass <= 0) {\n return {\n x: 0,\n y: 0\n } satisfies KnowledgeGraphCentroid;\n }\n\n return {\n x: sumX / totalMass,\n y: sumY / totalMass\n } satisfies KnowledgeGraphCentroid;\n}\n\nexport function stepCriticallyDampedValue({\n state,\n target,\n deltaSeconds,\n settleTimeMs\n}: {\n state: DampedValueState;\n target: number;\n deltaSeconds: number;\n settleTimeMs: number;\n}) {\n const smoothTime = Math.max(0.001, settleTimeMs / 1000);\n const omega = 2 / smoothTime;\n const x = omega * Math.max(0.0001, deltaSeconds);\n const exp = 1 / (1 + x + 0.48 * x * x + 0.235 * x * x * x);\n const change = state.value - target;\n const temp = (state.velocity + omega * change) * deltaSeconds;\n const nextVelocity = (state.velocity - omega * temp) * exp;\n const nextValue = target + (change + temp) * exp;\n\n return {\n value: nextValue,\n velocity: nextVelocity\n } satisfies DampedValueState;\n}\n","import type {\n KnowledgeGraphLayoutWorkerMessage,\n KnowledgeGraphLayoutWorkerResponse\n} from \"./knowledge-graph-layout-protocol\";\nimport {\n advanceKnowledgeGraphFocusSources,\n buildKnowledgeGraphFocusSourceSnapshots,\n computeKnowledgeGraphCentroid,\n computeKnowledgeGraphFocusPressure,\n DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS,\n getKnowledgeGraphSpringReduction,\n reconcileKnowledgeGraphFocusSources,\n resolveKnowledgeGraphFocusEnterDurationMs,\n resolveKnowledgeGraphFocusExitDurationMs,\n sanitizeKnowledgeGraphPhysicsSettings,\n type FocusSourceState,\n type KnowledgeGraphPhysicsSettings,\n type KnowledgeGraphSimulationPhase\n} from \"./knowledge-graph-layout-model\";\n\ntype LayoutState = {\n nodeIds: string[];\n nodeIndexById: Map<string, number>;\n x: Float32Array;\n y: Float32Array;\n vx: Float32Array;\n vy: Float32Array;\n fx: Float32Array;\n fy: Float32Array;\n mass: Float32Array;\n radius: Float32Array;\n importance: Float32Array;\n focusPressure: Float32Array;\n rowPtr: Uint32Array;\n colIdx: Uint32Array;\n colWeight: Float32Array;\n edgeSource: Uint32Array;\n edgeTarget: Uint32Array;\n edgeWeight: Float32Array;\n edgeRestLength0: Float32Array;\n physics: KnowledgeGraphPhysicsSettings;\n focusIndex: number;\n focusAnchorX: number;\n focusAnchorY: number;\n focusSources: FocusSourceState[];\n dragIndex: number;\n dragTargetX: number;\n dragTargetY: number;\n phase: KnowledgeGraphSimulationPhase;\n tick: number;\n accumulatorSeconds: number;\n lastFrameTimeMs: number;\n};\n\ntype QuadNode = {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n mass: number;\n massX: number;\n massY: number;\n point: number;\n children: [QuadNode | null, QuadNode | null, QuadNode | null, QuadNode | null] | null;\n};\n\nconst THETA = 0.55;\nconst DT = 1 / 120;\nconst MAX_FRAME_CATCHUP = 3;\nconst GLOBAL_DRAG = 7.2;\nconst SPRING_K = 8.0;\nconst SPRING_DAMPING = 1.4;\nconst REPULSION_K = 34.0;\nconst GRAVITY_K = 0.18;\nconst CENTROID_RESTORE_K = 0.09;\nconst FOCUS_REST_GAIN = 0.35;\nconst MAX_SPEED = 10.0;\nconst PUBLISH_POSITIONS_EVERY_TICKS = 1;\nconst PUBLISH_STATS_EVERY_TICKS = 12;\nconst COLLISION_PADDING = 0.16;\nconst FOCUS_SHELL_BASE_RADIUS = 1.4;\nconst FOCUS_SHELL_RADIUS_STEP = 1.15;\nconst FOCUS_SHELL_STIFFNESS = 5.6;\nconst FOCUS_SHELL_DAMPING = 3.8;\n\nlet state: LayoutState | null = null;\nlet loopHandle: number | null = null;\n\nfunction clearLoop() {\n if (loopHandle !== null) {\n clearTimeout(loopHandle);\n loopHandle = null;\n }\n}\n\nfunction scheduleLoop() {\n clearLoop();\n loopHandle = self.setTimeout(runLoop, 16) as unknown as number;\n}\n\nfunction clamp(value: number, minimum: number, maximum: number) {\n return Math.min(Math.max(value, minimum), maximum);\n}\n\nfunction hashIndex(index: number) {\n let hash = (index + 1) * 2654435761;\n hash ^= hash >>> 16;\n hash = Math.imul(hash, 2246822519);\n hash ^= hash >>> 13;\n hash = Math.imul(hash, 3266489917);\n hash ^= hash >>> 16;\n return hash >>> 0;\n}\n\nfunction criticalDampedForce({\n x,\n y,\n vx,\n vy,\n targetX,\n targetY,\n stiffness,\n damping\n}: {\n x: number;\n y: number;\n vx: number;\n vy: number;\n targetX: number;\n targetY: number;\n stiffness: number;\n damping: number;\n}) {\n return {\n fx: -stiffness * (x - targetX) - damping * vx,\n fy: -stiffness * (y - targetY) - damping * vy\n };\n}\n\nfunction createQuad(minX: number, minY: number, maxX: number, maxY: number): QuadNode {\n return {\n minX,\n minY,\n maxX,\n maxY,\n mass: 0,\n massX: 0,\n massY: 0,\n point: -1,\n children: null\n };\n}\n\nfunction quadrantFor(node: QuadNode, x: number, y: number) {\n const midX = (node.minX + node.maxX) / 2;\n const midY = (node.minY + node.maxY) / 2;\n const east = x >= midX ? 1 : 0;\n const south = y >= midY ? 1 : 0;\n return south * 2 + east;\n}\n\nfunction ensureChildren(node: QuadNode) {\n if (node.children) {\n return node.children;\n }\n const midX = (node.minX + node.maxX) / 2;\n const midY = (node.minY + node.maxY) / 2;\n node.children = [\n createQuad(node.minX, node.minY, midX, midY),\n createQuad(midX, node.minY, node.maxX, midY),\n createQuad(node.minX, midY, midX, node.maxY),\n createQuad(midX, midY, node.maxX, node.maxY)\n ];\n return node.children;\n}\n\nfunction insertPoint(current: LayoutState, node: QuadNode, index: number) {\n const nodeX = current.x[index]!;\n const nodeY = current.y[index]!;\n\n if (node.point === -1 && !node.children) {\n node.point = index;\n return;\n }\n\n const children = ensureChildren(node);\n if (node.point !== -1) {\n const existing = node.point;\n node.point = -1;\n const existingQuadrant = quadrantFor(node, current.x[existing]!, current.y[existing]!);\n insertPoint(current, children[existingQuadrant]!, existing);\n }\n\n const nextQuadrant = quadrantFor(node, nodeX, nodeY);\n insertPoint(current, children[nextQuadrant]!, index);\n}\n\nfunction accumulateQuad(current: LayoutState, node: QuadNode): { mass: number; x: number; y: number } {\n if (!node.children) {\n if (node.point === -1) {\n node.mass = 0;\n node.massX = 0;\n node.massY = 0;\n return { mass: 0, x: 0, y: 0 };\n }\n const pointIndex = node.point;\n const effectiveMass =\n current.mass[pointIndex]! *\n (1 + current.focusPressure[pointIndex]! * current.physics.focusRepulsion * 0.35);\n const x = current.x[pointIndex]!;\n const y = current.y[pointIndex]!;\n node.mass = effectiveMass;\n node.massX = x;\n node.massY = y;\n return {\n mass: effectiveMass,\n x,\n y\n };\n }\n\n let totalMass = 0;\n let sumX = 0;\n let sumY = 0;\n\n for (const child of node.children) {\n if (!child) {\n continue;\n }\n const aggregate = accumulateQuad(current, child);\n totalMass += aggregate.mass;\n sumX += aggregate.x * aggregate.mass;\n sumY += aggregate.y * aggregate.mass;\n }\n\n node.mass = totalMass;\n node.massX = totalMass > 0 ? sumX / totalMass : 0;\n node.massY = totalMass > 0 ? sumY / totalMass : 0;\n return {\n mass: totalMass,\n x: node.massX,\n y: node.massY\n };\n}\n\nfunction buildQuadtree(current: LayoutState) {\n let minX = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n\n for (let index = 0; index < current.x.length; index += 1) {\n minX = Math.min(minX, current.x[index]!);\n maxX = Math.max(maxX, current.x[index]!);\n minY = Math.min(minY, current.y[index]!);\n maxY = Math.max(maxY, current.y[index]!);\n }\n\n const span = Math.max(maxX - minX, maxY - minY, 1);\n const padding = span * 0.1 + 1;\n const root = createQuad(minX - padding, minY - padding, maxX + padding, maxY + padding);\n\n for (let index = 0; index < current.x.length; index += 1) {\n insertPoint(current, root, index);\n }\n\n accumulateQuad(current, root);\n return root;\n}\n\nfunction applyRepulsion(current: LayoutState, quad: QuadNode, index: number) {\n if (quad.mass === 0) {\n return;\n }\n if (!quad.children && quad.point === index) {\n return;\n }\n\n const dx = current.x[index]! - quad.massX;\n const dy = current.y[index]! - quad.massY;\n const distanceSq = dx * dx + dy * dy + 0.01;\n const distance = Math.sqrt(distanceSq);\n const size = Math.max(quad.maxX - quad.minX, quad.maxY - quad.minY);\n\n if (!quad.children || size / distance < THETA) {\n const stressGain = 1 + current.focusPressure[index]! * current.physics.focusRepulsion;\n const force = (REPULSION_K * stressGain * current.mass[index]! * quad.mass) / distanceSq;\n current.fx[index]! += (dx / distance) * force;\n current.fy[index]! += (dy / distance) * force;\n return;\n }\n\n for (const child of quad.children) {\n if (!child) {\n continue;\n }\n applyRepulsion(current, child, index);\n }\n}\n\nfunction applySpringAttraction(current: LayoutState) {\n const primarySource = current.focusSources[0];\n const primaryStrength = primarySource?.strength ?? 0;\n const hopLevels = primarySource?.hopLevels;\n\n for (let edgeIndex = 0; edgeIndex < current.edgeSource.length; edgeIndex += 1) {\n const source = current.edgeSource[edgeIndex]!;\n const target = current.edgeTarget[edgeIndex]!;\n const dx = current.x[target]! - current.x[source]!;\n const dy = current.y[target]! - current.y[source]!;\n const distance = Math.max(0.0001, Math.hypot(dx, dy));\n const ux = dx / distance;\n const uy = dy / distance;\n const relativeVelocity =\n (current.vx[source]! - current.vx[target]!) * ux +\n (current.vy[source]! - current.vy[target]!) * uy;\n const averageStress =\n (current.focusPressure[source]! + current.focusPressure[target]!) * 0.5;\n const sourceHopLevel = hopLevels?.[source] ?? -1;\n const targetHopLevel = hopLevels?.[target] ?? -1;\n const edgeHopLevel =\n sourceHopLevel < 0\n ? targetHopLevel\n : targetHopLevel < 0\n ? sourceHopLevel\n : Math.min(sourceHopLevel, targetHopLevel);\n const restLength =\n current.edgeRestLength0[edgeIndex]! *\n (1 + averageStress * (FOCUS_REST_GAIN + (current.physics.focusRepulsion - 1) * 0.16));\n const stretch = distance - restLength;\n const springReduction =\n primaryStrength > 0\n ? getKnowledgeGraphSpringReduction({\n hopLevel: edgeHopLevel,\n maxReduction:\n current.physics.focusSpringReductionMax * primaryStrength,\n diffusion: current.physics.focusSpringReductionDiffusion\n })\n : 0;\n const springForce =\n SPRING_K *\n current.physics.edgeSpringStrength *\n (1 - springReduction) *\n current.edgeWeight[edgeIndex]! *\n stretch;\n const dampingForce = -SPRING_DAMPING * relativeVelocity;\n const force = springForce + dampingForce;\n const forceX = ux * force;\n const forceY = uy * force;\n\n current.fx[source]! += forceX;\n current.fy[source]! += forceY;\n current.fx[target]! -= forceX;\n current.fy[target]! -= forceY;\n }\n}\n\nfunction applyGravity(current: LayoutState) {\n for (let index = 0; index < current.x.length; index += 1) {\n current.fx[index]! +=\n -GRAVITY_K *\n current.physics.gravityStrength *\n current.mass[index]! *\n current.x[index]!;\n current.fy[index]! +=\n -GRAVITY_K *\n current.physics.gravityStrength *\n current.mass[index]! *\n current.y[index]!;\n }\n}\n\nfunction applyCentroidRestoringForce(current: LayoutState) {\n const centroid = computeKnowledgeGraphCentroid({\n x: current.x,\n y: current.y,\n mass: current.mass\n });\n for (let index = 0; index < current.x.length; index += 1) {\n current.fx[index]! +=\n -CENTROID_RESTORE_K *\n current.physics.gravityStrength *\n current.mass[index]! *\n centroid.x;\n current.fy[index]! +=\n -CENTROID_RESTORE_K *\n current.physics.gravityStrength *\n current.mass[index]! *\n centroid.y;\n }\n}\n\nfunction applyFocusAndDragPins(current: LayoutState) {\n if (current.dragIndex >= 0) {\n current.fx[current.dragIndex] = 0;\n current.fy[current.dragIndex] = 0;\n }\n}\n\nfunction applyFocusShellForces(current: LayoutState, focusGain: number) {\n const primarySource = current.focusSources[0];\n if (current.focusIndex < 0 || !primarySource || focusGain <= 0) {\n return;\n }\n\n const focusX = current.x[current.focusIndex]!;\n const focusY = current.y[current.focusIndex]!;\n const hopLevels = primarySource.hopLevels;\n\n for (let index = 0; index < current.x.length; index += 1) {\n if (index === current.focusIndex) {\n continue;\n }\n\n const hopLevel = hopLevels[index] ?? -1;\n if (hopLevel < 1) {\n continue;\n }\n\n let dx = current.x[index]! - focusX;\n let dy = current.y[index]! - focusY;\n let distance = Math.hypot(dx, dy);\n\n if (distance < 0.001) {\n const angle = ((hashIndex(index) % 4096) / 4096) * Math.PI * 2;\n dx = Math.cos(angle);\n dy = Math.sin(angle);\n distance = 1;\n }\n\n const ux = dx / distance;\n const uy = dy / distance;\n const desiredRadius =\n (FOCUS_SHELL_BASE_RADIUS * current.physics.focusShellSpacing) +\n (Math.min(hopLevel, 6) - 1) *\n (\n FOCUS_SHELL_RADIUS_STEP *\n current.physics.focusShellSpacing *\n (0.92 + current.physics.focusDiffusion * 0.24)\n ) +\n current.focusPressure[index]! * (0.42 + current.physics.focusRepulsion * 0.12);\n const targetX = focusX + ux * desiredRadius;\n const targetY = focusY + uy * desiredRadius;\n const shellStrength =\n ((FOCUS_SHELL_STIFFNESS * (0.92 + current.physics.focusDiffusion * 0.18)) /\n Math.max(1, hopLevel)) *\n focusGain;\n const shellForce = criticalDampedForce({\n x: current.x[index]!,\n y: current.y[index]!,\n vx: current.vx[index]!,\n vy: current.vy[index]!,\n targetX,\n targetY,\n stiffness: shellStrength,\n damping: FOCUS_SHELL_DAMPING\n });\n\n current.fx[index]! += shellForce.fx;\n current.fy[index]! += shellForce.fy;\n }\n}\n\nfunction applyCollision(current: LayoutState) {\n const grid = new Map<string, number[]>();\n const cellSize = 1.2;\n\n for (let index = 0; index < current.x.length; index += 1) {\n const gx = Math.floor(current.x[index]! / cellSize);\n const gy = Math.floor(current.y[index]! / cellSize);\n const key = `${gx}:${gy}`;\n const bucket = grid.get(key) ?? [];\n bucket.push(index);\n grid.set(key, bucket);\n }\n\n for (const [key, indices] of grid) {\n const [gridX, gridY] = key.split(\":\").map(Number);\n for (let offsetX = -1; offsetX <= 1; offsetX += 1) {\n for (let offsetY = -1; offsetY <= 1; offsetY += 1) {\n const neighbor = grid.get(`${gridX + offsetX}:${gridY + offsetY}`);\n if (!neighbor) {\n continue;\n }\n for (const left of indices) {\n for (const right of neighbor) {\n if (left >= right) {\n continue;\n }\n const dx = current.x[right]! - current.x[left]!;\n const dy = current.y[right]! - current.y[left]!;\n const distance = Math.max(0.001, Math.hypot(dx, dy));\n const minimum = current.radius[left]! + current.radius[right]! + COLLISION_PADDING;\n if (distance >= minimum) {\n continue;\n }\n const push = ((minimum - distance) / distance) * 0.18;\n const pushX = dx * push;\n const pushY = dy * push;\n current.fx[left]! -= pushX;\n current.fy[left]! -= pushY;\n current.fx[right]! += pushX;\n current.fy[right]! += pushY;\n }\n }\n }\n }\n }\n}\n\nfunction integrate(current: LayoutState) {\n const dragFactor = Math.exp(-GLOBAL_DRAG * DT);\n\n for (let index = 0; index < current.x.length; index += 1) {\n if (index === current.dragIndex) {\n current.x[index] = current.dragTargetX;\n current.y[index] = current.dragTargetY;\n current.vx[index] = 0;\n current.vy[index] = 0;\n continue;\n }\n current.vx[index]! = (current.vx[index]! + (current.fx[index]! / current.mass[index]!) * DT) * dragFactor;\n current.vy[index]! = (current.vy[index]! + (current.fy[index]! / current.mass[index]!) * DT) * dragFactor;\n const speed = Math.hypot(current.vx[index]!, current.vy[index]!);\n if (speed > MAX_SPEED) {\n const scale = MAX_SPEED / speed;\n current.vx[index]! *= scale;\n current.vy[index]! *= scale;\n }\n current.x[index]! += current.vx[index]! * DT;\n current.y[index]! += current.vy[index]! * DT;\n }\n\n if (current.focusIndex >= 0 && current.dragIndex !== current.focusIndex) {\n current.x[current.focusIndex] = current.focusAnchorX;\n current.y[current.focusIndex] = current.focusAnchorY;\n current.vx[current.focusIndex] = 0;\n current.vy[current.focusIndex] = 0;\n }\n}\n\nfunction applyDraggedNodeIntervention(current: LayoutState) {\n if (current.dragIndex < 0) {\n return;\n }\n current.x[current.dragIndex] = current.dragTargetX;\n current.y[current.dragIndex] = current.dragTargetY;\n current.vx[current.dragIndex] = 0;\n current.vy[current.dragIndex] = 0;\n current.fx[current.dragIndex] = 0;\n current.fy[current.dragIndex] = 0;\n if (current.focusIndex === current.dragIndex) {\n current.focusAnchorX = current.dragTargetX;\n current.focusAnchorY = current.dragTargetY;\n }\n}\n\nfunction computePhase(current: LayoutState, nowMs: number) {\n if (current.dragIndex >= 0) {\n current.phase = \"dragging\";\n return;\n }\n if (current.focusIndex >= 0 || current.focusSources.length > 0) {\n const primaryStrength = current.focusSources[0]?.strength ?? 0;\n if (current.focusIndex >= 0 && primaryStrength < 0.999) {\n current.phase = \"focus-enter\";\n return;\n }\n if (current.focusIndex >= 0) {\n current.phase = \"focused\";\n return;\n }\n current.phase = \"focus-exit\";\n return;\n }\n current.phase = \"global\";\n}\n\nfunction tick(current: LayoutState, nowMs: number) {\n applyDraggedNodeIntervention(current);\n current.focusSources = advanceKnowledgeGraphFocusSources({\n sources: current.focusSources,\n nowMs,\n enterDurationMs: resolveKnowledgeGraphFocusEnterDurationMs(current.physics),\n exitDurationMs: resolveKnowledgeGraphFocusExitDurationMs(current.physics)\n });\n current.focusPressure = computeKnowledgeGraphFocusPressure({\n nodeCount: current.x.length,\n sources: current.focusSources,\n settings: current.physics\n });\n current.fx.fill(0);\n current.fy.fill(0);\n const quadtree = buildQuadtree(current);\n for (let index = 0; index < current.x.length; index += 1) {\n applyRepulsion(current, quadtree, index);\n }\n applySpringAttraction(current);\n applyGravity(current);\n applyCentroidRestoringForce(current);\n applyFocusAndDragPins(current);\n applyFocusShellForces(current, current.focusSources[0]?.strength ?? 0);\n applyCollision(current);\n applyDraggedNodeIntervention(current);\n integrate(current);\n computePhase(current, nowMs);\n current.tick += 1;\n}\n\nfunction publishPositions(current: LayoutState) {\n const x = current.x.slice();\n const y = current.y.slice();\n const message: KnowledgeGraphLayoutWorkerResponse = {\n type: \"positions\",\n x,\n y,\n tick: current.tick\n };\n self.postMessage(message);\n}\n\nfunction publishStats(current: LayoutState) {\n const message: KnowledgeGraphLayoutWorkerResponse = {\n type: \"stats\",\n tick: current.tick,\n phase: current.phase,\n primaryFocusedNodeId:\n current.focusIndex >= 0 ? current.nodeIds[current.focusIndex] ?? null : null,\n focusSources: buildKnowledgeGraphFocusSourceSnapshots(current.focusSources),\n focusPressure: current.focusPressure.slice(),\n centroid: computeKnowledgeGraphCentroid({\n x: current.x,\n y: current.y,\n mass: current.mass\n })\n };\n self.postMessage(message);\n}\n\nfunction runLoop() {\n if (!state) {\n clearLoop();\n return;\n }\n\n const nowMs = performance.now();\n const deltaSeconds = clamp((nowMs - state.lastFrameTimeMs) / 1000, 0, DT * MAX_FRAME_CATCHUP);\n state.lastFrameTimeMs = nowMs;\n state.accumulatorSeconds += deltaSeconds;\n\n let steps = 0;\n while (state.accumulatorSeconds >= DT && steps < MAX_FRAME_CATCHUP) {\n tick(state, nowMs);\n state.accumulatorSeconds -= DT;\n steps += 1;\n }\n\n if (steps > 0 && state.tick % PUBLISH_POSITIONS_EVERY_TICKS === 0) {\n publishPositions(state);\n }\n\n if (steps > 0 && state.tick % PUBLISH_STATS_EVERY_TICKS === 0) {\n publishStats(state);\n }\n\n scheduleLoop();\n}\n\nfunction buildAdjacency(edges: { source: number; target: number; weight: number }[], nodeCount: number) {\n const degree = new Uint32Array(nodeCount);\n for (const edge of edges) {\n degree[edge.source]! += 1;\n degree[edge.target]! += 1;\n }\n const rowPtr = new Uint32Array(nodeCount + 1);\n for (let index = 0; index < nodeCount; index += 1) {\n rowPtr[index + 1] = rowPtr[index]! + degree[index]!;\n }\n const colIdx = new Uint32Array(rowPtr[nodeCount]!);\n const colWeight = new Float32Array(rowPtr[nodeCount]!);\n const cursor = new Uint32Array(rowPtr);\n\n for (const edge of edges) {\n let pointer = cursor[edge.source]!;\n colIdx[pointer] = edge.target;\n colWeight[pointer] = edge.weight;\n cursor[edge.source]! += 1;\n\n pointer = cursor[edge.target]!;\n colIdx[pointer] = edge.source;\n colWeight[pointer] = edge.weight;\n cursor[edge.target]! += 1;\n }\n\n return {\n rowPtr,\n colIdx,\n colWeight\n };\n}\n\nfunction initializeState(message: Extract<KnowledgeGraphLayoutWorkerMessage, { type: \"init-graph\" }>) {\n const nodeIds = message.nodes.map((node) => node.id);\n const adjacency = buildAdjacency(message.edges, message.nodes.length);\n state = {\n nodeIds,\n nodeIndexById: new Map(nodeIds.map((id, index) => [id, index])),\n x: new Float32Array(message.nodes.map((node) => node.x)),\n y: new Float32Array(message.nodes.map((node) => node.y)),\n vx: new Float32Array(message.nodes.length),\n vy: new Float32Array(message.nodes.length),\n fx: new Float32Array(message.nodes.length),\n fy: new Float32Array(message.nodes.length),\n mass: new Float32Array(message.nodes.map((node) => Math.max(1, node.mass))),\n radius: new Float32Array(message.nodes.map((node) => Math.max(0.35, node.size * 0.12))),\n importance: new Float32Array(message.nodes.map((node) => node.importance)),\n focusPressure: new Float32Array(message.nodes.length),\n rowPtr: adjacency.rowPtr,\n colIdx: adjacency.colIdx,\n colWeight: adjacency.colWeight,\n edgeSource: new Uint32Array(message.edges.map((edge) => edge.source)),\n edgeTarget: new Uint32Array(message.edges.map((edge) => edge.target)),\n edgeWeight: new Float32Array(message.edges.map((edge) => edge.weight)),\n edgeRestLength0: new Float32Array(\n message.edges.map((edge) => {\n const sourceRadius = Math.max(0.35, message.nodes[edge.source]!.size * 0.12);\n const targetRadius = Math.max(0.35, message.nodes[edge.target]!.size * 0.12);\n return 0.8 + sourceRadius + targetRadius;\n })\n ),\n physics: sanitizeKnowledgeGraphPhysicsSettings(\n message.physics ?? DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS\n ),\n focusIndex: message.focusNodeId\n ? nodeIds.findIndex((nodeId) => nodeId === message.focusNodeId)\n : -1,\n focusAnchorX: 0,\n focusAnchorY: 0,\n focusSources: [],\n dragIndex: -1,\n dragTargetX: 0,\n dragTargetY: 0,\n phase: message.focusNodeId ? \"focus-enter\" : \"global\",\n tick: 0,\n accumulatorSeconds: 0,\n lastFrameTimeMs: performance.now()\n };\n\n if (state.focusIndex >= 0) {\n state.focusAnchorX = state.x[state.focusIndex]!;\n state.focusAnchorY = state.y[state.focusIndex]!;\n state.vx[state.focusIndex] = 0;\n state.vy[state.focusIndex] = 0;\n }\n state.focusSources = reconcileKnowledgeGraphFocusSources({\n sources: [],\n nodeIndexById: state.nodeIndexById,\n focusNodeId: message.focusNodeId,\n hopLevels: message.hopLevels,\n nowMs: performance.now()\n });\n state.focusPressure = computeKnowledgeGraphFocusPressure({\n nodeCount: state.x.length,\n sources: state.focusSources,\n settings: state.physics\n });\n\n publishPositions(state);\n publishStats(state);\n scheduleLoop();\n}\n\nfunction setFocus(message: Extract<KnowledgeGraphLayoutWorkerMessage, { type: \"set-focus\" }>) {\n if (!state) {\n return;\n }\n state.focusIndex = message.focusNodeId\n ? state.nodeIndexById.get(message.focusNodeId) ?? -1\n : -1;\n state.focusSources = reconcileKnowledgeGraphFocusSources({\n sources: state.focusSources,\n nodeIndexById: state.nodeIndexById,\n focusNodeId: message.focusNodeId,\n hopLevels: message.hopLevels,\n nowMs: performance.now()\n });\n if (state.focusIndex >= 0) {\n state.focusAnchorX = state.x[state.focusIndex]!;\n state.focusAnchorY = state.y[state.focusIndex]!;\n state.vx[state.focusIndex] = 0;\n state.vy[state.focusIndex] = 0;\n state.phase = \"focus-enter\";\n } else {\n state.phase = \"focus-exit\";\n }\n}\n\nfunction updatePhysics(\n message: Extract<KnowledgeGraphLayoutWorkerMessage, { type: \"update-physics\" }>\n) {\n if (!state) {\n return;\n }\n state.physics = sanitizeKnowledgeGraphPhysicsSettings(message.physics);\n state.focusPressure = computeKnowledgeGraphFocusPressure({\n nodeCount: state.x.length,\n sources: state.focusSources,\n settings: state.physics\n });\n}\n\nfunction dragStart(message: Extract<KnowledgeGraphLayoutWorkerMessage, { type: \"drag-start\" }>) {\n if (!state) {\n return;\n }\n const index = state.nodeIndexById.get(message.nodeId);\n if (index === undefined) {\n return;\n }\n state.dragIndex = index;\n state.dragTargetX = state.x[index]!;\n state.dragTargetY = state.y[index]!;\n state.x[index] = state.dragTargetX;\n state.y[index] = state.dragTargetY;\n state.vx[index] = 0;\n state.vy[index] = 0;\n state.phase = \"dragging\";\n}\n\nfunction dragMove(\n message: Extract<\n KnowledgeGraphLayoutWorkerMessage,\n { type: \"drag-move\" | \"nudge-node\" }\n >\n) {\n if (!state) {\n return;\n }\n const index = state.nodeIndexById.get(message.nodeId);\n if (index === undefined) {\n return;\n }\n state.dragTargetX = message.x;\n state.dragTargetY = message.y;\n state.x[index] = message.x;\n state.y[index] = message.y;\n state.vx[index] = 0;\n state.vy[index] = 0;\n if (message.type === \"nudge-node\") {\n state.fx[index] = 0;\n state.fy[index] = 0;\n }\n if (index === state.focusIndex) {\n state.focusAnchorX = message.x;\n state.focusAnchorY = message.y;\n }\n}\n\nfunction dragEnd(message: Extract<KnowledgeGraphLayoutWorkerMessage, { type: \"drag-end\" }>) {\n if (!state) {\n return;\n }\n const index = state.nodeIndexById.get(message.nodeId);\n if (index === undefined || state.dragIndex !== index) {\n return;\n }\n state.dragIndex = -1;\n state.phase = state.focusIndex >= 0 ? \"focus-enter\" : \"global\";\n}\n\nfunction recenterGraph(\n message: Extract<KnowledgeGraphLayoutWorkerMessage, { type: \"recenter-graph\" }>\n) {\n if (!state) {\n return;\n }\n if (message.offsetX === 0 && message.offsetY === 0) {\n return;\n }\n for (let index = 0; index < state.x.length; index += 1) {\n state.x[index]! -= message.offsetX;\n state.y[index]! -= message.offsetY;\n }\n if (state.dragIndex >= 0) {\n state.dragTargetX -= message.offsetX;\n state.dragTargetY -= message.offsetY;\n }\n if (state.focusIndex >= 0) {\n state.focusAnchorX -= message.offsetX;\n state.focusAnchorY -= message.offsetY;\n }\n publishPositions(state);\n publishStats(state);\n}\n\nself.onmessage = (event: MessageEvent<KnowledgeGraphLayoutWorkerMessage>) => {\n const message = event.data;\n\n switch (message.type) {\n case \"init-graph\":\n initializeState(message);\n return;\n case \"set-focus\":\n setFocus(message);\n return;\n case \"update-physics\":\n updatePhysics(message);\n return;\n case \"drag-start\":\n dragStart(message);\n return;\n case \"drag-move\":\n dragMove(message);\n return;\n case \"nudge-node\":\n dragMove(message);\n return;\n case \"recenter-graph\":\n recenterGraph(message);\n return;\n case \"drag-end\":\n dragEnd(message);\n return;\n case \"dispose\":\n clearLoop();\n state = null;\n return;\n }\n};\n"],"names":["HOP_ATTENUATION","DEFAULT_MAX_SOURCES","DEFAULT_ENTER_DURATION_MS","DEFAULT_EXIT_DURATION_MS","DEFAULT_REMOVAL_EPSILON","HISTORICAL_SOURCE_WEIGHT","KNOWLEDGE_GRAPH_MAX_FOCUS_REPULSION","KNOWLEDGE_GRAPH_MAX_FOCUS_DIFFUSION","KNOWLEDGE_GRAPH_MAX_FOCUS_SPRING_REDUCTION","KNOWLEDGE_GRAPH_MAX_FOCUS_SPRING_DIFFUSION","KNOWLEDGE_GRAPH_MIN_EDGE_SPRING_STRENGTH","KNOWLEDGE_GRAPH_MAX_EDGE_SPRING_STRENGTH","KNOWLEDGE_GRAPH_MAX_GRAVITY_STRENGTH","KNOWLEDGE_GRAPH_MIN_FOCUS_SHELL_SPACING","KNOWLEDGE_GRAPH_MAX_FOCUS_SHELL_SPACING","DEFAULT_KNOWLEDGE_GRAPH_PHYSICS_SETTINGS","clamp","value","minimum","maximum","sanitizeKnowledgeGraphPhysicsSettings","settings","resolveKnowledgeGraphFocusEnterDurationMs","resolveKnowledgeGraphFocusExitDurationMs","resolveKnowledgeGraphHistoricalSourceWeight","getKnowledgeGraphHopAttenuation","hopLevel","diffusion","terminal","base","getKnowledgeGraphSpringReduction","maxReduction","reconcileKnowledgeGraphFocusSources","sources","nodeIndexById","focusNodeId","hopLevels","nowMs","maxSources","nextSources","source","nextIndex","existingIndex","nextHopLevels","level","existing","advanceKnowledgeGraphFocusSources","enterDurationMs","exitDurationMs","removalEpsilon","elapsed","duration","delta","nextStrength","computeKnowledgeGraphFocusPressure","nodeCount","pressure","historicalWeight","sourceIndex","sourceWeight","index","attenuation","buildKnowledgeGraphFocusSourceSnapshots","computeKnowledgeGraphCentroid","x","y","mass","totalMass","sumX","sumY","weight","THETA","DT","MAX_FRAME_CATCHUP","SPRING_K","REPULSION_K","FOCUS_REST_GAIN","MAX_SPEED","PUBLISH_POSITIONS_EVERY_TICKS","PUBLISH_STATS_EVERY_TICKS","COLLISION_PADDING","FOCUS_SHELL_BASE_RADIUS","FOCUS_SHELL_RADIUS_STEP","FOCUS_SHELL_STIFFNESS","FOCUS_SHELL_DAMPING","state","loopHandle","clearLoop","scheduleLoop","runLoop","hashIndex","hash","criticalDampedForce","vx","vy","targetX","targetY","stiffness","damping","createQuad","minX","minY","maxX","maxY","quadrantFor","node","midX","midY","east","ensureChildren","insertPoint","current","nodeX","nodeY","children","existingQuadrant","nextQuadrant","accumulateQuad","pointIndex","effectiveMass","child","aggregate","buildQuadtree","padding","root","applyRepulsion","quad","dx","dy","distanceSq","distance","size","stressGain","force","applySpringAttraction","primarySource","primaryStrength","edgeIndex","target","ux","uy","relativeVelocity","averageStress","sourceHopLevel","targetHopLevel","edgeHopLevel","restLength","stretch","springReduction","springForce","dampingForce","forceX","forceY","applyGravity","applyCentroidRestoringForce","centroid","applyFocusAndDragPins","applyFocusShellForces","focusGain","focusX","focusY","angle","desiredRadius","shellStrength","shellForce","applyCollision","grid","cellSize","gx","gy","key","bucket","indices","gridX","gridY","offsetX","offsetY","neighbor","left","right","push","pushX","pushY","integrate","dragFactor","speed","scale","applyDraggedNodeIntervention","computePhase","_a","tick","quadtree","publishPositions","message","publishStats","deltaSeconds","steps","buildAdjacency","edges","degree","edge","rowPtr","colIdx","colWeight","cursor","pointer","initializeState","nodeIds","adjacency","id","sourceRadius","targetRadius","nodeId","setFocus","updatePhysics","dragStart","dragMove","dragEnd","recenterGraph","event"],"mappings":"yBAkCA,MAAMA,EAAkB,CAAC,EAAG,IAAM,IAAM,IAAM,GAAI,EAC5CC,EAAsB,EACtBC,EAA4B,IAC5BC,EAA2B,IAC3BC,EAA0B,KAC1BC,EAA2B,IACpBC,EAAsC,EACtCC,EAAsC,EACtCC,EAA6C,IAC7CC,GAA6C,EAC7CC,GAA2C,IAC3CC,GAA2C,IAC3CC,GAAuC,EACvCC,GAA0C,GAC1CC,GAA0C,EAY1CC,EAA0E,CACrF,eAAgB,KAChB,eAAgB,KAChB,wBAAyB,IACzB,8BAA+B,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