@duckcodeailabs/dql-cli 1.12.2 → 1.12.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/assets/dql-notebook/assets/AgentAnswerCard-BJAnjaLA.js +5 -0
- package/dist/assets/dql-notebook/assets/AgentLogPage-J72WR6hk.js +1 -0
- package/dist/assets/dql-notebook/assets/AiBuildDialog-CHJZfDmp.js +1 -0
- package/dist/assets/dql-notebook/assets/AiBuildResult-Da7_Cn12.js +33 -0
- package/dist/assets/dql-notebook/assets/AiSidePanel-BY6W_5aC.js +6 -0
- package/dist/assets/dql-notebook/assets/AnalyticsHome-u-buXgdv.js +6 -0
- package/dist/assets/dql-notebook/assets/AppsView-3k7ftDpd.js +4471 -0
- package/dist/assets/dql-notebook/assets/BlockStudio-CLX4EUyO.js +60 -0
- package/dist/assets/dql-notebook/assets/BusinessArtifactView-3THMNeyO.js +1 -0
- package/dist/assets/dql-notebook/assets/DbtFirstModelingPage-BwBPwtdA.js +22 -0
- package/dist/assets/dql-notebook/assets/GitPage-CvEki0pe.js +7 -0
- package/dist/assets/dql-notebook/assets/GlobalAiRail-NXdk9kNy.js +1 -0
- package/dist/assets/dql-notebook/assets/GovernedContextPage-DILbw-Vr.js +7 -0
- package/dist/assets/dql-notebook/assets/HelpDocsPage-DgCu4bvY.js +22 -0
- package/dist/assets/dql-notebook/assets/HomePage-CK3fXTQo.js +117 -0
- package/dist/assets/dql-notebook/assets/LineageDAG-DW_NO3P2.js +1 -0
- package/dist/assets/dql-notebook/assets/LineageDetailView-VT7DLJOB.js +1 -0
- package/dist/assets/dql-notebook/assets/LineageDrawer-DSTm8aXw.js +1 -0
- package/dist/assets/dql-notebook/assets/LineagePathBreadcrumb-DRlAYasJ.js +14 -0
- package/dist/assets/dql-notebook/assets/MiniLineageGraph-CR_nhwhZ.js +1 -0
- package/dist/assets/dql-notebook/assets/NewBlockModal-CJvjYiBF.js +1 -0
- package/dist/assets/dql-notebook/assets/NewNotebookModal-BEpPH93n.js +46 -0
- package/dist/assets/dql-notebook/assets/NotebookEditor-C7GDFwhF.js +202 -0
- package/dist/assets/dql-notebook/assets/ReadinessPage-rZiOp2xr.js +1 -0
- package/dist/assets/dql-notebook/assets/SetupOnboarding-BWjhTjPB.js +6 -0
- package/dist/assets/dql-notebook/assets/TrustBadge-RvZ9s6OQ.js +1 -0
- package/dist/assets/dql-notebook/assets/UnifiedAgentRunPanel-CGPcpY1B.js +83 -0
- package/dist/assets/dql-notebook/assets/ai-build-bus-1BR770pY.js +1 -0
- package/dist/assets/dql-notebook/assets/answer-to-notebook-Di227Cd4.js +2 -0
- package/dist/assets/dql-notebook/assets/arrow-left-BZHDcWHR.js +6 -0
- package/dist/assets/dql-notebook/assets/arrow-right-DlM1pC3_.js +6 -0
- package/dist/assets/dql-notebook/assets/book-open-text-DBcXFQAu.js +6 -0
- package/dist/assets/dql-notebook/assets/bot-BAywbvPm.js +6 -0
- package/dist/assets/dql-notebook/assets/chevron-up-B_GfKE_F.js +6 -0
- package/dist/assets/dql-notebook/assets/circle-x-BcxtZ-ym.js +6 -0
- package/dist/assets/dql-notebook/assets/{codemirror-Co0dCEDr.js → codemirror-1_I9gm6Z.js} +1 -1
- package/dist/assets/dql-notebook/assets/dagre-BZV40eAE.css +1 -0
- package/dist/assets/dql-notebook/assets/dagre.esm-Bqs0lsEz.js +23 -0
- package/dist/assets/dql-notebook/assets/external-link-B24Dk9_t.js +6 -0
- package/dist/assets/dql-notebook/assets/grip-vertical-D9g31N3j.js +6 -0
- package/dist/assets/dql-notebook/assets/{index-DvLT6Kls.css → index-DKu4CZt3.css} +1 -1
- package/dist/assets/dql-notebook/assets/index-DU7j3Sqk.js +644 -0
- package/dist/assets/dql-notebook/assets/link-2-B36oR5Bj.js +6 -0
- package/dist/assets/dql-notebook/assets/list-tree-B9ZzGc4U.js +6 -0
- package/dist/assets/dql-notebook/assets/maximize-2-BrvQLPoj.js +6 -0
- package/dist/assets/dql-notebook/assets/minimize-2-BrpFmsxS.js +6 -0
- package/dist/assets/dql-notebook/assets/panel-right-open-B1g1qhh5.js +6 -0
- package/dist/assets/dql-notebook/assets/pencil-DwywbTqQ.js +6 -0
- package/dist/assets/dql-notebook/assets/{react-BRY8hXab.js → react-CRB3T2We.js} +2 -2
- package/dist/assets/dql-notebook/assets/rotate-ccw-Db_KVs3J.js +6 -0
- package/dist/assets/dql-notebook/assets/semantic-fields-BIVuvP2l.js +3 -0
- package/dist/assets/dql-notebook/assets/triangle-alert-Cne6C2aG.js +6 -0
- package/dist/assets/dql-notebook/assets/usePersistedAgentThreadId-D6mtrJ-_.js +18 -0
- package/dist/assets/dql-notebook/assets/user-round-DkzxN1xD.js +11 -0
- package/dist/assets/dql-notebook/assets/wand-sparkles-CJUvFtur.js +6 -0
- package/dist/assets/dql-notebook/assets/workflow-BOvVTg7R.js +6 -0
- package/dist/assets/dql-notebook/assets/wrench-YeSpzZRt.js +6 -0
- package/dist/assets/dql-notebook/assets/x-C6tsHUR7.js +6 -0
- package/dist/assets/dql-notebook/index.html +3 -4
- package/dist/block-invocation.js +4 -0
- package/dist/block-invocation.js.map +1 -1
- package/dist/llm/answer-loop-tools.d.ts +8 -2
- package/dist/llm/answer-loop-tools.d.ts.map +1 -1
- package/dist/llm/answer-loop-tools.js +29 -2
- package/dist/llm/answer-loop-tools.js.map +1 -1
- package/dist/llm/providers/dql-agent-provider.d.ts +27 -1
- package/dist/llm/providers/dql-agent-provider.d.ts.map +1 -1
- package/dist/llm/providers/dql-agent-provider.js +79 -15
- package/dist/llm/providers/dql-agent-provider.js.map +1 -1
- package/dist/llm/types.d.ts +8 -1
- package/dist/llm/types.d.ts.map +1 -1
- package/dist/local-runtime.d.ts +56 -2
- package/dist/local-runtime.d.ts.map +1 -1
- package/dist/local-runtime.js +735 -104
- package/dist/local-runtime.js.map +1 -1
- package/dist/package.json +10 -10
- package/dist/sql-result-filter.d.ts +39 -0
- package/dist/sql-result-filter.d.ts.map +1 -0
- package/dist/sql-result-filter.js +256 -0
- package/dist/sql-result-filter.js.map +1 -0
- package/dist/warehouse-metadata.d.ts +1 -1
- package/dist/warehouse-metadata.d.ts.map +1 -1
- package/dist/warehouse-metadata.js +2 -2
- package/dist/warehouse-metadata.js.map +1 -1
- package/package.json +10 -10
- package/dist/assets/dql-notebook/assets/index-BRCtmVPa.js +0 -5952
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,r as h,as as O,at as x,au as S,o as L,n as C}from"./index-DU7j3Sqk.js";import{R as N,u as T,a as D,d as z,M as _,i as F,B as G,T as b,H as m,c as v}from"./dagre.esm-Bqs0lsEz.js";function A(e,c,a={}){var s;if(e.length===0)return e;const n=new b.graphlib.Graph().setDefaultEdgeLabel(()=>({}));n.setGraph({rankdir:"LR",ranksep:60,nodesep:30,marginx:20,marginy:20});for(const o of e){const i={width:170,height:52};if(a.mode==="layered"&&((s=o.data)!=null&&s.layer)){const d=S.indexOf(o.data.layer);d>=0&&(i.rank=d)}n.setNode(o.id,i)}for(const o of c)n.setEdge(o.source,o.target);return b.layout(n),e.map(o=>{const i=n.node(o.id);return{...o,position:{x:i.x-85,y:i.y-26}}})}function M({data:e,selected:c}){const a=e.nodeType,n=e.isFocal,s=C[a]??"var(--color-text-tertiary)",o=L[a]??a.toUpperCase();return t.jsxs("div",{style:{minWidth:140,maxWidth:190,background:"var(--color-bg-card)",border:`2px solid ${n||c?"var(--color-accent-blue)":s}`,borderRadius:8,padding:"6px 8px",boxShadow:n?"0 0 0 2px color-mix(in srgb, var(--color-accent-blue) 25%, transparent)":"none"},children:[t.jsx(m,{type:"target",position:v.Left,style:{width:6,height:6,background:s,border:"none"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginBottom:2},children:[t.jsx("span",{style:{fontSize:8,fontWeight:700,letterSpacing:"0.04em",color:"var(--color-bg-card)",background:s,borderRadius:3,padding:"1px 4px"},children:o}),e.domain&&t.jsx("span",{style:{color:"var(--color-text-tertiary)",fontSize:9},children:e.domain})]}),t.jsx("div",{style:{color:"var(--color-text-primary)",fontSize:10,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.label,children:e.label}),t.jsx(m,{type:"source",position:v.Right,style:{width:6,height:6,background:s,border:"none"}})]})}const W={miniDagNode:M};function B({nodes:e,edges:c,focalNodeId:a,height:n=250,onNodeClick:s,interactive:o=!0,layoutMode:i="flow",fitViewPadding:d=.15}){const[E,f,R]=T([]),[w,y,j]=D([]),{fitView:p}=z(),u=h.useRef(null);return h.useEffect(()=>{const g=e.map(r=>({id:r.id,type:"miniDagNode",position:{x:0,y:0},data:{label:r.name,nodeType:r.type,domain:r.domain,layer:O(r),isFocal:r.id===a}})),l=c.map((r,k)=>({id:`mini-edge-${k}-${r.source}-${r.target}`,source:r.source,target:r.target,style:{stroke:x[r.type]??"#8b949e",strokeWidth:1.4},markerEnd:{type:_.ArrowClosed,color:x[r.type]??"#8b949e",width:10,height:10}}));f(A(g,l,{mode:i})),y(l),requestAnimationFrame(()=>{p({padding:d,duration:200})})},[e,c,a,i,d,f,y,p]),h.useEffect(()=>{if(!u.current)return;const g=u.current,l=new ResizeObserver(()=>{p({padding:d,duration:0})});return l.observe(g),()=>l.disconnect()},[p,d]),e.length===0?t.jsx("div",{style:{height:n,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-text-tertiary)",fontSize:11},children:"No lineage nodes to display"}):t.jsx("div",{ref:u,style:{height:n,width:"100%",borderRadius:8,overflow:"hidden",border:"1px solid var(--color-border-subtle)"},children:t.jsx(F,{nodes:E,edges:w,onNodesChange:o?R:void 0,onEdgesChange:o?j:void 0,onNodeClick:s?(g,l)=>s(l.id):void 0,nodeTypes:W,fitView:!0,fitViewOptions:{padding:d},minZoom:.25,proOptions:{hideAttribution:!0},nodesDraggable:o,nodesConnectable:!1,zoomOnScroll:o,panOnDrag:o,style:{background:"var(--color-bg-sunken)"},children:t.jsx(G,{color:"var(--color-border-subtle)",gap:20,size:1})})})}function I(e){return t.jsx(N,{children:t.jsx(B,{...e})})}export{I as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as z,t as D,r as i,a as v,j as t}from"./index-DU7j3Sqk.js";import"./react-CRB3T2We.js";function F(a,s,l,e){var u;const n=l.trim().replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),p=`${n?`${n}/`:""}${e}.dql`;if(!s)return`blocks/${p}`;const r=a.find(k=>k.id===s),d=(u=r==null?void 0:r.sourcePath)==null?void 0:u.replace(/\/domain\.dql$/,"");return d?`${d}/blocks/${p}`:`blocks/${s}/${p}`}function E(a){return a.toLowerCase().replace(/[^a-z0-9\-_\s]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").slice(0,64)}function O(a){return a.trim()?/^[a-zA-Z0-9\-_ ]+$/.test(a)?null:"Only letters, numbers, hyphens, underscores, and spaces allowed.":"Name is required."}function W({onFileOpened:a}){const{state:s,dispatch:l}=z(),e=D[s.themeMode],[n,p]=i.useState(""),[r,d]=i.useState(s.newBlockModalDefaultType),[u,k]=i.useState([]),[y,L]=i.useState(""),[g,$]=i.useState(""),[m,f]=i.useState(null),[b,S]=i.useState(!1),B=i.useRef(null);i.useEffect(()=>{var c;(c=B.current)==null||c.focus();let o=!0;return v.getDomains().then(h=>{o&&k(h.domains)}),()=>{o=!1}},[]),i.useEffect(()=>{d(s.newBlockModalDefaultType)},[s.newBlockModalDefaultType]),i.useEffect(()=>{const o=c=>{c.key==="Escape"&&l({type:"CLOSE_NEW_BLOCK_MODAL"})};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[l]);const j=async()=>{var h;const o=O(n);if(o){f(o);return}S(!0),f(null);const c=E(n);try{const x=await v.createBlock(n.trim(),{blockType:r,...y?{domain:y}:{},...g.trim()?{folderPath:g.trim()}:{}}),C={name:`${c}.dql`,path:x.path,type:"block",folder:x.path.split("/").slice(0,-1).join("/"),isNew:!0};l({type:"FILE_ADDED",file:C}),l({type:"CLOSE_NEW_BLOCK_MODAL"}),a(C)}catch(x){(h=x.message)!=null&&h.includes("already exists")?f("A block with this name already exists."):f(x.message??"Failed to create block.")}finally{S(!1)}},w=o=>{o.target===o.currentTarget&&l({type:"CLOSE_NEW_BLOCK_MODAL"})};return t.jsx("div",{onClick:w,style:{position:"fixed",inset:0,background:e.modalOverlay,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,backdropFilter:"blur(4px)"},children:t.jsxs("div",{style:{background:e.modalBg,border:`1px solid ${e.cellBorder}`,borderRadius:12,width:420,maxWidth:"calc(100vw - 48px)",boxShadow:"0 20px 60px rgba(0,0,0,0.5)",overflow:"hidden"},children:[t.jsxs("div",{style:{padding:"20px 24px 0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("h2",{style:{fontSize:16,fontWeight:600,color:e.textPrimary,fontFamily:e.font,margin:0},children:"New Block"}),t.jsx("button",{onClick:()=>l({type:"CLOSE_NEW_BLOCK_MODAL"}),style:{background:"transparent",border:"none",cursor:"pointer",color:e.textMuted,fontSize:18,lineHeight:1,padding:"2px 4px",borderRadius:4},children:"×"})]}),t.jsxs("div",{style:{padding:"20px 24px 24px",display:"flex",flexDirection:"column",gap:16},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[t.jsxs("button",{type:"button",onClick:()=>d("custom"),style:{background:r==="custom"?`${e.accent}18`:e.btnBg,border:`1px solid ${r==="custom"?e.accent:e.btnBorder}`,borderRadius:8,color:r==="custom"?e.accent:e.textSecondary,cursor:"pointer",fontSize:12,fontWeight:700,fontFamily:e.font,padding:"10px 12px",textAlign:"left"},children:["SQL Block",t.jsx("span",{style:{display:"block",marginTop:3,color:e.textMuted,fontWeight:400,fontSize:11},children:"Build from dbt models, tables, and SELECT queries."})]}),t.jsxs("button",{type:"button",onClick:()=>d("semantic"),style:{background:r==="semantic"?`${e.accent}18`:e.btnBg,border:`1px solid ${r==="semantic"?e.accent:e.btnBorder}`,borderRadius:8,color:r==="semantic"?e.accent:e.textSecondary,cursor:"pointer",fontSize:12,fontWeight:700,fontFamily:e.font,padding:"10px 12px",textAlign:"left"},children:["Semantic Block",t.jsx("span",{style:{display:"block",marginTop:3,color:e.textMuted,fontWeight:400,fontSize:11},children:"Build from dbt/DQL metrics and dimensions."})]})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[t.jsx("label",{style:{fontSize:12,fontWeight:500,color:e.textSecondary,fontFamily:e.font},children:"Block Name"}),t.jsx("input",{ref:B,value:n,onChange:o=>{p(o.target.value),f(null)},onKeyDown:o=>{o.key==="Enter"&&j()},placeholder:"revenue-summary",style:{background:e.inputBg,border:`1px solid ${m?e.error:e.inputBorder}`,borderRadius:6,color:e.textPrimary,fontSize:13,fontFamily:e.font,padding:"8px 12px",outline:"none",transition:"border-color 0.15s"}}),m&&t.jsx("span",{style:{fontSize:11,color:e.error,fontFamily:e.font},children:m}),n&&!m&&t.jsxs("span",{style:{fontSize:11,color:e.textMuted,fontFamily:e.fontMono},children:["Git path: ",F(u,y,g,E(n))]})]}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[t.jsxs("label",{style:{display:"grid",gap:6,fontSize:12,fontWeight:500,color:e.textSecondary,fontFamily:e.font},children:["Domain",t.jsxs("select",{"aria-label":"Block domain",value:y,onChange:o=>L(o.target.value),style:{background:e.inputBg,border:`1px solid ${e.inputBorder}`,borderRadius:6,color:e.textPrimary,fontSize:13,fontFamily:e.font,padding:"8px 10px",outline:"none"},children:[t.jsx("option",{value:"",children:"Global / cross-domain"}),u.map(o=>t.jsx("option",{value:o.id,children:o.id},o.id))]})]}),t.jsxs("label",{style:{display:"grid",gap:6,fontSize:12,fontWeight:500,color:e.textSecondary,fontFamily:e.font},children:["Folder",t.jsx("input",{"aria-label":"Block folder",value:g,onChange:o=>$(o.target.value),placeholder:"reporting/monthly",style:{background:e.inputBg,border:`1px solid ${e.inputBorder}`,borderRadius:6,color:e.textPrimary,fontSize:13,fontFamily:e.fontMono,padding:"8px 10px",outline:"none"}})]})]}),t.jsx("div",{style:{fontSize:12,color:e.textMuted,fontFamily:e.font,lineHeight:1.5,padding:"8px 12px",background:e.pillBg,borderRadius:6},children:r==="semantic"?"Semantic blocks use governed metrics, dimensions, and chart intent. They do not start with raw SQL.":"SQL blocks are reusable SELECT queries stored in the blocks/ folder. Use them for dbt models, tables, and imported SQL."})]}),t.jsxs("div",{style:{padding:"14px 24px",borderTop:`1px solid ${e.cellBorder}`,display:"flex",justifyContent:"flex-end",gap:10},children:[t.jsx("button",{onClick:()=>l({type:"CLOSE_NEW_BLOCK_MODAL"}),style:{background:e.btnBg,border:`1px solid ${e.btnBorder}`,borderRadius:6,color:e.textSecondary,cursor:"pointer",fontSize:13,fontFamily:e.font,fontWeight:500,padding:"7px 16px"},children:"Cancel"}),t.jsx("button",{onClick:j,disabled:b||!n.trim(),style:{background:e.accent,border:`1px solid ${e.accent}`,borderRadius:6,color:"#ffffff",cursor:b||!n.trim()?"not-allowed":"pointer",fontSize:13,fontFamily:e.font,fontWeight:500,padding:"7px 20px",opacity:b||!n.trim()?.6:1,display:"flex",alignItems:"center",gap:6},children:b?"Creating...":"Create Block"})]})]})})}export{W as NewBlockModal};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import{g as E,m as o,u as N,t as B,r as l,a as j,j as t,h as T}from"./index-DU7j3Sqk.js";import{B as w}from"./book-open-text-DBcXFQAu.js";import{X as q}from"./x-C6tsHUR7.js";import"./react-CRB3T2We.js";/**
|
|
2
|
+
* @license lucide-react v0.563.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const z=[["path",{d:"M12 16v5",key:"zza2cw"}],["path",{d:"M16 14v7",key:"1g90b9"}],["path",{d:"M20 10v11",key:"1iqoj0"}],["path",{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15",key:"1fw8x9"}],["path",{d:"M4 18v3",key:"1yp0dc"}],["path",{d:"M8 14v7",key:"n3cwzv"}]],R=E("chart-no-axes-combined",z);/**
|
|
7
|
+
* @license lucide-react v0.563.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const A=[["path",{d:"M15.6 2.7a10 10 0 1 0 5.7 5.7",key:"1e0p6d"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M13.4 10.6 19 5",key:"1kr7tw"}]],I=E("circle-gauge",A);/**
|
|
12
|
+
* @license lucide-react v0.563.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const F=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],W=E("flask-conical",F),C={blank:"Start empty",analysis:"Explore a question",metric_diagnostic:"Investigate a metric",data_quality:"Check data quality",experiment:"Review an experiment"},$={blank:"Add Ask, DQL, SQL, or notes only when you need them.",analysis:"Move from a business question to evidence, findings, and a decision.",metric_diagnostic:"Trend a metric, break down its drivers, and record the diagnosis.",data_quality:"Profile a source, run checks, and document ownership and remediation.",experiment:"Capture the hypothesis, metrics, results, guardrails, and decision."},P={blank:"Empty canvas · 0 starter cells",analysis:"1 DQL query · 4 note sections",metric_diagnostic:"2 DQL queries · 2 note sections",data_quality:"2 DQL queries · 2 note sections",experiment:"1 DQL query · 3 note sections"};function K(r){switch(r){case"analysis":return[o("markdown",`# TL;DR
|
|
17
|
+
|
|
18
|
+
Summarize the answer and decision here.`),o("markdown",`## Context and methods
|
|
19
|
+
|
|
20
|
+
State the business question, scope, definitions, and assumptions.`),{...o("dql"),name:"analysis_data"},o("markdown",`## Results
|
|
21
|
+
|
|
22
|
+
Explain the material findings and uncertainty.`),o("markdown",`## Takeaways
|
|
23
|
+
|
|
24
|
+
Record the decision, risks, and next action.`)];case"metric_diagnostic":return[o("markdown",`# Metric diagnostic
|
|
25
|
+
|
|
26
|
+
**Question:** What changed, when, and for whom?
|
|
27
|
+
|
|
28
|
+
**Metric definition:** Add the certified definition and expected behavior.`),{...o("dql"),name:"metric_trend"},{...o("dql"),name:"driver_breakdown",dependencies:[]},o("markdown",`## Diagnosis
|
|
29
|
+
|
|
30
|
+
Separate validated drivers from hypotheses and data limitations.`)];case"data_quality":return[o("markdown",`# Data-quality investigation
|
|
31
|
+
|
|
32
|
+
Document the source, owner, freshness expectation, and affected decisions.`),{...o("dql"),name:"quality_profile"},{...o("dql"),name:"quality_checks"},o("markdown",`## Findings and disposition
|
|
33
|
+
|
|
34
|
+
Record severity, impacted metrics, owner, and remediation.`)];case"experiment":return[o("markdown",`# Experiment log
|
|
35
|
+
|
|
36
|
+
**Hypothesis:**
|
|
37
|
+
|
|
38
|
+
**Primary metric:**
|
|
39
|
+
|
|
40
|
+
**Guardrails:**
|
|
41
|
+
|
|
42
|
+
**Population and dates:**`),{...o("dql"),name:"experiment_results"},o("markdown",`## Results
|
|
43
|
+
|
|
44
|
+
Report effect size, uncertainty, guardrails, and data-quality checks.`),o("markdown",`## Decision
|
|
45
|
+
|
|
46
|
+
Ship, iterate, or stop — with rationale.`)];default:return[]}}const H={blank:w,analysis:R,metric_diagnostic:I,data_quality:T,experiment:W};function L(r){return r.toLowerCase().replace(/[^a-z0-9\-_\s]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").slice(0,64)}function Q(r){return r.trim()?/^[a-zA-Z0-9\-_ ]+$/.test(r)?null:"Only letters, numbers, hyphens, underscores, and spaces allowed.":"Name is required."}function Z({onFileOpened:r}){const{state:d,dispatch:a}=N(),e=B[d.themeMode],[s,m]=l.useState(""),[u,i]=l.useState("blank"),[h,y]=l.useState([]),[x,M]=l.useState(""),[f,k]=l.useState(null),[g,_]=l.useState(!1),S=l.useRef(null);l.useEffect(()=>{var c;(c=S.current)==null||c.focus();let n=!0;return j.getDomains().then(b=>{n&&y(b.domains)}),()=>{n=!1}},[]),l.useEffect(()=>{const n=c=>{c.key==="Escape"&&a({type:"CLOSE_NEW_NOTEBOOK_MODAL"})};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[a]);const O=async()=>{const n=Q(s);if(n){k(n);return}_(!0),k(null);const c=L(s),b=K(u);try{const v=await j.createNotebook(c,u,{...x?{ownerDomain:x,usesDomains:[x]}:{}}),p={name:`${c}.dqlnb`,path:v.path,type:"notebook",folder:"notebooks",isNew:!0};a({type:"FILE_ADDED",file:p}),a({type:"OPEN_FILE",file:p,cells:b,title:s.trim()}),a({type:"CLOSE_NEW_NOTEBOOK_MODAL"}),r(p)}catch{const v=`notebooks/${c}.dqlnb`,p={name:`${c}.dqlnb`,path:v,type:"notebook",folder:"notebooks",isNew:!0};a({type:"FILE_ADDED",file:p}),a({type:"OPEN_FILE",file:p,cells:b,title:s.trim()}),a({type:"CLOSE_NEW_NOTEBOOK_MODAL"}),r(p)}finally{_(!1)}},D=n=>{n.target===n.currentTarget&&a({type:"CLOSE_NEW_NOTEBOOK_MODAL"})};return t.jsx("div",{onClick:D,role:"presentation",style:{position:"fixed",inset:0,background:e.modalOverlay,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,backdropFilter:"blur(4px)"},children:t.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"new-notebook-title",style:{background:e.modalBg,border:`1px solid ${e.cellBorder}`,borderRadius:14,width:700,maxWidth:"calc(100vw - 48px)",maxHeight:"min(760px, calc(100vh - 48px))",boxShadow:"0 24px 72px rgba(0,0,0,0.38)",overflow:"hidden",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{padding:"14px 18px",display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16,borderBottom:`1px solid ${e.cellBorder}`},children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10},children:[t.jsx("span",{style:{width:30,height:30,borderRadius:8,display:"inline-grid",placeItems:"center",color:e.accent,background:"var(--accent-dim)",flexShrink:0},children:t.jsx(w,{size:16,strokeWidth:2,"aria-hidden":"true"})}),t.jsxs("div",{children:[t.jsx("h2",{id:"new-notebook-title",style:{fontSize:17,fontWeight:750,color:e.textPrimary,fontFamily:e.font,margin:0},children:"Create notebook"}),t.jsx("p",{style:{margin:"3px 0 0",color:e.textMuted,fontSize:11.5,lineHeight:1.35,fontFamily:e.font},children:"Choose how much starter structure you want. Every option creates the same editable, Git-tracked notebook."})]})]}),t.jsx("button",{type:"button","aria-label":"Close create notebook",onClick:()=>a({type:"CLOSE_NEW_NOTEBOOK_MODAL"}),style:{width:28,height:28,display:"inline-grid",placeItems:"center",background:e.btnBg,border:`1px solid ${e.btnBorder}`,cursor:"pointer",color:e.textMuted,padding:0,borderRadius:7,flexShrink:0},children:t.jsx(q,{size:14,"aria-hidden":"true"})})]}),t.jsxs("div",{style:{padding:"14px 18px",display:"flex",flexDirection:"column",gap:13,overflowY:"auto"},children:[t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(210px, 0.72fr)",gap:12},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:5,minWidth:0},children:[t.jsx("label",{htmlFor:"new-notebook-name",style:{fontSize:12,fontWeight:500,color:e.textSecondary,fontFamily:e.font},children:"Notebook name"}),t.jsx("input",{id:"new-notebook-name",ref:S,value:s,onChange:n=>{m(n.target.value),k(null)},onKeyDown:n=>{n.key==="Enter"&&O()},placeholder:"e.g. Customer retention analysis",style:{background:e.inputBg,border:`1px solid ${f?e.error:e.inputBorder}`,borderRadius:6,color:e.textPrimary,fontSize:13,fontFamily:e.font,padding:"8px 12px",outline:"none",transition:"border-color 0.15s"}}),f&&t.jsx("span",{style:{fontSize:11,color:e.error,fontFamily:e.font},children:f}),s&&!f&&t.jsxs("span",{style:{fontSize:11,color:e.textMuted,fontFamily:e.fontMono},children:["Git path: notebooks/",L(s),".dqlnb"]})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:5,minWidth:0},children:[t.jsx("label",{style:{fontSize:12,fontWeight:500,color:e.textSecondary,fontFamily:e.font},children:"Domain context"}),t.jsxs("select",{"aria-label":"Notebook owner domain",value:x,onChange:n=>M(n.target.value),style:{background:e.inputBg,border:`1px solid ${e.inputBorder}`,borderRadius:6,color:e.textPrimary,fontSize:13,fontFamily:e.font,padding:"8px 12px",outline:"none"},children:[t.jsx("option",{value:"",children:"Global / cross-domain"}),h.map(n=>t.jsx("option",{value:n.id,children:n.id},n.id))]}),t.jsx("span",{style:{fontSize:10.5,lineHeight:1.3,color:e.textMuted,fontFamily:e.font},children:"Optional. Adds a Domain Studio backlink without moving the Git file."})]})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:7},children:[t.jsx("label",{style:{fontSize:12,fontWeight:500,color:e.textSecondary,fontFamily:e.font},children:"Starting point"}),t.jsx("div",{style:{padding:"6px 9px",borderRadius:8,border:`1px solid ${e.cellBorder}`,background:e.cellBg,color:e.textMuted,fontSize:10.5,lineHeight:1.35,fontFamily:e.font},children:"Templates only add starter cells. They do not change execution, permissions, governance, or where the notebook is saved."}),t.jsx("div",{role:"radiogroup","aria-label":"Notebook starting point",style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:8},children:Object.keys(C).map(n=>t.jsx(G,{value:n,selected:u===n,onSelect:()=>i(n),label:C[n],description:$[n],cellSummary:P[n],Icon:H[n],t:e},n))})]})]}),t.jsxs("div",{style:{padding:"10px 18px",borderTop:`1px solid ${e.cellBorder}`,display:"flex",justifyContent:"flex-end",gap:10,background:e.cellBg},children:[t.jsx("button",{onClick:()=>a({type:"CLOSE_NEW_NOTEBOOK_MODAL"}),style:{background:e.btnBg,border:`1px solid ${e.btnBorder}`,borderRadius:8,color:e.textSecondary,cursor:"pointer",fontSize:13,fontFamily:e.font,fontWeight:500,padding:"8px 15px"},children:"Cancel"}),t.jsxs("button",{onClick:O,disabled:g||!s.trim(),style:{background:e.accent,border:`1px solid ${e.accent}`,borderRadius:8,color:"var(--accent-fg)",cursor:g||!s.trim()?"not-allowed":"pointer",fontSize:13,fontFamily:e.font,fontWeight:500,padding:"8px 16px",opacity:g||!s.trim()?.6:1,display:"flex",alignItems:"center",gap:6},children:[t.jsx(w,{size:14,"aria-hidden":"true"}),g?"Creating…":"Create notebook"]})]})]})})}function G({value:r,selected:d,onSelect:a,label:e,description:s,cellSummary:m,Icon:u,t:i}){const[h,y]=l.useState(!1);return t.jsxs("button",{type:"button",role:"radio","aria-checked":d,"aria-label":`${e}. ${m}`,onClick:a,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),style:{position:"relative",display:"grid",gridTemplateColumns:"30px minmax(0, 1fr)",gridColumn:r==="blank"?"1 / -1":void 0,alignItems:"start",gap:9,minHeight:r==="blank"?60:88,padding:"10px",borderRadius:10,border:`1px solid ${d?i.accent:h?i.textMuted:i.inputBorder}`,background:d?"var(--accent-dim)":h?i.sidebarItemHover:i.cellBg,color:i.textPrimary,cursor:"pointer",transition:"all 0.15s",textAlign:"left",fontFamily:i.font},children:[t.jsx("span",{style:{width:30,height:30,borderRadius:8,display:"inline-grid",placeItems:"center",color:d?i.accent:i.textSecondary,background:d?i.cellBg:i.btnBg,border:`1px solid ${d?`${i.accent}40`:i.btnBorder}`},children:t.jsx(u,{size:16,strokeWidth:2,"aria-hidden":"true"})}),t.jsxs("span",{style:{minWidth:0,display:"grid",gap:4},children:[t.jsx("span",{style:{fontSize:12.5,fontWeight:750,color:i.textPrimary},children:e}),t.jsx("span",{style:{fontSize:11,color:i.textSecondary,lineHeight:1.3},children:s}),t.jsx("span",{style:{marginTop:1,fontSize:10,color:d?i.accent:i.textMuted,fontWeight:650},children:m})]}),t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",right:10,top:10,width:14,height:14,borderRadius:999,border:`1.5px solid ${d?i.accent:i.textMuted}`,display:"inline-grid",placeItems:"center"},children:d?t.jsx("span",{style:{width:7,height:7,borderRadius:999,background:i.accent}}):null})]})}export{Z as NewNotebookModal};
|