PageSourceSearch

https://docs.kaelio.com/ktx/_next/static/chunks/0ik0sem.54s7e.js?dpl=dpl_4ChsLJB4h6y8hiU9ZFycxUPExL9h

js kaelio.com collected 2026-10-03 23:49:30 UTC 59,934 bytes, 270 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1066,e=>{"use strict";var t=e.i(33736),s=e.i(66417),a=e.i(85629);let r={padding:.05};e.s(["FlowCanvas",0,function({nodes:e,edges:o,nodeTypes:n,edgeTypes:i,canvasStyle:l,className:d,fitViewOptions:c=r,maxZoom:m=1.5,translateExtent:x,ariaLabel:p}){let[u,g]=(0,s.useState)(.15),h=(0,s.useCallback)(e=>{requestAnimationFrame(()=>{e.fitView(c).then(()=>{g(e.getZoom())})})},[c]);return(0,t.jsxs)("div",{className:`flow-canvas relative bg-fd-background ${d??""}`,style:l,"aria-label":p,children:[(0,t.jsx)("div",{className:"pointer-events-none absolute right-2.5 top-2.5 z-10 rounded border border-fd-border/50 bg-white/30 px-1.5 py-px font-mono text-[9.5px] font-medium uppercase tracking-[0.06em] text-fd-muted-foreground shadow-sm backdrop-blur-sm dark:bg-white/10",children:"Drag to pan · ⌘/Ctrl + scroll to zoom"}),(0,t.jsxs)(a.ReactFlow,{nodes:e,edges:o,nodeTypes:n,edgeTypes:i,onInit:h,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,edgesFocusable:!1,elementsSelectable:!1,panOnDrag:!0,panOnScroll:!1,zoomOnScroll:!1,zoomOnPinch:!0,zoomOnDoubleClick:!0,preventScrolling:!1,minZoom:u,maxZoom:m,translateExtent:x,proOptions:{hideAttribution:!0}
1,children:[(0,t.jsx)(a.Background,{variant:a.BackgroundVariant.Dots,gap:18,size:1,color:"var(--color-fd-border)"}),(0,t.jsx)(a.Controls,{showInteractive:!1,position:"bottom-right","aria-label":"Zoom and fit-view controls"})]})]})}])},75710,e=>{"use strict";var t=e.i(33736),s=e.i(85629),a=e.i(33814),r=e.i(1066);let o="#0891b2",n="#94a3b8",i=[{id:"sources",type:"sources",position:{x:220,y:16},data:{variant:"sources",badge:"1 · evidence",title:"Data stack",caption:"Connectors scan warehouses, modeling code, BI tools, and notes.",items:[{label:"warehouse",color:"#3b82f6"},{label:"dbt",color:"#f59e0b"},{label:"Metabase",color:"#f97316"},{label:"Notion",color:"#10b981"}]},draggable:!1,selectable:!1},{id:"ingest",type:"ingest",position:{x:220,y:284},data:{variant:"ingest",badge:"2 · run",title:"ktx ingest",command:"ktx ingest --all",caption:"Reconciles new evidence with the accepted YAML and Markdown already on disk."},draggable:!1,selectable:!1},{id:"diff",type:"diff",position:{x:220,y:552},data:{variant:"diff",badge:"3 · diff",title:"Branch diff",caption:"Every decision lands as a YAML or Markdown line.",branch:"ingest/nightly",files:[{path:"semantic-layer/warehouse/orders.yaml",accent:"#3b82f6",added:4,removed:1,lines:[{kind:"hunk",text:"@@ measures @@"},{kind:"ctx",text:"  - name: revenue"},{kind:"del",text:"    expr: sum(amount)"},{kind:"add",text:"    expr: sum(amount - refund_amount)"},{kind:"add",text:"  - name: net_orders"},{kind:"add",text:"    expr: count(distinct id)"}]},{path:"wiki/global/revenue.md",accent:"#10b981",added:2,removed:0,lines:[{kind:"hunk",text:"@@ Net revenue @@"},{kind:"add",text:"Excludes refunds and test accounts."},{kind:"add",text:"sl_refs: [warehouse.orders]"}]}]},draggable:!1,selectable:!1},{id:"review",type:"review",position:{x:220,y:1096},data:{variant:"review",badge:"4 · review",title:"PR review",caption:"Analysts approve, edit, or reject like any pull request.",checks:["joins are safe","measures match policy","wiki cites evidence"]},draggable:!1,selectable:!1},{id:"merged",type:"merged",position:{x:220,y:1364},data:{variant:"merged",badge:"5 · merged",title:"Accepted context",caption:"Merged files become the trusted layer agents read at runtime.",paths:[{label:"semantic-layer/",color:"#3b82f6"},{label:"wiki/",color:"#10b981"}]},draggable:!1,selectable:!1}],l=e=>({type:a.MarkerType.ArrowClosed,color:e,width:14,height:14}),d={fontSize:11,fontWeight:600,fill:"var(--color-fd-muted-foreground)",letterSpacing:"0.02em"},c={fill:"var(--color-fd-background)",stroke:"var(--color-fd-border)",strokeWidth:1},m=[{id:"sources-ingest",source:"sources",sourceHandle:"bottom",target:"ingest",targetHandle:"top",type:"straight",label:"scan",labelBgPadding:[6,3],labelBgBorderRadius:4,labelStyle:d,labelBgStyle:c,style:{stroke:o,strokeWidth:1.75},markerEnd:l(o)},{id:"ingest-diff",source:"ingest",sourceHandle:"bottom",target:"diff",targetHandle:"top",type:"straight",label:"propose files",labelBgPadding:[6,3],labelBgBorderRadius:4,labelStyle:d,labelBgStyle:c,style:{stroke:o,strokeWidth:1.75},markerEnd:l(o)},{id:"diff-review",source:"diff",sourceHandle:"bottom",target:"review",targetHandle:"top",type:"straight",label:"open PR",labelBgPadding:[6,3],labelBgBorderRadius:4,labelStyle:d,labelBgStyle:c,style:{stroke:o,strokeWidth:1.75},markerEnd:l(o)},{id:"review-merged",source:"review",sourceHandle:"bottom",target:"merged",targetHandle:"top",type:"straight",label:"merge",labelBgPadding:[6,3],labelBgBorderRadius:4,labelStyle:d,labelBgStyle:c,style:{stroke:o,strokeWidth:1.75},markerEnd:l(o)},{id:"merged-sources",source:"merged",sourceHandle:"right",target:"sources",targetHandle:"right",type:"smoothstep",pathOptions:{offset:64,borderRadius:18},style:{stroke:n,strokeWidth:1.5,strokeDasharray:"5 5"},markerEnd:l(n)}];function x({tone:e,children:s}){return(0,t.jsx)("span",{className:`inline-flex items-center gap-1.5 rounded-sm border px-2 font-mono text-[13px] font-semibold uppercase tracking-[0.06em] ${"primary"===e?"border-cyan-300/70 bg-cyan-50 text-cyan-800 dark:border-cyan-400/40 dark:bg-cyan-400/15 dark:text-cyan-100":"review"===e?"border-fuchsia-300/70 bg-fuchsia-50 text-fuchsia-800 dark:border-fuchsia-400/40 dark:bg-fuchsia-400/15 dark:text-fuchsia-100":"merged"===e?"border-emerald-300/70 bg-emerald-50 text-emerald-800 dark:border-emerald-400/40 dark:bg-emerald-400/15 dark:text-emerald-100":"border-slate-300 bg-slate-50 text-slate-700 dark:border-slate-600/60 dark:bg-slate-700/40 dark:text-slate-200"}`,style:{lineHeight:"20px",paddingBlock:0},children:s})}function p({noTop:e=!1}){return(0,t.jsxs)(t.Fragment,{children:[e?null:(0,t.jsx)(s.Handle,{id:"top",type:"target",position:a.Position.Top,className:"!opacity-0"}),(0,t.jsx)(s.Handle,{id:"bottom",type:"source",position:a.Position.Bottom,className:"!opacity-0"}),(0,t.jsx)(s.Handle,{id:"right",type:"source",position:a.Position.Right,className:"!opacity-0"}),(0,t.jsx)(s.Handle,{id:"right-target",type:"target",position:a.Position.Right,className:"!opacity-0"})]})}function u(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.Handle,{id:"bottom",type:"source",position:a.Position.Bottom,className:"!opacity-0"}),(0,t.jsx)(s.Handle,{id:"right",type:"target",position:a.Position.Right,className:"!opacity-0"})]})}function g({line:e}){if("hunk"===e.kind)return(0,t.jsx)("div",{className:"bg-fd-muted/40 px-2.5 py-1 font-mono text-[12px] uppercase tracking-[0.06em] text-fd-muted-foreground",children:e.text});let s="add"===e.kind?"+":"del"===e.kind?"-":" ",a="add"===e.kind?"bg-emerald-500/8 text-emerald-700 dark:text-emerald-300":"del"===e.kind?"bg-rose-500/8 text-rose-700 dark:text-rose-300":"text-fd-muted-foreground";return(0,t.jsxs)("div",{className:`flex gap-1.5 px-2.5 py-px font-mono text-[13px] leading-5 ${a}`,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"w-2.5 flex-none text-center opacity-70",children:s}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:e.text})]})}function h({file:e}){return(0,t.jsxs)("div",{className:"overflow-hidden rounded-sm border border-fd-border bg-fd-background",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-fd-border px-2.5 py-1.5",style:{borderTop:`2px solid ${e.accent}`},children:[(0,t.jsx)("span",{className:"truncate font-mono text-[14px] font-semibold tracking-tight",style:{color:e.accent},children:e.path}),(0,t.jsxs)("span",{className:"ml-auto flex-none font-mono text-[12px] tabular-nums text-emerald-600 dark:text-emerald-400",children:["+",e.added]}),e.removed>0?(0,t.jsxs)("span",{className:"flex-none font-mono text-[12px] tabular-nums text-rose-600 dar
1k:text-rose-400",children:["-",e.removed]}):null]}),(0,t.jsx)("div",{className:"py-1",children:e.lines.map((e,s)=>(0,t.jsx)(g,{line:e},s))})]})}let f={sources:function({data:e}){return(0,t.jsxs)("div",{style:{width:420,height:196},className:"flex flex-col rounded-md border border-fd-border bg-fd-card px-4 py-3.5 shadow-sm",children:[(0,t.jsx)(u,{}),(0,t.jsx)(x,{tone:"neutral",children:e.badge}),(0,t.jsx)("p",{className:"mt-2 text-[19px] font-semibold leading-7 text-fd-foreground",children:e.title}),(0,t.jsx)("p",{className:"mt-1.5 text-[15px] leading-6 text-fd-muted-foreground",children:e.caption}),(0,t.jsx)("div",{className:"mt-auto flex flex-wrap gap-1.5 pt-2.5",children:e.items.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded border border-fd-border bg-fd-background px-2 py-0.5 text-[13px] leading-5 text-fd-muted-foreground",children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"h-1.5 w-1.5 flex-none rounded-full",style:{background:e.color}}),e.label]},e.label))})]})},ingest:function({data:e}){return(0,t.jsxs)("div",{style:{width:420,height:196},className:"relative flex flex-col rounded-md border border-cyan-300/40 bg-[#0f1f23] px-4 py-3.5 text-white shadow-sm dark:bg-[#0b181b]",children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"absolute inset-y-0 left-0 w-[3px] rounded-l-md",style:{background:o}}),(0,t.jsx)(p,{}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(x,{tone:"primary",children:e.badge}),(0,t.jsx)("p",{className:"text-[19px] font-semibold leading-7 text-white",children:e.title})]}),(0,t.jsx)("span",{className:"mt-2 inline-flex w-fit items-center whitespace-pre rounded-sm border border-cyan-100/15 bg-white/[0.08] px-2 py-0.5 font-mono text-[14px] leading-5 text-cyan-100",style:{fontVariantLigatures:"none",fontFeatureSettings:'"liga" 0, "calt" 0'},children:`$ ${e.command}`}),(0,t.jsx)("p",{className:"mt-2 text-[15px] leading-6 text-cyan-50/80",children:e.caption})]})},diff:function({data:e}){return(0,t.jsxs)("div",{style:{width:420,height:472},className:"flex flex-col rounded-md border-2 border-fd-primary/45 bg-fd-card px-4 py-3.5 shadow-md",children:[(0,t.jsx)(p,{}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(x,{tone:"primary",children:e.badge}),(0,t.jsx)("p",{className:"text-[19px] font-semibold leading-7 text-fd-foreground",children:e.title}),(0,t.jsxs)("span",{className:"ml-auto inline-flex w-fit items-center gap-1.5 whitespace-nowrap rounded border border-fd-border bg-fd-background px-2 py-0.5 font-mono text-[13px] leading-5 text-fd-muted-foreground",children:[(0,t.jsxs)("svg",{"aria-hidden":"true",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"6",cy:"6",r:"2.25"}),(0,t.jsx)("circle",{cx:"6",cy:"18",r:"2.25"}),(0,t.jsx)("circle",{cx:"18",cy:"6",r:"2.25"}),(0,t.jsx)("path",{d:"M6 8.5v7"}),(0,t.jsx)("path",{d:"M6 18c0-6 12-6 12-9.5"})]}),e.branch]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-[15px] leading-6 text-fd-muted-foreground",children:e.caption}),(0,t.jsx)("div",{className:"mt-2.5 flex min-h-0 flex-1 flex-col gap-2",children:e.files.map(e=>(0,t.jsx)(h,{file:e},e.path))})]})},review:function({data:e}){return(0,t.jsxs)("div",{style:{width:420,height:196},className:"flex flex-col rounded-md border border-fd-border bg-fd-card px-4 py-3.5 shadow-sm",children:[(0,t.jsx)(p,{}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(x,{tone:"review",children:e.badge}),(0,t.jsx)("p",{className:"text-[19px] font-semibold leading-7 text-fd-foreground",children:e.title})]}),(0,t.jsx)("p",{className:"mt-1.5 text-[15px] leading-6 text-fd-muted-foreground",children:e.caption}),(0,t.jsx)("ul",{className:"mt-auto flex flex-wrap gap-x-4 gap-y-1.5 pt-2.5",children:e.checks.map(e=>(0,t.jsxs)("li",{className:"inline-flex items-center gap-1.5 text-[13px] leading-5 text-fd-muted-foreground",children:[(0,t.jsx)("svg",{"aria-hidden":"true",className:"h-3.5 w-3.5 flex-none text-fuchsia-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("polyline",{points:"4 12 10 18 20 6"})}),(0,t.jsx)("span",{children:e})]},e))})]})},merged:function({data:e}){return(0,t.jsxs)("div",{style:{width:420,height:196},className:"flex flex-col rounded-md border border-emerald-300/55 bg-fd-card px-4 py-3.5 shadow-sm",children:[(0,t.jsx)(p,{}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(x,{tone:"merged",children:e.badge}),(0,t.jsx)("p",{className:"text-[19px] font-semibold leading-7 text-fd-foreground",children:e.title})]}),(0,t.jsx)("p",{className:"mt-1.5 text-[15px] leading-6 text-fd-muted-foreground",children:e.caption}),(0,t.jsx)("div",{className:"mt-auto flex flex-wrap gap-4 pt-2.5",children:e.paths.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 font-mono text-[15px] font-semibold tracking-tight",style:{color:e.color},children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"h-2 w-2 flex-none rounded-full",style:{background:e.color}}),e.label]},e.label))})]})}};e.s(["ContextReviewLoop",0,function(){return(0,t.jsx)("section",{id:"review-loop",className:"not-prose my-10 w-full max-w-full min-w-0 scroll-mt-24","aria-labelledby":"review-loop-title",children:(0,t.jsxs)("article",{className:"max-w-full min-w-0 overflow-hidden rounded-lg border border-fd-border bg-fd-card shadow-sm","aria-label":"The ktx context review loop",children:[(0,t.jsxs)("div",{className:"border-b border-fd-border bg-fd-muted/35 px-5 py-4",children:[(0,t.jsxs)("a",{href:"#review-loop",className:"group/anchor inline-flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-fd-
1primary transition-colors hover:text-fd-primary/80",children:["The review loop",(0,t.jsx)("span",{"aria-hidden":"true",className:"opacity-0 transition-opacity duration-150 group-hover/anchor:opacity-100 group-focus-visible/anchor:opacity-100",children:"#"})]}),(0,t.jsx)("h3",{id:"review-loop-title",className:"mt-1 text-base font-semibold tracking-normal text-fd-foreground sm:text-lg",style:{fontFamily:"var(--font-display)"},children:"Every ingest is a diff you can refuse"}),(0,t.jsx)("p",{className:"mt-2 max-w-3xl text-xs leading-5 text-fd-muted-foreground",children:"Evidence becomes file changes. File changes become a PR. The PR merges into the layer agents will read tomorrow, and what you merged today becomes the baseline for the next run."}),(0,t.jsxs)("p",{className:"mt-2 inline-flex items-center gap-1.5 text-[10.5px] font-medium uppercase tracking-[0.06em] text-fd-muted-foreground",children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"inline-block h-px w-6",style:{borderTop:`1.5px dashed ${n}`}}),"dashed line: merged files feed the next ingest"]})]}),(0,t.jsx)(r.FlowCanvas,{nodes:i,edges:m,nodeTypes:f,canvasStyle:{height:"min(1080px, 160vw)",minHeight:760},translateExtent:[[-160,-120],[960,1696]],ariaLabel:"ktx context review loop diagram"})]})})}])},33971,e=>{"use strict";var t=e.i(33736),s=e.i(66417);e.s(["CopyButton",0,function({text:e,className:a=""}
1){let[r,o]=(0,s.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),1500)}catch{}};return(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":r?"Copied":"Copy code",className:`inline-flex items-center justify-center w-9 h-9 rounded-md transition-all hover:bg-fd-muted ${a}`,children:r?(0,t.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",className:"text-emerald-400","aria-hidden":"true",children:(0,t.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,t.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"opacity-70","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}])},64838,e=>{"use strict";var t=e.i(33736),s=e.i(33814),a=e.i(85629),r=e.i(66417),o=e.i(1066);let n="#94a3b8",i=[{title:"Databases",body:"Schemas, keys, row counts, query history.",items:["PostgreSQL","Snowflake","BigQuery","Athena","MongoDB","& more"],accent:"#3b82f6"},{title:"BI tools",body:"Dashboards, questions, explores, usage, and trusted examples.",items:["Metabase","Looker","Sigma"],accent:"#f97316"},{title:"Modeling code",body:"Existing metrics, dimensions, models, joins, and entities.",items:["dbt","LookML","MetricFlow"],accent:"#f59e0b"},{title:"Docs and notes",body:"Policies, caveats, team definitions, and analyst context.",items:["Notion","Google Drive","Any text"],accent:"#10b981"}],l=[{title:"Source connectors",body:"Read each configured system in its native shape."},{title:"Context builder",body:"Turn source evidence into proposed context updates."},{title:"Reconciliation",body:"Reconcile new evidence with the context that already exists."},{title:"Validation",body:"Check references and semantics before agents rely on them."}],d=[{title:"Wiki",path:"wiki/*.md",tags:["free-form","auto-maintained"],body:"Definitions, caveats, policies, analyst notes, and business language that agents can search.",accent:"#10b981"},{title:"Semantic layer",path:"semantic-layer/*.yaml",tags:["structured","executable","auto-maintained"],body:"Metrics, joins, tables, dimensions, filters, and segments that ktx can validate and compile into SQL.",accent:"#3b82f6"}],c=[...i.map((e,t)=>({id:`source-${t}`,type:"source",position:{x:4+234*t,y:80},data:e,draggable:!1,selectable:!1})),...l.map((e,t)=>({id:`stage-${t}`,type:"stage",position:{x:280,y:380+150*t},data:{...e,index:t+1},draggable:!1,selectable:!1})),...d.map((e,t)=>({id:`output-${t}`,type:"output",position:{x:30+520*t,y:1030},data:e,draggable:!1,selectable:!1}))],m="#64748b",x=[...i.map((e,t)=>({id:`e-source-${t}-stage-0`,source:`source-${t}`,target:"stage-0"})),...l.slice(0,-1).map((e,t)=>({id:`e-stage-${t}-stage-${t+1}`,source:`stage-${t}`,target:`stage-${t+1}`})),...d.map((e,t)=>({id:`e-stage-3-output-${t}`,source:"stage-3",target:`output-${t}`}))].map(e=>({...e,type:"smoothstep",style:{stroke:n,strokeWidth:1.5},markerEnd:{type:s.MarkerType.ArrowClosed,color:n,width:16,height:16}})),p={id:"e-output-refs",source:"output-0",sourceHandle:"right",target:"output-1",targetHandle:"left",type:"straight",label:"references",labelBgPadding:[6,3],labelBgBorderRadius:4,labelStyle:{fontSize:15,fontWeight:500,fill:"var(--color-fd-muted-foreground)"},labelBgStyle:{fill:"var(--color-fd-background)",stroke:"var(--color-fd-border)",strokeWidth:1},style:{stroke:m,strokeWidth:1.25,strokeDasharray:"4 4"},markerStart:{type:s.MarkerType.ArrowClosed,color:m,width:14,height:14},markerEnd:{type:s.MarkerType.ArrowClosed,color:m,width:14,height:14}},u={source:function({data:e}){return(0,t.jsxs)("div",{style:{width:210,height:220,borderTop:`3px solid ${e.accent}`},className:"overflow-hidden rounded-md border border-fd-border bg-fd-card px-3.5 py-3 shadow-sm",children:[(0,t.jsx)(a.Handle,{type:"target",position:s.Position.Top,className:"!opacity-0"}),(0,t.jsx)("p",{className:"text-[19px] font-semibold leading-7 text-fd-foreground",children:e.title}),(0,t.jsx)("p",{className:"mt-1.5 line-clamp-3 text-[15px] leading-6 text-fd-muted-foreground",children:e.body}),(0,t.jsx)("div",{className:"mt-2.5 flex flex-wrap gap-1.5",children:e.items.map(e=>(0,t.jsx)("span",{className:"rounded border border-fd-border bg-fd-background px-2 py-0.5 text-[13px] leading-5 text-fd-muted-foreground",children:e},e))}),(0,t.jsx)(a.Handle,{type:"source",position:s.Position.Bottom,className:"!opacity-0"})]})},stage:function({data:e}){return(0,t.jsxs)("div",{style:{width:360,height:120},className:"flex items-center gap-3.5 rounded-md border border-cyan-200/20 bg-[#0f1f23] px-4 py-3.5 text-white shadow-sm dark:bg-[#0b181b]",children:[(0,t.jsx)(a.Handle,{type:"target",position:s.Position.Top,className:"!opacity-0"}),(0,t.jsx)("span",{className:"flex h-9 w-9 flex-none items-center justify-center rounded-full bg-cyan-300/95 font-mono text-base font-semibold text-[#0b1c20]",children:e.index}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-[19px] font-semibold leading-7 text-white",children:e.title}),(0,t.jsx)("p",{className:"mt-1.5 line-clamp-3 text-[15px] leading-6 text-cyan-50/75",children:e.body})]}),(0,t.jsx)(a.Handle,{type:"source",position:s.Position.Bottom,className:"!opacity-0"})]})},output:function({data:e}){return(0,t.jsxs)("div",{style:{width:340,height:248,borderTop:`3px solid ${e.accent}`},className:"overflow-hidden rounded-md border border-fd-border bg-fd-card px-4 py-3.5 shadow-sm",children:[(0,t.jsx)(a.Handle,{type:"target",position:s.Position.Top,className:"!opacity-0"}),(0,t.jsx)(a.Handle,{id:"left",type:"target",position:s.Position.Left,className:"!opacity-0"}),(0,t.jsx)(a.Handle,{id:"right",type:"source",position:s.Position.Right,className:"!opacity-0"}),(0,t.jsx)("p",{className:"font-mono text-[15px] font-semibold tracking-tight",style:{color:e.accent},children:e.path}),(0,t.jsx)("p",{className:"mt-1.5 text-[19px] font-semibold leading-7 text-fd-foreground",children:e.title}),(0,t.jsx)("div",{className:"mt-2 flex flex-nowrap gap-1",children:e.tags.map(e=>(0,t.jsx)("span",{className:"whitespace-nowrap rounded border border-fd-border bg-fd-background px-2 py-0.5 text-[13px] leading-5 text-fd-muted-foreground",children:e},e))}),(0,t.jsx)("p",{className:"mt-2.5 line-clamp-3 text-[15px] leading-6 text-fd-muted-foreground",children:e.body})]})}},g={particle:function({id:e,data:s}){if(!s)return null;let a=`mechanics-particle-path-${e}`;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("path",{id:a,d:s.d,fill:"none",stroke:"none",pointerEvents:"none"}),(0,t.jsxs)("g",{className:"mechanics-particle",style:{color:s.color},children:[(0,t.jsx)("circle",{r:7.5,fill:"currentColor",opacity:.16}),(0,t.jsx)("circle",{r:3.75,fill:"currentColor",opacity:.32}),(0,t.jsx)("circle",{r:2.1,fill:"currentColor"}),(0,t.jsx)("animateMotion",{dur:`${s.duration.toFixed(2)}s`,begin:`-${s.beginOffset.toFixed(2)}
1s`,repeatCount:"indefinite",children:(0,t.jsx)("mpath",{href:`#${a}`})})]})]})}},h=[...x,p];function f(e){let{d:t,length:a}=function(e,t){let a=[[4+234*e+105,300,460,380],[460,500,460,530],[460,650,460,680],[460,800,460,830],[460,950,30+520*t+170,1030]],r=a.map(([e,t,a,r])=>{let[o]=(0,s.getSmoothStepPath)({sourceX:e,sourceY:t,sourcePosition:s.Position.Bottom,targetX:a,targetY:r,targetPosition:s.Position.Top});return o}),o=r[0];for(let e=1;e<r.length;e+=1)o+=` ${r[e].replace(/^M/,"L")}`;return{d:o,length:a.reduce((e,[t,s,a,r])=>e+Math.abs(a-t)+Math.abs(r-s),0)}}(e.sourceIndex,e.outputIndex),r=Math.max(4,a/130);return{id:e.id,source:`source-${e.sourceIndex}`,target:`output-${e.outputIndex}`,type:"particle",data:{d:t,duration:r,beginOffset:Math.random()*r,color:i[e.sourceIndex].accent}}}e.s(["ProductMechanics",0,function(){let[e,s]=(0,r.useState)([]);(0,r.useEffect)(()=>{s(function(){let e=[];for(let t=0;t<i.length;t+=1)for(let s=0;s<2;s+=1)e.push({id:`particle-${t}-${s}`,sourceIndex:t,outputIndex:Math.floor(Math.random()*d.length)});return e}())},[]);let a=(0,r.useMemo)(()=>[...h,...e.map(f)],[e]);return(0,t.jsxs)("section",{className:"not-prose my-12 w-full max-w-full min-w-0 space-y-5","aria-labelledby":"mechanics-title",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h2",{id:"mechanics-title",className:"text-xl font-semibold tracking-normal text-fd-foreground sm:text-2xl",style:{fontFamily:"var(--font-display)"},children:"How ingestion works"}),(0,t.jsx)("p",{className:"mt-3 text-sm leading-6 text-fd-muted-foreground",children:"ktx ingests source evidence, reconciles it with your existing project, and produces durable context that agents can search, review, and execute."})]}),(0,t.jsxs)("article",{className:"max-w-full min-w-0 overflow-hidden rounded-lg border border-fd-border bg-fd-card shadow-sm","aria-label":"ktx ingestion flow from source systems to durable context outputs",children:[(0,t.jsxs)("div",{className:"border-b border-fd-border bg-fd-muted/35 px-5 py-4",children:[(0,t.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-fd-primary",children:"Ingestion flow"}),(0,t.jsx)("h3",{className:"mt-1 text-base font-semibold tracking-normal text-fd-foreground sm:text-lg",style:{fontFamily:"var(--font-display)"},children:"From scattered source systems to agent-ready context"}),(0,t.jsx)("p",{className:"mt-2 max-w-3xl text-xs leading-5 text-fd-muted-foreground",children:"The inputs can be structured systems or loose team knowledge. The outputs are the two files agents need: a readable wiki and an executable semantic layer."})]}),(0,t.jsx)(o.FlowCanvas,{nodes:c,edges:a,nodeTypes:u,edgeTypes:g,canvasStyle:{height:"min(1240px, 170vw)",minHeight:720},className:"mechanics-canvas",fitViewOptions:{padding:.04},ariaLabel:"ktx ingestion flow diagram"})]}),(0,t.jsx)("style",{children:`
2        .mechanics-canvas .mechanics-particle {
3          pointer-events: none;
4          filter: drop-shadow(0 0 6px currentColor);
5        }
6        @media (prefers-reduced-motion: reduce) {
7          .mechanics-canvas .mechanics-particle {
8            display: none;
9          }
10        }
11      `})]})}])},62651,e=>{"use strict";var t=e.i(33736),s=e.i(33814),a=e.i(85629),r=e.i(1066);let o=489,n="#94a3b8",i="#0e7490",l="#0e7490",d=[{id:"agent",type:"agent",position:{x:344,y:0},data:{title:"Your agent",items:["Claude Code","Cursor","Codex"]},draggable:!1,selectable:!1},{id:"hub",type:"hub",position:{x:317,y:196},data:{title:"ktx",badge:"MCP + CLI",rows:["Search wiki + semantic layer","Return approved metrics","Compile metrics → SQL"]},draggable:!1,selectable:!1},{id:"context",type:"target",position:{x:183,y:488},data:{accent:l,title:"Context layer",body:"Approved definitions agents search before they answer.",rows:[{text:"wiki/*.md",color:"#059669",mono:!0},{text:"semantic-layer/*.yaml",color:l,mono:!0}]},draggable:!1,selectable:!1},{id:"warehouse",type:"target",position:{x:489,y:488},data:{accent:"#334155",title:"Database",badge:"read-only",body:"Runs the compiled SQL. ktx never writes to it.",rows:[]},draggable:!1,selectable:!1}],c={labelBgPadding:[6,3],labelBgBorderRadius:4,labelStyle:{fontSize:13,fontWeight:600,fill:"var(--color-fd-muted-foreground)"},labelBgStyle:{fill:"var(--color-fd-background)",stroke:"var(--color-fd-border)",strokeWidth:1}},m={type:s.MarkerType.ArrowClosed,color:n,width:16,height:16},x=[{id:"e-ask",source:"agent",sourceHandle:"ask",target:"hub",targetHandle:"ask",type:"straight",label:"ask",...c,style:{stroke:n,strokeWidth:1.5},markerEnd:m},{id:"e-answer",source:"hub",sourceHandle:"answer",target:"agent",targetHandle:"answer",type:"straight",label:"answer",...c,style:{stroke:n,strokeWidth:1.5},markerEnd:m},{id:"e-search",source:"hub",sourceHandle:"to-context",target:"context",targetHandle:"in",type:"smoothstep",label:"search + read",...c,style:{stroke:i,strokeWidth:1.5},markerStart:{type:s.MarkerType.ArrowClosed,color:i,width:14,height:14},markerEnd:{type:s.MarkerType.ArrowClosed,color:i,width:14,height:14}},{id:"e-readonly",source:"hub",sourceHandle:"to-warehouse",target:"warehouse",targetHandle:"in",type:"smoothstep",label:"read-only",...c,style:{stroke:i,strokeWidth:1.5},markerStart:{type:s.MarkerType.ArrowClosed,color:i,width:14,height:14},markerEnd:{type:s.MarkerType.ArrowClosed,color:i,width:14,height:14}}],p=432.2,u=507.8,g=431.75,h=508.25;function f(e,t,a,r,o){let{d:n,length:l}=function(e,t){let a=[{sx:p,sy:96,sPos:s.Position.Bottom,tx:g,ty:196,tPos:s.Position.Top},{sx:g,sy:196,sPos:s.Position.Bottom,tx:e,ty:386,tPos:s.Position.Top},{sx:e,sy:386,sPos:s.Position.Bottom,tx:t,ty:488,tPos:s.Position.Top},{sx:t,sy:488,sPos:s.Position.Top,tx:e,ty:386,tPos:s.Position.Bottom},{sx:e,sy:386,sPos:s.Position.Top,tx:h,ty:196,tPos:s.Position.Bottom},{sx:h,sy:196,sPos:s.Position.Top,tx:u,ty:96,tPos:s.Position.Bottom}],r=a.map(e=>{let[t]=(0,s.getSmoothStepPath)({sourceX:e.sx,sourceY:e.sy,sourcePosition:e.sPos,targetX:e.tx,targetY:e.ty,targetPosition:e.tPos});return t}),o=r[0];for(let e=1;e<r.length;e+=1)o+=` ${r[e].replace(/^M/,"L")}`;return{d:o,length:a.reduce((e,t)=>
11e+Math.abs(t.tx-t.sx)+Math.abs(t.ty-t.sy),0)}}(a,r),d=Math.max(5,l/150);return{id:e,source:t,target:t,type:"particle",data:{d:n,duration:d,beginOffset:d*o,color:i}}}let b=[f("p-context","context",451.64,317,0),f("p-warehouse","warehouse",488.36,o+134,.5)],y={agent:function({data:e}){return(0,t.jsxs)("div",{style:{width:252,height:96},className:"flex flex-col justify-center rounded-md border border-fd-border bg-fd-card px-3.5 py-2.5 shadow-sm",children:[(0,t.jsx)(a.Handle,{id:"ask",type:"source",position:s.Position.Bottom,className:"!opacity-0",style:{left:"35%"}}),(0,t.jsx)(a.Handle,{id:"answer",type:"target",position:s.Position.Bottom,className:"!opacity-0",style:{left:"65%"}}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("span",{className:"flex h-8 w-8 flex-none items-center justify-center rounded-full bg-fd-primary/15 text-fd-primary",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"6",width:"18",height:"12",rx:"3"}),(0,t.jsx)("circle",{cx:"9",cy:"12",r:"1.25",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"15",cy:"12",r:"1.25",fill:"currentColor",stroke:"none"}),(0,t.jsx)("path",{d:"M12 3v3"})]})}),(0,t.jsx)("p",{className:"text-[17px] font-semibold leading-6 text-fd-foreground",children:e.title})]}),(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.items.map(e=>(0,t.jsx)("span",{className:"rounded border border-fd-border bg-fd-background px-1.5 py-0.5 text-[12px] leading-5 text-fd-muted-foreground",children:e},e))})]})},hub:function({data:e}){return(0,t.jsxs)("div",{style:{width:306,height:190},className:"relative flex flex-col rounded-md border border-cyan-200/20 bg-[#0f1f23] px-4 py-3.5 text-white shadow-sm dark:bg-[#0b181b]",children:[(0,t.jsx)(a.Handle,{id:"ask",type:"target",position:s.Position.Top,className:"!opacity-0",style:{left:"37.5%"}}),(0,t.jsx)(a.Handle,{id:"answer",type:"source",position:s.Position.Top,className:"!opacity-0",style:{left:"62.5%"}}),(0,t.jsx)(a.Handle,{id:"to-context",type:"source",position:s.Position.Bottom,className:"!opacity-0",style:{left:"44%"}}),(0,t.jsx)(a.Handle,{id:"to-warehouse",type:"source",position:s.Position.Bottom,className:"!opacity-0",style:{left:"56%"}}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("span",{className:"flex h-7 w-7 flex-none items-center justify-center rounded-md bg-cyan-300/95 font-mono text-sm font-bold text-[#0b1c20]",children:"k"}),(0,t.jsx)("span",{className:"text-[19px] font-bold leading-6 text-white",children:e.title}),(0,t.jsx)("span",{className:"ml-1 rounded border border-cyan-200/30 bg-white/5 px-1.5 py-0.5 font-mono text-[11px] leading-5 text-cyan-100/85",children:e.badge})]}),(0,t.jsx)("div",{className:"mt-3 flex flex-1 flex-col justify-center gap-2",children:e.rows.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 flex-none rounded-full bg-cyan-300/95"}),(0,t.jsx)("span",{className:"text-[14px] font-medium leading-5 text-cyan-50/90",children:e})]},e))})]})},target:function({data:e}){return(0,t.jsxs)("div",{style:{width:268,height:148,borderTop:`3px solid ${e.accent}`},className:"overflow-hidden rounded-md border border-fd-border bg-fd-card px-3.5 py-3 shadow-sm",children:[(0,t.jsx)(a.Handle,{id:"in",type:"target",position:s.Position.Top,className:"!opacity-0"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-[17px] font-semibold leading-6 text-fd-foreground",children:e.title}),e.badge?(0,t.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[11px] font-semibold leading-5",style:{color:e.accent,background:"color-mix(in oklch, var(--color-fd-card) 86%, #64748b)"},children:e.badge}):null]}),e.rows.length>0?(0,t.jsx)("div",{className:"mt-1 flex flex-col gap-0.5",children:e.rows.map(e=>(0,t.jsx)("span",{className:e.mono?"font-mono text-[13px] font-semibold tracking-tight":"text-[12px] leading-4 text-fd-muted-foreground",style:e.color?{color:e.color}:void 0,children:e.text},e.text))}):null,(0,t.jsx)("p",{className:"mt-1.5 line-clamp-2 text-[13px] leading-[18px] text-fd-muted-foreground",children:e.body})]})}},w={particle:function({id:e,data:s}){if(!s)return null;let a=`runtime-particle-path-${e}`;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("path",{id:a,d:s.d,fill:"none",stroke:"none",pointerEvents:"none"}),(0,t.jsxs)("g",{className:"runtime-particle",style:{color:s.color},children:[(0,t.jsx)("circle",{r:7.5,fill:"currentColor",opacity:.16}),(0,t.jsx)("circle",{r:3.75,fill:"currentColor",opacity:.32}),(0,t.jsx)("circle",{r:2.1,fill:"currentColor"}),(0,t.jsx)("animateMotion",{dur:`${s.duration.toFixed(2)}s`,begin:`-${s.beginOffset.toFixed(2)}
11s`,repeatCount:"indefinite",children:(0,t.jsx)("mpath",{href:`#${a}`})})]})]})}},j=[...x,...b];e.s(["ProductRuntime",0,function(){return(0,t.jsxs)("section",{className:"not-prose my-12 w-full max-w-full min-w-0 space-y-5","aria-labelledby":"runtime-title",children:[(0,t.jsxs)("div",{className:"max-w-3xl",children:[(0,t.jsx)("h2",{id:"runtime-title",className:"text-xl font-semibold tracking-normal text-fd-foreground sm:text-2xl",style:{fontFamily:"var(--font-display)"},children:"How serving works"}),(0,t.jsx)("p",{className:"mt-3 text-sm leading-6 text-fd-muted-foreground",children:"At runtime, agents reach ktx through MCP. ktx searches the context layer, returns approved metrics, and compiles them into read-only SQL the warehouse runs."})]}),(0,t.jsxs)("article",{className:"max-w-full min-w-0 overflow-hidden rounded-lg border border-fd-border bg-fd-card shadow-sm","aria-label":"ktx serving flow from an agent request to a governed answer",children:[(0,t.jsxs)("div",{className:"border-b border-fd-border bg-fd-muted/35 px-5 py-4",children:[(0,t.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-fd-primary",children:"Serving flow"}),(0,t.jsx)("h3",{className:"mt-1 text-base font-semibold tracking-normal text-fd-foreground sm:text-lg",style:{fontFamily:"var(--font-display)"},children:"From an agent request to a governed answer"}),(0,t.jsx)("p",{className:"mt-2 max-w-3xl text-xs leading-5 text-fd-muted-foreground",children:"The agent asks in plain language. ktx is the only thing that touches the context layer and the warehouse, and every database connection is read-only."})]}),(0,t.jsx)(r.FlowCanvas,{nodes:d,edges:j,nodeTypes:y,edgeTypes:w,canvasStyle:{height:"min(620px, 98vw)",minHeight:430},className:"runtime-canvas",fitViewOptions:{padding:.06},ariaLabel:"ktx serving flow diagram"})]}),(0,t.jsx)("style",{children:`
12        .runtime-canvas .runtime-particle {
13          pointer-events: none;
14          filter: drop-shadow(0 0 6px currentColor);
15        }
16        @media (prefers-reduced-motion: reduce) {
17          .runtime-canvas .runtime-particle {
18            display: none;
19          }
20        }
21      `})]})}])},30396,e=>{"use strict";var t=e.i(33736),s=e.i(66417),a=e.i(85629),r=e.i(33814),o=e.i(1066);let n="#94a3b8",i="#0891b2",l={padding:.05},d=[{id:"agent",type:"agent",position:{x:370,y:16},data:{variant:"single",title:"Data agent",subtitle:"Asks: monthly net revenue and open tickets per segment, high-value orders only, no test customers"},draggable:!1,selectable:!1},{id:"manual-sql",type:"manualSql",position:{x:32,y:248},data:{variant:"manual",badge:"Without ktx",title:"Agent writes the SQL",caption:"Stitches four tables, mixes grains, and ships numbers that won't match the dashboard.",code:`-- agent stitches four tables, mixes facts,
22-- and ships numbers that won't match the dashboard
23
24SELECT
25  c.segment,
26  DATE_TRUNC('month', o.created_at)  AS month,
27  SUM(o.amount) - SUM(r.amount)      AS net_revenue,
28  COUNT(t.id)                        AS open_tickets
29FROM customers c
30LEFT JOIN orders  o
31  ON o.customer_id = c.id
32LEFT JOIN refunds r
33  ON r.order_id = o.id
34LEFT JOIN tickets t
35  ON t.customer_id = c.id
36WHERE
37  c.is_test = false
38  AND o.amount >= 100
39  AND t.status = 'open'     -- turns LEFT JOIN into INNER
40GROUP BY
41  c.segment,
42  DATE_TRUNC('month', o.created_at)
43ORDER BY
44  month,
45  c.segment
46LIMIT 1000;
47
48-- chasm trap: orders rows multiply by tickets and refunds
49-- net_revenue and open_tickets are both inflated
50-- DATE_TRUNC syntax breaks on BigQuery`,notes:[{id:1,label:"Re-stitches a 4-way join on every question"},{id:2,label:"Reinvents net_revenue and the high-value rule"},{id:3,label:"Hides a chasm trap across three facts"},{id:4,label:"Filters a LEFT JOIN target in WHERE"},{id:5,label:"Hardcodes one warehouse's date functions"}],lineIssues:{5:[5],6:[2,3],7:[3],8:[1],9:[1],10:[1],11:[1],12:[1],13:[1],14:[1],17:[2],18:[4],21:[5],27:[3],28:[3],29:[5]}},draggable:!1,selectable:!1},{id:"sl-query",type:"slQuery",position:{x:600,y:248},data:{variant:"slQuery",badge:"With ktx",title:"Agent sends a semantic query",caption:"Names the measures, dimensions, segments, and filters it wants. No SQL, no joins.",code:`{
51  "measures": [
52    "orders.revenue",
53    "refunds.amount",
54    "tickets.open_count",
55    {
56      "name": "net_revenue",
57      "expr": "orders.revenue - refunds.amount"
58    }
59  ],
60  "dimensions": [
61    "customers.segment",
62    { "field": "orders.created_at", "granularity": "month" }
63  ],
64  "segments": ["orders.high_value"],
65  "filters": ["customers.is_test = false"],
66  "limit": 1000
67}`},draggable:!1,selectable:!1},{id:"engine",type:"engine",position:{x:600,y:782},data:{variant:"engine",badge:"Semantic-layer engine",title:"Plans the query against the reviewed graph",stages:[{index:1,title:"Resolve refs",detail
67:"qualify columns, look up measure formulas"},{index:2,title:"Build join tree",detail:"Dijkstra over typed edges from an anchor source"},{index:3,title:"Detect fanout",detail:"group measures by source, flag chasm traps"},{index:4,title:"Localize aggregation",detail:"pre-aggregate each fact as its own CTE"},{index:5,title:"Transpile dialect",detail:"emit Postgres-shaped SQL, then target dialect"}]},draggable:!1,selectable:!1},{id:"compiled-sql",type:"compiledSql",position:{x:600,y:1186},data:{variant:"compiled",badge:"Generated SQL",title:"ktx returns dialect-correct SQL",caption:"Pre-aggregates each fact at its own grain, then joins back on the shared dimension.",code:`WITH orders_agg AS (
68  SELECT
69    customer_id,
70    DATE_TRUNC('month', created_at) AS month,
71    SUM(amount) AS revenue
72  FROM public.orders
73  WHERE amount >= 100
74  GROUP BY
75    customer_id,
76    DATE_TRUNC('month', created_at)
77),
78refunds_agg AS (
79  SELECT
80    o.customer_id,
81    DATE_TRUNC('month', o.created_at) AS month,
82    SUM(r.amount) AS refund_amount
83  FROM public.refunds r
84  JOIN public.orders o
85    ON o.id = r.order_id
86  WHERE o.amount >= 100
87  GROUP BY
88    o.customer_id,
89    DATE_TRUNC('month', o.created_at)
90),
91tickets_agg AS (
92  SELECT
93    customer_id,
94    DATE_TRUNC('month', opened_at) AS month,
95    COUNT(*) AS open_count
96  FROM public.tickets
97  WHERE status = 'open'
98  GROUP BY
99    customer_id,
100    DATE_TRUNC('month', opened_at)
101)
102SELECT
103  c.segment,
104  o.month,
105  SUM(o.revenue - COALESCE(r.refund_amount, 0)) AS net_revenue,
106  SUM(o.revenue)                               AS revenue,
107  SUM(r.refund_amount)                         AS refund_amount,
108  SUM(COALESCE(t.open_count, 0))               AS open_tickets
109FROM public.customers c
110JOIN orders_agg o
111  ON o.customer_id = c.id
112LEFT JOIN refunds_agg r
113  ON r.customer_id = c.id
114 AND r.month = o.month
115LEFT JOIN tickets_agg t
116  ON t.customer_id = c.id
117 AND t.month = o.month
118WHERE c.is_test = false
119GROUP BY
120  c.segment,
121  o.month
122ORDER BY
123  o.month,
124  c.segment
125LIMIT 1000;`,notes:["Walks the reviewed join graph automatically","Uses the canonical net_revenue formula","Pre-aggregates each fact to avoid the chasm trap","Keeps LEFT JOIN filters on the dimension source","Transpiles DATE_TRUNC to the target dialect"]},draggable:!1,selectable:!1},{id:"warehouse",type:"warehouse",position:{x:408,y:2622},data:{variant:"warehouse",title:"Warehouse",drivers:["PostgreSQL","Snowflake","BigQuery"]},draggable:!1,selectable:!1}],c=e=>({type:r.MarkerType.ArrowClosed,color:e,width:16,height:16}),m=[{id:"agent-manual",source:"agent",target:"manual-sql",type:"default",label:"writes raw SQL",labelBgPadding:[6,3],labelBgBorderRadius:4,labelStyle:{fontSize:12,fontWeight:500,fill:"var(--color-fd-muted-foreground)"},labelBgStyle:{fill:"var(--color-fd-background)",stroke:"var(--color-fd-border)",strokeWidth:1},style:{stroke:n,strokeWidth:1.5,strokeDasharray:"5 4"},markerEnd:c(n)},{id:"manual-warehouse",source:"manual-sql",target:"warehouse",targetHandle:"warehouse-manual",type:"default",style:{stroke:n,strokeWidth:1.5,strokeDasharray:"5 4"},markerEnd:c(n)},{id:"agent-slquery",source:"agent",target:"sl-query",type:"default",label:"sends semantic query",labelBgPadding:[6,3],labelBgBorderRadius:4,labelStyle:{fontSize:12,fontWeight:600,fill:i},labelBgStyle:{fill:"var(--color-fd-background)",stroke:"var(--color-fd-border)",strokeWidth:1},style:{stroke:i,strokeWidth:1.75},markerEnd:c(i)},{id:"slquery-engine",source:"sl-query",target:"engine",type:"straight",style:{stroke:i,strokeWidth:1.75},markerEnd:c(i)},{id:"engine-compiled",source:"engine",target:"compiled-sql",type:"straight",style:{stroke:i,strokeWidth:1.75},markerEnd:c(i)},{id:"compiled-warehouse",source:"compiled-sql",target:"warehouse",targetHandle:"warehouse-compiled",type:"straight",style:{stroke:i,strokeWidth:1.75},markerEnd:c(i)}];function x({variant:e,children:s}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 rounded-sm border px-2 py-0.5 text-[10.5px] font-semibold uppercase tracking-[0.08em] ${"manual"===e?"border-slate-300 bg-slate-100 text-slate-700 dark:border-slate-600/60 dark:bg-slate-700/40 dark:text-slate-200":"border-cyan-300/70 bg-cyan-50 text-cyan-800 dark:border-cyan-400/40 dark:bg-cyan-400/15 dark:text-cyan-100"}`,children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:"manual"===e?n:i}}),s]})}let p=/"(?:\\.|[^"\\])*"|-?\b\d+(?:\.\d+)?\b|\b(?:true|false|null)\b|[{}[\],:]/g,u=/--[^\n]*|'(?:''|[^'])*'|\b\d+(?:\.\d+)?\b|\b(?:select|from|join|left|right|inner|outer|on|where|group|by|order|limit|as|sum|count|coalesce|date_trunc|case|when|then|else|end|and|or|is|not|null|false|true|with|having|over|partition)\b|[(),.;=*<>+-]/gi,g=new Set(["sum","count","coalesce","date_trunc"]);function h(e){let s=[],a=0,r=0;for(let o of e.matchAll(u)){let n=o[0],i=o.index??0;i>a&&s.push(e.slice(a,i));let l=n.toLowerCase(),d=n.startsWith("--")?"syntax-comment":n.startsWith("'")?"syntax-string":/^\d/.test(n)?"syntax-number":g.has(l)?"syntax-function":/^[a-z_]+$/i.test(n)?"syntax-keyword":"syntax-punctuation";s.push((0,t.jsx)("span",{className:d,children:n},`sql-${r}`)),a=i+n.length,r+=1}return a<e.length&&s.push(e.slice(a)),s}function f({language:e,code:s,tone:a}){let r="json"===e?function(e){let s=[],a=0,r=0;for(let o of e.matchAll(p)){let n=o[0],i=o.index??0;i>a&&s.push(e.slice(a,i));let l=e.slice(i+n.length),d=n.startsWith('"')?/^\s*:/.test(l)?"syntax-json-key":"syntax-string":/^-?\d/.test(n)?"syntax-number":/^(true|false|null)$/.test(n)?"syntax-constant":"syntax-punctuation";s.push((0,t.jsx)("span",{className:d,children:n},`json-${r}`)),a=i+n.length,r+=1}return a<e.length&&s.push(e.slice(a)),s}(s):"sql"===e?h(s):s;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-md border border-fd-border bg-[#fbfaf6] dark:bg-[#0c1417]",children:[(0,t.jsxs)("div",{className:"flex flex-none items-center justify-between border-b border-fd-border bg-fd-muted/40 px-3 py-1.5",children:[(0,t.jsx)("span",{className:`font-mono font-medium tracking-wide ${"manual"===a?"text-slate-600 dar
125k:text-slate-300":"slQuery"===a?"text-fd-primary":"text-fd-primary/90"}`,style:{fontSize:"11px",lineHeight:"16px"},children:e}),(0,t.jsx)("span",{className:"font-mono uppercase tracking-[0.08em] text-fd-muted-foreground",style:{fontSize:"10.5px",lineHeight:"16px"},children:"compiled"===a?"ktx-compiled":"agent-authored"})]}),(0,t.jsx)("pre",{className:"m-0 flex-1 overflow-auto px-3 py-2 font-mono text-fd-foreground",style:{fontSize:"11.5px",lineHeight:"17.5px"},children:r})]})}function b({code:e,lineIssues:s,activeIssue:a,onIssueEnter:r,onIssueLeave:o}){let n=e.split("\n");return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-md border border-fd-border bg-[#fbfaf6] dark:bg-[#0c1417]",children:[(0,t.jsxs)("div",{className:"flex flex-none items-center justify-between border-b border-fd-border bg-fd-muted/40 px-3 py-1.5",children:[(0,t.jsx)("span",{className:"font-mono font-medium tracking-wide text-slate-600 dark:text-slate-300",style:{fontSize:"11px",lineHeight:"16px"},children:"sql"}),(0,t.jsx)("span",{className:"font-mono uppercase tracking-[0.08em] text-fd-muted-foreground",style:{fontSize:"10.5px",lineHeight:"16px"},children:"agent-authored"})]}),(0,t.jsx)("pre",{className:"m-0 flex-1 overflow-auto px-2 py-2 font-mono text-fd-foreground",style:{fontSize:"11.5px",lineHeight:"17.5px"},children:n.map((e,n)=>{let i=s[n]??[],l=i.length>0,d=null!==a&&!i.includes(a),c=["sl-sql-line",l?"is-issue":"",null!==a&&i.includes(a)?"is-active":"",d?"is-dim":""].filter(Boolean).join(" ");return(0,t.jsxs)("div",{className:c,children:[(0,t.jsx)("span",{className:"sl-sql-gutter",children:i.map(e=>(0,t.jsx)("button",{type:"button",className:`sl-issue-pill sl-issue-pill-sql ${a===e?"is-active":""}`,onMouseEnter:()=>r(e),onMouseLeave:o,onFocus:()=>r(e),onBlur:o,"aria-label":`Issue ${e}`,children:e},e))}),(0,t.jsx)("span",{className:"sl-sql-content",children:e.length?h(e):" "})]},n)})})]})}let y={agent:function({data:e}){return(0,t.jsxs)("div",{style:{width:380,height:104},className:"flex items-center gap-3 rounded-md border border-fd-border bg-fd-card px-4 py-3 shadow-sm",children:[(0,t.jsx)(a.Handle,{type:"source",position:r.Position.Bottom,className:"!opacity-0"}),(0,t.jsx)("div",{className:"flex h-10 w-10 flex-none items-center justify-center rounded-full bg-fd-primary/15 text-fd-primary",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"3",y:"6",width:"18",height:"12",rx:"3"}),(0,t.jsx)("circle",{cx:"9",cy:"12",r:"1.25",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"15",cy:"12",r:"1.25",fill:"currentColor",stroke:"none"}),(0,t.jsx)("path",{d:"M12 3v3"})]})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-[15px] font-semibold leading-5 text-fd-foreground",children:e.title}),(0,t.jsx)("p",{className:"mt-0.5 text-[12px] leading-4 text-fd-muted-foreground",children:e.subt
125itle})]})]})},manualSql:function({data:e}){let[o,n]=(0,s.useState)(null),i=(0,s.useCallback)(()=>n(null),[]);return(0,t.jsxs)("div",{style:{width:488,height:840},className:"flex flex-col rounded-lg border border-fd-border bg-fd-card p-3.5 shadow-sm",children:[(0,t.jsx)(a.Handle,{type:"target",position:r.Position.Top,className:"!opacity-0"}),(0,t.jsx)("div",{className:"flex items-start justify-between gap-3",children:(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(x,{variant:"manual",children:e.badge}),(0,t.jsx)("p",{className:"mt-2 text-[15px] font-semibold leading-5 text-fd-foreground",children:e.title}),(0,t.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-fd-muted-foreground",children:e.caption})]})}),(0,t.jsx)("div",{className:"mt-3 min-h-0 flex-1",children:(0,t.jsx)(b,{code:e.code,lineIssues:e.lineIssues,activeIssue:o,onIssueEnter:n,onIssueLeave:i})}),(0,t.jsx)("ul",{className:"mt-3 grid gap-1.5 sm:grid-cols-2",children:e.notes.map(e=>{let s=null!==o&&o!==e.id,a=o===e.id;return(0,t.jsxs)("li",{className:`flex items-start gap-2 text-[11.5px] leading-4 transition-opacity duration-150 ${s?"opacity-35":""} ${a?"text-fd-foreground":"text-fd-muted-foreground"}`,onMouseEnter:()=>n(e.id),onMouseLeave:i,onFocus:()=>n(e.id),onBlur:i,tabIndex:0,children:[(0,t.jsx)("span",{className:`sl-issue-pill sl-issue-pill-note ${a?"is-active":""}`,"aria-hidden":"true",children:e.id}),(0,t.jsx)("span",{children:e.label})]},e.id)})}),(0,t.jsx)(a.Handle,{type:"source",position:r.Position.Bottom,className:"!opacity-0"})]})},slQuery:function({data:e}){return(0,t.jsxs)("div",{style:{width:488,height:510},className:"flex flex-col rounded-lg border border-fd-primary/40 bg-fd-card p-3.5 shadow-sm",children:[(0,t.jsx)(a.Handle,{type:"target",position:r.Position.Top,className:"!opacity-0"}),(0,t.jsx)("div",{className:"flex items-start justify-between gap-3",children:(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(x,{variant:"ktx",children:e.badge}),(0,t.jsx)("p",{className:"mt-2 text-[15px] font-semibold leading-5 text-fd-foreground",children:e.title}),(0,t.jsx)("p",{className:"mt-0.5 text-[12px] leading-4 text-fd-muted-foreground",children:e.caption})]})}),(0,t.jsx)("div",{className:"mt-2 min-h-0 flex-1 overflow-hidden",children:(0,t.jsx)(f,{language:"json",code:e.code,tone:"slQuery"})}),(0,t.jsx)(a.Handle,{type:"source",position:r.Position.Bottom,className:"!opacity-0"})]})},engine:function({data:e}){return(0,t.jsxs)("div",{style:{width:488,height:380},className:"relative flex flex-col rounded-lg border border-cyan-200/30 bg-[#0f1f23] p-3.5 text-white shadow-sm dark:bg-[#0b181b]",children:[(0,t.jsx)("span",{className:"absolute inset-y-0 left-0 w-[3px] rounded-l-lg",style:{background:i},"aria-hidden":"true"}),(0,t.jsx)(a.Handle,{type:"target",position:r.Position.Top,className:"!opacity-0"}),(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsx)("p",{className:"text-[10.5px] font-semibold uppercase tracking-[0.08em] text-cyan-300",children:e.badge})}),(0,t.jsx)("p",{className:"mt-1.5 text-[15px] font-semibold leading-5 text-white",children:e.title}),(0,t.jsx)("ol",{className:"mt-3 flex flex-1 flex-col gap-1.5",children:e.stages.map(e=>(0,t.jsxs)("li",{className:"flex items-start gap-3 rounded-md border border-cyan-100/15 bg-white/[0.04] px-3 py-2",children:[(0,t.jsx)("span",{className:"mt-0.5 flex h-6 w-6 flex-none items-center justify-center rounded-full bg-cyan-300/95 font-mono text-[11px] font-semibold text-[#0b1c20]",children:e.index}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-[13px] font-semibold leading-[18px] text-white",children:e.title}),(0,t.jsx)("p",{className:"mt-0.5 text-[11.5px] leading-[16px] text-cyan-50/80",children:e.detail})]})]},e.index))}),(0,t.jsx)(a.Handle,{type:"source",position:r.Position.Bottom,className:"!opacity-0"})]})},compiledSql:function({data:e}){return(0,t.jsxs)("div",{style:{width:488,height:1380},className:"flex flex-col rounded-lg border border-fd-primary/40 bg-fd-card p-3.5 shadow-sm",children:[(0,t.jsx)(a.Handle,{type:"target",position:r.Position.Top,className:"!opacity-0"}),(0,t.jsx)("div",{className:"flex items-start justify-between gap-3",children:(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(x,{variant:"ktx",children:e.badge}),(0,t.jsx)("p",{className:"mt-2 text-[15px] font-semibold leading-5 text-fd-foreground",children:e.title}),(0,t.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-fd-muted-foreground",children:e.caption})]})}),(0,t.jsx)("div",{className:"mt-3 min-h-0 flex-1",children:(0,t.jsx)(f,{language:"sql",code:e.code,tone:"compiled"})}),(0,t.jsx)("ul",{className:"mt-3 grid gap-1.5 sm:grid-cols-2",children:e.notes.map(e=>(0,t.jsxs)("li",{className:"flex items-start gap-1.5 text-[11.5px] leading-4 text-fd-muted-foreground",children:[(0,t.jsx)("span",{className:"mt-[6px] h-1 w-1 flex-none rounded-full",style:{background:i},"aria-hidden":"true"}),(0,t.jsx)("span",{children:e})]},e))}),(0,t.jsx)(a.Handle,{type:"source",position:r.Position.Bottom,className:"!opacity-0"})]})},warehouse:function({data:e}){return(0,t.jsxs)("div",{style:{width:304,height:92},className:"flex items-center gap-3 rounded-md border border-fd-border bg-fd-card px-4 py-3 shadow-sm",children:[(0,t.jsx)(a.Handle,{id:"warehouse-manual",type:"target",position:r.Position.Top,className:"!opacity-0",style:{left:"42%"}}),(0,t.jsx)(a.Handle,{id:"warehouse-compiled",type:"target",position:r.Position.Top,className:"!opacity-0",style:{left:"58%"}}),(0,t.jsx)("div",{className:"flex h-10 w-10 flex-none items-center justify-center rounded-md bg-fd-primary/12 text-fd-
125primary",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("ellipse",{cx:"12",cy:"5.5",rx:"8",ry:"2.6"}),(0,t.jsx)("path",{d:"M4 5.5v6.2c0 1.43 3.58 2.6 8 2.6s8-1.17 8-2.6V5.5"}),(0,t.jsx)("path",{d:"M4 11.7v6.2c0 1.43 3.58 2.6 8 2.6s8-1.17 8-2.6v-6.2"})]})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-[15px] font-semibold leading-5 text-fd-foreground",children:e.title}),(0,t.jsx)("p",{className:"mt-0.5 text-[11.5px] leading-4 text-fd-muted-foreground",children:e.drivers.join(" • ")})]})]})}};e.s(["SemanticLayerFlow",0,function(){return(0,t.jsxs)("section",{id:"imperative-vs-declarative",className:"not-prose my-10 w-full max-w-full min-w-0 space-y-4 scroll-mt-24","aria-labelledby":"sl-flow-title",children:[(0,t.jsxs)("article",{className:"max-w-full min-w-0 overflow-hidden rounded-lg border border-fd-border bg-fd-card shadow-sm","aria-label":"From semantic query to executed SQL: contrast between agent-authored SQL and ktx-compiled SQL",children:[(0,t.jsxs)("div",{className:"border-b border-fd-border bg-fd-muted/35 px-5 py-4",children:[(0,t.jsxs)("a",{href:"#imperative-vs-declarative",className:"group/anchor inline-flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-fd-primary transition-colors hover:text-fd-primary/80",children:["Imperative vs declarative",(0,t.jsx)("span",{"aria-hidden":"true",className:"opacity-0 transition-opacity duration-150 group-hover/anchor:opacity-100 group-focus-visible/anchor:opacity-100",children:"#"})]}),(0,t.jsx)("h3",{id:"sl-flow-title",className:"mt-1 text-base font-semibold tracking-normal text-fd-foreground sm:text-lg",style:{fontFamily:"var(--font-display)"},children:"Same answer, two contracts"}),(0,t.jsx)("p",{className:"mt-2 max-w-3xl text-xs leading-5 text-fd-muted-foreground",children:"On the left, the agent works imperatively: chooses tables, writes joins, picks the grain, and remembers each warehouse's dialect. On the right, the agent only declares what it wants. ktx handles every how."})]}),(0,t.jsx)(o.FlowCanvas,{nodes:d,edges:m,nodeTypes:y,canvasStyle:{height:"min(2340px, 290vw)",minHeight:1780},className:"sl-flow-canvas",fitViewOptions:l,ariaLabel:"Semantic query to SQL flow diagram"})]}),(0,t.jsx)("style",{children:`
126        .sl-flow-canvas pre {
127          font-size: 11.5px !important;
128          line-height: 17.5px !important;
129          background: transparent !important;
130          padding: 8px 12px !important;
131          border: 0 !important;
132          margin: 0 !important;
133          box-shadow: none !important;
134        }
135        .sl-flow-canvas .react-flow__node pre code,
136        .sl-flow-canvas .react-flow__node pre span {
137          font-size: inherit !important;
138          line-height: inherit !important;
139        }
140        .sl-flow-canvas .syntax-json-key {
141          color: #0f766e;
142        }
143        .sl-flow-canvas .syntax-keyword {
144          color: #0e7490;
145          font-weight: 650;
146        }
147        .sl-flow-canvas .syntax-function {
148          color: #7c3aed;
149          font-weight: 650;
150        }
151        .sl-flow-canvas .syntax-string {
152          color: #b45309;
153        }
154        .sl-flow-canvas .syntax-number,
155        .sl-flow-canvas .syntax-constant {
156          color: #be123c;
157        }
158        .sl-flow-canvas .syntax-comment {
159          color: #64748b;
160          font-style: italic;
161        }
162        .sl-flow-canvas .syntax-punctuation {
163          color: #64748b;
164        }
165        .sl-flow-canvas .sl-sql-line {
166          display: flex;
167          align-items: center;
168          min-height: 17.5px;
169          padding: 0 6px;
170          border-radius: 4px;
171          transition: background-color 140ms ease, opacity 140ms ease;
172        }
173        .sl-flow-canvas .sl-sql-line.is-issue {
174          background-color: rgba(239, 68, 68, 0.05);
175        }
176        .sl-flow-canvas .sl-sql-line.is-active {
177          background-color: rgba(239, 68, 68, 0.15);
178          box-shadow: inset 2px 0 0 0 #ef4444;
179        }
180        .sl-flow-canvas .sl-sql-line.is-dim {
181          opacity: 0.34;
182        }
183        .sl-flow-canvas .sl-sql-gutter {
184          display: inline-flex;
185          align-items: center;
186          gap: 3px;
187          flex: none;
188          width: 38px;
189          padding-right: 8px;
190        }
191        .sl-flow-canvas .sl-sql-content {
192          flex: 1;
193          min-width: 0;
194          white-space: pre;
195        }
196        .sl-flow-canvas .sl-issue-pill {
197          display: inline-flex;
198          align-items: center;
199          justify-content: center;
200          border-radius: 9999px;
201          background: #ef4444;
202          color: white;
203          font-weight: 700;
204          line-height: 1;
205          font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
206          border: 0;
207          padding: 0;
208          cursor: pointer;
209          transition: transform 140ms ease, box-shadow 140ms ease,
210            background-color 140ms ease;
211        }
212        .sl-flow-canvas .sl-issue-pill:focus-visible {
213          outline: none;
214          box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35);
215        }
216        .sl-flow-canvas .sl-issue-pill.is-active {
217          background: #dc2626;
218          box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28);
219          transform: scale(1.08);
220        }
221        .sl-flow-canvas .sl-issue-pill-sql {
222          width: 14px;
223          height: 14px;
224          font-size: 9.5px;
225        }
226        .sl-flow-canvas .sl-issue-pill-note {
227          width: 16px;
228          height: 16px;
229          font-size: 10.5px;
230          flex: none;
231          margin-top: 0;
232        }
233        .dark .sl-flow-canvas .sl-sql-line.is-issue {
234          background-color: rgba(248, 113, 113, 0.08);
235        }
236        .dark .sl-flow-canvas .sl-sql-line.is-active {
237          background-color: rgba(248, 113, 113, 0.2);
238          box-shadow: inset 2px 0 0 0 #f87171;
239        }
240        .dark .sl-flow-canvas .sl-issue-pill {
241          background: #f87171;
242          color: #1b0408;
243        }
244        .dark .sl-flow-canvas .sl-issue-pill.is-active {
245          background: #fca5a5;
246          box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.32);
247        }
248        .dark .sl-flow-canvas .syntax-json-key {
249          color: #5eead4;
250        }
251        .dark .sl-flow-canvas .syntax-keyword {
252          color: #67e8f9;
253        }
254        .dark .sl-flow-canvas .syntax-function {
255          color: #c4b5fd;
256        }
257        .dark .sl-flow-canvas .syntax-string {
258          color: #fbbf24;
259        }
260        .dark .sl-flow-canvas .syntax-number,
261        .dark .sl-flow-canvas .syntax-constant {
262          color: #fb7185;
263        }
264        .dark .sl-flow-canvas .syntax-comment {
265          color: #94a3b8;
266        }
267        .dark .sl-flow-canvas .syntax-punctuation {
268          color: #94a3b8;
269        }
270      `})]})}])}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.