@rudderhq/server 0.7.20 → 0.7.21-canary.1

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.
Files changed (83) hide show
  1. package/package.json +14 -14
  2. package/ui-dist/assets/{LibraryLiveSurface-BiQQj5Hb.js → LibraryLiveSurface-DDOOwd5Y.js} +1 -1
  3. package/ui-dist/assets/{abnfDiagram-VRR7QNED--khQJc5a.js → abnfDiagram-VRR7QNED-C8SwKFxR.js} +1 -1
  4. package/ui-dist/assets/{addon-fit-CVKsoA6X.js → addon-fit-DYhsPYfx.js} +1 -1
  5. package/ui-dist/assets/{arc-y9rNydY4.js → arc-DrQAU9YY.js} +1 -1
  6. package/ui-dist/assets/{architectureDiagram-ZJ3FMSHR-CTTEn0SH.js → architectureDiagram-ZJ3FMSHR-CKBfpuH2.js} +1 -1
  7. package/ui-dist/assets/{blockDiagram-677ZJIJ3-U2j9QH1u.js → blockDiagram-677ZJIJ3-IaoO3eXY.js} +1 -1
  8. package/ui-dist/assets/{c4Diagram-LMCZKHZV-ByOtcnv-.js → c4Diagram-LMCZKHZV-DpgoQHMU.js} +1 -1
  9. package/ui-dist/assets/channel-C9ZdhwpO.js +1 -0
  10. package/ui-dist/assets/{chunk-2Q5K7J3B-C_F73aLm.js → chunk-2Q5K7J3B-B1kUCuo_.js} +1 -1
  11. package/ui-dist/assets/{chunk-32BRIVSS-B-_hFTRm.js → chunk-32BRIVSS-D_nsIdY1.js} +1 -1
  12. package/ui-dist/assets/{chunk-5VM5RSS4-kDtmO9rY.js → chunk-5VM5RSS4-BgTEYFd3.js} +1 -1
  13. package/ui-dist/assets/{chunk-EX3LRPZG-BH53QEjn.js → chunk-EX3LRPZG-s-n7_F-0.js} +1 -1
  14. package/ui-dist/assets/{chunk-JWPE2WC7-vi_fmyul.js → chunk-JWPE2WC7-CJkmHyr7.js} +1 -1
  15. package/ui-dist/assets/{chunk-MOJQB5TN-BTooeKeT.js → chunk-MOJQB5TN-Co2l_j69.js} +1 -1
  16. package/ui-dist/assets/{chunk-RYQCIY6F-BQrn9i9W.js → chunk-RYQCIY6F-BsLDrCHv.js} +1 -1
  17. package/ui-dist/assets/{chunk-V7JOEXUC-ovQThHH_.js → chunk-V7JOEXUC-CHgH7wi4.js} +1 -1
  18. package/ui-dist/assets/{chunk-VR4S4FIN-B-MZGW1V.js → chunk-VR4S4FIN-BN0h2hDz.js} +1 -1
  19. package/ui-dist/assets/{chunk-XXDRQBXY-C61eFp4w.js → chunk-XXDRQBXY-Xcz7auTv.js} +1 -1
  20. package/ui-dist/assets/classDiagram-OUVF2IWQ-DXFePAnI.js +1 -0
  21. package/ui-dist/assets/classDiagram-v2-EOCWNBFH-DXFePAnI.js +1 -0
  22. package/ui-dist/assets/{cose-bilkent-JH36ORCC-ULuzRVuW.js → cose-bilkent-JH36ORCC-BkzxcUdz.js} +1 -1
  23. package/ui-dist/assets/{cynefin-VYW2F7L2-BDGVZRa9.js → cynefin-VYW2F7L2-Cops8dQe.js} +1 -1
  24. package/ui-dist/assets/{cynefinDiagram-TSTJHNR4-BpwEbKkX.js → cynefinDiagram-TSTJHNR4-N0BenAvi.js} +1 -1
  25. package/ui-dist/assets/{dagre-VKFMJZFB-BrcLl5Bi.js → dagre-VKFMJZFB-B1K38Uun.js} +1 -1
  26. package/ui-dist/assets/{diagram-FQU43EPY-Chw0ZA8R.js → diagram-FQU43EPY-CNODcOKn.js} +1 -1
  27. package/ui-dist/assets/{diagram-G47NLZAW-Bnq9d0Yj.js → diagram-G47NLZAW-BCjVi2sd.js} +1 -1
  28. package/ui-dist/assets/{diagram-NH7WQ7WH-elRd9KQl.js → diagram-NH7WQ7WH-DWqo0ifc.js} +1 -1
  29. package/ui-dist/assets/{diagram-OA4YK3LP-CFjNInKN.js → diagram-OA4YK3LP-BwX7NVvE.js} +1 -1
  30. package/ui-dist/assets/{diagram-WEI45ONY-CTwTIF_a.js → diagram-WEI45ONY-D_Wd2XAJ.js} +1 -1
  31. package/ui-dist/assets/{ebnfDiagram-CCIWWBDH-DF8gLV0g.js → ebnfDiagram-CCIWWBDH-DB3MSIpz.js} +1 -1
  32. package/ui-dist/assets/{erDiagram-Q63AITRT-BuEsd1Ky.js → erDiagram-Q63AITRT-uNf14SiB.js} +1 -1
  33. package/ui-dist/assets/{flowDiagram-23GEKE2U-CtBUceZn.js → flowDiagram-23GEKE2U-Dt1ftEsn.js} +1 -1
  34. package/ui-dist/assets/{ganttDiagram-NO4QXBWP-DKppRPjk.js → ganttDiagram-NO4QXBWP-N9NGK_E-.js} +1 -1
  35. package/ui-dist/assets/{gitGraphDiagram-IHSO6WYX-BhU-PmC8.js → gitGraphDiagram-IHSO6WYX-Bds7H4j7.js} +1 -1
  36. package/ui-dist/assets/{graph-DKHhYWz-.js → graph-CgjYGtr0.js} +1 -1
  37. package/ui-dist/assets/{index-C3qfqMoh.js → index-3ovPPEui.js} +1 -1
  38. package/ui-dist/assets/{index-BMndNV-h.js → index-B164b9zP.js} +1 -1
  39. package/ui-dist/assets/{index-DUNFITh_.js → index-B7ENTQv6.js} +1 -1
  40. package/ui-dist/assets/{index-BDy0L6oz.js → index-BKYSTXPK.js} +1 -1
  41. package/ui-dist/assets/{index-CzGrB4Wy.js → index-C2Fe5OXi.js} +1 -1
  42. package/ui-dist/assets/{index-D6ddGuay.js → index-CAe8scgG.js} +1 -1
  43. package/ui-dist/assets/{index-Dmb5j1Fp.js → index-CDnDaLFd.js} +550 -550
  44. package/ui-dist/assets/{index-Ba4T7q2w.js → index-CYUeKcAd.js} +1 -1
  45. package/ui-dist/assets/{index-Dhj4jM1R.js → index-D79cKAuC.js} +1 -1
  46. package/ui-dist/assets/{index-5jvoEF8N.js → index-D7m8RQ1O.js} +1 -1
  47. package/ui-dist/assets/{index-b0vxLiyZ.js → index-DWsZyhTS.js} +1 -1
  48. package/ui-dist/assets/{index-MT--jY1n.js → index-F235-4cd.js} +1 -1
  49. package/ui-dist/assets/{index-oxndzUNp.js → index-RyfAWAnb.js} +1 -1
  50. package/ui-dist/assets/{index-O7us9hIV.js → index-nMmORwbT.js} +1 -1
  51. package/ui-dist/assets/{index-Bmz96tVk.js → index-t7MivziH.js} +1 -1
  52. package/ui-dist/assets/{infoDiagram-FWYZ7A6U-DygYyhIo.js → infoDiagram-FWYZ7A6U-C2pXAb1Y.js} +1 -1
  53. package/ui-dist/assets/{ishikawaDiagram-FXEZZL3T-Ccs65V6v.js → ishikawaDiagram-FXEZZL3T-B0sSIFEC.js} +1 -1
  54. package/ui-dist/assets/{journeyDiagram-5HDEW3XC-FSymf-td.js → journeyDiagram-5HDEW3XC-Ckdxd9ki.js} +1 -1
  55. package/ui-dist/assets/{kanban-definition-HUTT4EX6-Cv7up1fK.js → kanban-definition-HUTT4EX6-DOtJzPss.js} +1 -1
  56. package/ui-dist/assets/{layout-BVu8CYMb.js → layout-C7giAQLD.js} +1 -1
  57. package/ui-dist/assets/{linear-sv7GMpXV.js → linear-Q-TskblA.js} +1 -1
  58. package/ui-dist/assets/{map-D8_4cyHA.js → map-BY0XTFyN.js} +1 -1
  59. package/ui-dist/assets/{mermaid.core-DELkNXiT.js → mermaid.core-DvTQFTkl.js} +4 -4
  60. package/ui-dist/assets/{mindmap-definition-LN4V7U3C-BF63-JUL.js → mindmap-definition-LN4V7U3C-D3oQlHsI.js} +1 -1
  61. package/ui-dist/assets/{pegDiagram-2B236MQR-Bh0HC2Na.js → pegDiagram-2B236MQR-CHt-sOMt.js} +1 -1
  62. package/ui-dist/assets/{pieDiagram-ENE6RG2P-lBLdGBKK.js → pieDiagram-ENE6RG2P-uH7A5sz8.js} +1 -1
  63. package/ui-dist/assets/{quadrantDiagram-ABIIQ3AL-D_l5wSF6.js → quadrantDiagram-ABIIQ3AL-BZmRuT3b.js} +1 -1
  64. package/ui-dist/assets/{railroadDiagram-RFXS5EU6-kQpTkPp7.js → railroadDiagram-RFXS5EU6-C2JRYmSK.js} +1 -1
  65. package/ui-dist/assets/{requirementDiagram-TGXJPOKE-D04lqFVv.js → requirementDiagram-TGXJPOKE-DeYFtNus.js} +1 -1
  66. package/ui-dist/assets/{sankeyDiagram-HTMAVEWB-BrS6ULAc.js → sankeyDiagram-HTMAVEWB-DK2gcjP-.js} +1 -1
  67. package/ui-dist/assets/{sequenceDiagram-DBY2YBRQ-BvDUf8XG.js → sequenceDiagram-DBY2YBRQ-CZG5MZIf.js} +1 -1
  68. package/ui-dist/assets/{sizeCapture-X5ZJPWSS-CaOi4z6b.js → sizeCapture-X5ZJPWSS-BwVp4Ms1.js} +1 -1
  69. package/ui-dist/assets/{stateDiagram-2N3HPSRC-tkllD-n0.js → stateDiagram-2N3HPSRC-w9f-FThU.js} +1 -1
  70. package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-CBd_BU7Z.js +1 -0
  71. package/ui-dist/assets/{swimlanes-5IMT3BWC-D7iseGD6.js → swimlanes-5IMT3BWC-DHTTwB6S.js} +2 -2
  72. package/ui-dist/assets/swimlanesDiagram-G3AALYLV-BHVMV5Z6.js +8 -0
  73. package/ui-dist/assets/{timeline-definition-FHXFAJF6-B3Y8CbUX.js → timeline-definition-FHXFAJF6-BYUIBTUX.js} +1 -1
  74. package/ui-dist/assets/{vennDiagram-L72KCM5P-DwB-uCHa.js → vennDiagram-L72KCM5P-7lk1b60Q.js} +1 -1
  75. package/ui-dist/assets/{wardleyDiagram-EHGQE667-CJUNR115.js → wardleyDiagram-EHGQE667-BOCQiBHo.js} +1 -1
  76. package/ui-dist/assets/{xterm-D1iOyMXp.js → xterm-D5zHTQQc.js} +1 -1
  77. package/ui-dist/assets/{xychartDiagram-FW5EYKEG-DzFFcyyu.js → xychartDiagram-FW5EYKEG-BTH1tYON.js} +1 -1
  78. package/ui-dist/index.html +1 -1
  79. package/ui-dist/assets/channel-DyVqN2Rg.js +0 -1
  80. package/ui-dist/assets/classDiagram-OUVF2IWQ-BnvaEHDR.js +0 -1
  81. package/ui-dist/assets/classDiagram-v2-EOCWNBFH-BnvaEHDR.js +0 -1
  82. package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-Bxk0h_dS.js +0 -1
  83. package/ui-dist/assets/swimlanesDiagram-G3AALYLV-BN3uzPs1.js +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rudderhq/server",
