@lovelybunch/api 1.0.78-alpha.0 → 1.0.78-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/routes/api/v1/context/architecture/route.d.ts +3 -0
  2. package/dist/routes/api/v1/context/architecture/route.js +245 -0
  3. package/dist/routes/api/v1/context/project/route.d.ts +3 -0
  4. package/dist/routes/api/v1/context/project/route.js +200 -0
  5. package/dist/routes/api/v1/jobs/[id]/route.d.ts +8 -8
  6. package/dist/routes/api/v1/jobs/route.d.ts +8 -8
  7. package/dist/routes/api/v1/mail/route.d.ts +3 -3
  8. package/package.json +4 -4
  9. package/static/assets/{ActivityPage-DiwGC2nD.js → ActivityPage-GDXCtp2F.js} +1 -1
  10. package/static/assets/{AgentsContextEditPage-Xh10BIpD.js → AgentsContextEditPage-DoMluWwB.js} +1 -1
  11. package/static/assets/{AgentsContextPage-DYLVgjBy.js → AgentsContextPage-CXHbtOdz.js} +1 -1
  12. package/static/assets/{ApiKeysSettingsPage-21Rz7etb.js → ApiKeysSettingsPage-DbstsqyB.js} +1 -1
  13. package/static/assets/{AuthSettingsPage-CuDQH02c.js → AuthSettingsPage-CK9eFJo0.js} +1 -1
  14. package/static/assets/{CallbackPage-Fok1FSep.js → CallbackPage-BFE5x2Hd.js} +1 -1
  15. package/static/assets/{CoconutCallbackPage-CJCSsq2v.js → CoconutCallbackPage-D2aFrloh.js} +1 -1
  16. package/static/assets/{CodePage-CzEzWmjy.js → CodePage-BfUucBak.js} +1 -1
  17. package/static/assets/{CollapsibleSection-CAtdqP8-.js → CollapsibleSection-Cu7uJYqA.js} +1 -1
  18. package/static/assets/{DashboardPage-i5uE_kdH.js → DashboardPage-xDDYm5-7.js} +1 -1
  19. package/static/assets/{GitPage-Do-L6D0R.js → GitPage-Ca_CKgGJ.js} +1 -1
  20. package/static/assets/{GitSettingsPage-GZ5wAGvy.js → GitSettingsPage-Bx0JsYW4.js} +1 -1
  21. package/static/assets/{IdentityPage-BJe8PLkl.js → IdentityPage-DbG7B63H.js} +1 -1
  22. package/static/assets/{ImplementationStepsEditor-C5ERpOXx.js → ImplementationStepsEditor-D_eIbq-s.js} +1 -1
  23. package/static/assets/{IntegrationsSettingsPage-Bw9hlc_l.js → IntegrationsSettingsPage-2lBY2pzo.js} +1 -1
  24. package/static/assets/{JobDetailPage-DvPv3vVS.js → JobDetailPage-DVIv1yvM.js} +1 -1
  25. package/static/assets/{KnowledgeDetailPage-BPhauuYL.js → KnowledgeDetailPage-CgR2Sjgu.js} +1 -1
  26. package/static/assets/{KnowledgeEditPage-CQUswyeH.js → KnowledgeEditPage-XrvVy-Nr.js} +1 -1
  27. package/static/assets/{KnowledgePage-KTCjoesA.js → KnowledgePage-Bd4yUZve.js} +1 -1
  28. package/static/assets/{LoginPage-BYAGsbfR.js → LoginPage-BPjBtFbe.js} +1 -1
  29. package/static/assets/{MailInboxPage-DSTys1-R.js → MailInboxPage-Uv5Yd0V5.js} +1 -1
  30. package/static/assets/{MailProcessingModal-Ctknm_wU.js → MailProcessingModal-DFCnUJD5.js} +1 -1
  31. package/static/assets/{MailReadPage-AOANr3XI.js → MailReadPage-BjBTIvdR.js} +1 -1
  32. package/static/assets/{MailSentPage-BnSYoKkQ.js → MailSentPage-Dsv4mmWO.js} +1 -1
  33. package/static/assets/{McpSettingsPage-CY3iobWJ.js → McpSettingsPage-ddInKeE_.js} +1 -1
  34. package/static/assets/{MemoryEditPage-Bh_d-iqV.js → MemoryEditPage-1Duk8_Ep.js} +1 -1
  35. package/static/assets/{MemoryPage-CMPTTwSH.js → MemoryPage-BsVDrfoH.js} +1 -1
  36. package/static/assets/{NewKnowledgePage-B00wknYX.js → NewKnowledgePage-QD99jkhw.js} +1 -1
  37. package/static/assets/{NewSkillPage-hNhVRNjh.js → NewSkillPage-CzXXY_2H.js} +1 -1
  38. package/static/assets/{NewTaskPage-Dq75MGuc.js → NewTaskPage-Dnvq8q0H.js} +1 -1
  39. package/static/assets/{NotFoundPage-CR1-vMeX.js → NotFoundPage-CXNHyu2I.js} +1 -1
  40. package/static/assets/{NotificationsSettingsPage-5aeTZq8-.js → NotificationsSettingsPage-CMwizTN5.js} +1 -1
  41. package/static/assets/{PromptsSettingsPage-Brs1vikj.js → PromptsSettingsPage-mzfSW46B.js} +1 -1
  42. package/static/assets/{ResourceDetailPage-3r3KPdJy.js → ResourceDetailPage-DmVFJJeE.js} +1 -1
  43. package/static/assets/{ResourcesPage-CFtSgZva.js → ResourcesPage-B-S4WIgq.js} +1 -1
  44. package/static/assets/{RoleEditPage-DmSqJEHZ.js → RoleEditPage-CLDE56qK.js} +1 -1
  45. package/static/assets/{RolePage-Dm523gez.js → RolePage-D43fy7y9.js} +1 -1
  46. package/static/assets/{RulesSettingsPage-DewqNsAk.js → RulesSettingsPage-CZJQIr_7.js} +1 -1
  47. package/static/assets/{RunDetailPage-BDUVebTX.js → RunDetailPage-DM1a32RR.js} +1 -1
  48. package/static/assets/{SchedulePage-DFnoNF-X.js → SchedulePage-D2fMyBig.js} +1 -1
  49. package/static/assets/{SkillDetailPage-DnCPbpIZ.js → SkillDetailPage-BePyNqOX.js} +1 -1
  50. package/static/assets/{SkillEditPage-Inn-YsZP.js → SkillEditPage-DBc1H0t2.js} +1 -1
  51. package/static/assets/{SkillsPage-CD-eiUnZ.js → SkillsPage-Be_0YQkP.js} +1 -1
  52. package/static/assets/{SkillsSettingsPage-C1bs2gVd.js → SkillsSettingsPage-Vr645xmf.js} +1 -1
  53. package/static/assets/{SourceInput-CIyYOUd-.js → SourceInput-Xd7tPRiQ.js} +1 -1
  54. package/static/assets/{TagInput-fSSAsdov.js → TagInput-D0zZF7xt.js} +1 -1
  55. package/static/assets/{TaskDetailPage-B2AeYerz.js → TaskDetailPage-Bpg8n3W0.js} +1 -1
  56. package/static/assets/{TaskEditPage-B9dA1Nr4.js → TaskEditPage-BNvNMUgF.js} +1 -1
  57. package/static/assets/{TasksPage-DJBVDNw1.js → TasksPage-BQE58PD0.js} +1 -1
  58. package/static/assets/{TeamEditPage-BGHM7C8n.js → TeamEditPage-C4UQSONx.js} +1 -1
  59. package/static/assets/{TeamPage-CGxpXKc4.js → TeamPage-CVtSifUm.js} +1 -1
  60. package/static/assets/{TerminalPage-z5NbYWjF.js → TerminalPage-SUFGXm4l.js} +1 -1
  61. package/static/assets/{TerminalSessionPage-eDZDlEeb.js → TerminalSessionPage-BVsNKUkH.js} +1 -1
  62. package/static/assets/{UserPreferencesPage-uTC5S4Ig.js → UserPreferencesPage-Df-ITRan.js} +1 -1
  63. package/static/assets/{UserSettingsPage-D6uxgoz5.js → UserSettingsPage-DXVtBXML.js} +1 -1
  64. package/static/assets/{UtilitiesPage-BwoS0vin.js → UtilitiesPage-D6fqcEaT.js} +1 -1
  65. package/static/assets/{alert-CKLRmrya.js → alert-DAl4a56c.js} +1 -1
  66. package/static/assets/{arrow-down-B7v_FmC2.js → arrow-down-CDCYDGUx.js} +1 -1
  67. package/static/assets/{arrow-left-CrE2UamQ.js → arrow-left-VDfx33Jh.js} +1 -1
  68. package/static/assets/{arrow-up-DkJyEUv_.js → arrow-up-CDSv61uo.js} +1 -1
  69. package/static/assets/{arrow-up-down-CyKWLTed.js → arrow-up-down-Ezpoqf2s.js} +1 -1
  70. package/static/assets/{badge-CEhr50DH.js → badge-D_uqNUSH.js} +1 -1
  71. package/static/assets/{browser-modal-BaiHyGXz.js → browser-modal-C5jrpzix.js} +1 -1
  72. package/static/assets/{card-CEBVsJGA.js → card-B0QREUF4.js} +1 -1
  73. package/static/assets/{chevron-left-Dwnb59xB.js → chevron-left-35sibkLF.js} +1 -1
  74. package/static/assets/{chevron-up-CLuT-8K8.js → chevron-up-BjM6KODw.js} +1 -1
  75. package/static/assets/{chevrons-up-DiHFV5Rg.js → chevrons-up-jJ4zW_aE.js} +1 -1
  76. package/static/assets/{circle-alert-DbwPGG3s.js → circle-alert-gQD7uoQT.js} +1 -1
  77. package/static/assets/{circle-check-DoS8t4b0.js → circle-check-KTXf2BuN.js} +1 -1
  78. package/static/assets/{circle-check-big-DW9BPHOx.js → circle-check-big-CJ5S5SSR.js} +1 -1
  79. package/static/assets/{circle-play-B5pWyVQu.js → circle-play-SYdQRKi1.js} +1 -1
  80. package/static/assets/{circle-x-D0FfNqWc.js → circle-x-Bcwe-LN_.js} +1 -1
  81. package/static/assets/{clipboard-DesoxJnQ.js → clipboard-VHK-krjO.js} +1 -1
  82. package/static/assets/{clock-KMBAqOpw.js → clock-D5ggHAx5.js} +1 -1
  83. package/static/assets/{code-Jj7V1OI-.js → code-Dg1ZHEGS.js} +1 -1
  84. package/static/assets/{download-bCNOpuix.js → download-CGb5cJiK.js} +1 -1
  85. package/static/assets/{external-link-BbvQVJFO.js → external-link-Cf9EKGQO.js} +1 -1
  86. package/static/assets/{eye-B3bkY8eg.js → eye-oD_Emdr8.js} +1 -1
  87. package/static/assets/{folder-git-2-DK4rLsn4.js → folder-git-2-DX-nlC0d.js} +1 -1
  88. package/static/assets/{globe-bTMV8w2D.js → globe-pOzIGyKN.js} +1 -1
  89. package/static/assets/{index-DUahdX7L.js → index-BIwO8uo-.js} +1 -1
  90. package/static/assets/{index-C0uIENKu.js → index-BUPxY8PP.js} +3 -3
  91. package/static/assets/{index-X-V7B-bx.js → index-BXQJo5V4.js} +1 -1
  92. package/static/assets/{index-BnXRNrU8.js → index-Bfgdm0Cb.js} +1 -1
  93. package/static/assets/{index-CZiSycvj.js → index-Bxwh96Rz.js} +1 -1
  94. package/static/assets/{index--BGsGBNQ.js → index-C3FDBd4S.js} +1 -1
  95. package/static/assets/{index-D5ZLXUjG.js → index-C3MMQmQg.js} +1 -1
  96. package/static/assets/{index-gnXQirFQ.js → index-C6yQwDNN.js} +1 -1
  97. package/static/assets/{index-DtuMv8f8.js → index-CC7HjVOa.js} +1 -1
  98. package/static/assets/{index-BQ6iW0x3.js → index-CCGFI_UP.js} +1 -1
  99. package/static/assets/{index-BcFOHKDW.js → index-CHyffstY.js} +1 -1
  100. package/static/assets/{index-4_sGNb1Z.js → index-Cidb9y3R.js} +1 -1
  101. package/static/assets/{index-fkGtFh-U.js → index-CoFwRL3K.js} +1 -1
  102. package/static/assets/{index-DVczQIDE.js → index-CusNnDtY.js} +1 -1
  103. package/static/assets/{index-CpjimEBF.js → index-Cuz8Apx7.js} +1 -1
  104. package/static/assets/{index-DHFK1JbA.js → index-DchDWBTE.js} +1 -1
  105. package/static/assets/{index-Bys9M37r.js → index-DjJ6EU0v.js} +1 -1
  106. package/static/assets/{index-D82OGwJi.js → index-FklRfl66.js} +1 -1
  107. package/static/assets/{index-BbgmwHwE.js → index-pfpWERL-.js} +1 -1
  108. package/static/assets/{info-CMb2giNJ.js → info-DlnFCJCq.js} +1 -1
  109. package/static/assets/{label-DXN216Ba.js → label-CjHH2sSK.js} +1 -1
  110. package/static/assets/{markdown-editor-MQ7X6BHT.js → markdown-editor-BN8QzPHa.js} +3 -3
  111. package/static/assets/{message-square-f1hNpr6b.js → message-square-k2mWEt-W.js} +1 -1
  112. package/static/assets/{paperclip-BiwY4VlV.js → paperclip-pH0rHAfm.js} +1 -1
  113. package/static/assets/{pause-EbBEDWDr.js → pause-BF-WAXuj.js} +1 -1
  114. package/static/assets/{play-BHqUO04d.js → play-szwfQctH.js} +1 -1
  115. package/static/assets/{radio-group-CzhYpC89.js → radio-group-BAAsV2rJ.js} +1 -1
  116. package/static/assets/{refresh-cw-BPr-EVyC.js → refresh-cw-CxDJQR9R.js} +1 -1
  117. package/static/assets/{search-BBw4K5iK.js → search-CoqBUnty.js} +1 -1
  118. package/static/assets/{select-BLUGdloJ.js → select-SvSJ1fXP.js} +1 -1
  119. package/static/assets/{server-2mf5MwhW.js → server-yLtQ3igN.js} +1 -1
  120. package/static/assets/{switch-DwGQE3tG.js → switch-DNt53KzF.js} +1 -1
  121. package/static/assets/{tabs-33myWTAS.js → tabs-DBHspaGs.js} +1 -1
  122. package/static/assets/{tag-C-PW20qp.js → tag-yDsYYVah.js} +1 -1
  123. package/static/assets/{terminal-preview-BHb0aOSR.js → terminal-preview-DYd7d-he.js} +1 -1
  124. package/static/assets/{triangle-alert-CNER-68k.js → triangle-alert-Dy1Oo-ts.js} +1 -1
  125. package/static/assets/{use-terminal-GvBteSXs.js → use-terminal-DpQ4ZVfs.js} +1 -1
  126. package/static/assets/{video-3hk0v1CB.js → video-BoEpz24p.js} +1 -1
  127. package/static/index.html +1 -1
  128. package/dist/config/m2m.d.ts +0 -26
  129. package/dist/config/m2m.js +0 -27
  130. package/dist/lib/auth/clerk-m2m-verifier.d.ts +0 -34
  131. package/dist/lib/auth/clerk-m2m-verifier.js +0 -47
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-C0uIENKu.js";/**
1
+ import{c as e}from"./index-BUPxY8PP.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-C0uIENKu.js";/**
1
+ import{c}from"./index-BUPxY8PP.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as o,j as e,e as r,n as d,ah as y}from"./index-C0uIENKu.js";import{R as N,V as g,T as n,I as j,P as b,C as i,a as S,b as c,d as v,c as R,e as m,f as p,L as f,S as x}from"./index-4_sGNb1Z.js";import{C}from"./chevron-up-CLuT-8K8.js";const k=N,E=g,I=o.forwardRef(({className:t,children:s,...a},l)=>e.jsxs(n,{ref:l,className:r("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...a,children:[s,e.jsx(j,{asChild:!0,children:e.jsx(d,{className:"h-4 w-4 opacity-50"})})]}));I.displayName=n.displayName;const u=o.forwardRef(({className:t,...s},a)=>e.jsx(m,{ref:a,className:r("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(C,{className:"h-4 w-4"})}));u.displayName=m.displayName;const h=o.forwardRef(({className:t,...s},a)=>e.jsx(p,{ref:a,className:r("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(d,{className:"h-4 w-4"})}));h.displayName=p.displayName;const B=o.forwardRef(({className:t,children:s,position:a="popper",...l},w)=>e.jsx(b,{children:e.jsxs(i,{ref:w,className:r("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,...l,children:[e.jsx(u,{}),e.jsx(S,{className:r("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(h,{})]})}));B.displayName=i.displayName;const T=o.forwardRef(({className:t,...s},a)=>e.jsx(f,{ref:a,className:r("px-2 py-1.5 text-sm font-semibold",t),...s}));T.displayName=f.displayName;const V=o.forwardRef(({className:t,children:s,...a},l)=>e.jsxs(c,{ref:l,className:r("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(v,{children:e.jsx(y,{className:"h-4 w-4"})})}),e.jsx(R,{children:s})]}));V.displayName=c.displayName;const z=o.forwardRef(({className:t,...s},a)=>e.jsx(x,{ref:a,className:r("-mx-1 my-1 h-px bg-muted",t),...s}));z.displayName=x.displayName;export{k as S,I as a,E as b,B as c,V as d};
1
+ import{r as o,j as e,e as r,n as d,ah as y}from"./index-BUPxY8PP.js";import{R as N,V as g,T as n,I as j,P as b,C as i,a as S,b as c,d as v,c as R,e as m,f as p,L as f,S as x}from"./index-Cidb9y3R.js";import{C}from"./chevron-up-BjM6KODw.js";const k=N,E=g,I=o.forwardRef(({className:t,children:s,...a},l)=>e.jsxs(n,{ref:l,className:r("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...a,children:[s,e.jsx(j,{asChild:!0,children:e.jsx(d,{className:"h-4 w-4 opacity-50"})})]}));I.displayName=n.displayName;const u=o.forwardRef(({className:t,...s},a)=>e.jsx(m,{ref:a,className:r("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(C,{className:"h-4 w-4"})}));u.displayName=m.displayName;const h=o.forwardRef(({className:t,...s},a)=>e.jsx(p,{ref:a,className:r("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(d,{className:"h-4 w-4"})}));h.displayName=p.displayName;const B=o.forwardRef(({className:t,children:s,position:a="popper",...l},w)=>e.jsx(b,{children:e.jsxs(i,{ref:w,className:r("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,...l,children:[e.jsx(u,{}),e.jsx(S,{className:r("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(h,{})]})}));B.displayName=i.displayName;const T=o.forwardRef(({className:t,...s},a)=>e.jsx(f,{ref:a,className:r("px-2 py-1.5 text-sm font-semibold",t),...s}));T.displayName=f.displayName;const V=o.forwardRef(({className:t,children:s,...a},l)=>e.jsxs(c,{ref:l,className:r("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(v,{children:e.jsx(y,{className:"h-4 w-4"})})}),e.jsx(R,{children:s})]}));V.displayName=c.displayName;const z=o.forwardRef(({className:t,...s},a)=>e.jsx(x,{ref:a,className:r("-mx-1 my-1 h-px bg-muted",t),...s}));z.displayName=x.displayName;export{k as S,I as a,E as b,B as c,V as d};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-C0uIENKu.js";/**
1
+ import{c as e}from"./index-BUPxY8PP.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as c,j as e,e as i}from"./index-C0uIENKu.js";const d=c.forwardRef(({className:s,onCheckedChange:r,onChange:t,...o},n)=>{const l=a=>{t?.(a),r?.(a.target.checked)};return e.jsxs("label",{className:i("relative inline-flex cursor-pointer",s),children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",onChange:l,ref:n,...o}),e.jsx("div",{className:"block bg-gray-300 w-9 h-5 rounded-full transition-colors duration-200 ease-in-out peer-checked:bg-blue-600"}),e.jsx("div",{className:"absolute left-0 top-0 bg-white w-4 h-4 rounded-full mt-0.5 ml-0.5 transition-transform duration-200 ease-in-out transform peer-checked:translate-x-4 shadow"})]})});d.displayName="Switch";export{d as S};
1
+ import{r as c,j as e,e as i}from"./index-BUPxY8PP.js";const d=c.forwardRef(({className:s,onCheckedChange:r,onChange:t,...o},n)=>{const l=a=>{t?.(a),r?.(a.target.checked)};return e.jsxs("label",{className:i("relative inline-flex cursor-pointer",s),children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",onChange:l,ref:n,...o}),e.jsx("div",{className:"block bg-gray-300 w-9 h-5 rounded-full transition-colors duration-200 ease-in-out peer-checked:bg-blue-600"}),e.jsx("div",{className:"absolute left-0 top-0 bg-white w-4 h-4 rounded-full mt-0.5 ml-0.5 transition-transform duration-200 ease-in-out transform peer-checked:translate-x-4 shadow"})]})});d.displayName="Switch";export{d as S};
@@ -1 +1 @@
1
- import{r as l,ap as F,aj as k,j as c,ak as $,b6 as D,an as g,bi as y,bk as V,bj as G,am as m,b8 as L,e as T}from"./index-C0uIENKu.js";var p="Tabs",[K,Q]=$(p,[y]),h=y(),[B,x]=K(p),N=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,onValueChange:i,defaultValue:d,orientation:n="horizontal",dir:u,activationMode:f="automatic",...v}=e,r=F(u),[s,b]=k({prop:o,onChange:i,defaultProp:d??"",caller:p});return c.jsx(B,{scope:t,baseId:D(),value:s,onValueChange:b,orientation:n,dir:r,activationMode:f,children:c.jsx(g.div,{dir:r,"data-orientation":n,...v,ref:a})})});N.displayName=p;var C="TabsList",j=l.forwardRef((e,a)=>{const{__scopeTabs:t,loop:o=!0,...i}=e,d=x(C,t),n=h(t);return c.jsx(V,{asChild:!0,...n,orientation:d.orientation,dir:d.dir,loop:o,children:c.jsx(g.div,{role:"tablist","aria-orientation":d.orientation,...i,ref:a})})});j.displayName=C;var I="TabsTrigger",R=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,disabled:i=!1,...d}=e,n=x(I,t),u=h(t),f=A(n.baseId,o),v=E(n.baseId,o),r=o===n.value;return c.jsx(G,{asChild:!0,...u,focusable:!i,active:r,children:c.jsx(g.button,{type:"button",role:"tab","aria-selected":r,"aria-controls":v,"data-state":r?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...d,ref:a,onMouseDown:m(e.onMouseDown,s=>{!i&&s.button===0&&s.ctrlKey===!1?n.onValueChange(o):s.preventDefault()}),onKeyDown:m(e.onKeyDown,s=>{[" ","Enter"].includes(s.key)&&n.onValueChange(o)}),onFocus:m(e.onFocus,()=>{const s=n.activationMode!=="manual";!r&&!i&&s&&n.onValueChange(o)})})})});R.displayName=I;var w="TabsContent",_=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,forceMount:i,children:d,...n}=e,u=x(w,t),f=A(u.baseId,o),v=E(u.baseId,o),r=o===u.value,s=l.useRef(r);return l.useEffect(()=>{const b=requestAnimationFrame(()=>s.current=!1);return()=>cancelAnimationFrame(b)},[]),c.jsx(L,{present:i||r,children:({present:b})=>c.jsx(g.div,{"data-state":r?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!b,id:v,tabIndex:0,...n,ref:a,style:{...e.style,animationDuration:s.current?"0s":void 0},children:b&&d})})});_.displayName=w;function A(e,a){return`${e}-trigger-${a}`}function E(e,a){return`${e}-content-${a}`}var q=N,S=j,M=R,P=_;const U=q,z=l.forwardRef(({className:e,...a},t)=>c.jsx(S,{ref:t,className:T("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...a}));z.displayName=S.displayName;const H=l.forwardRef(({className:e,...a},t)=>c.jsx(M,{ref:t,className:T("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...a}));H.displayName=M.displayName;const O=l.forwardRef(({className:e,...a},t)=>c.jsx(P,{ref:t,className:T("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...a}));O.displayName=P.displayName;export{U as T,z as a,H as b,O as c};
1
+ import{r as l,ap as F,aj as k,j as c,ak as $,b6 as D,an as g,bi as y,bk as V,bj as G,am as m,b8 as L,e as T}from"./index-BUPxY8PP.js";var p="Tabs",[K,Q]=$(p,[y]),h=y(),[B,x]=K(p),N=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,onValueChange:i,defaultValue:d,orientation:n="horizontal",dir:u,activationMode:f="automatic",...v}=e,r=F(u),[s,b]=k({prop:o,onChange:i,defaultProp:d??"",caller:p});return c.jsx(B,{scope:t,baseId:D(),value:s,onValueChange:b,orientation:n,dir:r,activationMode:f,children:c.jsx(g.div,{dir:r,"data-orientation":n,...v,ref:a})})});N.displayName=p;var C="TabsList",j=l.forwardRef((e,a)=>{const{__scopeTabs:t,loop:o=!0,...i}=e,d=x(C,t),n=h(t);return c.jsx(V,{asChild:!0,...n,orientation:d.orientation,dir:d.dir,loop:o,children:c.jsx(g.div,{role:"tablist","aria-orientation":d.orientation,...i,ref:a})})});j.displayName=C;var I="TabsTrigger",R=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,disabled:i=!1,...d}=e,n=x(I,t),u=h(t),f=A(n.baseId,o),v=E(n.baseId,o),r=o===n.value;return c.jsx(G,{asChild:!0,...u,focusable:!i,active:r,children:c.jsx(g.button,{type:"button",role:"tab","aria-selected":r,"aria-controls":v,"data-state":r?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...d,ref:a,onMouseDown:m(e.onMouseDown,s=>{!i&&s.button===0&&s.ctrlKey===!1?n.onValueChange(o):s.preventDefault()}),onKeyDown:m(e.onKeyDown,s=>{[" ","Enter"].includes(s.key)&&n.onValueChange(o)}),onFocus:m(e.onFocus,()=>{const s=n.activationMode!=="manual";!r&&!i&&s&&n.onValueChange(o)})})})});R.displayName=I;var w="TabsContent",_=l.forwardRef((e,a)=>{const{__scopeTabs:t,value:o,forceMount:i,children:d,...n}=e,u=x(w,t),f=A(u.baseId,o),v=E(u.baseId,o),r=o===u.value,s=l.useRef(r);return l.useEffect(()=>{const b=requestAnimationFrame(()=>s.current=!1);return()=>cancelAnimationFrame(b)},[]),c.jsx(L,{present:i||r,children:({present:b})=>c.jsx(g.div,{"data-state":r?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!b,id:v,tabIndex:0,...n,ref:a,style:{...e.style,animationDuration:s.current?"0s":void 0},children:b&&d})})});_.displayName=w;function A(e,a){return`${e}-trigger-${a}`}function E(e,a){return`${e}-content-${a}`}var q=N,S=j,M=R,P=_;const U=q,z=l.forwardRef(({className:e,...a},t)=>c.jsx(S,{ref:t,className:T("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...a}));z.displayName=S.displayName;const H=l.forwardRef(({className:e,...a},t)=>c.jsx(M,{ref:t,className:T("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...a}));H.displayName=M.displayName;const O=l.forwardRef(({className:e,...a},t)=>c.jsx(P,{ref:t,className:T("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...a}));O.displayName=P.displayName;export{U as T,z as a,H as b,O as c};
@@ -1,4 +1,4 @@
1
- import{c}from"./index-C0uIENKu.js";/**
1
+ import{c}from"./index-BUPxY8PP.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as t,a7 as M,j as m}from"./index-C0uIENKu.js";import{x as T,a as k}from"./xterm-DTxiCjtJ.js";function B(n){if(!n||typeof n!="object")return!1;const i=n,u=i.type==="snapshot"||i.type==="data",l=i.data===void 0||typeof i.data=="string";return u&&l}function N({sessionId:n,className:i,heightPx:u=160,maxScrollback:l=200}){const b=t.useRef(null),v=t.useRef(null),w=t.useRef(null),x=t.useRef(null),[R,S]=t.useState(!0),c=t.useRef([]),a=t.useRef(null);return t.useEffect(()=>{const o=b.current;if(!o||!n)return;const e=new T.Terminal({disableStdin:!0,cursorBlink:!1,convertEol:!0,scrollback:Math.max(50,Math.min(l,1e3)),fontSize:12,fontFamily:"'IBM Plex Mono', 'Source Code Pro', 'Fira Code', ui-monospace, Menlo, Monaco, monospace",lineHeight:1.25,letterSpacing:.3,theme:{background:"#1a1b26",foreground:"#c0caf5",cursor:"#c0caf5",selectionBackground:"#33467c",black:"#15161e",red:"#f7768e",green:"#9ece6a",yellow:"#e0af68",blue:"#7aa2f7",magenta:"#bb9af7",cyan:"#7dcfff",white:"#a9b1d6",brightBlack:"#414868",brightRed:"#f7768e",brightGreen:"#9ece6a",brightYellow:"#e0af68",brightBlue:"#7aa2f7",brightMagenta:"#bb9af7",brightCyan:"#7dcfff",brightWhite:"#c0caf5"}}),h=new k.FitAddon;e.loadAddon(h),e.open(o),o.style.height=`${u}px`,v.current=e,w.current=h;const f=()=>{try{const r=o.getBoundingClientRect();r.width>8&&r.height>8&&e.element&&h.fit()}catch{}},j=setTimeout(()=>f(),100),p=new ResizeObserver(()=>f());p.observe(o);const y=()=>{document.visibilityState==="visible"&&setTimeout(f,50)};document.addEventListener("visibilitychange",y);const d=new WebSocket(`${M}/ws/terminal-preview/${n}`);x.current=d,d.onopen=()=>S(!1);const E=()=>{a.current=null;const r=c.current;if(r.length){c.current=[];try{e.write(r.join(""))}catch{}}},F=()=>{a.current===null&&(a.current=requestAnimationFrame(E))};return d.onmessage=r=>{let g;try{g=JSON.parse(r.data)}catch{return}if(!B(g))return;const s=g;if(s?.type==="snapshot"){if(e.reset(),c.current=[],s.data)try{e.write(s.data)}catch{}f()}else s?.type==="data"&&s.data&&(c.current.push(String(s.data)),F())},()=>{clearTimeout(j),p.disconnect(),document.removeEventListener("visibilitychange",y);try{d.close()}catch{}a.current!==null&&cancelAnimationFrame(a.current),a.current=null,c.current=[],e.dispose()}},[n,u,l]),m.jsxs("div",{className:`relative w-full ${i||""}`.trim(),children:[R&&m.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-50/60 z-10",children:m.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading preview…"})}),m.jsx("div",{ref:b,className:"border border-muted rounded overflow-hidden"})]})}export{N as T};
1
+ import{r as t,a7 as M,j as m}from"./index-BUPxY8PP.js";import{x as T,a as k}from"./xterm-DTxiCjtJ.js";function B(n){if(!n||typeof n!="object")return!1;const i=n,u=i.type==="snapshot"||i.type==="data",l=i.data===void 0||typeof i.data=="string";return u&&l}function N({sessionId:n,className:i,heightPx:u=160,maxScrollback:l=200}){const b=t.useRef(null),v=t.useRef(null),w=t.useRef(null),x=t.useRef(null),[R,S]=t.useState(!0),c=t.useRef([]),a=t.useRef(null);return t.useEffect(()=>{const o=b.current;if(!o||!n)return;const e=new T.Terminal({disableStdin:!0,cursorBlink:!1,convertEol:!0,scrollback:Math.max(50,Math.min(l,1e3)),fontSize:12,fontFamily:"'IBM Plex Mono', 'Source Code Pro', 'Fira Code', ui-monospace, Menlo, Monaco, monospace",lineHeight:1.25,letterSpacing:.3,theme:{background:"#1a1b26",foreground:"#c0caf5",cursor:"#c0caf5",selectionBackground:"#33467c",black:"#15161e",red:"#f7768e",green:"#9ece6a",yellow:"#e0af68",blue:"#7aa2f7",magenta:"#bb9af7",cyan:"#7dcfff",white:"#a9b1d6",brightBlack:"#414868",brightRed:"#f7768e",brightGreen:"#9ece6a",brightYellow:"#e0af68",brightBlue:"#7aa2f7",brightMagenta:"#bb9af7",brightCyan:"#7dcfff",brightWhite:"#c0caf5"}}),h=new k.FitAddon;e.loadAddon(h),e.open(o),o.style.height=`${u}px`,v.current=e,w.current=h;const f=()=>{try{const r=o.getBoundingClientRect();r.width>8&&r.height>8&&e.element&&h.fit()}catch{}},j=setTimeout(()=>f(),100),p=new ResizeObserver(()=>f());p.observe(o);const y=()=>{document.visibilityState==="visible"&&setTimeout(f,50)};document.addEventListener("visibilitychange",y);const d=new WebSocket(`${M}/ws/terminal-preview/${n}`);x.current=d,d.onopen=()=>S(!1);const E=()=>{a.current=null;const r=c.current;if(r.length){c.current=[];try{e.write(r.join(""))}catch{}}},F=()=>{a.current===null&&(a.current=requestAnimationFrame(E))};return d.onmessage=r=>{let g;try{g=JSON.parse(r.data)}catch{return}if(!B(g))return;const s=g;if(s?.type==="snapshot"){if(e.reset(),c.current=[],s.data)try{e.write(s.data)}catch{}f()}else s?.type==="data"&&s.data&&(c.current.push(String(s.data)),F())},()=>{clearTimeout(j),p.disconnect(),document.removeEventListener("visibilitychange",y);try{d.close()}catch{}a.current!==null&&cancelAnimationFrame(a.current),a.current=null,c.current=[],e.dispose()}},[n,u,l]),m.jsxs("div",{className:`relative w-full ${i||""}`.trim(),children:[R&&m.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-50/60 z-10",children:m.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading preview…"})}),m.jsx("div",{ref:b,className:"border border-muted rounded overflow-hidden"})]})}export{N as T};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-C0uIENKu.js";/**
1
+ import{c as e}from"./index-BUPxY8PP.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as i,ag as v,A as f}from"./index-C0uIENKu.js";function j(){const[y,p]=i.useState([]),[m,c]=i.useState(!1),[d,o]=i.useState(null),{refresh:w}=v(),S=i.useCallback(async(s,n)=>{try{c(!0),o(null);const e=await fetch(`${f}/api/v1/terminal/${s}/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({startupCommand:n})});if(!e.ok){const t=await e.json();throw new Error(t.error||"Failed to create terminal session")}const r=await e.json();return await w(),r.sessionId}catch(e){const r=e instanceof Error?e.message:"Unknown error";return o(r),null}finally{c(!1)}},[w]),g=i.useCallback(async s=>{try{c(!0),o(null);let n;if(s.startsWith("session-")){const r=s.split("-");n=`${r[0]}-${r[1]}`}else{const r=s.split("-");n=`${r[0]}-${r[1]}`}const e=await fetch(`${f}/api/v1/terminal/${n}/destroy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s})});if(!e.ok){const r=await e.json();throw new Error(r.error||"Failed to destroy terminal session")}return p(r=>r.filter(t=>t.id!==s)),await w(),!0}catch(n){const e=n instanceof Error?n.message:"Unknown error";return o(e),!1}finally{c(!1)}},[w]),$=i.useCallback(async(s,n,e)=>{try{o(null);let r;if(s.startsWith("session-")){const a=s.split("-");r=`${a[0]}-${a[1]}`}else{const a=s.split("-");r=`${a[0]}-${a[1]}`}const t=await fetch(`${f}/api/v1/terminal/${r}/resize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s,cols:n,rows:e})});if(!t.ok){const a=await t.json();throw new Error(a.error||"Failed to resize terminal session")}return!0}catch(r){const t=r instanceof Error?r.message:"Unknown error";return o(t),!1}},[]),k=i.useCallback(async(s,n,e)=>{try{c(!0),o(null);const r=new URLSearchParams;s&&r.set("taskId",s),n&&(r.set("withPreview","true"),e&&Number.isFinite(e)&&r.set("lines",String(e)));const t=`${f}/api/v1/terminal/sessions${r.toString()?`?${r.toString()}`:""}`,a=await fetch(t);if(!a.ok){const l=await a.json();throw new Error(l.error||"Failed to fetch terminal sessions")}const u=await a.json();p(u.sessions)}catch(r){const t=r instanceof Error?r.message:"Unknown error";o(t)}finally{c(!1)}},[]),E=i.useCallback(async(s,n=8)=>{try{o(null);const e=new URLSearchParams;e.set("sessionId",s),e.set("withPreview","true"),e.set("lines",String(n)),e.set("colorize","true");const r=`${f}/api/v1/terminal/sessions?${e.toString()}`,t=await fetch(r);if(!t.ok){const l=await t.json().catch(()=>({}));throw new Error(l.error||"Failed to fetch preview")}const a=await t.json(),u=Array.isArray(a?.sessions)&&a.sessions[0]?.preview?a.sessions[0].preview:[];return p(l=>l.map(h=>h.id===s?{...h,preview:u}:h)),u}catch(e){const r=e instanceof Error?e.message:"Unknown error";return o(r),[]}},[]);return{sessions:y,loading:m,error:d,createSession:S,destroySession:g,resizeSession:$,refreshSessions:k,fetchPreview:E}}export{j as u};
1
+ import{r as i,ag as v,A as f}from"./index-BUPxY8PP.js";function j(){const[y,p]=i.useState([]),[m,c]=i.useState(!1),[d,o]=i.useState(null),{refresh:w}=v(),S=i.useCallback(async(s,n)=>{try{c(!0),o(null);const e=await fetch(`${f}/api/v1/terminal/${s}/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({startupCommand:n})});if(!e.ok){const t=await e.json();throw new Error(t.error||"Failed to create terminal session")}const r=await e.json();return await w(),r.sessionId}catch(e){const r=e instanceof Error?e.message:"Unknown error";return o(r),null}finally{c(!1)}},[w]),g=i.useCallback(async s=>{try{c(!0),o(null);let n;if(s.startsWith("session-")){const r=s.split("-");n=`${r[0]}-${r[1]}`}else{const r=s.split("-");n=`${r[0]}-${r[1]}`}const e=await fetch(`${f}/api/v1/terminal/${n}/destroy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s})});if(!e.ok){const r=await e.json();throw new Error(r.error||"Failed to destroy terminal session")}return p(r=>r.filter(t=>t.id!==s)),await w(),!0}catch(n){const e=n instanceof Error?n.message:"Unknown error";return o(e),!1}finally{c(!1)}},[w]),$=i.useCallback(async(s,n,e)=>{try{o(null);let r;if(s.startsWith("session-")){const a=s.split("-");r=`${a[0]}-${a[1]}`}else{const a=s.split("-");r=`${a[0]}-${a[1]}`}const t=await fetch(`${f}/api/v1/terminal/${r}/resize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:s,cols:n,rows:e})});if(!t.ok){const a=await t.json();throw new Error(a.error||"Failed to resize terminal session")}return!0}catch(r){const t=r instanceof Error?r.message:"Unknown error";return o(t),!1}},[]),k=i.useCallback(async(s,n,e)=>{try{c(!0),o(null);const r=new URLSearchParams;s&&r.set("taskId",s),n&&(r.set("withPreview","true"),e&&Number.isFinite(e)&&r.set("lines",String(e)));const t=`${f}/api/v1/terminal/sessions${r.toString()?`?${r.toString()}`:""}`,a=await fetch(t);if(!a.ok){const l=await a.json();throw new Error(l.error||"Failed to fetch terminal sessions")}const u=await a.json();p(u.sessions)}catch(r){const t=r instanceof Error?r.message:"Unknown error";o(t)}finally{c(!1)}},[]),E=i.useCallback(async(s,n=8)=>{try{o(null);const e=new URLSearchParams;e.set("sessionId",s),e.set("withPreview","true"),e.set("lines",String(n)),e.set("colorize","true");const r=`${f}/api/v1/terminal/sessions?${e.toString()}`,t=await fetch(r);if(!t.ok){const l=await t.json().catch(()=>({}));throw new Error(l.error||"Failed to fetch preview")}const a=await t.json(),u=Array.isArray(a?.sessions)&&a.sessions[0]?.preview?a.sessions[0].preview:[];return p(l=>l.map(h=>h.id===s?{...h,preview:u}:h)),u}catch(e){const r=e instanceof Error?e.message:"Unknown error";return o(r),[]}},[]);return{sessions:y,loading:m,error:d,createSession:S,destroySession:g,resizeSession:$,refreshSessions:k,fetchPreview:E}}export{j as u};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-C0uIENKu.js";/**
1
+ import{c as e}from"./index-BUPxY8PP.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
package/static/index.html CHANGED
@@ -8,7 +8,7 @@
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
10
10
  <title>Coconut - Agentic Development Environment</title>
11
- <script type="module" crossorigin src="/assets/index-C0uIENKu.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-BUPxY8PP.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-DVMcu9sQ.css">
13
13
  </head>
14
14
  <body class="font-inter">
@@ -1,26 +0,0 @@
1
- /**
2
- * Control-plane → coconut M2M (machine-to-machine) runtime config.
3
- *
4
- * The control plane mints Clerk M2M JWTs carrying a `coconut_id` claim and
5
- * sends them as `Authorization: Bearer <jwt>` to coconut VMs. The coconut
6
- * verifies the signature against Clerk's JWKS (same one used for user OAuth
7
- * login), enforces the standard issuer, and — crucially — asserts that the
8
- * token's `coconut_id` claim equals THIS coconut's ID. That claim is the
9
- * isolation guarantee: a token minted for coconut A must be rejected by
10
- * coconut B.
11
- *
12
- * This runtime cache is populated at server startup from `resolveCoconutId()`
13
- * (which reads env → `.nut/config.json`). If no ID is resolvable, M2M auth
14
- * stays disabled and the Bearer chain falls through to existing paths. The
15
- * whole mechanism is purely additive: existing cookie / API-key / OAuth-user
16
- * flows are unaffected.
17
- *
18
- * Kept separate from `OAuthRuntimeConfig` because the verification rules
19
- * differ (audience vs. custom claim) and conflating them risks security bugs.
20
- */
21
- export interface M2MRuntimeConfig {
22
- enabled: boolean;
23
- coconutId?: string;
24
- }
25
- export declare function setM2MRuntimeConfig(config: M2MRuntimeConfig): void;
26
- export declare function getM2MRuntimeConfig(): M2MRuntimeConfig;
@@ -1,27 +0,0 @@
1
- /**
2
- * Control-plane → coconut M2M (machine-to-machine) runtime config.
3
- *
4
- * The control plane mints Clerk M2M JWTs carrying a `coconut_id` claim and
5
- * sends them as `Authorization: Bearer <jwt>` to coconut VMs. The coconut
6
- * verifies the signature against Clerk's JWKS (same one used for user OAuth
7
- * login), enforces the standard issuer, and — crucially — asserts that the
8
- * token's `coconut_id` claim equals THIS coconut's ID. That claim is the
9
- * isolation guarantee: a token minted for coconut A must be rejected by
10
- * coconut B.
11
- *
12
- * This runtime cache is populated at server startup from `resolveCoconutId()`
13
- * (which reads env → `.nut/config.json`). If no ID is resolvable, M2M auth
14
- * stays disabled and the Bearer chain falls through to existing paths. The
15
- * whole mechanism is purely additive: existing cookie / API-key / OAuth-user
16
- * flows are unaffected.
17
- *
18
- * Kept separate from `OAuthRuntimeConfig` because the verification rules
19
- * differ (audience vs. custom claim) and conflating them risks security bugs.
20
- */
21
- let runtimeConfig = { enabled: false };
22
- export function setM2MRuntimeConfig(config) {
23
- runtimeConfig = config;
24
- }
25
- export function getM2MRuntimeConfig() {
26
- return runtimeConfig;
27
- }
@@ -1,34 +0,0 @@
1
- import { jwtVerify, type JWTPayload } from 'jose';
2
- /**
3
- * Clerk M2M (control-plane → coconut) JWT verification.
4
- *
5
- * Differs from `verifyClerkToken` (user OIDC login) in three ways:
6
- * 1. No audience enforcement — Clerk M2M tokens don't carry the coconut's
7
- * OAuth client_id as audience; they're minted from the control plane's
8
- * machine secret with different audience conventions.
9
- * 2. Requires a custom `coconut_id` claim that must equal THIS coconut's
10
- * ID. This is the per-tenant isolation guarantee: a token minted for
11
- * coconut A is signed by the same tenant's keys as coconut B's tokens,
12
- * so the only thing keeping B from accepting A's token is this claim.
13
- * 3. Keeps JWKS separate from the OAuth verifier's instance for cleaner
14
- * test isolation, though both instances point at the same JWKS URL.
15
- *
16
- * Returns the verified payload on success, `null` on any failure. The
17
- * failure reason is logged (same pattern as the OAuth verifier) so 401s
18
- * are diagnosable in prod without adding debug endpoints.
19
- */
20
- type JwksKeyFn = Parameters<typeof jwtVerify>[1];
21
- export interface M2MVerifyResult {
22
- payload: JWTPayload & {
23
- coconut_id: string;
24
- };
25
- }
26
- export declare function verifyCoconutM2MToken(token: string, options: {
27
- expectedCoconutId: string;
28
- }): Promise<M2MVerifyResult | null>;
29
- /**
30
- * Test-only: inject a custom JWKS key function (e.g. `jose.createLocalJWKSet`
31
- * backed by a generated keypair) so middleware tests don't hit the network.
32
- */
33
- export declare function __setClerkM2MJwksForTests(jwks: JwksKeyFn | null): void;
34
- export {};
@@ -1,47 +0,0 @@
1
- import { createRemoteJWKSet, jwtVerify } from 'jose';
2
- import { CLERK_ISSUER, CLERK_JWKS_URL } from '../../config/oauth.js';
3
- let jwksInstance = null;
4
- function getJwks() {
5
- if (!jwksInstance) {
6
- jwksInstance = createRemoteJWKSet(new URL(CLERK_JWKS_URL));
7
- }
8
- return jwksInstance;
9
- }
10
- export async function verifyCoconutM2MToken(token, options) {
11
- try {
12
- const jwks = getJwks();
13
- const verifyOptions = {
14
- issuer: CLERK_ISSUER,
15
- };
16
- const { payload } = await jwtVerify(token, jwks, verifyOptions);
17
- const claim = payload.coconut_id;
18
- if (typeof claim !== 'string' || claim.length === 0) {
19
- console.warn('[clerk-m2m-verifier] Token rejected: missing coconut_id claim');
20
- return null;
21
- }
22
- if (claim !== options.expectedCoconutId) {
23
- // Log without leaking either ID at full length — prefix-only keeps
24
- // logs useful for triage without exposing tenant identifiers.
25
- const prefix = (s) => s.slice(0, 8);
26
- console.warn(`[clerk-m2m-verifier] Token rejected: coconut_id mismatch ` +
27
- `(token=${prefix(claim)}… expected=${prefix(options.expectedCoconutId)}…)`);
28
- return null;
29
- }
30
- return { payload: payload };
31
- }
32
- catch (err) {
33
- const e = err;
34
- const reason = e.code
35
- ? `${e.code}${e.claim ? ` (claim: ${e.claim})` : ''}`
36
- : e.message || 'unknown error';
37
- console.warn(`[clerk-m2m-verifier] Token verification failed: ${reason}`);
38
- return null;
39
- }
40
- }
41
- /**
42
- * Test-only: inject a custom JWKS key function (e.g. `jose.createLocalJWKSet`
43
- * backed by a generated keypair) so middleware tests don't hit the network.
44
- */
45
- export function __setClerkM2MJwksForTests(jwks) {
46
- jwksInstance = jwks;
47
- }