@rudderhq/server 0.7.1 → 0.7.2-canary.0
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/package.json +14 -14
- package/ui-dist/assets/{LibraryLiveSurface-CZED7oKj.js → LibraryLiveSurface-CcsYG18H.js} +1 -1
- package/ui-dist/assets/{abnfDiagram-VRR7QNED-BoPyIoAq.js → abnfDiagram-VRR7QNED-C34K70lu.js} +1 -1
- package/ui-dist/assets/{arc-DTYs4RCH.js → arc-BYztEqom.js} +1 -1
- package/ui-dist/assets/{architectureDiagram-ZJ3FMSHR-BGfp2S_3.js → architectureDiagram-ZJ3FMSHR-BQKKX-d7.js} +1 -1
- package/ui-dist/assets/{blockDiagram-677ZJIJ3-aW0EGIUf.js → blockDiagram-677ZJIJ3-DPfaIbqb.js} +1 -1
- package/ui-dist/assets/{c4Diagram-LMCZKHZV--1itKgA2.js → c4Diagram-LMCZKHZV-BnwCM567.js} +1 -1
- package/ui-dist/assets/channel-Bmzlyjow.js +1 -0
- package/ui-dist/assets/{chunk-2Q5K7J3B-ZIqIozPQ.js → chunk-2Q5K7J3B-CFviCRuZ.js} +1 -1
- package/ui-dist/assets/{chunk-32BRIVSS-DiwBEZVQ.js → chunk-32BRIVSS-FoIxWB1d.js} +1 -1
- package/ui-dist/assets/{chunk-5VM5RSS4-CLOrTmL8.js → chunk-5VM5RSS4-EbAfuwwN.js} +1 -1
- package/ui-dist/assets/{chunk-EX3LRPZG-D6xZzF47.js → chunk-EX3LRPZG-CsStqjdd.js} +1 -1
- package/ui-dist/assets/{chunk-JWPE2WC7-B9tYvTZl.js → chunk-JWPE2WC7-Dw5KEviU.js} +1 -1
- package/ui-dist/assets/{chunk-MOJQB5TN-D_qo-SzM.js → chunk-MOJQB5TN-BlHlEWfj.js} +1 -1
- package/ui-dist/assets/{chunk-RYQCIY6F-ChPHGc2P.js → chunk-RYQCIY6F-BWw7BE01.js} +1 -1
- package/ui-dist/assets/{chunk-V7JOEXUC-Dk6GbZYp.js → chunk-V7JOEXUC-CxRvHZbj.js} +1 -1
- package/ui-dist/assets/{chunk-VR4S4FIN-B6AREC1T.js → chunk-VR4S4FIN-DZa_KwY9.js} +1 -1
- package/ui-dist/assets/{chunk-XXDRQBXY-CUyO-JUr.js → chunk-XXDRQBXY-Cnimf5j2.js} +1 -1
- package/ui-dist/assets/classDiagram-OUVF2IWQ-VR7MKiEz.js +1 -0
- package/ui-dist/assets/classDiagram-v2-EOCWNBFH-VR7MKiEz.js +1 -0
- package/ui-dist/assets/{cose-bilkent-JH36ORCC-BCxIInLZ.js → cose-bilkent-JH36ORCC-COCPT6B8.js} +1 -1
- package/ui-dist/assets/{cynefin-VYW2F7L2-DqsnpnHA.js → cynefin-VYW2F7L2-C5CybQ7c.js} +1 -1
- package/ui-dist/assets/{cynefinDiagram-TSTJHNR4-BD7QQNLW.js → cynefinDiagram-TSTJHNR4-BDrPLGpv.js} +1 -1
- package/ui-dist/assets/{dagre-VKFMJZFB-DaE160f7.js → dagre-VKFMJZFB-DXxPiE9D.js} +1 -1
- package/ui-dist/assets/{diagram-FQU43EPY-DZ0c59y8.js → diagram-FQU43EPY-CdC2pj_S.js} +1 -1
- package/ui-dist/assets/{diagram-G47NLZAW-C_413g5E.js → diagram-G47NLZAW-sEOwPe0_.js} +1 -1
- package/ui-dist/assets/{diagram-NH7WQ7WH-D_o9pXB-.js → diagram-NH7WQ7WH-CwoTfWmv.js} +1 -1
- package/ui-dist/assets/{diagram-OA4YK3LP-BI2xMqiW.js → diagram-OA4YK3LP-Cksc-JQa.js} +1 -1
- package/ui-dist/assets/{diagram-WEI45ONY-hhM8R_14.js → diagram-WEI45ONY-1lHRkCse.js} +1 -1
- package/ui-dist/assets/{ebnfDiagram-CCIWWBDH-DfFgEtmG.js → ebnfDiagram-CCIWWBDH-BJ6dNjJ2.js} +1 -1
- package/ui-dist/assets/{erDiagram-Q63AITRT-CCw4ysHK.js → erDiagram-Q63AITRT-DVTmCmE1.js} +1 -1
- package/ui-dist/assets/{flowDiagram-23GEKE2U-CzC1SMmo.js → flowDiagram-23GEKE2U-B2A6w103.js} +1 -1
- package/ui-dist/assets/{ganttDiagram-NO4QXBWP-CbPJIrIw.js → ganttDiagram-NO4QXBWP-BoqdQOBD.js} +1 -1
- package/ui-dist/assets/{gitGraphDiagram-IHSO6WYX-jCxJ66_C.js → gitGraphDiagram-IHSO6WYX-BPWVpzXj.js} +1 -1
- package/ui-dist/assets/{graph-BfNZ9Jzj.js → graph-W8QGT1XQ.js} +1 -1
- package/ui-dist/assets/{index-BE1vSI6a.js → index-96_7QHQ5.js} +1 -1
- package/ui-dist/assets/{index-DmjAbzHq.js → index-9ogi82-q.js} +1 -1
- package/ui-dist/assets/{index-SkHIC7Ma.js → index-BT3SfQnV.js} +1 -1
- package/ui-dist/assets/{index-B3h9Vdxx.js → index-BYt_CWxk.js} +1 -1
- package/ui-dist/assets/{index-Ck-ZNQeD.js → index-C8VKPswh.js} +4 -4
- package/ui-dist/assets/{index-B8q4cbOz.js → index-CG59QbM3.js} +1 -1
- package/ui-dist/assets/{index-D_K-9VDs.js → index-CRe48ije.js} +1 -1
- package/ui-dist/assets/{index-BULll2e0.js → index-CaNgMg06.js} +1 -1
- package/ui-dist/assets/{index-Chop-Dpa.js → index-CjRwrGKt.js} +1 -1
- package/ui-dist/assets/{index-ByUFNj0O.js → index-Cjq0R1QI.js} +1 -1
- package/ui-dist/assets/{index-D00XdcOq.js → index-CrOrmmHY.js} +1 -1
- package/ui-dist/assets/{index-DiMDROQY.js → index-D5okPECv.js} +1 -1
- package/ui-dist/assets/{index-Bwo-C8W5.js → index-DFhr5xg9.js} +1 -1
- package/ui-dist/assets/{index-BKn4zRjf.js → index-DTqh4VW9.js} +1 -1
- package/ui-dist/assets/{index-BjxRqzZK.js → index-UkFXcg--.js} +1 -1
- package/ui-dist/assets/{infoDiagram-FWYZ7A6U-BkDimGw3.js → infoDiagram-FWYZ7A6U-CGKM1qd0.js} +1 -1
- package/ui-dist/assets/{ishikawaDiagram-FXEZZL3T-BAyUfn6x.js → ishikawaDiagram-FXEZZL3T-BMINXmgJ.js} +1 -1
- package/ui-dist/assets/{journeyDiagram-5HDEW3XC-DlbpTZHG.js → journeyDiagram-5HDEW3XC-lLpvO5ye.js} +1 -1
- package/ui-dist/assets/{kanban-definition-HUTT4EX6-Cd67S14K.js → kanban-definition-HUTT4EX6-B1o_jb4m.js} +1 -1
- package/ui-dist/assets/{layout-Dc4YEiCC.js → layout-CfhTVz4J.js} +1 -1
- package/ui-dist/assets/{linear-BhRsbD_5.js → linear-Cyfw5mer.js} +1 -1
- package/ui-dist/assets/{map-CEWybj6z.js → map-BJC9PnTS.js} +1 -1
- package/ui-dist/assets/{mermaid.core-CqqAFYNg.js → mermaid.core-FscMPm7s.js} +4 -4
- package/ui-dist/assets/{mindmap-definition-LN4V7U3C-CCb-XmEi.js → mindmap-definition-LN4V7U3C-DRgxKOO8.js} +1 -1
- package/ui-dist/assets/{pegDiagram-2B236MQR-CqUV14VZ.js → pegDiagram-2B236MQR-Dvz4qHu-.js} +1 -1
- package/ui-dist/assets/{pieDiagram-ENE6RG2P-Dn_M_GRM.js → pieDiagram-ENE6RG2P-Dk2JI7ZR.js} +1 -1
- package/ui-dist/assets/{quadrantDiagram-ABIIQ3AL-rAEhJDr2.js → quadrantDiagram-ABIIQ3AL-rDcmmQtb.js} +1 -1
- package/ui-dist/assets/{railroadDiagram-RFXS5EU6-iE2o_jkH.js → railroadDiagram-RFXS5EU6-DuGw7Ver.js} +1 -1
- package/ui-dist/assets/{requirementDiagram-TGXJPOKE-BFyKBR1h.js → requirementDiagram-TGXJPOKE-B9FO6PRO.js} +1 -1
- package/ui-dist/assets/{sankeyDiagram-HTMAVEWB-DRa_2YB6.js → sankeyDiagram-HTMAVEWB-Dvy9IKWr.js} +1 -1
- package/ui-dist/assets/{sequenceDiagram-DBY2YBRQ-BG8VIjD7.js → sequenceDiagram-DBY2YBRQ-BMNm3icE.js} +1 -1
- package/ui-dist/assets/{sizeCapture-X5ZJPWSS-CS1xlbzG.js → sizeCapture-X5ZJPWSS-D9g2vtWC.js} +1 -1
- package/ui-dist/assets/{stateDiagram-2N3HPSRC-BSl2RUJ1.js → stateDiagram-2N3HPSRC-kQ3-sJWr.js} +1 -1
- package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-BYK8scZh.js +1 -0
- package/ui-dist/assets/{swimlanes-5IMT3BWC-BT8Hrm9J.js → swimlanes-5IMT3BWC-Cx_ksQRH.js} +2 -2
- package/ui-dist/assets/swimlanesDiagram-G3AALYLV-irU0aSS8.js +8 -0
- package/ui-dist/assets/{timeline-definition-FHXFAJF6-CfYIqEuQ.js → timeline-definition-FHXFAJF6-CyArjIWu.js} +1 -1
- package/ui-dist/assets/{vennDiagram-L72KCM5P-C8zBH7o9.js → vennDiagram-L72KCM5P-Bjdg_skC.js} +1 -1
- package/ui-dist/assets/{wardleyDiagram-EHGQE667-D5HyFfI9.js → wardleyDiagram-EHGQE667-BLV-S7cE.js} +1 -1
- package/ui-dist/assets/{xychartDiagram-FW5EYKEG-CGItJmLx.js → xychartDiagram-FW5EYKEG-BTtly2sn.js} +1 -1
- package/ui-dist/index.html +1 -1
- package/ui-dist/assets/channel-DLNwhPnC.js +0 -1
- package/ui-dist/assets/classDiagram-OUVF2IWQ-JsIc-rlc.js +0 -1
- package/ui-dist/assets/classDiagram-v2-EOCWNBFH-JsIc-rlc.js +0 -1
- package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-DUVNSzI8.js +0 -1
- package/ui-dist/assets/swimlanesDiagram-G3AALYLV-DfLFj7sh.js +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rudderhq/server",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2-canary.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"homepage": "https://github.com/Undertone0809/rudder",
|
|
6
6
|
"bugs": {
|
|
@@ -55,19 +55,19 @@
|
|
|
55
55
|
"@aws-sdk/client-s3": "^3.1015.0",
|
|
56
56
|
"@larksuiteoapi/node-sdk": "1.67.0",
|
|
57
57
|
"@modelcontextprotocol/client": "2.0.0-beta.5",
|
|
58
|
-
"@rudderhq/agent-runtime-claude-local": "0.7.
|
|
59
|
-
"@rudderhq/agent-runtime-codex-local": "0.7.
|
|
60
|
-
"@rudderhq/agent-runtime-cursor-local": "0.7.
|
|
61
|
-
"@rudderhq/agent-runtime-gemini-local": "0.7.
|
|
62
|
-
"@rudderhq/agent-runtime-openclaw-gateway": "0.7.
|
|
63
|
-
"@rudderhq/agent-runtime-opencode-local": "0.7.
|
|
64
|
-
"@rudderhq/agent-runtime-pi-local": "0.7.
|
|
65
|
-
"@rudderhq/agent-runtime-utils": "0.7.
|
|
66
|
-
"@rudderhq/db": "0.7.
|
|
67
|
-
"@rudderhq/identity-core": "0.7.
|
|
68
|
-
"@rudderhq/plugin-sdk": "0.7.
|
|
69
|
-
"@rudderhq/run-intelligence-core": "0.7.
|
|
70
|
-
"@rudderhq/shared": "0.7.
|
|
58
|
+
"@rudderhq/agent-runtime-claude-local": "0.7.2-canary.0",
|
|
59
|
+
"@rudderhq/agent-runtime-codex-local": "0.7.2-canary.0",
|
|
60
|
+
"@rudderhq/agent-runtime-cursor-local": "0.7.2-canary.0",
|
|
61
|
+
"@rudderhq/agent-runtime-gemini-local": "0.7.2-canary.0",
|
|
62
|
+
"@rudderhq/agent-runtime-openclaw-gateway": "0.7.2-canary.0",
|
|
63
|
+
"@rudderhq/agent-runtime-opencode-local": "0.7.2-canary.0",
|
|
64
|
+
"@rudderhq/agent-runtime-pi-local": "0.7.2-canary.0",
|
|
65
|
+
"@rudderhq/agent-runtime-utils": "0.7.2-canary.0",
|
|
66
|
+
"@rudderhq/db": "0.7.2-canary.0",
|
|
67
|
+
"@rudderhq/identity-core": "0.7.2-canary.0",
|
|
68
|
+
"@rudderhq/plugin-sdk": "0.7.2-canary.0",
|
|
69
|
+
"@rudderhq/run-intelligence-core": "0.7.2-canary.0",
|
|
70
|
+
"@rudderhq/shared": "0.7.2-canary.0",
|
|
71
71
|
"ajv": "^8.18.0",
|
|
72
72
|
"ajv-formats": "^3.0.1",
|
|
73
73
|
"better-auth": "1.6.23",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as z,a as ee,b as re,r as l,c as Q,q as D,i as H,d as $,w as te,j as e,W as ne,T as ae,F as I,e as se,M as oe,f as ie,g as le,C as Z,h as ce,k as ue,l as de,m as fe,n as me,o as he,s as B,p as A,t as M,v as xe,x as G,y as ye,z as be,A as J,B as pe,R as ve,D as we}from"./index-Ck-ZNQeD.js";const U="This file changed while you were editing it.";function ke(b){return b.split("/").filter(Boolean).at(-1)??b}function ge(b){return!(b.truncated||b.previewKind!=="text"||b.content===null)}function je(b){return/\.(?:md|markdown|mdown|mdx)$/i.test(b.filePath)}function Fe({annotationConversationId:b,file:E,organizationId:t,sourceToolbar:K}){const n=me(),s=E.filePath,v=E.content??"",C=l.useRef(he(t,s,v)).current,u=l.useRef(!0),m=l.useRef(C.baseContent),P=l.useRef(v),d=l.useRef(C.content),w=l.useRef(null),L=l.useRef(!1),i=l.useRef(C.conflicted),y=l.useRef(0),[x,g]=l.useState(C.content),[_,h]=l.useState(C.conflicted?"error":C.content===v?"saved":"saving"),[R,c]=l.useState(C.conflicted?U:null),S=l.useRef(null),[N,a]=l.useState(null),j=je(E);d.current=x,P.current=v,l.useEffect(()=>(u.current=!0,()=>{u.current=!1,B(t,s,m.current,d.current)}),[s,t]),l.useEffect(()=>{if(v!==m.current){if(v===d.current){m.current=v,i.current=!1,h("saved"),c(null),A(t,s);return}if(d.current===m.current){m.current=v,d.current=v,g(v),i.current=!1,h("saved"),c(null),A(t,s);return}w.current=null,y.current+=1,i.current=!0,h("error"),c(U),B(t,s,m.current,d.current)}},[s,t,v]);const W=l.useCallback((o,r)=>{const f=o.content??r;m.current=f,P.current=f,i.current=!1,n.setQueryData(D.organizations.workspaceFile(t,s),o),B(t,s,f,d.current),d.current!==f&&(w.current=d.current),u.current&&(c(null),h(d.current===f?"saved":"saving"))},[s,t,n]),O=l.useCallback(async()=>{if(!L.current){L.current=!0;try{for(;w.current!==null;){const o=w.current,r=y.current;if(w.current=null,i.current)return;if(o!==m.current){u.current&&(h("saving"),c(null));try{const f=await M.updateWorkspaceFile(t,s,{content:o,expectedContent:m.current});if(r!==y.current)continue;W(f,o)}catch(f){if(r!==y.current)continue;let p=null;try{p=await M.readWorkspaceFile(t,s)}catch{}if(r!==y.current)continue;if(p&&(P.current=p.content??"",n.setQueryData(D.organizations.workspaceFile(t,s),p)),(p==null?void 0:p.content)===o){W(p,o);continue}p&&p.content!==m.current&&(w.current=null,i.current=!0,B(t,s,m.current,d.current)),u.current&&(h("error"),c(i.current?U:f instanceof Error?f.message:"Could not save this file."));return}}}u.current&&h(d.current===m.current?"saved":"saving")}finally{L.current=!1,w.current!==null&&!i.current&&O()}}},[W,s,t,n]),T=l.useCallback(o=>{w.current=o,O()},[O]);l.useEffect(()=>{if(B(t,s,m.current,x),i.current)return;if(x===m.current){h(L.current||w.current!==null?"saving":"saved");return}const o=window.setTimeout(()=>T(x),700);return()=>window.clearTimeout(o)},[x,T,s,t]);const q=()=>{const o=P.current;y.current+=1,m.current=o,d.current=o,w.current=null,i.current=!1,g(o),h("saved"),c(null),A(t,s)},F=()=>{y.current+=1,m.current=P.current,i.current=!1,h("saving"),c(null),T(d.current)},k=j?xe(x):{frontmatter:null,separator:"",body:x};return e.jsxs("div",{className:"relative flex h-full min-h-0 min-w-0 w-full flex-col overflow-hidden","data-testid":j?"library-live-surface-markdown-editor":"library-live-surface-text-editor",children:[K,e.jsx("div",{ref:S,className:J("min-h-0 flex-1",j?"scrollbar-auto-hide overflow-y-auto px-6 py-6":"overflow-hidden"),children:j?e.jsxs(e.Fragment,{children:[k.frontmatter!==null?e.jsxs("details",{className:"group mb-6 rounded-md border border-[color:var(--border-soft)] bg-[color:var(--surface-page)]","data-chat-annotation-ignore":!0,"data-testid":"library-live-surface-frontmatter-editor",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2 text-xs font-medium text-muted-foreground outline-none transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[e.jsx("span",{children:"Frontmatter"}),e.jsx(Z,{className:"h-3.5 w-3.5 transition-transform group-open:rotate-90"})]}),e.jsx("textarea",{value:k.frontmatter,onChange:o=>{const r=G(o.currentTarget.value,k.separator,k.body);d.current=r,g(r),h(i.current?"error":"saving"),i.current||c(null)},spellCheck:!1,className:"block min-h-28 w-full resize-y border-t border-[color:var(--border-soft)] bg-transparent px-3 py-2 font-mono text-xs leading-5 text-foreground outline-none","aria-label":"Frontmatter"})]}):null,e.jsx(ye,{engine:"codemirror",documentIdentity:`library-file:${s}`,value:k.body,onChange:o=>{const r=G(k.frontmatter,k.separator,o);d.current=r,g(r),h(i.current?"error":"saving"),i.current||c(null)},bordered:!1,placeholder:"Write in Markdown...",contentClassName:"rudder-library-document-editor rudder-readable-document mx-auto min-h-[420px] w-full max-w-[880px] text-[15px] leading-7 text-foreground"},s)]}):e.jsx(be,{"data-testid":"library-live-surface-text-source-editor",annotationSource:{surface:"workspace_file",sourceFilePath:s},ariaLabel:`${s} source editor`,filePath:s,value:x,onChange:o=>{d.current=o,g(o),h(i.current?"error":"saving"),i.current||c(null)},onSelectionChange:a})}),e.jsx(pe,{containerRef:S,conversationId:b,explicitSelection:j?void 0:N,saved:_==="saved"&&!i.current&&x===m.current,source:x,sourceIdentity:{surface:"workspace_file",sourceFilePath:s,sourceLibraryEntryId:E.libraryEntryId},sourceRenderMode:j?"markdown":"text",renderedSource:j?k.body:x,renderedSourceOffset:j?x.length-k.body.length:0}),e.jsxs("div",{className:J("flex min-h-10 shrink-0 items-center gap-2 border-t border-border/70 px-4 text-xs",_==="error"?"text-destructive":"text-muted-foreground"),role:_==="error"?"alert":"status",children:[e.jsx("span",{children:_==="saved"?"Saved":_==="saving"?"Saving…":R??"Save failed"}),i.current?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:F,children:"Keep mine"}),e.jsx("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:q,children:"Use latest"})]}):_==="error"?e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 font-medium text-foreground underline underline-offset-2",onClick:()=>T(d.current),children:[e.jsx(ve,{className:"h-3 w-3","aria-hidden":!0}),"Retry"]}):null]})]})}function X(b){return e.jsx("div",{className:"m-auto max-w-sm px-6 py-10 text-center text-sm leading-6 text-muted-foreground","data-testid":"library-live-surface-unavailable",role:"status",children:b})}function Pe({active:b,annotationConversationId:E=null,organizationId:t,surface:K,target:n,onOpenTarget:s}){var k,o;const{pushToast:v}=z(),V=ee(),C=re(),u=fe(),[m,P]=l.useState([]),[d,w]=l.useState(null),[L,i]=l.useState("preview"),y=n.kind==="library_entry"?n:null,x=n.kind==="library_document"?n:null,g=n.kind==="library_directory"?n:null,_=n.kind==="library_file"?n.filePath:(y==null?void 0:y.path)??null,h=Q({queryKey:D.organizations.libraryEntry(t,(y==null?void 0:y.entryId)??"__none__"),queryFn:()=>M.getLibraryEntry(t,y.entryId),enabled:!!y,refetchOnWindowFocus:!1}),R=_??(((k=h.data)==null?void 0:k.status)==="active"?h.data.currentPath:null),c=Q({queryKey:D.organizations.workspaceFile(t,R??""),queryFn:()=>M.readWorkspaceFile(t,R),enabled:(n.kind==="library_file"||n.kind==="library_entry")&&!!R,refetchOnWindowFocus:!1}),S=Q({queryKey:D.organizations.libraryDocument(t,(x==null?void 0:x.documentId)??"__none__"),queryFn:()=>M.getLibraryDocument(t,x.documentId),enabled:!!x,refetchOnWindowFocus:!1}),N=Q({queryKey:D.organizations.workspaceFiles(t,(g==null?void 0:g.directoryPath)??""),queryFn:()=>M.listWorkspaceFiles(t,g.directoryPath),enabled:!!g,refetchOnWindowFocus:!1}),a=c.data,j=a?H(a)||$(a):!1;l.useEffect(()=>{i("preview")},[R]);const W=te(m,{canOpenFile:!!(a!=null&&a.rootPath&&typeof(u==null?void 0:u.openWorkspaceFileInIde)=="function"),canOpenLocation:!!(a!=null&&a.rootPath&&typeof(u==null?void 0:u.openWorkspaceFileLocation)=="function")});l.useEffect(()=>{let r=!1;if(!(a!=null&&a.rootPath)||typeof(u==null?void 0:u.listWorkspaceLaunchTargets)!="function"){P([]);return}return u.listWorkspaceLaunchTargets().then(f=>{r||P(f)}).catch(()=>{r||P([])}),()=>{r=!0}},[u,a==null?void 0:a.rootPath]);const O=async r=>{var f;if(!(!(a!=null&&a.rootPath)||!u)){w(r.id);try{we(r)?await u.openWorkspaceFileInIde(a.rootPath,a.filePath,r.id):await((f=u.openWorkspaceFileLocation)==null?void 0:f.call(u,a.rootPath,a.filePath,r.id)),v({title:`Opened in ${r.label}`,tone:"success"})}catch(p){v({title:`Could not open in ${r.label}`,body:p instanceof Error?p.message:"Try another app.",tone:"error"})}finally{w(null)}}},T=!!(n.kind==="library_entry"&&h.isPending||(n.kind==="library_file"||n.kind==="library_entry")&&R&&c.isPending||n.kind==="library_document"&&S.isPending||n.kind==="library_directory"&&N.isPending),q=n.kind==="library_entry"?h.error??c.error:n.kind==="library_file"?c.error:n.kind==="library_document"?S.error:N.error;let F;return T?F=e.jsx("div",{className:"m-auto text-sm text-muted-foreground","data-testid":"library-live-surface-loading",children:"Loading Library item…"}):q?F=e.jsx("div",{className:"m-auto max-w-sm px-6 py-10 text-center text-sm leading-6 text-destructive","data-testid":"library-live-surface-error",role:"alert",children:q instanceof Error?q.message:"Could not open this Library item."}):n.kind==="library_entry"&&!R?F=X(((o=h.data)==null?void 0:o.status)==="deleted"?"This Library entry was deleted.":"This Library entry is unavailable on its original path."):(n.kind==="library_file"||n.kind==="library_entry")&&c.data?F=ge(c.data)&&(!j||L==="source")?e.jsx(Fe,{annotationConversationId:E,file:c.data,organizationId:t,sourceToolbar:H(c.data)?e.jsx(ne,{viewMode:"source",onViewModeChange:i,testIdPrefix:"library-live-surface"}):$(c.data)?e.jsx("div",{className:"flex h-10 shrink-0 items-center justify-end border-b border-border px-3",children:e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>i("preview"),"aria-label":"Show table",children:[e.jsx(ae,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Show table"]})}):void 0},c.data.filePath):e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","data-testid":"library-live-surface-file-preview",children:[$(c.data)?e.jsx("div",{className:"flex h-10 shrink-0 items-center justify-end border-b border-border px-3",children:e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>i("source"),"aria-label":"Show source",children:[e.jsx(I,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Show source"]})}):null,e.jsx(se,{file:c.data,organizationId:t,mode:L,onModeChange:i,testIdPrefix:"library-live-surface"})]}):n.kind==="library_document"&&S.data?F=e.jsx("article",{className:"scrollbar-auto-hide min-h-0 flex-1 overflow-y-auto px-8 py-8","data-testid":"library-live-surface-document",children:e.jsx(oe,{className:"rudder-library-document-editor rudder-readable-document mx-auto w-full max-w-[880px] text-[15px] leading-7 text-foreground",children:S.data.body})}):n.kind==="library_directory"&&N.data?F=e.jsxs("div",{className:"scrollbar-auto-hide min-h-0 flex-1 overflow-y-auto p-3","data-testid":"library-live-surface-directory",children:[e.jsxs("div",{className:"mb-3 px-2",children:[e.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:N.data.directoryPath||"Library root"}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[N.data.entries.length," item",N.data.entries.length===1?"":"s"]})]}),e.jsx("ul",{className:"space-y-0.5 border-t border-border/70 pt-2",children:N.data.entries.map(r=>{var Y;const f=((Y=r.displayLabel)==null?void 0:Y.trim())||r.name,p=r.isDirectory?ie:/\.(?:md|markdown|mdx|txt)$/i.test(r.path)?le:I;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-muted-foreground hover:bg-[color:var(--surface-active)] hover:text-foreground",onClick:()=>s(r.isDirectory?{kind:"library_directory",directoryPath:r.path,label:f}:r.libraryEntryId?{kind:"library_entry",entryId:r.libraryEntryId,label:f,path:r.path}:{kind:"library_file",filePath:r.path,label:f||ke(r.path)}),children:[e.jsx(p,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:f}),r.isDirectory?e.jsx(Z,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null]})},r.path)})})]}):F=X("This Library item is unavailable."),e.jsxs("section",{"aria-hidden":!b,className:"flex h-full min-h-0 min-w-0 w-full flex-col overflow-hidden bg-[color:var(--surface-panel)]","data-active":b?"true":"false","data-surface":K,"data-target-kind":n.kind,"data-testid":"library-live-surface",children:[a&&W.length>0?e.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-3 border-b border-border/70 px-4","data-testid":"library-live-surface-file-toolbar",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:a.filePath}),e.jsx("div",{"data-testid":"library-live-surface-file-open-selector",children:e.jsx(ce,{targets:W,openingTargetId:d,onOpenTarget:r=>void O(r),onOpenInLibrary:()=>C(ue(`/library?path=${encodeURIComponent(a.filePath)}`,de(V.pathname))),testId:"library-live-surface-file-open-menu"})})]}):null,F]})}export{Pe as LibraryLiveSurface};
|
|
1
|
+
import{u as z,a as ee,b as re,r as l,c as Q,q as D,i as H,d as $,w as te,j as e,W as ne,T as ae,F as I,e as se,M as oe,f as ie,g as le,C as Z,h as ce,k as ue,l as de,m as fe,n as me,o as he,s as B,p as A,t as M,v as xe,x as G,y as ye,z as be,A as J,B as pe,R as ve,D as we}from"./index-C8VKPswh.js";const U="This file changed while you were editing it.";function ke(b){return b.split("/").filter(Boolean).at(-1)??b}function ge(b){return!(b.truncated||b.previewKind!=="text"||b.content===null)}function je(b){return/\.(?:md|markdown|mdown|mdx)$/i.test(b.filePath)}function Fe({annotationConversationId:b,file:E,organizationId:t,sourceToolbar:K}){const n=me(),s=E.filePath,v=E.content??"",C=l.useRef(he(t,s,v)).current,u=l.useRef(!0),m=l.useRef(C.baseContent),P=l.useRef(v),d=l.useRef(C.content),w=l.useRef(null),L=l.useRef(!1),i=l.useRef(C.conflicted),y=l.useRef(0),[x,g]=l.useState(C.content),[_,h]=l.useState(C.conflicted?"error":C.content===v?"saved":"saving"),[R,c]=l.useState(C.conflicted?U:null),S=l.useRef(null),[N,a]=l.useState(null),j=je(E);d.current=x,P.current=v,l.useEffect(()=>(u.current=!0,()=>{u.current=!1,B(t,s,m.current,d.current)}),[s,t]),l.useEffect(()=>{if(v!==m.current){if(v===d.current){m.current=v,i.current=!1,h("saved"),c(null),A(t,s);return}if(d.current===m.current){m.current=v,d.current=v,g(v),i.current=!1,h("saved"),c(null),A(t,s);return}w.current=null,y.current+=1,i.current=!0,h("error"),c(U),B(t,s,m.current,d.current)}},[s,t,v]);const W=l.useCallback((o,r)=>{const f=o.content??r;m.current=f,P.current=f,i.current=!1,n.setQueryData(D.organizations.workspaceFile(t,s),o),B(t,s,f,d.current),d.current!==f&&(w.current=d.current),u.current&&(c(null),h(d.current===f?"saved":"saving"))},[s,t,n]),O=l.useCallback(async()=>{if(!L.current){L.current=!0;try{for(;w.current!==null;){const o=w.current,r=y.current;if(w.current=null,i.current)return;if(o!==m.current){u.current&&(h("saving"),c(null));try{const f=await M.updateWorkspaceFile(t,s,{content:o,expectedContent:m.current});if(r!==y.current)continue;W(f,o)}catch(f){if(r!==y.current)continue;let p=null;try{p=await M.readWorkspaceFile(t,s)}catch{}if(r!==y.current)continue;if(p&&(P.current=p.content??"",n.setQueryData(D.organizations.workspaceFile(t,s),p)),(p==null?void 0:p.content)===o){W(p,o);continue}p&&p.content!==m.current&&(w.current=null,i.current=!0,B(t,s,m.current,d.current)),u.current&&(h("error"),c(i.current?U:f instanceof Error?f.message:"Could not save this file."));return}}}u.current&&h(d.current===m.current?"saved":"saving")}finally{L.current=!1,w.current!==null&&!i.current&&O()}}},[W,s,t,n]),T=l.useCallback(o=>{w.current=o,O()},[O]);l.useEffect(()=>{if(B(t,s,m.current,x),i.current)return;if(x===m.current){h(L.current||w.current!==null?"saving":"saved");return}const o=window.setTimeout(()=>T(x),700);return()=>window.clearTimeout(o)},[x,T,s,t]);const q=()=>{const o=P.current;y.current+=1,m.current=o,d.current=o,w.current=null,i.current=!1,g(o),h("saved"),c(null),A(t,s)},F=()=>{y.current+=1,m.current=P.current,i.current=!1,h("saving"),c(null),T(d.current)},k=j?xe(x):{frontmatter:null,separator:"",body:x};return e.jsxs("div",{className:"relative flex h-full min-h-0 min-w-0 w-full flex-col overflow-hidden","data-testid":j?"library-live-surface-markdown-editor":"library-live-surface-text-editor",children:[K,e.jsx("div",{ref:S,className:J("min-h-0 flex-1",j?"scrollbar-auto-hide overflow-y-auto px-6 py-6":"overflow-hidden"),children:j?e.jsxs(e.Fragment,{children:[k.frontmatter!==null?e.jsxs("details",{className:"group mb-6 rounded-md border border-[color:var(--border-soft)] bg-[color:var(--surface-page)]","data-chat-annotation-ignore":!0,"data-testid":"library-live-surface-frontmatter-editor",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2 text-xs font-medium text-muted-foreground outline-none transition-colors hover:text-foreground [&::-webkit-details-marker]:hidden",children:[e.jsx("span",{children:"Frontmatter"}),e.jsx(Z,{className:"h-3.5 w-3.5 transition-transform group-open:rotate-90"})]}),e.jsx("textarea",{value:k.frontmatter,onChange:o=>{const r=G(o.currentTarget.value,k.separator,k.body);d.current=r,g(r),h(i.current?"error":"saving"),i.current||c(null)},spellCheck:!1,className:"block min-h-28 w-full resize-y border-t border-[color:var(--border-soft)] bg-transparent px-3 py-2 font-mono text-xs leading-5 text-foreground outline-none","aria-label":"Frontmatter"})]}):null,e.jsx(ye,{engine:"codemirror",documentIdentity:`library-file:${s}`,value:k.body,onChange:o=>{const r=G(k.frontmatter,k.separator,o);d.current=r,g(r),h(i.current?"error":"saving"),i.current||c(null)},bordered:!1,placeholder:"Write in Markdown...",contentClassName:"rudder-library-document-editor rudder-readable-document mx-auto min-h-[420px] w-full max-w-[880px] text-[15px] leading-7 text-foreground"},s)]}):e.jsx(be,{"data-testid":"library-live-surface-text-source-editor",annotationSource:{surface:"workspace_file",sourceFilePath:s},ariaLabel:`${s} source editor`,filePath:s,value:x,onChange:o=>{d.current=o,g(o),h(i.current?"error":"saving"),i.current||c(null)},onSelectionChange:a})}),e.jsx(pe,{containerRef:S,conversationId:b,explicitSelection:j?void 0:N,saved:_==="saved"&&!i.current&&x===m.current,source:x,sourceIdentity:{surface:"workspace_file",sourceFilePath:s,sourceLibraryEntryId:E.libraryEntryId},sourceRenderMode:j?"markdown":"text",renderedSource:j?k.body:x,renderedSourceOffset:j?x.length-k.body.length:0}),e.jsxs("div",{className:J("flex min-h-10 shrink-0 items-center gap-2 border-t border-border/70 px-4 text-xs",_==="error"?"text-destructive":"text-muted-foreground"),role:_==="error"?"alert":"status",children:[e.jsx("span",{children:_==="saved"?"Saved":_==="saving"?"Saving…":R??"Save failed"}),i.current?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:F,children:"Keep mine"}),e.jsx("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:q,children:"Use latest"})]}):_==="error"?e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 font-medium text-foreground underline underline-offset-2",onClick:()=>T(d.current),children:[e.jsx(ve,{className:"h-3 w-3","aria-hidden":!0}),"Retry"]}):null]})]})}function X(b){return e.jsx("div",{className:"m-auto max-w-sm px-6 py-10 text-center text-sm leading-6 text-muted-foreground","data-testid":"library-live-surface-unavailable",role:"status",children:b})}function Pe({active:b,annotationConversationId:E=null,organizationId:t,surface:K,target:n,onOpenTarget:s}){var k,o;const{pushToast:v}=z(),V=ee(),C=re(),u=fe(),[m,P]=l.useState([]),[d,w]=l.useState(null),[L,i]=l.useState("preview"),y=n.kind==="library_entry"?n:null,x=n.kind==="library_document"?n:null,g=n.kind==="library_directory"?n:null,_=n.kind==="library_file"?n.filePath:(y==null?void 0:y.path)??null,h=Q({queryKey:D.organizations.libraryEntry(t,(y==null?void 0:y.entryId)??"__none__"),queryFn:()=>M.getLibraryEntry(t,y.entryId),enabled:!!y,refetchOnWindowFocus:!1}),R=_??(((k=h.data)==null?void 0:k.status)==="active"?h.data.currentPath:null),c=Q({queryKey:D.organizations.workspaceFile(t,R??""),queryFn:()=>M.readWorkspaceFile(t,R),enabled:(n.kind==="library_file"||n.kind==="library_entry")&&!!R,refetchOnWindowFocus:!1}),S=Q({queryKey:D.organizations.libraryDocument(t,(x==null?void 0:x.documentId)??"__none__"),queryFn:()=>M.getLibraryDocument(t,x.documentId),enabled:!!x,refetchOnWindowFocus:!1}),N=Q({queryKey:D.organizations.workspaceFiles(t,(g==null?void 0:g.directoryPath)??""),queryFn:()=>M.listWorkspaceFiles(t,g.directoryPath),enabled:!!g,refetchOnWindowFocus:!1}),a=c.data,j=a?H(a)||$(a):!1;l.useEffect(()=>{i("preview")},[R]);const W=te(m,{canOpenFile:!!(a!=null&&a.rootPath&&typeof(u==null?void 0:u.openWorkspaceFileInIde)=="function"),canOpenLocation:!!(a!=null&&a.rootPath&&typeof(u==null?void 0:u.openWorkspaceFileLocation)=="function")});l.useEffect(()=>{let r=!1;if(!(a!=null&&a.rootPath)||typeof(u==null?void 0:u.listWorkspaceLaunchTargets)!="function"){P([]);return}return u.listWorkspaceLaunchTargets().then(f=>{r||P(f)}).catch(()=>{r||P([])}),()=>{r=!0}},[u,a==null?void 0:a.rootPath]);const O=async r=>{var f;if(!(!(a!=null&&a.rootPath)||!u)){w(r.id);try{we(r)?await u.openWorkspaceFileInIde(a.rootPath,a.filePath,r.id):await((f=u.openWorkspaceFileLocation)==null?void 0:f.call(u,a.rootPath,a.filePath,r.id)),v({title:`Opened in ${r.label}`,tone:"success"})}catch(p){v({title:`Could not open in ${r.label}`,body:p instanceof Error?p.message:"Try another app.",tone:"error"})}finally{w(null)}}},T=!!(n.kind==="library_entry"&&h.isPending||(n.kind==="library_file"||n.kind==="library_entry")&&R&&c.isPending||n.kind==="library_document"&&S.isPending||n.kind==="library_directory"&&N.isPending),q=n.kind==="library_entry"?h.error??c.error:n.kind==="library_file"?c.error:n.kind==="library_document"?S.error:N.error;let F;return T?F=e.jsx("div",{className:"m-auto text-sm text-muted-foreground","data-testid":"library-live-surface-loading",children:"Loading Library item…"}):q?F=e.jsx("div",{className:"m-auto max-w-sm px-6 py-10 text-center text-sm leading-6 text-destructive","data-testid":"library-live-surface-error",role:"alert",children:q instanceof Error?q.message:"Could not open this Library item."}):n.kind==="library_entry"&&!R?F=X(((o=h.data)==null?void 0:o.status)==="deleted"?"This Library entry was deleted.":"This Library entry is unavailable on its original path."):(n.kind==="library_file"||n.kind==="library_entry")&&c.data?F=ge(c.data)&&(!j||L==="source")?e.jsx(Fe,{annotationConversationId:E,file:c.data,organizationId:t,sourceToolbar:H(c.data)?e.jsx(ne,{viewMode:"source",onViewModeChange:i,testIdPrefix:"library-live-surface"}):$(c.data)?e.jsx("div",{className:"flex h-10 shrink-0 items-center justify-end border-b border-border px-3",children:e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>i("preview"),"aria-label":"Show table",children:[e.jsx(ae,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Show table"]})}):void 0},c.data.filePath):e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","data-testid":"library-live-surface-file-preview",children:[$(c.data)?e.jsx("div",{className:"flex h-10 shrink-0 items-center justify-end border-b border-border px-3",children:e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground",onClick:()=>i("source"),"aria-label":"Show source",children:[e.jsx(I,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Show source"]})}):null,e.jsx(se,{file:c.data,organizationId:t,mode:L,onModeChange:i,testIdPrefix:"library-live-surface"})]}):n.kind==="library_document"&&S.data?F=e.jsx("article",{className:"scrollbar-auto-hide min-h-0 flex-1 overflow-y-auto px-8 py-8","data-testid":"library-live-surface-document",children:e.jsx(oe,{className:"rudder-library-document-editor rudder-readable-document mx-auto w-full max-w-[880px] text-[15px] leading-7 text-foreground",children:S.data.body})}):n.kind==="library_directory"&&N.data?F=e.jsxs("div",{className:"scrollbar-auto-hide min-h-0 flex-1 overflow-y-auto p-3","data-testid":"library-live-surface-directory",children:[e.jsxs("div",{className:"mb-3 px-2",children:[e.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:N.data.directoryPath||"Library root"}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[N.data.entries.length," item",N.data.entries.length===1?"":"s"]})]}),e.jsx("ul",{className:"space-y-0.5 border-t border-border/70 pt-2",children:N.data.entries.map(r=>{var Y;const f=((Y=r.displayLabel)==null?void 0:Y.trim())||r.name,p=r.isDirectory?ie:/\.(?:md|markdown|mdx|txt)$/i.test(r.path)?le:I;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-muted-foreground hover:bg-[color:var(--surface-active)] hover:text-foreground",onClick:()=>s(r.isDirectory?{kind:"library_directory",directoryPath:r.path,label:f}:r.libraryEntryId?{kind:"library_entry",entryId:r.libraryEntryId,label:f,path:r.path}:{kind:"library_file",filePath:r.path,label:f||ke(r.path)}),children:[e.jsx(p,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:f}),r.isDirectory?e.jsx(Z,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null]})},r.path)})})]}):F=X("This Library item is unavailable."),e.jsxs("section",{"aria-hidden":!b,className:"flex h-full min-h-0 min-w-0 w-full flex-col overflow-hidden bg-[color:var(--surface-panel)]","data-active":b?"true":"false","data-surface":K,"data-target-kind":n.kind,"data-testid":"library-live-surface",children:[a&&W.length>0?e.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-3 border-b border-border/70 px-4","data-testid":"library-live-surface-file-toolbar",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:a.filePath}),e.jsx("div",{"data-testid":"library-live-surface-file-open-selector",children:e.jsx(ce,{targets:W,openingTargetId:d,onOpenTarget:r=>void O(r),onOpenInLibrary:()=>C(ue(`/library?path=${encodeURIComponent(a.filePath)}`,de(V.pathname))),testId:"library-live-surface-file-open-menu"})})]}):null,F]})}export{Pe as LibraryLiveSurface};
|
package/ui-dist/assets/{abnfDiagram-VRR7QNED-BoPyIoAq.js → abnfDiagram-VRR7QNED-C34K70lu.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-BlHlEWfj.js";import{p as f}from"./chunk-JWPE2WC7-Dw5KEviU.js";import{_ as n,l as o}from"./mermaid.core-FscMPm7s.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-C5CybQ7c.js";import"./index-C8VKPswh.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as ln,H as un,I as N,J as I,K as J,L as an,M as y,N as tn,O as j,P as _,Q as rn,R as o,S as on,T as sn,V as fn}from"./mermaid.core-
|
|
1
|
+
import{G as ln,H as un,I as N,J as I,K as J,L as an,M as y,N as tn,O as j,P as _,Q as rn,R as o,S as on,T as sn,V as fn}from"./mermaid.core-FscMPm7s.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,O,v,R,K,u){var D=q-l,i=O-h,n=K-v,d=u-R,a=d*D-n*i;if(!(a*a<y))return a=(n*(h-R)-d*(l-v))/a,[l+a*D,h+a*i]}function W(l,h,q,O,v,R,K){var u=l-q,D=h-O,i=(K?R:-R)/j(u*u+D*D),n=i*D,d=-i*u,a=l+n,s=h+d,f=q+n,c=O+d,L=(a+f)/2,t=(s+c)/2,m=f-a,g=c-s,A=m*m+g*g,T=v-R,P=a*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),G=(P*g-m*E)/A,H=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=G-L,e=H-t,r=w-L,M=p-t;return x*x+e*e>r*r+M*M&&(G=w,H=p),{cx:G,cy:H,x01:-n,y01:-d,x11:G*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=J(0),O=null,v=gn,R=dn,K=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,L=rn(c-f),t=c>f;if(u||(u=n=D()),s<a&&(d=s,s=a,a=d),!(s>y))u.moveTo(0,0);else if(L>tn-y)u.moveTo(s*N(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*N(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=L,E=L,G=K.apply(this,arguments)/2,H=G>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(H>y){var M=sn(H/a*I(G)),z=sn(H/s*I(G));(P-=M*2)>y?(M*=t?1:-1,A+=M,T-=M):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var Q=s*N(m),V=s*I(m),B=a*N(T),C=a*I(T);if(w>y){var F=s*N(g),U=s*I(g),X=a*N(A),Y=a*I(A),S;if(L<un)if(S=pn(Q,V,X,Y,F,U,B,C)){var Z=Q-S[0],$=V-S[1],k=F-S[0],b=U-S[1],nn=1/I(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(S[0]*S[0]+S[1]*S[1]);p=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=W(X,Y,Q,V,s,x,t),r=W(F,U,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),u.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(u.moveTo(Q,V),u.arc(0,0,s,m,g,!t)):u.moveTo(Q,V),!(a>y)||!(P>y)?u.lineTo(B,C):p>y?(e=W(B,C,F,U,a,-p,t),r=W(Q,V,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,a,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),u.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):u.arc(0,0,a,T,A,t)}if(u.closePath(),n)return u=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[N(d)*n,I(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:J(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:J(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:J(+n),i):q},i.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:J(+n),i):O},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:J(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:J(+n),i):R},i.padAngle=function(n){return arguments.length?(K=typeof n=="function"?n:J(+n),i):K},i.context=function(n){return arguments.length?(u=n??null,i):u},i}export{hn as d};
|