3
- "version": "0.7.20",
3
+ "version": "0.7.21-canary.1",
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",
58
- "@rudderhq/agent-runtime-claude-local": "0.7.20",
59
- "@rudderhq/agent-runtime-codex-local": "0.7.20",
60
- "@rudderhq/agent-runtime-cursor-local": "0.7.20",
61
- "@rudderhq/agent-runtime-gemini-local": "0.7.20",
62
- "@rudderhq/agent-runtime-hermes-gateway": "0.7.20",
63
- "@rudderhq/agent-runtime-openclaw-gateway": "0.7.20",
64
- "@rudderhq/agent-runtime-opencode-local": "0.7.20",
65
- "@rudderhq/agent-runtime-pi-local": "0.7.20",
66
- "@rudderhq/agent-runtime-utils": "0.7.20",
67
- "@rudderhq/db": "0.7.20",
68
- "@rudderhq/identity-core": "0.7.20",
69
- "@rudderhq/run-intelligence-core": "0.7.20",
70
- "@rudderhq/shared": "0.7.20",
58
+ "@rudderhq/agent-runtime-claude-local": "0.7.21-canary.1",
59
+ "@rudderhq/agent-runtime-codex-local": "0.7.21-canary.1",
60
+ "@rudderhq/agent-runtime-cursor-local": "0.7.21-canary.1",
61
+ "@rudderhq/agent-runtime-gemini-local": "0.7.21-canary.1",
62
+ "@rudderhq/agent-runtime-hermes-gateway": "0.7.21-canary.1",
63
+ "@rudderhq/agent-runtime-openclaw-gateway": "0.7.21-canary.1",
64
+ "@rudderhq/agent-runtime-opencode-local": "0.7.21-canary.1",
65
+ "@rudderhq/agent-runtime-pi-local": "0.7.21-canary.1",
66
+ "@rudderhq/agent-runtime-utils": "0.7.21-canary.1",
67
+ "@rudderhq/db": "0.7.21-canary.1",
68
+ "@rudderhq/identity-core": "0.7.21-canary.1",
69
+ "@rudderhq/run-intelligence-core": "0.7.21-canary.1",
70
+ "@rudderhq/shared": "0.7.21-canary.1",
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 ee,a as re,b as te,r as l,c as Q,q as T,i as I,d as A,w as ne,j as e,W as ae,T as se,F as G,e as oe,M as ie,f as le,g as ce,C as z,h as ue,k as de,l as fe,m as me,n as he,o as xe,s as q,p as U,t as D,v as ye,x as J,y as be,z as pe,A as X,B as ve,R as we,D as ke}from"./index-Dmb5j1Fp.js";const V="This file changed while you were editing it.";function ge(b){return b.split("/").filter(Boolean).at(-1)??b}function je(b){return!(b.truncated||b.previewKind!=="text"||b.content===null)}function Fe(b){return/\.(?:md|markdown|mdown|mdx)$/i.test(b.filePath)}function Ce({annotationConversationId:b,file:L,organizationId:n,sourceToolbar:K}){const a=he(),s=L.filePath,w=L.content??"",F=l.useRef(xe(n,s,w)).current,c=l.useRef(!0),f=l.useRef(F.baseContent),C=l.useRef(w),u=l.useRef(F.content),g=l.useRef(null),_=l.useRef(!1),i=l.useRef(F.conflicted),y=l.useRef(0),[m,j]=l.useState(F.content),[P,p]=l.useState(F.conflicted?"error":F.content===w?"saved":"saving"),[R,h]=l.useState(F.conflicted?V:null),v=l.useRef(null),[S,N]=l.useState(null),t=Fe(L);u.current=m,C.current=w,l.useEffect(()=>(c.current=!0,()=>{c.current=!1,q(n,s,f.current,u.current)}),[s,n]),l.useEffect(()=>{if(w!==f.current){if(w===u.current){f.current=w,i.current=!1,p("saved"),h(null),U(n,s);return}if(u.current===f.current){f.current=w,u.current=w,j(w),i.current=!1,p("saved"),h(null),U(n,s);return}g.current=null,y.current+=1,i.current=!0,p("error"),h(V),q(n,s,f.current,u.current)}},[s,n,w]);const M=l.useCallback((o,k)=>{const r=o.content??k;f.current=r,C.current=r,i.current=!1,a.setQueryData(T.organizations.workspaceFile(n,s),o),q(n,s,r,u.current),u.current!==r&&(g.current=u.current),c.current&&(h(null),p(u.current===r?"saved":"saving"))},[s,n,a]),E=l.useCallback(async()=>{if(!_.current){_.current=!0;try{for(;g.current!==null;){const o=g.current,k=y.current;if(g.current=null,i.current)return;if(o!==f.current){c.current&&(p("saving"),h(null));try{const r=await D.updateWorkspaceFile(n,s,{content:o,expectedContent:f.current});if(k!==y.current)continue;M(r,o)}catch(r){if(k!==y.current)continue;let d=null;try{d=await D.readWorkspaceFile(n,s)}catch{}if(k!==y.current)continue;if(d&&(C.current=d.content??"",a.setQueryData(T.organizations.workspaceFile(n,s),d)),(d==null?void 0:d.content)===o){M(d,o);continue}d&&d.content!==f.current&&(g.current=null,i.current=!0,q(n,s,f.current,u.current)),c.current&&(p("error"),h(i.current?V:r instanceof Error?r.message:"Could not save this file."));return}}}c.current&&p(u.current===f.current?"saved":"saving")}finally{_.current=!1,g.current!==null&&!i.current&&E()}}},[M,s,n,a]),W=l.useCallback(o=>{g.current=o,E()},[E]);l.useEffect(()=>{if(q(n,s,f.current,m),i.current)return;if(m===f.current){p(_.current||g.current!==null?"saving":"saved");return}const o=window.setTimeout(()=>W(m),700);return()=>window.clearTimeout(o)},[m,W,s,n]);const $=()=>{const o=C.current;y.current+=1,f.current=o,u.current=o,g.current=null,i.current=!1,j(o),p("saved"),h(null),U(n,s)},O=()=>{y.current+=1,f.current=C.current,i.current=!1,p("saving"),h(null),W(u.current)},x=t?ye(m):{frontmatter:null,separator:"",body:m};return e.jsxs("div",{className:"relative flex h-full min-h-0 min-w-0 w-full flex-col overflow-hidden","data-testid":t?"library-live-surface-markdown-editor":"library-live-surface-text-editor",children:[K,e.jsx("div",{ref:v,className:X("min-h-0 flex-1",t?"scrollbar-auto-hide overflow-y-auto px-6 py-6":"overflow-hidden"),children:t?e.jsxs(e.Fragment,{children:[x.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:x.frontmatter,onChange:o=>{const k=J(o.currentTarget.value,x.separator,x.body);u.current=k,j(k),p(i.current?"error":"saving"),i.current||h(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(be,{engine:"codemirror",documentIdentity:`library-file:${s}`,value:x.body,onChange:o=>{const k=J(x.frontmatter,x.separator,o);u.current=k,j(k),p(i.current?"error":"saving"),i.current||h(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(pe,{"data-testid":"library-live-surface-text-source-editor",annotationSource:{surface:"workspace_file",sourceFilePath:s},ariaLabel:`${s} source editor`,filePath:s,value:m,onChange:o=>{u.current=o,j(o),p(i.current?"error":"saving"),i.current||h(null)},onSelectionChange:N})}),e.jsx(ve,{containerRef:v,conversationId:b,explicitSelection:t?void 0:S,saved:P==="saved"&&!i.current&&m===f.current,source:m,sourceIdentity:{surface:"workspace_file",sourceFilePath:s,sourceLibraryEntryId:L.libraryEntryId},sourceRenderMode:t?"markdown":"text",renderedSource:t?x.body:m,renderedSourceOffset:t?m.length-x.body.length:0}),e.jsxs("div",{className:X("flex min-h-10 shrink-0 items-center gap-2 border-t border-border/70 px-4 text-xs",P==="error"?"text-destructive":"text-muted-foreground"),role:P==="error"?"alert":"status",children:[e.jsx("span",{children:P==="saved"?"Saved":P==="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:O,children:"Keep mine"}),e.jsx("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:$,children:"Use latest"})]}):P==="error"?e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 font-medium text-foreground underline underline-offset-2",onClick:()=>W(u.current),children:[e.jsx(we,{className:"h-3 w-3","aria-hidden":!0}),"Retry"]}):null]})]})}function Z(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 Ne({active:b,annotationConversationId:L=null,organizationId:n,surface:K,target:a,onOpenTarget:s}){var o,k;const{pushToast:w}=ee(),Y=re(),F=te(),c=me(),[f,C]=l.useState([]),[u,g]=l.useState(null),[_,i]=l.useState("preview"),y=a.kind==="library_entry"?a:null,m=a.kind==="library_document"?a:null,j=a.kind==="library_directory"?a:null,P=(j==null?void 0:j.directoryPath)??"",p=a.kind==="library_file"?a.filePath:(y==null?void 0:y.path)??null,R=Q({queryKey:T.organizations.libraryEntry(n,(y==null?void 0:y.entryId)??"__none__"),queryFn:()=>D.getLibraryEntry(n,y.entryId),enabled:!!y,refetchOnWindowFocus:!1}),h=p??(((o=R.data)==null?void 0:o.status)==="active"?R.data.currentPath:null),v=Q({queryKey:T.organizations.workspaceFile(n,h??""),queryFn:()=>D.readWorkspaceFile(n,h),enabled:(a.kind==="library_file"||a.kind==="library_entry")&&!!h,refetchOnWindowFocus:!1}),S=Q({queryKey:T.organizations.libraryDocument(n,(m==null?void 0:m.documentId)??"__none__"),queryFn:()=>D.getLibraryDocument(n,m.documentId),enabled:!!m,refetchOnWindowFocus:!1}),N=Q({queryKey:T.organizations.workspaceFiles(n,P),queryFn:()=>D.listWorkspaceFiles(n,P),enabled:!!j,refetchOnWindowFocus:!1}),t=v.data,M=t?I(t)||A(t):!1;l.useEffect(()=>{i("preview")},[h]);const E=ne(f,{canOpenFile:!!(t!=null&&t.rootPath&&typeof(c==null?void 0:c.openWorkspaceFileInIde)=="function"),canOpenLocation:!!(t!=null&&t.rootPath&&typeof(c==null?void 0:c.openWorkspaceFileLocation)=="function")});l.useEffect(()=>{let r=!1;if(!(t!=null&&t.rootPath)||typeof(c==null?void 0:c.listWorkspaceLaunchTargets)!="function"){C([]);return}return c.listWorkspaceLaunchTargets().then(d=>{r||C(d)}).catch(()=>{r||C([])}),()=>{r=!0}},[c,t==null?void 0:t.rootPath]);const W=async r=>{var d;if(!(!(t!=null&&t.rootPath)||!c)){g(r.id);try{ke(r)?await c.openWorkspaceFileInIde(t.rootPath,t.filePath,r.id):await((d=c.openWorkspaceFileLocation)==null?void 0:d.call(c,t.rootPath,t.filePath,r.id)),w({title:`Opened in ${r.label}`,tone:"success"})}catch(B){w({title:`Could not open in ${r.label}`,body:B instanceof Error?B.message:"Try another app.",tone:"error"})}finally{g(null)}}},$=!!(a.kind==="library_entry"&&R.isPending||(a.kind==="library_file"||a.kind==="library_entry")&&h&&v.isPending||a.kind==="library_document"&&S.isPending||a.kind==="library_directory"&&N.isPending),O=a.kind==="library_entry"?R.error??v.error:a.kind==="library_file"?v.error:a.kind==="library_document"?S.error:N.error;let x;return $?x=e.jsx("div",{className:"m-auto text-sm text-muted-foreground","data-testid":"library-live-surface-loading",children:"Loading Library item…"}):O?x=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:O instanceof Error?O.message:"Could not open this Library item."}):a.kind==="library_entry"&&!h?x=Z(((k=R.data)==null?void 0:k.status)==="deleted"?"This Library entry was deleted.":"This Library entry is unavailable on its original path."):(a.kind==="library_file"||a.kind==="library_entry")&&v.data?x=je(v.data)&&(!M||_==="source")?e.jsx(Ce,{annotationConversationId:L,file:v.data,organizationId:n,sourceToolbar:I(v.data)?e.jsx(ae,{viewMode:"source",onViewModeChange:i,testIdPrefix:"library-live-surface"}):A(v.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(se,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Show table"]})}):void 0},v.data.filePath):e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","data-testid":"library-live-surface-file-preview",children:[A(v.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(G,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Show source"]})}):null,e.jsx(oe,{file:v.data,organizationId:n,mode:_,onModeChange:i,testIdPrefix:"library-live-surface"})]}):a.kind==="library_document"&&S.data?x=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(ie,{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})}):a.kind==="library_directory"&&N.data?x=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 H;const d=((H=r.displayLabel)==null?void 0:H.trim())||r.name,B=r.isDirectory?le:/\.(?:md|markdown|mdx|txt)$/i.test(r.path)?ce:G;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:d}:r.libraryEntryId?{kind:"library_entry",entryId:r.libraryEntryId,label:d,path:r.path}:{kind:"library_file",filePath:r.path,label:d||ge(r.path)}),children:[e.jsx(B,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:d}),r.isDirectory?e.jsx(z,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null]})},r.path)})})]}):x=Z("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":a.kind,"data-testid":"library-live-surface",children:[t&&E.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:t.filePath}),e.jsx("div",{"data-testid":"library-live-surface-file-open-selector",children:e.jsx(ue,{targets:E,openingTargetId:u,onOpenTarget:r=>void W(r),onOpenInLibrary:()=>F(de(`/library?path=${encodeURIComponent(t.filePath)}`,fe(Y.pathname))),testId:"library-live-surface-file-open-menu"})})]}):null,x]})}export{Ne as LibraryLiveSurface};
1
+ import{u as ee,a as re,b as te,r as l,c as Q,q as T,i as I,d as A,w as ne,j as e,W as ae,T as se,F as G,e as oe,M as ie,f as le,g as ce,C as z,h as ue,k as de,l as fe,m as me,n as he,o as xe,s as q,p as U,t as D,v as ye,x as J,y as be,z as pe,A as X,B as ve,R as we,D as ke}from"./index-CDnDaLFd.js";const V="This file changed while you were editing it.";function ge(b){return b.split("/").filter(Boolean).at(-1)??b}function je(b){return!(b.truncated||b.previewKind!=="text"||b.content===null)}function Fe(b){return/\.(?:md|markdown|mdown|mdx)$/i.test(b.filePath)}function Ce({annotationConversationId:b,file:L,organizationId:n,sourceToolbar:K}){const a=he(),s=L.filePath,w=L.content??"",F=l.useRef(xe(n,s,w)).current,c=l.useRef(!0),f=l.useRef(F.baseContent),C=l.useRef(w),u=l.useRef(F.content),g=l.useRef(null),_=l.useRef(!1),i=l.useRef(F.conflicted),y=l.useRef(0),[m,j]=l.useState(F.content),[P,p]=l.useState(F.conflicted?"error":F.content===w?"saved":"saving"),[R,h]=l.useState(F.conflicted?V:null),v=l.useRef(null),[S,N]=l.useState(null),t=Fe(L);u.current=m,C.current=w,l.useEffect(()=>(c.current=!0,()=>{c.current=!1,q(n,s,f.current,u.current)}),[s,n]),l.useEffect(()=>{if(w!==f.current){if(w===u.current){f.current=w,i.current=!1,p("saved"),h(null),U(n,s);return}if(u.current===f.current){f.current=w,u.current=w,j(w),i.current=!1,p("saved"),h(null),U(n,s);return}g.current=null,y.current+=1,i.current=!0,p("error"),h(V),q(n,s,f.current,u.current)}},[s,n,w]);const M=l.useCallback((o,k)=>{const r=o.content??k;f.current=r,C.current=r,i.current=!1,a.setQueryData(T.organizations.workspaceFile(n,s),o),q(n,s,r,u.current),u.current!==r&&(g.current=u.current),c.current&&(h(null),p(u.current===r?"saved":"saving"))},[s,n,a]),E=l.useCallback(async()=>{if(!_.current){_.current=!0;try{for(;g.current!==null;){const o=g.current,k=y.current;if(g.current=null,i.current)return;if(o!==f.current){c.current&&(p("saving"),h(null));try{const r=await D.updateWorkspaceFile(n,s,{content:o,expectedContent:f.current});if(k!==y.current)continue;M(r,o)}catch(r){if(k!==y.current)continue;let d=null;try{d=await D.readWorkspaceFile(n,s)}catch{}if(k!==y.current)continue;if(d&&(C.current=d.content??"",a.setQueryData(T.organizations.workspaceFile(n,s),d)),(d==null?void 0:d.content)===o){M(d,o);continue}d&&d.content!==f.current&&(g.current=null,i.current=!0,q(n,s,f.current,u.current)),c.current&&(p("error"),h(i.current?V:r instanceof Error?r.message:"Could not save this file."));return}}}c.current&&p(u.current===f.current?"saved":"saving")}finally{_.current=!1,g.current!==null&&!i.current&&E()}}},[M,s,n,a]),W=l.useCallback(o=>{g.current=o,E()},[E]);l.useEffect(()=>{if(q(n,s,f.current,m),i.current)return;if(m===f.current){p(_.current||g.current!==null?"saving":"saved");return}const o=window.setTimeout(()=>W(m),700);return()=>window.clearTimeout(o)},[m,W,s,n]);const $=()=>{const o=C.current;y.current+=1,f.current=o,u.current=o,g.current=null,i.current=!1,j(o),p("saved"),h(null),U(n,s)},O=()=>{y.current+=1,f.current=C.current,i.current=!1,p("saving"),h(null),W(u.current)},x=t?ye(m):{frontmatter:null,separator:"",body:m};return e.jsxs("div",{className:"relative flex h-full min-h-0 min-w-0 w-full flex-col overflow-hidden","data-testid":t?"library-live-surface-markdown-editor":"library-live-surface-text-editor",children:[K,e.jsx("div",{ref:v,className:X("min-h-0 flex-1",t?"scrollbar-auto-hide overflow-y-auto px-6 py-6":"overflow-hidden"),children:t?e.jsxs(e.Fragment,{children:[x.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:x.frontmatter,onChange:o=>{const k=J(o.currentTarget.value,x.separator,x.body);u.current=k,j(k),p(i.current?"error":"saving"),i.current||h(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(be,{engine:"codemirror",documentIdentity:`library-file:${s}`,value:x.body,onChange:o=>{const k=J(x.frontmatter,x.separator,o);u.current=k,j(k),p(i.current?"error":"saving"),i.current||h(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(pe,{"data-testid":"library-live-surface-text-source-editor",annotationSource:{surface:"workspace_file",sourceFilePath:s},ariaLabel:`${s} source editor`,filePath:s,value:m,onChange:o=>{u.current=o,j(o),p(i.current?"error":"saving"),i.current||h(null)},onSelectionChange:N})}),e.jsx(ve,{containerRef:v,conversationId:b,explicitSelection:t?void 0:S,saved:P==="saved"&&!i.current&&m===f.current,source:m,sourceIdentity:{surface:"workspace_file",sourceFilePath:s,sourceLibraryEntryId:L.libraryEntryId},sourceRenderMode:t?"markdown":"text",renderedSource:t?x.body:m,renderedSourceOffset:t?m.length-x.body.length:0}),e.jsxs("div",{className:X("flex min-h-10 shrink-0 items-center gap-2 border-t border-border/70 px-4 text-xs",P==="error"?"text-destructive":"text-muted-foreground"),role:P==="error"?"alert":"status",children:[e.jsx("span",{children:P==="saved"?"Saved":P==="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:O,children:"Keep mine"}),e.jsx("button",{type:"button",className:"font-medium text-foreground underline underline-offset-2",onClick:$,children:"Use latest"})]}):P==="error"?e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 font-medium text-foreground underline underline-offset-2",onClick:()=>W(u.current),children:[e.jsx(we,{className:"h-3 w-3","aria-hidden":!0}),"Retry"]}):null]})]})}function Z(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 Ne({active:b,annotationConversationId:L=null,organizationId:n,surface:K,target:a,onOpenTarget:s}){var o,k;const{pushToast:w}=ee(),Y=re(),F=te(),c=me(),[f,C]=l.useState([]),[u,g]=l.useState(null),[_,i]=l.useState("preview"),y=a.kind==="library_entry"?a:null,m=a.kind==="library_document"?a:null,j=a.kind==="library_directory"?a:null,P=(j==null?void 0:j.directoryPath)??"",p=a.kind==="library_file"?a.filePath:(y==null?void 0:y.path)??null,R=Q({queryKey:T.organizations.libraryEntry(n,(y==null?void 0:y.entryId)??"__none__"),queryFn:()=>D.getLibraryEntry(n,y.entryId),enabled:!!y,refetchOnWindowFocus:!1}),h=p??(((o=R.data)==null?void 0:o.status)==="active"?R.data.currentPath:null),v=Q({queryKey:T.organizations.workspaceFile(n,h??""),queryFn:()=>D.readWorkspaceFile(n,h),enabled:(a.kind==="library_file"||a.kind==="library_entry")&&!!h,refetchOnWindowFocus:!1}),S=Q({queryKey:T.organizations.libraryDocument(n,(m==null?void 0:m.documentId)??"__none__"),queryFn:()=>D.getLibraryDocument(n,m.documentId),enabled:!!m,refetchOnWindowFocus:!1}),N=Q({queryKey:T.organizations.workspaceFiles(n,P),queryFn:()=>D.listWorkspaceFiles(n,P),enabled:!!j,refetchOnWindowFocus:!1}),t=v.data,M=t?I(t)||A(t):!1;l.useEffect(()=>{i("preview")},[h]);const E=ne(f,{canOpenFile:!!(t!=null&&t.rootPath&&typeof(c==null?void 0:c.openWorkspaceFileInIde)=="function"),canOpenLocation:!!(t!=null&&t.rootPath&&typeof(c==null?void 0:c.openWorkspaceFileLocation)=="function")});l.useEffect(()=>{let r=!1;if(!(t!=null&&t.rootPath)||typeof(c==null?void 0:c.listWorkspaceLaunchTargets)!="function"){C([]);return}return c.listWorkspaceLaunchTargets().then(d=>{r||C(d)}).catch(()=>{r||C([])}),()=>{r=!0}},[c,t==null?void 0:t.rootPath]);const W=async r=>{var d;if(!(!(t!=null&&t.rootPath)||!c)){g(r.id);try{ke(r)?await c.openWorkspaceFileInIde(t.rootPath,t.filePath,r.id):await((d=c.openWorkspaceFileLocation)==null?void 0:d.call(c,t.rootPath,t.filePath,r.id)),w({title:`Opened in ${r.label}`,tone:"success"})}catch(B){w({title:`Could not open in ${r.label}`,body:B instanceof Error?B.message:"Try another app.",tone:"error"})}finally{g(null)}}},$=!!(a.kind==="library_entry"&&R.isPending||(a.kind==="library_file"||a.kind==="library_entry")&&h&&v.isPending||a.kind==="library_document"&&S.isPending||a.kind==="library_directory"&&N.isPending),O=a.kind==="library_entry"?R.error??v.error:a.kind==="library_file"?v.error:a.kind==="library_document"?S.error:N.error;let x;return $?x=e.jsx("div",{className:"m-auto text-sm text-muted-foreground","data-testid":"library-live-surface-loading",children:"Loading Library item…"}):O?x=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:O instanceof Error?O.message:"Could not open this Library item."}):a.kind==="library_entry"&&!h?x=Z(((k=R.data)==null?void 0:k.status)==="deleted"?"This Library entry was deleted.":"This Library entry is unavailable on its original path."):(a.kind==="library_file"||a.kind==="library_entry")&&v.data?x=je(v.data)&&(!M||_==="source")?e.jsx(Ce,{annotationConversationId:L,file:v.data,organizationId:n,sourceToolbar:I(v.data)?e.jsx(ae,{viewMode:"source",onViewModeChange:i,testIdPrefix:"library-live-surface"}):A(v.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(se,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Show table"]})}):void 0},v.data.filePath):e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden","data-testid":"library-live-surface-file-preview",children:[A(v.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(G,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Show source"]})}):null,e.jsx(oe,{file:v.data,organizationId:n,mode:_,onModeChange:i,testIdPrefix:"library-live-surface"})]}):a.kind==="library_document"&&S.data?x=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(ie,{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})}):a.kind==="library_directory"&&N.data?x=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 H;const d=((H=r.displayLabel)==null?void 0:H.trim())||r.name,B=r.isDirectory?le:/\.(?:md|markdown|mdx|txt)$/i.test(r.path)?ce:G;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:d}:r.libraryEntryId?{kind:"library_entry",entryId:r.libraryEntryId,label:d,path:r.path}:{kind:"library_file",filePath:r.path,label:d||ge(r.path)}),children:[e.jsx(B,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:d}),r.isDirectory?e.jsx(z,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}):null]})},r.path)})})]}):x=Z("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":a.kind,"data-testid":"library-live-surface",children:[t&&E.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:t.filePath}),e.jsx("div",{"data-testid":"library-live-surface-file-open-selector",children:e.jsx(ue,{targets:E,openingTargetId:u,onOpenTarget:r=>void W(r),onOpenInLibrary:()=>F(de(`/library?path=${encodeURIComponent(t.filePath)}`,fe(Y.pathname))),testId:"library-live-surface-file-open-menu"})})]}):null,x]})}export{Ne as LibraryLiveSurface};
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-BTooeKeT.js";import{p as f}from"./chunk-JWPE2WC7-vi_fmyul.js";import{_ as n,l as o}from"./mermaid.core-DELkNXiT.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-BDGVZRa9.js";import"./index-Dmb5j1Fp.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
+ import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-Co2l_j69.js";import{p as f}from"./chunk-JWPE2WC7-CJkmHyr7.js";import{_ as n,l as o}from"./mermaid.core-DvTQFTkl.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-Cops8dQe.js";import"./index-CDnDaLFd.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{aa as g}from"./index-Dmb5j1Fp.js";function _(i,s){for(var o=0;o<s.length;o++){const t=s[o];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in i)){const r=Object.getOwnPropertyDescriptor(t,e);r&&Object.defineProperty(i,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var a={exports:{}},d;function y(){return d||(d=1,(function(i,s){(function(o,t){i.exports=t()})(self,(()=>(()=>{var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const r=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(r._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,r=e._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const c=this._terminal.options.scrollback===0?0:e.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),m=parseInt(l.getPropertyValue("height")),u=Math.max(0,parseInt(l.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),h=m-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),f=u-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-c;return{cols:Math.max(2,Math.floor(f/r.css.cell.width)),rows:Math.max(1,Math.floor(h/r.css.cell.height))}}}})(),o})()))})(a)),a.exports}var p=y();const w=g(p),x=_({__proto__:null,default:w},[p]);export{x as a};
1
+ import{aa as g}from"./index-CDnDaLFd.js";function _(i,s){for(var o=0;o<s.length;o++){const t=s[o];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in i)){const r=Object.getOwnPropertyDescriptor(t,e);r&&Object.defineProperty(i,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var a={exports:{}},d;function y(){return d||(d=1,(function(i,s){(function(o,t){i.exports=t()})(self,(()=>(()=>{var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const r=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(r._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,r=e._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const c=this._terminal.options.scrollback===0?0:e.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),m=parseInt(l.getPropertyValue("height")),u=Math.max(0,parseInt(l.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),h=m-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),f=u-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-c;return{cols:Math.max(2,Math.floor(f/r.css.cell.width)),rows:Math.max(1,Math.floor(h/r.css.cell.height))}}}})(),o})()))})(a)),a.exports}var p=y();const w=g(p),x=_({__proto__:null,default:w},[p]);export{x as a};
@@ -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-DELkNXiT.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};
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-DvTQFTkl.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};