@rudderhq/server 0.7.13 → 0.7.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/middleware/error-handler.d.ts.map +1 -1
- package/dist/middleware/error-handler.js +10 -2
- package/dist/middleware/error-handler.js.map +1 -1
- package/dist/middleware/logger.d.ts +3 -0
- package/dist/middleware/logger.d.ts.map +1 -1
- package/dist/middleware/logger.js +15 -6
- package/dist/middleware/logger.js.map +1 -1
- package/dist/middleware/logger.test.js +14 -1
- package/dist/middleware/logger.test.js.map +1 -1
- package/dist/routes/agents.management-routes.js +7 -7
- package/dist/routes/agents.management-routes.js.map +1 -1
- package/dist/routes/chats.js +2 -2
- package/dist/routes/chats.js.map +1 -1
- package/dist/routes/issues.d.ts.map +1 -1
- package/dist/routes/issues.js +5 -6
- package/dist/routes/issues.js.map +1 -1
- package/dist/routes/rudder-plugins.js +2 -2
- package/dist/routes/rudder-plugins.js.map +1 -1
- package/dist/services/agent-run-context.d.ts +1 -1
- package/dist/services/agent-run-context.d.ts.map +1 -1
- package/dist/services/agent-run-context.js +6 -12
- package/dist/services/agent-run-context.js.map +1 -1
- package/dist/services/agent-startup-context.d.ts.map +1 -1
- package/dist/services/agent-startup-context.js +7 -6
- package/dist/services/agent-startup-context.js.map +1 -1
- package/dist/services/automations.js +2 -2
- package/dist/services/automations.js.map +1 -1
- package/dist/services/chat-assistant.d.ts.map +1 -1
- package/dist/services/chat-assistant.js +43 -19
- package/dist/services/chat-assistant.js.map +1 -1
- package/dist/services/chats.d.ts +2 -1
- package/dist/services/chats.d.ts.map +1 -1
- package/dist/services/chats.js +2 -2
- package/dist/services/chats.js.map +1 -1
- package/dist/services/integrations/feishu/runtime.d.ts.map +1 -1
- package/dist/services/integrations/feishu/runtime.js +69 -23
- package/dist/services/integrations/feishu/runtime.js.map +1 -1
- package/dist/services/issues.d.ts +4 -1
- package/dist/services/issues.d.ts.map +1 -1
- package/dist/services/issues.js +134 -5
- package/dist/services/issues.js.map +1 -1
- package/dist/services/knowledge-portability/organization-portability.js +1 -1
- package/dist/services/knowledge-portability/organization-portability.js.map +1 -1
- package/dist/services/messenger-saved-views.d.ts.map +1 -1
- package/dist/services/messenger-saved-views.js +29 -5
- package/dist/services/messenger-saved-views.js.map +1 -1
- package/dist/services/rudder-plugin-catalog.d.ts.map +1 -1
- package/dist/services/rudder-plugin-catalog.js +38 -25
- package/dist/services/rudder-plugin-catalog.js.map +1 -1
- package/dist/services/rudder-plugin-catalog.test.js +169 -1
- package/dist/services/rudder-plugin-catalog.test.js.map +1 -1
- package/dist/services/rudder-plugins.d.ts.map +1 -1
- package/dist/services/rudder-plugins.js +1 -0
- package/dist/services/rudder-plugins.js.map +1 -1
- package/dist/services/runtime-kernel/assignment-run-guardrail.d.ts +0 -92
- package/dist/services/runtime-kernel/assignment-run-guardrail.d.ts.map +1 -1
- package/dist/services/runtime-kernel/assignment-run-guardrail.js +0 -343
- package/dist/services/runtime-kernel/assignment-run-guardrail.js.map +1 -1
- package/dist/services/runtime-kernel/assignment-run-guardrail.test.js +2 -152
- package/dist/services/runtime-kernel/assignment-run-guardrail.test.js.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.core.d.ts +1 -1
- package/dist/services/runtime-kernel/heartbeat.core.d.ts.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.core.js +51 -4
- package/dist/services/runtime-kernel/heartbeat.core.js.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.execute.d.ts.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.execute.js +7 -116
- package/dist/services/runtime-kernel/heartbeat.execute.js.map +1 -1
- package/package.json +14 -14
- package/resources/bundled-skills/rudder-docs/references/agent-creation.md +5 -2
- package/resources/bundled-skills/rudder-docs/references/api-reference.md +6 -4
- package/resources/bundled-skills/rudder-docs/references/cli-reference.md +3 -0
- package/skills/rudder-docs/references/agent-creation.md +5 -2
- package/skills/rudder-docs/references/api-reference.md +6 -4
- package/skills/rudder-docs/references/cli-reference.md +3 -0
- package/ui-dist/assets/{LibraryLiveSurface-l4GUICoP.js → LibraryLiveSurface-CbD9B2Jg.js} +1 -1
- package/ui-dist/assets/{abnfDiagram-VRR7QNED-BLBjJ-cq.js → abnfDiagram-VRR7QNED-BGfRZrl0.js} +1 -1
- package/ui-dist/assets/{addon-fit-BJjiE5UX.js → addon-fit--ip0m1eF.js} +1 -1
- package/ui-dist/assets/{arc-Cc8Cihbb.js → arc-BtiiHzBd.js} +1 -1
- package/ui-dist/assets/{architectureDiagram-ZJ3FMSHR--xCnNdhe.js → architectureDiagram-ZJ3FMSHR-CblysKA0.js} +1 -1
- package/ui-dist/assets/{blockDiagram-677ZJIJ3-DRT2VAhQ.js → blockDiagram-677ZJIJ3-DZUzthvF.js} +1 -1
- package/ui-dist/assets/{c4Diagram-LMCZKHZV-D88LDng_.js → c4Diagram-LMCZKHZV-Durmr5OS.js} +1 -1
- package/ui-dist/assets/channel-DtMg64x5.js +1 -0
- package/ui-dist/assets/{chunk-2Q5K7J3B-Dz_vdT6U.js → chunk-2Q5K7J3B-CzC-fYbH.js} +1 -1
- package/ui-dist/assets/{chunk-32BRIVSS-DigOixDH.js → chunk-32BRIVSS-D4A3SSYA.js} +1 -1
- package/ui-dist/assets/{chunk-5VM5RSS4-C_1XAVwx.js → chunk-5VM5RSS4-IPYYyHit.js} +1 -1
- package/ui-dist/assets/{chunk-EX3LRPZG-C6viraTj.js → chunk-EX3LRPZG-CGdhATIq.js} +1 -1
- package/ui-dist/assets/{chunk-JWPE2WC7-BCRBJeuJ.js → chunk-JWPE2WC7-CY08geUj.js} +1 -1
- package/ui-dist/assets/{chunk-MOJQB5TN-Cf1ATLhT.js → chunk-MOJQB5TN-B0VR-_eb.js} +1 -1
- package/ui-dist/assets/{chunk-RYQCIY6F-WltrJiTY.js → chunk-RYQCIY6F-CwiPcDLW.js} +1 -1
- package/ui-dist/assets/{chunk-V7JOEXUC-CA5tCSQF.js → chunk-V7JOEXUC-CC4xQqDn.js} +1 -1
- package/ui-dist/assets/{chunk-VR4S4FIN-CEkOCBXH.js → chunk-VR4S4FIN-fa3cKPyb.js} +1 -1
- package/ui-dist/assets/{chunk-XXDRQBXY-CtrnGXIb.js → chunk-XXDRQBXY-B_uFpawt.js} +1 -1
- package/ui-dist/assets/classDiagram-OUVF2IWQ-Dhm6vJZV.js +1 -0
- package/ui-dist/assets/classDiagram-v2-EOCWNBFH-Dhm6vJZV.js +1 -0
- package/ui-dist/assets/{cose-bilkent-JH36ORCC-CByYAK4l.js → cose-bilkent-JH36ORCC-DfOcZUvm.js} +1 -1
- package/ui-dist/assets/{cynefin-VYW2F7L2-_sCXFLWX.js → cynefin-VYW2F7L2-BID948i0.js} +1 -1
- package/ui-dist/assets/{cynefinDiagram-TSTJHNR4-CFeFfsqk.js → cynefinDiagram-TSTJHNR4-BqvF2qjZ.js} +1 -1
- package/ui-dist/assets/{dagre-VKFMJZFB-Bqod3KpP.js → dagre-VKFMJZFB-C5W_FyuW.js} +1 -1
- package/ui-dist/assets/{diagram-FQU43EPY-BfvoZqSk.js → diagram-FQU43EPY-CutgooHd.js} +1 -1
- package/ui-dist/assets/{diagram-G47NLZAW-BXbnKoJ9.js → diagram-G47NLZAW-CM16AG4F.js} +1 -1
- package/ui-dist/assets/{diagram-NH7WQ7WH-DzyI0L8P.js → diagram-NH7WQ7WH-CbXAmz5f.js} +1 -1
- package/ui-dist/assets/{diagram-OA4YK3LP-DTMuvqry.js → diagram-OA4YK3LP-B_zLEkuk.js} +1 -1
- package/ui-dist/assets/{diagram-WEI45ONY-CAzeoFPA.js → diagram-WEI45ONY-s5JKRJa5.js} +1 -1
- package/ui-dist/assets/{ebnfDiagram-CCIWWBDH-CV731d_d.js → ebnfDiagram-CCIWWBDH-B8MHJ46l.js} +1 -1
- package/ui-dist/assets/{erDiagram-Q63AITRT-X1TOS4Ka.js → erDiagram-Q63AITRT-dlFN6klQ.js} +1 -1
- package/ui-dist/assets/{flowDiagram-23GEKE2U-DVrBhhZN.js → flowDiagram-23GEKE2U-CMEEUfRl.js} +1 -1
- package/ui-dist/assets/{ganttDiagram-NO4QXBWP-Bu2bat7s.js → ganttDiagram-NO4QXBWP-RYdUNmeQ.js} +1 -1
- package/ui-dist/assets/{gitGraphDiagram-IHSO6WYX-BACGK4uh.js → gitGraphDiagram-IHSO6WYX-BB5uby_3.js} +1 -1
- package/ui-dist/assets/{graph-DBmSffWh.js → graph-CHqsk9a0.js} +1 -1
- package/ui-dist/assets/{index-DsjgdWi0.js → index-0b2QvaiP.js} +1 -1
- package/ui-dist/assets/{index-Qr_boV5N.js → index-C7bvI53l.js} +1 -1
- package/ui-dist/assets/{index-BM89NC7H.js → index-CFQElZYx.js} +1 -1
- package/ui-dist/assets/{index-juSeEYHt.js → index-CMRNQHWA.js} +1 -1
- package/ui-dist/assets/{index-BJLMZ-lO.js → index-CQfL7Zs4.js} +581 -572
- package/ui-dist/assets/index-CYaeM_68.css +32 -0
- package/ui-dist/assets/{index-sPs1blcu.js → index-CkCTdyQB.js} +1 -1
- package/ui-dist/assets/{index-C7oAJP9-.js → index-Cv41zOKL.js} +1 -1
- package/ui-dist/assets/{index-qSO_9tQ4.js → index-D6KvRwFm.js} +1 -1
- package/ui-dist/assets/{index-SBaOrW31.js → index-DAVSGjLA.js} +1 -1
- package/ui-dist/assets/{index-37d7mmQR.js → index-DmawwuDA.js} +1 -1
- package/ui-dist/assets/{index-CqrPtttL.js → index-Dyal9gL0.js} +1 -1
- package/ui-dist/assets/{index-CY63mXIN.js → index-F9rBxffQ.js} +1 -1
- package/ui-dist/assets/{index-BlzBPtLA.js → index-Io44HJHg.js} +1 -1
- package/ui-dist/assets/{index-D8VjtybU.js → index-Y7wKGA2n.js} +1 -1
- package/ui-dist/assets/{index-jawM4Mw8.js → index-jiYIDst0.js} +1 -1
- package/ui-dist/assets/{infoDiagram-FWYZ7A6U-DsKiGJG2.js → infoDiagram-FWYZ7A6U-DTjJ4G6b.js} +1 -1
- package/ui-dist/assets/{ishikawaDiagram-FXEZZL3T-qFWBzEXh.js → ishikawaDiagram-FXEZZL3T-CYEQju_T.js} +1 -1
- package/ui-dist/assets/{journeyDiagram-5HDEW3XC-CzXYTAgD.js → journeyDiagram-5HDEW3XC-CjAZvQIh.js} +1 -1
- package/ui-dist/assets/{kanban-definition-HUTT4EX6-BCz-L1fU.js → kanban-definition-HUTT4EX6-DpopB0pg.js} +1 -1
- package/ui-dist/assets/{layout-YfTyU1_8.js → layout-zLRJSNuB.js} +1 -1
- package/ui-dist/assets/{linear-Cmr3155j.js → linear-DvemTimo.js} +1 -1
- package/ui-dist/assets/{map-Cd3zkWna.js → map-Bls8mI9F.js} +1 -1
- package/ui-dist/assets/{mermaid.core-B0LpeiXb.js → mermaid.core-Cr_nLldI.js} +4 -4
- package/ui-dist/assets/{mindmap-definition-LN4V7U3C-53OklQRn.js → mindmap-definition-LN4V7U3C-CYQI0O1_.js} +1 -1
- package/ui-dist/assets/{pegDiagram-2B236MQR-Dm_aMKAy.js → pegDiagram-2B236MQR-D4ZufqLz.js} +1 -1
- package/ui-dist/assets/{pieDiagram-ENE6RG2P-X7GdM_uO.js → pieDiagram-ENE6RG2P-Cp9_BLOv.js} +1 -1
- package/ui-dist/assets/{quadrantDiagram-ABIIQ3AL-CwNrCyye.js → quadrantDiagram-ABIIQ3AL-D3vG5dG8.js} +1 -1
- package/ui-dist/assets/{railroadDiagram-RFXS5EU6-qeA8AyXg.js → railroadDiagram-RFXS5EU6-ajkkn6FI.js} +1 -1
- package/ui-dist/assets/{requirementDiagram-TGXJPOKE-CbTV3-mv.js → requirementDiagram-TGXJPOKE-ClXp9KU7.js} +1 -1
- package/ui-dist/assets/{sankeyDiagram-HTMAVEWB-Cb2FZniK.js → sankeyDiagram-HTMAVEWB-DZgfcF8o.js} +1 -1
- package/ui-dist/assets/{sequenceDiagram-DBY2YBRQ-43rfMbK2.js → sequenceDiagram-DBY2YBRQ-_zoarL3b.js} +1 -1
- package/ui-dist/assets/{sizeCapture-X5ZJPWSS-kd6mcpBA.js → sizeCapture-X5ZJPWSS-Bf9ESdZs.js} +1 -1
- package/ui-dist/assets/{stateDiagram-2N3HPSRC-DVpqAreh.js → stateDiagram-2N3HPSRC-C3CX2N_K.js} +1 -1
- package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-Dk-0Ax2u.js +1 -0
- package/ui-dist/assets/{swimlanes-5IMT3BWC-Cpgu2cLX.js → swimlanes-5IMT3BWC-DBx4Yd1a.js} +2 -2
- package/ui-dist/assets/swimlanesDiagram-G3AALYLV-BPKbu0D2.js +8 -0
- package/ui-dist/assets/{timeline-definition-FHXFAJF6-BXgN1EJb.js → timeline-definition-FHXFAJF6-BQd4WmPY.js} +1 -1
- package/ui-dist/assets/{vennDiagram-L72KCM5P-ZFEGgsAk.js → vennDiagram-L72KCM5P-C52MuYHI.js} +1 -1
- package/ui-dist/assets/{wardleyDiagram-EHGQE667-DrxFJODe.js → wardleyDiagram-EHGQE667-Cb_8DNud.js} +1 -1
- package/ui-dist/assets/{xterm-DeUtt-wP.js → xterm-FmL4hGL4.js} +1 -1
- package/ui-dist/assets/{xychartDiagram-FW5EYKEG-BNcvHMPz.js → xychartDiagram-FW5EYKEG-BT_-q9dc.js} +1 -1
- package/ui-dist/index.html +2 -2
- package/ui-dist/assets/channel-C5Hipz5u.js +0 -1
- package/ui-dist/assets/classDiagram-OUVF2IWQ-ClTHNkOu.js +0 -1
- package/ui-dist/assets/classDiagram-v2-EOCWNBFH-ClTHNkOu.js +0 -1
- package/ui-dist/assets/index-CPP8apmO.css +0 -32
- package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-CD2jPBKH.js +0 -1
- package/ui-dist/assets/swimlanesDiagram-G3AALYLV-CwSF2io0.js +0 -8
|
@@ -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-BJLMZ-lO.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-CQfL7Zs4.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};
|
package/ui-dist/assets/{abnfDiagram-VRR7QNED-BLBjJ-cq.js → abnfDiagram-VRR7QNED-BGfRZrl0.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-B0VR-_eb.js";import{p as f}from"./chunk-JWPE2WC7-CY08geUj.js";import{_ as n,l as o}from"./mermaid.core-Cr_nLldI.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-BID948i0.js";import"./index-CQfL7Zs4.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-
|
|
1
|
+
import{aa as g}from"./index-CQfL7Zs4.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-
|
|
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-Cr_nLldI.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};
|