@nodefony/studio 10.0.0-beta.8 → 10.0.0-beta.9
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/frontend/assets/Accordion-D_8LAjKl.js +1 -0
- package/dist/frontend/assets/{ActionsLiveGraph-D1QeuUQm.js → ActionsLiveGraph-DPG8293v.js} +1 -1
- package/dist/frontend/assets/AgentsPreview-CbuZ1MW3.js +12 -0
- package/dist/frontend/assets/ApiKeys-sejlaGPu.js +2 -0
- package/dist/frontend/assets/{ArchitectureLiveGraph-CMuDgIZB.js → ArchitectureLiveGraph-DdYMg18n.js} +1 -1
- package/dist/frontend/assets/Audit-Df57p0vH.js +1 -0
- package/dist/frontend/assets/{BackplaneLiveGraph-DPaKwgjB.js → BackplaneLiveGraph-ieJyx_Ub.js} +1 -1
- package/dist/frontend/assets/Breadcrumbs-DWWRbD1u.js +1 -0
- package/dist/frontend/assets/BrickStoreChip-BLiTtfPX.js +1 -0
- package/dist/frontend/assets/Chat-DayrInKR.js +1 -0
- package/dist/frontend/assets/Chip-HiZSg-p4.js +1 -0
- package/dist/frontend/assets/Cluster-BxvMBlHV.js +1 -0
- package/dist/frontend/assets/{Collapse-C38QJ_Ri.js → Collapse-ctIxjH-g.js} +1 -1
- package/dist/frontend/assets/ConfigPage-DLwDTF2O.js +1 -0
- package/dist/frontend/assets/ConnectorCard-CjcESZAg.js +11 -0
- package/dist/frontend/assets/Create-6NkV6-cz.js +2 -0
- package/dist/frontend/assets/DashboardSupervision-BTvAD0Iu.js +1 -0
- package/dist/frontend/assets/Database-2r7Ksj1s.js +1 -0
- package/dist/frontend/assets/{DbLogo-CckTvmdO.js → DbLogo-Cz2-EXsq.js} +1 -1
- package/dist/frontend/assets/Documentation-Cw3zFNhR.js +1 -0
- package/dist/frontend/assets/{FanOutLiveGraph-C6KbaYVm.js → FanOutLiveGraph-CTVtTGnG.js} +1 -1
- package/dist/frontend/assets/Firewall-7nfoWXua.js +1 -0
- package/dist/frontend/assets/GatewayPreview-C-bXaPd3.js +1 -0
- package/dist/frontend/assets/{IconAdjustmentsAlt-CPpJMDFd.js → IconAdjustmentsAlt-BYYo82z6.js} +1 -1
- package/dist/frontend/assets/{IconAdjustmentsHorizontal-CzTgez2O.js → IconAdjustmentsHorizontal-BbopjGKW.js} +1 -1
- package/dist/frontend/assets/{IconAffiliate-B-8j6CaO.js → IconAffiliate-CALcdBM0.js} +1 -1
- package/dist/frontend/assets/{IconApi-CBIbi8ns.js → IconApi-9l8MA5iC.js} +1 -1
- package/dist/frontend/assets/{IconAppWindow-BtbyDQML.js → IconAppWindow-D53SJAEH.js} +1 -1
- package/dist/frontend/assets/{IconApps-BfSGoNRn.js → IconApps-C6EUs10H.js} +1 -1
- package/dist/frontend/assets/{IconArchive-DDq3xKRQ.js → IconArchive-BBz0xGgX.js} +1 -1
- package/dist/frontend/assets/{IconArrowDown-CypWBIm8.js → IconArrowDown-BJtqr-61.js} +1 -1
- package/dist/frontend/assets/{IconArrowLeft-D0LQWE0c.js → IconArrowLeft-DeLkgqIP.js} +1 -1
- package/dist/frontend/assets/{IconArrowUp-GGdt393_.js → IconArrowUp-CmWO7XuE.js} +1 -1
- package/dist/frontend/assets/IconArrowsExchange-C_kRqndj.js +1 -0
- package/dist/frontend/assets/{IconArrowsSplit2-BMV-DM2_.js → IconArrowsSplit2-D_oHpLml.js} +1 -1
- package/dist/frontend/assets/IconBan-Ci1EWASP.js +1 -0
- package/dist/frontend/assets/{IconBook-BS-zX7Sh.js → IconBook-B_pBdt3F.js} +1 -1
- package/dist/frontend/assets/{IconBooks-DYJgVlGf.js → IconBooks-nvCidUrl.js} +1 -1
- package/dist/frontend/assets/{IconBox-DT4IcS8e.js → IconBox-t6C2bRKY.js} +1 -1
- package/dist/frontend/assets/{IconBrain-CMyyVykF.js → IconBrain-CQHG8g62.js} +1 -1
- package/dist/frontend/assets/{IconCircleCheck-BkiqnBmy.js → IconCircleCheck-DkVi0NqA.js} +1 -1
- package/dist/frontend/assets/{IconCircleDot-DBpgsPm5.js → IconCircleDot-BDJbMpKL.js} +1 -1
- package/dist/frontend/assets/IconCircuitResistor-BghxljUq.js +1 -0
- package/dist/frontend/assets/{IconCode-CkzeaOMf.js → IconCode-CE3-hQ1q.js} +1 -1
- package/dist/frontend/assets/{IconDeviceDesktop-BhfcZEfk.js → IconDeviceDesktop-OvxYj-tE.js} +1 -1
- package/dist/frontend/assets/{IconDevices-DYaCW1Lf.js → IconDevices-MdfOIWwb.js} +1 -1
- package/dist/frontend/assets/{IconDots-zMMjYLi7.js → IconDots-DppzaKps.js} +1 -1
- package/dist/frontend/assets/{IconDownload-BIf4ZImv.js → IconDownload-D6gc8nI5.js} +1 -1
- package/dist/frontend/assets/{IconEye-DXjnEUL5.js → IconEye-Bzn7AU39.js} +1 -1
- package/dist/frontend/assets/{IconFile-D_AMs1iZ.js → IconFile-BPpLKPwy.js} +1 -1
- package/dist/frontend/assets/{IconFolder-DNvrDX-8.js → IconFolder-Ckv1Xm-N.js} +1 -1
- package/dist/frontend/assets/{IconGitBranch-C9rgpIR2.js → IconGitBranch-CVhYV-zp.js} +1 -1
- package/dist/frontend/assets/{IconHandStop-DQFq7Kla.js → IconHandStop-B68ZZTGv.js} +1 -1
- package/dist/frontend/assets/{IconHeartRateMonitor-DURptc8j.js → IconHeartRateMonitor-Dk3J4q2m.js} +1 -1
- package/dist/frontend/assets/{IconHelpCircle-C6caw8cr.js → IconHelpCircle-TIagVTB7.js} +1 -1
- package/dist/frontend/assets/{IconLayoutGrid-DqIXTdsq.js → IconLayoutGrid-BWw9qEEk.js} +1 -1
- package/dist/frontend/assets/{IconListSearch-Dx8ldAwH.js → IconListSearch-D9MErH_U.js} +1 -1
- package/dist/frontend/assets/{IconPackages-Dswyo8q2.js → IconPackages-BzsI-Li9.js} +1 -1
- package/dist/frontend/assets/{IconPencil-B8AVKzwi.js → IconPencil-B5Aj92dN.js} +1 -1
- package/dist/frontend/assets/{IconPlayerPause-BESNYgPM.js → IconPlayerPause-CKysLAOo.js} +1 -1
- package/dist/frontend/assets/IconPlayerPlay-XEjU8Vve.js +1 -0
- package/dist/frontend/assets/{IconPlayerStop-BEsZkT6N.js → IconPlayerStop-Gw6QwdEs.js} +1 -1
- package/dist/frontend/assets/IconPlus-Coq8xjXa.js +1 -0
- package/dist/frontend/assets/{IconPuzzle-CJhQUtbI.js → IconPuzzle-sBK_hUoV.js} +1 -1
- package/dist/frontend/assets/{IconRecycle-Ba6E065w.js → IconRecycle-D7gEhQcy.js} +1 -1
- package/dist/frontend/assets/{IconSend-YkuVPb0V.js → IconSend-Bc0inf9r.js} +1 -1
- package/dist/frontend/assets/{IconServer2-CQ-VREH3.js → IconServer2-DAA64x6c.js} +1 -1
- package/dist/frontend/assets/{IconShieldOff-BsfIN8zc.js → IconShieldOff--SkVGoxa.js} +1 -1
- package/dist/frontend/assets/{IconSitemap-BVtH3lou.js → IconSitemap-BnDmpiKO.js} +1 -1
- package/dist/frontend/assets/{IconStack2-CCZMRSRP.js → IconStack2-CMC-_hkZ.js} +1 -1
- package/dist/frontend/assets/{IconTerminal2-DTjQG6wa.js → IconTerminal2-Cu7EnrUO.js} +1 -1
- package/dist/frontend/assets/{IconTool-BSCYXvc-.js → IconTool-Dp0ccZSt.js} +1 -1
- package/dist/frontend/assets/{IconUserOff-f9WTCDbr.js → IconUserOff-B5FGETxB.js} +1 -1
- package/dist/frontend/assets/{IconWorld-DSRVZK6z.js → IconWorld-CIpRNsHH.js} +1 -1
- package/dist/frontend/assets/KnowledgePreview-BdKGMh6C.js +1 -0
- package/dist/frontend/assets/List-BtRdrxnk.js +1 -0
- package/dist/frontend/assets/LlmProvidersPreview-BeMe85gQ.js +1 -0
- package/dist/frontend/assets/{LogVisuals-DEasJmu2.js → LogVisuals-CA1F7UzB.js} +1 -1
- package/dist/frontend/assets/Logs-L943vOfP.js +1 -0
- package/dist/frontend/assets/McpPreview-D5SYhTdY.js +1 -0
- package/dist/frontend/assets/MemoryPreview-DmXb-Gh_.js +1 -0
- package/dist/frontend/assets/Migrations-CUbBH2cP.js +3 -0
- package/dist/frontend/assets/ModuleDetail-BMQuwphQ.js +1 -0
- package/dist/frontend/assets/Modules-BUEEsgaF.js +1 -0
- package/dist/frontend/assets/OrmConnector-Bb4x-xfj.js +1 -0
- package/dist/frontend/assets/OrmEntity-fUZhlaqY.js +1 -0
- package/dist/frontend/assets/OrmOverview-DFbEanaA.js +1 -0
- package/dist/frontend/assets/OrmWorker-Bg_aQv9q.js +1 -0
- package/dist/frontend/assets/Playground-DUT2F_nl.js +1 -0
- package/dist/frontend/assets/{ProbesLiveGraph-D94e1c6i.js → ProbesLiveGraph-ClLUCJ9O.js} +1 -1
- package/dist/frontend/assets/Profile-CXDaUmnR.js +2 -0
- package/dist/frontend/assets/{ProfileFields-dt4VO6bY.js → ProfileFields-KZ59Eqrf.js} +1 -1
- package/dist/frontend/assets/Progress-Jl9Xrd62.js +1 -0
- package/dist/frontend/assets/{ProtocoleLiveGraph-UmOlL04Y.js → ProtocoleLiveGraph-Cmbh6-Gx.js} +1 -1
- package/dist/frontend/assets/RealtimeConsole-DLc-QQGy.js +1 -0
- package/dist/frontend/assets/{RingProgress-QfUZ9GPc.js → RingProgress-xUUyRmUq.js} +1 -1
- package/dist/frontend/assets/Roadmap-aBVMLJAM.js +1 -0
- package/dist/frontend/assets/RoleSwitch-B1hL5p-3.js +1 -0
- package/dist/frontend/assets/Roles-C4kmzA_U.js +1 -0
- package/dist/frontend/assets/{RoutesView-CXZ8Aoj_.js → RoutesView-PqukWFCc.js} +1 -1
- package/dist/frontend/assets/Runtime-xIs1NAq2.js +1 -0
- package/dist/frontend/assets/Sessions-taAwHrtE.js +1 -0
- package/dist/frontend/assets/Skeleton-BoQtbCT4.js +1 -0
- package/dist/frontend/assets/{Slider-BbJH89K3.js → Slider-CYJI87Vt.js} +1 -1
- package/dist/frontend/assets/StoresView-BEcp800X.js +1 -0
- package/dist/frontend/assets/System-DEc_-VAA.js +1 -0
- package/dist/frontend/assets/TagsInput-Buuy4DOA.js +1 -0
- package/dist/frontend/assets/{Textarea-nmioafgL.js → Textarea-9yD_OCzE.js} +1 -1
- package/dist/frontend/assets/Timeline-VZPUF9dn.js +1 -0
- package/dist/frontend/assets/TraceView-Rt3ss0Bi.js +1 -0
- package/dist/frontend/assets/Twin-DuE4P1SA.js +1 -0
- package/dist/frontend/assets/TwinMap-CiX43ENP.js +19 -0
- package/dist/frontend/assets/UserProfile-C0FcE-Gd.js +1 -0
- package/dist/frontend/assets/Users-DI9oLxxe.js +1 -0
- package/dist/frontend/assets/VectorStoresPreview-BJq6Wcjl.js +1 -0
- package/dist/frontend/assets/Webhooks-3TsZ9kVA.js +1 -0
- package/dist/frontend/assets/Workspace-0CrIYPNk.js +1 -0
- package/dist/frontend/assets/{aiPreviewParts-Dj8Ljhnn.js → aiPreviewParts-Bwx9e8dx.js} +1 -1
- package/dist/frontend/assets/{apiKeysModel-CJevQpt8.js → apiKeysModel-Dopci2hd.js} +1 -1
- package/dist/frontend/assets/{auditFormat-jZN46_5Z.js → auditFormat-r1_77PDm.js} +1 -1
- package/dist/frontend/assets/{auditModel-Cz-3Rzik.js → auditModel-DUpx7JmY.js} +1 -1
- package/dist/frontend/assets/configEdit-BhbQlj6k.js +1 -0
- package/dist/frontend/assets/{eventFlow-wonKPF8V.js → eventFlow-LpuRUXXg.js} +1 -1
- package/dist/frontend/assets/{health-7sMajsQI.js → health-CyGA2Jii.js} +1 -1
- package/dist/frontend/assets/{hooks-DL-ZhyoD.js → hooks-C5izbcnh.js} +1 -1
- package/dist/frontend/assets/index-Bxrb_NNJ.js +28 -0
- package/dist/frontend/assets/index-x3d2S3sp.css +1 -0
- package/dist/frontend/assets/{logFormat-Bk36BvWi.js → logFormat-DYk42zSe.js} +1 -1
- package/dist/frontend/assets/{ormConnectorInsights-C7902tKC.js → ormConnectorInsights-BHrwQYA6.js} +1 -1
- package/dist/frontend/assets/{profileVisuals-Dz_Mb4iH.js → profileVisuals-hNLkIVoO.js} +1 -1
- package/dist/frontend/assets/stores-CsHxacRb.js +1 -0
- package/dist/frontend/assets/ui-NqIPktVY.js +323 -0
- package/dist/frontend/assets/{ui-DLioOiRN.css → ui-bSyOAvy0.css} +1 -1
- package/dist/frontend/assets/useBlockSource-m6WHsmzP.js +1 -0
- package/dist/frontend/assets/{useSocketLiveData-CmMYezqs.js → useSocketLiveData-BZjzaQMC.js} +1 -1
- package/dist/frontend/assets/{usersFormat-EIUaaMSm.js → usersFormat-aVUkQnOe.js} +1 -1
- package/dist/frontend/index.html +16 -16
- package/package.json +19 -19
- package/dist/frontend/assets/Accordion-CpfkavHk.js +0 -1
- package/dist/frontend/assets/AgentsPreview-3-5OZZ37.js +0 -12
- package/dist/frontend/assets/ApiKeys-CtLUNnl0.js +0 -2
- package/dist/frontend/assets/Audit-B2FUlGqs.js +0 -1
- package/dist/frontend/assets/Breadcrumbs-Ct1K_zqN.js +0 -1
- package/dist/frontend/assets/BrickStoreChip-D1KnkCmc.js +0 -1
- package/dist/frontend/assets/Chat-DvhzrpTt.js +0 -1
- package/dist/frontend/assets/Chip-CzEO4TVP.js +0 -1
- package/dist/frontend/assets/Cluster-4QkYbMbl.js +0 -1
- package/dist/frontend/assets/ConfigPage-DSazrv0h.js +0 -1
- package/dist/frontend/assets/ConnectorCard-GiShQva6.js +0 -11
- package/dist/frontend/assets/Create-C-ZVQRdt.js +0 -2
- package/dist/frontend/assets/DashboardSupervision-deg6L71S.js +0 -1
- package/dist/frontend/assets/Database-BmezwQtb.js +0 -1
- package/dist/frontend/assets/Documentation-CmNFuMcO.js +0 -1
- package/dist/frontend/assets/Firewall-Htuj9USB.js +0 -1
- package/dist/frontend/assets/GatewayPreview-Bl4ilFGn.js +0 -1
- package/dist/frontend/assets/IconArrowsExchange-BP7tLAV_.js +0 -1
- package/dist/frontend/assets/IconBan-DF34c4Ac.js +0 -1
- package/dist/frontend/assets/IconCircuitResistor-BiMeCX9K.js +0 -1
- package/dist/frontend/assets/IconPlayerPlay-DhqKbQEW.js +0 -1
- package/dist/frontend/assets/IconPlus-DPedeEtY.js +0 -1
- package/dist/frontend/assets/KnowledgePreview-DXIniW1c.js +0 -1
- package/dist/frontend/assets/List-B4NvgWxC.js +0 -1
- package/dist/frontend/assets/LlmProvidersPreview-C6K_4T7y.js +0 -1
- package/dist/frontend/assets/Logs-D4Lwm_D0.js +0 -1
- package/dist/frontend/assets/McpPreview-RM10Do9w.js +0 -1
- package/dist/frontend/assets/MemoryPreview-BIQuDHaJ.js +0 -1
- package/dist/frontend/assets/Migrations-Ct1DBgot.js +0 -3
- package/dist/frontend/assets/ModuleDetail-zR6tYvwc.js +0 -1
- package/dist/frontend/assets/Modules-yxw9R2M5.js +0 -1
- package/dist/frontend/assets/OrmConnector-CJZkJeNS.js +0 -1
- package/dist/frontend/assets/OrmEntity-PEj9Ff7K.js +0 -1
- package/dist/frontend/assets/OrmOverview-DETG6IpL.js +0 -1
- package/dist/frontend/assets/OrmWorker-8Etwr4fo.js +0 -1
- package/dist/frontend/assets/Playground-BWA7qAvx.js +0 -1
- package/dist/frontend/assets/Profile-D0U83sV_.js +0 -2
- package/dist/frontend/assets/Progress-COepY2v5.js +0 -1
- package/dist/frontend/assets/RealtimeConsole-CcZUTtHc.js +0 -1
- package/dist/frontend/assets/Roadmap-DrseUgGd.js +0 -1
- package/dist/frontend/assets/RoleSwitch-DZt4YgqK.js +0 -1
- package/dist/frontend/assets/Roles-Dhe0yW0U.js +0 -1
- package/dist/frontend/assets/Runtime-BAWsvDqI.js +0 -1
- package/dist/frontend/assets/Sessions-Dvi9WBmv.js +0 -1
- package/dist/frontend/assets/Skeleton-D4mSLrUF.js +0 -1
- package/dist/frontend/assets/StoresView-m9K9J-zE.js +0 -1
- package/dist/frontend/assets/System-DbcrHR18.js +0 -1
- package/dist/frontend/assets/TagsInput-DLA4PIhC.js +0 -1
- package/dist/frontend/assets/Timeline-ouAOSjY1.js +0 -1
- package/dist/frontend/assets/TraceView-Bvtoz8-Z.js +0 -1
- package/dist/frontend/assets/Twin-gbY-Ir8E.js +0 -1
- package/dist/frontend/assets/TwinMap-DCpZouug.js +0 -19
- package/dist/frontend/assets/UserProfile-BaPNh-G3.js +0 -1
- package/dist/frontend/assets/Users-DoSedUDm.js +0 -1
- package/dist/frontend/assets/VectorStoresPreview-BwYoGKio.js +0 -1
- package/dist/frontend/assets/Webhooks-Ck9n1qLs.js +0 -1
- package/dist/frontend/assets/Workspace-BZRv5E_W.js +0 -1
- package/dist/frontend/assets/configEdit-p1JESVv_.js +0 -1
- package/dist/frontend/assets/index-CA-mibvn.css +0 -1
- package/dist/frontend/assets/index-PhNQVa0x.js +0 -28
- package/dist/frontend/assets/stores-BPQ3jvDo.js +0 -1
- package/dist/frontend/assets/ui-B4vXT8-w.js +0 -323
- package/dist/frontend/assets/useBlockSource-DTNNrdmz.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fr as e,Ki as t,Si as n,Ui as r,Zi as i,ci as a,gi as o,ha as s,la as c,li as l,ma as u,oi as d,pa as f,ri as p,vi as m,ya as h}from"./ui-NqIPktVY.js";import{t as g}from"./Collapse-ctIxjH-g.js";var[_,v]=s(`Accordion component was not found in the tree`),[y,b]=s(`Accordion.Item component was not found in the tree`),x={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`},S=n(),C=a(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,chevron:o,icon:s,onClick:c,onKeyDown:l,children:u,disabled:h,mod:g,..._}=m(`AccordionControl`,null,e),{value:y}=b(),x=v(),C=x.isItemActive(y),w=typeof x.order==`number`,T=`h${x.order}`,E=(0,S.jsxs)(p,{...x.getStyles(`control`,{className:n,classNames:t,style:r,styles:i,variant:x.variant}),unstyled:x.unstyled,mod:[`accordion-control`,{active:C,"chevron-position":x.chevronPosition,disabled:h},g],onClick:e=>{c?.(e),x.onChange(y)},type:`button`,disabled:h,"aria-expanded":C,"aria-controls":x.getRegionId(y),id:x.getControlId(y),onKeyDown:f({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:x.loop,orientation:`vertical`,onKeyDown:l}),..._,children:[(0,S.jsx)(d,{component:`span`,mod:{rotate:!x.disableChevronRotation&&C,position:x.chevronPosition},...x.getStyles(`chevron`,{classNames:t,styles:i}),children:o||x.chevron}),(0,S.jsx)(`span`,{...x.getStyles(`label`,{classNames:t,styles:i}),children:u}),s&&(0,S.jsx)(d,{component:`span`,mod:{"chevron-position":x.chevronPosition},...x.getStyles(`icon`,{classNames:t,styles:i}),children:s})]});return w?(0,S.jsx)(T,{...x.getStyles(`itemTitle`,{classNames:t,styles:i}),children:E}):E});C.displayName=`@mantine/core/AccordionControl`,C.classes=x;var w=a(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,value:o,mod:s,...c}=m(`AccordionItem`,null,e),l=v();return(0,S.jsx)(y,{value:{value:o},children:(0,S.jsx)(d,{mod:[{active:l.isItemActive(o)},s],...l.getStyles(`item`,{className:n,classNames:t,styles:i,style:r,variant:l.variant}),...c})})});w.displayName=`@mantine/core/AccordionItem`,w.classes=x;var T=a(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,keepMounted:s,keepMountedMode:c,...l}=m(`AccordionPanel`,null,e),{value:u}=b(),d=v();return(0,S.jsx)(g,{...d.getStyles(`panel`,{className:n,classNames:t,style:r,styles:i}),expanded:d.isItemActive(u),transitionDuration:d.transitionDuration??200,role:`region`,id:d.getRegionId(u),"aria-labelledby":d.getControlId(u),keepMounted:s??d.keepMounted,keepMountedMode:c??d.keepMountedMode,...l,children:(0,S.jsx)(`div`,{...d.getStyles(`content`,{classNames:t,styles:i}),children:o})})});T.displayName=`@mantine/core/AccordionPanel`,T.classes=x;var E={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16,keepMountedMode:`activity`},D=r((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:h(n),"--accordion-radius":r===void 0?void 0:c(r)}})),O=l(n=>{let r=m(`Accordion`,E,n),{classNames:a,className:s,style:c,styles:l,unstyled:f,vars:p,children:h,multiple:g,value:v,defaultValue:y,onChange:b,id:C,loop:w,transitionDuration:T,disableChevronRotation:O,disableCollapse:k,chevronPosition:A,chevronSize:j,order:M,chevron:N,variant:P,radius:F,chevronIconSize:I,attributes:L,keepMounted:R,keepMountedMode:z,...B}=r,V=i(C),[H,U]=t({value:v,defaultValue:y,finalValue:g?[]:null,onChange:b}),W=e=>Array.isArray(H)?H.includes(e):e===H,G=e=>{if(!Array.isArray(H)&&k&&e===H)return;let t=Array.isArray(H)?H.includes(e)?H.filter(t=>t!==e):[...H,e]:e===H?null:e;U(t)},K=o({name:`Accordion`,classes:x,props:r,className:s,style:c,classNames:a,styles:l,unstyled:f,attributes:L,vars:p,varsResolver:D});return(0,S.jsx)(_,{value:{isItemActive:W,onChange:G,getControlId:u(`${V}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:u(`${V}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:N===null?null:N||(0,S.jsx)(e,{size:I}),transitionDuration:T,disableChevronRotation:O,chevronPosition:A,order:M,loop:w,getStyles:K,variant:P,unstyled:f,keepMounted:R,keepMountedMode:z},children:(0,S.jsx)(d,{...K(`root`),id:V,...B,variant:P,"data-accordion":!0,children:h})})});O.classes=x,O.varsResolver=D,O.displayName=`@mantine/core/Accordion`,O.Item=w,O.Panel=T,O.Control=C,O.Chevron=e;export{O as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{Si as t,fn as n,vn as r,wa as i,y as a}from"./ui-NqIPktVY.js";import{$ as o,Et as s,P as c}from"./index-Bxrb_NNJ.js";import{t as l}from"./IconDeviceDesktop-OvxYj-tE.js";import{t as u}from"./IconPlayerPlay-XEjU8Vve.js";import{c as d,n as f}from"./useSocketLiveData-BZjzaQMC.js";var p=r(`outline`,`arrow-back-up`,`ArrowBackUp`,[[`path`,{d:`M9 14l-4 -4l4 -4`,key:`svg-0`}],[`path`,{d:`M5 10h11a4 4 0 1 1 0 8h-1`,key:`svg-1`}]]),m=r(`outline`,`route-square`,`RouteSquare`,[[`path`,{d:`M3 17h4v4h-4l0 -4`,key:`svg-0`}],[`path`,{d:`M17 3h4v4h-4l0 -4`,key:`svg-1`}],[`path`,{d:`M11 19h5.5a3.5 3.5 0 0 0 0 -7h-8a3.5 3.5 0 0 1 0 -7h4.5`,key:`svg-2`}]]),h=e(i(),1),g=t(),_=[{id:`request`,data:{label:`client.request()`,sub:"frame JSON-RPC avec `id` · attend une réponse",icon:(0,g.jsx)(l,{size:20}),color:`blue`}},{id:`welcome`,data:{label:`realtime:welcome`,sub:`Registre annoncé UNE fois au handshake · découvrabilité`,icon:(0,g.jsx)(n,{size:20}),color:`cyan`}},{id:`resolve`,data:{label:`Résolution de méthode`,sub:`actions.get(method) · inconnue → -32601 method not found`,icon:(0,g.jsx)(m,{size:20}),color:`cyan`}},{id:`authz`,data:{label:`beforeDispatch`,sub:`Zero Trust · peer.roles (server-derived) · refus → -32001`,icon:(0,g.jsx)(c,{size:20}),color:`red`}},{id:`handler`,data:{label:`Handler`,sub:`Logique métier · valide SES params (-32602) · throw = -32603 générique`,icon:(0,g.jsx)(u,{size:20}),color:`indigo`,emphasis:!0}},{id:`audit`,data:{label:`onFrameAudit`,sub:`Seam d'audit sur REJET : invalid · denied · method_not_found · internal_error`,icon:(0,g.jsx)(o,{size:20}),color:`grape`}},{id:`result`,data:{label:`Result | Error`,sub:"Frame de retour avec même `id` · result ou error",icon:(0,g.jsx)(p,{size:20}),color:`teal`}}],v=[{source:`request`,target:`resolve`,label:`method`,color:`blue`},{source:`welcome`,target:`resolve`,label:`registre (1× au handshake)`,color:`cyan`,dashed:!0,animated:!1},{source:`resolve`,target:`authz`,label:`méthode connue`,color:`cyan`},{source:`authz`,target:`handler`,label:`autorisé`,color:`red`},{source:`handler`,target:`result`,label:`result`,color:`indigo`},{source:`result`,target:`request`,label:`même id`,color:`teal`},{source:`resolve`,target:`audit`,label:`-32601`,color:`grape`,dashed:!0},{source:`authz`,target:`audit`,label:`-32001 · realtime:denied`,color:`grape`,dashed:!0},{source:`handler`,target:`audit`,label:`throw → -32603`,color:`grape`,dashed:!0},{source:`audit`,target:`result`,label:`error`,color:`grape`,dashed:!0}],y=s(({height:e})=>{let t=d(),n=(0,h.useMemo)(()=>f(t),[t]);return(0,g.jsx)(a,{nodes:_,edges:v,dir:`TB`,height:e,ariaLabel:`Pipeline d'une action RPC — temps réel actif`,liveNodeData:n})});function b({live:e=!1,height:t=600}){return e?(0,g.jsx)(y,{height:t}):(0,g.jsx)(a,{nodes:_,edges:v,dir:`TB`,height:t,ariaLabel:`Pipeline d'une action RPC (statique)`})}export{b as ActionsLiveGraph,b as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{J as t,Jr as n,Nr as r,Pr as i,Si as a,Y as o,_ as s,at as c,br as l,cn as u,gr as d,n as f,nt as p,ot as m,pn as h,pr as g,rr as _,vn as v,wa as y,xr as b,yr as x}from"./ui-NqIPktVY.js";import{t as S}from"./Timeline-VZPUF9dn.js";import{t as C}from"./IconBrain-CQHG8g62.js";import{t as w}from"./IconHandStop-B68ZZTGv.js";import{t as T}from"./IconPlayerPlay-XEjU8Vve.js";import{t as E}from"./IconPlayerStop-Gw6QwdEs.js";import{z as D}from"./index-Bxrb_NNJ.js";import{t as O}from"./IconTool-Dp0ccZSt.js";import{a as k,i as A,o as j,t as M}from"./aiPreviewParts-Bwx9e8dx.js";var N=v(`outline`,`message`,`Message`,[[`path`,{d:`M8 9h8`,key:`svg-0`}],[`path`,{d:`M8 13h6`,key:`svg-1`}],[`path`,{d:`M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12`,key:`svg-2`}]]),P=e(y(),1),F=a(),I=[{key:`name`,header:`Agent`,value:e=>e.name,render:e=>(0,F.jsxs)(_,{gap:0,children:[(0,F.jsx)(r,{size:`sm`,fw:600,ff:`monospace`,children:e.name}),(0,F.jsx)(r,{size:`xs`,c:`dimmed`,children:e.description})]})},{key:`model`,header:`Modèle`,value:e=>e.model},{key:`tools`,header:`Outils`,value:e=>e.tools.join(` `),render:e=>(0,F.jsx)(n,{gap:4,children:e.tools.map(e=>(0,F.jsx)(b,{variant:`default`,size:`xs`,tt:`none`,children:e},e))})},{key:`zone`,header:`Zone`,value:e=>e.zone,render:e=>(0,F.jsx)(k,{zone:e.zone})},{key:`runs24h`,header:`Exécutions 24 h`,align:`right`,value:e=>e.runs24h,render:e=>j(e.runs24h)},{key:`successRate`,header:`Succès`,align:`right`,value:e=>e.successRate,render:e=>`${j(e.successRate,1)} %`},{key:`breaker`,header:`Disjoncteur`,value:e=>e.breaker,render:e=>(0,F.jsx)(M,{state:e.breaker})}],L={started:{icon:(0,F.jsx)(T,{size:12}),label:`Démarrage`,color:`blue`},thinking:{icon:(0,F.jsx)(C,{size:12}),label:`Réflexion`,color:`grape`},tool_call:{icon:(0,F.jsx)(O,{size:12}),label:`Appel d'outil`,color:`brand`},tool_result:{icon:(0,F.jsx)(u,{size:12}),label:`Résultat`,color:`teal`},approval:{icon:(0,F.jsx)(w,{size:12}),label:`Approbation`,color:`orange`},token:{icon:(0,F.jsx)(N,{size:12}),label:`Réponse`,color:`blue`},completed:{icon:(0,F.jsx)(h,{size:12}),label:`Terminé`,color:`teal`}},R=45;function z({event:e,text:t}){return e.type===`token`?(0,F.jsx)(r,{size:`sm`,children:t??e.content}):(0,F.jsxs)(_,{gap:4,children:[e.content&&(0,F.jsx)(r,{size:`sm`,children:e.content}),e.tool&&(0,F.jsx)(d,{children:e.tool}),e.data!==void 0&&(0,F.jsx)(s,{value:e.data,maxHeight:140})]})}function B(){let[e,a]=(0,P.useState)(0),[s,u]=(0,P.useState)(!1),[h,_]=(0,P.useState)(0),v=(0,P.useRef)(null),y=(m.find(e=>e.type===`token`)?.content??``).split(` `);(0,P.useEffect)(()=>{if(s){if(m[e-1]?.type===`token`&&h<y.length)v.current=setTimeout(()=>_(e=>e+1),R);else if(e<m.length){let t=m[e];v.current=setTimeout(()=>a(e=>e+1),t.afterMs)}else v.current=setTimeout(()=>u(!1),0);return()=>{v.current!==null&&clearTimeout(v.current)}}},[s,e,h,y.length]);let C=()=>{a(0),_(0),u(!0)},w=c.reduce((e,t)=>e+t.runs24h,0),O=c.reduce((e,t)=>e+t.runs24h*t.avgCostEur,0),k=c.filter(e=>e.breaker!==`closed`);return(0,F.jsxs)(p,{title:`Agents`,subtitle:`Des services du conteneur, avec des outils typés, une zone de confiance et un disjoncteur.`,icon:(0,F.jsx)(D,{size:22}),children:[(0,F.jsx)(A,{module:`@nodefony/ai`,contract:`IAgent / ITool`}),(0,F.jsxs)(g,{children:[(0,F.jsx)(t,{label:`Agents`,hint:`déclarés comme services injectables`,children:c.length}),(0,F.jsx)(t,{label:`Exécutions 24 h`,hint:`toutes zones confondues`,children:j(w)}),(0,F.jsxs)(t,{label:`Coût 24 h`,hint:`somme des usages modèle facturés`,children:[j(O,2),` €`]}),(0,F.jsx)(t,{label:`Disjoncteurs déclenchés`,hint:`un agent qui dérive (boucle, coût, erreurs) est coupé automatiquement`,children:k.length})]}),k.map(e=>(0,F.jsx)(i,{color:e.breaker===`open`?`red`:`yellow`,variant:`light`,title:`${e.name} — disjoncteur ${e.breaker===`open`?`ouvert`:`semi-ouvert`}`,children:e.breakerReason},e.name)),(0,F.jsx)(f,{mode:`client`,data:c,columns:I,getRowId:e=>e.name,searchable:!1,height:330}),(0,F.jsxs)(x,{withBorder:!0,radius:`md`,padding:`md`,children:[(0,F.jsxs)(n,{justify:`space-between`,mb:`sm`,children:[(0,F.jsxs)(n,{gap:6,children:[(0,F.jsx)(r,{fw:600,children:`Rejouer une exécution`}),(0,F.jsx)(r,{size:`sm`,c:`dimmed`,ff:`monospace`,children:`assistant-support · s-7f3a21`}),(0,F.jsx)(o,{title:`Ce que le flux d'un agent transporte`,summary:`Chaque étape est un événement poussé sur le canal temps réel de la session : réflexion, appel d'outil, résultat, approbation, jetons, fin.`,sections:[{label:`Approbation`,body:`L'outil create_ticket engage un remboursement : l'agent s'arrête et attend qu'un humain valide. C'est la validation humaine que l'AI Act exige pour une action à fort impact.`},{label:`Corrélation`,body:`Le requestId de la requête suit chaque appel de modèle et d'outil jusqu'au journal d'audit.`}]})]}),s?(0,F.jsx)(l,{variant:`light`,color:`red`,leftSection:(0,F.jsx)(E,{size:16}),onClick:()=>u(!1),children:`Interrompre`}):(0,F.jsx)(l,{leftSection:(0,F.jsx)(T,{size:16}),onClick:C,children:e===0?`Lancer`:`Rejouer`})]}),e===0?(0,F.jsx)(r,{size:`sm`,c:`dimmed`,children:`Lancez le rejeu pour voir l'exécution arriver événement par événement.`}):(0,F.jsx)(S,{active:e-1,bulletSize:22,lineWidth:2,"aria-live":`polite`,children:m.slice(0,e).map(e=>{let t=L[e.type];return(0,F.jsx)(S.Item,{bullet:t.icon,color:t.color,title:(0,F.jsx)(r,{size:`xs`,c:`dimmed`,tt:`uppercase`,fw:600,children:t.label}),children:(0,F.jsx)(z,{event:e,...e.type===`token`?{text:y.slice(0,h).join(` `)}:{}})},`${e.type}:${e.tool??``}:${e.afterMs}`)})})]}),(0,F.jsxs)(x,{withBorder:!0,radius:`md`,padding:`md`,children:[(0,F.jsxs)(n,{gap:6,mb:`sm`,children:[(0,F.jsx)(r,{fw:600,children:`Déclarer un agent`}),(0,F.jsx)(b,{variant:`light`,color:`violet`,size:`sm`,children:`API envisagée`})]}),(0,F.jsx)(d,{block:!0,children:`@Agent({ name: "assistant-support", zone: "internal", model: "mistral" })
|
|
2
|
+
export class SupportAgent {
|
|
3
|
+
constructor(@Inject() private readonly orders: OrderService) {}
|
|
4
|
+
|
|
5
|
+
@Tool({ description: "Statut d'une commande", input: z.object({ orderId: z.string() }) })
|
|
6
|
+
getOrderStatus({ orderId }: { orderId: string }) {
|
|
7
|
+
return this.orders.status(orderId);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@Tool({ description: "Ouvre un ticket", approval: "required" })
|
|
11
|
+
createTicket(input: TicketInput) { /* … */ }
|
|
12
|
+
}`})]})]})}export{B as AgentsPreview};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{$n as t,Er as n,J as r,Jr as i,Kt as a,Nr as o,Pr as s,Qn as c,Si as l,Xt as u,Y as d,Yt as f,ar as p,br as m,cn as h,er as g,gn as _,gr as v,hr as y,ir as b,n as x,nn as S,nt as ee,oi as C,pr as w,rn as T,rr as E,t as D,tt as O,ur as k,vn as A,wa as j,xr as M,yr as N}from"./ui-NqIPktVY.js";import{A as P,C as F,Et as I,N as te,P as ne,S as re,X as L,b as ie,z as R}from"./index-Bxrb_NNJ.js";import{t as ae}from"./IconPlus-Coq8xjXa.js";import{t as oe}from"./IconHelpCircle-TIagVTB7.js";import{t as z}from"./IconBan-Ci1EWASP.js";import{t as se}from"./IconCircleCheck-DkVi0NqA.js";import{D as ce,c as le,o as ue,r as de,x as fe}from"./stores-CsHxacRb.js";import{a as pe,c as me,d as B,f as he,i as ge,l as V,m as _e,n as ve,o as H,p as U,r as ye,s as be,t as xe,u as W}from"./apiKeysModel-Dopci2hd.js";import{t as Se}from"./TagsInput-Buuy4DOA.js";import{a as Ce,n as G,s as we,t as Te}from"./pageQuery-CeNWND3J.js";import{t as K}from"./List-BtRdrxnk.js";import{t as Ee}from"./IconTerminal2-Cu7EnrUO.js";import{t as De}from"./BrickStoreChip-BLiTtfPX.js";var Oe=A(`outline`,`clock-bolt`,`ClockBolt`,[[`path`,{d:`M20.984 12.53a9 9 0 1 0 -7.552 8.355`,key:`svg-0`}],[`path`,{d:`M12 7v5l3 3`,key:`svg-1`}],[`path`,{d:`M19 16l-2 3h4l-2 3`,key:`svg-2`}]]),ke=A(`outline`,`list-check`,`ListCheck`,[[`path`,{d:`M3.5 5.5l1.5 1.5l2.5 -2.5`,key:`svg-0`}],[`path`,{d:`M3.5 11.5l1.5 1.5l2.5 -2.5`,key:`svg-1`}],[`path`,{d:`M3.5 17.5l1.5 1.5l2.5 -2.5`,key:`svg-2`}],[`path`,{d:`M11 6l9 0`,key:`svg-3`}],[`path`,{d:`M11 12l9 0`,key:`svg-4`}],[`path`,{d:`M11 18l9 0`,key:`svg-5`}]]),q=e(j(),1),J=l(),Y={active:{color:`teal`,label:`Active`,Icon:se},expired:{color:`orange`,label:`Expirée`,Icon:T},revoked:{color:`red`,label:`Révoquée`,Icon:z}};function X({status:e,size:t=`sm`}){let n=Y[e];return(0,J.jsx)(M,{variant:e===`active`?`light`:`outline`,color:n.color,size:t,leftSection:(0,J.jsx)(n.Icon,{size:12}),style:{textTransform:`none`},children:n.label})}function Ae({scopes:e}){return e.length===0?(0,J.jsx)(o,{size:`sm`,c:`dimmed`,fs:`italic`,children:`tous (droits du porteur)`}):(0,J.jsx)(i,{gap:4,wrap:`wrap`,children:e.map(e=>(0,J.jsx)(M,{variant:`outline`,color:`grape`,size:`sm`,style:{textTransform:`none`},children:e},e))})}function Z({subjectId:e,subjectType:t}){return(0,J.jsx)(M,{variant:`light`,color:t===`service`?`cyan`:`blue`,leftSection:t===`service`?(0,J.jsx)(R,{size:12}):(0,J.jsx)(P,{size:12}),style:{textTransform:`none`},children:e})}var je={subjectId:{label:`Porteur`,hint:`Identifiant EXACT du porteur (colonne indexée) — pas une recherche.`,placeholder:`identifiant exact`},status:{label:`État`,hint:`Active = utilisable. Expirée = au-delà de son échéance. Révoquée = désactivée à la main. Les trois partitionnent : une clé est dans exactement une case.`,values:{active:`Actives`,expired:`Expirées`,revoked:`Révoquées`}}};function Q({k:e,children:t}){return(0,J.jsxs)(i,{justify:`space-between`,wrap:`nowrap`,gap:`xl`,align:`flex-start`,children:[(0,J.jsx)(o,{size:`sm`,c:`dimmed`,style:{flexShrink:0},children:e}),(0,J.jsx)(C,{style:{textAlign:`right`,minWidth:0},children:t})]})}var Me=I(function({keys:e,showSubject:t,filters:n,onFiltersChange:r,reloadKey:a=0,onRevoke:c,onBulkRevoke:l,revokingId:f}){let p=le(),[h,g]=(0,q.useState)(null),_=t?p.admin.pageCapabilities(xe):null,{signal:y,filters:b}=ie(n),S=(0,q.useMemo)(Te,[a]),ee=(0,q.useCallback)(async e=>{try{return await Ce(S,e,b,async e=>{let t=await p.api.getAbsolute(`${xe}?${e}`);return{...t,items:t.keys??[]}})}catch(e){throw Error(V(e),{cause:e})}},[p,b,S]),C=(0,q.useMemo)(()=>new Set(_?.sortable??[]),[_?.sortable]),w=(0,q.useCallback)(e=>!t||C.has(e),[t,C]),T=(0,q.useMemo)(()=>{let e=[{key:`name`,header:`Nom`,sortable:w(`name`),value:e=>e.name,render:e=>(0,J.jsx)(o,{fw:600,size:`sm`,children:e.name}),size:170},{key:`prefix`,header:`Préfixe`,value:e=>e.prefix??``,render:e=>e.prefix?(0,J.jsxs)(v,{children:[e.prefix,`…`]}):(0,J.jsx)(o,{size:`sm`,c:`dimmed`,children:`—`}),size:150}];return t&&e.push({key:`subjectId`,header:`Porteur`,sortable:w(`subjectId`),value:e=>e.subjectId,render:e=>(0,J.jsx)(Z,{subjectId:e.subjectId,subjectType:e.subjectType}),size:170}),e.push({key:`scopes`,header:`Scopes`,value:e=>e.scopes.join(`, `),render:e=>(0,J.jsx)(Ae,{scopes:e.scopes}),size:200},{key:`status`,header:`Statut`,filterable:!t,filterType:`select`,value:e=>U(e),render:e=>(0,J.jsx)(X,{status:U(e)}),size:120},{key:`lastUsedAt`,header:`Dernière utilisation`,sortable:w(`lastUsedAt`),value:e=>e.lastUsedAt??0,render:e=>(0,J.jsx)(o,{size:`sm`,c:e.lastUsedAt===null?`dimmed`:void 0,children:he(e.lastUsedAt)}),size:160},{key:`expiresAt`,header:`Expiration`,sortable:w(`expiresAt`),value:e=>e.expiresAt??2**53-1,render:e=>(0,J.jsx)(o,{size:`sm`,c:e.expiresAt===null?`dimmed`:void 0,children:B(e.expiresAt)}),size:150}),e},[w,t]),O=h?U(h):null;return(0,J.jsxs)(E,{gap:`md`,children:[(0,J.jsxs)(i,{gap:`xs`,children:[(0,J.jsx)(o,{size:`sm`,c:`dimmed`,children:t?`Toutes les clés, tous porteurs. Clic sur une ligne pour le détail.`:`${e.length} clé(s). Clic sur une ligne pour le détail.`}),(0,J.jsx)(d,{title:`Clés API personnelles (PAT)`,version:ve,summary:`Un jeton d'accès personnel (Personal Access Token) authentifie un script/une machine avec les droits frais de son porteur. Présenté en en-tête Authorization: Bearer.`,sections:[{label:`Sécurité`,body:`Seul le hash (sha256) du secret est stocké : le secret en clair n'est montré qu'à la création, jamais ré-affiché. Révocable à tout moment ; un préfixe public permet de la repérer sans révéler le secret.`},{label:`Statut`,body:`« Active » = utilisable. « Expirée » = au-delà de sa date (rejetée). « Révoquée » = désactivée manuellement (conservée un temps pour l'audit).`},{label:`Scopes`,body:`Capacités accordées (sous-ensemble des droits du porteur). Aucun scope = la clé porte tous les droits frais du porteur.`}]})]}),!t&&e.length===0&&(0,J.jsx)(s,{variant:`light`,color:`gray`,icon:(0,J.jsx)(L,{size:18}),title:`Aucune clé`,children:`Vous n'avez aucune clé API. Créez-en une avec « Nouvelle clé ».`}),t&&(0,J.jsx)(D,{spec:_?.filters??null,value:n,onChange:r,labels:je}),(0,J.jsx)(x,{...t?{mode:`server`,loader:ee}:{mode:`client`,data:e},columns:T,getRowId:e=>e.id,onRowClick:e=>g(e),dimRow:e=>U(e)!==`active`,initialSort:w(`name`)?{key:`name`,dir:`asc`}:void 0,searchable:t?_?.search??!1:!0,searchPlaceholder:`Rechercher (nom, préfixe, porteur, scope…)`,resetPageSignal:y,pageSize:25,persist:{key:t?`studio.apikeys.admin`:`studio.apikeys.mine`,storage:`session`},emptyMessage:`Aucune clé ne correspond.`,selectable:l!==void 0,renderBulkActions:l?(e,t)=>{let n=e.filter(e=>U(e)===`active`);return(0,J.jsxs)(m,{color:`red`,size:`xs`,variant:`light`,leftSection:(0,J.jsx)(z,{size:14}),disabled:n.length===0,onClick:()=>l(n,t),children:[`Révoquer `,n.length,` clé`,n.length>1?`s`:``]})}:void 0}),(0,J.jsx)(k,{opened:h!==null,onClose:()=>g(null),title:h?(0,J.jsxs)(i,{gap:`xs`,children:[(0,J.jsxs)(o,{fw:700,children:[`Clé « `,h.name,` »`]}),(0,J.jsx)(X,{status:U(h)})]}):``,centered:!0,size:`lg`,children:h&&(0,J.jsxs)(E,{gap:`sm`,children:[(0,J.jsx)(Q,{k:`Identifiant`,children:(0,J.jsx)(v,{children:h.id})}),(0,J.jsx)(Q,{k:`Préfixe public`,children:h.prefix?(0,J.jsxs)(v,{children:[h.prefix,`…`]}):(0,J.jsx)(o,{size:`sm`,c:`dimmed`,children:`—`})}),t&&(0,J.jsx)(Q,{k:`Porteur`,children:(0,J.jsx)(Z,{subjectId:h.subjectId,subjectType:h.subjectType})}),h.tenantId&&(0,J.jsx)(Q,{k:`Tenant`,children:(0,J.jsx)(v,{children:h.tenantId})}),(0,J.jsx)(Q,{k:`Scopes`,children:(0,J.jsx)(Ae,{scopes:h.scopes})}),(0,J.jsx)(Q,{k:`Créée le`,children:(0,J.jsx)(o,{size:`sm`,children:W(h.createdAt)})}),(0,J.jsx)(Q,{k:`Expiration`,children:(0,J.jsx)(o,{size:`sm`,children:h.expiresAt===null?`Sans expiration`:`${B(h.expiresAt)} (${W(h.expiresAt)})`})}),(0,J.jsx)(Q,{k:`Dernière utilisation`,children:(0,J.jsx)(o,{size:`sm`,children:h.lastUsedAt===null?`Jamais utilisée`:`${he(h.lastUsedAt)} (${W(h.lastUsedAt)})`})}),h.revokedAt!==null&&(0,J.jsx)(Q,{k:`Révoquée le`,children:(0,J.jsx)(o,{size:`sm`,children:W(h.revokedAt)})}),(0,J.jsx)(s,{variant:`light`,color:`gray`,icon:(0,J.jsx)(u,{size:16}),mt:`xs`,children:(0,J.jsxs)(o,{size:`xs`,children:[`Le secret n'est pas affichable : seul son empreinte (sha256) est stockée. `,`Révoquer`,` une clé est immédiat et définitif — un script qui l'utilise sera rejeté (401).`]})}),O!==`revoked`&&(0,J.jsx)(i,{justify:`flex-end`,mt:`xs`,children:(0,J.jsx)(m,{color:`red`,variant:`light`,leftSection:(0,J.jsx)(z,{size:16}),loading:f===h.id,onClick:()=>{let e=h;g(null),c(e)},children:`Révoquer cette clé`})})]})})]})}),Ne=[{value:`30`,label:`30 jours`},{value:`60`,label:`60 jours`},{value:`90`,label:`90 jours`},{value:`365`,label:`1 an`},{value:`null`,label:`Sans expiration`}];function Pe(e){let t=e.defaultExpiryDays;if(t===null)return`null`;let n=String(t);return Ne.some(e=>e.value===n)?n:`90`}function Fe({opened:e,onClose:r,capabilities:a,onCreated:c}){let l=le(),[u,d]=(0,q.useState)(``),[f,p]=(0,q.useState)([]),[g,x]=(0,q.useState)(()=>Pe(a)),[ee,w]=(0,q.useState)(!1),[T,D]=(0,q.useState)(null),[O,A]=(0,q.useState)(null),j=(0,q.useMemo)(()=>{let e=new Map,t=t=>{let n=t.indexOf(`:`),r=n===-1?t:t.slice(0,n),i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(t)};for(let e of a.declaredScopes??[])for(let n of e.scopes)t(n);for(let e of a.allowedScopes??[])t(e);return[...e.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({api:e,scopes:[...t].sort()}))},[a.declaredScopes,a.allowedScopes]),M=(0,q.useMemo)(()=>j.flatMap(e=>e.scopes),[j]),N=M.length>0,P=a.allowedScopes===null;function F(){d(``),p([]),x(Pe(a)),D(null),A(null),w(!1)}function I(){let e=O!==null;F(),r(),e&&c()}async function te(){if(D(null),u.trim().length===0)D(`Donnez un nom à la clé (ex. « CI deploy », « script backup »).`);else{w(!0);try{let e={name:u.trim(),expiresInDays:g===`null`?null:Number(g)};f.length>0&&(e.scopes=f);let t=await l.api.postAbsolute(H,e);A(t)}catch(e){D(V(e))}finally{w(!1)}}}return(0,J.jsx)(k,{opened:e,onClose:I,title:(0,J.jsxs)(i,{gap:`xs`,children:[(0,J.jsx)(L,{size:18}),(0,J.jsx)(o,{fw:700,children:O?`Clé créée — copiez le secret`:`Nouvelle clé API`})]}),centered:!0,size:`lg`,closeOnClickOutside:O===null,children:O===null?(0,J.jsxs)(E,{gap:`md`,children:[(0,J.jsx)(C,{mih:44,children:T&&(0,J.jsx)(s,{role:`alert`,variant:`light`,color:`red`,icon:(0,J.jsx)(_,{size:16}),children:T})}),(0,J.jsx)(t,{label:`Nom`,description:`Un libellé pour reconnaître la clé (ne fait pas partie du secret).`,placeholder:`CI deploy`,required:!0,value:u,maxLength:100,onChange:e=>{d(e.currentTarget.value),T&&D(null)},"data-autofocus":!0}),N?(0,J.jsxs)(E,{gap:`sm`,children:[(0,J.jsx)(n.Group,{label:`Scopes`,description:`Capacités accordées (sous-ensemble des droits du porteur), découvertes depuis les routes du serveur.`,value:f.filter(e=>M.includes(e)),onChange:e=>p([...e,...f.filter(e=>!M.includes(e))]),children:(0,J.jsx)(E,{gap:`sm`,mt:`xs`,children:j.map(e=>(0,J.jsxs)(C,{children:[(0,J.jsx)(o,{size:`xs`,fw:600,c:`dimmed`,tt:`uppercase`,children:e.api}),(0,J.jsx)(i,{gap:`md`,mt:4,children:e.scopes.map(e=>(0,J.jsx)(n,{value:e,label:e},e))})]},e.api))})}),P&&(0,J.jsx)(Se,{label:`Scopes personnalisés (optionnel)`,description:`Mode libre : ajoutez un scope hors catalogue (toute valeur est acceptée).`,placeholder:`custom:scope…`,value:f.filter(e=>!M.includes(e)),onChange:e=>p([...f.filter(e=>M.includes(e)),...e]),clearable:!0})]}):(0,J.jsx)(Se,{label:`Scopes (optionnel)`,description:`Aucun catalogue défini : tout scope est accepté. Vide = la clé porte tous les droits du porteur.`,placeholder:`orders:read, billing:write…`,value:f,onChange:p,clearable:!0}),(0,J.jsx)(b,{label:`Expiration`,description:`Une clé qui expire limite l'impact d'une fuite (rotation).`,data:Ne,value:g,onChange:e=>e&&x(e),allowDeselect:!1,comboboxProps:{withinPortal:!0}}),(0,J.jsxs)(o,{size:`xs`,c:`dimmed`,children:[`Plafond : `,a.maxPerSubject,` clés actives par porteur. Préfixe public : `,(0,J.jsxs)(v,{children:[a.prefix,`_`]}),`.`]}),(0,J.jsxs)(i,{justify:`flex-end`,mt:`xs`,children:[(0,J.jsx)(m,{variant:`default`,onClick:I,children:`Annuler`}),(0,J.jsx)(m,{leftSection:(0,J.jsx)(L,{size:16}),loading:ee,onClick:()=>void te(),children:`Créer la clé`})]})]}):(0,J.jsxs)(E,{gap:`md`,children:[(0,J.jsxs)(s,{role:`alert`,variant:`light`,color:`orange`,icon:(0,J.jsx)(_,{size:16}),title:`Copiez ce secret maintenant`,children:[`Il ne sera `,(0,J.jsx)(`strong`,{children:`plus jamais affiché`}),`. Seule son empreinte est conservée côté serveur — il est impossible de le récupérer ensuite.`]}),(0,J.jsxs)(C,{children:[(0,J.jsxs)(o,{size:`sm`,c:`dimmed`,mb:4,children:[`Secret de « `,O.name,` »`]}),(0,J.jsxs)(i,{gap:`xs`,wrap:`nowrap`,align:`stretch`,style:{border:`1px solid var(--mantine-color-default-border)`,borderRadius:`var(--mantine-radius-sm)`,padding:`var(--mantine-spacing-xs)`},children:[(0,J.jsx)(v,{block:!0,style:{flex:1,wordBreak:`break-all`,background:`transparent`},children:O.token}),(0,J.jsx)(y,{value:O.token,timeout:2e3,children:({copied:e,copy:t})=>(0,J.jsx)(m,{color:e?`teal`:`brand`,variant:e?`light`:`filled`,leftSection:e?(0,J.jsx)(h,{size:16}):(0,J.jsx)(S,{size:16}),onClick:t,children:e?`Copié`:`Copier`})})]})]}),(0,J.jsx)(s,{variant:`light`,color:`gray`,icon:(0,J.jsx)(ne,{size:16}),children:(0,J.jsxs)(o,{size:`xs`,children:[`Utilisation : en-tête`,` `,(0,J.jsxs)(v,{children:[`Authorization: Bearer`,` `,O.prefix??`${a.prefix}_`,`…`]}),`. Révocable à tout moment depuis cette console.`]})}),(0,J.jsx)(i,{justify:`flex-end`,children:(0,J.jsx)(m,{leftSection:(0,J.jsx)(h,{size:16}),onClick:I,children:`J'ai copié le secret`})})]})})}function $({icon:e,title:t,children:n}){return(0,J.jsxs)(N,{withBorder:!0,radius:`md`,p:`lg`,children:[(0,J.jsxs)(i,{gap:`xs`,mb:`sm`,wrap:`nowrap`,children:[(0,J.jsx)(c,{variant:`light`,color:`brand`,children:e}),(0,J.jsx)(o,{fw:700,children:t})]}),n]})}function Ie({capabilities:e}){let t=e.prefix,n=e.defaultExpiryDays===null?`sans expiration`:`${e.defaultExpiryDays} jours`;return(0,J.jsxs)(E,{gap:`md`,children:[(0,J.jsxs)($,{icon:(0,J.jsx)(Ee,{size:18}),title:`Utiliser une clé`,children:[(0,J.jsxs)(o,{size:`sm`,c:`dimmed`,mb:`sm`,children:[`Présentez la clé dans l'en-tête `,(0,J.jsx)(v,{children:`Authorization`}),` de vos requêtes HTTP (schéma Bearer, RFC 6750) — comme un script, un job CI ou un agent le ferait :`]}),(0,J.jsx)(v,{block:!0,children:`curl https://votre-app/api/ressource \\
|
|
2
|
+
-H "Authorization: Bearer ${t}_xxxxxxxx………"`}),(0,J.jsxs)(o,{size:`xs`,c:`dimmed`,mt:`sm`,children:[`La clé authentifie avec les droits `,(0,J.jsx)(`em`,{children:`frais`}),` de son porteur (la base fait foi à chaque requête, pas un instantané figé).`]})]}),(0,J.jsxs)($,{icon:(0,J.jsx)(ke,{size:18}),title:`Scopes (capacités)`,children:[(0,J.jsx)(o,{size:`sm`,c:`dimmed`,children:`Les scopes restreignent ce qu'une clé peut faire — un sous-ensemble des droits du porteur (principe du moindre privilège).`}),(0,J.jsxs)(K,{size:`sm`,spacing:4,mt:`sm`,children:[(0,J.jsxs)(K.Item,{children:[(0,J.jsx)(`strong`,{children:`Aucun scope`}),` : la clé porte tous les droits du porteur.`]}),(0,J.jsxs)(K.Item,{children:[(0,J.jsx)(`strong`,{children:e.allowedScopes===null?`Catalogue libre`:`${e.allowedScopes.length} scope(s) au catalogue`}),` `,`:`,` `,e.allowedScopes===null?`tout scope non vide est accepté à la création.`:`seuls les scopes du catalogue sont acceptés.`]})]})]}),(0,J.jsx)($,{icon:(0,J.jsx)(Oe,{size:18}),title:`Expiration & plafond`,children:(0,J.jsxs)(K,{size:`sm`,spacing:4,children:[(0,J.jsxs)(K.Item,{children:[`Expiration par défaut : `,(0,J.jsx)(`strong`,{children:n}),` (réglable à la création — une clé qui expire limite l'impact d'une fuite).`]}),(0,J.jsxs)(K.Item,{children:[`Plafond : `,(0,J.jsx)(`strong`,{children:e.maxPerSubject}),` clés`,` `,(0,J.jsx)(`em`,{children:`actives`}),` par porteur (révoquez-en pour en créer au-delà).`]}),(0,J.jsx)(K.Item,{children:`Rotation : créez la nouvelle, basculez vos scripts, révoquez l'ancienne.`})]})}),(0,J.jsx)($,{icon:(0,J.jsx)(te,{size:18}),title:`Sécurité`,children:(0,J.jsxs)(K,{size:`sm`,spacing:4,children:[(0,J.jsxs)(K.Item,{children:[`Le secret n'est affiché `,(0,J.jsx)(`strong`,{children:`qu'une fois`}),`, à la création : seul son empreinte (sha256) est stockée, jamais le secret en clair.`]}),(0,J.jsxs)(K.Item,{children:[`Un `,(0,J.jsxs)(v,{children:[t,`_…`]}),` public permet de repérer une clé sans révéler le secret (logs, audit).`]}),(0,J.jsx)(K.Item,{children:`Révocation immédiate et définitive — toute requête portant la clé est ensuite rejetée (401).`}),(0,J.jsx)(K.Item,{children:`Traitez une clé comme un mot de passe : jamais dans un dépôt git, une URL ou un canal non chiffré.`})]})}),(0,J.jsx)(s,{variant:`light`,color:`gray`,icon:(0,J.jsx)(u,{size:16}),children:(0,J.jsxs)(o,{size:`xs`,children:[`Une clé API est une preuve `,(0,J.jsx)(`em`,{children:`portée par la requête`}),` (axe API), distincte de la session de navigateur (cookie BFF) et des rôles RBAC. La révocation d'une clé n'affecte ni la session ni les autres clés du porteur.`]})})]})}var Le=I(()=>{let e=le(),t=de(),n=ue(),c=ce(t.roles,fe),[l,u]=(0,q.useState)(c?`admin`:`user`),[h,v]=(0,q.useState)(`keys`),[y,b]=(0,q.useState)(!1),[x,S]=(0,q.useState)(null),[C,D]=(0,q.useState)(null),[A,j]=(0,q.useState)(null),[M,N]=(0,q.useState)(!1),[P,I]=(0,q.useState)({}),[te,ne]=(0,q.useState)(0),ie=(0,q.useCallback)(async()=>{if(l===`admin`)return[];try{return(await e.api.getAbsolute(`/nodefony/security/api/keys`)).keys??[]}catch(e){throw Error(V(e),{cause:e})}},[e,l]),{data:R,loading:B,error:he,reload:ve}=F(ie),H=(0,q.useMemo)(()=>R??[],[R]),U=(0,q.useCallback)(()=>{ve(),ne(e=>e+1)},[ve]),xe=(0,q.useCallback)(async()=>{try{return await e.api.getAbsolute(pe)}catch(e){throw Error(V(e),{cause:e})}},[e]),{data:W}=F(xe),Se=(0,q.useCallback)(()=>e.api.getAbsolute(ge),[e]),{data:Ce}=F(Se),Te=e.admin.pageCapabilities(ye),K=we(P,Te).toString(),Ee=(0,q.useCallback)(()=>l!==`admin`||!c?Promise.resolve(null):e.api.getAbsolute(K?`${ye}?${K}`:ye),[e,l,c,K]),{data:Oe,reload:ke}=F(Ee),Y=re(l===`admin`?Te:null,P,I),X=(0,q.useMemo)(()=>l===`admin`?Oe??{total:null,active:null,expired:null,revoked:null}:me(H),[l,Oe,H]),Ae=(0,q.useMemo)(()=>[{value:`admin`,label:`Administration`},{value:`user`,label:`Mes clés`},{value:`tenant`,label:`Tenant (P17)`,disabled:!0}],[]);async function Z(){if(!x)return;let t=x;D(t.id);try{l===`admin`?await e.api.postAbsolute(be(t.id)):await e.api.deleteAbsolute(_e(t.id)),n.notify(`success`,`Clé « ${t.name} » révoquée.`,{source:`api`}),S(null),U(),ke()}catch(e){n.notify(`error`,V(e),{source:`api`})}finally{D(null)}}async function je(){if(!A)return;let{keys:t,clear:r}=A;N(!0);try{let i=await Promise.allSettled(t.map(t=>l===`admin`?e.api.postAbsolute(be(t.id)):e.api.deleteAbsolute(_e(t.id)))),a=i.filter(e=>e.status===`fulfilled`).length,o=i.length-a;n.notify(o===0?`success`:`warning`,o===0?`${a} clé(s) révoquée(s).`:`${a} révoquée(s), ${o} échec(s).`,{source:`api`}),r(),j(null),U(),ke()}catch(e){n.notify(`error`,V(e),{source:`api`})}finally{N(!1)}}let Q=l===`admin`?`Toutes les clés — ${G(X.total)} clé(s) · ${G(X.active)} active(s)`:`Mes clés — ${G(X.total)} clé(s) · ${G(X.active)} active(s)`;return(0,J.jsxs)(ee,{title:`API Keys`,subtitle:Q,icon:(0,J.jsx)(L,{size:26}),actions:(0,J.jsxs)(i,{gap:`sm`,wrap:`nowrap`,children:[l===`user`&&(0,J.jsx)(m,{leftSection:(0,J.jsx)(ae,{size:16}),disabled:!W?.enabled,onClick:()=>b(!0),children:`Nouvelle clé`}),(0,J.jsx)(m,{variant:`light`,leftSection:(0,J.jsx)(a,{size:16}),loading:B,onClick:U,children:`Recharger`})]}),children:[c&&(0,J.jsxs)(i,{gap:`xs`,align:`center`,children:[(0,J.jsx)(p,{value:l,onChange:e=>{e!==`tenant`&&u(e)},data:Ae,color:l===`admin`?`orange`:`brand`}),(0,J.jsx)(d,{title:`Portée des clés`,version:`v1.0`,summary:`« Mes clés » = self-service (vos propres jetons). « Administration » = gouvernance de toutes les clés du système (lister, révoquer en réponse à incident).`,sections:[{label:`Pourquoi pas de création en Administration`,body:`Une clé porte l'identité et les droits frais de son porteur ; en créer une « au nom de » quelqu'un serait une usurpation. L'admin supervise et révoque ; chacun crée ses propres clés.`},{label:`Tenant (P17)`,body:`La même vue, filtrée par organisation/tenant — disponible avec le multi-tenant (le champ tenantId existe déjà sur chaque clé).`}]}),l===`admin`&&(0,J.jsx)(o,{size:`xs`,c:`dimmed`,children:`Vue gouvernance — révocation en réponse à incident, audité.`}),Ce&&Ce.store!==`none`&&(0,J.jsx)(De,{brick:`tokens`})]}),(0,J.jsxs)(w,{children:[(0,J.jsx)(r,{label:`Total`,...Y(`total`,`toutes les clés (retire les filtres de facette)`),icon:(0,J.jsx)(L,{size:20,color:`var(--mantine-color-brand-5)`}),hint:`Nombre de clés API dans cette portée (actives + expirées + révoquées).`,children:(0,J.jsx)(o,{fz:28,fw:700,style:{fontVariantNumeric:`tabular-nums`},children:G(X.total)})}),(0,J.jsx)(r,{label:`Actives`,...Y(`active`,`les clés utilisables`),icon:(0,J.jsx)(se,{size:20,color:`var(--mantine-color-teal-6)`}),hint:`Clés utilisables : ni expirées, ni révoquées.`,children:(0,J.jsx)(o,{fz:28,fw:700,c:`teal`,style:{fontVariantNumeric:`tabular-nums`},children:G(X.active)})}),(0,J.jsx)(r,{label:`Expirées`,...Y(`expired`,`les clés arrivées à échéance`),icon:(0,J.jsx)(T,{size:20,color:`var(--mantine-color-orange-6)`}),hint:`Clés dont la date d'expiration est passée (rejetées à l'usage).`,children:(0,J.jsx)(o,{fz:28,fw:700,c:`orange`,style:{fontVariantNumeric:`tabular-nums`},children:G(X.expired)})}),(0,J.jsx)(r,{label:`Révoquées`,...Y(`revoked`,`les clés révoquées`),icon:(0,J.jsx)(z,{size:20,color:`var(--mantine-color-red-6)`}),hint:`Clés désactivées manuellement (conservées un temps pour l'audit).`,children:(0,J.jsx)(o,{fz:28,fw:700,c:`red`,style:{fontVariantNumeric:`tabular-nums`},children:G(X.revoked)})})]}),(0,J.jsxs)(g,{value:h,onChange:e=>e&&v(e),mt:`xs`,children:[(0,J.jsxs)(g.List,{children:[(0,J.jsx)(g.Tab,{value:`keys`,leftSection:(0,J.jsx)(f,{size:15}),children:`Clés`}),(0,J.jsx)(g.Tab,{value:`help`,leftSection:(0,J.jsx)(oe,{size:15}),children:`Utilisation & aide`})]}),(0,J.jsx)(g.Panel,{value:`keys`,pt:`md`,children:(0,J.jsx)(O,{loading:l===`user`&&B&&!R,error:l===`user`?he:null,onRetry:U,children:(0,J.jsx)(Me,{keys:H,showSubject:l===`admin`,filters:P,onFiltersChange:I,reloadKey:te,onRevoke:e=>S(e),onBulkRevoke:(e,t)=>j({keys:e,clear:t}),revokingId:C})})}),(0,J.jsx)(g.Panel,{value:`help`,pt:`md`,children:h===`help`&&(W?(0,J.jsx)(Ie,{capabilities:W}):(0,J.jsx)(o,{size:`sm`,c:`dimmed`,children:`Capacités indisponibles (clés API désactivées ou non authentifié).`}))})]}),W&&(0,J.jsx)(Fe,{opened:y,onClose:()=>b(!1),capabilities:W,onCreated:U}),(0,J.jsx)(k,{opened:x!==null,onClose:()=>C?void 0:S(null),title:(0,J.jsxs)(i,{gap:`xs`,children:[(0,J.jsx)(z,{size:18,color:`var(--mantine-color-red-6)`}),(0,J.jsx)(o,{fw:700,children:`Révoquer la clé ?`})]}),centered:!0,children:x&&(0,J.jsxs)(E,{gap:`md`,children:[(0,J.jsx)(s,{variant:`light`,color:`red`,icon:(0,J.jsx)(_,{size:16}),children:(0,J.jsxs)(o,{size:`sm`,children:[`La clé `,(0,J.jsxs)(`strong`,{children:[`« `,x.name,` »`]}),l===`admin`?(0,J.jsxs)(J.Fragment,{children:[` `,`du porteur `,(0,J.jsx)(`strong`,{children:x.subjectId})]}):null,` `,`sera `,(0,J.jsx)(`strong`,{children:`immédiatement et définitivement`}),` `,`désactivée. Tout script qui l'utilise sera rejeté (401). Action irréversible.`]})}),(0,J.jsxs)(i,{justify:`flex-end`,children:[(0,J.jsx)(m,{variant:`default`,disabled:C!==null,onClick:()=>S(null),children:`Annuler`}),(0,J.jsx)(m,{color:`red`,leftSection:(0,J.jsx)(z,{size:16}),loading:C===x.id,onClick:()=>void Z(),children:`Révoquer`})]})]})}),(0,J.jsx)(k,{opened:A!==null,onClose:()=>M?void 0:j(null),title:(0,J.jsxs)(i,{gap:`xs`,children:[(0,J.jsx)(z,{size:18,color:`var(--mantine-color-red-6)`}),(0,J.jsx)(o,{fw:700,children:`Révoquer les clés sélectionnées ?`})]}),centered:!0,children:A&&(0,J.jsxs)(E,{gap:`md`,children:[(0,J.jsx)(s,{variant:`light`,color:`red`,icon:(0,J.jsx)(_,{size:16}),children:(0,J.jsxs)(o,{size:`sm`,children:[(0,J.jsx)(`strong`,{children:A.keys.length}),` clé(s) seront`,` `,(0,J.jsx)(`strong`,{children:`immédiatement et définitivement`}),` désactivées — tout script qui les utilise sera rejeté (401). Action irréversible.`,l===`admin`?` Ces clés appartiennent à leurs porteurs respectifs (action de gouvernance, auditée).`:``]})}),(0,J.jsxs)(i,{justify:`flex-end`,children:[(0,J.jsx)(m,{variant:`default`,disabled:M,onClick:()=>j(null),children:`Annuler`}),(0,J.jsxs)(m,{color:`red`,leftSection:(0,J.jsx)(z,{size:16}),loading:M,onClick:()=>void je(),children:[`Révoquer `,A.keys.length]})]})]})})]})});export{Le as ApiKeys,Le as default};
|
package/dist/frontend/assets/{ArchitectureLiveGraph-CMuDgIZB.js → ArchitectureLiveGraph-DdYMg18n.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{Si as t,wa as n,y as r}from"./ui-NqIPktVY.js";import{Et as i,U as a,ct as o,it as s}from"./index-Bxrb_NNJ.js";import{t as c}from"./IconCircuitResistor-BghxljUq.js";import{t as l}from"./IconDeviceDesktop-OvxYj-tE.js";import{t as u}from"./IconStack2-CMC-_hkZ.js";import{c as d,r as f}from"./useSocketLiveData-BZjzaQMC.js";var p=e(n(),1),m=t(),h=[{id:`client`,data:{label:`NodefonySocket`,sub:`Navigateur · isomorphe · subscribe / on / publish / request`,icon:(0,m.jsx)(l,{size:20}),color:`blue`}},{id:`transport`,data:{label:`Transport (WSS)`,sub:`IRealtimeTransport · seul à connaître le réseau`,icon:(0,m.jsx)(a,{size:20}),color:`cyan`}},{id:`peer`,data:{label:`JsonRpcPeer`,sub:`JSON-RPC 2.0 · le même protocole des 2 côtés (isomorphe)`,icon:(0,m.jsx)(u,{size:20}),color:`grape`}},{id:`hub`,data:{label:`RealtimeHub`,sub:`Broker pub/sub · fan-out par canal`,icon:(0,m.jsx)(o,{size:20}),color:`indigo`,emphasis:!0}},{id:`backplane`,data:{label:`IBackplane`,sub:`Fond de panier · driver réel remonté par la sonde`,icon:(0,m.jsx)(c,{size:20}),color:`orange`,emphasis:!0}},{id:`w1`,data:{label:`Worker A`,sub:`process / pod · alimenté par instances[] en vue pod`,icon:(0,m.jsx)(s,{size:20}),color:`teal`}},{id:`w2`,data:{label:`Worker B`,sub:`process / pod · neutre si le pod n'a qu'un worker`,icon:(0,m.jsx)(s,{size:20}),color:`teal`}}],g=[{source:`client`,target:`transport`,label:`WSS`,color:`blue`},{source:`transport`,target:`peer`,label:`frames`,color:`cyan`},{source:`peer`,target:`hub`,label:`subscribe / publish`,color:`grape`},{source:`hub`,target:`backplane`,label:`fan-out cross-process`,color:`indigo`},{source:`backplane`,target:`w1`,label:`delivery`,color:`orange`},{source:`backplane`,target:`w2`,label:`delivery`,color:`orange`}],_=i(({height:e})=>{let t=d(),n=(0,p.useMemo)(()=>f(t),[t]);return(0,m.jsx)(r,{nodes:h,edges:g,dir:`TB`,height:e,ariaLabel:`Architecture en couches de la Socket Nodefony — temps réel actif`,liveNodeData:n})});function v({live:e=!1,height:t=540}){return e?(0,m.jsx)(_,{height:t}):(0,m.jsx)(r,{nodes:h,edges:g,dir:`TB`,height:t,ariaLabel:`Architecture en couches de la Socket Nodefony (statique)`})}export{v as ArchitectureLiveGraph,v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{$n as t,Gt as n,J as r,Jr as i,Jt as a,Kt as o,Nr as s,Pr as c,Qn as l,Qt as u,Si as d,_ as f,ar as p,br as m,gn as ee,gr as h,ir as g,mr as _,n as te,nr as ne,nt as re,oi as v,or as ie,pr as y,q as b,rr as x,sn as ae,ur as S,vn as C,wa as w,xr as T}from"./ui-NqIPktVY.js";import{Et as E,L as D,P as oe,pt as O}from"./index-Bxrb_NNJ.js";import{c as se}from"./stores-CsHxacRb.js";import{a as k,i as A,n as j,o as ce,r as M,t as N}from"./auditModel-DUpx7JmY.js";import{a as P,i as F,n as I,r as le,t as L}from"./auditFormat-r1_77PDm.js";import{t as ue}from"./BrickStoreChip-BLiTtfPX.js";import{l as R}from"./hooks-C5izbcnh.js";var z=C(`outline`,`cookie`,`Cookie`,[[`path`,{d:`M8 13v.01`,key:`svg-0`}],[`path`,{d:`M12 17v.01`,key:`svg-1`}],[`path`,{d:`M12 12v.01`,key:`svg-2`}],[`path`,{d:`M16 14v.01`,key:`svg-3`}],[`path`,{d:`M11 8v.01`,key:`svg-4`}],[`path`,{d:`M13.148 3.476l2.667 1.104a4 4 0 0 0 4.656 6.14l.053 .132a3 3 0 0 1 0 2.296q -.745 1.18 -1.024 1.852q -.283 .684 -.66 2.216a3 3 0 0 1 -1.624 1.623q -1.572 .394 -2.216 .661q -.712 .295 -1.852 1.024a3 3 0 0 1 -2.296 0q -1.203 -.754 -1.852 -1.024q -.707 -.292 -2.216 -.66a3 3 0 0 1 -1.623 -1.624q -.397 -1.577 -.661 -2.216q -.298 -.718 -1.024 -1.852a3 3 0 0 1 0 -2.296q .719 -1.116 1.024 -1.852q .257 -.62 .66 -2.216a3 3 0 0 1 1.624 -1.623q 1.547 -.384 2.216 -.661q .687 -.285 1.852 -1.024a3 3 0 0 1 2.296 0`,key:`svg-5`}]]),B=e(w(),1),V=d(),H=[{label:`Tous`,value:``},...M.map(e=>({label:e.label,value:e.value}))],U=j.map(e=>({value:e.value,label:e.label})),W=N.map(e=>({value:e.value,label:e.label})),G=A.map(e=>({label:e.label,value:e.value}));function de({filter:e,onChange:r,onReset:a,hasActiveFilter:o}){let[c,l]=(0,B.useState)(e.actor??``);(0,B.useEffect)(()=>l(e.actor??``),[e.actor]);let d=()=>{let t=c.trim();t!==(e.actor??``)&&r({actor:t===``?void 0:t})};return(0,V.jsx)(x,{gap:`xs`,children:(0,V.jsxs)(i,{gap:`md`,align:`flex-end`,wrap:`wrap`,children:[(0,V.jsxs)(x,{gap:2,children:[(0,V.jsxs)(i,{gap:4,children:[(0,V.jsx)(s,{size:`xs`,fw:600,c:`dimmed`,children:`Période`}),(0,V.jsx)(b,{text:`Borne basse de la recherche (since). « Tout » = toute la fenêtre de rétention du journal.`})]}),(0,V.jsx)(p,{size:`xs`,data:G,value:e.period,onChange:e=>r({period:e})})]}),(0,V.jsxs)(x,{gap:2,children:[(0,V.jsxs)(i,{gap:4,children:[(0,V.jsx)(s,{size:`xs`,fw:600,c:`dimmed`,children:`Issue`}),(0,V.jsx)(b,{text:`Succès / Échec (l'acteur a raté une preuve) / Refus (une politique a refusé un acteur valide — signal Zero Trust).`})]}),(0,V.jsx)(p,{size:`xs`,data:H,value:e.outcome??``,onChange:e=>r({outcome:e===``?void 0:e})})]}),(0,V.jsx)(g,{label:`Catégorie`,placeholder:`Toutes`,size:`xs`,clearable:!0,searchable:!0,data:U,value:e.category??null,onChange:e=>r({category:e??void 0}),w:170,comboboxProps:{withinPortal:!0}}),(0,V.jsx)(g,{label:`Action`,placeholder:`Toutes`,size:`xs`,clearable:!0,searchable:!0,data:W,value:e.action??null,onChange:e=>r({action:e??void 0}),w:230,comboboxProps:{withinPortal:!0}}),(0,V.jsx)(t,{label:`Acteur`,placeholder:`identifiant exact`,size:`xs`,value:c,onChange:e=>l(e.currentTarget.value),onBlur:d,onKeyDown:e=>{e.key===`Enter`&&d()},leftSection:(0,V.jsx)(n,{size:14}),w:190}),o&&(0,V.jsx)(m,{size:`xs`,variant:`subtle`,color:`gray`,leftSection:(0,V.jsx)(u,{size:14}),onClick:a,children:`Réinitialiser`})]})})}function K({label:e,children:t}){return(0,V.jsxs)(i,{justify:`space-between`,wrap:`nowrap`,gap:`md`,align:`flex-start`,children:[(0,V.jsx)(s,{size:`sm`,c:`dimmed`,style:{flexShrink:0},children:e}),(0,V.jsx)(v,{style:{textAlign:`right`,minWidth:0},children:t})]})}function q({children:e}){return e?(0,V.jsx)(s,{size:`sm`,style:{wordBreak:`break-word`},children:e}):(0,V.jsx)(s,{size:`sm`,c:`dimmed`,children:`—`})}function fe({event:e,onClose:t}){let n=R();return e?(0,V.jsx)(S,{opened:!0,onClose:t,title:(0,V.jsxs)(i,{gap:`xs`,children:[(0,V.jsx)(s,{fw:700,children:`Événement d'audit`}),(0,V.jsx)(h,{children:e.action})]}),size:`lg`,centered:!0,children:(0,V.jsxs)(x,{gap:`sm`,children:[(0,V.jsx)(K,{label:`Horodatage`,children:(0,V.jsx)(q,{children:P(e.ts)})}),(0,V.jsx)(K,{label:`Catégorie`,children:(0,V.jsx)(I,{category:e.category})}),(0,V.jsx)(K,{label:`Action`,children:(0,V.jsx)(h,{children:e.action})}),(0,V.jsx)(K,{label:`Issue`,children:(0,V.jsx)(F,{outcome:e.outcome})}),(0,V.jsx)(K,{label:`Acteur`,children:(0,V.jsx)(L,{actor:e.actor})}),(0,V.jsx)(_,{my:4}),(0,V.jsx)(K,{label:`Ressource`,children:(0,V.jsx)(q,{children:e.resource})}),(0,V.jsx)(K,{label:`Raison (machine)`,children:e.reason?(0,V.jsx)(h,{children:e.reason}):(0,V.jsx)(q,{children:null})}),(0,V.jsx)(K,{label:`Adresse IP`,children:(0,V.jsx)(q,{children:e.ip})}),(0,V.jsx)(K,{label:`User-Agent`,children:(0,V.jsx)(q,{children:e.userAgent})}),(e.flags?.hasAuthorization||e.flags?.hasCookie)&&(0,V.jsx)(K,{label:`Présence`,children:(0,V.jsxs)(i,{gap:6,justify:`flex-end`,children:[e.flags.hasAuthorization&&(0,V.jsx)(T,{variant:`light`,color:`grape`,leftSection:(0,V.jsx)(a,{size:11}),style:{textTransform:`none`},children:`Authorization`}),e.flags.hasCookie&&(0,V.jsx)(T,{variant:`light`,color:`cyan`,leftSection:(0,V.jsx)(z,{size:11}),style:{textTransform:`none`},children:`Cookie`})]})}),(0,V.jsx)(_,{my:4}),(0,V.jsx)(K,{label:`Requête (corrélation)`,children:e.requestId?(0,V.jsxs)(i,{gap:`xs`,justify:`flex-end`,wrap:`nowrap`,children:[(0,V.jsx)(h,{children:e.requestId}),(0,V.jsx)(m,{size:`compact-xs`,variant:`light`,leftSection:(0,V.jsx)(D,{size:13}),onClick:()=>{e.requestId&&(t(),n(`/nodefony/logs/trace/${encodeURIComponent(e.requestId)}`))},children:`Voir la trace`})]}):(0,V.jsx)(q,{children:null})}),(0,V.jsx)(K,{label:`Identifiant`,children:(0,V.jsx)(h,{children:e.id})}),e.metadata&&Object.keys(e.metadata).length>0&&(0,V.jsxs)(x,{gap:4,children:[(0,V.jsx)(s,{size:`sm`,c:`dimmed`,children:`Métadonnées`}),(0,V.jsx)(f,{value:e.metadata,maxHeight:200})]})]})}):null}function pe({onBatch:e}){return O(k,t=>{let n=t;n&&Array.isArray(n.events)&&e(n)}),null}var me=`/nodefony/security/api/audit/events`,he=2e3,J={period:`24h`};function ge(e,t){return!(t.category&&e.category!==t.category||t.outcome&&e.outcome!==t.outcome||t.action&&e.action!==t.action||t.actor&&(e.actor??``)!==t.actor)}function Y(e){let t=new Set,n=[];for(let r of e)t.has(r.id)||(t.add(r.id),n.push(r));return n.sort((e,t)=>t.ts-e.ts),n}function X(e){let t=e?.status;if(t===401)return`Non authentifié — votre session Studio a expiré ou n'est plus reconnue par le firewall. Reconnectez-vous.`;if(t===403)return`Accès refusé — le journal d'audit est réservé aux administrateurs (ROLE_NODEFONY_ADMIN).`;if(t===503)return`Journal d'audit indisponible — service désactivé dans la configuration (audit.enabled).`;if(t===404)return`Endpoint d'audit introuvable — le module @nodefony/security n'est peut-être pas chargé.`;let n=e?.message;return n?`Erreur de chargement du journal : ${n}`:`Erreur de chargement du journal d'audit.`}var Z=E(()=>{let e=se(),[t,n]=(0,B.useState)(J),[a,u]=(0,B.useState)([]),[d,f]=(0,B.useState)(0),[p,g]=(0,B.useState)(null),[_,v]=(0,B.useState)(!0),[x,S]=(0,B.useState)(!1),[C,w]=(0,B.useState)(null),[E,O]=(0,B.useState)(null),[k,A]=(0,B.useState)(!1),[j,M]=(0,B.useState)(0),[N,P]=(0,B.useState)(0),R=(0,B.useRef)(0),z=(0,B.useCallback)(n=>{let r=ce(t,Date.now(),n);return e.api.getAbsolute(`${me}?${r}`)},[e,t]),H=(0,B.useCallback)(async()=>{let e=++R.current;v(!0),w(null);try{let t=await z();if(e!==R.current)return;u(Y(t.items)),f(t.total??0),g(t.nextCursor??null)}catch(t){if(e!==R.current)return;w(X(t)),u([]),f(0),g(null)}finally{e===R.current&&v(!1)}},[z]);(0,B.useEffect)(()=>{H()},[H]);let U=(0,B.useCallback)(async()=>{if(!p||x)return;let e=R.current;S(!0);try{let t=await z(p);if(e!==R.current)return;u(e=>Y([...e,...t.items])),g(t.nextCursor??null),f(t.total??0)}catch(t){e===R.current&&w(X(t))}finally{e===R.current&&S(!1)}},[z,p,x]),W=(0,B.useCallback)(e=>{e.dropped&&P(t=>t+e.dropped);let n=e.events.filter(e=>ge(e,t));n.length!==0&&(M(e=>e+n.length),u(e=>Y([...n,...e]).slice(0,he)))},[t]),G=e=>{A(e),M(0),P(0)},K=e=>n(t=>({...t,...e})),q=()=>n(J),Z=!!(t.category||t.outcome||t.actor||t.action),Q=(0,B.useMemo)(()=>{let e=0,t=0,n=0;for(let r of a){let i=r.outcome;i===`success`?e++:i===`failure`?t++:i===`denied`&&n++}return{success:e,failure:t,denied:n}},[a]),$=(0,B.useMemo)(()=>[{key:`ts`,header:`Heure`,sortable:!0,value:e=>e.ts,render:e=>(0,V.jsx)(le,{ts:e.ts}),size:95},{key:`category`,header:`Catégorie`,filterable:!0,filterType:`select`,value:e=>e.category,render:e=>(0,V.jsx)(I,{category:e.category}),size:150},{key:`action`,header:`Action`,filterable:!0,value:e=>e.action,render:e=>(0,V.jsx)(h,{children:e.action}),size:175},{key:`outcome`,header:`Issue`,filterable:!0,filterType:`select`,value:e=>e.outcome,render:e=>(0,V.jsx)(F,{outcome:e.outcome}),size:110},{key:`actor`,header:`Acteur`,filterable:!0,value:e=>e.actor??`anonyme`,render:e=>(0,V.jsx)(L,{actor:e.actor}),size:150},{key:`reason`,header:`Raison`,value:e=>e.reason??``,render:e=>e.reason?(0,V.jsx)(h,{children:e.reason}):(0,V.jsx)(s,{size:`sm`,c:`dimmed`,children:`—`}),size:150},{key:`ip`,header:`IP`,value:e=>e.ip??``,render:e=>(0,V.jsx)(s,{size:`sm`,ff:`monospace`,children:e.ip??`—`}),size:125},{key:`trace`,header:`Trace`,align:`right`,value:e=>e.requestId?`1`:``,render:e=>e.requestId?(0,V.jsx)(ie,{label:`Voir la trace de la requête`,withinPortal:!0,children:(0,V.jsx)(l,{variant:`subtle`,size:`sm`,color:`brand`,children:(0,V.jsx)(D,{size:15})})}):null,size:70}],[]),_e=`${a.length} événement(s) chargé(s)${d>a.length?` · ${d} en rétention pour ce filtre`:``}`;return(0,V.jsxs)(re,{title:`Journal d'audit`,subtitle:_e,icon:(0,V.jsx)(oe,{size:26}),actions:(0,V.jsxs)(i,{gap:`sm`,wrap:`nowrap`,children:[(0,V.jsx)(ue,{brick:`audit`}),(0,V.jsxs)(i,{gap:6,wrap:`nowrap`,children:[(0,V.jsx)(ne,{size:`sm`,checked:k,onChange:e=>G(e.currentTarget.checked),label:`Temps réel`}),(0,V.jsx)(b,{text:`Affiche les nouveaux événements en tête, en direct (canal nodefony:audit). Réservé aux pics d'activité — un journal d'audit se consulte, il ne se regarde pas défiler.`}),k&&j>0&&(0,V.jsxs)(T,{color:`teal`,variant:`light`,children:[j,` nouveau(x)`]})]}),(0,V.jsx)(m,{variant:`light`,leftSection:(0,V.jsx)(o,{size:16}),loading:_,onClick:()=>void H(),children:`Recharger`})]}),children:[k&&(0,V.jsx)(pe,{onBatch:W}),k&&N>0&&(0,V.jsxs)(c,{variant:`light`,color:`orange`,icon:(0,V.jsx)(ee,{size:18}),title:`Pic d'activité`,children:[N,` événement(s) omis du flux live (ring borné). Le journal complet reste consultable via « Recharger » et les filtres.`]}),(0,V.jsxs)(y,{children:[(0,V.jsx)(r,{label:`Total (rétention)`,hint:`Nombre d'événements correspondant au filtre courant sur toute la fenêtre de rétention du journal (compté côté serveur).`,children:(0,V.jsx)(s,{fz:28,fw:700,style:{fontVariantNumeric:`tabular-nums`},children:d})}),(0,V.jsx)(r,{label:`Succès`,hint:`Issues « success » sur les événements chargés. Filtrez « Issue = Succès » pour le total exact en rétention.`,children:(0,V.jsx)(s,{fz:28,fw:700,c:`teal`,style:{fontVariantNumeric:`tabular-nums`},children:Q.success})}),(0,V.jsx)(r,{label:`Échecs`,hint:`Issues « failure » (l'acteur a raté une preuve : mot de passe, signature) sur les événements chargés.`,children:(0,V.jsx)(s,{fz:28,fw:700,c:`orange`,style:{fontVariantNumeric:`tabular-nums`},children:Q.failure})}),(0,V.jsx)(r,{label:`Refus`,hint:`Issues « denied » (une politique a refusé un acteur valide — Zero Trust, RBAC, CSRF). Le signal d'alerte de l'auditeur.`,children:(0,V.jsx)(s,{fz:28,fw:700,c:`red`,style:{fontVariantNumeric:`tabular-nums`},children:Q.denied})})]}),(0,V.jsx)(de,{filter:t,onChange:K,onReset:q,hasActiveFilter:Z}),(0,V.jsx)(te,{mode:`client`,data:a,loading:_,error:C,columns:$,getRowId:e=>e.id,onRowClick:e=>O(e),initialSort:{key:`ts`,dir:`desc`},searchable:!0,searchPlaceholder:`Rechercher (acteur, action, IP, raison…)`,pageSize:25,persist:{key:`studio.audit`,storage:`session`},emptyMessage:`Aucun événement de sécurité pour ce filtre.`}),p&&(0,V.jsx)(i,{justify:`center`,children:(0,V.jsx)(m,{variant:`default`,leftSection:(0,V.jsx)(ae,{size:16}),loading:x,onClick:()=>void U(),children:`Charger les événements plus anciens`})}),(0,V.jsx)(fe,{event:E,onClose:()=>O(null)})]})});export{Z as Audit};
|
package/dist/frontend/assets/{BackplaneLiveGraph-DPaKwgjB.js → BackplaneLiveGraph-ieJyx_Ub.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{Si as t,pn as n,vn as r,wa as i,y as a}from"./ui-NqIPktVY.js";import{Et as o,it as s}from"./index-Bxrb_NNJ.js";import{t as c}from"./IconCircuitResistor-BghxljUq.js";import{t as l}from"./IconPuzzle-sBK_hUoV.js";import{t as u}from"./IconServer2-DAA64x6c.js";import{c as d,i as f,t as p}from"./useSocketLiveData-BZjzaQMC.js";var m=r(`outline`,`loader-2`,`Loader2`,[[`path`,{d:`M12 3a9 9 0 1 0 9 9`,key:`svg-0`}]]),h=e(i(),1),g=t(),_=[{id:`workerA`,data:{label:`Worker A`,sub:`publish + subscribe`,icon:(0,g.jsx)(s,{size:20}),color:`teal`}},{id:`workerB`,data:{label:`Worker B`,sub:`publish + subscribe · neutre si le pod n'a qu'un worker`,icon:(0,g.jsx)(s,{size:20}),color:`teal`}},{id:`workerC`,data:{label:`Worker C`,sub:`publish + subscribe · neutre si le pod n'a qu'un worker`,icon:(0,g.jsx)(s,{size:20}),color:`teal`}},{id:`backplane`,data:{label:`IBackplane`,sub:`Contrat · publish() · subscribe() · dispose()`,icon:(0,g.jsx)(c,{size:20}),color:`orange`,emphasis:!0}},{id:`loopback`,data:{label:`LoopbackBackplane`,sub:"driver `loopback` · mono-process · microtask · latence ordre µs",icon:(0,g.jsx)(m,{size:20}),color:`green`}},{id:`cluster`,data:{label:`ClusterBackplane`,sub:"driver `cluster` · transport `ipc` · 1 host · latence ordre ms",icon:(0,g.jsx)(u,{size:20}),color:`blue`}},{id:`redis`,data:{label:`RedisBackplane`,sub:"driver `redis` · `redis-pubsub` · cross-pod · latence ordre ms",icon:(0,g.jsx)(n,{size:20}),color:`red`}},{id:`custom`,data:{label:`Driver userland`,sub:`registerBackplaneDriver(name, factory) — NATS, Pulsar, RabbitMQ…`,icon:(0,g.jsx)(l,{size:20}),color:`grape`}}],v=[{id:`loopback`,color:`green`},{id:`cluster`,color:`blue`},{id:`redis`,color:`red`},{id:`custom`,color:`grape`}];function y(e){let t=!!e&&!p.includes(e),n=[{source:`workerA`,target:`backplane`,label:`bus`,color:`teal`},{source:`workerB`,target:`backplane`,label:`bus`,color:`teal`},{source:`workerC`,target:`backplane`,label:`bus`,color:`teal`}];for(let r of v){let i=r.id===`custom`?t:r.id===e;n.push({source:`backplane`,target:r.id,label:i?`actif`:`alternatif`,color:r.color,dashed:!i})}return n}var b=y(void 0),x=o(({height:e})=>{let t=d(),n=(0,h.useMemo)(()=>f(t),[t]),r=t.backplane?.driver,i=(0,h.useMemo)(()=>y(r),[r]);return(0,g.jsx)(a,{nodes:_,edges:i,dir:`TB`,height:e,ariaLabel:`Backplane Nodefony — drivers pluggables — temps réel actif`,liveNodeData:n})});function S({live:e=!1,height:t=600}){return e?(0,g.jsx)(x,{height:t}):(0,g.jsx)(a,{nodes:_,edges:b,dir:`TB`,height:t,ariaLabel:`Backplane Nodefony — drivers pluggables (statique)`})}export{S as BackplaneLiveGraph,S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{Si as t,Ui as n,ci as r,da as i,ga as a,gi as o,oi as s,vi as c,wa as l}from"./ui-NqIPktVY.js";var u={root:`m_8b3717df`,breadcrumb:`m_f678d540`,separator:`m_3b8f2208`},d=e(l(),1),f=t(),p={separator:`/`},m=n((e,{separatorMargin:t})=>({root:{"--bc-separator-margin":i(t)}})),h=r(e=>{let t=c(`Breadcrumbs`,p,e),{classNames:n,className:r,style:i,styles:l,unstyled:h,vars:g,children:_,separator:v,separatorMargin:y,attributes:b,...x}=t,S=o({name:`Breadcrumbs`,classes:u,props:t,className:r,style:i,classNames:n,styles:l,unstyled:h,attributes:b,vars:g,varsResolver:m}),C=d.Children.toArray(_).reduce((e,t,n,r)=>{let i=a(t)?(0,d.cloneElement)(t,{...S(`breadcrumb`,{className:t.props?.className}),key:n}):(0,d.createElement)(`div`,{...S(`breadcrumb`),key:n},t);return e.push(i),n!==r.length-1&&e.push((0,d.createElement)(s,{...S(`separator`),key:`separator-${n}`},v)),e},[]);return(0,f.jsx)(s,{...S(`root`),...x,children:C})});h.classes=u,h.varsResolver=m,h.displayName=`@mantine/core/Breadcrumbs`;export{h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{C as t,Et as n,gt as r,rt as i}from"./index-Bxrb_NNJ.js";import{Jr as a,K as o,Mr as s,Nr as c,Si as l,fr as u,gn as d,rr as f,wa as p,xr as m}from"./ui-NqIPktVY.js";import{c as h}from"./stores-CsHxacRb.js";import{a as g,d as _,i as v,n as y,p as b,t as x,u as S}from"./storesModel-B7ZpgdOv.js";var C=e(p(),1),w=l(),T=n(({brick:e})=>{let n=h(),l=(0,C.useCallback)(async()=>(await n.api.getAbsolute(`/nodefony/kernel/api/stores`)).stores.find(t=>t.brick===e)??null,[n,e]),{data:p}=t(l);if(!p)return null;let T=_(p),E=S(p.source),D=b(p);return(0,w.jsxs)(u,{width:300,shadow:`md`,openDelay:120,withArrow:!0,position:`bottom-end`,children:[(0,w.jsx)(u.Target,{children:(0,w.jsxs)(m,{variant:`light`,color:T?`orange`:`grape`,leftSection:(0,w.jsx)(i,{size:12}),rightSection:T?(0,w.jsx)(d,{size:11}):null,style:{textTransform:`none`,cursor:`help`},children:[`Store · `,p.resolved]})}),(0,w.jsx)(u.Dropdown,{children:(0,w.jsxs)(f,{gap:6,children:[(0,w.jsx)(c,{fw:600,size:`sm`,children:x[p.brick]??p.brick}),y[p.brick]&&(0,w.jsx)(c,{size:`xs`,c:`dimmed`,children:y[p.brick]}),(0,w.jsx)(o,{k:`Store actif`,v:p.resolved,mono:!0}),(0,w.jsx)(o,{k:`Configuré`,v:p.configured,mono:!0}),(0,w.jsx)(o,{k:`Provenance`,v:g[p.provenance]}),E&&(0,w.jsx)(o,{k:`Source`,v:E}),(0,w.jsx)(o,{k:`Emplacement`,v:D.path??D.hint,mono:!!D.path}),(0,w.jsx)(c,{size:`xs`,c:`dimmed`,children:p.reason}),(0,w.jsx)(o,{k:`Durabilité`,v:v[p.nature]+(T?` · ⚠ volatil`:``)}),(0,w.jsxs)(a,{gap:4,wrap:`wrap`,children:[(0,w.jsx)(c,{size:`xs`,c:`dimmed`,children:`Dispo :`}),p.available.map(e=>(0,w.jsx)(m,{size:`xs`,variant:e===p.resolved?`filled`:`outline`,color:e===p.resolved?`grape`:`gray`,style:{textTransform:`none`},children:e},e))]}),(0,w.jsx)(s,{component:r,to:`/nodefony/stores`,size:`xs`,children:`Voir tous les stores →`})]})})]})});export{T as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{A as t,Et as n,z as r}from"./index-Bxrb_NNJ.js";import{H as i,Jr as a,Nr as o,Pr as s,Si as c,Ut as l,Xr as u,at as d,br as f,cn as p,gr as m,ii as h,ir as g,it as _,on as v,ri as y,rr as b,sn as x,ti as S,wa as C,xr as w,yr as T}from"./ui-NqIPktVY.js";import{t as E}from"./Collapse-ctIxjH-g.js";import{t as D}from"./Textarea-9yD_OCzE.js";import{t as O}from"./IconBrain-CQHG8g62.js";import{t as k}from"./IconPlayerStop-Gw6QwdEs.js";import{t as A}from"./IconSend-Bc0inf9r.js";import{t as j}from"./IconTool-Dp0ccZSt.js";import{a as M,i as N}from"./stores-CsHxacRb.js";import{a as P,i as F,t as I}from"./aiPreviewParts-Bwx9e8dx.js";var L=e(C(),1),R=c(),z=[`Quel est le délai de rétractation ?`,`Comment annuler une commande en cours de livraison ?`,`Que devient la mémoire d'un client qui demande l'effacement ?`,`Quel est le chiffre d'affaires 2025 ?`],B={thinking:O,tool_call:j,tool_result:p},V=n(()=>{let e=N(),t=M(),[n,c]=(0,L.useState)(``),d=(0,L.useRef)(null);(0,L.useEffect)(()=>{d.current?.scrollTo({top:d.current.scrollHeight,behavior:`smooth`})},[e.messages.length,e.currentResponse,e.currentSteps.length]);let p=(t=n)=>{t.trim()&&!e.isStreaming&&(e.send(t),c(``))};return(0,R.jsxs)(b,{gap:`md`,h:i,children:[(0,R.jsx)(_,{sticky:!0,title:`Chat IA`,subtitle:`Un agent qui cherche avant de répondre, cite ce qu'il a trouvé, et s'arrête quand on le lui demande.`,icon:(0,R.jsx)(r,{size:22}),actions:(0,R.jsxs)(a,{gap:`xs`,children:[(0,R.jsx)(w,{color:t.isConnected?`teal`:`yellow`,variant:`light`,children:t.isConnected?`temps réel connecté`:`hors ligne`}),(0,R.jsx)(u,{variant:`subtle`,color:`red`,"aria-label":`Effacer la conversation`,onClick:()=>e.clear(),disabled:e.messages.length===0||e.isStreaming,children:(0,R.jsx)(l,{size:18})})]})}),(0,R.jsx)(F,{module:`@nodefony/ai`,contract:`IAgent.stream()`}),(0,R.jsx)(H,{}),(0,R.jsxs)(T,{withBorder:!0,radius:`md`,p:0,style:{flex:1,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,R.jsx)(h,{viewportRef:d,style:{flex:1},p:`md`,children:(0,R.jsxs)(b,{gap:`md`,"aria-live":`polite`,children:[e.messages.length===0&&!e.isStreaming&&(0,R.jsxs)(b,{gap:`sm`,children:[(0,R.jsx)(o,{size:`sm`,c:`dimmed`,children:`Posez une question, ou partez d'un exemple :`}),(0,R.jsx)(a,{gap:`xs`,children:z.map(e=>(0,R.jsx)(f,{variant:`light`,size:`xs`,radius:`xl`,onClick:()=>p(e),children:e},e))})]}),e.messages.map(e=>(0,R.jsx)(G,{message:e},e.id)),e.isStreaming&&(0,R.jsx)(G,{message:{id:`streaming`,role:`assistant`,content:e.currentResponse,ts:0,steps:e.currentSteps,streaming:!0,agent:e.agent.name}}),e.error&&(0,R.jsx)(s,{color:`red`,variant:`light`,children:e.error})]})}),(0,R.jsxs)(a,{gap:`xs`,p:`sm`,align:`flex-end`,style:{borderTop:`1px solid var(--mantine-color-default-border)`},children:[(0,R.jsx)(D,{placeholder:`Posez une question à l'agent…`,"aria-label":`Question à l'agent`,autosize:!0,minRows:1,maxRows:6,value:n,onChange:e=>c(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),p())},disabled:e.isStreaming,style:{flex:1}}),e.isStreaming?(0,R.jsx)(u,{size:`lg`,variant:`light`,color:`red`,onClick:()=>e.abort(),"aria-label":`Interrompre la réponse`,children:(0,R.jsx)(k,{size:18})}):(0,R.jsx)(u,{size:`lg`,variant:`filled`,color:`brand`,onClick:()=>p(),disabled:!n.trim(),"aria-label":`Envoyer`,children:(0,R.jsx)(A,{size:18})})]})]})]})}),H=n(()=>{let e=N(),t=e.agent;return(0,R.jsx)(T,{withBorder:!0,radius:`md`,padding:`sm`,children:(0,R.jsxs)(a,{gap:`md`,align:`flex-end`,wrap:`wrap`,children:[(0,R.jsx)(g,{label:`Agent`,data:d.map(e=>({value:e.name,label:e.name})),value:e.agentName,onChange:t=>t&&e.setAgent(t),disabled:e.isStreaming,allowDeselect:!1,w:220}),(0,R.jsxs)(b,{gap:4,style:{flex:1,minWidth:260},children:[(0,R.jsx)(o,{size:`xs`,c:`dimmed`,children:t.description}),(0,R.jsxs)(a,{gap:6,children:[(0,R.jsx)(w,{variant:`light`,size:`sm`,tt:`none`,children:t.model}),(0,R.jsx)(P,{zone:t.zone}),(0,R.jsx)(I,{state:t.breaker}),t.collections.length>0?t.collections.map(e=>(0,R.jsxs)(w,{variant:`outline`,color:`teal`,size:`sm`,tt:`none`,children:[`RAG · `,e]},e)):(0,R.jsx)(w,{variant:`outline`,color:`gray`,size:`sm`,tt:`none`,children:`sans base documentaire`}),t.tools.map(e=>(0,R.jsx)(w,{variant:`default`,size:`xs`,tt:`none`,children:e},e))]})]})]})})});function U({steps:e,live:t}){let[n,r]=(0,L.useState)(!1),i=t||n;return(0,R.jsxs)(b,{gap:4,children:[(0,R.jsx)(y,{onClick:()=>r(e=>!e),"aria-expanded":i,disabled:t,children:(0,R.jsxs)(a,{gap:4,children:[i?(0,R.jsx)(x,{size:14}):(0,R.jsx)(v,{size:14}),(0,R.jsx)(o,{size:`xs`,c:`dimmed`,children:t?`L'agent travaille…`:`Raisonnement et outils (${e.length} étapes)`})]})}),(0,R.jsx)(E,{expanded:i,children:(0,R.jsx)(b,{gap:6,pl:`md`,children:e.map(e=>{let t=B[e.kind];return(0,R.jsxs)(a,{gap:6,align:`flex-start`,wrap:`nowrap`,children:[(0,R.jsx)(t,{size:14,style:{marginTop:3,flexShrink:0}}),(0,R.jsxs)(b,{gap:2,style:{minWidth:0},children:[e.kind===`tool_call`?(0,R.jsx)(m,{children:e.label}):(0,R.jsx)(o,{size:`xs`,fw:600,children:e.label}),e.detail&&(0,R.jsx)(o,{size:`xs`,c:`dimmed`,ff:`monospace`,style:{whiteSpace:`pre-wrap`},children:e.detail})]})]},`${e.kind}-${e.label}`)})})})]})}function W({citations:e}){return(0,R.jsx)(a,{gap:6,children:e.map(e=>(0,R.jsxs)(w,{variant:`outline`,size:`sm`,tt:`none`,children:[`[`,e.index,`] `,e.source,e.page?` p.${e.page}`:``,` · `,e.score.toFixed(2)]},e.index))})}function G({message:e}){let n=e.role===`user`,i=e.steps??[];return(0,R.jsxs)(a,{align:`flex-start`,wrap:`nowrap`,justify:n?`flex-end`:`flex-start`,children:[!n&&(0,R.jsx)(S,{radius:`xl`,p:6,bg:`dark.6`,children:(0,R.jsx)(r,{size:18})}),(0,R.jsx)(S,{radius:`md`,p:`sm`,withBorder:!0,bg:n?`orange.9`:void 0,style:{maxWidth:`75%`},children:(0,R.jsxs)(b,{gap:`xs`,children:[!n&&e.agent&&(0,R.jsx)(o,{size:`xs`,c:`dimmed`,ff:`monospace`,children:e.agent}),!n&&i.length>0&&(0,R.jsx)(U,{steps:i,live:!!e.streaming&&!e.content}),(e.content||!e.streaming)&&(0,R.jsxs)(o,{size:`sm`,style:{whiteSpace:`pre-wrap`},children:[e.content,e.streaming&&(0,R.jsx)(o,{span:!0,c:`dimmed`,children:`▍`})]}),e.aborted&&(0,R.jsx)(o,{size:`xs`,c:`orange`,children:`Réponse interrompue.`}),e.citations&&e.citations.length>0&&(0,R.jsx)(W,{citations:e.citations}),e.usage&&(0,R.jsxs)(o,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[e.usage.model,` · `,e.usage.inputTokens,` jetons en entrée · `,e.usage.outputTokens,` en sortie ·`,` `,e.usage.costEur.toFixed(4),` €`]})]})}),n&&(0,R.jsx)(S,{radius:`xl`,p:6,bg:`orange.7`,children:(0,R.jsx)(t,{size:18})})]})}export{V as Chat};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{Dr as t,Ki as n,Si as r,Ui as i,Zi as a,ci as o,gi as s,la as c,li as l,oi as u,pi as d,sa as f,ua as p,vi as m,wa as h}from"./ui-NqIPktVY.js";var g=e(h(),1),_=r(),v=l(e=>{let{value:t,defaultValue:r,onChange:i,multiple:a,children:o}=m(`ChipGroup`,null,e),[s,c]=n({value:t,defaultValue:r,finalValue:a?[]:null,onChange:i});return(0,_.jsx)(y,{value:{isChipSelected:e=>Array.isArray(s)?s.includes(e):e===s,onChange:e=>{let t=e.currentTarget.value;c(Array.isArray(s)?s.includes(t)?s.filter(e=>e!==t):[...s,t]:t)},multiple:a},children:o})});v.displayName=`@mantine/core/ChipGroup`;var y=(0,g.createContext)(null),b={root:`m_f59ffda3`,label:`m_be049a53`,"label--outline":`m_3904c1af`,"label--filled":`m_fa109255`,"label--light":`m_f7e165c3`,iconWrapper:`m_9ac86df9`,checkIcon:`m_d6d72580`,input:`m_bde07329`},x={type:`checkbox`},S=i((e,{size:t,radius:n,variant:r,color:i,autoContrast:a})=>{let o=e.variantColorResolver({color:i||e.primaryColor,theme:e,variant:r||`filled`,autoContrast:a});return{root:{"--chip-fz":f(t),"--chip-size":p(t,`chip-size`),"--chip-radius":n===void 0?void 0:c(n),"--chip-checked-padding":p(t,`chip-checked-padding`),"--chip-padding":p(t,`chip-padding`),"--chip-icon-size":p(t,`chip-icon-size`),"--chip-bg":i||r?o.background:void 0,"--chip-hover":i||r?o.hover:void 0,"--chip-color":i||r?o.color:void 0,"--chip-bd":i||r?o.border:void 0,"--chip-spacing":p(t,`chip-spacing`)}}}),C=o(e=>{let r=m(`Chip`,x,e),{classNames:i,className:o,style:c,styles:l,unstyled:f,vars:p,id:h,checked:v,defaultChecked:C,onChange:w,value:T,wrapperProps:E,type:D,disabled:O,children:k,size:A,variant:j,icon:M,rootRef:N,autoContrast:P,mod:F,attributes:I,readOnly:L,...R}=r,z=s({name:`Chip`,classes:b,props:r,className:o,style:c,classNames:i,styles:l,unstyled:f,attributes:I,vars:p,varsResolver:S}),B=(0,g.use)(y),V=a(h),{styleProps:H,rest:U}=d(R),[W,G]=n({value:v,defaultValue:C,finalValue:!1,onChange:w}),K=B?{checked:B.isChipSelected(T),onChange:e=>{L||(B.onChange(e),w?.(e.currentTarget.checked))},type:B.multiple?`checkbox`:`radio`}:{},q=K.checked||W;return(0,_.jsxs)(u,{size:A,variant:j,ref:N,mod:F,...z(`root`),...H,...E,children:[(0,_.jsx)(`input`,{type:D,...z(`input`),checked:q,onChange:e=>!L&&G(e.currentTarget.checked),id:V,disabled:O,readOnly:L,value:T,...K,...U}),(0,_.jsxs)(u,{component:`label`,htmlFor:V,mod:{checked:q,disabled:O},...z(`label`,{variant:j||`filled`}),children:[q&&M!==null&&M!==!1&&(0,_.jsx)(`span`,{...z(`iconWrapper`),children:M===void 0?(0,_.jsx)(t,{...z(`checkIcon`)}):M}),(0,_.jsx)(`span`,{children:k})]})]})});C.classes=b,C.varsResolver=S,C.displayName=`@mantine/core/Chip`,C.Group=v;export{C as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{C as t,Et as n,F as r,U as i,bt as a,ct as o,ft as s,it as c,lt as l,rt as u,x as d}from"./index-Bxrb_NNJ.js";import{Jr as f,Kt as p,Nr as m,Pr as ee,Qn as h,Si as g,X as _,Xt as v,Y as y,a as b,ar as te,br as x,f as S,fr as C,gn as w,m as T,mr as E,nr as D,nt as ne,on as O,p as k,pn as A,pr as re,ri as j,tt as M,wa as N,xr as P,yr as F,zn as I}from"./ui-NqIPktVY.js";import{l as L}from"./hooks-C5izbcnh.js";import{c as R,l as z}from"./stores-CsHxacRb.js";import{n as B}from"./realtimeHealth-ClmV7IKO.js";var V=e(N(),1),H=g(),U=`v1.1`,W=40,G=1024**2;function K(e,t){let n=e.length>=W?e.slice(e.length-W+1):e.slice();return n.push(t),n}function q(e){return e<1024?`${e} o`:e<1048576?`${Math.round(e/1024)} Ko`:e<1073741824?`${(e/1024/1024).toFixed(1)} Mo`:`${(e/1024/1024/1024).toFixed(2)} Go`}function J(e){if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}min`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60);return n?`${t}h${n}`:`${t}h`}function Y(e){return e>=90?`red`:e>=70?`orange`:`teal`}function X(e){return e>=120?`red`:e>=50?`orange`:`teal`}function ie({intervalMs:e,adaptive:t,onData:n,onRate:r}){let{realtime:i}=R(),{data:a,intervalMs:o}=s(i,I.socket,e,{defaultMs:5e3,enabled:t});return d(a,e=>{e&&n(e)}),d(o,r),null}function Z({label:e,value:t,color:n,info:r}){return(0,H.jsxs)(`div`,{style:{minWidth:0},children:[(0,H.jsxs)(f,{gap:4,wrap:`nowrap`,children:[(0,H.jsx)(m,{size:`xs`,c:`dimmed`,truncate:!0,children:e}),r]}),(0,H.jsx)(m,{fw:600,c:n,style:{fontVariantNumeric:`tabular-nums`},children:(0,H.jsx)(k,{value:t,children:t})})]})}function Q({label:e,data:t,color:n,unit:r,max:i,threshold:a}){let o=t.length?t[t.length-1]:0;return(0,H.jsxs)(`div`,{style:{minWidth:0},children:[(0,H.jsxs)(f,{gap:4,justify:`space-between`,wrap:`nowrap`,children:[(0,H.jsx)(m,{size:`xs`,c:`dimmed`,truncate:!0,children:e}),(0,H.jsxs)(m,{size:`xs`,fw:600,style:{fontVariantNumeric:`tabular-nums`},children:[o,r]})]}),(0,H.jsx)(b,{series:[{data:t,color:n,label:e}],height:34,max:i,threshold:a})]})}function ae({inst:e,live:t,index:n,series:r,onSelect:i}){let o=e.process,s=e.channels.map(e=>e.channel).join(`, `)||`aucun`,l=t&&!!r&&r.cpu.length>1;return(0,H.jsxs)(F,{withBorder:!0,radius:`md`,p:`md`,h:`100%`,className:t?`nf-live-card`:void 0,style:{contain:`content`},children:[(0,H.jsxs)(f,{justify:`space-between`,wrap:`nowrap`,mb:`sm`,children:[(0,H.jsx)(j,{onClick:i,"aria-label":`Voir le détail du worker ${n+1} (pid ${e.instanceId})`,style:{flex:1,minWidth:0,borderRadius:8},children:(0,H.jsxs)(f,{gap:`xs`,wrap:`nowrap`,children:[(0,H.jsx)(h,{variant:`light`,color:`brand`,radius:`md`,children:(0,H.jsx)(c,{size:18})}),(0,H.jsxs)(`div`,{style:{minWidth:0},children:[(0,H.jsxs)(f,{gap:4,wrap:`nowrap`,children:[(0,H.jsxs)(m,{fw:600,children:[`worker `,n+1]}),(0,H.jsx)(O,{size:14,style:{opacity:.5}})]}),(0,H.jsxs)(m,{size:`xs`,c:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:[`pid `,e.instanceId]})]})]})}),o?(0,H.jsx)(P,{variant:`light`,color:`gray`,children:(0,H.jsx)(k,{value:J(o.uptime),children:J(o.uptime)})}):null]}),(0,H.jsx)(E,{label:(0,H.jsxs)(f,{gap:4,wrap:`nowrap`,children:[(0,H.jsx)(m,{inherit:!0,children:`Process`}),l?(0,H.jsx)(_,{title:`Courbes live du worker`,version:U,summary:`CPU, heap et event-loop sur les dernières mesures — séries dérivées des snapshots pod (par pid), 0 état serveur.`,sections:[{label:`Lecture`,body:`CPU = % d'un cœur (≈100 = saturé). Event-loop > 50 ms = blocage synchrone (seuil orange).`}]}):null]}),labelPosition:`left`,mb:`xs`,styles:{label:{fontSize:11}}}),l?(0,H.jsxs)(a,{cols:3,spacing:`xs`,mb:`sm`,children:[(0,H.jsx)(Q,{label:`CPU`,data:r.cpu,color:`var(--mantine-color-teal-6)`,unit:`%`,max:100}),(0,H.jsx)(Q,{label:`Heap`,data:r.heap,color:`var(--mantine-color-blue-6)`,unit:` Mo`}),(0,H.jsx)(Q,{label:`Event-loop`,data:r.loop,color:`var(--mantine-color-grape-6)`,unit:` ms`,threshold:50})]}):null,o?(0,H.jsxs)(a,{cols:3,spacing:`xs`,mb:`sm`,children:[(0,H.jsx)(Z,{label:`CPU`,value:`${o.cpuPercent}%`,color:Y(o.cpuPercent)}),(0,H.jsx)(Z,{label:`Event-loop`,value:`${o.eventLoopMs} ms`,color:X(o.eventLoopMs),info:(0,H.jsx)(y,{title:`Event-loop lag`,version:U,summary:`Retard moyen de la boucle d'événements sur l'intervalle (blocage synchrone).`,sections:[{label:`À surveiller`,body:`En dev, le process partage la boucle avec Vite/HMR (15-25 ms normal). Seuils relâchés : orange ≥ 50 ms, rouge ≥ 120 ms.`}]})}),(0,H.jsx)(Z,{label:`ELU`,value:o.eluUtilization.toFixed(2),color:X(o.eventLoopMs)}),(0,H.jsx)(Z,{label:`RSS`,value:q(o.rss)}),(0,H.jsx)(Z,{label:`Heap`,value:q(o.heapUsed)}),(0,H.jsx)(Z,{label:`Hors-heap`,value:q(o.external)})]}):(0,H.jsx)(m,{size:`xs`,c:`dimmed`,mb:`sm`,children:`Sonde process désactivée.`}),(0,H.jsx)(E,{label:`Socket`,labelPosition:`left`,mb:`xs`,styles:{label:{fontSize:11}}}),(0,H.jsxs)(a,{cols:3,spacing:`xs`,children:[(0,H.jsx)(Z,{label:`Canaux`,value:e.channelCount,info:(0,H.jsx)(y,{title:`Canaux actifs`,version:U,summary:`Canaux avec ≥ 1 abonné sur ce worker : ${s}.`})}),(0,H.jsx)(Z,{label:`Connexions`,value:e.connectionCount}),(0,H.jsx)(Z,{label:`Fan-out`,value:e.fanoutTotal,info:(0,H.jsx)(y,{title:`Fan-out cumulé`,version:U,summary:`Livraisons cumulées (publish × abonnés) depuis le boot du worker — vrai coût de diffusion.`})}),(0,H.jsx)(Z,{label:`Backpressure`,value:q(e.backpressure.totalBufferedAmount),color:e.backpressure.totalBufferedAmount>0?`orange`:void 0,info:(0,H.jsx)(y,{title:`Backpressure (bufferedAmount)`,version:U,summary:`Octets en file d'envoi non drainés vers le réseau. > 0 durablement = consommateur lent → la file grossit → pression mémoire (blocker #1 du multiplexing).`,sections:[{label:`Si > 0`,body:`${e.backpressure.slowConsumers} connexion(s) lente(s) ; pire file ${q(e.backpressure.maxBufferedAmount)}.`}]})}),(0,H.jsx)(Z,{label:`Octets envoyés`,value:q(e.bytesSentTotal)}),(0,H.jsx)(Z,{label:`Frames`,value:e.messagesSentTotal})]}),e.orm?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(E,{label:`ORM`,labelPosition:`left`,mt:`sm`,mb:`xs`,styles:{label:{fontSize:11}}}),(0,H.jsxs)(a,{cols:3,spacing:`xs`,children:[(0,H.jsx)(Z,{label:`Requêtes`,value:e.orm.queryTotal,info:(0,H.jsx)(y,{title:`Requêtes ORM`,version:U,summary:`Requêtes cumulées de ce worker depuis le boot (tous connecteurs).`,sections:[{label:`Si 0`,body:`La sonde de flux ORM est OFF (par défaut en production) — activer via NF_ORM_FLOW=1. Les erreurs/connecteurs restent comptés.`}]})}),(0,H.jsx)(Z,{label:`Lentes`,value:e.orm.slowTotal,color:e.orm.slowTotal>0?`orange`:void 0}),(0,H.jsx)(Z,{label:`Latence EWMA`,value:e.orm.maxEwmaMs===null?`—`:`${e.orm.maxEwmaMs} ms`,info:(0,H.jsx)(y,{title:`Latence EWMA`,version:U,summary:`Pire latence moyenne lissée (EWMA) parmi les connecteurs du worker.`})}),(0,H.jsx)(Z,{label:`Connecteurs`,value:`${e.orm.connected}/${e.orm.connectors}`,color:e.orm.connected<e.orm.connectors?`orange`:void 0}),(0,H.jsx)(Z,{label:`Erreurs ORM`,value:e.orm.errorTotal,color:e.orm.errorTotal>0?`orange`:void 0}),(0,H.jsx)(Z,{label:`Reconnexions`,value:e.orm.reconnectTotal})]})]}):null,e.errors?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(E,{label:`Erreurs (logs)`,labelPosition:`left`,mt:`sm`,mb:`xs`,styles:{label:{fontSize:11}}}),(0,H.jsxs)(a,{cols:2,spacing:`xs`,children:[(0,H.jsx)(Z,{label:`Erreurs`,value:e.errors.errorTotal,info:(0,H.jsx)(y,{title:`Erreurs Syslog (worker)`,version:U,summary:`Logs ERROR/CRITIC/ALERT/EMERGENCY cumulés depuis le boot du worker (compteur monotone).`,sections:[{label:`Lecture`,body:`Un compteur élevé n'est pas forcément grave (cumul). Le taux d'erreur se dérive de l'évolution dans le temps.`}]})}),(0,H.jsx)(Z,{label:`Critiques`,value:e.errors.criticTotal,color:e.errors.criticTotal>0?`red`:void 0})]})]}):null]})}var $=n(()=>{let e=R(),n=z(),s=L();(0,V.useEffect)(T,[]);let c=(0,V.useCallback)(()=>e.api.getAbsolute(`/nodefony/realtime/api/health`),[e]),{data:d,loading:h,error:g,reload:_}=t(c),b=n.realtimeLive,[E,O]=(0,V.useState)(5e3),j=n.adaptiveCadence,[N,F]=(0,V.useState)(E),[I,W]=(0,V.useState)(null),[J,Y]=(0,V.useState)(new Map);(0,V.useEffect)(()=>{b||(W(null),Y(new Map))},[b]),(0,V.useEffect)(()=>{if(!b||!I)return;let e=B(I);e&&Y(t=>{let n=new Map(t),r=new Set;for(let t of e.instances){r.add(t.instanceId);let e=t.process;if(!e)continue;let i=n.get(t.instanceId)??{cpu:[],heap:[],loop:[]};n.set(t.instanceId,{cpu:K(i.cpu,e.cpuPercent),heap:K(i.heap,Math.round(e.heapUsed/G)),loop:K(i.loop,e.eventLoopMs)})}for(let e of n.keys())r.has(e)||n.delete(e);return n})},[I,b]);let X=B(b?I??d:d),Z=X?.instances??[],Q=X?.totals;return(0,H.jsxs)(ne,{gap:`lg`,title:`Cluster`,subtitle:X?X.cluster?`${Z.length} worker(s) — vue pod agrégée`:`Mono-process — 1 worker`:`Salle des machines du pod`,actions:(0,H.jsxs)(f,{gap:`sm`,children:[j&&b?(0,H.jsxs)(P,{variant:`light`,color:`grape`,leftSection:(0,H.jsx)(A,{size:12}),children:[`AIMD ~`,Math.round(N/1e3),`s`]}):null,(0,H.jsxs)(C,{width:300,shadow:`md`,position:`bottom-end`,openDelay:120,closeDelay:120,children:[(0,H.jsx)(C.Target,{children:(0,H.jsx)(`div`,{children:(0,H.jsx)(D,{size:`sm`,checked:b,onChange:e=>n.setRealtimeLive(e.currentTarget.checked),label:`Temps réel`,"aria-label":`abonnement temps réel (socket Nodefony) de la vue cluster`})})}),(0,H.jsxs)(C.Dropdown,{children:[(0,H.jsxs)(f,{gap:6,mb:6,children:[(0,H.jsx)(A,{size:14}),(0,H.jsx)(m,{size:`xs`,fw:600,children:j?`Cadence désirée (plancher)`:`Granularité du canal`})]}),(0,H.jsx)(te,{fullWidth:!0,size:`xs`,value:String(E),onChange:e=>O(Number(e)),data:[{label:`2 s`,value:`2000`},{label:`5 s`,value:`5000`},{label:`10 s`,value:`10000`},{label:`30 s`,value:`30000`}]}),(0,H.jsx)(m,{size:`xs`,c:`dimmed`,mt:6,children:j?`Cadence auto (AIMD) ACTIVE — réglée globalement dans le Hub. Cette valeur sert de plancher.`:`Cadence des pushes de la socket (santé cluster). Cadence auto réglable dans le Hub.`})]})]}),(0,H.jsx)(x,{variant:`light`,leftSection:(0,H.jsx)(p,{size:16}),loading:h,onClick:_,children:`Recharger`})]}),children:[b?(0,H.jsx)(ie,{intervalMs:E,adaptive:j,onData:W,onRate:F}):null,X&&!X.cluster?(0,H.jsxs)(ee,{variant:`light`,color:`blue`,icon:(0,H.jsx)(v,{size:18}),title:`Mode mono-process`,children:[`Ce process tourne seul (pas de cluster). Pour la vue pod agrégée, lancer`,` `,(0,H.jsx)(m,{span:!0,ff:`monospace`,fz:`sm`,children:`nodefony cluster -w N`}),` `,`(N workers). Chaque worker remonte alors sa santé au master.`]}):null,(0,H.jsxs)(M,{loading:h&&!X,error:g,empty:!Z.length,onRetry:_,emptyMessage:`Aucune santé worker disponible.`,children:[Q?(0,H.jsxs)(re,{children:[(0,H.jsx)(S,{icon:(0,H.jsx)(r,{size:20}),label:`Workers`,accent:`brand`,pulse:b,value:(0,H.jsx)(k,{value:Z.length,children:Z.length}),info:(0,H.jsx)(y,{title:`Workers`,version:U,summary:X.cluster?`${Z.length} worker(s) dans le pod (snapshot agrégé poussé par le master).`:`Mono-process : 1 seul worker (pas de cluster).`})}),(0,H.jsx)(S,{icon:(0,H.jsx)(i,{size:20}),label:`Connexions`,accent:`teal`,pulse:b,value:(0,H.jsx)(k,{value:Q.connectionCount,children:Q.connectionCount}),info:(0,H.jsx)(y,{title:`Connexions realtime`,version:U,summary:`Connexions WebSocket vivantes, tous workers du pod confondus.`})}),(0,H.jsx)(S,{icon:(0,H.jsx)(o,{size:20}),label:`Fan-out`,accent:`grape`,pulse:b,value:(0,H.jsx)(k,{value:Q.fanoutTotal,children:Q.fanoutTotal}),info:(0,H.jsx)(y,{title:`Fan-out cumulé (pod)`,version:U,summary:`Livraisons cumulées (publish × abonnés) sur l'ensemble des workers depuis leur boot.`})}),(0,H.jsx)(S,{icon:(0,H.jsx)(l,{size:20}),label:`Backpressure`,accent:Q.backpressure.totalBufferedAmount>0?`orange`:`gray`,pulse:b,value:(0,H.jsx)(k,{value:Q.backpressure.totalBufferedAmount,children:q(Q.backpressure.totalBufferedAmount)}),info:(0,H.jsx)(y,{title:`Backpressure pod`,version:U,summary:`Somme des octets en file d'envoi non drainés, tous workers — risque mémoire #1 du multiplexing.`,sections:[{label:`Si > 0`,body:`${Q.backpressure.slowConsumers} connexion(s) lente(s) dans le pod ; pire file ${q(Q.backpressure.maxBufferedAmount)}.`}]})}),Q.orm?(0,H.jsx)(S,{icon:(0,H.jsx)(u,{size:20}),label:`Requêtes ORM`,accent:Q.orm.slowTotal>0?`orange`:`cyan`,pulse:b,value:(0,H.jsx)(k,{value:Q.orm.queryTotal,children:Q.orm.queryTotal}),info:(0,H.jsx)(y,{title:`ORM (pod)`,version:U,summary:`Requêtes ORM cumulées, tous workers — agrégat des sondes ORM par worker.`,sections:[{label:`Détail`,body:`${Q.orm.connected}/${Q.orm.connectors} connecteur(s) connecté(s) ; ${Q.orm.slowTotal} lente(s) ; ${Q.orm.errorTotal} erreur(s) ORM ; pire latence EWMA ${Q.orm.maxEwmaMs===null?`—`:`${Q.orm.maxEwmaMs} ms`}.`},{label:`Si 0`,body:`Flux ORM OFF (défaut prod) — NF_ORM_FLOW=1 pour compter les requêtes.`}]})}):null,Q.errors?(0,H.jsx)(S,{icon:(0,H.jsx)(w,{size:20}),label:`Erreurs (logs)`,accent:Q.errors.criticTotal>0?`red`:`gray`,pulse:b,value:(0,H.jsx)(k,{value:Q.errors.errorTotal,children:Q.errors.errorTotal}),info:(0,H.jsx)(y,{title:`Erreurs Syslog (pod)`,version:U,summary:`Logs ERROR/CRITIC/ALERT/EMERGENCY cumulés, tous workers (compteurs monotones).`,sections:[{label:`Détail`,body:`${Q.errors.criticTotal} critique(s) (CRITIC/ALERT/EMERGENCY) dans le pod.`}]})}):null]}):null,(0,H.jsx)(a,{cols:{base:1,md:2,xl:3},spacing:`md`,mt:`md`,children:Z.map((e,t)=>(0,H.jsx)(ae,{inst:e,live:b,index:t,series:J.get(e.instanceId),onSelect:()=>void s(`/nodefony/supervision?pid=${e.instanceId}`)},e.instanceId))})]})]})});export{$ as Cluster,$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{$i as t,Ca as n,Gi as r,Ji as i,Oi as a,Si as o,bi as s,ci as c,oi as l,ui as u,vi as d,wa as f}from"./ui-NqIPktVY.js";var p=e(f(),1),m=e(n(),1);function h(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function g(e){return e.current?e.current.scrollHeight:`auto`}function _(e){return typeof e==`number`&&e>0}function v({transitionDuration:e,transitionTimingFunction:n=`ease`,onTransitionEnd:r,onTransitionStart:a,expanded:o,keepMounted:s}){let c={height:0,overflow:`hidden`,...s?{}:{display:`none`}},l=(0,p.useEffectEvent)(()=>a?.()),u=(0,p.useEffectEvent)(()=>r?.()),d=(0,p.useRef)(null),[f,v]=(0,p.useState)(o?{}:c),[y,b]=(0,p.useState)(o?`entered`:`exited`),x=e=>{(0,m.flushSync)(()=>v(e))},S=e=>{x(t=>({...t,...e}))},C=t=>{let r=e??h(t);return{transition:`height ${r}ms ${n}, opacity ${r}ms ${n}`}},w=(0,p.useRef)(0);t(()=>{w.current+=1;let t=w.current,n=()=>w.current===t;e!==0&&l(),o?window.requestAnimationFrame(()=>{n()&&d.current&&((0,m.flushSync)(()=>b(`entering`)),S({willChange:`height`,display:`block`,overflow:`hidden`}),window.requestAnimationFrame(()=>{if(!n()||!d.current)return;let e=g(d);_(e)?S({...C(e),height:e}):(x({}),b(`entered`),u())}))}):window.requestAnimationFrame(()=>{if(!n()||!d.current)return;(0,m.flushSync)(()=>b(`exiting`));let e=g(d);_(e)?(S({...C(e),willChange:`height`,height:e}),window.requestAnimationFrame(()=>{n()&&d.current&&S({height:0,overflow:`hidden`})})):(x(c),b(`exited`),u())})},[o]);let T=e=>{if(e.target===d.current&&e.propertyName===`height`){if(o){let e=g(d);e===f.height?x({}):S({height:e}),b(`entered`),u()}else f.height===0&&(x(c),b(`exited`),u())}};return{state:y,getCollapseProps:e=>({"aria-hidden":!o,inert:!o,ref:i(d,e?.ref),onTransitionEnd:T,style:{boxSizing:`border-box`,...e?.style,...f}})}}function y(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function b(e){return e.current?e.current.scrollWidth:`auto`}function x({transitionDuration:e,transitionTimingFunction:n=`ease`,onTransitionEnd:r,onTransitionStart:a,expanded:o,keepMounted:s}){let c={width:0,overflow:`hidden`,...s?{}:{display:`none`}},l=(0,p.useEffectEvent)(()=>a?.()),u=(0,p.useEffectEvent)(()=>r?.()),d=(0,p.useRef)(null),[f,h]=(0,p.useState)(o?{}:c),[g,v]=(0,p.useState)(o?`entered`:`exited`),x=e=>{(0,m.flushSync)(()=>h(e))},S=e=>{x(t=>({...t,...e}))},C=t=>{let r=e??y(t);return{transition:`width ${r}ms ${n}, opacity ${r}ms ${n}`}},w=(0,p.useRef)(0);t(()=>{w.current+=1;let t=w.current,n=()=>w.current===t;e!==0&&l(),o?window.requestAnimationFrame(()=>{n()&&d.current&&((0,m.flushSync)(()=>v(`entering`)),S({willChange:`width`,display:`block`,overflow:`hidden`}),window.requestAnimationFrame(()=>{if(!n()||!d.current)return;let e=b(d);_(e)?S({...C(e),width:e}):(x({}),v(`entered`),u())}))}):window.requestAnimationFrame(()=>{if(!n()||!d.current)return;(0,m.flushSync)(()=>v(`exiting`));let e=b(d);_(e)?(S({...C(e),willChange:`width`,width:e}),window.requestAnimationFrame(()=>{n()&&d.current&&S({width:0,overflow:`hidden`})})):(x(c),v(`exited`),u())})},[o]);let T=e=>{if(e.target===d.current&&e.propertyName===`width`){if(o){let e=b(d);e===f.width?x({}):S({width:e}),v(`entered`),u()}else f.width===0&&(x(c),v(`exited`),u())}};return{state:g,getCollapseProps:e=>({"aria-hidden":!o,inert:!o,ref:i(d,e?.ref),onTransitionEnd:T,style:{boxSizing:`border-box`,...e?.style,...f}})}}var S=o(),C={transitionDuration:200,transitionTimingFunction:`ease`,animateOpacity:!0,orientation:`vertical`,keepMounted:!0,keepMountedMode:`activity`},w=c(e=>{let{children:t,expanded:n,transitionDuration:i,transitionTimingFunction:o,style:c,onTransitionEnd:f,onTransitionStart:m,animateOpacity:h,keepMounted:g,keepMountedMode:_,ref:y,orientation:b,...w}=d(`Collapse`,C,e),T=a(),E=s(),D=r(),O=E.respectReducedMotion&&D?0:i,k=(b===`horizontal`?x:v)({expanded:n,transitionDuration:O,transitionTimingFunction:o,onTransitionEnd:f,onTransitionStart:m,keepMounted:!1});if(O===0)return g===!0&&(_===`display-none`||T!==`test`)?_===`display-none`?(0,S.jsx)(l,{...w,style:{...u(c,E),...n?{}:{display:`none`}},ref:y,children:t}):(0,S.jsx)(p.Activity,{mode:n?`visible`:`hidden`,children:(0,S.jsx)(l,{...w,style:c,ref:y,children:t})}):n?(0,S.jsx)(l,{...w,style:c,ref:y,children:t}):null;let A=k.state===`exited`,j;return j=g===!1?A?null:t:g===!0?_===`display-none`?t:(0,S.jsx)(p.Activity,{mode:A?`hidden`:`visible`,children:t}):t,(0,S.jsx)(l,{...w,...k.getCollapseProps({style:{opacity:n||!h?1:0,transition:h?`opacity ${O}ms ${o}`:`none`,...u(c,E),...g&&_===`display-none`&&A?{display:`none`}:{}},ref:y}),children:j})});w.displayName=`@mantine/core/Collapse`;export{w as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{$ as t,$n as n,$t as r,Gt as i,J as a,Jr as o,Jt as s,Kt as c,Nr as l,Pr as u,Qn as d,R as f,Ri as p,Si as m,Ui as h,Xr as g,Xt as _,Y as v,Zn as y,ar as ee,br as b,c as x,ci as S,cn as C,gi as w,gn as T,gr as E,hn as te,hr as D,it as ne,l as O,n as re,nn as ie,oi as k,on as A,or as j,pn as ae,pr as M,ri as N,rr as P,si as F,ti as I,tr as L,tt as oe,u as se,ua as ce,vi as R,vn as le,wa as ue,xr as z,yr as B}from"./ui-NqIPktVY.js";import{C as V,Et as de,F as fe,T as pe,X as me,_t as he,bt as ge}from"./index-Bxrb_NNJ.js";import{l as _e}from"./hooks-C5izbcnh.js";import{t as H}from"./Progress-Jl9Xrd62.js";import{t as ve}from"./IconAdjustmentsAlt-BYYo82z6.js";import{t as ye}from"./IconEye-Bzn7AU39.js";import{t as be}from"./IconPackages-BzsI-Li9.js";import{t as xe}from"./IconServer2-DAA64x6c.js";import{t as Se}from"./IconStack2-CMC-_hkZ.js";import{c as Ce}from"./stores-CsHxacRb.js";import{a as we,c as Te,i as Ee,l as De,n as Oe,o as ke,r as Ae,s as U,t as je}from"./configEdit-BhbQlj6k.js";import{t as Me}from"./RingProgress-xUUyRmUq.js";import{t as Ne}from"./IconCircleCheck-DkVi0NqA.js";import{t as Pe}from"./IconWorld-CIpRNsHH.js";var Fe={" ":`space`,ArrowLeft:`arrowleft`,ArrowRight:`arrowright`,ArrowUp:`arrowup`,ArrowDown:`arrowdown`,Escape:`escape`,Esc:`escape`,esc:`escape`,Enter:`enter`,Tab:`tab`,Backspace:`backspace`,Delete:`delete`,Insert:`insert`,Home:`home`,End:`end`,PageUp:`pageup`,PageDown:`pagedown`,"+":`plus`,"-":`minus`,"*":`asterisk`,"/":`slash`};function W(e){let t=e.replace(/^Key/i,``).toLowerCase();return Fe[e]||t}function Ie(e){let t=e.toLowerCase().split(`+`).map(e=>e.trim()),n={alt:t.includes(`alt`),ctrl:t.includes(`ctrl`),meta:t.includes(`meta`),mod:t.includes(`mod`),shift:t.includes(`shift`)},r=[`alt`,`ctrl`,`meta`,`shift`,`mod`],i=t.find(e=>!r.includes(e));return{...n,key:i===`[plus]`?`+`:i}}function Le(e,t,n){let{alt:r,ctrl:i,meta:a,mod:o,shift:s,key:c}=e,{altKey:l,ctrlKey:u,metaKey:d,shiftKey:f,key:p,code:m}=t;if(r!==l)return!1;if(o){if(!u&&!d)return!1}else if(i!==u||a!==d)return!1;return s===f&&!!(c&&(n?W(m)===W(c):W(p??m)===W(c)))}function Re(e,t){return n=>Le(Ie(e),n,t)}var G=e(ue(),1);function ze(e,t,n=!1){return e.target instanceof HTMLElement?(n||!e.target.isContentEditable)&&!t.includes(e.target.tagName):!0}function Be(e,t=[`INPUT`,`TEXTAREA`,`SELECT`],n=!1){let r=(0,G.useEffectEvent)(r=>{e.forEach(([e,i,a])=>{let{preventDefault:o=!0,usePhysicalKeys:s=!1}=a||{};Re(e,s)(r)&&ze(r,t,n)&&(o&&r.preventDefault(),i(r))})});(0,G.useEffect)(()=>(document.documentElement.addEventListener(`keydown`,r),()=>document.documentElement.removeEventListener(`keydown`,r)),[])}function Ve({color:e,theme:t,defaultShade:n}){let r=p({color:e,theme:t});return r.isThemeColor?r.shade===void 0?`var(--mantine-color-${r.color}-${n})`:`var(${r.variable})`:e}var He={root:`m_bcb3f3c2`},K=m(),Ue={color:`yellow`},We=h((e,{color:t})=>({root:{"--mark-bg-dark":Ve({color:t,theme:e,defaultShade:5}),"--mark-bg-light":Ve({color:t,theme:e,defaultShade:2})}})),q=S(e=>{let t=R(`Mark`,Ue,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,color:c,variant:l,attributes:u,...d}=t,f=w({name:`Mark`,props:t,className:r,style:i,classes:He,classNames:n,styles:a,unstyled:o,attributes:u,vars:s,varsResolver:We});return(0,K.jsx)(k,{component:`mark`,variant:l,...f(`root`),...d})});q.classes=He,q.varsResolver=We,q.displayName=`@mantine/core/Mark`;function Ge(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`)}function Ke(e){return e.normalize(`NFD`).replace(/\p{M}/gu,``)}function qe(e){let t=``,n=[],r=0;for(;r<e.length;){let i=e.codePointAt(r),a=String.fromCodePoint(i),o=Ke(a);for(let e=0;e<o.length;e+=1)n.push(r);t+=o,r+=a.length}return n.push(e.length),{folded:t,map:n}}function Je(e,t){let{folded:n,map:r}=qe(e),i=[],a=0,o;for(;(o=t.exec(n))!==null;){let n=o.index,s=n+o[0].length,c=r[n],l=r[s];c>a&&i.push({chunk:e.slice(a,c),highlighted:!1}),i.push({chunk:e.slice(c,l),highlighted:!0}),a=l,o[0].length===0&&(t.lastIndex+=1)}return a<e.length&&i.push({chunk:e.slice(a),highlighted:!1}),i.filter(({chunk:e})=>e)}function Ye(e,t,n={}){if(t==null)return[{chunk:e,highlighted:!1}];let{wholeWord:r=!1,caseInsensitive:i=!0,accentInsensitive:a=!0}=n,o=e=>a?Ke(Ge(e)):Ge(e),s=Array.isArray(t)?t.map(o):o(t);if(!(Array.isArray(s)?s.filter(e=>e.trim().length>0).length>0:s.trim()!==``))return[{chunk:e,highlighted:!1}];let c=typeof s==`string`?s.trim():s.filter(e=>e.trim().length!==0).map(e=>e.trim()).sort((e,t)=>t.length-e.length).join(`|`),l=r?`(?<![\\p{L}\\p{N}_])(${c})(?![\\p{L}\\p{N}_])`:`(${c})`,u=[`g`,i?`i`:``,r?`u`:``].join(``),d=new RegExp(l,u);return a?Je(e,d):e.split(d).map((e,t)=>({chunk:e,highlighted:t%2==1})).filter(({chunk:e})=>e)}var Xe={color:`yellow`,wholeWord:!1,caseInsensitive:!0,accentInsensitive:!0},Ze=F(e=>{let{unstyled:t,children:n,highlight:r,highlightStyles:i,color:a,wholeWord:o,caseInsensitive:s,accentInsensitive:c,...u}=R(`Highlight`,Xe,e),d=Array.isArray(r)&&typeof r[0]==`object`,f=new Map,p=e=>{let t=e;return s&&(t=t.toLowerCase()),c&&(t=Ke(t)),t},m;m=d?r.map(e=>(e.color&&f.set(p(e.text),e.color),e.text)):Array.isArray(r)?r:[r];let h=Ye(n,m,{wholeWord:o,caseInsensitive:s,accentInsensitive:c});return(0,K.jsx)(l,{unstyled:t,...u,__staticSelector:`Highlight`,children:h.map(({chunk:e,highlighted:n},r)=>n?(0,K.jsx)(q,{unstyled:t,color:f.get(p(e))||a,style:i,"data-highlight":e,children:e},r):(0,K.jsx)(`span`,{children:e},r))})});Ze.classes=l.classes,Ze.displayName=`@mantine/core/Highlight`;var Qe={root:`m_dc6f14e2`},$e=h((e,{size:t})=>({root:{"--kbd-fz":ce(t,`kbd-fz`)}})),J=S(e=>{let t=R(`Kbd`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,attributes:c,...l}=t,u=w({name:`Kbd`,classes:Qe,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:c,vars:s,varsResolver:$e});return(0,K.jsx)(k,{component:`kbd`,...u(`root`),...l})});J.classes=Qe,J.varsResolver=$e,J.displayName=`@mantine/core/Kbd`;var et=le(`outline`,`arrows-diff`,`ArrowsDiff`,[[`path`,{d:`M11 16h10`,key:`svg-0`}],[`path`,{d:`M11 16l4 4`,key:`svg-1`}],[`path`,{d:`M11 16l4 -4`,key:`svg-2`}],[`path`,{d:`M13 8h-10`,key:`svg-3`}],[`path`,{d:`M13 8l-4 4`,key:`svg-4`}],[`path`,{d:`M13 8l-4 -4`,key:`svg-5`}]]),tt=le(`outline`,`point`,`Point`,[[`path`,{d:`M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0`,key:`svg-0`}]]),nt={app:`grape`,env:`teal`};function rt({m:e,onOpen:t}){let n=e.sections.flatMap(e=>e.fields),i=n.filter(e=>e.source===`app`||e.source===`env`),a=i.filter(e=>e.source===`app`).length,s=i.filter(e=>e.source===`env`).length,c=n.filter(e=>e.secret).length,u=n.filter(e=>e.mutability===`live`&&!e.reserved).length,d=i.slice(0,3);return(0,K.jsxs)(B,{withBorder:!0,radius:`md`,p:`md`,h:`100%`,role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},style:{cursor:`pointer`,display:`flex`,flexDirection:`column`,contain:`content`},children:[(0,K.jsxs)(o,{justify:`space-between`,wrap:`nowrap`,mb:4,gap:`xs`,children:[(0,K.jsxs)(o,{gap:6,wrap:`nowrap`,style:{minWidth:0},children:[e.entry.isApp&&(0,K.jsx)(z,{size:`xs`,variant:`light`,color:`grape`,tt:`none`,children:`app`}),(0,K.jsx)(l,{fw:600,truncate:!0,children:e.entry.name})]}),(0,K.jsx)(A,{size:16,style:{opacity:.4,flexShrink:0},"aria-hidden":!0})]}),(0,K.jsx)(z,{size:`xs`,variant:`light`,color:e.schemaStatus===`zod`?`teal`:`gray`,tt:`none`,mb:`sm`,style:{alignSelf:`flex-start`},children:e.schemaStatus===`zod`?`validé Zod`:`non migré`}),(0,K.jsxs)(o,{align:`baseline`,gap:6,children:[(0,K.jsx)(l,{fw:700,fz:28,lh:1,c:i.length?void 0:`dimmed`,style:{fontVariantNumeric:`tabular-nums`},children:i.length}),(0,K.jsx)(l,{size:`sm`,c:`dimmed`,children:i.length>1?`surcharges`:`surcharge`})]}),(0,K.jsxs)(o,{gap:6,wrap:`wrap`,mt:6,mb:`xs`,children:[a>0&&(0,K.jsxs)(z,{size:`xs`,variant:`dot`,color:`grape`,tt:`none`,children:[a,` app`]}),s>0&&(0,K.jsxs)(z,{size:`xs`,variant:`dot`,color:`teal`,tt:`none`,children:[s,` env`]}),u>0&&(0,K.jsxs)(z,{size:`xs`,variant:`light`,color:`teal`,leftSection:(0,K.jsx)(ae,{size:10}),tt:`none`,children:[u,` à chaud`]}),c>0&&(0,K.jsxs)(z,{size:`xs`,variant:`light`,color:`orange`,leftSection:(0,K.jsx)(r,{size:10}),tt:`none`,children:[c,` secret`,c>1?`s`:``]})]}),(0,K.jsx)(P,{gap:3,style:{flex:1},children:d.length===0?(0,K.jsxs)(l,{size:`xs`,c:`dimmed`,children:[`Tout par défaut · `,n.length,` réglage`,n.length>1?`s`:``]}):(0,K.jsxs)(K.Fragment,{children:[d.map(e=>(0,K.jsxs)(o,{gap:6,wrap:`nowrap`,justify:`space-between`,children:[(0,K.jsx)(E,{fz:11,title:e.key,style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0},children:e.key}),(0,K.jsx)(z,{size:`xs`,variant:`light`,color:nt[e.source??`app`]??`gray`,tt:`none`,style:{flexShrink:0},children:e.source})]},e.key)),i.length>d.length&&(0,K.jsxs)(l,{size:`xs`,c:`dimmed`,children:[`+`,i.length-d.length,` autre`,i.length-d.length>1?`s`:``]})]})})]})}var it=new Map([[`domaine`,[`domain`]],[`hote`,[`host`,`hostname`,`domain`]],[`ecoute`,[`port`,`host`]],[`serveur`,[`servers`,`server`]],[`journal`,[`log`,`logs`,`syslog`]],[`journaux`,[`log`,`logs`,`syslog`]],[`trace`,[`log`,`debug`,`trace`]],[`base`,[`connectors`,`database`,`dialect`,`url`]],[`bdd`,[`connectors`,`database`,`dialect`,`url`]],[`database`,[`connectors`,`dialect`,`url`]],[`db`,[`connectors`,`database`,`dialect`]],[`cache`,[`redis`,`cache`]],[`certificat`,[`certificates`,`cert`,`tls`,`https`]],[`ssl`,[`tls`,`https`,`cert`]],[`fichier`,[`file`,`upload`,`filename`,`dir`]],[`dossier`,[`dir`,`path`,`folder`]],[`chemin`,[`path`,`dir`]],[`televersement`,[`upload`]],[`cle`,[`key`,`secret`]],[`motdepasse`,[`password`,`secret`]],[`origine`,[`origin`,`cors`]],[`jeton`,[`token`,`jwt`]],[`expiration`,[`ttl`,`expires`,`maxage`,`timeout`]],[`duree`,[`ttl`,`maxage`,`timeout`,`duration`]],[`delai`,[`timeout`,`ttl`,`delay`]],[`courriel`,[`mail`,`smtp`,`email`]],[`utilisateur`,[`user`,`users`]],[`parefeu`,[`firewall`,`firewalls`]],[`tempsreel`,[`realtime`,`websocket`,`ws`]],[`socket`,[`websocket`,`ws`,`realtime`]],[`limite`,[`limit`,`max`,`rate`]],[`entete`,[`header`,`headers`]],[`compression`,[`compress`,`gzip`]],[`langue`,[`locale`,`lang`,`i18n`]]]),Y={segmentExact:10,segmentPrefix:7,key:5,env:5,fuzzy:4,module:3,description:2,value:1};function at(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`).split(/[^A-Za-z0-9]+/).filter(Boolean)}function ot(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function st(e,t){let n=e;for(let e of t.split(`.`)){if(!ot(n))return;n=n[e]}return n}function ct(e){if(e===void 0)return``;if(typeof e==`object`&&e)try{return JSON.stringify(e)}catch{return``}return f(e)}function lt(e,t){if(e===t)return!0;let n=e.length,r=t.length;if(Math.abs(n-r)>1)return!1;let i=0;for(;i<n&&i<r&&e[i]===t[i];)i++;return n===r?e.slice(i+1)===t.slice(i+1)||e[i]===t[i+1]&&e[i+1]===t[i]&&e.slice(i+2)===t.slice(i+2):n>r?e.slice(i+1)===t.slice(i):e.slice(i)===t.slice(i+1)}function ut(e){let t=[];return e.forEach((e,n)=>{let{entry:r}=e,i=x(`${r.name} ${r.key}`);for(let a of e.sections)for(let e of a.fields){let a=e.secret?void 0:st(r.config,e.key),o=typeof e.description==`string`?e.description:``,s=r.envKeys[e.key.toLowerCase()]??null,c=e.env??e.recipe??null,l=at(e.key).map(x),u=e.key.split(`.`).map(x),d=typeof e.constraint==`string`?e.constraint:``;t.push({moduleKey:r.key,moduleName:r.name,isApp:r.isApp,field:e,value:a,valueText:ct(a),description:o,envVar:c,envSet:s,order:n,segments:u,words:l,compactKey:x(e.key),compactModule:i,compactEnv:[e.env,e.recipe,s].filter(e=>typeof e==`string`).map(x),normDesc:O(o),normValues:O(`${e.type??``} ${d} ${ct(a)}`)})}}),t}function dt(e,t,n){if(!t)return 0;let r=[...e.segments,...e.words];return r.includes(t)?Y.segmentExact:r.some(e=>e.startsWith(t))?Y.segmentPrefix:e.compactKey.includes(t)?Y.key:e.compactEnv.some(e=>e.includes(t))?Y.env:t.length>=5&&r.some(e=>e.length>=4&<(e,t))?Y.fuzzy:e.compactModule.includes(t)?Y.module:n&&e.normDesc.includes(n)?Y.description:n&&e.normValues.includes(n)?Y.value:0}function ft(e,t){if(/^nf_/i.test(t)){let n=x(t);return e.compactEnv.includes(n)?Y.segmentExact:e.compactEnv.some(e=>e.includes(n))?Y.env:0}let n=x(t),r=dt(e,n,O(t));for(let t of it.get(n)??[])r=Math.max(r,dt(e,t,t)-1);return r}function pt(e){let t=e.field.source;return t===`app`||t===`env`||t===`runtime`}function mt(e,t,n=50){let r=t.trim().split(/\s+/).filter(Boolean);if(!r.length)return{hits:[],total:0};let i=[];for(let t of e){let e=0,n=!0;for(let i of r){let r=ft(t,i);if(r===0){n=!1;break}e+=r}n&&i.push({doc:t,score:e})}return i.sort((e,t)=>t.score-e.score||Number(pt(t.doc))-Number(pt(e.doc))||e.doc.field.key.length-t.doc.field.key.length||e.doc.order-t.doc.order),{hits:i.slice(0,n),total:i.length}}var ht=[`port`,`session`,`durée`,`journal`,`base`,`NF_`],gt=40,_t={app:{label:`app`,color:`grape`},env:{label:`env`,color:`teal`},runtime:{label:`à chaud`,color:`cyan`}};function vt(e){if(e.field.secret)return`•••••`;let t=e.valueText;return t.length>gt?`${t.slice(0,39)}…`:t}function yt({index:e,onOpen:t}){let[r,a]=(0,G.useState)(``),[s,c]=(0,G.useState)(0),u=(0,G.useDeferredValue)(r),d=(0,G.useRef)(null),f=(0,G.useId)(),{hits:p,total:m}=(0,G.useMemo)(()=>mt(e,u),[e,u]),h=(0,G.useMemo)(()=>u.trim().split(/\s+/).filter(e=>e.length>1),[u]),g=r.trim().length>0,_=Math.min(s,Math.max(p.length-1,0)),v=e=>`${f}-opt-${e}`;Be([[`/`,()=>d.current?.focus()],[`mod+K`,()=>d.current?.focus()]]);let y=e=>{a(e),c(0)};return(0,K.jsxs)(P,{gap:`xs`,children:[(0,K.jsx)(n,{ref:d,value:r,onChange:e=>y(e.currentTarget.value),onKeyDown:e=>{e.key===`ArrowDown`&&p.length?(e.preventDefault(),c((_+1)%p.length)):e.key===`ArrowUp`&&p.length?(e.preventDefault(),c((_-1+p.length)%p.length)):e.key===`Enter`&&p[_]?(e.preventDefault(),t(p[_].doc)):e.key===`Escape`&&y(``)},placeholder:ke,size:`md`,leftSection:(0,K.jsx)(i,{size:18}),rightSection:(0,K.jsx)(J,{size:`xs`,"aria-hidden":!0,children:`/`}),role:`combobox`,"aria-label":`Chercher un réglage de configuration dans tous les modules`,"aria-expanded":g,"aria-controls":f,"aria-autocomplete":`list`,"aria-activedescendant":g&&p.length?v(_):void 0}),!g&&(0,K.jsxs)(o,{gap:6,wrap:`wrap`,children:[(0,K.jsx)(l,{size:`xs`,c:`dimmed`,children:`Essaie :`}),ht.map(e=>(0,K.jsx)(b,{size:`compact-xs`,variant:`light`,color:`gray`,onClick:()=>{y(e),d.current?.focus()},children:e},e))]}),g&&(0,K.jsxs)(I,{withBorder:!0,radius:`md`,p:0,children:[(0,K.jsx)(l,{size:`xs`,c:`dimmed`,px:`sm`,py:6,"aria-live":`polite`,style:{fontVariantNumeric:`tabular-nums`},children:m===0?`Aucun réglage ne répond à « ${r.trim()} ». Essaie un morceau de clé (port), un mot français (durée) ou une variable (NF_…).`:m>p.length?`${m} réglages trouvés — les ${p.length} plus pertinents. ↑ ↓ pour choisir, Entrée pour ouvrir.`:`${m} réglage(s) trouvé(s). ↑ ↓ pour choisir, Entrée pour ouvrir.`}),(0,K.jsx)(`div`,{id:f,role:`listbox`,"aria-label":`Résultats de la recherche`,style:{maxHeight:`min(60vh, 520px)`,overflowY:`auto`},children:p.map(({doc:e},n)=>{let r=e.field.source?_t[e.field.source]:void 0;return(0,K.jsxs)(N,{id:v(n),role:`option`,"aria-selected":n===_,tabIndex:-1,onMouseEnter:()=>c(n),onClick:()=>t(e),px:`sm`,py:8,w:`100%`,style:{display:`block`,borderTop:`1px solid var(--mantine-color-default-border)`,background:n===_?`var(--mantine-color-default-hover)`:void 0},children:[(0,K.jsxs)(o,{gap:8,wrap:`nowrap`,justify:`space-between`,children:[(0,K.jsxs)(o,{gap:8,wrap:`nowrap`,style:{minWidth:0},children:[(0,K.jsx)(z,{size:`sm`,variant:`light`,color:e.isApp?`brand`:`gray`,tt:`none`,style:{flexShrink:0},children:e.isApp?`noyau`:e.moduleName}),(0,K.jsx)(Ze,{highlight:h,size:`sm`,ff:`monospace`,fw:600,style:{overflowWrap:`anywhere`},children:e.field.key}),r&&(0,K.jsx)(z,{size:`xs`,variant:`light`,color:r.color,tt:`none`,children:r.label})]}),e.valueText||e.field.secret?(0,K.jsx)(E,{style:{fontSize:11,flexShrink:0},children:vt(e)}):null]}),e.description&&(0,K.jsx)(l,{size:`xs`,c:`dimmed`,lineClamp:1,mt:2,children:e.description}),e.envVar&&(0,K.jsxs)(l,{size:`xs`,c:`dimmed`,mt:2,children:[`Variable :`,` `,(0,K.jsx)(E,{style:{fontSize:10},children:e.envSet??e.envVar}),e.envSet?` (posée)`:``]})]},`${e.moduleKey}:${e.field.key}`)})})]})]})}var bt=[[86400,`j`],[3600,`h`],[60,`min`]];function xt(e){if(e===0)return`0 (désactivé)`;for(let[t,n]of bt)if(e>=t&&e%t===0)return`${e/t} ${n}`;return`${e} s`}function St(e){if(e===void 0)return`—`;if(e===null)return`aucun`;if(typeof e==`string`)return e===``?`(vide)`:e;if(typeof e==`number`||typeof e==`boolean`)return String(e);try{return JSON.stringify(e)}catch{return`—`}}function Ct(e,t){if(e.field.secret)return{kind:`text`,text:`•••••`};let n=e.value;return typeof n==`boolean`?{kind:`bool`,on:n}:t===`duration-s`&&typeof n==`number`?{kind:`text`,text:xt(n)}:Array.isArray(n)?{kind:`list`,items:n.map(e=>St(e))}:{kind:`text`,text:St(n)}}var X=e=>e===!0,wt=[{module:`app`,key:/^domain$/,label:`Domaine`},{module:`app`,key:/^domainAlias$/,label:`Autres domaines`,format:`list`},{module:`@nodefony/http`,key:/^trustProxy$/,label:`Proxy de confiance`,check:e=>e===!1?{level:`info`,text:`Non : l'adresse vue est celle du client qui se connecte.`}:{level:`info`,text:`Oui : les en-têtes X-Forwarded-* du proxy sont crus.`}},{module:`@nodefony/http`,key:/^trustedHosts$/,label:`Hôtes acceptés`,format:`list`}],Tt=[{module:`@nodefony/http`,key:/^session\.cookie\.secure$/,label:`Cookie de session HTTPS`,check:e=>X(e)?{level:`ok`,text:`Il ne circule jamais en clair.`}:{level:`warn`,text:`Il peut circuler en clair sur HTTP : volable sur le réseau.`}},{module:`@nodefony/http`,key:/^session\.idleTimeoutS$/,label:`Inactivité max.`,format:`duration-s`,check:e=>typeof e==`number`&&(e===0||e>86400)?{level:`warn`,text:`Une session abandonnée reste ouverte longtemps.`}:{level:`ok`,text:`Une session oubliée se ferme d'elle-même.`}},{module:`@nodefony/security`,key:/^csrf\.enabled$/,label:`Protection CSRF`,check:e=>X(e)?{level:`ok`,text:`Un autre site ne peut pas agir à la place de l'utilisateur.`}:{level:`warn`,text:`Coupée : un autre site peut déclencher des actions au nom de l'utilisateur connecté.`}},{module:`@nodefony/security`,key:/^csrf\.sameSite$/,label:`Cookies SameSite`,check:e=>typeof e==`string`&&e.toLowerCase()===`none`?{level:`warn`,text:`« None » : les cookies partent aussi depuis les autres sites.`}:{level:`ok`,text:`Les autres sites ne reçoivent pas les cookies.`}},{module:`@nodefony/security`,key:/^cors\.origins$/,label:`Origines CORS`,format:`list`,check:e=>Array.isArray(e)&&e.includes(`*`)?{level:`warn`,text:`« * » : n'importe quel site peut appeler l'API.`}:null},{module:`@nodefony/http`,key:/^securityHeaders\.strictTransportSecurity(\.maxAge)?$/,label:`HTTPS imposé (HSTS)`,format:`duration-s`,check:(e,t)=>typeof e==`number`&&e>0?{level:`ok`,text:`Le navigateur refusera de revenir en HTTP.`}:t.production?{level:`warn`,text:`Absent en production : une première visite peut passer en clair.`}:{level:`info`,text:`Absent — sans conséquence en développement.`}},{module:`@nodefony/security`,key:/^rateLimit\.enabled$/,label:`Anti force brute`,check:e=>X(e)?{level:`ok`,text:`Deviner un mot de passe par essais répétés est ralenti.`}:{level:`warn`,text:`Coupé : rien ne ralentit qui essaie des mots de passe en boucle.`}},{module:`@nodefony/http`,key:/^rateLimit\.enabled$/,label:`Limite de requêtes`,check:(e,t)=>X(e)?{level:`ok`,text:`Un client trop bavard est freiné.`}:t.production?{level:`warn`,text:`Coupée en production : un seul client peut saturer le serveur.`}:{level:`info`,text:`Coupée — habituel en développement.`}},{module:`@nodefony/security`,key:/^jwt\.accessTtlS$/,label:`Jeton d'accès`,format:`duration-s`,check:e=>typeof e==`number`&&e>3600?{level:`warn`,text:`Plus d'une heure : un jeton volé reste utilisable longtemps.`}:{level:`ok`,text:`Courte : un jeton volé expire vite.`}},{module:`@nodefony/security`,key:/^jwt\.refreshTtlS$/,label:`Jeton de rafraîchissement`,format:`duration-s`}];function Et(e,t){return e.module===(t.isApp?`app`:t.moduleName)&&e.key.test(t.field.key)}function Dt(e,t){return t.findIndex(t=>Et(t,e))}function Ot(e,t,n){return e.field.reserved?{level:`info`,text:`Clé réservée : posée, elle n'a aucun effet aujourd'hui.`}:!t?.check||e.field.secret?null:t.check(e.value,n)}function kt(e,t,n){return e.filter(e=>!e.field.reserved).map(e=>({doc:e,r:Dt(e,t)})).filter(({r:e})=>e>=0).sort((e,t)=>e.r-t.r).map(({doc:e,r})=>{let i=t[r];return{doc:e,label:i?.label??e.field.key,display:Ct(e,i?.format??`auto`),verdict:Ot(e,i,n)}})}function At(e){return e.isApp?`noyau › ${e.field.key}`:`${e.moduleName.replace(/^@nodefony\//,``)} › ${e.field.key}`}function jt(e){let t=e.filter(e=>e.isApp),n=e=>t.find(t=>t.field.key===e),r=n(`domain`)?.value,i=typeof r==`string`&&r?r:`localhost`,a=i===`0.0.0.0`||i===`::`,o=[],s=(e,t,r)=>{let s=n(`servers.${r}.port`);s&&typeof s.value==`number`&&n(`servers.${r}.enabled`)?.value!==!1&&o.push({label:e,url:`${t}://${i}:${s.value}`,allInterfaces:a,doc:s})};return s(`HTTP`,`http`,`http`),s(`HTTPS`,`https`,`https`),s(`HTTP/2 en clair`,`http`,`h2c`),o}function Mt(e,t){let n=kt(e,Tt,t);return{endpoints:jt(e),network:kt(e,wt,t),security:n,env:e.filter(e=>e.field.source===`env`).map(e=>{let n=[...Tt,...wt].find(t=>Et(t,e));return{doc:e,label:n?.label??At(e),display:Ct(e,n?.format??`auto`),verdict:Ot(e,n,t)}}).sort((e,t)=>Number(t.verdict?.level===`warn`)-Number(e.verdict?.level===`warn`)),summary:{ok:n.filter(e=>e.verdict?.level===`ok`).length,warn:n.filter(e=>e.verdict?.level===`warn`).length}}}var Nt=2,Pt={ok:{icon:(0,K.jsx)(Ne,{size:18}),color:`teal`,label:`En place`},warn:{icon:(0,K.jsx)(T,{size:18}),color:`orange`,label:`À vérifier`},info:{icon:(0,K.jsx)(_,{size:18}),color:`blue`,label:`À savoir`}};function Ft(e){return e.kind===`bool`?e.on?`activé`:`désactivé`:e.kind===`list`?e.items.length?e.items.join(`, `):`aucun`:e.text}function It({display:e}){if(e.kind===`bool`)return(0,K.jsx)(z,{variant:`light`,color:e.on?`teal`:`gray`,tt:`none`,style:{flexShrink:0},children:e.on?`activé`:`désactivé`});if(e.kind===`list`){if(!e.items.length)return(0,K.jsx)(l,{size:`sm`,c:`dimmed`,children:`aucun`});let t=e.items.slice(0,Nt),n=e.items.length-t.length;return(0,K.jsxs)(o,{gap:4,wrap:`nowrap`,justify:`flex-end`,style:{minWidth:0},children:[t.map(e=>(0,K.jsx)(E,{style:{fontSize:12,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:`100%`},children:e},e)),n>0&&(0,K.jsxs)(z,{size:`sm`,variant:`default`,title:e.items.slice(Nt).join(`, `),children:[`+`,n]})]})}return(0,K.jsx)(E,{title:e.text,style:{fontSize:12,display:`inline-block`,maxWidth:`100%`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,verticalAlign:`middle`},children:e.text})}function Lt({item:e}){let{doc:t,verdict:n}=e,r=[];return n&&r.push({label:Pt[n.level].label,body:n.text}),r.push(...Ae({field:t.field,moduleName:t.moduleName,isApp:t.isApp})),(0,K.jsx)(v,{title:e.label,summary:t.description||`Le schéma ne décrit pas ce réglage.`,sections:r,width:420})}function Rt({item:e,title:t,mono:n=!1,first:r,onOpen:i}){let[a,s]=(0,G.useState)(!1),c=e.verdict;return(0,K.jsxs)(o,{gap:0,wrap:`nowrap`,align:`center`,style:{borderTop:r?void 0:`1px solid var(--mantine-color-default-border)`,background:a?`var(--mantine-color-default-hover)`:void 0},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[(0,K.jsx)(N,{onClick:()=>i(e.doc),px:`sm`,py:8,style:{flex:`1 1 auto`,minWidth:0},children:(0,K.jsxs)(o,{gap:`sm`,wrap:`nowrap`,align:`center`,children:[(0,K.jsx)(d,{variant:`transparent`,color:c?Pt[c.level].color:`gray`,size:20,"aria-hidden":!0,children:c?Pt[c.level].icon:(0,K.jsx)(tt,{size:14})}),(0,K.jsxs)(P,{gap:0,style:{flex:`1 1 auto`,minWidth:0},children:[(0,K.jsx)(l,{size:`sm`,fw:600,ff:n?`monospace`:void 0,truncate:!0,title:t,children:t}),(0,K.jsx)(l,{size:`xs`,c:`dimmed`,ff:`monospace`,truncate:!0,children:At(e.doc)}),c?.level===`warn`&&(0,K.jsx)(l,{size:`xs`,c:`orange`,children:c.text})]}),(0,K.jsx)(k,{style:{flex:`0 1 auto`,minWidth:0,maxWidth:`45%`,textAlign:`right`},children:(0,K.jsx)(It,{display:e.display})}),(0,K.jsx)(A,{size:14,color:`var(--mantine-color-dimmed)`,"aria-hidden":!0,style:{flexShrink:0}})]})}),(0,K.jsx)(k,{pr:`sm`,style:{flexShrink:0},children:(0,K.jsx)(Lt,{item:e})})]})}function zt({icon:e,color:t,title:n,help:r,items:i,empty:a,mono:s,titleOf:c,onOpen:u}){return(0,K.jsxs)(B,{withBorder:!0,radius:`md`,p:0,children:[(0,K.jsxs)(o,{gap:8,wrap:`nowrap`,px:`sm`,py:`xs`,style:{borderBottom:`1px solid var(--mantine-color-default-border)`},children:[(0,K.jsx)(d,{variant:`light`,color:t,size:28,radius:`md`,children:e}),(0,K.jsx)(l,{fw:700,children:n}),(0,K.jsx)(z,{size:`sm`,variant:`light`,color:`gray`,children:i.length}),(0,K.jsx)(v,{title:n,summary:r,width:320})]}),i.length?(0,K.jsx)(P,{gap:0,children:i.map((e,t)=>(0,K.jsx)(Rt,{item:e,title:c(e),mono:s,first:t===0,onOpen:u},`${e.doc.moduleKey}:${e.doc.field.key}`))}):(0,K.jsx)(l,{size:`sm`,c:`dimmed`,p:`sm`,children:a})]})}function Z({value:e,label:t,onClick:n}){let r=(0,K.jsxs)(P,{gap:0,align:`center`,px:`xs`,children:[(0,K.jsx)(l,{fw:700,style:{fontSize:26,lineHeight:1.1,fontVariantNumeric:`tabular-nums`},children:e}),(0,K.jsx)(l,{size:`xs`,c:`dimmed`,ta:`center`,children:t})]});return n?(0,K.jsx)(N,{onClick:n,children:r}):r}function Bt({index:e,runtime:t,counts:n,onOpen:r,onShowOverrides:i}){let a=t?.environment===`production`,c=(0,G.useMemo)(()=>Mt(e,{production:a}),[e,a]),{summary:d,endpoints:f}=c,p=(0,G.useMemo)(()=>{let e=new Set;return[...c.security,...c.network,...c.env].filter(t=>{if(t.verdict?.level!==`warn`)return!1;let n=`${t.doc.moduleKey}:${t.doc.field.key}`;return!e.has(n)&&(e.add(n),!0)})},[c]),m=c.security.filter(e=>e.verdict).length,h=c.security.filter(e=>e.verdict?.level===`info`).length,g=e=>m?e/m*100:0,_=t?a?`Production`:t.environment===`development`?`Développement`:t.environment:`mode inconnu`,v=c.env[0];return(0,K.jsxs)(P,{gap:`md`,children:[(0,K.jsx)(B,{withBorder:!0,radius:`md`,p:`md`,children:(0,K.jsxs)(o,{justify:`space-between`,align:`center`,gap:`lg`,wrap:`wrap`,children:[(0,K.jsxs)(o,{gap:`md`,wrap:`nowrap`,children:[(0,K.jsx)(Me,{role:`img`,size:88,thickness:9,roundCaps:!0,sections:[{value:g(d.ok),color:`teal`},{value:g(d.warn),color:`orange`},{value:g(h),color:`blue`}],label:(0,K.jsxs)(l,{ta:`center`,fw:700,size:`md`,children:[d.ok,`/`,m]}),"aria-label":`${d.ok} verrous en place sur ${m}, ${d.warn} à vérifier`}),(0,K.jsxs)(P,{gap:2,children:[(0,K.jsx)(l,{fw:700,size:`lg`,c:d.warn?`orange`:`teal`,children:d.warn?`${d.warn} point${d.warn>1?`s`:``} à vérifier`:`Rien à signaler`}),(0,K.jsxs)(l,{size:`sm`,c:`dimmed`,children:[d.ok,` verrou`,d.ok>1?`s`:``,` de sécurité en place sur `,m,` examinés`]})]})]}),(0,K.jsxs)(P,{gap:6,style:{minWidth:0},children:[(0,K.jsxs)(o,{gap:8,wrap:`nowrap`,children:[(0,K.jsx)(l,{size:`xs`,c:`dimmed`,fw:700,tt:`uppercase`,w:56,children:`Mode`}),(0,K.jsx)(z,{variant:`light`,color:a?`blue`:`teal`,tt:`none`,children:_}),t?.debug&&(0,K.jsx)(z,{variant:`light`,color:`orange`,tt:`none`,children:`debug`})]}),(0,K.jsxs)(o,{gap:8,wrap:`wrap`,children:[(0,K.jsx)(l,{size:`xs`,c:`dimmed`,fw:700,tt:`uppercase`,w:56,children:`Écoute`}),f.length?f.map(e=>(0,K.jsx)(N,{onClick:()=>r(e.doc),title:`${e.label} — ouvrir le réglage du port`,children:(0,K.jsx)(E,{style:{fontSize:12,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:`100%`},children:e.url})},e.url)):(0,K.jsx)(l,{size:`xs`,c:`dimmed`,children:`aucun port exposé`}),f[0]?.allInterfaces&&(0,K.jsx)(l,{size:`xs`,c:`dimmed`,children:`toutes les interfaces`})]})]}),(0,K.jsxs)(o,{gap:`md`,wrap:`nowrap`,children:[(0,K.jsx)(Z,{value:n.modified,label:`réglages modifiés`,onClick:i}),(0,K.jsx)(Z,{value:c.env.length,label:`variables posées`,onClick:v?()=>r(v.doc):void 0}),(0,K.jsx)(Z,{value:n.secrets,label:`secrets masqués`})]})]})}),p.length>0&&(0,K.jsx)(u,{color:`orange`,variant:`light`,radius:`md`,icon:(0,K.jsx)(T,{size:20}),title:`À vérifier d'abord`,children:(0,K.jsx)(P,{gap:8,children:p.map(e=>(0,K.jsxs)(o,{justify:`space-between`,wrap:`nowrap`,gap:`md`,children:[(0,K.jsxs)(P,{gap:0,style:{minWidth:0},children:[(0,K.jsxs)(l,{size:`sm`,fw:600,children:[e.label,` : `,Ft(e.display),e.doc.envSet?(0,K.jsxs)(l,{span:!0,size:`xs`,c:`dimmed`,ff:`monospace`,children:[` `,`(posé par `,e.doc.envSet,`)`]}):null]}),(0,K.jsx)(l,{size:`sm`,children:e.verdict?.text})]}),(0,K.jsx)(b,{size:`xs`,variant:`light`,color:`orange`,rightSection:(0,K.jsx)(A,{size:14}),onClick:()=>r(e.doc),style:{flexShrink:0},children:`Ouvrir le réglage`})]},`${e.doc.moduleKey}:${e.doc.field.key}`))})}),(0,K.jsxs)(M,{children:[(0,K.jsx)(M.Col,{span:{base:12,lg:7},children:(0,K.jsx)(zt,{icon:(0,K.jsx)(s,{size:16}),color:d.warn?`orange`:`teal`,title:`Sécurité`,help:`Les verrous qu'on vérifie d'abord, chacun avec son verdict. La bulle ⓘ d'une ligne dit ce que règle le réglage et comment le changer. Ce sont des règles simples : elles signalent ce qui mérite un second regard, elles ne remplacent pas un audit.`,items:c.security,empty:`Aucun verrou exposé : le module de sécurité est-il chargé ?`,titleOf:e=>e.label,onOpen:r})}),(0,K.jsx)(M.Col,{span:{base:12,lg:5},children:(0,K.jsxs)(P,{gap:`md`,children:[(0,K.jsx)(zt,{icon:(0,K.jsx)(Pe,{size:16}),color:`brand`,title:`Réseau`,help:`Par où l'on entre dans l'application, et à qui l'on fait confiance devant elle : le domaine, ses autres noms, le proxy, les noms d'hôte acceptés.`,items:c.network,empty:`Aucun de ces réglages n'est exposé par l'application.`,titleOf:e=>e.label,onOpen:r}),(0,K.jsx)(zt,{icon:(0,K.jsx)(me,{size:16}),color:`grape`,title:`Variables posées`,help:`Chaque réglage qu'une variable d'environnement a changé (.env du poste, ou l'hébergeur). Elle l'emporte sur nodefony.config.ts : si l'application ne fait pas ce que dit le fichier, la réponse est souvent ici.`,items:c.env,empty:`Aucune : tout vient de nodefony.config.ts ou des valeurs d'usine.`,mono:!0,titleOf:e=>e.doc.envSet??e.doc.envVar??e.doc.field.key,onOpen:r})]})})]})]})}var Vt=[[`database`,`Bases de données`],[`cache`,`Cache et messagerie`],[`observability`,`Observabilité`],[`identity`,`Identité`],[`network`,`Réseau`]],Ht={ready:{label:`Prêt`,color:`teal`},partial:{label:`Partiel`,color:`orange`},down:{label:`Arrêté`,color:`orange`},unknown:{label:`Inconnu`,color:`gray`}},Ut={healthy:`sain`,running:`tourne`,starting:`démarre`,unhealthy:`en mauvaise santé`,stopped:`arrêté`,absent:`absent`,unknown:`état inconnu`};function Wt(e){return e.playedBy==="default"?`levé par npm run test:all`:e.playedBy===`phase`?`levé par npm run test:all -- ${e.phase??``}`.trim():`levé par personne : à monter à la main`}function Gt(e){return e.state!==`ready`||(e.server?.missing.length??0)>0}function Kt(e,t){let n=e=>t===`all`||(t===`todo`?Gt(e):!Gt(e));return Vt.map(([t,r])=>({family:t,title:r,boxes:e.filter(e=>e.family===t&&n(e))})).filter(e=>e.boxes.length>0)}function qt(e){let t=e.tools.filter(e=>!e.oneShot);return{ready:e.testbeds.filter(e=>e.state===`ready`).length,total:e.testbeds.length,todo:e.testbeds.filter(Gt).length,switchesOpen:e.switches.filter(e=>e.open).length,switchesTotal:e.switches.length,toolsUp:t.filter(e=>e.state===`healthy`||e.state===`running`).length,toolsTotal:t.length}}var Q={fontSize:12},Jt={whiteSpace:`pre-wrap`,overflowWrap:`anywhere`};function Yt({command:e}){return(0,K.jsxs)(o,{gap:6,wrap:`nowrap`,align:`flex-start`,children:[(0,K.jsxs)(E,{block:!0,style:{...Q,...Jt,flex:1,minWidth:0},children:[`$ `,e]}),(0,K.jsx)(D,{value:e,timeout:1500,children:({copied:e,copy:t})=>(0,K.jsx)(j,{label:e?`Copié`:`Copier la commande`,withArrow:!0,children:(0,K.jsx)(g,{variant:`light`,color:e?`teal`:`gray`,"aria-label":`Copier la commande`,onClick:t,children:e?(0,K.jsx)(C,{size:14}):(0,K.jsx)(ie,{size:14})})})})]})}function Xt({children:e}){return(0,K.jsx)(l,{size:`xs`,tt:`uppercase`,c:`dimmed`,fw:600,style:{letterSpacing:`.04em`},children:e})}function Zt({box:e}){let t=Ht[e.state],n=e.services.map(e=>`nodefony-${e.name} · ${Ut[e.state]}`).join(` — `),r=e.server?.missing??[];return(0,K.jsx)(I,{withBorder:!0,radius:`md`,p:`md`,h:`100%`,style:{contain:`content`,borderColor:e.state===`ready`?void 0:`var(--mantine-color-orange-filled)`},children:(0,K.jsxs)(P,{gap:`sm`,children:[(0,K.jsxs)(o,{justify:`space-between`,align:`flex-start`,wrap:`nowrap`,gap:`sm`,children:[(0,K.jsxs)(`div`,{style:{minWidth:0},children:[(0,K.jsx)(y,{order:3,size:`h5`,children:e.label}),(0,K.jsx)(l,{size:`xs`,c:`dimmed`,ff:`monospace`,children:n||`sans conteneur`})]}),(0,K.jsx)(z,{variant:`light`,color:t.color,tt:`none`,style:{flexShrink:0},children:t.label})]}),(0,K.jsx)(l,{size:`sm`,children:e.purpose}),(0,K.jsxs)(P,{gap:4,children:[(0,K.jsxs)(o,{gap:6,children:[(0,K.jsx)(Xt,{children:`Variables du test`}),(0,K.jsx)(v,{title:`Variables du test`,summary:`Le process de test lit ${e.vars.length===1?`cette variable`:`ces ${e.vars.length} variables`}. Tu n'as rien à poser : npm run test:all les calcule depuis le compose avant de lancer vitest. Lancer vitest à la main sans elles fait sauter les cas — et un saut compte comme vert.`})]}),e.vars.map(e=>(0,K.jsxs)(E,{block:!0,style:{...Q,...Jt},children:[e.name,` = `,e.value]},e.name)),e.sharedWith.length>0&&(0,K.jsxs)(l,{size:`xs`,c:`dimmed`,children:[`Même variable que : `,e.sharedWith.join(`, `),` — une seule valeur à la fois.`]})]}),e.server&&(0,K.jsx)(u,{variant:`light`,color:r.length?`orange`:`teal`,icon:(0,K.jsx)(fe,{size:16}),p:`xs`,title:r.length?`Côté serveur : ${r.length} / ${e.server.required.length} manquante(s)`:`Côté serveur : ${e.server.required.length} / ${e.server.required.length} posée(s)`,children:(0,K.jsx)(l,{size:`xs`,children:r.length?`À ajouter au .env du poste, puis redémarrer le serveur : ${r.join(`, `)}. Sans elles, le banc échoue sans dire pourquoi.`:`Le serveur porte bien ce que ce décor lui demande.`})}),(0,K.jsxs)(P,{gap:6,children:[(0,K.jsx)(Xt,{children:`Débloque`}),(0,K.jsx)(o,{gap:6,children:e.suites.length?e.suites.map(e=>(0,K.jsx)(j,{label:e.config,withArrow:!0,children:(0,K.jsxs)(z,{variant:`default`,tt:`none`,tabIndex:0,children:[e.label,e.proofs?` · ${e.proofs} preuve(s)`:``]})},e.config)):(0,K.jsx)(z,{variant:`outline`,color:`gray`,tt:`none`,children:`aucune suite ne le déclare`})}),(0,K.jsx)(l,{size:`xs`,c:e.playedBy===`manual`?`orange`:`dimmed`,children:Wt(e)})]}),e.upCommand&&(0,K.jsx)(Yt,{command:e.upCommand}),e.note&&(0,K.jsx)(l,{size:`xs`,c:`dimmed`,style:{borderTop:`1px dashed var(--mantine-color-default-border)`,paddingTop:8},children:e.note})]})})}var Qt=de(()=>{let e=Ce(),t=(0,G.useCallback)(()=>e.api.getAbsolute(`/nodefony/test/api/testbed`),[e]),{data:n,loading:r,error:i,reload:s}=V(t),[d,f]=(0,G.useState)(`all`),p=n?.supported===!0?n:null,m=(0,G.useMemo)(()=>p?Kt(p.testbeds,d):[],[p,d]);if(!p)return(0,K.jsx)(oe,{loading:r,error:i??(n?.supported===!1?n.reason:null),empty:!r&&!i,onRetry:s,emptyMessage:`Aucun constat des décors.`,children:null});let h=qt(p),g=new Date(p.generatedAt).toLocaleTimeString(`fr-FR`);return(0,K.jsxs)(P,{gap:`lg`,children:[(0,K.jsx)(l,{size:`sm`,c:`dimmed`,maw:900,children:`Ce que le cœur exige pour que ses tests disent vrai. Sans un décor, des suites entières sautent, et un saut compte comme vert. Cet onglet n'existe que sur le dépôt du framework.`}),(0,K.jsxs)(M,{children:[(0,K.jsx)(a,{label:`Décors prêts`,hint:`${h.ready} décor(s) sur ${h.total} ont tous leurs conteneurs démarrés et sains. ${h.todo?`${h.todo} demande(nt) un geste : conteneur arrêté ou variable manquante côté serveur.`:`Rien à monter.`}`,children:(0,K.jsxs)(l,{fz:28,fw:700,ff:`monospace`,children:[h.ready,` / `,h.total]})}),(0,K.jsx)(a,{label:`Interrupteurs ouverts`,hint:`Les interrupteurs NF_RUN_* ouvrent des bancs coûteux (perf, boots réels, cluster, ruptures). ${h.switchesOpen} sur ${h.switchesTotal} sont ouverts dans l'environnement du serveur — fermés par défaut, à raison.`,children:(0,K.jsxs)(l,{fz:28,fw:700,ff:`monospace`,children:[h.switchesOpen,` / `,h.switchesTotal]})}),(0,K.jsx)(a,{label:`Outils lancés`,hint:`${h.toolsUp} outil(s) sur ${h.toolsTotal} tournent (tableaux, boîte aux lettres, navigateur…). Aucun test ne les exige : ils servent l'humain.`,children:(0,K.jsxs)(l,{fz:28,fw:700,ff:`monospace`,children:[h.toolsUp,` / `,h.toolsTotal]})}),(0,K.jsx)(a,{label:`Constaté`,hint:p.docker?`Constat pris à ${g} : un seul docker inspect, au rechargement — jamais sur minuterie.`:`Docker ne répond pas : l'état des conteneurs est inconnu, pas « arrêté ».`,children:(0,K.jsxs)(o,{gap:`xs`,wrap:`nowrap`,children:[(0,K.jsx)(l,{fw:600,children:p.docker?g:`docker injoignable`}),(0,K.jsx)(b,{size:`xs`,variant:`light`,leftSection:(0,K.jsx)(c,{size:14}),loading:r,onClick:s,children:`Recharger`})]})})]}),p.blindSpots.length>0&&(0,K.jsx)(u,{variant:`light`,color:`orange`,icon:(0,K.jsx)(T,{size:18}),title:`Angles morts constatés — ${p.blindSpots.length}`,children:(0,K.jsxs)(P,{gap:4,children:[p.blindSpots.map(e=>(0,K.jsxs)(l,{size:`sm`,children:[(0,K.jsx)(l,{span:!0,fw:600,children:e.subject}),` `,`— `,e.detail]},`${e.kind}:${e.subject}`)),(0,K.jsx)(l,{size:`xs`,c:`dimmed`,children:`Calculés à chaque constat par des règles : un trou bouché disparaît de lui-même.`})]})}),(0,K.jsx)(o,{gap:`sm`,children:(0,K.jsx)(ee,{"aria-label":`Filtrer les décors`,value:d,onChange:e=>f(e===`todo`||e===`ready`?e:`all`),data:[{value:`all`,label:`Tous · ${h.total}`},{value:`todo`,label:`À monter · ${h.todo}`},{value:`ready`,label:`Prêts · ${h.total-h.todo}`}]})}),m.map(e=>(0,K.jsxs)(P,{gap:`sm`,children:[(0,K.jsx)(y,{order:2,size:`xs`,tt:`uppercase`,c:`dimmed`,style:{letterSpacing:`.06em`},children:e.title}),(0,K.jsx)(ge,{cols:{base:1,lg:2},spacing:`md`,children:e.boxes.map(e=>(0,K.jsx)(Zt,{box:e},e.id))})]},e.family)),m.length===0&&(0,K.jsx)(l,{size:`sm`,c:`dimmed`,children:`Aucun décor dans ce filtre.`}),(0,K.jsxs)(P,{gap:`sm`,children:[(0,K.jsx)(y,{order:2,size:`xs`,tt:`uppercase`,c:`dimmed`,style:{letterSpacing:`.06em`},children:`Interrupteurs de coût`}),(0,K.jsx)(I,{withBorder:!0,radius:`md`,children:(0,K.jsx)(L.ScrollContainer,{minWidth:640,children:(0,K.jsxs)(L,{verticalSpacing:`xs`,horizontalSpacing:`md`,children:[(0,K.jsx)(L.Thead,{children:(0,K.jsxs)(L.Tr,{children:[(0,K.jsx)(L.Th,{children:`Interrupteur`}),(0,K.jsx)(L.Th,{children:`Ce qu'il ouvre`}),(0,K.jsx)(L.Th,{children:`Suites qui le lisent`}),(0,K.jsx)(L.Th,{children:`État`})]})}),(0,K.jsx)(L.Tbody,{children:p.switches.map(e=>(0,K.jsxs)(L.Tr,{children:[(0,K.jsx)(L.Td,{children:(0,K.jsx)(E,{style:Q,children:e.env})}),(0,K.jsx)(L.Td,{children:(0,K.jsx)(l,{size:`sm`,children:e.what})}),(0,K.jsx)(L.Td,{children:(0,K.jsx)(l,{size:`sm`,c:`dimmed`,children:e.suites.join(` · `)||`—`})}),(0,K.jsx)(L.Td,{children:(0,K.jsx)(z,{variant:`light`,color:e.open?`teal`:`gray`,tt:`none`,children:e.open?`ouvert`:`fermé`})})]},e.env))})]})})})]}),(0,K.jsxs)(P,{gap:`sm`,children:[(0,K.jsx)(y,{order:2,size:`xs`,tt:`uppercase`,c:`dimmed`,style:{letterSpacing:`.06em`},children:`Outils — aucun test ne les exige`}),(0,K.jsx)(ge,{cols:{base:1,xs:2,md:3,lg:4},spacing:`sm`,children:p.tools.map(e=>{let t=e.state===`healthy`||e.state===`running`;return(0,K.jsxs)(I,{withBorder:!0,radius:`md`,p:`sm`,children:[(0,K.jsxs)(o,{gap:8,wrap:`nowrap`,children:[(0,K.jsx)(z,{size:`xs`,circle:!0,variant:t?`filled`:`outline`,color:t?`teal`:`gray`,"aria-hidden":!0,children:` `}),(0,K.jsx)(l,{fw:600,size:`sm`,truncate:!0,children:e.label})]}),(0,K.jsxs)(l,{size:`xs`,c:`dimmed`,children:[e.oneShot&&e.state===`stopped`?`terminé`:Ut[e.state],` `,`· `,e.what]})]},e.service)})})]}),(0,K.jsxs)(l,{size:`xs`,c:`dimmed`,children:[`Même source que `,(0,K.jsx)(E,{style:Q,children:`npm run test:all -- --infra`}),` :`,` `,(0,K.jsx)(E,{style:Q,children:`scripts/test/vitest/gates.ts`}),`, attentes exportées par chaque `,(0,K.jsx)(E,{style:Q,children:`vitest*.config.ts`}),`.`]})]})}),$t=[`glance`,`overrides`,`modules`,`testbed`];function en(e){return $t.some(t=>t===e)}var tn={label:`défaut`,color:`gray`},nn={default:tn,app:{label:`app`,color:`grape`},env:{label:`env`,color:`teal`}};function rn({value:e}){return(0,K.jsxs)(o,{gap:6,wrap:`nowrap`,children:[(0,K.jsx)(E,{style:{fontSize:12},children:e}),(0,K.jsx)(D,{value:e,timeout:1500,children:({copied:t,copy:n})=>(0,K.jsx)(j,{label:t?`Copié`:`Copier`,withArrow:!0,children:(0,K.jsx)(g,{size:`sm`,variant:`subtle`,color:t?`teal`:`gray`,"aria-label":`Copier ${e}`,onClick:n,children:t?(0,K.jsx)(C,{size:14}):(0,K.jsx)(ie,{size:14})})})})]})}var an=[{label:`défaut`,color:`gray`,help:`La valeur d'usine du framework (personne ne l'a changée).`},{label:`module`,color:`blue`,help:`La config propre du module.`},{label:`app`,color:`grape`,help:`nodefony.config.ts, ou un autre module qui reconfigure celui-ci.`},{label:`env`,color:`teal`,help:`Une variable d'environnement — elle a le dernier mot.`}];function on(){return(0,K.jsxs)(I,{withBorder:!0,p:`md`,radius:`md`,children:[(0,K.jsxs)(o,{gap:6,mb:8,children:[(0,K.jsx)(d,{size:`sm`,variant:`light`,color:`grape`,children:(0,K.jsx)(Se,{size:14})}),(0,K.jsx)(l,{fw:600,size:`sm`,children:`Qui gagne ?`}),(0,K.jsx)(l,{size:`sm`,c:`dimmed`,children:`chaque niveau remplace le précédent`})]}),(0,K.jsx)(o,{gap:4,wrap:`wrap`,mb:8,children:an.map((e,t)=>(0,K.jsxs)(o,{gap:4,wrap:`nowrap`,children:[t>0&&(0,K.jsx)(te,{size:13,style:{opacity:.4},"aria-hidden":!0}),(0,K.jsx)(j,{label:e.help,withArrow:!0,children:(0,K.jsx)(z,{variant:`light`,color:e.color,tt:`none`,tabIndex:0,style:{cursor:`help`},children:e.label})})]},e.label))}),(0,K.jsxs)(l,{size:`xs`,c:`dimmed`,children:[`Comme des calques posés les uns sur les autres : on voit le dernier. Une variable d'environnement (`,(0,K.jsx)(E,{style:{fontSize:11},children:`NF__…`}),`) l'emporte sur le fichier — c'est ce qui permet de déployer sans toucher au code. La colonne « Provenance » dit quel calque se voit.`]})]})}function $({children:e}){return(0,K.jsx)(l,{size:`sm`,c:`dimmed`,maw:900,children:e})}var sn=de(()=>{let e=Ce(),n=(0,G.useCallback)(()=>e.api.getAbsolute(`/nodefony/kernel/api/config`),[e]),{data:r,loading:i,error:a,reload:s}=V(n),u=(0,G.useCallback)(()=>e.api.getAbsolute(`/nodefony/kernel/api/info`),[e]),{data:d}=V(u),f=(0,G.useCallback)(()=>e.api.getAbsolute(`/nodefony/test/api/testbed-capability`),[e]),{data:p}=V(f),m=p?.supported===!0,{modules:h,overrides:_,stats:y}=(0,G.useMemo)(()=>De(r?.modules??[]),[r]),ee=(0,G.useMemo)(()=>ut(h),[h]),b=h.find(e=>e.entry.isApp),x=(0,G.useMemo)(()=>h.filter(e=>!e.entry.isApp),[h]),S=_e(),[C,w]=he(),T=C.get(`tab`),te=T===`core`,D=te?`modules`:en(T)?T:`glance`,O=D===`modules`&&(te||C.get(`app`)===`1`),ie=O?C.get(`key`)??void 0:void 0,k=(0,G.useCallback)(e=>{en(e)&&w({tab:e})},[w]),A=(0,G.useCallback)(e=>{if(e.isApp){w({tab:`modules`,app:`1`,key:e.field.key});return}let t=new URLSearchParams({tab:`config`,key:e.field.key});S(`/nodefony/modules/${encodeURIComponent(e.moduleKey)}?${t.toString()}`)},[S,w]),j=b?.entry.key,ae=(0,G.useCallback)(async(t,n)=>{if(!j)return{ok:!1,error:`Aucune application exposée.`};try{return await e.api.patchAbsolute(`/nodefony/kernel/api/config/${encodeURIComponent(j)}`,{path:t.key,value:n}),e.notifications.notify(`success`,`${t.key} mis à jour (à chaud)`,{title:`Configuration`}),s(),{ok:!0}}catch(t){let n=je(t);return e.notifications.notify(`error`,n,{title:`Édition refusée`}),{ok:!1,error:n}}},[e,j,s]),N=(0,G.useMemo)(()=>[{key:`module`,header:`Module`,sortable:!0,filterable:!0,value:e=>e.module,render:e=>(0,K.jsx)(l,{size:`sm`,fw:500,children:e.module})},{key:`field`,header:`Réglage`,sortable:!0,filterable:!0,value:e=>e.field,render:e=>(0,K.jsx)(E,{style:{fontSize:12},children:e.field})},{key:`source`,header:`Provenance`,sortable:!0,filterable:!0,filterType:`select`,filterOptions:[`app`,`env`],render:e=>(0,K.jsx)(z,{size:`sm`,variant:`light`,color:(nn[e.source]??tn).color,tt:`none`,children:(nn[e.source]??tn).label})},{key:`where`,header:`Surchargé par`,sortable:!0,hint:`Qui a changé la valeur : la variable d'environnement réellement posée (provenance env), ou le fichier qui la pose (provenance app).`,render:e=>(0,K.jsx)(E,{style:{fontSize:12},children:e.where})},{key:`overrideKey`,header:`Variable pour la changer`,hint:`La variable d'environnement qui change ce réglage sans toucher au code (NF__<MODULE|APP>__<CHEMIN>). À copier dans .env (poste) ou chez l'hébergeur.`,render:e=>(0,K.jsx)(rn,{value:e.overrideKey})}],[]),F=e=>y.fieldCount?Math.round(e/y.fieldCount*100):0,L=(0,K.jsx)(g,{variant:`light`,size:`lg`,"aria-label":`Recharger la configuration`,loading:i,onClick:s,children:(0,K.jsx)(c,{size:18})});if(!h.length)return(0,K.jsxs)(P,{gap:`md`,children:[(0,K.jsx)(ne,{title:`Configuration`,icon:(0,K.jsx)(ve,{size:22}),actions:L}),(0,K.jsx)(oe,{loading:i,error:a,empty:!0,onRetry:s,emptyMessage:`Aucune configuration exposée.`,children:null})]});let ce=()=>w(O?{tab:`modules`}:{tab:`modules`,app:`1`}),R=b&&O?(0,K.jsx)(I,{withBorder:!0,radius:`md`,p:`md`,id:`config-app`,children:(0,K.jsxs)(P,{gap:`md`,children:[(0,K.jsxs)(o,{justify:`space-between`,wrap:`nowrap`,children:[(0,K.jsxs)(o,{gap:8,wrap:`nowrap`,children:[(0,K.jsx)(z,{size:`sm`,variant:`light`,color:`grape`,tt:`none`,children:`app`}),(0,K.jsx)(l,{fw:600,children:`Application — nodefony.config.ts`})]}),(0,K.jsx)(g,{variant:`subtle`,color:`gray`,"aria-label":`Replier la configuration de l'application`,onClick:ce,children:(0,K.jsx)(pe,{size:16})})]}),(0,K.jsx)($,{children:U.core}),(0,K.jsx)(Te,{module:b.entry.name,seg:b.entry.seg,schema:b.schemaStatus,sections:b.sections,editable:!1,onEdit:ae,focusKey:ie,renderHelp:e=>(0,K.jsx)(Oe,{field:e,moduleName:b.entry.name,isApp:!0})})]})}):null,le=(0,K.jsxs)(P,{gap:`md`,children:[(0,K.jsx)($,{children:U.modules}),(0,K.jsxs)(M,{children:[b&&(0,K.jsx)(M.Col,{span:{base:12,sm:6,lg:4},children:(0,K.jsx)(rt,{m:b,onOpen:ce})}),x.map(e=>(0,K.jsx)(M.Col,{span:{base:12,sm:6,lg:4},children:(0,K.jsx)(rt,{m:e,onOpen:()=>void S(`/nodefony/modules/${encodeURIComponent(e.entry.key)}?tab=config`)})},e.entry.key))]}),R]}),ue=(0,K.jsxs)(P,{gap:`md`,children:[(0,K.jsx)($,{children:U.overrides}),(0,K.jsx)(on,{}),(0,K.jsxs)(I,{withBorder:!0,p:`md`,radius:`md`,children:[(0,K.jsxs)(o,{justify:`space-between`,mb:8,children:[(0,K.jsxs)(o,{gap:6,children:[(0,K.jsx)(l,{fw:600,size:`sm`,children:`D'où viennent les valeurs`}),(0,K.jsx)(v,{title:`D'où viennent les valeurs`,summary:`Sur ${y.fieldCount} réglages, ${y.byProvenance.default} gardent leur valeur d'usine, ${y.byProvenance.app} sont posés par nodefony.config.ts et ${y.byProvenance.env} par une variable d'environnement. Une barre entièrement grise = un déploiement qui n'a rien changé.`})]}),(0,K.jsxs)(o,{gap:`md`,children:[(0,K.jsx)(cn,{color:`gray`,label:`défaut ${y.byProvenance.default}`}),(0,K.jsx)(cn,{color:`grape`,label:`app ${y.byProvenance.app}`}),(0,K.jsx)(cn,{color:`teal`,label:`env ${y.byProvenance.env}`})]})]}),(0,K.jsxs)(H.Root,{size:`xl`,radius:`sm`,children:[(0,K.jsx)(H.Section,{value:F(y.byProvenance.default),"aria-label":`Provenance défaut : ${F(y.byProvenance.default)} %`,color:`gray`}),(0,K.jsx)(H.Section,{value:F(y.byProvenance.app),"aria-label":`Provenance application : ${F(y.byProvenance.app)} %`,color:`grape`}),(0,K.jsx)(H.Section,{value:F(y.byProvenance.env),"aria-label":`Provenance environnement : ${F(y.byProvenance.env)} %`,color:`teal`})]})]}),(0,K.jsxs)(I,{withBorder:!0,p:`md`,radius:`md`,children:[(0,K.jsxs)(o,{gap:6,mb:`sm`,children:[(0,K.jsx)(l,{fw:600,children:`Réglages modifiés`}),(0,K.jsxs)(l,{size:`sm`,c:`dimmed`,children:[_.length,` diffèrent de la valeur d'usine`]})]}),_.length?(0,K.jsx)(re,{mode:`client`,data:_,columns:N,getRowId:e=>`${e.moduleKey}:${e.field}`,initialSort:{key:`module`,dir:`asc`},searchable:!0,searchPlaceholder:`Filtrer les réglages modifiés…`,height:_.length>12?void 0:`auto`,persist:{key:`studio.config.overrides`,storage:`session`}}):(0,K.jsx)(t,{title:`Déploiement 100 % par défaut`,summary:`Aucune valeur ne diffère de la valeur d'usine : ni le fichier ni l'environnement n'ont rien changé. C'est un état sain, pas une erreur.`,children:(0,K.jsx)(z,{variant:`light`,color:`gray`,tt:`none`,children:`aucune modification`})})]})]});return(0,K.jsx)(se,{title:`Configuration`,subtitle:`${x.length} module(s) · ${y.fieldCount} réglages · ${_.length} modifié(s) · ${y.secrets} secret(s)`,icon:(0,K.jsx)(ve,{size:22}),actions:L,statusBar:(0,K.jsxs)(P,{gap:6,children:[(0,K.jsxs)(o,{gap:6,wrap:`nowrap`,children:[(0,K.jsx)(l,{size:`sm`,c:`dimmed`,children:we}),(0,K.jsx)(v,{title:`Comment lire cette page`,summary:Ee,width:380})]}),(0,K.jsx)(yt,{index:ee,onOpen:A})]}),value:D,onChange:k,tabs:[{value:`glance`,label:`Coup d'œil`,icon:(0,K.jsx)(ye,{size:16}),panel:(0,K.jsx)(Bt,{index:ee,runtime:d??null,counts:{modified:_.length,secrets:y.secrets},onOpen:A,onShowOverrides:()=>k(`overrides`)})},{value:`overrides`,label:`Écarts`,icon:(0,K.jsx)(et,{size:16}),badge:(0,K.jsx)(z,{size:`xs`,variant:`light`,color:`grape`,children:_.length}),panel:ue},{value:`modules`,label:`Modules`,icon:(0,K.jsx)(be,{size:16}),badge:(0,K.jsx)(z,{size:`xs`,variant:`light`,color:`gray`,children:x.length+ +!!b}),panel:le},...m?[{value:`testbed`,label:`Décors`,icon:(0,K.jsx)(xe,{size:16}),badge:(0,K.jsx)(z,{size:`xs`,variant:`light`,color:`gray`,tt:`none`,children:`dépôt seul`}),panel:D===`testbed`?(0,K.jsx)(Qt,{}):null}]:[]]})});function cn({color:e,label:t}){return(0,K.jsxs)(o,{gap:6,wrap:`nowrap`,children:[(0,K.jsx)(z,{size:`xs`,circle:!0,variant:`filled`,color:e,style:{width:10,height:10,padding:0}}),(0,K.jsx)(l,{size:`xs`,c:`dimmed`,children:t})]})}export{sn as ConfigPage};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{G as t,Jr as n,K as r,Mr as i,Nr as a,P as o,Qn as s,Qr as c,Si as l,Xr as u,Y as d,a as ee,ar as f,br as te,cn as ne,er as p,gn as m,gr as re,hr as ie,ii as ae,mr as h,n as oe,nn as se,nr as g,or as _,pn as v,rr as ce,vn as y,wa as b,xr as x,yr as S,zn as C}from"./ui-NqIPktVY.js";import{B as le,F as w,H as ue,U as T,at as E,bt as D,dt as O,ft as k,gt as A,lt as de,ot as fe,rt as j,x as M}from"./index-Bxrb_NNJ.js";import{t as N}from"./IconAffiliate-CALcdBM0.js";import{t as P}from"./IconAdjustmentsHorizontal-BbopjGKW.js";import{t as F}from"./IconFile-BPpLKPwy.js";import{t as pe}from"./IconHeartRateMonitor-Dk3J4q2m.js";import{t as me}from"./IconCircleCheck-DkVi0NqA.js";import{n as I,t as L}from"./DbLogo-Cz2-EXsq.js";import{n as he}from"./orm-CL-WJRcX.js";import{c as R}from"./stores-CsHxacRb.js";var z=y(`outline`,`category`,`Category`,[[`path`,{d:`M4 4h6v6h-6l0 -6`,key:`svg-0`}],[`path`,{d:`M14 4h6v6h-6l0 -6`,key:`svg-1`}],[`path`,{d:`M4 14h6v6h-6l0 -6`,key:`svg-2`}],[`path`,{d:`M14 17a3 3 0 1 0 6 0a3 3 0 1 0 -6 0`,key:`svg-3`}]]),B=y(`outline`,`table`,`Table`,[[`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}],[`path`,{d:`M3 10h18`,key:`svg-1`}],[`path`,{d:`M10 3v18`,key:`svg-2`}]]),V=e(b(),1),H=`v1.2`;function U(e,t){return e.default&&t===0?{label:`défaut de l'ORM`,color:`gray`,hint:"Connecteur `default` de son ORM — mais AUCUNE brique durable n'est portée par un ORM : vos sessions, comptes, jetons et audit sont en mémoire, sur Redis ou en fichier. La page Stores dit où chacun est résolu."}:e.default?{label:`primaire`,color:`brand`,hint:`Base applicative principale — suit l'infra déclarée (NF_DATABASE_URL). Tes stores (session, users, tokens, audit…) et ton login vivent ici.`}:t!==void 0&&t>0?{label:`porte les stores`,color:`teal`,hint:`Une partie de vos données applicatives vit ICI : des briques durables (sessions, comptes, jetons, audit, 2FA…) sont résolues sur ce connecteur. Le connecteur « primaire » en porte davantage — la page Stores dit laquelle est où.`}:e.connection?.target===`:memory:`?{label:`dédié · volatile`,color:`grape`,hint:`Connecteur DÉDIÉ en mémoire (fixture/démo/test isolée). Ne suit PAS NF_DATABASE_URL et est perdu au redémarrage — il reste sur sqlite :memory: quelle que soit l'infra déclarée.`}:{label:`dédié`,color:`gray`,hint:`Connecteur secondaire avec sa propre config (base distincte) — indépendant de l'infra déclarée.`}}function W(e){if(e<0)return`—`;if(e<1e3)return String(e);if(e<1e6){let t=e/1e3;return`${t>=100?Math.round(t):t.toFixed(1).replace(/\.0$/,``)}k`}return`${(e/1e6).toFixed(1).replace(/\.0$/,``)}M`}function G(e){return e==null?`—`:e<1e3?`${e<10?e.toFixed(2):Math.round(e)} ms`:`${(e/1e3).toFixed(2)} s`}function K(e){if(e==null||e<0)return`—`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m ${t%60}s`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}j ${r%24}h`}function q(e){return new Date(e).toLocaleTimeString()}function J(e){return e==null?`—`:e<1024?`${e} o`:e<1048576?`${(e/1024).toFixed(1)} Ko`:e<1073741824?`${(e/1024/1024).toFixed(1)} Mo`:`${(e/1024/1024/1024).toFixed(2)} Go`}function Y(e,t){return e[`${t.connector}:${t.name}`]??e[t.name]}function X(e,t){let n=0,r=0,i=0,a=0,o={},s={},c={};for(let l of e){let e=l.relations??[];n+=e.length,e.length===0&&r++,l.columns&&l.columns.length!==0||i++;for(let t of e)o[t.type]=(o[t.type]??0)+1;let u=l.domain||l.module||`(non classé)`;s[u]=(s[u]??0)+1;let d=Y(t,l);typeof d==`number`&&d>0&&(a+=d,c[u]=(c[u]??0)+d)}return{relationTotal:n,orphans:r,noColumns:i,rowsTotal:a,relByType:o,entitiesByDomain:s,rowsByDomain:c,domainCount:Object.keys(s).length}}function ge(e,t){let n=[];return n.push({label:`Connecteurs`,value:e.connectors>0?e.connectors-e.connected:null,good:0,crit:Math.max(1,e.connectors),weight:1.5,critical:!0}),t.errPerMin!=null&&n.push({label:`Erreurs`,value:t.errPerMin,good:0,crit:30,weight:1.2,critical:!0}),e.queryTotal>0&&n.push({label:`Requêtes lentes`,value:e.slowTotal/e.queryTotal,good:.01,crit:.25,weight:1,floor:.3}),e.maxEwmaMs!=null&&n.push({label:`Latence`,value:e.maxEwmaMs,good:20,crit:500,weight:1,floor:.2}),t.reconPerMin!=null&&n.push({label:`Reconnexions`,value:t.reconPerMin,good:0,crit:6,weight:.8,floor:.2}),n}function _e(){o(`data-nf-orm-live`,`
|
|
2
|
+
@keyframes nf-live-breathe{0%,100%{opacity:.5}50%{opacity:1}}
|
|
3
|
+
.nf-live-dot{width:8px;height:8px;border-radius:50%;background:var(--mantine-color-teal-6);animation:nf-live-breathe 2.4s ease-in-out infinite;flex:0 0 auto}
|
|
4
|
+
.nf-live-card{box-shadow:inset 0 0 0 1px rgba(18,184,134,.22)}
|
|
5
|
+
@keyframes nf-flash{0%{background:rgba(18,184,134,.32)}100%{background:transparent}}
|
|
6
|
+
.nf-flash{animation:nf-flash .9s ease-out;border-radius:4px}
|
|
7
|
+
@media (prefers-reduced-motion: reduce){
|
|
8
|
+
.nf-live-dot{animation:none;opacity:.85}
|
|
9
|
+
.nf-flash{animation:none;background:transparent}
|
|
10
|
+
}
|
|
11
|
+
`)}function ve(e){try{return localStorage.getItem(e)}catch{return null}}function ye(e,t){try{localStorage.setItem(e,t)}catch{}}var Z=l();function Q(e,t){return t===`:memory:`?{label:`En mémoire (volatile)`,icon:(0,Z.jsx)(v,{size:14}),color:`grape`}:e===`sqlite`&&t?{label:`Fichier local`,icon:(0,Z.jsx)(F,{size:14}),color:`blue`}:{label:`Serveur`,icon:(0,Z.jsx)(w,{size:14}),color:`teal`}}function be(e){return[{key:`name`,header:`Entité`,sortable:!0,value:e=>e.name,render:t=>(0,Z.jsx)(i,{component:A,to:`/nodefony/orm-entity?name=${encodeURIComponent(t.name)}&connector=${encodeURIComponent(e)}`,size:`xs`,children:t.name})},{key:`domain`,header:`Domaine`,sortable:!0,value:e=>e.domain,render:e=>(0,Z.jsx)(a,{size:`xs`,c:`dimmed`,children:e.domain})},{key:`rows`,header:`Lignes`,align:`right`,sortable:!0,value:e=>e.rows,render:e=>(0,Z.jsx)(a,{size:`xs`,ff:`monospace`,children:W(e.rows)})}]}function $({icon:e,label:t,value:r,hint:i,info:o,color:s,flashKey:c}){return(0,Z.jsxs)(S,{withBorder:!0,radius:`sm`,p:`sm`,children:[(0,Z.jsxs)(n,{gap:6,wrap:`nowrap`,mb:4,c:`dimmed`,children:[e,(0,Z.jsx)(a,{size:`xs`,children:t}),o??(i?(0,Z.jsx)(d,{title:t,version:`v1.2`,summary:i}):null)]}),(0,Z.jsx)(a,{fw:700,size:`lg`,c:s,children:c===void 0?r:(0,Z.jsx)(`span`,{className:`nf-flash`,children:r},String(c))})]})}function xe({orm:e,entities:o,countMap:c,health:l,flow:f}){let g=e.connection?.driver??l?.driver??``,y=e.connection?.target??l?.target,b=e.connection?.version??l?.version,C=e.connection?.ormVersion??l?.ormVersion,O=he[e.vendor??``]??e.vendor??`—`,k=Q(g,y),M=y===`:memory:`,P=!!y&&!M&&g!==`sqlite`,F=U(e),R=(0,V.useMemo)(()=>{let t=o.filter(t=>t.connector===e.name),n=0,r=0,i=new Set,a=t.map(e=>{n+=e.relations?.length??0,i.add(e.domain||`(non classé)`);let t=Y(c,e);return typeof t==`number`&&t>0&&(r+=t),{name:e.name,domain:e.domain||`—`,rows:t??-1}}).sort((e,t)=>t.rows-e.rows||e.name.localeCompare(t.name));return{count:t.length,relations:n,rows:r,domainCount:i.size,rowList:a}},[o,c,e.name]),X=l?.recentErrors??[];return(0,Z.jsxs)(S,{withBorder:!0,radius:`md`,p:`lg`,children:[(0,Z.jsxs)(n,{justify:`space-between`,wrap:`nowrap`,mb:`md`,children:[(0,Z.jsxs)(n,{gap:`sm`,wrap:`nowrap`,style:{minWidth:0},children:[(0,Z.jsx)(s,{size:46,radius:`md`,variant:`default`,children:I(g)?(0,Z.jsx)(L,{name:g,size:28,title:g}):(0,Z.jsx)(j,{size:26})}),(0,Z.jsxs)(`div`,{style:{minWidth:0},children:[(0,Z.jsxs)(n,{gap:6,wrap:`nowrap`,children:[(0,Z.jsx)(i,{component:A,to:`/nodefony/orm-connector?name=${encodeURIComponent(e.name)}`,fw:700,truncate:!0,children:e.name}),(0,Z.jsx)(_,{label:F.hint,multiline:!0,w:280,withArrow:!0,children:(0,Z.jsx)(x,{size:`xs`,variant:`light`,color:F.color,style:{textTransform:`none`,cursor:`help`},children:F.label})})]}),(0,Z.jsxs)(n,{gap:5,wrap:`nowrap`,style:{minWidth:0},children:[I(e.vendor)&&(0,Z.jsx)(L,{name:e.vendor,size:13,title:O}),(0,Z.jsxs)(a,{size:`xs`,c:`dimmed`,truncate:!0,children:[O,C?` ${C}`:``,g?` · ${g}`:``]})]}),y&&(0,Z.jsxs)(n,{gap:4,wrap:`nowrap`,style:{minWidth:0},mt:2,children:[(0,Z.jsx)(`span`,{style:{display:`inline-flex`,color:`var(--mantine-color-${k.color}-6)`,flexShrink:0},"aria-hidden":!0,children:k.icon}),(0,Z.jsx)(a,{size:`xs`,c:`dimmed`,ff:`monospace`,truncate:!0,title:y,children:M?k.label:y})]})]})]}),(0,Z.jsx)(x,{variant:`light`,color:e.connected?`teal`:`gray`,leftSection:e.connected?(0,Z.jsx)(T,{size:13}):(0,Z.jsx)(ue,{size:13}),children:e.connected?`connecté`:`déconnecté`})]}),(0,Z.jsxs)(p,{defaultValue:`diagnostic`,keepMounted:!1,children:[(0,Z.jsxs)(p.List,{mb:`md`,children:[(0,Z.jsx)(p.Tab,{value:`diagnostic`,leftSection:(0,Z.jsx)(pe,{size:14}),children:`Diagnostic`}),(0,Z.jsx)(p.Tab,{value:`connexion`,leftSection:(0,Z.jsx)(T,{size:14}),children:`Connexion`}),(0,Z.jsx)(p.Tab,{value:`modele`,leftSection:(0,Z.jsx)(N,{size:14}),children:`Modèle`}),(0,Z.jsx)(p.Tab,{value:`entites`,leftSection:(0,Z.jsx)(B,{size:14}),children:`Entités`})]}),(0,Z.jsxs)(p.Panel,{value:`diagnostic`,children:[(0,Z.jsxs)(n,{gap:`xs`,wrap:`nowrap`,mb:`sm`,children:[(0,Z.jsx)(x,{size:`sm`,variant:`light`,color:l?l.pingOk?`teal`:`red`:e.connected?`gray`:`red`,leftSection:(0,Z.jsx)(v,{size:12}),children:l?(0,Z.jsx)(`span`,{className:`nf-flash`,children:l.pingOk?`ping ${G(l.pingMs)}`:`ping échec`},String(l.pingMs)):`ping —`}),l&&(0,Z.jsxs)(x,{size:`sm`,variant:`default`,leftSection:(0,Z.jsx)(w,{size:12}),children:[`instance `,l.instanceId]}),(0,Z.jsx)(d,{title:`Diagnostic per-instance`,version:H,summary:`Chaque process/pod a son propre pool de connexions, donc ses propres métriques (cloud-native).`,sections:[{label:`Temps réel`,body:`Données poussées en direct par la Socket Nodefony (switch « Temps réel »).`},{label:`Multi-pod`,body:`La vue agrégée relève de l'observabilité externe (Prometheus) ou du fan-out Redis cross-pod (P13).`}]})]}),(0,Z.jsxs)(D,{cols:{base:2,sm:3},spacing:`sm`,children:[(0,Z.jsx)($,{icon:(0,Z.jsx)(v,{size:16}),label:`Latence ping`,value:G(l?.pingMs??null),color:l?.pingOk?`teal`:void 0,flashKey:l?.pingMs??`—`,hint:"Round-trip RÉEL vers la base (SQL `SELECT 1` / Mongo `ping`), mesuré à chaque push temps réel et au bouton « Tester »."}),(0,Z.jsx)($,{icon:(0,Z.jsx)(E,{size:16}),label:`Uptime`,value:K(l?.uptimeMs??null),hint:`Temps écoulé depuis la dernière connexion réussie de ce process.`}),(0,Z.jsx)($,{icon:(0,Z.jsx)(T,{size:16}),label:`Connexions`,value:l?.connectCount??`—`,hint:`Nombre de connexions réussies depuis le démarrage du process (1 = boot normal).`}),(0,Z.jsx)($,{icon:(0,Z.jsx)(le,{size:16}),label:`Reconnexions`,value:l?.reconnectCount??`—`,color:l&&l.reconnectCount>0?`orange`:void 0,hint:`Connexions au-delà de la première = rétablissements après une coupure. > 0 signale une connexion instable (per-instance).`}),(0,Z.jsx)($,{icon:(0,Z.jsx)(m,{size:16}),label:`Erreurs`,value:l?.errorCount??`—`,color:l&&l.errorCount>0?`red`:void 0,hint:`Erreurs de connexion + pings en échec cumulés sur ce process. > 0 = la base a refusé/coupé au moins une fois.`}),(0,Z.jsx)($,{icon:(0,Z.jsx)(E,{size:16}),label:`Latence connexion`,value:G(l?.lastConnectMs??null),hint:`Durée d'établissement de la dernière connexion (handshake + pool). Élevée = base lente à répondre au boot.`})]}),f&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(h,{my:`sm`,label:(0,Z.jsxs)(n,{gap:5,children:[`Flux requêtes (live)`,(0,Z.jsx)(d,{title:`Flux SQL du connecteur`,version:`v1.2`,summary:`Débit SQL de ce connecteur (requêtes/s) + latence moyenne lissée (EWMA).`,sections:[{label:`Technique`,body:`Débit dérivé du delta entre 2 mesures ; latence lissée en EWMA. Le petit graphe = historique du débit.`},{label:`Source`,body:`Canal nodefony:orm:flow, cadence suivant le réglage temps réel.`}]})]}),labelPosition:`left`}),(0,Z.jsxs)(n,{justify:`space-between`,align:`flex-end`,wrap:`nowrap`,gap:`md`,children:[(0,Z.jsxs)(n,{gap:`lg`,wrap:`nowrap`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(a,{size:`xs`,c:`dimmed`,children:`Débit`}),(0,Z.jsxs)(a,{fw:700,style:{fontVariantNumeric:`tabular-nums`},children:[f.rate.toFixed(+(f.rate<10)),` `,(0,Z.jsx)(a,{span:!0,size:`xs`,c:`dimmed`,children:`req/s`})]})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(a,{size:`xs`,c:`dimmed`,children:`Latence ⌀ (EWMA)`}),(0,Z.jsx)(a,{fw:700,style:{fontVariantNumeric:`tabular-nums`},children:G(f.ewmaMs)})]})]}),f.hist.length>1&&(0,Z.jsx)(`div`,{style:{flex:1,minWidth:0,maxWidth:240},children:(0,Z.jsx)(ee,{series:[{data:f.hist,color:`var(--mantine-color-grape-5)`,label:`req/s`}],height:46})})]})]}),l&&(l.latency.samples>0||l.storage||l.pool)&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(h,{my:`sm`,label:`Sondes`,labelPosition:`left`}),(0,Z.jsxs)(D,{cols:{base:2,sm:3},spacing:`sm`,children:[l.latency.samples>0&&(0,Z.jsx)($,{icon:(0,Z.jsx)(v,{size:16}),label:`Latence min/⌀/max`,value:`${G(l.latency.min)} / ${G(l.latency.avg)} / ${G(l.latency.max)}`,flashKey:l.latency.last??`—`,hint:`Fenêtre glissante sur ${l.latency.samples} ping(s) — révèle les pics, pas qu'un instantané.`}),l.storage&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{icon:(0,Z.jsx)(j,{size:16}),label:`Taille base`,value:J(l.storage.sizeBytes),flashKey:l.storage.sizeBytes??`—`,hint:`${l.storage.pages??`—`} pages × ${l.storage.pageSize??`—`} o. Croissance visible en direct.`}),(0,Z.jsx)($,{icon:(0,Z.jsx)(de,{size:16}),label:`Journal`,value:l.storage.journalMode??`—`,hint:"Mode de journalisation SQLite (`wal` = lectures concurrentes pendant l'écriture ; `delete` = défaut)."}),(0,Z.jsx)($,{icon:(0,Z.jsx)(m,{size:16}),label:`Pages libres`,value:l.storage.freePages??`—`,color:(l.storage.freePages??0)>1e3?`orange`:void 0,hint:"Pages libérées non récupérées (fragmentation). Élevé → un `VACUUM` récupérerait de l'espace."})]}),l.pool&&(0,Z.jsx)($,{icon:(0,Z.jsx)(w,{size:16}),label:`Pool (actives/dispo)`,value:`${l.pool.borrowed??`—`} / ${l.pool.available??`—`}`,hint:`Connexions en cours d'utilisation / disponibles (bases serveur).`})]})]}),(0,Z.jsx)(h,{my:`sm`,label:`Erreurs récentes${X.length?` (${X.length})`:``}`,labelPosition:`left`}),X.length===0?(0,Z.jsxs)(n,{gap:6,c:`teal`,children:[(0,Z.jsx)(me,{size:16}),(0,Z.jsx)(a,{size:`sm`,children:`Aucune erreur de connexion enregistrée.`})]}):(0,Z.jsx)(ae.Autosize,{mah:150,type:`auto`,children:(0,Z.jsx)(ce,{gap:6,children:X.map((e,t)=>(0,Z.jsxs)(n,{gap:`xs`,wrap:`nowrap`,align:`flex-start`,children:[(0,Z.jsx)(a,{size:`xs`,c:`dimmed`,ff:`monospace`,style:{flexShrink:0},children:q(e.ts)}),(0,Z.jsx)(a,{size:`xs`,c:`red`,style:{wordBreak:`break-word`},children:e.message})]},`${e.ts}-${t}`))})}),l?.pingError&&(0,Z.jsxs)(a,{size:`xs`,c:`red`,mt:`xs`,children:[`Dernier ping : `,l.pingError]})]}),(0,Z.jsxs)(p.Panel,{value:`connexion`,children:[(0,Z.jsxs)(t,{children:[(0,Z.jsx)(r,{k:`Vendor ORM`,v:`${O}${C?` ${C}`:``}`}),(0,Z.jsx)(r,{k:`Base / driver`,v:g||`—`,mono:!0}),(0,Z.jsx)(r,{k:`Version base`,v:b??`—`,mono:!0}),(0,Z.jsx)(r,{k:`Connecteur`,v:`${e.name}${e.default?` (défaut)`:``}`,mono:!0}),(0,Z.jsx)(r,{k:`Rôle`,v:F.label})]}),(0,Z.jsx)(a,{size:`xs`,c:`dimmed`,mt:6,children:F.hint}),(0,Z.jsxs)(n,{gap:`xs`,mt:`sm`,align:`center`,children:[(0,Z.jsx)(x,{variant:`light`,color:k.color,leftSection:k.icon,children:k.label}),(0,Z.jsx)(d,{title:P?`Endpoint réseau`:`Emplacement`,version:H,summary:P?`Cible réseau de la connexion (host:port/base), credentials masqués côté serveur.`:`Emplacement physique de la base de données.`,sections:[{label:`Sécurité`,body:`Chemin TOUJOURS relatif à la racine du projet ; URL réseau SANS user/password — jamais d'absolu ni de credential exposé dans le data plane.`}]})]}),y&&!M?(0,Z.jsxs)(n,{gap:6,wrap:`nowrap`,mt:`xs`,style:{minWidth:0},children:[(0,Z.jsx)(re,{style:{fontSize:11,wordBreak:`break-all`,flex:1,minWidth:0},title:y,children:y}),(0,Z.jsx)(ie,{value:y,timeout:1500,children:({copied:e,copy:t})=>(0,Z.jsx)(_,{label:e?`Copié`:`Copier`,withArrow:!0,children:(0,Z.jsx)(u,{size:`sm`,variant:`subtle`,color:e?`teal`:`gray`,onClick:t,"aria-label":`Copier la cible de connexion`,children:e?(0,Z.jsx)(ne,{size:14}):(0,Z.jsx)(se,{size:14})})})})]}):(0,Z.jsx)(a,{size:`xs`,c:`dimmed`,mt:`xs`,children:M?`Base volatile en mémoire — aucun fichier, données perdues au redémarrage.`:`Emplacement indisponible.`})]}),(0,Z.jsxs)(p.Panel,{value:`modele`,children:[(0,Z.jsxs)(D,{cols:2,spacing:`sm`,children:[(0,Z.jsx)($,{icon:(0,Z.jsx)(B,{size:16}),label:`Entités`,value:R.count,hint:`Entités mappées sur ce connecteur.`}),(0,Z.jsx)($,{icon:(0,Z.jsx)(N,{size:16}),label:`Relations`,value:R.relations,hint:`Relations déclarées entre entités de ce connecteur.`}),(0,Z.jsx)($,{icon:(0,Z.jsx)(z,{size:16}),label:`Domaines`,value:R.domainCount,hint:`Domaines fonctionnels distincts couverts.`}),(0,Z.jsx)($,{icon:(0,Z.jsx)(fe,{size:16}),label:`Lignes`,value:W(R.rows),hint:`Total des lignes en base pour ce connecteur (COUNT(*)).`})]}),(0,Z.jsx)(te,{component:A,to:`/nodefony/databases`,variant:`subtle`,size:`xs`,mt:`md`,fullWidth:!0,leftSection:(0,Z.jsx)(N,{size:14}),children:`Voir le schéma ERD`})]}),(0,Z.jsx)(p.Panel,{value:`entites`,children:R.rowList.length===0?(0,Z.jsx)(a,{size:`sm`,c:`dimmed`,children:`Aucune entité sur ce connecteur.`}):(0,Z.jsx)(oe,{mode:`client`,data:R.rowList,columns:be(e.name),getRowId:e=>e.name,initialSort:{key:`rows`,dir:`desc`},searchable:!0,searchPlaceholder:`Rechercher une entité…`,height:300})})]})]})}function Se({intervalMs:e,adaptive:t,onData:n,onRate:r}){let{data:i,intervalMs:a}=k(C.ormHealth,e,{defaultMs:5e3,enabled:t});return M(i,e=>{Array.isArray(e)&&n(e)}),M(a,r),null}function Ce({intervalMs:e,adaptive:t,onFlow:n}){return O(C.ormFlow,n,e,{defaultMs:2e3,enabled:t}),null}function we({pid:e,intervalMs:t,adaptive:n,onHealth:r,onFlow:i,onPending:a}){let o=(0,V.useCallback)(e=>{let t=e;t&&(t.richPending?a?.(!0):(a?.(!1),Array.isArray(t.health)&&r(t.health),t.flow!==void 0&&i(t.flow)))},[r,i,a]);return O(`${C.ormRich}@${e}`,o,t,{defaultMs:3e3,enabled:n}),null}function Te({intervalMs:e,adaptive:t,onData:n,onRate:r}){let{realtime:i}=R(),{data:a,intervalMs:o}=k(i,C.socket,e,{defaultMs:5e3,enabled:t});return M(a,e=>{e&&n(e)}),M(o,r),null}function Ee(){let[e,t]=(0,V.useState)({}),n=(0,V.useRef)(null);return{flowByName:e,onFlow:(0,V.useCallback)(e=>{let r=e;if(!r||!Array.isArray(r.connectors))return;let i=n.current,a=i?(r.ts-i.ts)/1e3:0;t(e=>{let t={...e};for(let e of r.connectors){let n=i?.totals[e.connector],r=n!=null&&a>0?Math.max(0,(e.total-n)/a):t[e.connector]?.rate??0,o=[...t[e.connector]?.hist??[],r].slice(-40);t[e.connector]={rate:r,ewmaMs:e.ewmaMs,hist:o}}return t});let o={};for(let e of r.connectors)o[e.connector]=e.total;n.current={ts:r.ts,totals:o}},[]),reset:(0,V.useCallback)(()=>{t({}),n.current=null},[])}}function De(e,t){let n=(0,V.useRef)(new Map),[r,i]=(0,V.useState)(new Map),[a,o]=(0,V.useState)(new Map);return(0,V.useEffect)(()=>{t||(n.current=new Map,i(new Map),o(new Map))},[t]),(0,V.useEffect)(()=>{if(!e)return;let t=new Map,r=new Map,a=new Set;for(let i of e.instances){let o=i.orm;if(!o)continue;a.add(i.instanceId);let s=n.current.get(i.instanceId),c=s?(e.ts-s.ts)/6e4:0,l=s?(e.ts-s.ts)/1e3:0;t.set(i.instanceId,s&&c>0?{errPerMin:Math.max(0,(o.errorTotal-s.err)/c),reconPerMin:Math.max(0,(o.reconnectTotal-s.recon)/c)}:{errPerMin:null,reconPerMin:null}),r.set(i.instanceId,s&&l>0?Math.max(0,(o.queryTotal-s.q)/l):0),n.current.set(i.instanceId,{ts:e.ts,err:o.errorTotal,recon:o.reconnectTotal,q:o.queryTotal})}for(let e of n.current.keys())a.has(e)||n.current.delete(e);i(t),o(e=>{let t=new Map(e);for(let[e,n]of r){let r=t.get(e)??[],i=r.length>=40?r.slice(r.length-40+1):r.slice();i.push(n),t.set(e,i)}for(let e of t.keys())a.has(e)||t.delete(e);return t})},[e]),{ratesByPid:r,qSeriesByPid:a}}function Oe({live:e,onToggle:t,liveMs:r,setLiveMs:i,auto:o,effectiveMs:s,ariaLabel:l}){return(0,Z.jsxs)(n,{gap:`xs`,children:[e&&(0,Z.jsx)(`span`,{className:`nf-live-dot`,"aria-hidden":!0}),(0,Z.jsx)(g,{size:`sm`,checked:e,onChange:e=>t(e.currentTarget.checked),label:`Temps réel`,"aria-label":l}),(0,Z.jsxs)(c,{width:250,shadow:`md`,position:`bottom`,withinPortal:!0,children:[(0,Z.jsx)(c.Target,{children:(0,Z.jsx)(u,{variant:`subtle`,color:`gray`,w:24,h:24,"aria-label":o?`Cadence désirée (plancher)`:`Granularité du canal`,children:(0,Z.jsx)(P,{size:15,stroke:1.6})})}),(0,Z.jsxs)(c.Dropdown,{children:[(0,Z.jsxs)(n,{gap:6,mb:6,children:[(0,Z.jsx)(v,{size:14}),(0,Z.jsx)(a,{size:`xs`,fw:600,children:o?`Cadence désirée (plancher)`:`Granularité du canal`})]}),(0,Z.jsx)(f,{fullWidth:!0,size:`xs`,value:String(r),onChange:e=>i(Number(e)),data:[{label:`2 s`,value:`2000`},{label:`5 s`,value:`5000`},{label:`10 s`,value:`10000`},{label:`30 s`,value:`30000`}]}),(0,Z.jsx)(a,{size:`xs`,c:`dimmed`,mt:6,children:o?`Cadence auto (AIMD) ACTIVE — réglée globalement dans le Hub. Cette valeur sert de plancher : la socket part de là et l'ajuste seule selon la charge serveur.`:`Cadence des pushes de la socket (sonde ORM). Plus court = plus réactif, mais plus de sondes par seconde côté serveur. (Cadence auto réglable dans le Hub.)`})]})]}),o&&e?(0,Z.jsxs)(x,{size:`sm`,variant:`light`,color:`grape`,title:`Cadence auto (AIMD) — cadence réelle appliquée. Recule sous charge serveur, remonte quand c'est fluide. Réglage global dans le Hub.`,style:{fontVariantNumeric:`tabular-nums`},children:[`auto ~`,s<1e3?`${s}ms`:`${s/1e3}s`]}):null]})}export{B as C,ge as S,K as _,Oe as a,ve as b,Ee as c,X as d,U as f,q as g,J as h,Se as i,De as l,Y as m,$ as n,we as o,_e as p,Ce as r,Te as s,xe as t,H as u,G as v,z as w,ye as x,W as y};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{$n as t,Bt as n,Er as r,Ht as i,It as a,Jr as o,Ln as s,Mr as c,Nr as l,Pr as u,Qn as d,Rt as f,Si as p,Ut as m,Vn as h,Xr as g,Y as _,Zr as v,ar as y,br as b,cn as x,et as S,gn as C,gr as w,ir as T,nn as ee,nr as te,nt as ne,oi as E,on as re,or as D,pr as ie,q as ae,rr as O,sn as oe,sr as se,ti as k,tr as A,tt as ce,ur as le,vn as j,wa as M,xr as N,yr as ue,zn as P,zt as F}from"./ui-NqIPktVY.js";import{C as de,L as I,M as L,Q as fe,_t as pe,pt as R,rt as z}from"./index-Bxrb_NNJ.js";import{t as B}from"./IconApps-C6EUs10H.js";import{t as V}from"./IconBox-t6C2bRKY.js";import{t as me}from"./IconPlus-Coq8xjXa.js";import{O as he,c as ge,o as _e}from"./stores-CsHxacRb.js";import{t as H}from"./Breadcrumbs-DWWRbD1u.js";import{t as ve}from"./IconFolder-Ckv1Xm-N.js";import{t as U}from"./Collapse-ctIxjH-g.js";import{t as W}from"./TagsInput-Buuy4DOA.js";import{t as G}from"./List-BtRdrxnk.js";var K=j(`outline`,`adjustments`,`Adjustments`,[[`path`,{d:`M4 10a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-0`}],[`path`,{d:`M6 4v4`,key:`svg-1`}],[`path`,{d:`M6 12v8`,key:`svg-2`}],[`path`,{d:`M10 16a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-3`}],[`path`,{d:`M12 4v10`,key:`svg-4`}],[`path`,{d:`M12 18v2`,key:`svg-5`}],[`path`,{d:`M16 7a2 2 0 1 0 4 0a2 2 0 0 0 -4 0`,key:`svg-6`}],[`path`,{d:`M18 4v1`,key:`svg-7`}],[`path`,{d:`M18 9v11`,key:`svg-8`}]]),ye=j(`outline`,`browser`,`Browser`,[[`path`,{d:`M4 8h16`,key:`svg-0`}],[`path`,{d:`M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12`,key:`svg-1`}],[`path`,{d:`M8 4v4`,key:`svg-2`}]]),be=j(`outline`,`folder-open`,`FolderOpen`,[[`path`,{d:`M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2`,key:`svg-0`}]]),xe=j(`filled`,`player-stop-filled`,`PlayerStopFilled`,[[`path`,{d:`M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z`,key:`svg-0`}]]),q=e(M(),1),Se=F([`info`,`out`,`err`,`ok`,`fail`]),Ce=F([`running`,`done`,`failed`]),we=e=>s(e)&&f(e.seq)&&f(e.ts)&&Se(e.stream)&&n(e.text);function Te(e){if(!s(e))return null;if(e.kind===`line`)return we(e.line)?{kind:`line`,line:e.line}:null;if(e.kind!==`state`||!s(e.state))return null;let t=e.state;return!n(t.id)||!n(t.type)||!Ce(t.status)||!f(t.startedAt)?null:{kind:`state`,state:{id:t.id,type:t.type,status:t.status,startedAt:t.startedAt,endedAt:f(t.endedAt)?t.endedAt:null,files:a(t.files,n),notes:a(t.notes,n),lines:a(t.lines,we)}}}var J=[{key:`sqlite`,label:`SQLite`},{key:`postgres`,label:`PostgreSQL`},{key:`mysql`,label:`MySQL / MariaDB`},{key:`mongodb`,label:`MongoDB`}];function Y(e,t){let n=e?.connectors??[];return n.find(e=>e.name===t)?.dialect??n.at(0)?.dialect??null}function Ee(e,t,n){let r=Y(t,n);if(r===null)return e;let i=r!==`mongodb`;return e.hasSqlOrm===i?e:{...e,hasSqlOrm:i}}function X(e){switch(e){case`string`:return`nom:string(120)`;case`char`:return`pays:char(2)`;case`decimal`:return`prix:decimal(10,2)`;case`enum`:return`statut:enum(draft,published)`;case`ref`:return`auteur:ref:User`;default:return`nom:${e}`}}var De={sqlite:`Le type ne porte aucune longueur : string(120) devient un text(120) qu'une contrainte CHECK borne en base, et le schéma d'entrée avant elle, sur tous les transports.`,postgres:`Types stricts : une référence prend le type exact de la clé visée (uuid, entier, texte pour User). Le schéma de production s'applique par orm:generate puis orm:migrate.`,mysql:`Les dates sont en datetime(3) (timestamp s'arrête en 2038), une valeur d'énumération tient en 64 caractères. Le schéma de production s'applique par orm:generate puis orm:migrate.`,mongodb:`Ni clé étrangère ni migration : une relation est un ObjectId chargé par ?include=, et supprimer un parent n'est jamais refusé. Les options SQL (table, casse des colonnes, index composites) sont refusées.`};function Oe(e,t,n,r){if(!e)return[];let i=t.find(e=>e.kind===`app`)?.name,a=typeof n==`string`&&n!==``?n:i;return[...new Set([...a?e.entities[a]??[]:[],...i&&a!==i&&r===`mongodb`?e.entities[i]??[]:[]])].sort()}function ke(e){return e===`app`}var Ae=/^[a-z][a-z0-9-]*$/u;function Z(e){return e.split(`/`).filter(e=>e!==``)}function je(e,t){return e===``?t:`${e}/${t}`}function Me(e,t){return Z(e).slice(0,t).join(`/`)}function Ne(e,t,n){let r=n.trim(),i=e===null?`Choisissez un emplacement d'installation.`:r===``?`Donnez un nom à l'application pour voir sa destination.`:Ae.test(r)?null:`Nom d'application invalide : minuscules, chiffres et tirets, commençant par une lettre (ex : mon-app).`,a=r===``?`<nom>`:r;return{label:[e?.label??`<emplacement>`,...Z(t),a].join(`/`),path:e?[e.path,...Z(t),a].join(`/`):null,issue:i}}function Pe(e){return e[0]?.id??null}function Q(e,t,n={}){return!(e.askIf&&t[e.askIf]===!1||e.askWhen&&String(n[e.askWhen.key])!==e.askWhen.equals)}function Fe(e,t,n={}){let r=e.questions.filter(e=>Q(e,t,n));return{main:r.filter(e=>!e.advanced),advanced:r.filter(e=>e.advanced===!0)}}function Ie(e,t){let n={};for(let r of e.questions)Q(r,t,n)&&(n[r.key]=r.key===`link`&&e.type===`app`&&t.hasCheckout===!0||r.default);return n}var Le=new Map;function Re(e){let t=Le.get(e);if(t)return t;try{let t=new RegExp(e);return Le.set(e,t),t}catch{return null}}function ze(e,t){if(e.type!==`string`||!e.pattern)return null;let n=typeof t==`string`?t:``,r=Re(e.pattern);return!r||r.test(n)?null:e.patternHint??`Valeur attendue : ${e.pattern}`}function Be(e,t,n){let r={};for(let i of e.questions){if(!Q(i,n))continue;let e=ze(i,t[i.key]);e&&(r[i.key]=e)}return r}function Ve(e,t,n,r){return!ke(e)||!r.includes(`install`)||n.link===!0?null:t.hasCheckout===!0?`Sans le câblage sur le checkout local, npm install ira chercher les paquets @nodefony/* sur le registre npm, où ils ne sont pas encore publiés : l'installation échouera (404). Cochez le câblage dans les réglages, ou décochez npm install et installez l'app plus tard.`:`Aucun checkout du framework n'est résolvable depuis ce serveur, et les paquets @nodefony/* ne sont pas encore publiés sur npm : npm install échouera (404). Décochez l'étape — l'application sera écrite, à installer à la main.`}var He={install:{label:`npm install`,help:`Installe les dépendances et — pour un module — crée le lien de workspace. Sans lui, un module tout juste créé n'est PAS résolvable par le kernel (il l'importe par son NOM).`},build:{label:`npm run build`,help:`Compile le projet (et les modules). Le nouveau code n'est chargé qu'au redémarrage du serveur.`},typecheck:{label:`npm run typecheck`,help:`Vérifie les types du projet — le seul gate qui attrape une erreur de type (le bundler, lui, ne type pas).`}};function Ue(e){return He[e]??{label:e,help:`Étape déclarée par le serveur.`}}function We(e,t){let n=e===`app`||e===`module`||e===`front`?[`install`]:[];return t.filter(e=>n.includes(e))}function Ge(e,t){let n=e.length>=500?e.slice(1):e.slice();return n.push(t),n}var Ke={info:`var(--mantine-color-gray-5)`,out:`var(--mantine-color-gray-2)`,err:`var(--mantine-color-orange-4)`,ok:`var(--mantine-color-teal-4)`,fail:`var(--mantine-color-red-5)`};function qe(e,t){if(e.type===`boolean`)return t===!0?`oui`:`non`;if(e.type===`list`){let n=Array.isArray(t)?t:[];return n.length===0?`aucun`:n.map(t=>e.choices?.find(e=>e.value===t)?.label??t).join(`, `)}let n=typeof t==`string`?t:``;if(n===``)return`— (défaut)`;if(e.type===`choice`){let t=e.choices?.find(e=>e.value===n);return t?t.label:n}return n}function Je(e){return e instanceof Error&&e.message?e.message:`Le serveur a refusé la demande.`}var Ye=new Set([`json`,`date`,`ref`]);function Xe(e){return{id:e,name:``,type:`string`,length:``,precision:``,scale:``,values:[],target:``,nullable:!1,unique:!1,indexed:!1,defaultValue:``}}function Ze(e){let t=e.name.trim();if(!t)return null;let n;n=e.type===`ref`?`ref:${e.target.trim()}`:(e.type===`string`||e.type===`char`)&&e.length.trim()?`${e.type}(${e.length.trim()})`:e.type===`decimal`&&e.precision.trim()?`decimal(${e.precision.trim()},${e.scale.trim()||`0`})`:e.type===`enum`?`enum(${e.values.map(e=>e.trim()).filter(Boolean).join(`,`)})`:e.type;let r=`${t}:${n}`;return e.nullable&&(r+=`?`),e.defaultValue.trim()&&!Ye.has(e.type)&&(r+=`=${e.defaultValue.trim()}`),e.unique?r+=`:unique`:e.indexed&&(r+=`:index`),r}function Qe(e){return e.map(Ze).filter(e=>e!==null).join(` `)}function $e(e){return typeof e==`string`?e.split(/\s+/u).map(e=>e.split(`:`)[0]??``).filter(Boolean):[]}var $=p(),et=`/nodefony/studio/api/create/browse`,tt=3,nt={display:`inline-flex`,alignItems:`center`,gap:4};function rt(e){if(e instanceof he){let t=e.body;if(t&&typeof t.error==`string`&&t.error)return t.error}return e instanceof Error&&e.message?e.message:`Exploration impossible.`}function it({roots:e,rootId:t,subPath:n,name:r,onRootChange:i,onSubPathChange:a}){let s=ge(),d=(0,q.useCallback)(async()=>{if(t===null)return{sub:``,dirs:[]};let e=new URLSearchParams({root:t,sub:n});try{return await s.api.getAbsolute(`${et}?${e.toString()}`)}catch(e){throw Error(rt(e),{cause:e})}},[s,t,n]),{data:f,loading:p,error:m,reload:h}=de(d),g=e.find(e=>e.id===t)??null,v=f?.dirs??[],x=Z(n),S=Ne(g,n,r);return e.length===0?(0,$.jsx)(u,{color:`orange`,variant:`light`,icon:(0,$.jsx)(C,{size:16}),title:`Aucun emplacement d'installation`,children:(0,$.jsxs)(l,{size:`sm`,children:[`Le serveur ne déclare aucun espace de travail où créer une application. Déclarez-en un dans la configuration du module Studio (`,(0,$.jsx)(w,{children:`scaffold.roots`}),`), puis rechargez.`]})}):(0,$.jsx)(k,{withBorder:!0,p:`md`,children:(0,$.jsxs)(O,{gap:`md`,children:[(0,$.jsxs)(O,{gap:6,children:[(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(l,{size:`sm`,fw:600,children:`Espace de travail`}),(0,$.jsx)(_,{title:`Une app naît hors du projet`,summary:`Les emplacements proposés sont ceux que le serveur autorise — par défaut le dossier parent du projet courant, là où vivent déjà vos autres projets.`,sections:[{label:`Ce que le navigateur envoie`,body:`L'identifiant de l'emplacement et un sous-dossier relatif — jamais un chemin. Le serveur recompose la destination et refuse tout ce qui sortirait de l'espace autorisé.`},{label:`Pour en ajouter un`,body:`Configuration du module Studio, clé scaffold.roots (libellé + chemin).`}]})]}),e.length>tt?(0,$.jsx)(T,{"aria-label":`Espace de travail`,data:e.map(e=>({value:e.id,label:e.label})),value:t??``,onChange:e=>e&&i(e),allowDeselect:!1}):(0,$.jsx)(y,{"aria-label":`Espace de travail`,data:e.map(e=>({value:e.id,label:e.label})),value:t??e.at(0)?.id??``,onChange:i}),g&&(0,$.jsx)(l,{size:`xs`,c:`dimmed`,children:(0,$.jsx)(w,{children:g.path})})]}),(0,$.jsx)(`nav`,{"aria-label":`Fil d'Ariane du dossier d'installation`,children:(0,$.jsxs)(H,{separator:(0,$.jsx)(re,{size:12}),children:[(0,$.jsxs)(c,{component:`button`,type:`button`,size:`sm`,"aria-label":`Revenir à la racine de l'espace de travail`,onClick:()=>a(``),style:nt,children:[(0,$.jsx)(fe,{size:14}),(0,$.jsx)(`span`,{children:g?.label??`Racine`})]}),x.map((e,t)=>(0,$.jsx)(c,{component:`button`,type:`button`,size:`sm`,"aria-label":`Remonter au dossier ${e}`,onClick:()=>a(Me(n,t+1)),children:e},`${e}-${String(t)}`))]})}),(0,$.jsx)(ce,{loading:p,error:m,empty:!p&&!m&&v.length===0,onRetry:h,minHeight:80,emptyMessage:`Aucun sous-dossier ici — l'application naîtra directement dans ce dossier.`,children:(0,$.jsx)(o,{gap:`xs`,children:v.map(e=>(0,$.jsx)(b,{variant:`default`,size:`compact-sm`,leftSection:(0,$.jsx)(ve,{size:14}),"aria-label":`Ouvrir le dossier ${e}`,onClick:()=>a(je(n,e)),children:e},e))})}),(0,$.jsx)(k,{withBorder:!0,p:`sm`,bg:`var(--mantine-color-default-hover)`,"aria-live":`polite`,children:(0,$.jsxs)(O,{gap:6,children:[(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(be,{size:16}),(0,$.jsx)(l,{size:`sm`,fw:600,children:`L'application naîtra ici`}),S.issue===null&&(0,$.jsx)(N,{variant:`light`,color:`teal`,size:`sm`,children:`destination complète`})]}),(0,$.jsx)(w,{block:!0,children:S.label}),S.issue?(0,$.jsx)(l,{size:`sm`,c:`orange`,children:S.issue}):S.path&&(0,$.jsxs)(l,{size:`xs`,c:`dimmed`,children:[`Chemin sur le serveur : `,(0,$.jsx)(w,{children:S.path})]})]})})]})})}function at({types:e,referenceable:n,error:i,onChange:a}){let[s,c]=(0,q.useState)([Xe(1)]),[u,d]=(0,q.useState)(2),f=e=>{c(e),a(Qe(e))},p=(e,t)=>f(s.map(n=>n.id===e?{...n,...t}:n));return(0,$.jsxs)(O,{gap:`xs`,children:[(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(l,{size:`sm`,fw:500,children:`Champs`}),(0,$.jsx)(_,{title:`Composer les champs`,summary:`${s.length} champ(s) en cours. Chaque ligne est traduite dans la grammaire de la commande, et le générateur la valide à la préview : ce que l'écran accepte est exactement ce que le terminal accepterait.`,sections:[{label:`Obligatoire par défaut`,body:`Un champ est NON NUL tant que « facultatif » n'est pas coché. « unique » pose une contrainte d'unicité, qui indexe déjà ; « indexé » un index simple.`},{label:`Relation`,body:n.length>0?`Le type « ref » vise une entité existante : ${n.join(`, `)}.`:`Le type « ref » vise une entité existante — cette cible n'en a encore aucune.`}]})]}),s.map((i,a)=>(0,$.jsx)(k,{withBorder:!0,p:`xs`,children:(0,$.jsxs)(o,{gap:`xs`,align:`flex-end`,wrap:`wrap`,children:[(0,$.jsx)(t,{label:`Nom`,placeholder:`publishedAt`,value:i.name,onChange:e=>p(i.id,{name:e.currentTarget.value}),w:180,"aria-label":`Nom du champ ${a+1}`}),(0,$.jsx)(T,{label:`Type`,data:e,value:i.type,onChange:e=>{let t=e??`string`;p(i.id,{type:t,...t===`decimal`&&!i.precision?{precision:`10`,scale:`2`}:{}})},allowDeselect:!1,w:130}),(i.type===`string`||i.type===`char`)&&(0,$.jsx)(t,{label:i.type===`char`?`Longueur exacte`:`Longueur max`,placeholder:i.type===`char`?`2`:`255`,value:i.length,onChange:e=>p(i.id,{length:e.currentTarget.value.replace(/\D/gu,``)}),w:120}),i.type===`decimal`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(t,{label:`Chiffres`,placeholder:`10`,value:i.precision,onChange:e=>p(i.id,{precision:e.currentTarget.value.replace(/\D/gu,``)}),w:90}),(0,$.jsx)(t,{label:`Décimales`,placeholder:`2`,value:i.scale,onChange:e=>p(i.id,{scale:e.currentTarget.value.replace(/\D/gu,``)}),w:90})]}),i.type===`enum`&&(0,$.jsx)(W,{label:`Valeurs admises`,placeholder:`draft, puis Entrée`,value:i.values,onChange:e=>p(i.id,{values:e}),w:240}),i.type===`ref`&&(0,$.jsx)(T,{label:`Entité visée`,data:n,value:i.target||null,onChange:e=>p(i.id,{target:e??``}),placeholder:n.length?`choisir`:`aucune entité`,disabled:n.length===0,w:160}),!Ye.has(i.type)&&(0,$.jsx)(t,{label:`Défaut`,placeholder:i.type===`bool`?`true`:`—`,value:i.defaultValue,onChange:e=>p(i.id,{defaultValue:e.currentTarget.value}),w:110}),(0,$.jsxs)(O,{gap:4,pb:4,children:[(0,$.jsx)(r,{label:`facultatif`,checked:i.nullable,onChange:e=>p(i.id,{nullable:e.currentTarget.checked})}),(0,$.jsxs)(o,{gap:`sm`,children:[(0,$.jsx)(r,{label:`unique`,checked:i.unique,onChange:e=>p(i.id,{unique:e.currentTarget.checked})}),(0,$.jsx)(r,{label:`indexé`,checked:i.indexed||i.unique||i.type===`ref`,disabled:i.unique||i.type===`ref`,onChange:e=>p(i.id,{indexed:e.currentTarget.checked})})]})]}),(0,$.jsx)(g,{variant:`subtle`,color:`red`,"aria-label":`Retirer le champ ${i.name||a+1}`,disabled:s.length===1,onClick:()=>f(s.filter(e=>e.id!==i.id)),mb:6,children:(0,$.jsx)(m,{size:16})})]})},i.id)),(0,$.jsx)(o,{children:(0,$.jsx)(b,{variant:`light`,size:`compact-sm`,leftSection:(0,$.jsx)(me,{size:14}),onClick:()=>{d(u+1),f([...s,Xe(u)])},children:`Ajouter un champ`})}),i&&(0,$.jsx)(l,{size:`sm`,c:`red`,role:`alert`,children:i})]})}var ot=0,st=e=>({id:ot++,cols:e});function ct({label:e,columns:t,value:n,onChange:r}){let[i,a]=(0,q.useState)(()=>n.map(e=>st(e.split(`,`).filter(Boolean)))),s=e=>{a(e),r(e.filter(e=>e.cols.length>0).map(e=>e.cols.join(`,`)))};return(0,$.jsxs)(O,{gap:6,children:[(0,$.jsx)(l,{size:`sm`,fw:500,children:e}),i.length===0&&(0,$.jsx)(l,{size:`xs`,c:`dimmed`,children:`Aucun — un index qui porte PLUSIEURS colonnes se compose ici.`}),i.map((n,r)=>(0,$.jsxs)(o,{gap:`xs`,align:`flex-end`,wrap:`nowrap`,children:[(0,$.jsx)(se,{"aria-label":`${e} ${r+1}`,data:t,value:n.cols,onChange:e=>s(i.map(t=>t.id===n.id?{...t,cols:e}:t)),placeholder:t.length?`colonnes, dans l'ordre`:`déclarez d'abord des champs`,disabled:t.length===0,style:{flex:1}}),(0,$.jsx)(g,{variant:`subtle`,color:`red`,"aria-label":`Retirer ${e.toLowerCase()} ${r+1}`,onClick:()=>s(i.filter(e=>e.id!==n.id)),mb:6,children:(0,$.jsx)(m,{size:16})})]},n.id)),(0,$.jsx)(o,{children:(0,$.jsx)(b,{variant:`light`,size:`compact-sm`,leftSection:(0,$.jsx)(me,{size:14}),disabled:t.length<2,onClick:()=>s([...i,st([])]),children:`Ajouter`})})]})}function lt(e){return e.map(e=>e.kind===`app`?{value:``,label:`${e.name} — application racine`}:{value:e.name,label:`${e.name} — module`})}function ut({question:e,value:n,error:i,targets:a,onChange:s}){if(e.key===`module`)return(0,$.jsx)(T,{label:e.label,description:`Où le code est écrit.`,data:lt(a),value:typeof n==`string`?n:``,onChange:t=>s(e.key,t??``),allowDeselect:!1,error:i});if(e.type===`boolean`){let t=(0,$.jsx)(r,{label:e.label,checked:n===!0,onChange:t=>s(e.key,t.currentTarget.checked)});return e.key===`link`?(0,$.jsxs)(o,{gap:`xs`,wrap:`nowrap`,children:[t,(0,$.jsx)(_,{title:`Câblage sur le checkout local`,summary:`L'application utilisera le framework de VOTRE checkout (dépendances @nodefony/* réécrites en file:…) au lieu des paquets du registre npm.`,sections:[{label:`Pourquoi c'est nécessaire`,body:`Les paquets @nodefony/* ne sont pas encore publiés sur npm : sans ce câblage, npm install s'arrête sur un 404. Décoché, l'app est écrite mais pas installable en l'état.`},{label:`Ce que ça change`,body:`Les modifications du framework se répercutent immédiatement dans l'app générée — c'est le mode de travail d'un contributeur du framework.`}]})]}):t}if(e.type===`list`&&e.choices){let t=Array.isArray(n)?n:[];return(0,$.jsxs)(O,{gap:4,children:[(0,$.jsxs)(o,{gap:`xs`,wrap:`nowrap`,children:[(0,$.jsx)(l,{size:`sm`,fw:500,children:e.label}),(0,$.jsx)(_,{title:`Ce que « câbler un agent » veut dire`,summary:`Rien n'est coché par défaut : ${t.length===0?`en l'état, aucun fichier d'agent n'est écrit hors du projet`:`${t.length} agent(s) seront servis`}.`,sections:[{label:`Ce que l'application dépose, toujours`,body:`Ses instructions en AGENTS.md (standard porté par l'Agentic AI Foundation, sous Linux Foundation ; précédence « le plus proche gagne »), et un pointeur au nom des agents qui ne lisent pas ce fichier — Claude Code lit CLAUDE.md, Gemini CLI lit GEMINI.md.`},{label:`Ce que ce choix ajoute`,body:`La porte d'introspection de l'app, déclarée chez l'agent coché — par SA propre CLI, jamais en écrivant son fichier de configuration. Un agent conforme aux standards se sert seul des fichiers du projet : c'est le premier choix de la liste, et il ne lance aucune commande.`},{label:`Si vous ne cochez rien`,body:`Aucune configuration d'un autre outil n'est touchée. Le geste reste disponible plus tard : npx nodefony ai:mcp, dans l'application générée.`}]})]}),e.choices.map(n=>(0,$.jsx)(r,{label:n.hint?`${n.label} — ${n.hint}`:n.label,checked:t.includes(n.value),onChange:r=>s(e.key,r.currentTarget.checked?[...t,n.value]:t.filter(e=>e!==n.value))},n.value)),i?(0,$.jsx)(l,{size:`xs`,c:`red`,children:i}):null]})}if(e.type===`choice`){let t=(e.choices??[]).map(e=>({value:e.value,label:e.hint?`${e.label} — ${e.hint}`:e.label}));return(0,$.jsx)(T,{label:e.label,data:t,value:typeof n==`string`?n:``,onChange:t=>s(e.key,t??``),allowDeselect:!1,error:i})}return(0,$.jsx)(t,{label:e.label,value:typeof n==`string`?n:``,onChange:t=>s(e.key,t.currentTarget.value),error:i,description:e.patternHint})}function dt({spec:e,answers:t,errors:n,targets:r,caps:i,onChange:a,entity:s}){let[c,d]=(0,q.useState)(!1),{main:f,advanced:p}=Fe(e,i,t),m=[`id`,...$e(t.fields),...t.timestamps===!1?[]:[`createdAt`,`updatedAt`],...t.softDelete===!0?[`deletedAt`]:[]],h=e=>s&&e.key===`fields`?(0,$.jsx)(at,{types:s.types,referenceable:s.referenceable,error:n[e.key]??null,onChange:t=>a(e.key,t)},e.key):s&&(e.key===`index`||e.key===`uniqueIndex`)?(0,$.jsx)(ct,{label:e.key===`index`?`Index composites`:`Contraintes d'unicité composites`,columns:m,value:Array.isArray(t[e.key])?t[e.key]:[],onChange:t=>a(e.key,t)},e.key):(0,$.jsx)(ut,{question:e,value:t[e.key],error:n[e.key]??ft(e,t[e.key]),targets:r,onChange:a},e.key);return(0,$.jsxs)(O,{gap:`md`,children:[f.map(h),p.length>0&&(0,$.jsxs)(O,{gap:`xs`,children:[(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsxs)(b,{variant:`subtle`,size:`compact-sm`,color:`gray`,leftSection:(0,$.jsx)(K,{size:16}),rightSection:c?(0,$.jsx)(oe,{size:14}):(0,$.jsx)(re,{size:14}),"aria-expanded":c,onClick:()=>d(e=>!e),children:[`Réglages avancés (`,p.length,`)`]}),(0,$.jsx)(ae,{text:`Ces réglages ont un défaut sûr — les laisser tels quels donne le comportement recommandé.`})]}),(0,$.jsx)(U,{expanded:c,children:(0,$.jsx)(O,{gap:`md`,pt:`xs`,children:p.map(h)})})]}),f.length===0&&p.length===0&&(0,$.jsx)(u,{color:`gray`,variant:`light`,children:(0,$.jsx)(l,{size:`sm`,children:`Ce type ne demande aucune réponse.`})})]})}function ft(e,t){return typeof t!=`string`||t===``?null:ze(e,t)}var pt=e=>J.find(t=>t.key===e)?.label??e??`inconnu`,mt={whiteSpace:`nowrap`};function ht({context:e,engine:t,referenceable:n}){let[r,i]=(0,q.useState)(!1),a=r?J:J.filter(e=>e.key===t).concat(t&&J.some(e=>e.key===t)?[]:J),s=t?De[t]:void 0;return(0,$.jsx)(k,{withBorder:!0,p:`md`,children:(0,$.jsxs)(O,{gap:`sm`,children:[(0,$.jsxs)(o,{justify:`space-between`,wrap:`wrap`,gap:`xs`,children:[(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(l,{fw:600,children:`Types de champ`}),(0,$.jsxs)(N,{variant:`light`,color:`brand`,children:[`moteur : `,pt(t)]}),(0,$.jsx)(_,{title:`Ce que le générateur écrit`,summary:`${e.columnTypes.length} types, rendus tels que CETTE version du générateur les écrit sur ${J.length} moteurs. Le moteur affiché suit le connecteur choisi dans les réglages.`,sections:[{label:`Grammaire`,body:`nom:type — non nul par défaut. « ? » rend facultatif, « =valeur » fixe un défaut littéral, « :index » pose un index, « :unique » l'unicité. Le « ! » est refusé : un champ est déjà obligatoire.`},{label:`Casse`,body:`Entité et cible d'une relation en PascalCase (Post, ref:User), champ en camelCase (publishedAt). Une faute de casse ou un type d'un autre outil (boolean, integer) est refusé avec la forme juste.`}]})]}),(0,$.jsx)(te,{label:`Comparer les moteurs`,checked:r,onChange:e=>i(e.currentTarget.checked)})]}),s&&(0,$.jsxs)(l,{size:`sm`,c:`dimmed`,children:[(0,$.jsxs)(l,{span:!0,fw:600,c:`yellow.8`,children:[`À savoir sur `,pt(t),` :`]}),` `,s]}),(0,$.jsx)(A.ScrollContainer,{minWidth:r?760:420,children:(0,$.jsxs)(A,{striped:!0,withTableBorder:!0,verticalSpacing:4,children:[(0,$.jsx)(A.Thead,{children:(0,$.jsxs)(A.Tr,{children:[(0,$.jsx)(A.Th,{scope:`col`,children:`Type`}),(0,$.jsx)(A.Th,{scope:`col`,children:`Syntaxe`}),a.map(e=>(0,$.jsxs)(A.Th,{scope:`col`,children:[e.label,e.key===t&&r?` (ici)`:``]},e.key))]})}),(0,$.jsx)(A.Tbody,{children:e.columnTypes.map(e=>(0,$.jsxs)(A.Tr,{children:[(0,$.jsx)(A.Td,{style:mt,children:(0,$.jsx)(w,{children:e.type})}),(0,$.jsx)(A.Td,{style:mt,children:(0,$.jsx)(w,{children:X(e.type)})}),a.map(n=>(0,$.jsx)(A.Td,{children:(0,$.jsx)(l,{size:`xs`,ff:`monospace`,fw:n.key===t?600:400,children:e.byDialect[n.key]??`—`})},n.key))]},e.type))})]})}),(0,$.jsxs)(O,{gap:4,children:[(0,$.jsx)(l,{size:`sm`,fw:600,children:`Entités qu'une relation peut viser`}),n.length>0?(0,$.jsx)(G,{size:`sm`,spacing:2,children:n.map(e=>(0,$.jsx)(G.Item,{children:(0,$.jsx)(w,{children:`champ:ref:${e}`})},e))}):(0,$.jsx)(l,{size:`sm`,c:`dimmed`,children:`Aucune entité dans cette cible : une relation vers une entité absente est refusée. Crée d'abord la cible, puis la relation.`})]})]})})}function gt({jobId:e,onEvent:t}){return R(`${P.scaffoldJob}@${e}`,e=>{let n=Te(e);n&&t(n)}),null}function _t(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}function vt({job:e,lines:t,onCancel:n,cancelling:r}){let i=(0,q.useRef)(null),[a,s]=(0,q.useState)(!0),[c,d]=(0,q.useState)(!1),f=e.status===`running`;return(0,q.useEffect)(()=>{if(!a)return;let e=i.current;e&&(e.scrollTop=e.scrollHeight)},[t,a]),(0,$.jsxs)(O,{gap:`sm`,children:[(0,$.jsxs)(o,{justify:`space-between`,wrap:`wrap`,children:[(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(l,{fw:600,children:`Terminal`}),f&&(0,$.jsx)(v,{size:`xs`}),(0,$.jsx)(N,{color:e.status===`done`?`teal`:e.status===`failed`?`red`:`blue`,variant:`light`,children:e.status===`done`?`terminé`:e.status===`failed`?`échec`:`en cours`}),(0,$.jsx)(w,{children:e.type}),(0,$.jsx)(_,{title:`Ce que vous voyez`,summary:`La sortie RÉELLE du serveur, ligne à ligne : ce que le moteur écrit, puis la sortie de npm. Rien n'est résumé ni deviné.`,sections:[{label:`Couleurs`,body:`gris = information · normal = sortie standard · orange = sortie d'erreur (npm y écrit aussi ses avertissements) · vert = succès · rouge = échec.`},{label:`Si la page est rechargée`,body:`Le job continue côté serveur. En revenant sur son lien, le terminal se reconstitue depuis le début (le serveur garde les 4000 dernières lignes ; 500 au plus sont rendues ici).`}]})]}),(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(D,{label:c?`Copié`:`Copier tout le terminal`,children:(0,$.jsx)(g,{variant:`default`,"aria-label":`Copier le contenu du terminal`,onClick:()=>{let e=t.map(e=>e.text).join(`
|
|
2
|
+
`);navigator.clipboard?.writeText(e).then(()=>{d(!0),window.setTimeout(()=>d(!1),1500)},()=>d(!1))},children:c?(0,$.jsx)(x,{size:16}):(0,$.jsx)(ee,{size:16})})}),f&&(0,$.jsx)(b,{color:`red`,variant:`light`,size:`compact-sm`,loading:r,leftSection:(0,$.jsx)(xe,{size:14}),"aria-label":`Arrêter la génération en cours`,onClick:n,children:`Arrêter`})]})]}),(0,$.jsx)(E,{ref:i,onScroll:()=>{let e=i.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<24;s(t)},role:`log`,"aria-live":`polite`,"aria-label":`Sortie de la génération`,"aria-busy":f,style:{background:`#0b0d10`,border:`1px solid var(--mantine-color-dark-4)`,borderRadius:`var(--mantine-radius-sm)`,padding:`var(--mantine-spacing-sm)`,height:360,overflowY:`auto`,fontFamily:`var(--mantine-font-family-monospace)`,fontSize:12,lineHeight:1.5,fontVariantNumeric:`tabular-nums`,contain:`content`},children:t.length===0?(0,$.jsx)(`span`,{style:{color:Ke.info},children:`En attente des premières lignes…`}):t.map(e=>(0,$.jsxs)(`div`,{style:{color:Ke[e.stream],whiteSpace:`pre-wrap`},children:[(0,$.jsxs)(`span`,{style:{color:`var(--mantine-color-dark-2)`},children:[_t(e.ts),` `]}),e.text]},e.seq))}),t.length>=500&&(0,$.jsxs)(l,{size:`xs`,c:`dimmed`,children:[`Fenêtre limitée aux `,500,` dernières lignes (les plus anciennes restent côté serveur).`]}),!a&&f&&(0,$.jsx)(b,{size:`compact-xs`,variant:`subtle`,onClick:()=>s(!0),children:`Reprendre le suivi automatique`}),e.status===`failed`&&(0,$.jsx)(u,{color:`red`,variant:`light`,icon:(0,$.jsx)(C,{size:16}),title:`La génération a échoué`,children:(0,$.jsx)(l,{size:`sm`,children:`Les fichiers déjà écrits (ci-dessous, s'il y en a) ne sont PAS retirés — le moteur ne revient pas en arrière. Lire la dernière ligne rouge : elle porte la cause.`})}),e.files.length>0&&(0,$.jsxs)(k,{withBorder:!0,p:`sm`,children:[(0,$.jsxs)(l,{fw:600,size:`sm`,mb:`xs`,children:[e.files.length,` fichier(s) écrit(s)`]}),(0,$.jsx)(O,{gap:2,children:e.files.map(e=>(0,$.jsx)(w,{style:{fontSize:11},children:e},e))})]}),e.notes.length>0&&(0,$.jsx)(u,{color:`blue`,variant:`light`,title:`À savoir`,children:(0,$.jsx)(O,{gap:4,children:e.notes.map(e=>(0,$.jsx)(l,{size:`sm`,children:e},e))})})]})}var yt=`/nodefony/studio/api/create/spec`,bt=`/nodefony/studio/api/create/job`,xt={app:B,module:V,controller:I,front:ye,entity:z};function St({spec:e,selected:t,onSelect:n}){let r=xt[e.type]??L;return(0,$.jsx)(ie.Col,{span:{base:12,sm:6,lg:3},children:(0,$.jsxs)(ue,{withBorder:!0,padding:`md`,component:`button`,type:`button`,"aria-pressed":t,onClick:()=>n(e.type),style:{cursor:`pointer`,height:`100%`,textAlign:`left`,width:`100%`,borderColor:t?`var(--mantine-color-brand-5)`:`var(--mantine-color-default-border)`,background:t?`var(--mantine-color-brand-light)`:void 0},children:[(0,$.jsxs)(o,{gap:`xs`,mb:`xs`,children:[(0,$.jsx)(d,{variant:t?`filled`:`light`,color:`brand`,size:`md`,children:(0,$.jsx)(r,{size:16})}),(0,$.jsx)(l,{fw:600,children:e.type})]}),(0,$.jsx)(l,{size:`sm`,c:`dimmed`,children:e.description})]})})}function Ct(){let e=ge(),t=_e(),[n,a]=pe(),s=(0,q.useCallback)(async()=>{try{return await e.api.getAbsolute(yt)}catch(e){if(e instanceof he&&e.status===403){let t=e.body;return{enabled:!1,reason:t&&typeof t.reason==`string`?t.reason:`La création de code est réservée au développement.`}}throw e}},[e]),{data:c,loading:d,error:f,reload:p}=de(s),m=c?.enabled===!0?c:null,[g,v]=(0,q.useState)(null),[y,x]=(0,q.useState)({}),[T,ee]=(0,q.useState)([]),[te,E]=(0,q.useState)({}),[re,D]=(0,q.useState)(!1),[oe,se]=(0,q.useState)(!1),[A,j]=(0,q.useState)(!1),[M,ue]=(0,q.useState)(null),[P,F]=(0,q.useState)(``),[I,L]=(0,q.useState)(null),[fe,R]=(0,q.useState)([]),z=(0,q.useRef)(0),B=m?.specs.find(e=>e.type===g)??null,V=n.get(`job`),H=ke(B?.type??null),ve=m?.roots??[],U=m?.caps??{hasCheckout:!1},W=B?.type===`entity`?Ee(U,m?.context,y.connector):U,G=Ne(ve.find(e=>e.id===M)??null,P,typeof y.name==`string`?y.name:``),K=Ve(B?.type??null,W,y,T),ye=e=>{let t=m?.specs.find(t=>t.type===e);t&&(v(e),x(Ie(t,U)),ee(We(e,m?.steps??[])),E({}),ue(Pe(m?.roots??[])),F(``))},be=(e,t)=>{x(n=>({...n,[e]:t})),E(t=>{if(!t[e])return t;let n={...t};return delete n[e],n})},xe=(e,t)=>{ee(n=>t?[...n,e]:n.filter(t=>t!==e))},Se=(0,q.useCallback)(e=>{if(e?.kind===`state`){let{lines:t,...n}=e.state;L(n);return}let t=e?.kind===`line`?e.line:null;t&&typeof t.seq==`number`&&(t.seq<=z.current||(z.current=t.seq,R(e=>Ge(e,t))))},[]);(0,q.useEffect)(()=>{if(!V||I?.id===V)return;let t=!0;return e.api.getAbsolute(`${bt}/${V}`).then(e=>{if(!t)return;let{lines:n,...r}=e,i=n.slice(-500);z.current=i.length?i[i.length-1]?.seq??0:0,R(i),L(r)}).catch(()=>{t&&a({},{replace:!0})}),()=>{t=!1}},[V,I?.id,e,a]);let Ce=()=>{if(!B)return;let e=Be(B,y,W);E(e),Object.keys(e).length>0||(H&&G.issue!==null?t.notify(`warning`,G.issue,{title:`Destination incomplète`,source:`api`}):D(!0))},we=async()=>{if(B){se(!0);try{let t=H?{...y,root:M??``,subPath:P}:y,{lines:n,...r}=await e.realtime.request(h.scaffoldRun,{type:B.type,answers:t,steps:T}),i=n.slice(-500);z.current=i.length?i[i.length-1]?.seq??0:0,R(i),L(r),D(!1),a({job:r.id})}catch(e){t.notify(`error`,Je(e),{title:`Génération refusée`,source:`server`})}finally{se(!1)}}},Te=async()=>{if(I){j(!0);try{await e.realtime.request(h.scaffoldCancel,{id:I.id})}catch(e){t.notify(`error`,Je(e),{title:`Arrêt impossible`,source:`server`})}finally{j(!1)}}},J=()=>{L(null),R([]),z.current=0,a({},{replace:!0})},X=I?.status===`running`;return(0,$.jsxs)(ne,{title:`Créer`,icon:(0,$.jsx)(i,{size:22}),subtitle:`Génère du code DANS ce projet — le serveur écrit réellement sur le disque.`,actions:I&&!X?(0,$.jsx)(b,{variant:`light`,leftSection:(0,$.jsx)(me,{size:16}),onClick:J,children:`Nouvelle génération`}):void 0,children:[(0,$.jsx)(ce,{loading:d,error:f,onRetry:p,children:c?.enabled===!1?(0,$.jsx)(u,{color:`orange`,variant:`light`,icon:(0,$.jsx)(C,{size:16}),title:`Création indisponible`,children:(0,$.jsx)(l,{size:`sm`,children:c.reason})}):m===null?null:(0,$.jsxs)(O,{gap:`lg`,children:[(0,$.jsx)(u,{color:`orange`,variant:`light`,icon:(0,$.jsx)(C,{size:16}),title:H?`Réservé au développement — une application va être créée sur le disque`:`Réservé au développement — l'écriture est réelle`,children:(0,$.jsxs)(O,{gap:6,children:[H?(0,$.jsxs)(l,{size:`sm`,children:[`Une application naît `,(0,$.jsx)(`b`,{children:`AILLEURS`}),` : dans l'espace de travail choisi ci-dessous, pas dans ce projet — qui n'est ni modifié ni recâblé. Le serveur y écrit réellement un nouveau dossier (et y lance `,(0,$.jsx)(w,{children:`npm install`}),` si l'étape est cochée). Le moteur n'a `,(0,$.jsx)(`b`,{children:`aucun mode simulation`}),` : rien à prévisualiser, rien d'annulé en cas d'échec — d'où la confirmation demandée avant de lancer.`]}):(0,$.jsxs)(l,{size:`sm`,children:[`Cette page ÉCRIT des fichiers dans le projet et modifie son`,` `,(0,$.jsx)(w,{children:`index.ts`}),` et son `,(0,$.jsx)(w,{children:`package.json`}),` `,`(câblage du module, des controllers, des entités). Le moteur n'a `,(0,$.jsx)(`b`,{children:`aucun mode simulation`}),` : il n'y a rien à prévisualiser, et rien n'est annulé en cas d'échec — d'où la confirmation demandée avant de lancer.`]}),(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(l,{size:`sm`,c:`dimmed`,children:`Projet :`}),(0,$.jsx)(w,{children:m.projectRoot}),(0,$.jsx)(S,{title:`Ce qui n'est pas fait pour vous`,summary:H?`L'application est écrite et prête, mais elle vit sa propre vie : ce serveur ne la charge pas.`:`Le code est écrit et câblé, mais le serveur qui tourne ne le connaît pas encore.`,sections:H?[{label:`Après la génération`,body:`L'app est autonome (son propre package.json, son propre serveur). Elle se lance depuis son dossier — le terminal ci-dessous vous donne la commande exacte.`},{label:`Ce projet`,body:`Il n'est pas touché : ni index.ts, ni package.json, ni redémarrage à prévoir.`}]:[{label:`Après la génération`,body:`Un module n'est chargeable qu'une fois installé (lien de workspace npm) ET le serveur redémarré — le kernel lit les modules au boot.`},{label:`Entités`,body:`La table naît au prochain démarrage en développement (CREATE TABLE IF NOT EXISTS). Modifier une entité existante n'altère AUCUNE table : le moteur ne produit pas de migration.`}]})]})]})}),(0,$.jsxs)(O,{gap:`xs`,children:[(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(N,{variant:`light`,color:`brand`,children:`1`}),(0,$.jsx)(l,{fw:600,children:`Que voulez-vous créer ?`})]}),(0,$.jsx)(ie,{children:m.specs.map(e=>(0,$.jsx)(St,{spec:e,selected:e.type===g,onSelect:ye},e.type))})]}),B&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(O,{gap:`xs`,children:[(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(N,{variant:`light`,color:`brand`,children:`2`}),(0,$.jsx)(l,{fw:600,children:`Réglages`}),(0,$.jsx)(_,{title:`Formulaire généré, pas écrit`,summary:`Ces champs viennent des questions du moteur de scaffold — les mêmes que celles posées par le CLI. Une question ajoutée au moteur apparaît ici sans qu'une ligne de front ne change.`,sections:[{label:`Validation`,body:`Les formes attendues (kebab-case, PascalCase, chemin absolu…) sont celles déclarées par le moteur. Le serveur revalide de toute façon : il reste l'autorité.`}]})]}),(0,$.jsx)(k,{withBorder:!0,p:`md`,children:(0,$.jsx)(dt,{spec:B,answers:y,errors:te,targets:m.targets,caps:W,onChange:be,entity:B.type===`entity`&&m.context?{types:m.context.columnTypes.map(e=>e.type),referenceable:Oe(m.context,m.targets,y.module,Y(m.context,y.connector))}:void 0})}),B.type===`entity`&&m.context&&(0,$.jsx)(ht,{context:m.context,engine:Y(m.context,y.connector),referenceable:Oe(m.context,m.targets,y.module,Y(m.context,y.connector))})]}),H&&(0,$.jsxs)(O,{gap:`xs`,children:[(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(N,{variant:`light`,color:`brand`,children:`3`}),(0,$.jsx)(l,{fw:600,children:`Emplacement d'installation`})]}),(0,$.jsx)(it,{roots:ve,rootId:M,subPath:P,name:typeof y.name==`string`?y.name:``,onRootChange:e=>{ue(e),F(``)},onSubPathChange:F})]}),(0,$.jsxs)(O,{gap:`xs`,children:[(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(N,{variant:`light`,color:`brand`,children:H?4:3}),(0,$.jsx)(l,{fw:600,children:`Après l'écriture`})]}),(0,$.jsx)(k,{withBorder:!0,p:`md`,children:(0,$.jsxs)(O,{gap:`sm`,children:[(0,$.jsx)(l,{size:`sm`,c:`dimmed`,children:H?(0,$.jsxs)($.Fragment,{children:[`Une application naît avec son propre`,` `,(0,$.jsx)(w,{children:`package.json`}),` : sans`,` `,(0,$.jsx)(w,{children:`npm install`}),`, elle n'est pas lançable. Les étapes tournent DANS le dossier de la nouvelle app — jamais dans ce projet.`]}):(0,$.jsxs)($.Fragment,{children:[`Sans `,(0,$.jsx)(w,{children:`npm install`}),`, un module tout juste créé n'est pas résolvable par le kernel : il l'importe par son NOM, et c'est le lien de workspace posé par l'installation qui rend ce nom résolvable.`]})}),m.steps.map(e=>{let t=Ue(e);return(0,$.jsxs)(o,{gap:`xs`,children:[(0,$.jsx)(r,{label:t.label,checked:T.includes(e),onChange:t=>xe(e,t.currentTarget.checked)}),(0,$.jsx)(ae,{text:t.help})]},e)}),K&&(0,$.jsx)(u,{color:`orange`,variant:`light`,icon:(0,$.jsx)(C,{size:16}),title:`L'installation va probablement échouer`,children:(0,$.jsx)(l,{size:`sm`,children:K})})]})})]}),(0,$.jsxs)(o,{children:[(0,$.jsx)(b,{leftSection:(0,$.jsx)(i,{size:16}),disabled:X,onClick:Ce,children:`Générer`}),X&&(0,$.jsx)(l,{size:`sm`,c:`dimmed`,children:`Une génération est en cours — attendez la fin ou arrêtez-la.`})]})]}),I&&(0,$.jsxs)(k,{withBorder:!0,p:`md`,children:[(0,$.jsx)(gt,{jobId:I.id,onEvent:Se}),(0,$.jsx)(vt,{job:I,lines:fe,onCancel:()=>void Te(),cancelling:A})]})]})}),(0,$.jsx)(le,{opened:re,onClose:()=>D(!1),title:`Confirmer la génération`,centered:!0,children:B&&(0,$.jsxs)(O,{gap:`md`,children:[(0,$.jsx)(u,{color:`orange`,variant:`light`,icon:(0,$.jsx)(C,{size:16}),children:H?(0,$.jsxs)(l,{size:`sm`,children:[`Une application va être créée dans`,` `,(0,$.jsx)(w,{children:G.path??G.label}),`. Ce projet n'est pas modifié. Il n'y a pas de simulation, et pas de retour en arrière automatique.`]}):(0,$.jsxs)(l,{size:`sm`,children:[`Des fichiers vont être écrits dans`,` `,(0,$.jsx)(w,{children:m?.projectRoot}),` et le projet va être modifié. Il n'y a pas de simulation, et pas de retour en arrière automatique.`]})}),(0,$.jsxs)(O,{gap:4,children:[(0,$.jsx)(l,{size:`sm`,fw:600,children:B.type}),B.questions.filter(e=>Q(e,W,y)).map(e=>(0,$.jsxs)(o,{justify:`space-between`,gap:`xs`,wrap:`nowrap`,children:[(0,$.jsx)(l,{size:`sm`,c:`dimmed`,style:{flex:1},children:e.label}),(0,$.jsx)(w,{children:qe(e,y[e.key])})]},e.key)),H&&(0,$.jsxs)(o,{justify:`space-between`,gap:`xs`,wrap:`nowrap`,children:[(0,$.jsx)(l,{size:`sm`,c:`dimmed`,style:{flex:1},children:`Destination`}),(0,$.jsx)(w,{children:G.label})]})]}),(0,$.jsxs)(O,{gap:4,children:[(0,$.jsx)(l,{size:`sm`,fw:600,children:`Étapes enchaînées`}),(0,$.jsx)(l,{size:`sm`,c:`dimmed`,children:T.length===0?`Aucune — les fichiers seront seulement écrits.`:T.map(e=>Ue(e).label).join(` · `)}),K&&(0,$.jsx)(l,{size:`sm`,c:`orange`,children:K})]}),(0,$.jsxs)(o,{justify:`flex-end`,children:[(0,$.jsx)(b,{variant:`default`,onClick:()=>D(!1),children:`Annuler`}),(0,$.jsx)(b,{color:`orange`,loading:oe,leftSection:(0,$.jsx)(i,{size:16}),onClick:()=>void we(),children:`Écrire sur le disque`})]})]})})]})}export{Ct as Create};
|