{"_id":"@bufinance/gtm-graph","name":"@bufinance/gtm-graph","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bufinance/gtm-graph","version":"0.1.0","description":"BUFI GTM graph — force-directed account-map view (POIs, bridges, warm paths) plus the pure path/bridge algorithms that power it. Shared between the desk admin cockpit and open-agents.","license":"MIT","sideEffects":false,"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./algorithms":{"types":"./dist/algorithms/index.d.ts","import":"./dist/algorithms/index.js","require":"./dist/algorithms/index.cjs"},"./view":{"types":"./dist/view/index.d.ts","import":"./dist/view/index.js","require":"./dist/view/index.cjs"}},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"scripts":{"build":"tsup","typecheck":"tsc --noEmit","test":"bun test --exit src","clean":"git clean -xdf .turbo node_modules dist"},"peerDependencies":{"react":">=18","react-dom":">=18"},"peerDependenciesMeta":{"react-dom":{"optional":true}},"devDependencies":{"@types/react":"^19.1.13","@types/react-dom":"^19.1.9","react":"^19.1.1","react-dom":"^19.1.1","tsup":"^8.5.0","typescript":"^5.8.3"},"keywords":["graph","gtm","account-map","force-directed","knowledge-graph","bufi"],"repository":{"type":"git","url":"git+https://github.com/bu-finance/desk.git","directory":"packages/gtm-graph"},"_id":"@bufinance/gtm-graph@0.1.0","gitHead":"6c9cd10814fb44faef62b4e92ef0ade76b0ee6a3","bugs":{"url":"https://github.com/bu-finance/desk/issues"},"homepage":"https://github.com/bu-finance/desk#readme","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-V2Hmz/DP74Z+R/sjTQCSgZwkIc3a0m45c3QvpKsTRg5cn4WRYYXnYXL9+1nA+Po09LrAgeX09q4y5Lv9ziR9Gg==","shasum":"53a7d129afd140672cb5a1bcdf1b33928beeba66","tarball":"https://registry.npmjs.org/@bufinance/gtm-graph/-/gtm-graph-0.1.0.tgz","fileCount":23,"unpackedSize":438001,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICIDUrcRetHo7rZiz37s4B/IbGszdaCoRAx6Kf1sL8b+AiEAylbfwizb87V0dZMzmzUldnHwGooklTVnuyo407whJ/0="}]},"_npmUser":{"name":"criptopoeta","email":"apart.giblets_7j@icloud.com"},"directories":{},"maintainers":[{"name":"criptopoeta","email":"apart.giblets_7j@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gtm-graph_0.1.0_1784219938156_0.9786153721463744"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-16T16:38:57.973Z","0.1.0":"2026-07-16T16:38:58.318Z","modified":"2026-07-16T16:38:58.580Z"},"maintainers":[{"name":"criptopoeta","email":"apart.giblets_7j@icloud.com"}],"description":"BUFI GTM graph — force-directed account-map view (POIs, bridges, warm paths) plus the pure path/bridge algorithms that power it. Shared between the desk admin cockpit and open-agents.","homepage":"https://github.com/bu-finance/desk#readme","keywords":["graph","gtm","account-map","force-directed","knowledge-graph","bufi"],"repository":{"type":"git","url":"git+https://github.com/bu-finance/desk.git","directory":"packages/gtm-graph"},"bugs":{"url":"https://github.com/bu-finance/desk/issues"},"license":"MIT","readme":"# @bufinance/gtm-graph\n\nBUFI's GTM account map: a force-directed graph view (people of interest,\nbridges, warm paths) plus the pure path/bridge algorithms that power it.\nShared between the BUFI desk admin cockpit (workspace dep) and\n`open-agents` (published npm dep).\n\n## Entry points\n\n| Import                          | Contents                                                                                       | Safe on server? |\n| ------------------------------- | ---------------------------------------------------------------------------------------------- | --------------- |\n| `@bufinance/gtm-graph`          | Data contracts (`GtmGraphData`, `GtmGraphPayload`) + everything from `/algorithms`             | Yes             |\n| `@bufinance/gtm-graph/algorithms` | `fewestHops`, `strongestPath`, `bridgeScores`, `neighborhood`, `edgeWeight`, `computePoiIds`, `computeBridgeIds`, `capGraph` | Yes             |\n| `@bufinance/gtm-graph/view`     | `GtmGraphView` React component (ships `\"use client\"`)                                          | Client only     |\n\n## Usage\n\n```tsx\nimport { GtmGraphView } from '@bufinance/gtm-graph/view';\n\n<GtmGraphView\n  data={{ entities, relationships }}\n  decorations={{ poiIds, bridgeScores }} // optional — computed client-side when absent\n  now={generatedAt}\n  onEntitySelect={id => openDetail(id)}\n/>;\n```\n\n```ts\nimport { strongestPath, neighborhood } from '@bufinance/gtm-graph/algorithms';\n\nconst warm = strongestPath(graph, repId, targetId, { now: Date.now() });\nconst context = neighborhood(graph, entityId, 2);\n```\n\n### Data shape\n\n`GtmGraphData` is structurally compatible with the desk repo's\n`KnowledgeGraphData` (`get_knowledge_graph` RPC payload). Edge\n`lastSeenAt`/`metadata` are optional because that RPC omits them — hosts that\nread `entity_relationships` directly should include both so recency fading\nand traversal weights are exact. Missing `lastSeenAt` is treated as fresh.\n\n### Weight formula\n\n```\nw = strength * ln(1 + evidenceCount) * 0.5^(daysStale / 90)\n```\n\n`strongestPath` runs Dijkstra on `1/w`; it can legitimately return MORE hops\nthan `fewestHops` when a chain of strong fresh edges beats a weak stale\ndirect edge — that divergence is the warm-path payoff.\n\n## Versioning discipline\n\nConsumers outside the desk workspace (open-agents) track **published**\nversions. Any change to this package needs a version bump + `npm publish`\nbefore those consumers can use it — a workspace-side edit alone is invisible\nto them. Until the first publish, open-agents consumes the packed tarball via\na `file:` dependency; switch it to `^0.1.0` after publishing.\n\n## Development\n\n```bash\nbun install\nbun run build      # tsup → dist (esm + cjs + dts); required before dependents typecheck\nbun run test       # bun test (algorithms + view-model + static render)\nbun run typecheck\nnpm pack           # tarball for file: consumers\nnpm publish --dry-run\n```\n\n## Provenance\n\n- Algorithms moved here from the desk repo's\n  `packages/intelligence/src/knowledge/graph-paths.ts` (plan 099) — that path\n  is now a re-export shim of `@bufinance/gtm-graph/algorithms`.\n- Physics copied (not imported) from\n  `packages/intelligence-ui/src/bubble-memory/bubble-physics.ts` so the\n  package publishes standalone; the bubble-memory original is unchanged.\n- `li_connection` edge styling is pre-wired for the HeyReach LinkedIn\n  network edges (099 follow-up) — the UI needs zero changes when they land.\n","readmeFilename":"README.md","_rev":"1-165640d819bfcc2d1b0eed94452d6157"}