@duckcodeailabs/dql-cli 1.13.2 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apps-api.d.ts +26 -3
- package/dist/apps-api.d.ts.map +1 -1
- package/dist/apps-api.js +1045 -175
- package/dist/apps-api.js.map +1 -1
- package/dist/assets/dql-notebook/assets/{AgentLogPage-BlUE3qsX.js → AgentLogPage-DYmHO6_i.js} +1 -1
- package/dist/assets/dql-notebook/assets/{AiBuildDialog-O88iK6UW.js → AiBuildDialog-BfhaOd1h.js} +1 -1
- package/dist/assets/dql-notebook/assets/{AiBuildResult-D-6G4Sh3.js → AiBuildResult-DLKFAe6R.js} +3 -3
- package/dist/assets/dql-notebook/assets/{AiSidePanel-MRSGtQDV.js → AiSidePanel-C6Z3URGr.js} +1 -1
- package/dist/assets/dql-notebook/assets/{AnalyticsHome-CcRVO6zN.js → AnalyticsHome-uG3xCP_s.js} +1 -1
- package/dist/assets/dql-notebook/assets/AppsView-DfieNjkh.js +5595 -0
- package/dist/assets/dql-notebook/assets/BlockStudio-90J_wvWL.js +55 -0
- package/dist/assets/dql-notebook/assets/{BusinessArtifactView-itEIUrYy.js → BusinessArtifactView-_zSMae5q.js} +1 -1
- package/dist/assets/dql-notebook/assets/{DbtFirstModelingPage-CbAqOpNc.js → DbtFirstModelingPage-DoXiPssu.js} +4 -4
- package/dist/assets/dql-notebook/assets/{GitPage-BxOqRYu2.js → GitPage-CUfAhS67.js} +3 -3
- package/dist/assets/dql-notebook/assets/{GlobalAiRail-Tfkx76CI.js → GlobalAiRail-ovtL7nQu.js} +1 -1
- package/dist/assets/dql-notebook/assets/{GovernedContextPage-CeaDbepP.js → GovernedContextPage-CaMiKAzA.js} +3 -3
- package/dist/assets/dql-notebook/assets/{HelpDocsPage-D1lAryYv.js → HelpDocsPage-CEGUx28b.js} +1 -1
- package/dist/assets/dql-notebook/assets/{HomePage-GB6se6xW.js → HomePage-2v3SRf8V.js} +1 -1
- package/dist/assets/dql-notebook/assets/{LineageDAG-zCyN-hdg.js → LineageDAG-AaqLEiBN.js} +1 -1
- package/dist/assets/dql-notebook/assets/{LineageDetailView-Cg0TgG2Y.js → LineageDetailView-CFc8pm91.js} +1 -1
- package/dist/assets/dql-notebook/assets/{LineageDrawer-DwMcenDf.js → LineageDrawer-DOkFjPq-.js} +1 -1
- package/dist/assets/dql-notebook/assets/{LineagePathBreadcrumb-DUZx3ksU.js → LineagePathBreadcrumb-BrDwCuMs.js} +3 -3
- package/dist/assets/dql-notebook/assets/{MiniLineageGraph-DT_ycl6s.js → MiniLineageGraph-CiHtQs3y.js} +1 -1
- package/dist/assets/dql-notebook/assets/{NewBlockModal-qdhzeJPF.js → NewBlockModal-DAgJZbws.js} +1 -1
- package/dist/assets/dql-notebook/assets/{NewNotebookModal-BnaDzs1A.js → NewNotebookModal-xjG7nZ3O.js} +1 -1
- package/dist/assets/dql-notebook/assets/{NotebookEditor-CouPFzdo.js → NotebookEditor-CXZaKfYT.js} +1 -1
- package/dist/assets/dql-notebook/assets/{ReadinessPage-DB_KbH9Y.js → ReadinessPage-MuJBFwwg.js} +1 -1
- package/dist/assets/dql-notebook/assets/{SetupOnboarding-CamQq_N2.js → SetupOnboarding-vKFtKtjh.js} +1 -1
- package/dist/assets/dql-notebook/assets/{SkillsPage--mYkOAK2.js → SkillsPage-DCFVOV5f.js} +1 -1
- package/dist/assets/dql-notebook/assets/{TrustBadge-ClEYiYeA.js → TrustBadge-TcwXFFHK.js} +1 -1
- package/dist/assets/dql-notebook/assets/{UnifiedAgentRunPanel-DBfsmXes.js → UnifiedAgentRunPanel-Cu-YgIe4.js} +1 -1
- package/dist/assets/dql-notebook/assets/{answer-to-notebook-Cg3UyGwh.js → answer-to-notebook-DCFWlHB7.js} +1 -1
- package/dist/assets/dql-notebook/assets/{arrow-left-DnYPGqlr.js → arrow-left-BLnlJAtp.js} +1 -1
- package/dist/assets/dql-notebook/assets/{arrow-right-Ct_YGrmU.js → arrow-right-BmUAb1aW.js} +1 -1
- package/dist/assets/dql-notebook/assets/{book-open-text-DULlwbj6.js → book-open-text-bdSChSag.js} +1 -1
- package/dist/assets/dql-notebook/assets/{circle-x-ByYxoiS9.js → circle-x-Cc6dEaf4.js} +1 -1
- package/dist/assets/dql-notebook/assets/{dagre.esm-BjYSO53F.js → dagre.esm-CPebQKQ9.js} +1 -1
- package/dist/assets/dql-notebook/assets/{external-link-DprWh9Yf.js → external-link-rmXvubf3.js} +1 -1
- package/dist/assets/dql-notebook/assets/{grip-vertical-CrEEYkXN.js → grip-vertical-Sg4zd5-Q.js} +1 -1
- package/dist/assets/dql-notebook/assets/index-mQd_pC-P.js +635 -0
- package/dist/assets/dql-notebook/assets/{link-2-BkW-rkEC.js → link-2-BLaPoFxW.js} +1 -1
- package/dist/assets/dql-notebook/assets/{list-tree-BipBLmIE.js → list-tree-j0s4asFK.js} +1 -1
- package/dist/assets/dql-notebook/assets/{minimize-2-BhXsglrO.js → minimize-2-Cl4pef4s.js} +1 -1
- package/dist/assets/dql-notebook/assets/{panel-right-open-BoCSilYB.js → panel-right-open-Clz-FtWi.js} +1 -1
- package/dist/assets/dql-notebook/assets/{play-mdoZawPu.js → play-DFdazMg7.js} +1 -1
- package/dist/assets/dql-notebook/assets/{rotate-ccw-ELiDRUmj.js → rotate-ccw-C3tTaR7s.js} +1 -1
- package/dist/assets/dql-notebook/assets/{semantic-fields-DVNRLfeU.js → semantic-fields-DIAhTlfy.js} +1 -1
- package/dist/assets/dql-notebook/assets/{sliders-horizontal-GeUzpmKz.js → sliders-horizontal-BUiu2tfY.js} +1 -1
- package/dist/assets/dql-notebook/assets/{star-D63O81Wp.js → star--Yq77aH4.js} +1 -1
- package/dist/assets/dql-notebook/assets/{triangle-alert-BWrCxQVE.js → triangle-alert-D5Ng-xZO.js} +1 -1
- package/dist/assets/dql-notebook/assets/{upload-CI-ldXhC.js → upload-L8BKQAxP.js} +1 -1
- package/dist/assets/dql-notebook/assets/{usePersistedAgentThreadId-Cv7Yq2hK.js → usePersistedAgentThreadId-DBu97YaM.js} +1 -1
- package/dist/assets/dql-notebook/assets/{user-round-Do21aFGo.js → user-round-BK5N1cJW.js} +1 -1
- package/dist/assets/dql-notebook/assets/{wand-sparkles-DT7u7F_x.js → wand-sparkles-D8XDQD9z.js} +1 -1
- package/dist/assets/dql-notebook/assets/{workflow-DHh2mMbn.js → workflow-Bl9zwG0q.js} +1 -1
- package/dist/assets/dql-notebook/assets/{wrench-7tYr_GKb.js → wrench-C-zLCMbW.js} +1 -1
- package/dist/assets/dql-notebook/assets/{x-CcYceFMz.js → x-stiJ-sP7.js} +1 -1
- package/dist/assets/dql-notebook/index.html +1 -1
- package/dist/local-operation-coordinator.d.ts.map +1 -1
- package/dist/local-operation-coordinator.js +16 -2
- package/dist/local-operation-coordinator.js.map +1 -1
- package/dist/local-runtime.d.ts +55 -19
- package/dist/local-runtime.d.ts.map +1 -1
- package/dist/local-runtime.js +1098 -581
- package/dist/local-runtime.js.map +1 -1
- package/dist/package.json +10 -10
- package/package.json +10 -10
- package/dist/assets/dql-notebook/assets/AppsView-BTkGC-wl.js +0 -5588
- package/dist/assets/dql-notebook/assets/BlockStudio-BrTNaDpb.js +0 -55
- package/dist/assets/dql-notebook/assets/index-9w93YPF9.js +0 -635
package/dist/assets/dql-notebook/assets/{ReadinessPage-DB_KbH9Y.js → ReadinessPage-MuJBFwwg.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as F,i as H,k as _,r as n,a as R,j as e,S as q,a0 as P,aG as Q,L as N,l as V,d as U,e as K,B as J,f as X}from"./index-9w93YPF9.js";import{T as Y}from"./TrustBadge-ClEYiYeA.js";import{o as O}from"./ai-build-bus-1BR770pY.js";import{W as G}from"./wand-sparkles-DT7u7F_x.js";import{U as Z,G as ee}from"./user-round-Do21aFGo.js";import{T as B}from"./triangle-alert-BWrCxQVE.js";import{A as se}from"./arrow-right-Ct_YGrmU.js";import"./react-CRB3T2We.js";function Re(){const s=F(H(t=>({files:t.files}))),c=_(),[o,u]=n.useState(null),[w,x]=n.useState(!0),[p,f]=n.useState(new Set),[l,k]=n.useState(!1),[T,z]=n.useState(null),[W,C]=n.useState(null);n.useEffect(()=>{let t=!1;return R.getIdentity().then(r=>{!t&&(r!=null&&r.owner)&&C(r.owner)}).catch(()=>{}),()=>{t=!0}},[]);const I=n.useCallback(async(t,r)=>{const i={name:t.split("/").pop()??`${r}.dql`,path:t,type:"block",folder:"blocks"};s.files.some(a=>a.path===t)||c({type:"FILE_ADDED",file:i});const y=await R.openBlockStudio(t);c({type:"OPEN_BLOCK_STUDIO",file:i,payload:y})},[c,s.files]),b=n.useCallback(()=>{let t=!1;return x(!0),R.getProposeReadiness().then(r=>{if(t)return;u(r);const i=r.ready?r.plan.domains.flatMap(y=>y.candidates.map(a=>a.slug)):[];f(new Set(i))}).catch(()=>{t||u(null)}).finally(()=>{t||x(!1)}),()=>{t=!0}},[]);n.useEffect(()=>b(),[b]);const m=n.useCallback(()=>{c({type:"SET_MAIN_VIEW",view:"block_studio"})},[c]),D=n.useCallback(t=>{f(r=>{const i=new Set(r);return i.has(t)?i.delete(t):i.add(t),i})},[]),v=n.useCallback(t=>{f(r=>{const i=new Set(r),y=t.candidates.map(g=>g.slug),a=y.every(g=>i.has(g));for(const g of y)a?i.delete(g):i.add(g);return i})},[]),L=n.useCallback(async()=>{const t=[...p];if(t.length!==0){k(!0),z(null);try{const r=await R.generateProposeDrafts({slugs:t});if(!r.ready){z(r.reason??"Could not generate drafts.");return}const i=r.proposals.find(y=>y.path);i!=null&&i.path?I(i.path,i.slug):m()}catch(r){z(r instanceof Error?r.message:String(r))}finally{k(!1)}}},[p,m,I]),d=o==null?void 0:o.summary,h=o!=null&&o.ready?o.plan:null;return e.jsx("div",{style:{flex:1,minWidth:0,overflow:"auto"},children:e.jsxs("div",{style:{maxWidth:980,margin:"0 auto",padding:"22px 28px 40px",display:"grid",gap:16},children:[e.jsxs("header",{style:{display:"grid",gap:6},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx(q,{size:20}),e.jsx("div",{style:{fontSize:22,fontWeight:750},children:"Get started"}),e.jsx("div",{style:{flex:1}}),e.jsxs("button",{type:"button",onClick:()=>O({target:"block",lockTarget:!0,sourceLabel:"Describe a block to draft from your project context."}),style:ye,children:[e.jsx(G,{size:14})," Ask AI to build a block"]})]}),e.jsx("div",{style:{fontSize:13,opacity:.72,maxWidth:760,lineHeight:1.55},children:d!=null&&d.modelsScanned?`I scanned your dbt project and found ${d.businessModels} ${d.businessModels===1?"thing":"things"} worth governing — here's what each one does. Expand a row to see the SQL it would run and what's still missing to certify. Plumbing and low-value models are left out. Nothing is drafted or certified until you approve it.`:"I scanned your dbt project for the business models worth governing — here's what each one does. Expand a row to see the SQL it would run and what's still missing to certify. Nothing is drafted or certified until you approve it."}),W?e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11.5,opacity:.62},children:[e.jsx(Z,{size:12})," drafting as ",W]}):null,e.jsxs("button",{type:"button",onClick:()=>c({type:"SET_MAIN_VIEW",view:"skills"}),style:{display:"inline-flex",alignItems:"center",gap:6,alignSelf:"start",marginTop:2,padding:0,border:"none",background:"transparent",color:"var(--color-accent-blue, #6b5dd3)",fontSize:12,fontWeight:650,cursor:"pointer"},children:[e.jsx(ee,{size:13})," Teach the AI your business rules →"]})]}),w?e.jsx("div",{style:E,children:"Classifying dbt models and planning the business seed…"}):o?o.ready?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, minmax(0, 1fr))",gap:10},children:[e.jsx(S,{label:"dbt models scanned",value:d.modelsScanned}),e.jsx(S,{label:"Business models",value:d.businessModels,tone:"success"}),e.jsx(S,{label:"Plumbing excluded",value:d.plumbingExcluded}),e.jsx(S,{label:"Metrics found",value:d.metricsFound})]}),d.reviewTelemetry&&d.reviewTelemetry.existingDrafts>0?e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:10},children:[e.jsx(S,{label:"Drafts ready for review",value:`${Math.round((d.reviewTelemetry.readyForReviewRate??0)*100)}%`,tone:"success"}),e.jsx(S,{label:"Median draft age",value:d.reviewTelemetry.medianReviewAgeHours!=null?`${d.reviewTelemetry.medianReviewAgeHours.toFixed(1)}h`:"—"}),e.jsx(S,{label:"Est. review time",value:`~${d.reviewTelemetry.estimatedReviewMinutes} min`})]}):null,e.jsxs("div",{style:he,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx(Q,{size:16}),e.jsxs("div",{style:{fontSize:13},children:[e.jsxs("strong",{children:["Will generate ",p.size]}),e.jsxs("span",{style:{opacity:.65},children:[" ","of ",h.willGenerate," planned · skipping ",h.willSkip," · ≤ ",h.config.maxPerDomain," per domain"]})]})]}),e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[e.jsxs("button",{type:"button",onClick:b,style:$,children:[e.jsx(P,{size:13})," Refresh"]}),e.jsxs("button",{type:"button",onClick:()=>void L(),disabled:l||p.size===0,style:{...me,opacity:l||p.size===0?.6:1},children:[l?e.jsx(N,{size:13,className:"spin"}):e.jsx(V,{size:13}),l?"Generating…":e.jsxs(e.Fragment,{children:["Approve & generate ",p.size>0?`(${p.size})`:""]})]})]})]}),T?e.jsxs("div",{style:{...E,display:"flex",gap:8,alignItems:"center",borderColor:"var(--status-error, #cf222e)"},children:[e.jsx(B,{size:16})," ",T]}):null,e.jsx("div",{style:{display:"grid",gap:12},children:h.domains.length===0?e.jsxs("div",{style:E,children:["No business models found to govern. Tag a layer in ",e.jsx("code",{children:"dql.config.json"})," ","(",e.jsx("code",{children:"propose.businessLayers"}),") or add ",e.jsx("code",{children:"meta.dql.business"})," to your dbt models."]}):h.domains.map(t=>e.jsx(te,{domain:t,selected:p,onToggleSlug:D,onToggleDomain:v,onOpenInBlockStudio:I},t.name))}),e.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:e.jsxs("button",{type:"button",onClick:m,style:be,children:["Open Block Studio ",e.jsx(se,{size:13})]})})]}):e.jsxs("div",{style:{...E,display:"flex",alignItems:"flex-start",gap:10},children:[e.jsx(B,{size:18,style:{flexShrink:0,marginTop:1}}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("div",{style:{fontWeight:650},children:"Not ready to propose yet"}),e.jsx("div",{style:{opacity:.8},children:o.reason}),e.jsxs("button",{type:"button",onClick:b,style:$,children:[e.jsx(P,{size:13})," Re-check"]})]})]}):e.jsx("div",{style:E,children:"Could not load readiness."})]})})}function te({domain:s,selected:c,onToggleSlug:o,onToggleDomain:u,onOpenInBlockStudio:w}){const x=s.candidates.map(l=>l.slug),p=x.every(l=>c.has(l)),f=x.some(l=>c.has(l));return e.jsxs("div",{style:oe,children:[e.jsxs("div",{style:ae,children:[e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:p,ref:l=>{l&&(l.indeterminate=!p&&f)},onChange:()=>u(s)}),e.jsx("span",{style:{fontSize:13,fontWeight:700},children:s.name}),e.jsxs("span",{style:{fontSize:11,opacity:.6},children:[s.modelCount," model",s.modelCount===1?"":"s"]})]}),s.owner?e.jsxs("span",{style:{fontSize:11,opacity:.6},children:["owner ",s.owner]}):null]}),e.jsx("div",{style:{display:"grid",gap:6},children:s.candidates.map(l=>e.jsx(re,{candidate:l,checked:c.has(l.slug),onToggle:()=>o(l.slug),onOpenInBlockStudio:w},l.slug))})]})}function re({candidate:s,checked:c,onToggle:o,onOpenInBlockStudio:u}){const w=n.useMemo(()=>s.evidence.slice(0,3),[s.evidence]),[x,p]=n.useState(!1),[f,l]=n.useState(null),[k,T]=n.useState(!1),[z,W]=n.useState(null),[C,I]=n.useState(!1),[b,m]=n.useState(null),D=n.useCallback(()=>{p(a=>{const g=!a;return g&&!f&&!k&&(T(!0),W(null),R.proposePreview(s.slug).then(j=>l(j.candidate)).catch(j=>W(j instanceof Error?j.message:"Could not load the preview.")).finally(()=>T(!1))),g})},[s.slug,f,k]),v=f??s,L=v.sqlPreview,d=v.outputs??[],h=v.examples??[],t=v.certifierVerdict,r=v.description,i=n.useCallback(async()=>{I(!0),m(null);try{const a=await R.generateProposeDrafts({slugs:[s.slug]}),g=a.proposals.find(M=>M.slug===s.slug)??a.proposals[0],j=g==null?void 0:g.path;if(!j){m("No draft path was returned for this model yet.");return}await u(j,s.model)}catch(a){m(a instanceof Error?a.message:"Could not open this draft.")}finally{I(!1)}},[s.model,s.slug,u]),y=n.useCallback(()=>{O({target:"block",lockTarget:!0,prompt:`Refine the "${s.model}" block: ${r??`a ${s.pattern??"business"} model${s.grain?` at ${s.grain} grain`:""}`}.`,sourceLabel:`Refining ${s.model}`})},[s.grain,s.model,s.pattern,r]);return e.jsxs("div",{style:{...de,opacity:c?1:.7},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto minmax(0, 1fr) auto",gap:10,alignItems:"start"},children:[e.jsx("input",{type:"checkbox",checked:c,onChange:o,style:{marginTop:3},"aria-label":`Include ${s.model}`}),e.jsxs("div",{style:{display:"grid",gap:4,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700},children:s.model}),e.jsx(Y,{state:"ai_generated"}),s.pattern?e.jsx(le,{children:s.pattern}):null,s.grain?e.jsxs("span",{style:{fontSize:11,opacity:.6},children:["grain ",s.grain]}):null]}),w.length>0?e.jsxs("div",{style:{fontSize:11,opacity:.66},children:[e.jsx("span",{style:{opacity:.8},children:"why: "}),w.join(" · ")]}):null]}),e.jsxs("button",{type:"button",onClick:D,"aria-expanded":x,style:pe,children:[x?e.jsx(U,{size:13}):e.jsx(K,{size:13}),x?"Hide":"Details"]})]}),x?e.jsx("div",{style:ce,children:k?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,opacity:.75},children:[e.jsx(N,{size:13,className:"spin"})," Loading the generated SQL and verdict…"]}):z?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--status-error, #cf222e)"},children:[e.jsx(B,{size:14})," ",z]}):e.jsxs(e.Fragment,{children:[r?e.jsx("div",{style:{fontSize:12,opacity:.82,lineHeight:1.5},children:r}):null,e.jsxs("div",{style:{display:"grid",gap:5},children:[e.jsx(A,{children:"SQL this block will run"}),L?e.jsx("pre",{style:ge,children:e.jsx("code",{style:{fontFamily:"var(--font-mono, monospace)",fontSize:11.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:L.trim()})}):e.jsx("div",{style:{fontSize:11.5,opacity:.6},children:"The generated SQL is not available for this model yet."})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:12},children:[e.jsxs("div",{style:{display:"grid",gap:5,alignContent:"start"},children:[e.jsx(A,{children:"Outputs"}),d.length>0?e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:5},children:d.map(a=>e.jsx(ie,{children:a},a))}):e.jsx("div",{style:{fontSize:11,opacity:.6},children:"No declared outputs yet."})]}),e.jsxs("div",{style:{display:"grid",gap:5,alignContent:"start"},children:[e.jsx(A,{children:"Answers questions like"}),h.length>0?e.jsx("ul",{style:{margin:0,padding:"0 0 0 16px",display:"grid",gap:3},children:h.slice(0,3).map(a=>e.jsx("li",{style:{fontSize:11.5,opacity:.82,lineHeight:1.45},children:a},a))}):e.jsx("div",{style:{fontSize:11,opacity:.6},children:"No example questions yet."})]})]}),e.jsx(ne,{verdict:t}),e.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[e.jsxs("button",{type:"button",onClick:()=>void i(),disabled:C,style:{...ue,opacity:C?.65:1},children:[C?e.jsx(N,{size:13,className:"spin"}):e.jsx(J,{size:13}),C?"Opening…":"Open in Block Studio"]}),e.jsxs("button",{type:"button",onClick:y,style:xe,children:[e.jsx(G,{size:13})," Refine with AI"]})]}),b?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11.5,color:"var(--status-error, #cf222e)"},children:[e.jsx(B,{size:13})," ",b]}):null]})}):null]})}function ne({verdict:s}){const c=!!(s!=null&&s.ready&&s.blocking.length===0),o=s?[...s.blocking,...s.warnings]:[];return e.jsxs("div",{style:{display:"grid",gap:5},children:[e.jsx(A,{children:"What's missing to certify"}),c?e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12,color:"var(--status-success, #1f883d)"},children:[e.jsx(X,{size:14})," Grain, outputs, and context are set."]}):e.jsxs("div",{style:{display:"grid",gap:4},children:[e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12,color:"var(--status-warning, #9a6700)"},children:[e.jsx(B,{size:14})," Needs an owner and passing tests before it can be certified."]}),o.length>0?e.jsx("ul",{style:{margin:0,padding:"0 0 0 16px",display:"grid",gap:2},children:o.map(u=>e.jsx("li",{style:{fontSize:11,opacity:.78,lineHeight:1.4},children:u},u))}):s?null:e.jsx("div",{style:{fontSize:11,opacity:.6},children:"Expand to load the Certifier verdict."})]})]})}function A({children:s}){return e.jsx("div",{style:{fontSize:10,fontWeight:800,letterSpacing:"0.05em",textTransform:"uppercase",opacity:.55},children:s})}function ie({children:s}){return e.jsx("span",{style:{fontSize:11,fontWeight:600,padding:"3px 8px",borderRadius:6,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",background:"var(--surface-hover, rgba(0,0,0,0.04))",fontFamily:"var(--font-mono, monospace)"},children:s})}function S({label:s,value:c,tone:o}){return e.jsxs("div",{style:{...fe,borderTop:`2px solid ${o==="success"?"var(--status-success, #1f883d)":"var(--border-color, rgba(0,0,0,0.10))"}`},children:[e.jsx("div",{style:{fontSize:11,opacity:.62},children:s}),e.jsx("div",{style:{fontSize:24,fontWeight:800},children:c})]})}function le({children:s}){return e.jsx("span",{style:{fontSize:10,padding:"2px 7px",borderRadius:4,background:"var(--surface-hover, rgba(0,0,0,0.06))",opacity:.82},children:s})}const oe={border:"1px solid var(--border-color, rgba(0,0,0,0.10))",borderRadius:8,background:"var(--surface, rgba(0,0,0,0.02))",padding:12,display:"grid",gap:8},ae={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,paddingBottom:6,borderBottom:"1px solid var(--border-color, rgba(0,0,0,0.08))"},de={width:"100%",border:"1px solid var(--border-color, rgba(0,0,0,0.10))",borderLeft:"3px solid var(--status-warning, #9a6700)",borderRadius:7,background:"var(--surface, rgba(0,0,0,0.02))",padding:10,display:"grid",gap:10},ce={borderTop:"1px solid var(--border-color, rgba(0,0,0,0.08))",paddingTop:10,marginLeft:26,display:"grid",gap:12},pe={display:"inline-flex",alignItems:"center",gap:4,padding:"4px 8px",borderRadius:6,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",background:"transparent",color:"inherit",fontSize:11,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",alignSelf:"start"},ge={margin:0,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",borderRadius:8,background:"var(--color-bg-primary, rgba(0,0,0,0.03))",padding:"9px 11px",overflow:"auto",maxHeight:280},ue={display:"inline-flex",alignItems:"center",gap:6,padding:"6px 11px",borderRadius:6,border:"1px solid var(--color-accent-blue, #6b5dd3)",background:"var(--color-accent-blue, #6b5dd3)",color:"#fff",fontSize:12,fontWeight:650,cursor:"pointer",whiteSpace:"nowrap"},xe={display:"inline-flex",alignItems:"center",gap:6,padding:"6px 11px",borderRadius:6,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",background:"transparent",color:"inherit",fontSize:12,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},ye={display:"inline-flex",alignItems:"center",gap:6,padding:"7px 13px",borderRadius:7,border:"1px solid var(--color-clay, #b4593f)",background:"var(--color-clay, #b4593f)",color:"#fff",fontSize:12.5,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},fe={border:"1px solid var(--border-color, rgba(0,0,0,0.10))",borderRadius:7,background:"var(--surface, rgba(0,0,0,0.02))",padding:12},he={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,border:"1px solid var(--border-color, rgba(0,0,0,0.10))",borderRadius:8,background:"var(--surface, rgba(0,0,0,0.02))",padding:"10px 12px"},be={display:"inline-flex",alignItems:"center",gap:5,padding:"6px 11px",borderRadius:6,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",background:"var(--surface, transparent)",color:"inherit",fontSize:12,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},me={display:"inline-flex",alignItems:"center",gap:6,padding:"7px 13px",borderRadius:6,border:"1px solid var(--status-success, #1f883d)",background:"var(--status-success, #1f883d)",color:"#fff",fontSize:12,fontWeight:650,cursor:"pointer",whiteSpace:"nowrap"},$={display:"inline-flex",alignItems:"center",gap:5,padding:"6px 11px",borderRadius:6,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",background:"transparent",color:"inherit",fontSize:12,cursor:"pointer"},E={border:"1px dashed var(--border-color, rgba(0,0,0,0.16))",borderRadius:8,padding:24,fontSize:13,opacity:.85};export{Re as ReadinessPage};
|
|
1
|
+
import{h as G,i as H,k as _,r as n,a as R,j as e,S as q,a0 as P,aJ as Q,L as N,l as V,d as U,e as J,B as K,f as X}from"./index-mQd_pC-P.js";import{T as Y}from"./TrustBadge-TcwXFFHK.js";import{o as O}from"./ai-build-bus-1BR770pY.js";import{W as M}from"./wand-sparkles-D8XDQD9z.js";import{U as Z,G as ee}from"./user-round-BK5N1cJW.js";import{T as B}from"./triangle-alert-D5Ng-xZO.js";import{A as se}from"./arrow-right-BmUAb1aW.js";import"./react-CRB3T2We.js";function Re(){const s=G(H(t=>({files:t.files}))),c=_(),[o,u]=n.useState(null),[w,x]=n.useState(!0),[p,f]=n.useState(new Set),[l,k]=n.useState(!1),[T,z]=n.useState(null),[W,C]=n.useState(null);n.useEffect(()=>{let t=!1;return R.getIdentity().then(r=>{!t&&(r!=null&&r.owner)&&C(r.owner)}).catch(()=>{}),()=>{t=!0}},[]);const I=n.useCallback(async(t,r)=>{const i={name:t.split("/").pop()??`${r}.dql`,path:t,type:"block",folder:"blocks"};s.files.some(a=>a.path===t)||c({type:"FILE_ADDED",file:i});const y=await R.openBlockStudio(t);c({type:"OPEN_BLOCK_STUDIO",file:i,payload:y})},[c,s.files]),b=n.useCallback(()=>{let t=!1;return x(!0),R.getProposeReadiness().then(r=>{if(t)return;u(r);const i=r.ready?r.plan.domains.flatMap(y=>y.candidates.map(a=>a.slug)):[];f(new Set(i))}).catch(()=>{t||u(null)}).finally(()=>{t||x(!1)}),()=>{t=!0}},[]);n.useEffect(()=>b(),[b]);const m=n.useCallback(()=>{c({type:"SET_MAIN_VIEW",view:"block_studio"})},[c]),D=n.useCallback(t=>{f(r=>{const i=new Set(r);return i.has(t)?i.delete(t):i.add(t),i})},[]),v=n.useCallback(t=>{f(r=>{const i=new Set(r),y=t.candidates.map(g=>g.slug),a=y.every(g=>i.has(g));for(const g of y)a?i.delete(g):i.add(g);return i})},[]),L=n.useCallback(async()=>{const t=[...p];if(t.length!==0){k(!0),z(null);try{const r=await R.generateProposeDrafts({slugs:t});if(!r.ready){z(r.reason??"Could not generate drafts.");return}const i=r.proposals.find(y=>y.path);i!=null&&i.path?I(i.path,i.slug):m()}catch(r){z(r instanceof Error?r.message:String(r))}finally{k(!1)}}},[p,m,I]),d=o==null?void 0:o.summary,h=o!=null&&o.ready?o.plan:null;return e.jsx("div",{style:{flex:1,minWidth:0,overflow:"auto"},children:e.jsxs("div",{style:{maxWidth:980,margin:"0 auto",padding:"22px 28px 40px",display:"grid",gap:16},children:[e.jsxs("header",{style:{display:"grid",gap:6},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx(q,{size:20}),e.jsx("div",{style:{fontSize:22,fontWeight:750},children:"Get started"}),e.jsx("div",{style:{flex:1}}),e.jsxs("button",{type:"button",onClick:()=>O({target:"block",lockTarget:!0,sourceLabel:"Describe a block to draft from your project context."}),style:ye,children:[e.jsx(M,{size:14})," Ask AI to build a block"]})]}),e.jsx("div",{style:{fontSize:13,opacity:.72,maxWidth:760,lineHeight:1.55},children:d!=null&&d.modelsScanned?`I scanned your dbt project and found ${d.businessModels} ${d.businessModels===1?"thing":"things"} worth governing — here's what each one does. Expand a row to see the SQL it would run and what's still missing to certify. Plumbing and low-value models are left out. Nothing is drafted or certified until you approve it.`:"I scanned your dbt project for the business models worth governing — here's what each one does. Expand a row to see the SQL it would run and what's still missing to certify. Nothing is drafted or certified until you approve it."}),W?e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11.5,opacity:.62},children:[e.jsx(Z,{size:12})," drafting as ",W]}):null,e.jsxs("button",{type:"button",onClick:()=>c({type:"SET_MAIN_VIEW",view:"skills"}),style:{display:"inline-flex",alignItems:"center",gap:6,alignSelf:"start",marginTop:2,padding:0,border:"none",background:"transparent",color:"var(--color-accent-blue, #6b5dd3)",fontSize:12,fontWeight:650,cursor:"pointer"},children:[e.jsx(ee,{size:13})," Teach the AI your business rules →"]})]}),w?e.jsx("div",{style:E,children:"Classifying dbt models and planning the business seed…"}):o?o.ready?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, minmax(0, 1fr))",gap:10},children:[e.jsx(S,{label:"dbt models scanned",value:d.modelsScanned}),e.jsx(S,{label:"Business models",value:d.businessModels,tone:"success"}),e.jsx(S,{label:"Plumbing excluded",value:d.plumbingExcluded}),e.jsx(S,{label:"Metrics found",value:d.metricsFound})]}),d.reviewTelemetry&&d.reviewTelemetry.existingDrafts>0?e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:10},children:[e.jsx(S,{label:"Drafts ready for review",value:`${Math.round((d.reviewTelemetry.readyForReviewRate??0)*100)}%`,tone:"success"}),e.jsx(S,{label:"Median draft age",value:d.reviewTelemetry.medianReviewAgeHours!=null?`${d.reviewTelemetry.medianReviewAgeHours.toFixed(1)}h`:"—"}),e.jsx(S,{label:"Est. review time",value:`~${d.reviewTelemetry.estimatedReviewMinutes} min`})]}):null,e.jsxs("div",{style:he,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx(Q,{size:16}),e.jsxs("div",{style:{fontSize:13},children:[e.jsxs("strong",{children:["Will generate ",p.size]}),e.jsxs("span",{style:{opacity:.65},children:[" ","of ",h.willGenerate," planned · skipping ",h.willSkip," · ≤ ",h.config.maxPerDomain," per domain"]})]})]}),e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[e.jsxs("button",{type:"button",onClick:b,style:$,children:[e.jsx(P,{size:13})," Refresh"]}),e.jsxs("button",{type:"button",onClick:()=>void L(),disabled:l||p.size===0,style:{...me,opacity:l||p.size===0?.6:1},children:[l?e.jsx(N,{size:13,className:"spin"}):e.jsx(V,{size:13}),l?"Generating…":e.jsxs(e.Fragment,{children:["Approve & generate ",p.size>0?`(${p.size})`:""]})]})]})]}),T?e.jsxs("div",{style:{...E,display:"flex",gap:8,alignItems:"center",borderColor:"var(--status-error, #cf222e)"},children:[e.jsx(B,{size:16})," ",T]}):null,e.jsx("div",{style:{display:"grid",gap:12},children:h.domains.length===0?e.jsxs("div",{style:E,children:["No business models found to govern. Tag a layer in ",e.jsx("code",{children:"dql.config.json"})," ","(",e.jsx("code",{children:"propose.businessLayers"}),") or add ",e.jsx("code",{children:"meta.dql.business"})," to your dbt models."]}):h.domains.map(t=>e.jsx(te,{domain:t,selected:p,onToggleSlug:D,onToggleDomain:v,onOpenInBlockStudio:I},t.name))}),e.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:e.jsxs("button",{type:"button",onClick:m,style:be,children:["Open Block Studio ",e.jsx(se,{size:13})]})})]}):e.jsxs("div",{style:{...E,display:"flex",alignItems:"flex-start",gap:10},children:[e.jsx(B,{size:18,style:{flexShrink:0,marginTop:1}}),e.jsxs("div",{style:{display:"grid",gap:8},children:[e.jsx("div",{style:{fontWeight:650},children:"Not ready to propose yet"}),e.jsx("div",{style:{opacity:.8},children:o.reason}),e.jsxs("button",{type:"button",onClick:b,style:$,children:[e.jsx(P,{size:13})," Re-check"]})]})]}):e.jsx("div",{style:E,children:"Could not load readiness."})]})})}function te({domain:s,selected:c,onToggleSlug:o,onToggleDomain:u,onOpenInBlockStudio:w}){const x=s.candidates.map(l=>l.slug),p=x.every(l=>c.has(l)),f=x.some(l=>c.has(l));return e.jsxs("div",{style:oe,children:[e.jsxs("div",{style:ae,children:[e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:p,ref:l=>{l&&(l.indeterminate=!p&&f)},onChange:()=>u(s)}),e.jsx("span",{style:{fontSize:13,fontWeight:700},children:s.name}),e.jsxs("span",{style:{fontSize:11,opacity:.6},children:[s.modelCount," model",s.modelCount===1?"":"s"]})]}),s.owner?e.jsxs("span",{style:{fontSize:11,opacity:.6},children:["owner ",s.owner]}):null]}),e.jsx("div",{style:{display:"grid",gap:6},children:s.candidates.map(l=>e.jsx(re,{candidate:l,checked:c.has(l.slug),onToggle:()=>o(l.slug),onOpenInBlockStudio:w},l.slug))})]})}function re({candidate:s,checked:c,onToggle:o,onOpenInBlockStudio:u}){const w=n.useMemo(()=>s.evidence.slice(0,3),[s.evidence]),[x,p]=n.useState(!1),[f,l]=n.useState(null),[k,T]=n.useState(!1),[z,W]=n.useState(null),[C,I]=n.useState(!1),[b,m]=n.useState(null),D=n.useCallback(()=>{p(a=>{const g=!a;return g&&!f&&!k&&(T(!0),W(null),R.proposePreview(s.slug).then(j=>l(j.candidate)).catch(j=>W(j instanceof Error?j.message:"Could not load the preview.")).finally(()=>T(!1))),g})},[s.slug,f,k]),v=f??s,L=v.sqlPreview,d=v.outputs??[],h=v.examples??[],t=v.certifierVerdict,r=v.description,i=n.useCallback(async()=>{I(!0),m(null);try{const a=await R.generateProposeDrafts({slugs:[s.slug]}),g=a.proposals.find(F=>F.slug===s.slug)??a.proposals[0],j=g==null?void 0:g.path;if(!j){m("No draft path was returned for this model yet.");return}await u(j,s.model)}catch(a){m(a instanceof Error?a.message:"Could not open this draft.")}finally{I(!1)}},[s.model,s.slug,u]),y=n.useCallback(()=>{O({target:"block",lockTarget:!0,prompt:`Refine the "${s.model}" block: ${r??`a ${s.pattern??"business"} model${s.grain?` at ${s.grain} grain`:""}`}.`,sourceLabel:`Refining ${s.model}`})},[s.grain,s.model,s.pattern,r]);return e.jsxs("div",{style:{...de,opacity:c?1:.7},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto minmax(0, 1fr) auto",gap:10,alignItems:"start"},children:[e.jsx("input",{type:"checkbox",checked:c,onChange:o,style:{marginTop:3},"aria-label":`Include ${s.model}`}),e.jsxs("div",{style:{display:"grid",gap:4,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:14,fontWeight:700},children:s.model}),e.jsx(Y,{state:"ai_generated"}),s.pattern?e.jsx(le,{children:s.pattern}):null,s.grain?e.jsxs("span",{style:{fontSize:11,opacity:.6},children:["grain ",s.grain]}):null]}),w.length>0?e.jsxs("div",{style:{fontSize:11,opacity:.66},children:[e.jsx("span",{style:{opacity:.8},children:"why: "}),w.join(" · ")]}):null]}),e.jsxs("button",{type:"button",onClick:D,"aria-expanded":x,style:pe,children:[x?e.jsx(U,{size:13}):e.jsx(J,{size:13}),x?"Hide":"Details"]})]}),x?e.jsx("div",{style:ce,children:k?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,opacity:.75},children:[e.jsx(N,{size:13,className:"spin"})," Loading the generated SQL and verdict…"]}):z?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--status-error, #cf222e)"},children:[e.jsx(B,{size:14})," ",z]}):e.jsxs(e.Fragment,{children:[r?e.jsx("div",{style:{fontSize:12,opacity:.82,lineHeight:1.5},children:r}):null,e.jsxs("div",{style:{display:"grid",gap:5},children:[e.jsx(A,{children:"SQL this block will run"}),L?e.jsx("pre",{style:ge,children:e.jsx("code",{style:{fontFamily:"var(--font-mono, monospace)",fontSize:11.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:L.trim()})}):e.jsx("div",{style:{fontSize:11.5,opacity:.6},children:"The generated SQL is not available for this model yet."})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:12},children:[e.jsxs("div",{style:{display:"grid",gap:5,alignContent:"start"},children:[e.jsx(A,{children:"Outputs"}),d.length>0?e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:5},children:d.map(a=>e.jsx(ie,{children:a},a))}):e.jsx("div",{style:{fontSize:11,opacity:.6},children:"No declared outputs yet."})]}),e.jsxs("div",{style:{display:"grid",gap:5,alignContent:"start"},children:[e.jsx(A,{children:"Answers questions like"}),h.length>0?e.jsx("ul",{style:{margin:0,padding:"0 0 0 16px",display:"grid",gap:3},children:h.slice(0,3).map(a=>e.jsx("li",{style:{fontSize:11.5,opacity:.82,lineHeight:1.45},children:a},a))}):e.jsx("div",{style:{fontSize:11,opacity:.6},children:"No example questions yet."})]})]}),e.jsx(ne,{verdict:t}),e.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[e.jsxs("button",{type:"button",onClick:()=>void i(),disabled:C,style:{...ue,opacity:C?.65:1},children:[C?e.jsx(N,{size:13,className:"spin"}):e.jsx(K,{size:13}),C?"Opening…":"Open in Block Studio"]}),e.jsxs("button",{type:"button",onClick:y,style:xe,children:[e.jsx(M,{size:13})," Refine with AI"]})]}),b?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11.5,color:"var(--status-error, #cf222e)"},children:[e.jsx(B,{size:13})," ",b]}):null]})}):null]})}function ne({verdict:s}){const c=!!(s!=null&&s.ready&&s.blocking.length===0),o=s?[...s.blocking,...s.warnings]:[];return e.jsxs("div",{style:{display:"grid",gap:5},children:[e.jsx(A,{children:"What's missing to certify"}),c?e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12,color:"var(--status-success, #1f883d)"},children:[e.jsx(X,{size:14})," Grain, outputs, and context are set."]}):e.jsxs("div",{style:{display:"grid",gap:4},children:[e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12,color:"var(--status-warning, #9a6700)"},children:[e.jsx(B,{size:14})," Needs an owner and passing tests before it can be certified."]}),o.length>0?e.jsx("ul",{style:{margin:0,padding:"0 0 0 16px",display:"grid",gap:2},children:o.map(u=>e.jsx("li",{style:{fontSize:11,opacity:.78,lineHeight:1.4},children:u},u))}):s?null:e.jsx("div",{style:{fontSize:11,opacity:.6},children:"Expand to load the Certifier verdict."})]})]})}function A({children:s}){return e.jsx("div",{style:{fontSize:10,fontWeight:800,letterSpacing:"0.05em",textTransform:"uppercase",opacity:.55},children:s})}function ie({children:s}){return e.jsx("span",{style:{fontSize:11,fontWeight:600,padding:"3px 8px",borderRadius:6,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",background:"var(--surface-hover, rgba(0,0,0,0.04))",fontFamily:"var(--font-mono, monospace)"},children:s})}function S({label:s,value:c,tone:o}){return e.jsxs("div",{style:{...fe,borderTop:`2px solid ${o==="success"?"var(--status-success, #1f883d)":"var(--border-color, rgba(0,0,0,0.10))"}`},children:[e.jsx("div",{style:{fontSize:11,opacity:.62},children:s}),e.jsx("div",{style:{fontSize:24,fontWeight:800},children:c})]})}function le({children:s}){return e.jsx("span",{style:{fontSize:10,padding:"2px 7px",borderRadius:4,background:"var(--surface-hover, rgba(0,0,0,0.06))",opacity:.82},children:s})}const oe={border:"1px solid var(--border-color, rgba(0,0,0,0.10))",borderRadius:8,background:"var(--surface, rgba(0,0,0,0.02))",padding:12,display:"grid",gap:8},ae={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,paddingBottom:6,borderBottom:"1px solid var(--border-color, rgba(0,0,0,0.08))"},de={width:"100%",border:"1px solid var(--border-color, rgba(0,0,0,0.10))",borderLeft:"3px solid var(--status-warning, #9a6700)",borderRadius:7,background:"var(--surface, rgba(0,0,0,0.02))",padding:10,display:"grid",gap:10},ce={borderTop:"1px solid var(--border-color, rgba(0,0,0,0.08))",paddingTop:10,marginLeft:26,display:"grid",gap:12},pe={display:"inline-flex",alignItems:"center",gap:4,padding:"4px 8px",borderRadius:6,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",background:"transparent",color:"inherit",fontSize:11,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",alignSelf:"start"},ge={margin:0,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",borderRadius:8,background:"var(--color-bg-primary, rgba(0,0,0,0.03))",padding:"9px 11px",overflow:"auto",maxHeight:280},ue={display:"inline-flex",alignItems:"center",gap:6,padding:"6px 11px",borderRadius:6,border:"1px solid var(--color-accent-blue, #6b5dd3)",background:"var(--color-accent-blue, #6b5dd3)",color:"#fff",fontSize:12,fontWeight:650,cursor:"pointer",whiteSpace:"nowrap"},xe={display:"inline-flex",alignItems:"center",gap:6,padding:"6px 11px",borderRadius:6,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",background:"transparent",color:"inherit",fontSize:12,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},ye={display:"inline-flex",alignItems:"center",gap:6,padding:"7px 13px",borderRadius:7,border:"1px solid var(--color-clay, #b4593f)",background:"var(--color-clay, #b4593f)",color:"#fff",fontSize:12.5,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},fe={border:"1px solid var(--border-color, rgba(0,0,0,0.10))",borderRadius:7,background:"var(--surface, rgba(0,0,0,0.02))",padding:12},he={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,border:"1px solid var(--border-color, rgba(0,0,0,0.10))",borderRadius:8,background:"var(--surface, rgba(0,0,0,0.02))",padding:"10px 12px"},be={display:"inline-flex",alignItems:"center",gap:5,padding:"6px 11px",borderRadius:6,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",background:"var(--surface, transparent)",color:"inherit",fontSize:12,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},me={display:"inline-flex",alignItems:"center",gap:6,padding:"7px 13px",borderRadius:6,border:"1px solid var(--status-success, #1f883d)",background:"var(--status-success, #1f883d)",color:"#fff",fontSize:12,fontWeight:650,cursor:"pointer",whiteSpace:"nowrap"},$={display:"inline-flex",alignItems:"center",gap:5,padding:"6px 11px",borderRadius:6,border:"1px solid var(--border-color, rgba(0,0,0,0.12))",background:"transparent",color:"inherit",fontSize:12,cursor:"pointer"},E={border:"1px dashed var(--border-color, rgba(0,0,0,0.16))",borderRadius:8,padding:24,fontSize:13,opacity:.85};export{Re as ReadinessPage};
|
package/dist/assets/dql-notebook/assets/{SetupOnboarding-CamQq_N2.js → SetupOnboarding-vKFtKtjh.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ne,u as ae,t as de,r as a,a as S,j as t,a1 as le,a2 as pe,a3 as ce,a4 as fe,F as ue,S as ge}from"./index-
|
|
1
|
+
import{c as ne,u as ae,t as de,r as a,a as S,j as t,a1 as le,a2 as pe,a3 as ce,a4 as fe,F as ue,S as ge}from"./index-mQd_pC-P.js";import{A as xe}from"./arrow-left-BLnlJAtp.js";import{A as ye}from"./arrow-right-BmUAb1aW.js";import"./react-CRB3T2We.js";/**
|
|
2
2
|
* @license lucide-react v0.563.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Pe,r as x,j as e,l as he,f as Te,a0 as le,L as Q,a as $,u as je,t as ke,$ as ge,S as Se,P as Y,T as se,a5 as De,Q as U}from"./index-
|
|
1
|
+
import{c as Pe,r as x,j as e,l as he,f as Te,a0 as le,L as Q,a as $,u as je,t as ke,$ as ge,S as Se,P as Y,T as se,a5 as De,Q as U}from"./index-mQd_pC-P.js";import{U as Ae}from"./UnifiedAgentRunPanel-Cu-YgIe4.js";import{X as ae}from"./x-stiJ-sP7.js";import{T as we}from"./triangle-alert-D5Ng-xZO.js";import{G as Z}from"./user-round-BK5N1cJW.js";import{u as Ee,P as _e}from"./usePersistedAgentThreadId-DBu97YaM.js";/**
|
|
2
2
|
* @license lucide-react v0.563.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c,
|
|
1
|
+
import{j as c,b8 as l}from"./index-mQd_pC-P.js";const e={certified:{base:"Certified",tone:"success"},reviewed:{base:"Reviewed",tone:"info"},ai_generated:{base:"AI-Generated",tone:"warning"},insufficient_context:{base:"Insufficient-Context",tone:"neutral"},conflict:{base:"Conflict",tone:"error"}},s="insufficient_context";function d({state:t,qualifier:i,label:a}){if(!t)return null;const n=o[t]??o[s],r=i?`${n.label} · ${i}`:n.label;return c.jsx(l,{tone:n.tone,children:a??r})}const o={certified:{tone:e.certified.tone,label:e.certified.base},reviewed:{tone:e.reviewed.tone,label:e.reviewed.base},ai_generated:{tone:e.ai_generated.tone,label:e.ai_generated.base},insufficient_context:{tone:e.insufficient_context.tone,label:e.insufficient_context.base},conflict:{tone:e.conflict.tone,label:e.conflict.base},draft:{tone:"warning",label:"Draft"},pending:{tone:"warning",label:"Pending review"},review:{tone:"warning",label:"Review"},uncertified:{tone:"warning",label:"Uncertified"},deprecated:{tone:"neutral",label:"Deprecated"},no_answer:{tone:"error",label:"No answer"}};export{d as T};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ze,r as f,a as te,j as t,d as $t,g as ot,l as ye,
|
|
1
|
+
import{c as ze,r as f,a as te,j as t,d as $t,g as ot,l as ye,b7 as ei,f as lt,L as Qe,aK as ti,ba as lr,B as ut,e as ar,u as Mt,t as dr,a5 as ni,bb as Ge,E as ri,H as ii,bc as si,w as oi,S as Ve,aH as cr,b as Et,b9 as Xe,P as it,D as li,G as ur,bd as ai,b0 as en,a0 as Ot,ar as di}from"./index-mQd_pC-P.js";import{S as qt,P as ci,F as at,E as ui,M as pi,R as un,d as pn,e as fi,A as gi,g as hi,u as xi}from"./usePersistedAgentThreadId-DBu97YaM.js";import{C as yi}from"./AiBuildResult-DLKFAe6R.js";import{T as Qt}from"./triangle-alert-D5Ng-xZO.js";import{U as mi}from"./user-round-BK5N1cJW.js";import{X as Ct}from"./x-stiJ-sP7.js";import{L as dt}from"./list-tree-j0s4asFK.js";import{W as Lt}from"./wrench-C-zLCMbW.js";import{M as bi}from"./minimize-2-Cl4pef4s.js";import{A as vi}from"./arrow-right-BmUAb1aW.js";/**
|
|
2
2
|
* @license lucide-react v0.563.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as x,r as w,a as k,m}from"./index-
|
|
1
|
+
import{u as x,r as w,a as k,m}from"./index-mQd_pC-P.js";const C="dql:focus-notebook-cell";function h(e){window.setTimeout(()=>{window.dispatchEvent(new CustomEvent(C,{detail:{cellId:e}}))},0)}function S(e){var t,a,c;const i=(t=e.question)==null?void 0:t.trim(),n=(a=e.generatedSql)==null?void 0:a.trim(),s=(c=e.generatedDql)==null?void 0:c.trim();if(!(!i||!n&&!s))return{version:1,source:"agent_run",question:i,...n?{generatedSql:n}:{},...s?{generatedDql:s}:{},...e.sourceRunId?{sourceRunId:e.sourceRunId}:{}}}function g(e){return e.replace(/[^a-zA-Z0-9_ -]+/g," ").replace(/\s+/g,"_").replace(/^_+|_+$/g,"").slice(0,48)||"ai_analysis"}function E(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function I(e,i){var c,o,u,f,l,q;const n=(o=(c=e.dqlArtifact)==null?void 0:c.source)==null?void 0:o.trim(),s=(e.sql??n??"").trim();if(!s&&!n)return[];if(e.mixedSourcePlan){const r=e.mixedSourcePlan,A=m("markdown",[`### ${e.title??"Mixed-source analysis"}`,"",`This analysis combines a bounded warehouse extraction with the local dataset \`${r.localDataset}\`.`,"",...(u=r.warehouseRelations)!=null&&u.length?[`- Warehouse sources: ${r.warehouseRelations.map(b=>`\`${b}\``).join(", ")}`]:[],`- Join: \`${r.warehouseKey}\` = \`${r.localKey}\``,"- Trust: local mixed-source analysis · review required"].join(`
|
|
2
2
|
`));A.name=g("Analysis context");const d=m("sql",s);return d.name=g(e.title??"Warehouse extraction"),d.mixedSourcePlan=r,d.executionTarget=((f=e.executionTarget)==null?void 0:f.target)==="connection"?e.executionTarget:{target:"connection"},d.datasetRefs=[{id:r.datasetId??r.localDataset,alias:r.localDataset,role:"source"}],[A,d]}const t=m(n?"dql":"sql",n||s);t.name=g(e.title??((l=e.dqlArtifact)==null?void 0:l.name)??"AI analysis"),e.result&&(t.result=e.result,t.status="success",t.executionCount=1),e.chartConfig&&(t.chartConfig=e.chartConfig),e.executionTarget&&(t.executionTarget=e.executionTarget),t.correctionProvenance=S({question:e.question,generatedSql:e.sql??((q=e.dqlArtifact)==null?void 0:q.compiledSql),generatedDql:n,sourceRunId:e.sourceRunId}),e.dqlArtifact&&(t.dqlArtifact={source:e.dqlArtifact.source,sql:e.sql,name:e.dqlArtifact.name,sourcePath:e.dqlArtifact.sourcePath,kind:e.dqlArtifact.kind,metrics:e.dqlArtifact.metrics,dimensions:e.dqlArtifact.dimensions,parameters:e.dqlArtifact.parameters,parameterValues:e.dqlArtifact.parameterValues,persistence:e.dqlArtifact.persistence,trustState:e.dqlArtifact.trustState,compiledSql:e.dqlArtifact.compiledSql??e.sql,...e.question?{question:e.question}:{}},t.dqlParameterValues=e.dqlArtifact.parameterValues);const a=i.filter(r=>new RegExp(`\\b${E(r.alias)}\\b`,"i").test(s)).map(r=>({id:r.id,alias:r.alias,role:r.storageMode==="staged"?"staged":"source",fingerprint:r.fileFingerprint}));return a.length>0&&(t.executionTarget={target:"local"},t.datasetRefs=a,t.dqlArtifact&&(t.dqlArtifact.reviewState="review_required")),[t]}function _(e){return(e??"ai analysis").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"ai-analysis"}function v(){const{state:e,dispatch:i}=x();return w.useCallback(async(n,s)=>{var f;const t=I(n,(s==null?void 0:s.datasets)??[]);if(t.length===0)return;if(e.activeFile&&e.activeFile.type!=="block"){let l=s==null?void 0:s.afterId;for(const q of t)i({type:"ADD_CELL",cell:q,...l?{afterId:l}:{}}),l=q.id;h(t[t.length-1].id);return}const a=n.title??((f=n.dqlArtifact)==null?void 0:f.name)??"AI analysis",c=_(a);let o=`notebooks/${c}.dqlnb`;try{o=(await k.createNotebook(c,"blank")).path}catch{}const u={name:o.split("/").pop()??`${c}.dqlnb`,path:o,type:"notebook",folder:"notebooks",isNew:!0};i({type:"FILE_ADDED",file:u}),i({type:"OPEN_FILE",file:u,cells:t,title:a}),h(t[t.length-1].id)},[i,e.activeFile])}export{C as N,S as c,h as f,v as u};
|