@saluzi/saluzi-edu 0.1.113 → 0.1.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/cli.js +49 -49
  2. package/dist/rcs-web/assets/{Dashboard-DOyfeJKS.js → Dashboard-B0_C_eCh.js} +1 -1
  3. package/dist/rcs-web/assets/SessionDetail-BVcLmpSR.js +11 -0
  4. package/{packages/remote-control-server/web/dist/assets/arc-BDJ2Eev3.js → dist/rcs-web/assets/arc-BMfjmOZd.js} +1 -1
  5. package/{packages/remote-control-server/web/dist/assets/architectureDiagram-3BPJPVTR-CpQsmwLL.js → dist/rcs-web/assets/architectureDiagram-3BPJPVTR-BYxZ0hOY.js} +1 -1
  6. package/dist/rcs-web/assets/{blockDiagram-GPEHLZMM-D_GoSalG.js → blockDiagram-GPEHLZMM-CWh17r9L.js} +1 -1
  7. package/{packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-BY5ZKFLA.js → dist/rcs-web/assets/c4Diagram-AAUBKEIU-BNck9voD.js} +1 -1
  8. package/dist/rcs-web/assets/channel-Cu25yFW_.js +1 -0
  9. package/dist/rcs-web/assets/{chunk-2J33WTMH-BMaWxISL.js → chunk-2J33WTMH-DW95SYdK.js} +1 -1
  10. package/dist/rcs-web/assets/{chunk-4BX2VUAB-CQZc7ATX.js → chunk-4BX2VUAB-DVZ0-Xg3.js} +1 -1
  11. package/dist/rcs-web/assets/{chunk-55IACEB6-DMLZcgTS.js → chunk-55IACEB6-DHH0d-Du.js} +1 -1
  12. package/{packages/remote-control-server/web/dist/assets/chunk-727SXJPM-B0VacbyX.js → dist/rcs-web/assets/chunk-727SXJPM-yWDASXFo.js} +1 -1
  13. package/dist/rcs-web/assets/{chunk-AQP2D5EJ-BVLmy1or.js → chunk-AQP2D5EJ-oPQl9HsD.js} +1 -1
  14. package/dist/rcs-web/assets/{chunk-FMBD7UC4-Ci3V4sad.js → chunk-FMBD7UC4-XLFq3FF_.js} +1 -1
  15. package/dist/rcs-web/assets/{chunk-ND2GUHAM-C5sfUGYz.js → chunk-ND2GUHAM-BxAsbUdn.js} +1 -1
  16. package/dist/rcs-web/assets/{chunk-QZHKN3VN-D6Tbp2SA.js → chunk-QZHKN3VN-CGT1jVR4.js} +1 -1
  17. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-B9GK3JSb.js +1 -0
  18. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-B9GK3JSb.js +1 -0
  19. package/dist/rcs-web/assets/{code-block-IT6T5CEO-DSN-4YWc.js → code-block-IT6T5CEO-CVG0O_DE.js} +1 -1
  20. package/{packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-DNz-hspP.js → dist/rcs-web/assets/cose-bilkent-S5V4N54A-B-ByrvpW.js} +1 -1
  21. package/dist/rcs-web/assets/{dagre-BM42HDAG-CTUxhMhQ.js → dagre-BM42HDAG-vzptXZy4.js} +1 -1
  22. package/dist/rcs-web/assets/{diagram-2AECGRRQ-ChudKXBS.js → diagram-2AECGRRQ-DQfWzyaK.js} +1 -1
  23. package/dist/rcs-web/assets/{diagram-5GNKFQAL-B7lTlzoC.js → diagram-5GNKFQAL-DFAEoBaf.js} +1 -1
  24. package/dist/rcs-web/assets/{diagram-KO2AKTUF-D8VXYHRu.js → diagram-KO2AKTUF-D5FS9d4Q.js} +1 -1
  25. package/dist/rcs-web/assets/{diagram-LMA3HP47-DZHyt2ga.js → diagram-LMA3HP47-uaT2tKfY.js} +1 -1
  26. package/dist/rcs-web/assets/{diagram-OG6HWLK6-BTSZqWF_.js → diagram-OG6HWLK6-DLAyIQZ5.js} +1 -1
  27. package/{packages/remote-control-server/web/dist/assets/erDiagram-TEJ5UH35-Cy3yaLQ-.js → dist/rcs-web/assets/erDiagram-TEJ5UH35-CZZKDW1C.js} +1 -1
  28. package/{packages/remote-control-server/web/dist/assets/flowDiagram-I6XJVG4X-_o1hAff3.js → dist/rcs-web/assets/flowDiagram-I6XJVG4X-BabIQdSf.js} +1 -1
  29. package/{packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-B9UcrGAG.js → dist/rcs-web/assets/ganttDiagram-6RSMTGT7-CUkoijgX.js} +1 -1
  30. package/dist/rcs-web/assets/{gitGraphDiagram-PVQCEYII-CNsV-e9t.js → gitGraphDiagram-PVQCEYII-C5WGSFfE.js} +1 -1
  31. package/dist/rcs-web/assets/{infoDiagram-5YYISTIA-BrKsfjc1.js → infoDiagram-5YYISTIA-CPnpA24t.js} +1 -1
  32. package/dist/rcs-web/assets/{ishikawaDiagram-YF4QCWOH-cXyU9qYI.js → ishikawaDiagram-YF4QCWOH-hF5b3pir.js} +1 -1
  33. package/dist/rcs-web/assets/{journeyDiagram-JHISSGLW-BlDKeIBg.js → journeyDiagram-JHISSGLW-CzZZcSGc.js} +1 -1
  34. package/dist/rcs-web/assets/{kanban-definition-UN3LZRKU-B0kpAPIz.js → kanban-definition-UN3LZRKU-CdVWapOk.js} +1 -1
  35. package/dist/rcs-web/assets/{linear-Ctux1SeF.js → linear-C_5hpdA2.js} +1 -1
  36. package/dist/rcs-web/assets/main-ByE_8xaY.js +226 -0
  37. package/dist/rcs-web/assets/main-Y8_R7WtO.css +1 -0
  38. package/dist/rcs-web/assets/{mermaid-VLURNSYL-CHTncs0X.js → mermaid-VLURNSYL-CutVUlEB.js} +4 -4
  39. package/dist/rcs-web/assets/{mermaid.core-gzqLmJwE.js → mermaid.core-BJO0lY1A.js} +5 -5
  40. package/dist/rcs-web/assets/{mindmap-definition-RKZ34NQL-DCyvuBpq.js → mindmap-definition-RKZ34NQL-DNjEMua0.js} +1 -1
  41. package/dist/rcs-web/assets/{pieDiagram-4H26LBE5-jz_ctekD.js → pieDiagram-4H26LBE5-Dp9Q4Xri.js} +1 -1
  42. package/{packages/remote-control-server/web/dist/assets/quadrantDiagram-W4KKPZXB-DGq2-6C5.js → dist/rcs-web/assets/quadrantDiagram-W4KKPZXB-COt02xAt.js} +1 -1
  43. package/dist/rcs-web/assets/{requirementDiagram-4Y6WPE33-CXWwWMHa.js → requirementDiagram-4Y6WPE33-BDAmdZ0f.js} +1 -1
  44. package/{packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-DoebOOVu.js → dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-DMyfxPBl.js} +1 -1
  45. package/{packages/remote-control-server/web/dist/assets/sequenceDiagram-3UESZ5HK-X9kFOqRY.js → dist/rcs-web/assets/sequenceDiagram-3UESZ5HK-CM30vxmh.js} +1 -1
  46. package/dist/rcs-web/assets/{stateDiagram-AJRCARHV-BFLeyn9g.js → stateDiagram-AJRCARHV-Hrdkc1Sj.js} +1 -1
  47. package/dist/rcs-web/assets/{stateDiagram-v2-BHNVJYJU-Bucy3yoA.js → stateDiagram-v2-BHNVJYJU-Nl7q42lO.js} +1 -1
  48. package/{packages/remote-control-server/web/dist/assets/timeline-definition-PNZ67QCA-Da8CRo-I.js → dist/rcs-web/assets/timeline-definition-PNZ67QCA-DGTtlCQ0.js} +1 -1
  49. package/dist/rcs-web/assets/{vennDiagram-CIIHVFJN-B4TQ9SGR.js → vennDiagram-CIIHVFJN-BYGg02eY.js} +1 -1
  50. package/{packages/remote-control-server/web/dist/assets/wardleyDiagram-YWT4CUSO-Cls4p8ZD.js → dist/rcs-web/assets/wardleyDiagram-YWT4CUSO-DDcsl7td.js} +1 -1
  51. package/{packages/remote-control-server/web/dist/assets/xychartDiagram-2RQKCTM6-BRKD9sqn.js → dist/rcs-web/assets/xychartDiagram-2RQKCTM6-BCPQ4a44.js} +1 -1
  52. package/dist/rcs-web/index.html +2 -2
  53. package/package.json +1 -1
  54. package/packages/remote-control-server/src/__tests__/client-payload.test.ts +25 -0
  55. package/packages/remote-control-server/src/__tests__/work-dispatch.test.ts +8 -3
  56. package/packages/remote-control-server/src/registerRoutes.ts +16 -1
  57. package/packages/remote-control-server/src/routes/web/control.ts +2 -0
  58. package/packages/remote-control-server/src/services/work-dispatch.ts +36 -5
  59. package/packages/remote-control-server/src/store.ts +4 -0
  60. package/packages/remote-control-server/src/transport/client-payload.ts +13 -1
  61. package/packages/remote-control-server/web/dist/assets/{Dashboard-DOyfeJKS.js → Dashboard-B0_C_eCh.js} +1 -1
  62. package/packages/remote-control-server/web/dist/assets/SessionDetail-BVcLmpSR.js +11 -0
  63. package/{dist/rcs-web/assets/arc-BDJ2Eev3.js → packages/remote-control-server/web/dist/assets/arc-BMfjmOZd.js} +1 -1
  64. package/{dist/rcs-web/assets/architectureDiagram-3BPJPVTR-CpQsmwLL.js → packages/remote-control-server/web/dist/assets/architectureDiagram-3BPJPVTR-BYxZ0hOY.js} +1 -1
  65. package/packages/remote-control-server/web/dist/assets/{blockDiagram-GPEHLZMM-D_GoSalG.js → blockDiagram-GPEHLZMM-CWh17r9L.js} +1 -1
  66. package/{dist/rcs-web/assets/c4Diagram-AAUBKEIU-BY5ZKFLA.js → packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-BNck9voD.js} +1 -1
  67. package/packages/remote-control-server/web/dist/assets/channel-Cu25yFW_.js +1 -0
  68. package/packages/remote-control-server/web/dist/assets/{chunk-2J33WTMH-BMaWxISL.js → chunk-2J33WTMH-DW95SYdK.js} +1 -1
  69. package/packages/remote-control-server/web/dist/assets/{chunk-4BX2VUAB-CQZc7ATX.js → chunk-4BX2VUAB-DVZ0-Xg3.js} +1 -1
  70. package/packages/remote-control-server/web/dist/assets/{chunk-55IACEB6-DMLZcgTS.js → chunk-55IACEB6-DHH0d-Du.js} +1 -1
  71. package/{dist/rcs-web/assets/chunk-727SXJPM-B0VacbyX.js → packages/remote-control-server/web/dist/assets/chunk-727SXJPM-yWDASXFo.js} +1 -1
  72. package/packages/remote-control-server/web/dist/assets/{chunk-AQP2D5EJ-BVLmy1or.js → chunk-AQP2D5EJ-oPQl9HsD.js} +1 -1
  73. package/packages/remote-control-server/web/dist/assets/{chunk-FMBD7UC4-Ci3V4sad.js → chunk-FMBD7UC4-XLFq3FF_.js} +1 -1
  74. package/packages/remote-control-server/web/dist/assets/{chunk-ND2GUHAM-C5sfUGYz.js → chunk-ND2GUHAM-BxAsbUdn.js} +1 -1
  75. package/packages/remote-control-server/web/dist/assets/{chunk-QZHKN3VN-D6Tbp2SA.js → chunk-QZHKN3VN-CGT1jVR4.js} +1 -1
  76. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-B9GK3JSb.js +1 -0
  77. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-B9GK3JSb.js +1 -0
  78. package/packages/remote-control-server/web/dist/assets/{code-block-IT6T5CEO-DSN-4YWc.js → code-block-IT6T5CEO-CVG0O_DE.js} +1 -1
  79. package/{dist/rcs-web/assets/cose-bilkent-S5V4N54A-DNz-hspP.js → packages/remote-control-server/web/dist/assets/cose-bilkent-S5V4N54A-B-ByrvpW.js} +1 -1
  80. package/packages/remote-control-server/web/dist/assets/{dagre-BM42HDAG-CTUxhMhQ.js → dagre-BM42HDAG-vzptXZy4.js} +1 -1
  81. package/packages/remote-control-server/web/dist/assets/{diagram-2AECGRRQ-ChudKXBS.js → diagram-2AECGRRQ-DQfWzyaK.js} +1 -1
  82. package/packages/remote-control-server/web/dist/assets/{diagram-5GNKFQAL-B7lTlzoC.js → diagram-5GNKFQAL-DFAEoBaf.js} +1 -1
  83. package/packages/remote-control-server/web/dist/assets/{diagram-KO2AKTUF-D8VXYHRu.js → diagram-KO2AKTUF-D5FS9d4Q.js} +1 -1
  84. package/packages/remote-control-server/web/dist/assets/{diagram-LMA3HP47-DZHyt2ga.js → diagram-LMA3HP47-uaT2tKfY.js} +1 -1
  85. package/packages/remote-control-server/web/dist/assets/{diagram-OG6HWLK6-BTSZqWF_.js → diagram-OG6HWLK6-DLAyIQZ5.js} +1 -1
  86. package/{dist/rcs-web/assets/erDiagram-TEJ5UH35-Cy3yaLQ-.js → packages/remote-control-server/web/dist/assets/erDiagram-TEJ5UH35-CZZKDW1C.js} +1 -1
  87. package/{dist/rcs-web/assets/flowDiagram-I6XJVG4X-_o1hAff3.js → packages/remote-control-server/web/dist/assets/flowDiagram-I6XJVG4X-BabIQdSf.js} +1 -1
  88. package/{dist/rcs-web/assets/ganttDiagram-6RSMTGT7-B9UcrGAG.js → packages/remote-control-server/web/dist/assets/ganttDiagram-6RSMTGT7-CUkoijgX.js} +1 -1
  89. package/packages/remote-control-server/web/dist/assets/{gitGraphDiagram-PVQCEYII-CNsV-e9t.js → gitGraphDiagram-PVQCEYII-C5WGSFfE.js} +1 -1
  90. package/packages/remote-control-server/web/dist/assets/{infoDiagram-5YYISTIA-BrKsfjc1.js → infoDiagram-5YYISTIA-CPnpA24t.js} +1 -1
  91. package/packages/remote-control-server/web/dist/assets/{ishikawaDiagram-YF4QCWOH-cXyU9qYI.js → ishikawaDiagram-YF4QCWOH-hF5b3pir.js} +1 -1
  92. package/packages/remote-control-server/web/dist/assets/{journeyDiagram-JHISSGLW-BlDKeIBg.js → journeyDiagram-JHISSGLW-CzZZcSGc.js} +1 -1
  93. package/packages/remote-control-server/web/dist/assets/{kanban-definition-UN3LZRKU-B0kpAPIz.js → kanban-definition-UN3LZRKU-CdVWapOk.js} +1 -1
  94. package/packages/remote-control-server/web/dist/assets/{linear-Ctux1SeF.js → linear-C_5hpdA2.js} +1 -1
  95. package/packages/remote-control-server/web/dist/assets/main-ByE_8xaY.js +226 -0
  96. package/packages/remote-control-server/web/dist/assets/main-Y8_R7WtO.css +1 -0
  97. package/packages/remote-control-server/web/dist/assets/{mermaid-VLURNSYL-CHTncs0X.js → mermaid-VLURNSYL-CutVUlEB.js} +4 -4
  98. package/packages/remote-control-server/web/dist/assets/{mermaid.core-gzqLmJwE.js → mermaid.core-BJO0lY1A.js} +5 -5
  99. package/packages/remote-control-server/web/dist/assets/{mindmap-definition-RKZ34NQL-DCyvuBpq.js → mindmap-definition-RKZ34NQL-DNjEMua0.js} +1 -1
  100. package/packages/remote-control-server/web/dist/assets/{pieDiagram-4H26LBE5-jz_ctekD.js → pieDiagram-4H26LBE5-Dp9Q4Xri.js} +1 -1
  101. package/{dist/rcs-web/assets/quadrantDiagram-W4KKPZXB-DGq2-6C5.js → packages/remote-control-server/web/dist/assets/quadrantDiagram-W4KKPZXB-COt02xAt.js} +1 -1
  102. package/packages/remote-control-server/web/dist/assets/{requirementDiagram-4Y6WPE33-CXWwWMHa.js → requirementDiagram-4Y6WPE33-BDAmdZ0f.js} +1 -1
  103. package/{dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-DoebOOVu.js → packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-DMyfxPBl.js} +1 -1
  104. package/{dist/rcs-web/assets/sequenceDiagram-3UESZ5HK-X9kFOqRY.js → packages/remote-control-server/web/dist/assets/sequenceDiagram-3UESZ5HK-CM30vxmh.js} +1 -1
  105. package/packages/remote-control-server/web/dist/assets/{stateDiagram-AJRCARHV-BFLeyn9g.js → stateDiagram-AJRCARHV-Hrdkc1Sj.js} +1 -1
  106. package/packages/remote-control-server/web/dist/assets/{stateDiagram-v2-BHNVJYJU-Bucy3yoA.js → stateDiagram-v2-BHNVJYJU-Nl7q42lO.js} +1 -1
  107. package/{dist/rcs-web/assets/timeline-definition-PNZ67QCA-Da8CRo-I.js → packages/remote-control-server/web/dist/assets/timeline-definition-PNZ67QCA-DGTtlCQ0.js} +1 -1
  108. package/packages/remote-control-server/web/dist/assets/{vennDiagram-CIIHVFJN-B4TQ9SGR.js → vennDiagram-CIIHVFJN-BYGg02eY.js} +1 -1
  109. package/{dist/rcs-web/assets/wardleyDiagram-YWT4CUSO-Cls4p8ZD.js → packages/remote-control-server/web/dist/assets/wardleyDiagram-YWT4CUSO-DDcsl7td.js} +1 -1
  110. package/{dist/rcs-web/assets/xychartDiagram-2RQKCTM6-BRKD9sqn.js → packages/remote-control-server/web/dist/assets/xychartDiagram-2RQKCTM6-BCPQ4a44.js} +1 -1
  111. package/packages/remote-control-server/web/dist/index.html +2 -2
  112. package/dist/rcs-web/assets/SessionDetail-DM8oEegB.js +0 -11
  113. package/dist/rcs-web/assets/channel-B8OKhjS1.js +0 -1
  114. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-2ZJVPzzv.js +0 -1
  115. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-2ZJVPzzv.js +0 -1
  116. package/dist/rcs-web/assets/main-BoVtqLej.js +0 -226
  117. package/dist/rcs-web/assets/main-szEOBPOd.css +0 -1
  118. package/packages/remote-control-server/web/dist/assets/SessionDetail-DM8oEegB.js +0 -11
  119. package/packages/remote-control-server/web/dist/assets/channel-B8OKhjS1.js +0 -1
  120. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-2ZJVPzzv.js +0 -1
  121. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-2ZJVPzzv.js +0 -1
  122. package/packages/remote-control-server/web/dist/assets/main-BoVtqLej.js +0 -226
  123. package/packages/remote-control-server/web/dist/assets/main-szEOBPOd.css +0 -1
@@ -1 +1 @@
1
- import{j as e,e as l}from"./vendor-DE_-CLIE.js";import{S as p,v as j,D as g,d as y,f as N,g as v,e as C,j as w,k as S,l as k}from"./main-BoVtqLej.js";import"./shiki-mEP5vQQu.js";import"./qr-C0jP9HcD.js";import"./motion-BILbV7YQ.js";function D({environments:r,onSelectEnvironment:i}){return!r||r.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-8 text-center text-text-muted",children:"No active environments"}):e.jsx("div",{className:"space-y-2",children:r.map(a=>{const t=a.worker_type==="acp",d=t?"ACP Agent":"Saluzi",c=t?"bg-brand/15 text-brand":"bg-status-running/15 text-status-running";return e.jsxs("button",{type:"button",onClick:()=>i==null?void 0:i(a),disabled:t,className:`flex w-full items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 text-left transition-colors ${t?"cursor-default opacity-80":"hover:border-border-light cursor-pointer"}`,children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-text-primary",children:a.machine_name||a.id}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${c}`,children:d})]}),e.jsx("div",{className:"text-sm text-text-muted",children:a.directory||""})]})}),e.jsxs("div",{className:"text-right",children:[e.jsx(p,{status:a.status}),e.jsx("div",{className:"mt-1 text-xs text-text-muted",children:a.branch||""})]})]},a.id)})})}function E({sessions:r,onSelect:i}){if(!r||r.length===0)return e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-8 text-center text-text-muted",children:"No sessions"});const a=[...r].sort((t,d)=>(d.updated_at||0)-(t.updated_at||0));return e.jsx("div",{className:"space-y-2",children:a.map(t=>e.jsxs("button",{type:"button",onClick:()=>i(t.id),className:"flex w-full items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 text-left transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-medium text-text-primary",children:t.title||t.id}),t.source==="acp"&&e.jsx("span",{className:"rounded-full bg-brand/15 px-2 py-0.5 text-xs font-medium text-brand",children:"ACP"})]}),e.jsx("div",{className:"truncate text-xs text-text-muted",children:t.id})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(p,{status:t.status}),e.jsx("span",{className:"text-xs text-text-muted",children:j(t.created_at||t.updated_at)})]})]},t.id))})}function _({open:r,environments:i,onClose:a,onCreated:t}){const[d,c]=l.useState(""),[o,x]=l.useState(""),[u,m]=l.useState(""),[b,n]=l.useState(!1);l.useEffect(()=>{r&&(c(""),x(""),m(""))},[r]);const h=async()=>{n(!0),m("");try{const s={};d.trim()&&(s.title=d.trim()),o&&(s.environment_id=o);const f=await w(s);t(f)}catch(s){m(s instanceof Error?s.message:"Failed to create session")}finally{n(!1)}};return e.jsx(g,{open:r,onOpenChange:s=>{s||a()},children:e.jsxs(y,{className:"max-w-md rounded-2xl border-border bg-surface-1 p-6 shadow-2xl",children:[e.jsx(N,{children:e.jsx(v,{className:"font-display text-lg font-semibold text-text-primary",children:"New Session"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:"Title (optional)"}),e.jsx("input",{type:"text",value:d,onChange:s=>c(s.target.value),placeholder:"My session",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:"Environment"}),e.jsxs("select",{value:o,onChange:s=>x(s.target.value),className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-brand focus:outline-none",children:[e.jsx("option",{value:"",children:"-- None --"}),i.map(s=>e.jsxs("option",{value:s.id,children:[s.machine_name||s.id," (",s.branch||"no branch",")"]},s.id))]})]}),u&&e.jsx("div",{className:"text-sm text-status-error",children:u})]}),e.jsxs(C,{children:[e.jsx("button",{onClick:a,className:"rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:h,disabled:b,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light disabled:opacity-50 transition-colors",children:b?"Creating...":"Create"})]})]})})}function O({onNavigateSession:r}){const[i,a]=l.useState([]),[t,d]=l.useState([]),[c,o]=l.useState(!1),x=l.useCallback(async()=>{try{const[n,h]=await Promise.all([S(),k()]);a(n||[]),d(h||[])}catch(n){console.error("Dashboard render error:",n)}},[]);l.useEffect(()=>{x();const n=setInterval(x,1e4);return()=>clearInterval(n)},[x]);const u=n=>{o(!1),r(n.id)},m=l.useCallback(n=>{},[]),b=l.useCallback(n=>{r(n)},[r]);return e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-8",children:[e.jsx("h1",{className:"sr-only",children:"Dashboard"}),e.jsxs("section",{className:"mb-10",children:[e.jsx("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:"Environments"}),e.jsx(D,{environments:t,onSelectEnvironment:m})]}),e.jsxs("section",{children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:"Sessions"}),e.jsx("button",{onClick:()=>o(!0),className:"rounded-lg bg-brand px-3 py-1.5 text-sm font-medium text-white hover:bg-brand-light transition-colors",children:"+ New Session"})]}),e.jsx(E,{sessions:i,onSelect:b})]}),e.jsx(_,{open:c,environments:t,onClose:()=>o(!1),onCreated:u})]})}export{O as Dashboard};
1
+ import{j as e,e as l}from"./vendor-DE_-CLIE.js";import{S as p,w as j,D as g,d as y,f as N,g as v,e as C,j as w,k as S,l as k}from"./main-ByE_8xaY.js";import"./shiki-mEP5vQQu.js";import"./qr-C0jP9HcD.js";import"./motion-BILbV7YQ.js";function D({environments:r,onSelectEnvironment:i}){return!r||r.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-8 text-center text-text-muted",children:"No active environments"}):e.jsx("div",{className:"space-y-2",children:r.map(a=>{const t=a.worker_type==="acp",d=t?"ACP Agent":"Saluzi",c=t?"bg-brand/15 text-brand":"bg-status-running/15 text-status-running";return e.jsxs("button",{type:"button",onClick:()=>i==null?void 0:i(a),disabled:t,className:`flex w-full items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 text-left transition-colors ${t?"cursor-default opacity-80":"hover:border-border-light cursor-pointer"}`,children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-text-primary",children:a.machine_name||a.id}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${c}`,children:d})]}),e.jsx("div",{className:"text-sm text-text-muted",children:a.directory||""})]})}),e.jsxs("div",{className:"text-right",children:[e.jsx(p,{status:a.status}),e.jsx("div",{className:"mt-1 text-xs text-text-muted",children:a.branch||""})]})]},a.id)})})}function E({sessions:r,onSelect:i}){if(!r||r.length===0)return e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-8 text-center text-text-muted",children:"No sessions"});const a=[...r].sort((t,d)=>(d.updated_at||0)-(t.updated_at||0));return e.jsx("div",{className:"space-y-2",children:a.map(t=>e.jsxs("button",{type:"button",onClick:()=>i(t.id),className:"flex w-full items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 text-left transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-medium text-text-primary",children:t.title||t.id}),t.source==="acp"&&e.jsx("span",{className:"rounded-full bg-brand/15 px-2 py-0.5 text-xs font-medium text-brand",children:"ACP"})]}),e.jsx("div",{className:"truncate text-xs text-text-muted",children:t.id})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(p,{status:t.status}),e.jsx("span",{className:"text-xs text-text-muted",children:j(t.created_at||t.updated_at)})]})]},t.id))})}function _({open:r,environments:i,onClose:a,onCreated:t}){const[d,c]=l.useState(""),[o,x]=l.useState(""),[u,m]=l.useState(""),[b,n]=l.useState(!1);l.useEffect(()=>{r&&(c(""),x(""),m(""))},[r]);const h=async()=>{n(!0),m("");try{const s={};d.trim()&&(s.title=d.trim()),o&&(s.environment_id=o);const f=await w(s);t(f)}catch(s){m(s instanceof Error?s.message:"Failed to create session")}finally{n(!1)}};return e.jsx(g,{open:r,onOpenChange:s=>{s||a()},children:e.jsxs(y,{className:"max-w-md rounded-2xl border-border bg-surface-1 p-6 shadow-2xl",children:[e.jsx(N,{children:e.jsx(v,{className:"font-display text-lg font-semibold text-text-primary",children:"New Session"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:"Title (optional)"}),e.jsx("input",{type:"text",value:d,onChange:s=>c(s.target.value),placeholder:"My session",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm text-text-secondary",children:"Environment"}),e.jsxs("select",{value:o,onChange:s=>x(s.target.value),className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary focus:border-brand focus:outline-none",children:[e.jsx("option",{value:"",children:"-- None --"}),i.map(s=>e.jsxs("option",{value:s.id,children:[s.machine_name||s.id," (",s.branch||"no branch",")"]},s.id))]})]}),u&&e.jsx("div",{className:"text-sm text-status-error",children:u})]}),e.jsxs(C,{children:[e.jsx("button",{onClick:a,className:"rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"Cancel"}),e.jsx("button",{onClick:h,disabled:b,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light disabled:opacity-50 transition-colors",children:b?"Creating...":"Create"})]})]})})}function O({onNavigateSession:r}){const[i,a]=l.useState([]),[t,d]=l.useState([]),[c,o]=l.useState(!1),x=l.useCallback(async()=>{try{const[n,h]=await Promise.all([S(),k()]);a(n||[]),d(h||[])}catch(n){console.error("Dashboard render error:",n)}},[]);l.useEffect(()=>{x();const n=setInterval(x,1e4);return()=>clearInterval(n)},[x]);const u=n=>{o(!1),r(n.id)},m=l.useCallback(n=>{},[]),b=l.useCallback(n=>{r(n)},[r]);return e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-8",children:[e.jsx("h1",{className:"sr-only",children:"Dashboard"}),e.jsxs("section",{className:"mb-10",children:[e.jsx("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:"Environments"}),e.jsx(D,{environments:t,onSelectEnvironment:m})]}),e.jsxs("section",{children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:"Sessions"}),e.jsx("button",{onClick:()=>o(!0),className:"rounded-lg bg-brand px-3 py-1.5 text-sm font-medium text-white hover:bg-brand-light transition-colors",children:"+ New Session"})]}),e.jsx(E,{sessions:i,onSelect:b})]}),e.jsx(_,{open:c,environments:t,onClose:()=>o(!1),onCreated:u})]})}export{O as Dashboard};
@@ -0,0 +1,11 @@
1
+ var Q=Object.defineProperty;var V=(r,t,s)=>t in r?Q(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s;var k=(r,t,s)=>V(r,typeof t!="symbol"?t+"":t,s);import{j as e,e as h}from"./vendor-DE_-CLIE.js";import{t as O,i as z,n as J,q as Y,x as K,p as T,o as W,z as G,D as X,d as Z,f as ee,g as te,v as _,s as A,c as se,E as ne,A as re,y as oe,F as ae,u as le,T as F,S as ie,w as ce,b as de,C as ue,m as me,B as xe,h as pe,a as he}from"./main-ByE_8xaY.js";import"./shiki-mEP5vQQu.js";import"./qr-C0jP9HcD.js";import"./motion-BILbV7YQ.js";/**
2
+ * @license lucide-react v0.555.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const fe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],be=O("info",fe);/**
7
+ * @license lucide-react v0.555.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const ye=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ge=O("triangle-alert",ye);class je{constructor(){k(this,"listeners",new Set);k(this,"eventSource",null)}onEvent(t){return this.listeners.add(t),()=>this.listeners.delete(t)}connect(t){this.disconnect();const s=G(),n=`/web/sessions/${t}/events?uuid=${encodeURIComponent(s)}`,i=new EventSource(n);this.eventSource=i,i.addEventListener("message",a=>{try{const l=JSON.parse(a.data);for(const d of this.listeners)d(l)}catch{}})}disconnect(){this.eventSource&&(this.eventSource.close(),this.eventSource=null)}}const q=new je;function D(r){if(typeof r.content=="string")return r.content;if(r.message&&typeof r.message=="object"){const t=r.message;if(typeof t.content=="string")return t.content;if(Array.isArray(t.content))return t.content.filter(s=>s.type==="text"&&typeof s.text=="string").map(s=>s.text).join("")}return""}function $(r,t){for(let s=r.length-1;s>=0;s--){const n=r[s];if(n&&n.type==="tool_call"&&n.toolCall.id===t)return s}return-1}class ve{constructor(t,s,n){k(this,"sessionId");k(this,"setEntries");k(this,"unsub",null);k(this,"onStatusChange");k(this,"onError");k(this,"onPermissionRequest");this.sessionId=t,this.setEntries=s,this.onStatusChange=n==null?void 0:n.onStatusChange,this.onError=n==null?void 0:n.onError,this.onPermissionRequest=n==null?void 0:n.onPermissionRequest}async init(){try{await z(this.sessionId)}catch{}await this.loadHistory(),this.connectSSE()}async loadHistory(){const{events:t}=await J(this.sessionId);if(!t||t.length===0)return;const s=[];let n=null;const i=()=>{n&&(s.push(n),n=null)};for(const a of t){const l=a.payload||{};if(a.type==="user"){if(a.direction==="outbound")continue;i();const d=D(l);d&&s.push({type:"user_message",id:a.id||`hist-user-${s.length}`,content:d})}else if(a.type==="assistant"){i();const d=D(l),o=[],u=l.message;if(u&&typeof u=="object"&&Array.isArray(u.content))for(const m of u.content)m.type==="tool_use"&&o.push({type:"tool_call",toolCall:{id:m.id||`hist-tool-${s.length}`,title:m.name||"tool",status:"complete",rawInput:m.input||{}}});if(d||o.length>0){n={type:"assistant_message",id:a.id||`hist-asst-${s.length}`,chunks:d?[{type:"message",text:d}]:[]},s.push(n);for(const m of o)s.push(m);n=null}}else if(a.type==="tool_use"){const d=l,o={type:"tool_call",toolCall:{id:d.tool_call_id||`hist-tool-${s.length}`,title:d.tool_name||"tool",status:"complete",rawInput:d.tool_input||{}}};s.push(o)}else if(a.type==="tool_result"){const d=l,o=$(s,d.tool_call_id||"");if(o>=0){const u=s[o];s[o]={type:"tool_call",toolCall:{...u.toolCall,rawOutput:{output:d.content||d.output||""}}}}}}i(),this.setEntries(s)}connectSSE(){q.connect(this.sessionId),this.unsub=q.onEvent(t=>this.handleEvent(t))}disconnect(){this.unsub&&(this.unsub(),this.unsub=null),q.disconnect()}handleEvent(t){var a,l,d;const s=t.type,n=t.payload||{},i=JSON.stringify(t);if(!/Remote Control connecting/i.test(i))switch(s){case"assistant":{const o=typeof n.content=="string"?n.content:"";this.setEntries(m=>{const x=m[m.length-1];if((x==null?void 0:x.type)==="assistant_message"){const j=x.chunks[x.chunks.length-1];return(j==null?void 0:j.type)==="message"?[...m.slice(0,-1),{...x,chunks:[...x.chunks.slice(0,-1),{type:"message",text:j.text+o}]}]:[...m.slice(0,-1),{...x,chunks:[...x.chunks,{type:"message",text:o}]}]}if(o&&o.trim()){const j={type:"assistant_message",id:`assistant-${Date.now()}`,chunks:[{type:"message",text:o}]};return[...m,j]}return m});const u=n.message;if(u&&typeof u=="object"&&Array.isArray(u.content)){const m=u.content.filter(x=>x.type==="tool_use");for(const x of m){const N={id:x.id||`call-${Date.now()}-${Math.random().toString(16).slice(2,8)}`,title:x.name||"tool",status:"running",rawInput:x.input||{}};this.setEntries(p=>[...p,{type:"tool_call",toolCall:N}])}}break}case"tool_use":{const o=n,m={id:o.tool_call_id||`call-${Date.now()}`,title:o.tool_name||"tool",status:"running",rawInput:o.tool_input||{}};this.setEntries(x=>[...x,{type:"tool_call",toolCall:m}]);break}case"tool_result":{const o=n,u=o.tool_call_id||"";this.setEntries(m=>{const x=$(m,u);if(x<0)return m;const j=m[x];return m.map((N,p)=>p===x?{type:"tool_call",toolCall:{...j.toolCall,status:"complete",rawOutput:{output:o.content||o.output||""}}}:N)});break}case"control_request":case"permission_request":{const o=n.request;if(o&&o.subtype==="can_use_tool"){const u=n.request_id||"",m=o.tool_name||"unknown",x=o.input||o.tool_input||{},j=o.description||"";this.setEntries(N=>{const p=[...N].reverse().findIndex(f=>f.type==="tool_call");if(p>=0){const f=N.length-1-p,y=N[f];if(y.toolCall.status==="running")return N.map((w,S)=>S===f?{type:"tool_call",toolCall:{...y.toolCall,status:"waiting_for_confirmation",permissionRequest:{requestId:u,options:[]}}}:w)}return N}),(a=this.onPermissionRequest)==null||a.call(this,{requestId:u,toolName:m,toolInput:x,description:j})}break}case"session_status":{typeof n.status=="string"&&((l=this.onStatusChange)==null||l.call(this,n.status));break}case"error":{const o=String(n.message||n.content||"Unknown error");(d=this.onError)==null||d.call(this,o);break}}}async sendMessage(t,s){if(!t.trim()&&(!s||s.length===0))return;const n={type:"user_message",id:`user-${Date.now()}`,content:t,images:s&&s.length>0?s:void 0};this.setEntries(l=>[...l,n]);const a=s&&s.length>0?[...t?[{type:"text",text:t}]:[],...(s??[]).map(l=>({type:"image",source:{type:"base64",media_type:l.mimeType,data:l.data}}))]:t;await Y(this.sessionId,{type:"user",uuid:K(),content:t,message:{content:a}})}async respondPermission(t,s,n){await T(this.sessionId,{type:"permission_response",approved:s,request_id:t,...n}),this.setEntries(i=>i.map(a=>{var l;return a.type!=="tool_call"||((l=a.toolCall.permissionRequest)==null?void 0:l.requestId)!==t?a:{type:"tool_call",toolCall:{...a.toolCall,status:s?"running":"rejected",permissionRequest:void 0}}}))}async interrupt(){this.setEntries(t=>t.map(s=>s.type!=="tool_call"||s.toolCall.status!=="running"&&s.toolCall.status!=="waiting_for_confirmation"?s:{type:"tool_call",toolCall:{...s.toolCall,status:"canceled",permissionRequest:void 0}})),await W(this.sessionId)}}function we({onClose:r}){return e.jsx(X,{open:!0,onOpenChange:t=>{t||r()},children:e.jsxs(Z,{showCloseButton:!1,className:"fixed inset-y-0 right-0 top-auto left-auto translate-x-0 translate-y-0 w-full sm:w-80 h-full max-w-none max-h-none rounded-none border-l border-border bg-surface-1 p-4 sm:max-w-sm",children:[e.jsx(ee,{children:e.jsx(te,{className:"font-display font-semibold text-text-primary",children:"Tasks"})}),e.jsx("div",{className:"text-sm text-text-muted",children:"No active tasks"})]})})}function Ne({requestId:r,toolName:t,toolInput:s,description:n,onApprove:i,onReject:a}){const l=typeof s=="string"?s:JSON.stringify(s,null,2);return e.jsxs("div",{className:"rounded-xl border border-warning-border/30 bg-surface-1 p-4",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-warning-border/15 text-warning-text",children:e.jsx(ge,{className:"h-3 w-3"})}),e.jsx("span",{className:"text-sm font-semibold text-warning-text",children:"Permission Request"})]}),n&&e.jsx("div",{className:"mb-2 text-sm text-text-secondary",children:_(n)}),e.jsx("div",{className:"mb-2 font-mono text-xs font-bold text-text-primary",children:_(t)}),t!=="AskUserQuestion"&&e.jsx("pre",{className:"mb-3 max-h-40 overflow-auto rounded-lg bg-surface-1 p-2 text-xs text-text-secondary font-mono",children:ne(l,500)}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:i,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light transition-colors",children:"Approve"}),e.jsx("button",{onClick:a,className:"rounded-lg bg-status-error/20 px-4 py-2 text-sm font-medium text-status-error hover:bg-status-error/30 transition-colors",children:"Reject"})]})]})}function Se({questions:r,description:t,onSubmit:s,onSkip:n}){const[i,a]=h.useState({}),[l,d]=h.useState({}),[o,u]=h.useState(0),m=(p,f,y)=>{if(y){const w=i[p]||[],S=w.includes(f)?w.filter(v=>v!==f):[...w,f];a({...i,[p]:S})}else a({...i,[p]:f})},x=p=>{var y;const f=(y=l[p])==null?void 0:y.trim();f&&(a({...i,[p]:f}),d({...l,[p]:""}))},j=()=>{var f,y;const p={};for(const[w,S]of Object.entries(i)){const v=r[parseInt(w,10)];v&&(typeof S=="number"?p[w]=((y=(f=v.options)==null?void 0:f[S])==null?void 0:y.label)||String(S):Array.isArray(S)?p[w]=S.map(E=>{var R,I;return((I=(R=v.options)==null?void 0:R[E])==null?void 0:I.label)||String(E)}):p[w]=S)}s(p)};if(r.length<=1){const p=r[0]||{question:t,options:[],multiSelect:!1},f=p.multiSelect||!1;return e.jsxs("div",{className:"rounded-xl border border-brand/30 bg-surface-1 p-4",children:[e.jsx("div",{className:"mb-3 text-sm font-semibold text-text-primary",children:_(t||p.question||"Question")}),e.jsxs("div",{className:"space-y-2",children:[(p.options||[]).map((y,w)=>{const S=f?(i[0]||[]).includes(w):i[0]===w;return e.jsxs("button",{onClick:()=>m(0,w,f),className:A("w-full rounded-lg border px-4 py-2.5 text-left text-sm transition-colors",S?"border-brand bg-brand/10 text-text-primary":"border-border bg-surface-2 text-text-secondary hover:border-border-light"),children:[e.jsx("div",{className:"font-medium",children:_(y.label)}),y.description&&e.jsx("div",{className:"mt-0.5 text-xs text-text-muted",children:_(y.description)})]},w)}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:l[0]||"",onChange:y=>d({...l,0:y.target.value}),placeholder:"Other...",className:"flex-1 rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none",onKeyDown:y=>y.key==="Enter"&&x(0)}),e.jsx("button",{onClick:()=>x(0),className:"rounded-lg border border-border px-3 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"Send"})]})]}),e.jsxs("div",{className:"mt-4 flex gap-2",children:[e.jsx("button",{onClick:j,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light transition-colors",children:"Submit"}),e.jsx("button",{onClick:n,className:"rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"Skip"})]})]})}const N=r[o];return e.jsxs("div",{className:"rounded-xl border border-brand/30 bg-surface-1 p-4",children:[e.jsx("div",{className:"mb-3 text-sm font-semibold text-text-primary",children:_(t||"Questions")}),e.jsx("div",{className:"mb-3 flex gap-1 overflow-x-auto",children:r.map((p,f)=>e.jsx("button",{onClick:()=>u(f),className:A("rounded-md px-3 py-1.5 text-xs whitespace-nowrap transition-colors",o===f?"bg-brand/20 text-brand":"text-text-muted hover:bg-surface-2"),children:p.header||`Q${f+1}`},f))}),N&&e.jsx(Ce,{question:N,qIdx:o,answers:i,otherTexts:l,onSelect:m,onOtherTextChange:(p,f)=>d({...l,[p]:f}),onOtherSubmit:x}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-text-muted",children:[o+1," / ",r.length]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:j,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light transition-colors",children:"Submit All"}),e.jsx("button",{onClick:n,className:"rounded-lg border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"Skip"})]})]})]})}function Ce({question:r,qIdx:t,answers:s,otherTexts:n,onSelect:i,onOtherTextChange:a,onOtherSubmit:l}){const d=r.multiSelect||!1;return e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-sm text-text-secondary",children:_(r.question)}),e.jsxs("div",{className:"space-y-2",children:[(r.options||[]).map((o,u)=>{const m=d?(s[t]||[]).includes(u):s[t]===u;return e.jsxs("button",{onClick:()=>i(t,u,d),className:A("w-full rounded-lg border px-4 py-2.5 text-left text-sm transition-colors",m?"border-brand bg-brand/10 text-text-primary":"border-border bg-surface-2 text-text-secondary hover:border-border-light"),children:[e.jsx("div",{className:"font-medium",children:_(o.label)}),o.description&&e.jsx("div",{className:"mt-0.5 text-xs text-text-muted",children:_(o.description)})]},u)}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:n[t]||"",onChange:o=>a(t,o.target.value),placeholder:"Other...",className:"flex-1 rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none",onKeyDown:o=>o.key==="Enter"&&l(t)}),e.jsx("button",{onClick:()=>l(t),className:"rounded-lg border border-border px-3 py-2 text-sm text-text-secondary hover:bg-surface-2 transition-colors",children:"Send"})]})]})]})}function _e({planContent:r,description:t,onSubmit:s}){const[n,i]=h.useState(null),[a,l]=h.useState(""),d=!r||!r.trim(),o=()=>{n&&s(n,n==="no"?a:void 0)};return e.jsxs("div",{className:"rounded-xl border border-brand/30 bg-surface-1 p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-brand/15 text-brand",children:e.jsx(se,{className:"h-3 w-3",strokeWidth:2.5})}),e.jsx("span",{className:"text-sm font-semibold text-text-primary",children:d?"Exit plan mode?":"Ready to code?"})]}),!d&&e.jsx("div",{className:"mb-4 max-h-64 overflow-auto rounded-lg bg-tool-card p-4 text-sm text-text-secondary",dangerouslySetInnerHTML:{__html:ke(r)}}),e.jsx("div",{className:"space-y-2",children:d?e.jsxs(e.Fragment,{children:[e.jsx(P,{selected:n==="yes-default",onClick:()=>i("yes-default"),label:"Yes"}),e.jsx(P,{selected:n==="no",onClick:()=>i("no"),label:"No"})]}):e.jsxs(e.Fragment,{children:[e.jsx(P,{selected:n==="yes-accept-edits",onClick:()=>i("yes-accept-edits"),label:"Yes, auto-accept edits",desc:"Approve plan and auto-accept file edits"}),e.jsx(P,{selected:n==="yes-default",onClick:()=>i("yes-default"),label:"Yes, manually approve edits",desc:"Approve plan but confirm each edit"}),e.jsx(P,{selected:n==="no",onClick:()=>i("no"),label:"No, keep planning",desc:"Provide feedback to refine the plan"})]})}),n==="no"&&e.jsx("textarea",{value:a,onChange:u=>l(u.target.value),placeholder:"Tell Saluzi what to change...",className:"mt-3 w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none",rows:3}),e.jsx("div",{className:"mt-4",children:e.jsx("button",{onClick:o,disabled:!n,className:"rounded-lg bg-brand px-4 py-2 text-sm font-medium text-white hover:bg-brand-light disabled:opacity-50 transition-colors",children:"Submit"})})]})}function P({selected:r,onClick:t,label:s,desc:n}){return e.jsxs("button",{onClick:t,className:A("w-full rounded-lg border px-4 py-2.5 text-left text-sm transition-colors",r?"border-brand bg-brand/10 text-text-primary":"border-border bg-surface-2 text-text-secondary hover:border-border-light"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:A("flex h-4 w-4 items-center justify-center rounded-full border text-[10px] transition-colors",r?"border-brand bg-brand text-white":"border-border"),children:r&&"✓"}),e.jsx("span",{className:"font-medium",children:s})]}),n&&e.jsx("div",{className:"mt-0.5 pl-6 text-xs text-text-muted",children:n})]})}function ke(r){let t=_(r);return t=t.replace(/```(\w*)\n?([\s\S]*?)```/g,(s,n,i)=>`<pre class="my-2 overflow-x-auto rounded-lg bg-tool-card p-3 font-mono text-xs">${i.trim()}</pre>`),t=t.replace(/`([^`]+)`/g,'<code class="rounded bg-tool-card px-1.5 py-0.5 font-mono text-xs">$1</code>'),t=t.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),t}function Ee(r){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/acp/relay/${r}`}function Pe(r){const t=Ee(r),s=oe(),n=s?{proxyUrl:t,token:s}:{proxyUrl:t};return new re(n)}function Oe({sessionId:r}){const[t,s]=h.useState(null),[n,i]=h.useState(null),[a,l]=h.useState(""),[d,o]=h.useState(!1),[u,m]=h.useState(!1),[x,j]=h.useState([]),[N,p]=h.useState(!1),[f,y]=h.useState([]),w=h.useRef(null),S=h.useRef(x);S.current=x;const v=h.useMemo(()=>new ve(r,j,{onStatusChange:c=>{i(c)},onError:c=>{console.error("[RCSChatAdapter] error:",c)},onPermissionRequest:c=>{y(g=>g.some(b=>b.requestId===c.requestId)?g:[...g,c])}}),[r]);h.useEffect(()=>(w.current=v,()=>{v.disconnect()}),[v]),h.useEffect(()=>{let c=!1;async function g(){l("");try{const b=await me(r);if(c)return;s(b),i(b.status)}catch(b){if(c)return;l(b instanceof Error?b.message:"Failed to load session");return}try{await v.init()}catch(b){console.warn("Failed to init adapter:",b)}}return g(),()=>{c=!0}},[r,v]);const E=xe(n),R=h.useCallback(async c=>{const g=c.text.trim();if(!g||E)return;const b=await ae(g,{sessionId:r,availableCommands:[],availableModels:[],currentModel:null,supportsImages:!0,entries:S.current,setModel:async()=>{throw new Error("RCS 原生协议不支持模型切换,请用 ACP 模式")},onNewSession:()=>{j([])}}).catch(()=>null);if(b){if(le("[SessionDetail] local command result",b),"clearEntries"in b&&b.clearEntries){j([]);return}if("newSession"in b&&b.newSession){j([]);return}if("userEntry"in b){j(C=>[...C,b.userEntry,b.cmdEntry]);return}}p(!0);try{await v.sendMessage(g,c.images)}catch(C){console.error("Send failed:",C)}},[v,E,r]),I=h.useCallback(async()=>{try{await v.interrupt()}catch(c){console.error("Interrupt failed:",c)}finally{p(!1)}},[v]);h.useEffect(()=>{if(x.length===0)return;const c=x[x.length-1];if((c==null?void 0:c.type)==="assistant_message"||(c==null?void 0:c.type)==="tool_call"){if(c.type==="tool_call"&&c.toolCall.status==="running")return;p(!1)}},[x]);const U=h.useCallback(async c=>{try{await v.respondPermission(c,!0)}catch(g){console.error("Failed to approve:",g)}y(g=>g.filter(b=>b.requestId!==c))},[v]),B=h.useCallback(async c=>{try{await v.respondPermission(c,!1)}catch(g){console.error("Failed to reject:",g)}y(g=>g.filter(b=>b.requestId!==c))},[v]),L=h.useCallback(async(c,g,b)=>{try{await T(r,{type:"permission_response",approved:!0,request_id:c,updated_input:{questions:b,answers:g}})}catch(C){console.error("Failed to submit answers:",C)}y(C=>C.filter(M=>M.requestId!==c))},[r]),H=h.useCallback(async(c,g,b)=>{try{g==="no"?await T(r,{type:"permission_response",approved:!1,request_id:c,...b?{message:b}:{}}):await T(r,{type:"permission_response",approved:!0,request_id:c,updated_permissions:[{type:"setMode",mode:{"yes-accept-edits":"acceptEdits","yes-default":"default"}[g]||"default",destination:"session"}]})}catch(C){console.error("Failed to submit plan response:",C)}y(C=>C.filter(M=>M.requestId!==c))},[r]);return a?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-status-error",children:a}),e.jsx("a",{href:"/code/",className:"mt-4 inline-block text-brand hover:underline",children:"← Back to Dashboard"})]})}):t?t.source==="acp"&&t.environment_id?e.jsx(Re,{sessionId:r,agentId:t.environment_id}):e.jsx(F,{children:e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsx("h1",{className:"sr-only",children:t.title||t.id}),e.jsx("div",{className:"border-b bg-surface-1 px-4 py-3",children:e.jsxs("div",{className:"mx-auto max-w-5xl",children:[e.jsx("div",{className:"mb-1",children:e.jsx("a",{href:"/code/",className:"text-sm text-text-muted hover:text-text-secondary transition-colors no-underline",children:"← Dashboard"})}),e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:t.title||t.id}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[n&&e.jsx(ie,{status:n}),e.jsx("span",{className:"text-xs text-text-muted",children:ce(t.created_at)})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>m(!u),className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-muted hover:bg-surface-2 hover:text-text-secondary transition-colors",title:"Session info",children:e.jsx(be,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>o(!d),className:"flex items-center gap-1 rounded-md px-3 py-1.5 text-sm text-text-primary font-bold hover:bg-brand-light hover:text-white transition-colors",children:"Tasks"})]})]}),u&&e.jsxs("div",{className:"mt-2 rounded-md bg-surface-2 px-3 py-2 text-xs text-text-muted space-y-1 font-mono",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-text-primary font-bold font-sans",children:"Session"})," ",t.id]}),t.environment_id&&e.jsxs("div",{children:[e.jsx("span",{className:"text-text-primary font-bold font-sans",children:"Environment"})," ",t.environment_id]})]})]})}),e.jsx(de,{entries:x,isLoading:N,emptyTitle:"开始对话",emptyDescription:"输入消息开始聊天"}),f.length>0&&e.jsx("div",{className:"border-t bg-surface-1 px-4 py-3",children:e.jsx("div",{className:"mx-auto max-w-3xl space-y-3",children:f.map(c=>e.jsx(Ae,{request:c,onApprove:()=>U(c.requestId),onReject:()=>B(c.requestId),onSubmitAnswers:L,onSubmitPlan:H},c.requestId))})}),e.jsx(ue,{onSubmit:R,isLoading:N,onInterrupt:I,disabled:E,placeholder:E?"会话已关闭":"输入消息...",supportsImages:!0}),d&&e.jsx(we,{onClose:()=>o(!1)})]})}):e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx("div",{className:"text-text-muted",children:"Loading session..."})})}function Ae({request:r,onApprove:t,onReject:s,onSubmitAnswers:n,onSubmitPlan:i}){const a=r.toolName,l=r.toolInput,d=r.description||"";if(a==="AskUserQuestion"){const o=l.questions||[];return e.jsx(Se,{requestId:r.requestId,questions:o,description:d,onSubmit:u=>n(r.requestId,u,o),onSkip:s})}if(a==="ExitPlanMode"){const o=l.plan||"";return e.jsx(_e,{requestId:r.requestId,planContent:o,description:d,onSubmit:(u,m)=>i(r.requestId,u,m)})}return e.jsx(Ne,{requestId:r.requestId,toolName:a,toolInput:l,description:d,onApprove:t,onReject:s})}function Re({sessionId:r,agentId:t}){const[s,n]=h.useState(null),[i,a]=h.useState("disconnected"),[l,d]=h.useState(null),o=h.useRef(null);return h.useEffect(()=>{const u=Pe(t);return u.setConnectionStateHandler((m,x)=>{a(m),d(x||null)}),o.current=u,n(u),u.connect().catch(m=>{m instanceof pe||(d(m.message),a("error"))}),()=>{u.disconnect(),o.current=null,n(null),a("disconnected")}},[t]),e.jsx(F,{children:e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l&&i==="error"&&e.jsx("div",{className:"px-4 py-2 bg-destructive/10 text-destructive text-sm border-b",children:l}),i==="connecting"&&e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin h-8 w-8 border-2 border-brand border-t-transparent rounded-full mx-auto mb-3"}),e.jsx("p",{className:"text-text-muted text-sm",children:"Connecting to agent..."})]})}),i==="error"&&!s&&e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"font-medium mb-1",children:"Connection Failed"}),e.jsx("p",{className:"text-text-muted text-sm",children:l})]})}),s&&i==="connected"&&e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(he,{client:s,agentId:t})})]})})}export{Oe as SessionDetail};
@@ -1 +1 @@
1
- import{bl as ln,aO as an,H as z,b8 as w,F as G,ah as un,W as y,bd as tn,b9 as J,aI as _,c as rn,m as o,aG as on,j as sn,d as fn}from"./mermaid.core-gzqLmJwE.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,j,I,v,A,H,a){var q=j-l,i=I-h,n=H-v,d=a-A,u=d*q-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*q,h+u*i]}function U(l,h,j,I,v,A,H){var a=l-j,q=h-I,i=(H?A:-A)/J(a*a+q*q),n=i*q,d=-i*a,u=l+n,s=h+d,f=j+n,c=I+d,S=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,D=(g<0?-1:1)*J(on(0,T*T*R-P*P)),E=(P*g-m*D)/R,F=(-P*m-g*D)/R,b=(P*g+m*D)/R,p=(-P*m+g*D)/R,x=E-S,e=F-t,r=b-S,W=p-t;return x*x+e*e>r*r+W*W&&(E=b,F=p),{cx:E,cy:F,x01:-n,y01:-d,x11:E*(v/T-1),y11:F*(v/T-1)}}function hn(){var l=cn,h=yn,j=G(0),I=null,v=gn,A=dn,H=mn,a=null,q=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,S=rn(c-f),t=c>f;if(a||(a=n=q()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(S>tn-y)a.moveTo(s*z(f),s*w(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*z(c),u*w(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=S,D=S,E=H.apply(this,arguments)/2,F=E>y&&(I?+I.apply(this,arguments):J(u*u+s*s)),b=_(rn(s-u)/2,+j.apply(this,arguments)),p=b,x=b,e,r;if(F>y){var W=sn(F/u*w(E)),K=sn(F/s*w(E));(P-=W*2)>y?(W*=t?1:-1,R+=W,T-=W):(P=0,R=T=(f+c)/2),(D-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(D=0,m=g=(f+c)/2)}var B=s*z(m),C=s*w(m),L=u*z(T),M=u*w(T);if(b>y){var N=s*z(g),Q=s*w(g),V=u*z(R),X=u*w(R),O;if(S<an)if(O=pn(B,C,V,X,N,Q,L,M)){var Y=B-O[0],Z=C-O[1],$=N-O[0],k=Q-O[1],nn=1/w(fn((Y*$+Z*k)/(J(Y*Y+Z*Z)*J($*$+k*k)))/2),en=J(O[0]*O[0]+O[1]*O[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}D>y?x>y?(e=U(V,X,B,C,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(B,C),a.arc(0,0,s,m,g,!t)):a.moveTo(B,C),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(B,C,V,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[z(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:G(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:G(+n),i):h},i.cornerRadius=function(n){return arguments.length?(j=typeof n=="function"?n:G(+n),i):j},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:G(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:G(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:G(+n),i):A},i.padAngle=function(n){return arguments.length?(H=typeof n=="function"?n:G(+n),i):H},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{bl as ln,aO as an,H as z,b8 as w,F as G,ah as un,W as y,bd as tn,b9 as J,aI as _,c as rn,m as o,aG as on,j as sn,d as fn}from"./mermaid.core-BJO0lY1A.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,j,I,v,A,H,a){var q=j-l,i=I-h,n=H-v,d=a-A,u=d*q-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*q,h+u*i]}function U(l,h,j,I,v,A,H){var a=l-j,q=h-I,i=(H?A:-A)/J(a*a+q*q),n=i*q,d=-i*a,u=l+n,s=h+d,f=j+n,c=I+d,S=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,D=(g<0?-1:1)*J(on(0,T*T*R-P*P)),E=(P*g-m*D)/R,F=(-P*m-g*D)/R,b=(P*g+m*D)/R,p=(-P*m+g*D)/R,x=E-S,e=F-t,r=b-S,W=p-t;return x*x+e*e>r*r+W*W&&(E=b,F=p),{cx:E,cy:F,x01:-n,y01:-d,x11:E*(v/T-1),y11:F*(v/T-1)}}function hn(){var l=cn,h=yn,j=G(0),I=null,v=gn,A=dn,H=mn,a=null,q=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,S=rn(c-f),t=c>f;if(a||(a=n=q()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(S>tn-y)a.moveTo(s*z(f),s*w(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*z(c),u*w(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=S,D=S,E=H.apply(this,arguments)/2,F=E>y&&(I?+I.apply(this,arguments):J(u*u+s*s)),b=_(rn(s-u)/2,+j.apply(this,arguments)),p=b,x=b,e,r;if(F>y){var W=sn(F/u*w(E)),K=sn(F/s*w(E));(P-=W*2)>y?(W*=t?1:-1,R+=W,T-=W):(P=0,R=T=(f+c)/2),(D-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(D=0,m=g=(f+c)/2)}var B=s*z(m),C=s*w(m),L=u*z(T),M=u*w(T);if(b>y){var N=s*z(g),Q=s*w(g),V=u*z(R),X=u*w(R),O;if(S<an)if(O=pn(B,C,V,X,N,Q,L,M)){var Y=B-O[0],Z=C-O[1],$=N-O[0],k=Q-O[1],nn=1/w(fn((Y*$+Z*k)/(J(Y*Y+Z*Z)*J($*$+k*k)))/2),en=J(O[0]*O[0]+O[1]*O[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}D>y?x>y?(e=U(V,X,B,C,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(B,C),a.arc(0,0,s,m,g,!t)):a.moveTo(B,C),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(B,C,V,X,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[z(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:G(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:G(+n),i):h},i.cornerRadius=function(n){return arguments.length?(j=typeof n=="function"?n:G(+n),i):j},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:G(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:G(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:G(+n),i):A},i.padAngle=function(n){return arguments.length?(H=typeof n=="function"?n:G(+n),i):H},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};