@recombine-ai/platform 0.11.2 → 0.12.0

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 (160) hide show
  1. package/build/bosun/index.d.ts +2 -2
  2. package/build/bosun/index.d.ts.map +1 -1
  3. package/build/bosun/interfaces/agent.d.ts +7 -0
  4. package/build/bosun/interfaces/agent.d.ts.map +1 -1
  5. package/build/bosun/interfaces/project.d.ts +6 -0
  6. package/build/bosun/interfaces/project.d.ts.map +1 -1
  7. package/build/bosun-app/backend/server.js +7076 -6658
  8. package/build/bosun-app/backend/server.js.map +4 -4
  9. package/build/bosun-app/frontend/client/_app/immutable/chunks/{DGqwi6rZ.js → BA_s3vf-.js} +1 -1
  10. package/build/bosun-app/frontend/client/_app/immutable/chunks/BA_s3vf-.js.br +0 -0
  11. package/build/bosun-app/frontend/client/_app/immutable/chunks/BA_s3vf-.js.gz +0 -0
  12. package/build/bosun-app/frontend/client/_app/immutable/chunks/{CjkTW30g.js → BDj12791.js} +1 -1
  13. package/build/bosun-app/frontend/client/_app/immutable/chunks/BDj12791.js.br +0 -0
  14. package/build/bosun-app/frontend/client/_app/immutable/chunks/BDj12791.js.gz +0 -0
  15. package/build/bosun-app/frontend/client/_app/immutable/chunks/{DVqcTvSV.js → BundM1xT.js} +1 -1
  16. package/build/bosun-app/frontend/client/_app/immutable/chunks/BundM1xT.js.br +0 -0
  17. package/build/bosun-app/frontend/client/_app/immutable/chunks/BundM1xT.js.gz +0 -0
  18. package/build/bosun-app/frontend/client/_app/immutable/chunks/CWrb40J2.js +1 -0
  19. package/build/bosun-app/frontend/client/_app/immutable/chunks/CWrb40J2.js.br +0 -0
  20. package/build/bosun-app/frontend/client/_app/immutable/chunks/CWrb40J2.js.gz +0 -0
  21. package/build/bosun-app/frontend/client/_app/immutable/chunks/DaPi9zoH.js +3 -0
  22. package/build/bosun-app/frontend/client/_app/immutable/chunks/DaPi9zoH.js.br +0 -0
  23. package/build/bosun-app/frontend/client/_app/immutable/chunks/DaPi9zoH.js.gz +0 -0
  24. package/build/bosun-app/frontend/client/_app/immutable/chunks/{DiNgE43O.js → hHPtUt6H.js} +1 -1
  25. package/build/bosun-app/frontend/client/_app/immutable/chunks/hHPtUt6H.js.br +0 -0
  26. package/build/bosun-app/frontend/client/_app/immutable/chunks/hHPtUt6H.js.gz +0 -0
  27. package/build/bosun-app/frontend/client/_app/immutable/entry/{app.rHjbMnFc.js → app.DEGfM7JG.js} +2 -2
  28. package/build/bosun-app/frontend/client/_app/immutable/entry/app.DEGfM7JG.js.br +0 -0
  29. package/build/bosun-app/frontend/client/_app/immutable/entry/app.DEGfM7JG.js.gz +0 -0
  30. package/build/bosun-app/frontend/client/_app/immutable/entry/start.D2Q-9wJB.js +1 -0
  31. package/build/bosun-app/frontend/client/_app/immutable/entry/start.D2Q-9wJB.js.br +0 -0
  32. package/build/bosun-app/frontend/client/_app/immutable/entry/start.D2Q-9wJB.js.gz +0 -0
  33. package/build/bosun-app/frontend/client/_app/immutable/nodes/{0.CffmfeCN.js → 0.D4hVCSQO.js} +1 -1
  34. package/build/bosun-app/frontend/client/_app/immutable/nodes/0.D4hVCSQO.js.br +0 -0
  35. package/build/bosun-app/frontend/client/_app/immutable/nodes/0.D4hVCSQO.js.gz +0 -0
  36. package/build/bosun-app/frontend/client/_app/immutable/nodes/{1.CmX_nRov.js → 1.exu_SEtw.js} +1 -1
  37. package/build/bosun-app/frontend/client/_app/immutable/nodes/1.exu_SEtw.js.br +0 -0
  38. package/build/bosun-app/frontend/client/_app/immutable/nodes/1.exu_SEtw.js.gz +0 -0
  39. package/build/bosun-app/frontend/client/_app/immutable/nodes/{10.BwODd0ab.js → 10.D9EOZOcA.js} +1 -1
  40. package/build/bosun-app/frontend/client/_app/immutable/nodes/10.D9EOZOcA.js.br +0 -0
  41. package/build/bosun-app/frontend/client/_app/immutable/nodes/10.D9EOZOcA.js.gz +0 -0
  42. package/build/bosun-app/frontend/client/_app/immutable/nodes/{17.BxiBPC57.js → 17.BBzzkhS3.js} +1 -1
  43. package/build/bosun-app/frontend/client/_app/immutable/nodes/17.BBzzkhS3.js.br +0 -0
  44. package/build/bosun-app/frontend/client/_app/immutable/nodes/17.BBzzkhS3.js.gz +0 -0
  45. package/build/bosun-app/frontend/client/_app/immutable/nodes/{18.fUMviTUO.js → 18.C1Wu7YII.js} +1 -1
  46. package/build/bosun-app/frontend/client/_app/immutable/nodes/18.C1Wu7YII.js.br +0 -0
  47. package/build/bosun-app/frontend/client/_app/immutable/nodes/18.C1Wu7YII.js.gz +0 -0
  48. package/build/bosun-app/frontend/client/_app/immutable/nodes/2.K_wNLkOy.js +35 -0
  49. package/build/bosun-app/frontend/client/_app/immutable/nodes/2.K_wNLkOy.js.br +0 -0
  50. package/build/bosun-app/frontend/client/_app/immutable/nodes/2.K_wNLkOy.js.gz +0 -0
  51. package/build/bosun-app/frontend/client/_app/immutable/nodes/{3.BpSGVLcf.js → 3.DC1YtH2n.js} +1 -1
  52. package/build/bosun-app/frontend/client/_app/immutable/nodes/3.DC1YtH2n.js.br +0 -0
  53. package/build/bosun-app/frontend/client/_app/immutable/nodes/3.DC1YtH2n.js.gz +0 -0
  54. package/build/bosun-app/frontend/client/_app/immutable/nodes/{4.BmcqYasy.js → 4.DjofsVgf.js} +1 -1
  55. package/build/bosun-app/frontend/client/_app/immutable/nodes/4.DjofsVgf.js.br +0 -0
  56. package/build/bosun-app/frontend/client/_app/immutable/nodes/4.DjofsVgf.js.gz +0 -0
  57. package/build/bosun-app/frontend/client/_app/immutable/nodes/{5.DXFquMVj.js → 5.Daft73xD.js} +1 -1
  58. package/build/bosun-app/frontend/client/_app/immutable/nodes/5.Daft73xD.js.br +0 -0
  59. package/build/bosun-app/frontend/client/_app/immutable/nodes/5.Daft73xD.js.gz +0 -0
  60. package/build/bosun-app/frontend/client/_app/immutable/nodes/{6.WMxmoB8u.js → 6.BC5i16hF.js} +1 -1
  61. package/build/bosun-app/frontend/client/_app/immutable/nodes/6.BC5i16hF.js.br +0 -0
  62. package/build/bosun-app/frontend/client/_app/immutable/nodes/6.BC5i16hF.js.gz +0 -0
  63. package/build/bosun-app/frontend/client/_app/immutable/nodes/{8.DN7-_OgI.js → 8.BD-2mMOE.js} +1 -1
  64. package/build/bosun-app/frontend/client/_app/immutable/nodes/8.BD-2mMOE.js.br +0 -0
  65. package/build/bosun-app/frontend/client/_app/immutable/nodes/8.BD-2mMOE.js.gz +0 -0
  66. package/build/bosun-app/frontend/client/_app/immutable/nodes/9.DStZMtBP.js +2 -0
  67. package/build/bosun-app/frontend/client/_app/immutable/nodes/9.DStZMtBP.js.br +0 -0
  68. package/build/bosun-app/frontend/client/_app/immutable/nodes/9.DStZMtBP.js.gz +0 -0
  69. package/build/bosun-app/frontend/client/_app/version.json +1 -1
  70. package/build/bosun-app/frontend/client/_app/version.json.br +0 -0
  71. package/build/bosun-app/frontend/client/_app/version.json.gz +0 -0
  72. package/build/bosun-app/frontend/handler.js +4 -4
  73. package/build/bosun-app/frontend/index.js +4 -4
  74. package/build/bosun-app/frontend/server/chunks/chunks/{internal.js-B9o0piPQ.js → internal.js-B2-81-og.js} +2 -2
  75. package/build/bosun-app/frontend/server/chunks/chunks/{internal.js-B9o0piPQ.js.map → internal.js-B2-81-og.js.map} +1 -1
  76. package/build/bosun-app/frontend/server/chunks/chunks/{log-content.svelte.js-C6EzbHLC.js → log-content.svelte.js-NCi6Gu4g.js} +6 -3
  77. package/build/bosun-app/frontend/server/chunks/chunks/log-content.svelte.js-NCi6Gu4g.js.map +1 -0
  78. package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/{_layout.svelte.js-B2wHKJV7.js → _layout.svelte.js-bpxxSpHz.js} +76 -5
  79. package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/_layout.svelte.js-bpxxSpHz.js.map +1 -0
  80. package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/roleplay/{_page.svelte.js-DDcIjgZD.js → _page.svelte.js-aRz73jD-.js} +58 -18
  81. package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/roleplay/_page.svelte.js-aRz73jD-.js.map +1 -0
  82. package/build/bosun-app/frontend/server/chunks/{handler-CfBVe8pc.js → handler-C5nNwvq2.js} +3 -3
  83. package/build/bosun-app/frontend/server/chunks/{handler-CfBVe8pc.js.map → handler-C5nNwvq2.js.map} +1 -1
  84. package/build/bosun-app/frontend/server/chunks/{index.js-ve0cVNqU.js → index.js-OQig22wo.js} +2 -2
  85. package/build/bosun-app/frontend/server/chunks/{index.js-ve0cVNqU.js.map → index.js-OQig22wo.js.map} +1 -1
  86. package/build/bosun-app/frontend/server/chunks/{manifest.js-BQtoc_eZ.js → manifest.js-mMK7bnzv.js} +14 -14
  87. package/build/bosun-app/frontend/server/chunks/{manifest.js-BQtoc_eZ.js.map → manifest.js-mMK7bnzv.js.map} +1 -1
  88. package/build/bosun-app/frontend/server/chunks/nodes/{0.js-BvF-NlS2.js → 0.js-DHGYS99S.js} +2 -2
  89. package/build/bosun-app/frontend/server/chunks/nodes/{0.js-BvF-NlS2.js.map → 0.js-DHGYS99S.js.map} +1 -1
  90. package/build/bosun-app/frontend/server/chunks/nodes/{1.js-Bymq1A1s.js → 1.js-Bcf6Apx5.js} +2 -2
  91. package/build/bosun-app/frontend/server/chunks/nodes/{1.js-Bymq1A1s.js.map → 1.js-Bcf6Apx5.js.map} +1 -1
  92. package/build/bosun-app/frontend/server/chunks/nodes/{10.js-B5EUlAGJ.js → 10.js-DrOSxSqp.js} +2 -2
  93. package/build/bosun-app/frontend/server/chunks/nodes/{10.js-B5EUlAGJ.js.map → 10.js-DrOSxSqp.js.map} +1 -1
  94. package/build/bosun-app/frontend/server/chunks/nodes/{17.js-BMWgwZ_e.js → 17.js-CI2KQfFS.js} +2 -2
  95. package/build/bosun-app/frontend/server/chunks/nodes/{17.js-BMWgwZ_e.js.map → 17.js-CI2KQfFS.js.map} +1 -1
  96. package/build/bosun-app/frontend/server/chunks/nodes/{18.js-CVZTrZNt.js → 18.js-BrwBD9MG.js} +2 -2
  97. package/build/bosun-app/frontend/server/chunks/nodes/{18.js-CVZTrZNt.js.map → 18.js-BrwBD9MG.js.map} +1 -1
  98. package/build/bosun-app/frontend/server/chunks/nodes/{2.js-CRAy3ydl.js → 2.js-CGziSbJs.js} +3 -3
  99. package/build/bosun-app/frontend/server/chunks/nodes/{2.js-CRAy3ydl.js.map → 2.js-CGziSbJs.js.map} +1 -1
  100. package/build/bosun-app/frontend/server/chunks/nodes/{3.js-CUE-Y7gE.js → 3.js-jXjzl_HM.js} +2 -2
  101. package/build/bosun-app/frontend/server/chunks/nodes/{3.js-CUE-Y7gE.js.map → 3.js-jXjzl_HM.js.map} +1 -1
  102. package/build/bosun-app/frontend/server/chunks/nodes/{4.js-C7XtMBCk.js → 4.js-DHb154Fk.js} +2 -2
  103. package/build/bosun-app/frontend/server/chunks/nodes/{4.js-C7XtMBCk.js.map → 4.js-DHb154Fk.js.map} +1 -1
  104. package/build/bosun-app/frontend/server/chunks/nodes/{5.js-D4_PnZHP.js → 5.js-DncWCDEN.js} +2 -2
  105. package/build/bosun-app/frontend/server/chunks/nodes/{5.js-D4_PnZHP.js.map → 5.js-DncWCDEN.js.map} +1 -1
  106. package/build/bosun-app/frontend/server/chunks/nodes/{6.js-BjqcswgO.js → 6.js-DDVvJCgQ.js} +2 -2
  107. package/build/bosun-app/frontend/server/chunks/nodes/{6.js-BjqcswgO.js.map → 6.js-DDVvJCgQ.js.map} +1 -1
  108. package/build/bosun-app/frontend/server/chunks/nodes/{8.js-BYf2Dqth.js → 8.js-DQx6ZWZj.js} +2 -2
  109. package/build/bosun-app/frontend/server/chunks/nodes/{8.js-BYf2Dqth.js.map → 8.js-DQx6ZWZj.js.map} +1 -1
  110. package/build/bosun-app/frontend/server/chunks/nodes/{9.js-BumKWgh1.js → 9.js-CWugbQHv.js} +3 -3
  111. package/build/bosun-app/frontend/server/chunks/nodes/{9.js-BumKWgh1.js.map → 9.js-CWugbQHv.js.map} +1 -1
  112. package/package.json +1 -1
  113. package/build/bosun-app/frontend/client/_app/immutable/chunks/CjkTW30g.js.br +0 -2
  114. package/build/bosun-app/frontend/client/_app/immutable/chunks/CjkTW30g.js.gz +0 -0
  115. package/build/bosun-app/frontend/client/_app/immutable/chunks/D9OWCkdk.js +0 -3
  116. package/build/bosun-app/frontend/client/_app/immutable/chunks/D9OWCkdk.js.br +0 -0
  117. package/build/bosun-app/frontend/client/_app/immutable/chunks/D9OWCkdk.js.gz +0 -0
  118. package/build/bosun-app/frontend/client/_app/immutable/chunks/DGqwi6rZ.js.br +0 -0
  119. package/build/bosun-app/frontend/client/_app/immutable/chunks/DGqwi6rZ.js.gz +0 -0
  120. package/build/bosun-app/frontend/client/_app/immutable/chunks/DVqcTvSV.js.br +0 -0
  121. package/build/bosun-app/frontend/client/_app/immutable/chunks/DVqcTvSV.js.gz +0 -0
  122. package/build/bosun-app/frontend/client/_app/immutable/chunks/DiNgE43O.js.br +0 -0
  123. package/build/bosun-app/frontend/client/_app/immutable/chunks/DiNgE43O.js.gz +0 -0
  124. package/build/bosun-app/frontend/client/_app/immutable/chunks/ouMvMh56.js +0 -1
  125. package/build/bosun-app/frontend/client/_app/immutable/chunks/ouMvMh56.js.br +0 -0
  126. package/build/bosun-app/frontend/client/_app/immutable/chunks/ouMvMh56.js.gz +0 -0
  127. package/build/bosun-app/frontend/client/_app/immutable/entry/app.rHjbMnFc.js.br +0 -0
  128. package/build/bosun-app/frontend/client/_app/immutable/entry/app.rHjbMnFc.js.gz +0 -0
  129. package/build/bosun-app/frontend/client/_app/immutable/entry/start.CocMZrbB.js +0 -1
  130. package/build/bosun-app/frontend/client/_app/immutable/entry/start.CocMZrbB.js.br +0 -0
  131. package/build/bosun-app/frontend/client/_app/immutable/entry/start.CocMZrbB.js.gz +0 -0
  132. package/build/bosun-app/frontend/client/_app/immutable/nodes/0.CffmfeCN.js.br +0 -0
  133. package/build/bosun-app/frontend/client/_app/immutable/nodes/0.CffmfeCN.js.gz +0 -0
  134. package/build/bosun-app/frontend/client/_app/immutable/nodes/1.CmX_nRov.js.br +0 -0
  135. package/build/bosun-app/frontend/client/_app/immutable/nodes/1.CmX_nRov.js.gz +0 -0
  136. package/build/bosun-app/frontend/client/_app/immutable/nodes/10.BwODd0ab.js.br +0 -0
  137. package/build/bosun-app/frontend/client/_app/immutable/nodes/10.BwODd0ab.js.gz +0 -0
  138. package/build/bosun-app/frontend/client/_app/immutable/nodes/17.BxiBPC57.js.br +0 -0
  139. package/build/bosun-app/frontend/client/_app/immutable/nodes/17.BxiBPC57.js.gz +0 -0
  140. package/build/bosun-app/frontend/client/_app/immutable/nodes/18.fUMviTUO.js.br +0 -0
  141. package/build/bosun-app/frontend/client/_app/immutable/nodes/18.fUMviTUO.js.gz +0 -0
  142. package/build/bosun-app/frontend/client/_app/immutable/nodes/2.DMc2hXxC.js +0 -35
  143. package/build/bosun-app/frontend/client/_app/immutable/nodes/2.DMc2hXxC.js.br +0 -0
  144. package/build/bosun-app/frontend/client/_app/immutable/nodes/2.DMc2hXxC.js.gz +0 -0
  145. package/build/bosun-app/frontend/client/_app/immutable/nodes/3.BpSGVLcf.js.br +0 -0
  146. package/build/bosun-app/frontend/client/_app/immutable/nodes/3.BpSGVLcf.js.gz +0 -0
  147. package/build/bosun-app/frontend/client/_app/immutable/nodes/4.BmcqYasy.js.br +0 -0
  148. package/build/bosun-app/frontend/client/_app/immutable/nodes/4.BmcqYasy.js.gz +0 -0
  149. package/build/bosun-app/frontend/client/_app/immutable/nodes/5.DXFquMVj.js.br +0 -0
  150. package/build/bosun-app/frontend/client/_app/immutable/nodes/5.DXFquMVj.js.gz +0 -0
  151. package/build/bosun-app/frontend/client/_app/immutable/nodes/6.WMxmoB8u.js.br +0 -0
  152. package/build/bosun-app/frontend/client/_app/immutable/nodes/6.WMxmoB8u.js.gz +0 -0
  153. package/build/bosun-app/frontend/client/_app/immutable/nodes/8.DN7-_OgI.js.br +0 -0
  154. package/build/bosun-app/frontend/client/_app/immutable/nodes/8.DN7-_OgI.js.gz +0 -0
  155. package/build/bosun-app/frontend/client/_app/immutable/nodes/9.DlckNySe.js +0 -2
  156. package/build/bosun-app/frontend/client/_app/immutable/nodes/9.DlckNySe.js.br +0 -0
  157. package/build/bosun-app/frontend/client/_app/immutable/nodes/9.DlckNySe.js.gz +0 -0
  158. package/build/bosun-app/frontend/server/chunks/chunks/log-content.svelte.js-C6EzbHLC.js.map +0 -1
  159. package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/_layout.svelte.js-B2wHKJV7.js.map +0 -1
  160. package/build/bosun-app/frontend/server/chunks/entries/pages/edit/_agent_/roleplay/_page.svelte.js-DDcIjgZD.js.map +0 -1
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DLQqXQ6R.js","../chunks/C1FmrZbK.js","../assets/editor.BMIWPGx3.css"])))=>i.map(i=>d[i]);
2
- import{_ as re}from"../chunks/C1FmrZbK.js";import{a as c,f as d}from"../chunks/CCYriF4C.js";import{o as oe,a as ie}from"../chunks/DnMQeiTY.js";import{p as se,d as le,a as ne,y as a,j as e,f as T,s as E,c as m,r as p,t as O,w as u}from"../chunks/CR-uVjxM.js";import{s as V}from"../chunks/B0nqNj93.js";import{i as S}from"../chunks/BQIf5msi.js";import{b as ce}from"../chunks/ClLUwVGq.js";import{g as ue,P as ve}from"../chunks/CHCMKZAC.js";import{e as de,a as fe}from"../chunks/BU7aeYn4.js";import{t as J}from"../chunks/DGqwi6rZ.js";var me=d("<span>Saving…</span>"),pe=d("<span>Saved</span>"),ge=d('<div class="text-rc-gray-400">Loading…</div>'),_e=d('<div class="text-rc-red-500"> </div>'),L=d('<div class="text-rc-red-500 mb-2 text-xs"> </div>'),he=d('<!> <!> <div class="min-h-0 flex-1"></div>',1),ye=d('<div class="flex flex-none items-center justify-between gap-3 pb-2"><div class="min-w-0"><div class="truncate font-semibold text-rc-gray-100">Region config</div> <div class="truncate text-xs text-rc-gray-400">Edits `region-config.json` in the project</div></div> <div class="flex items-center gap-3 text-xs text-rc-gray-400"><!></div></div> <!>',1);function Be(W,z){se(z,!0);const{actions:F}=ue();let o=u(null),k,P=null,w=[],D=null,j=!1,g=u(""),A=u(""),B=u(!0),_=u(null),h=u(null),y=u(!1),f=u(null),x=null;const R=800;function M(){x&&(clearTimeout(x),x=null)}function q(t){M(),x=setTimeout(()=>{Q(t)},R)}async function Q(t){if(!e(y)&&t!==e(A)){try{JSON.parse(t)}catch{return}a(y,!0),a(f,null);try{await J.regionConfig.save.mutate({text:t}),a(A,t,!0),F.sendAppEvent({type:"reload-project"})}catch(l){console.error(l),a(f,"Failed to save region config")}finally{a(y,!1)}}}oe(async()=>{try{de();const t=await re(()=>import("../chunks/DLQqXQ6R.js").then(n=>n.e),__vite__mapDeps([0,1,2]),import.meta.url);if(j)return;D=t,fe(t),a(B,!0),a(_,null);const l=await J.regionConfig.get.query();if(j)return;a(g,l,!0),a(A,l,!0),a(o,t.editor.create(k,{value:l,language:"json",theme:"bosun-dark",automaticLayout:!0,lineNumbers:"on",minimap:{enabled:!1},wordWrap:"on",matchBrackets:"never",bracketPairColorization:{enabled:!1},guides:{highlightActiveBracketPair:!1,bracketPairs:!1,bracketPairsHorizontal:!1},occurrencesHighlight:"off",selectionHighlight:!1,unicodeHighlight:{ambiguousCharacters:!1,nonBasicASCII:!1,invisibleCharacters:!1,includeStrings:!1,includeComments:!1},autoClosingQuotes:"never",padding:{top:12}}),!0),P=e(o).getModel(),w.push(e(o).onDidChangeModelContent(()=>{if(!e(o))return;const n=e(o).getValue();a(g,n,!0),a(f,null);try{JSON.parse(n),a(h,null),q(n)}catch{M(),a(h,"Invalid JSON")}}))}catch(t){console.error(t),a(_,"Failed to load region config")}finally{a(B,!1)}}),ie(()=>{j=!0,M();for(const l of w)try{l.dispose()}catch{}w=[];const t=P;P=null;try{if(e(o)){try{e(o).setModel(null)}catch{}e(o).dispose()}}finally{a(o,null)}try{t==null||t.dispose()}catch{}D=null}),le(()=>{e(o)&&e(g)!==e(o).getValue()&&e(o).setValue(e(g))}),ve(W,{class:"flex h-full min-h-0 flex-col !rounded-none p-2",children:(t,l)=>{var n=ye(),b=T(n),H=E(m(b),2),U=m(H);{var G=r=>{var i=me();c(r,i)},K=r=>{var i=pe();c(r,i)};S(U,r=>{e(y)?r(G):r(K,-1)})}p(H),p(b);var X=E(b,2);{var Y=r=>{var i=ge();c(r,i)},Z=r=>{var i=_e(),C=m(i,!0);p(i),O(()=>V(C,e(_))),c(r,i)},$=r=>{var i=he(),C=T(i);{var ee=s=>{var v=L(),N=m(v,!0);p(v),O(()=>V(N,e(h))),c(s,v)};S(C,s=>{e(h)&&s(ee)})}var I=E(C,2);{var te=s=>{var v=L(),N=m(v,!0);p(v),O(()=>V(N,e(f))),c(s,v)};S(I,s=>{e(f)&&s(te)})}var ae=E(I,2);ce(ae,s=>k=s,()=>k),c(r,i)};S(X,r=>{e(B)?r(Y):e(_)?r(Z,1):r($,-1)})}c(t,n)}}),ne()}export{Be as component};
2
+ import{_ as re}from"../chunks/C1FmrZbK.js";import{a as c,f as d}from"../chunks/CCYriF4C.js";import{o as oe,a as ie}from"../chunks/DnMQeiTY.js";import{p as se,d as le,a as ne,y as a,j as e,f as T,s as E,c as m,r as p,t as O,w as u}from"../chunks/CR-uVjxM.js";import{s as V}from"../chunks/B0nqNj93.js";import{i as S}from"../chunks/BQIf5msi.js";import{b as ce}from"../chunks/ClLUwVGq.js";import{g as ue,P as ve}from"../chunks/CHCMKZAC.js";import{e as de,a as fe}from"../chunks/BU7aeYn4.js";import{t as J}from"../chunks/BA_s3vf-.js";var me=d("<span>Saving…</span>"),pe=d("<span>Saved</span>"),ge=d('<div class="text-rc-gray-400">Loading…</div>'),_e=d('<div class="text-rc-red-500"> </div>'),L=d('<div class="text-rc-red-500 mb-2 text-xs"> </div>'),he=d('<!> <!> <div class="min-h-0 flex-1"></div>',1),ye=d('<div class="flex flex-none items-center justify-between gap-3 pb-2"><div class="min-w-0"><div class="truncate font-semibold text-rc-gray-100">Region config</div> <div class="truncate text-xs text-rc-gray-400">Edits `region-config.json` in the project</div></div> <div class="flex items-center gap-3 text-xs text-rc-gray-400"><!></div></div> <!>',1);function Be(W,z){se(z,!0);const{actions:F}=ue();let o=u(null),k,P=null,w=[],D=null,j=!1,g=u(""),A=u(""),B=u(!0),_=u(null),h=u(null),y=u(!1),f=u(null),x=null;const R=800;function M(){x&&(clearTimeout(x),x=null)}function q(t){M(),x=setTimeout(()=>{Q(t)},R)}async function Q(t){if(!e(y)&&t!==e(A)){try{JSON.parse(t)}catch{return}a(y,!0),a(f,null);try{await J.regionConfig.save.mutate({text:t}),a(A,t,!0),F.sendAppEvent({type:"reload-project"})}catch(l){console.error(l),a(f,"Failed to save region config")}finally{a(y,!1)}}}oe(async()=>{try{de();const t=await re(()=>import("../chunks/DLQqXQ6R.js").then(n=>n.e),__vite__mapDeps([0,1,2]),import.meta.url);if(j)return;D=t,fe(t),a(B,!0),a(_,null);const l=await J.regionConfig.get.query();if(j)return;a(g,l,!0),a(A,l,!0),a(o,t.editor.create(k,{value:l,language:"json",theme:"bosun-dark",automaticLayout:!0,lineNumbers:"on",minimap:{enabled:!1},wordWrap:"on",matchBrackets:"never",bracketPairColorization:{enabled:!1},guides:{highlightActiveBracketPair:!1,bracketPairs:!1,bracketPairsHorizontal:!1},occurrencesHighlight:"off",selectionHighlight:!1,unicodeHighlight:{ambiguousCharacters:!1,nonBasicASCII:!1,invisibleCharacters:!1,includeStrings:!1,includeComments:!1},autoClosingQuotes:"never",padding:{top:12}}),!0),P=e(o).getModel(),w.push(e(o).onDidChangeModelContent(()=>{if(!e(o))return;const n=e(o).getValue();a(g,n,!0),a(f,null);try{JSON.parse(n),a(h,null),q(n)}catch{M(),a(h,"Invalid JSON")}}))}catch(t){console.error(t),a(_,"Failed to load region config")}finally{a(B,!1)}}),ie(()=>{j=!0,M();for(const l of w)try{l.dispose()}catch{}w=[];const t=P;P=null;try{if(e(o)){try{e(o).setModel(null)}catch{}e(o).dispose()}}finally{a(o,null)}try{t==null||t.dispose()}catch{}D=null}),le(()=>{e(o)&&e(g)!==e(o).getValue()&&e(o).setValue(e(g))}),ve(W,{class:"flex h-full min-h-0 flex-col !rounded-none p-2",children:(t,l)=>{var n=ye(),b=T(n),H=E(m(b),2),U=m(H);{var G=r=>{var i=me();c(r,i)},K=r=>{var i=pe();c(r,i)};S(U,r=>{e(y)?r(G):r(K,-1)})}p(H),p(b);var X=E(b,2);{var Y=r=>{var i=ge();c(r,i)},Z=r=>{var i=_e(),C=m(i,!0);p(i),O(()=>V(C,e(_))),c(r,i)},$=r=>{var i=he(),C=T(i);{var ee=s=>{var v=L(),N=m(v,!0);p(v),O(()=>V(N,e(h))),c(s,v)};S(C,s=>{e(h)&&s(ee)})}var I=E(C,2);{var te=s=>{var v=L(),N=m(v,!0);p(v),O(()=>V(N,e(f))),c(s,v)};S(I,s=>{e(f)&&s(te)})}var ae=E(I,2);ce(ae,s=>k=s,()=>k),c(r,i)};S(X,r=>{e(B)?r(Y):e(_)?r(Z,1):r($,-1)})}c(t,n)}}),ne()}export{Be as component};
@@ -0,0 +1,2 @@
1
+ import{a as S,f as P,d as Vt,b as Le,t as ve,e as bt,c as Ut}from"../chunks/CCYriF4C.js";import{p as Qe,c as T,f as De,r as w,s as M,j as e,t as ee,y as s,n as f,a as $e,w as j,d as Pe,o as Me,x as Rt}from"../chunks/CR-uVjxM.js";import{i as K}from"../chunks/BQIf5msi.js";import{B as ie}from"../chunks/joiJcRPz.js";import{D as qt,c as re,i as Et,a as Dt,b as qe,d as Ke,e as Xt}from"../chunks/CWrb40J2.js";import{s as se}from"../chunks/B0nqNj93.js";import{e as Ye,i as _t}from"../chunks/DuQdgMax.js";import{s as Xe,c as Lt}from"../chunks/C9yBjdYI.js";import{p as pe}from"../chunks/BcbX6huO.js";import{I as Be}from"../chunks/BBk8_Xpk.js";import{t as Ze}from"../chunks/BA_s3vf-.js";import{P as Ot,g as Zt}from"../chunks/CHCMKZAC.js";import{c as yt,s as Qt}from"../chunks/CR5IRTqC.js";import{b as Bt}from"../chunks/ClLUwVGq.js";import{C as $t,b as er,a as tr,c as It,f as Ft,d as St}from"../chunks/DaPi9zoH.js";import{i as zt}from"../chunks/DgGeUDDh.js";import{o as rr}from"../chunks/DnMQeiTY.js";import{s as nr}from"../chunks/9mOMnnWN.js";import{I as Ht}from"../chunks/DJnDF3d9.js";import{l as st,c as ar}from"../chunks/B1dhmiqQ.js";var or=P('<span class="min-w-0 flex-1 truncate text-left"> </span> <!>',1),sr=P('<div class="truncate p-1 text-base font-semibold text-rc-green-200"> </div>'),ir=P('<div class="truncate p-1 text-base font-semibold text-rc-gray-100"> </div>'),lr=P('<div class="flex items-start gap-2"><div class="min-w-0"><div class="truncate p-1 text-sm text-rc-gray-300 group-hover:text-rc-gray-200"> </div> <!></div></div>'),ur=P('<div class="mt-1 max-h-96 w-max min-w-full max-w-[min(26rem,90vw)] overflow-y-auto overflow-x-hidden rounded-lg border border-rc-gray-110 bg-rc-gray-930 backdrop-blur-2xl" role="listbox"></div>'),cr=P("<div><!> <!></div>");function dr(c,r){Qe(r,!0);let n=pe(r,"class",3,""),o=j(!1),i=j(null);const g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function p(){s(o,!e(o))}function C(h){r.onSelectState(h),s(o,!1)}function v(h){const z=h.userMessage;if(z==null)return"No message";const A=(typeof z=="string"?z:String(z)).trim();return A?h.userMessageSender==="system"?`System: ${A}`:A:"No message"}function l(h,z=50,A="…"){if(!h)return"";if(h.length<=z)return h;const D=h.slice(0,z+1),W=Math.max(D.lastIndexOf(" "),D.lastIndexOf(" "),D.lastIndexOf(" "),D.lastIndexOf(`
2
+ `),D.lastIndexOf("\r"));return(W>0?D.slice(0,W):h.slice(0,z)).trimEnd()+A}function y(h){h.key==="ArrowDown"&&!e(o)?(s(o,!0),h.preventDefault()):h.key==="ArrowUp"&&e(o)&&(s(o,!1),h.preventDefault())}function le(h){const z=h.getDate(),A=g[h.getMonth()];let D=h.getHours();const W=D>=12?"PM":"AM";D=D%12,D===0&&(D=12);const H=String(h.getMinutes()).padStart(2,"0"),k=new Date,ue=h.getFullYear(),ge=ue!==k.getFullYear()?` ${ue}`:"";return`${z} ${A}${ge}, ${D}:${H} ${W}`}function de(h){const z=new Date(h.id);if(!Number.isNaN(z.getTime()))return le(z);const A=new Date(h.name);return Number.isNaN(A.getTime())?h.name||"History":le(A)}let E=f(()=>r.agentStates.find(h=>h.id===r.currentState)??null),Se=f(()=>e(E)?de(e(E)):"History");var Y=cr(),he=T(Y);ie(he,{variant:"ghost",get"aria-expanded"(){return e(o)},"aria-haspopup":"listbox","aria-controls":"history-dropdown",onclick:p,onkeydown:y,class:"inline-flex w-40 items-center rounded-lg border border-transparent !bg-rc-gray-700 !px-3 !pb-1 !pt-[5px] text-rc-gray-200 hover:border hover:border-rc-gray-500 focus:outline-none focus:ring-0",get el(){return e(i)},set el(h){s(i,h,!0)},children:(h,z)=>{var A=or(),D=De(A),W=T(D,!0);w(D);var H=M(D,2);{let k=f(()=>"size-7 shrink-0 text-rc-gray-500 transition-transform duration-200 "+(e(o)?"rotate-180":""));Be(H,{name:"chevron-down",get class(){return e(k)}})}ee(()=>se(W,e(Se))),S(h,A)},$$slots:{default:!0}});var ne=M(he,2);qt(ne,{id:"history-dropdown",get open(){return e(o)},onClose:()=>s(o,!1),get anchorEl(){return e(i)},placement:"bottom-start",offset:[0,1],children:z=>{var A=ur();Ye(A,21,()=>r.agentStates.slice().reverse(),_t,(D,W)=>{{let H=f(()=>e(W).id===r.currentState);ie(D,{variant:"ghost",size:"small",role:"option",get"aria-selected"(){return e(H)},onclick:()=>C(e(W).id),class:"group w-full rounded-none border-b border-rc-gray-110 py-2 pr-3 text-left backdrop-blur-2xl last:border-b-0 hover:bg-rc-gray-700 focus:bg-rc-gray-400",children:(k,ue)=>{var ge=lr(),Ae=T(ge),Ne=T(Ae),Oe=T(Ne,!0);w(Ne);var Fe=M(Ne,2);{var ze=ae=>{var fe=sr(),Ee=T(fe,!0);w(fe),ee(we=>se(Ee,we),[()=>l(v(e(W)))]),S(ae,fe)},Re=ae=>{var fe=ir(),Ee=T(fe,!0);w(fe),ee(we=>se(Ee,we),[()=>l(v(e(W)))]),S(ae,fe)};K(Fe,ae=>{e(W).id===r.currentState?ae(ze):ae(Re,-1)})}w(Ae),w(ge),ee(ae=>se(Oe,ae),[()=>de(e(W))]),S(k,ge)},$$slots:{default:!0}})}}),w(A),S(z,A)},$$slots:{default:!0}}),w(Y),ee(()=>Xe(Y,1,`relative ${n()}`)),S(c,Y),$e()}var gr=P('<span class="text-[13px] leading-none text-rc-gray-400"> </span>'),fr=P('<div class="flex w-full select-text items-baseline gap-2 truncate rounded-md bg-transparent px-2 py-1 text-left text-sm text-rc-gray-200"><!> <!> <span> </span></div>');function mr(c,r){Qe(r,!0);const n=f(()=>{const l=new Date(r.trace.createdAt);return Number.isNaN(l.getTime())?null:[l.getHours(),l.getMinutes(),l.getSeconds()].map(y=>String(y).padStart(2,"0")).join(":")});var o=fr(),i=T(o);{let l=f(()=>r.trace.status==="failed"?"close":r.trace.status==="updated"?"sparkles":"checkmark"),y=f(()=>r.trace.status==="failed"?"self-center text-red-400":"self-center text-rc-green-200");Be(i,{get name(){return e(l)},width:18,height:18,get class(){return e(y)}})}var g=M(i,2);{var p=l=>{var y=gr(),le=T(y,!0);w(y),ee(()=>se(le,e(n))),S(l,y)};K(g,l=>{e(n)&&l(p)})}var C=M(g,2),v=T(C,!0);w(C),w(o),ee(()=>{Xe(C,1,Lt(r.trace.status==="failed"?"text-red-200":"")),se(v,r.trace.summary)}),S(c,o),$e()}var vr=P('<dialog class="dialog m-auto bg-transparent p-0 text-rc-gray-100 shadow-md svelte-jby388"><!> <!></dialog>');function pr(c,r){Qe(r,!0);let n,o=pe(r,"showCloseButton",3,!1),i=pe(r,"onClose",3,()=>{}),g=pe(r,"onOpen",3,()=>{}),p=pe(r,"isOpen",3,!1);Pe(()=>{p()?(console.log("show"),n==null||n.showModal(),g()()):n!=null&&n.open&&(console.log("close"),n.close())});function C(){i()()}rr(()=>(n.addEventListener("close",C),()=>{n.removeEventListener("close",C)}));function v(E){E.target===n&&n.close()}var l=vr(),y=T(l);nr(y,()=>r.children);var le=M(y,2);{var de=E=>{ie(E,{variant:"ghost",onclick:()=>n.close(),class:"absolute right-2 top-2",children:(Se,Y)=>{Me();var he=ve("✕");S(Se,he)},$$slots:{default:!0}})};K(le,E=>{o()&&E(de)})}w(l),Bt(l,E=>n=E,()=>n),Le("mousedown",l,v),S(c,l),$e()}Vt(["mousedown"]);function hr(c){if(!Array.isArray(c))return[];const r=[];for(const n of c){if(!n||typeof n!="object")continue;const o=n.text,i=n.lastSeen,g=n.uses;if(typeof o!="string"||typeof i!="number"||!Number.isFinite(i)||typeof g!="number"||!Number.isFinite(g))continue;const p=o.trim();p&&r.push({text:p,lastSeen:i,uses:g})}return r.sort((n,o)=>o.lastSeen-n.lastSeen),r}function xr(c,r,n=2e3){var C;const o=r.trim();if(!o)return c;const i=(((C=c[0])==null?void 0:C.lastSeen)??0)+1,g=c.findIndex(v=>v.text===o);let p;if(g!==-1){const v=c[g];p=[{text:v.text,lastSeen:i,uses:(v.uses??0)+1},...c.slice(0,g),...c.slice(g+1)]}else p=[{text:o,lastSeen:i,uses:1},...c];return p.length>n?p.slice(0,n):p}function br(c,r,n=2e3){var C,v;if(!r.length)return c;if(!c.length)return r;const o=((C=c[0])==null?void 0:C.lastSeen)??0,g=(((v=r[0])==null?void 0:v.lastSeen)??0)>o?r:r.map((l,y)=>({...l,lastSeen:o+(r.length-y)})),p=new Map;for(const l of c)p.set(l.text,l);for(const l of g){const y=p.get(l.text);if(!y){p.set(l.text,l);continue}p.set(l.text,{text:l.text,lastSeen:Math.max(y.lastSeen,l.lastSeen),uses:y.uses+l.uses})}return Array.from(p.values()).sort((l,y)=>y.lastSeen-l.lastSeen).slice(0,n)}function yr(c,r,n=5){if(!r.length)return[];const i=c.trim().toLowerCase(),g=wt(c,!1).text,p=/\s$/u.test(c);if(!wt(c,!0).text)return[];const C=[];for(const v of r){const l=wt(v.text);if(!l.text||v.text.trim().toLowerCase()===i)continue;const y=wr(l,v.text,g,p);y&&C.push({item:v,match:y})}return C.sort((v,l)=>v.match.kindRank!==l.match.kindRank?v.match.kindRank-l.match.kindRank:v.match.span!==l.match.span?v.match.span-l.match.span:v.match.start!==l.match.start?v.match.start-l.match.start:v.item.lastSeen!==l.item.lastSeen?l.item.lastSeen-v.item.lastSeen:v.item.uses!==l.item.uses?l.item.uses-v.item.uses:v.item.text.length-l.item.text.length),C.slice(0,n).map(v=>({text:v.item.text,prefixEndIndex:v.match.prefixEndIndex,segments:Mr(v.item.text,v.match.ranges)}))}function wt(c,r=!0){const n=[],o=[];for(let i=0;i<c.length;i++){const g=Sr(c[i]);if(g===" "){if(!n.length)continue;const p=n.length-1;if(n[p]===" "){o[p][1]=i+1;continue}}n.push(g),o.push([i,i+1])}return r&&n[n.length-1]===" "&&(n.pop(),o.pop()),{text:n.join(""),ranges:o}}function Sr(c){if(/\s/u.test(c))return" ";try{return/[\p{P}\p{S}]/u.test(c)?" ":c.toLowerCase()}catch{return/[^a-z0-9\s]/i.test(c)?" ":c.toLowerCase()}}function wr(c,r,n,o){if(!c.text)return null;if(c.text.startsWith(n)){const g=kr(r,n,o)??r.length,p=Math.max(0,Math.min(r.length,g));return{kindRank:0,start:0,span:n.length,ranges:[[0,p]],prefixEndIndex:p}}const i=c.text.indexOf(n);return i!==-1?{kindRank:Tr(c.text,i,n.length),start:i,span:n.length,ranges:Cr(c,i,i+n.length),prefixEndIndex:r.length}:null}function _r(c,r){return r<=0?!0:c[r-1]===" "}function Ir(c,r){return r>=c.length?!0:c[r]===" "}function Tr(c,r,n){const o=_r(c,r),i=Ir(c,r+n);return o&&i?1:o?2:3}function Cr(c,r,n){const o=Math.max(0,Math.min(c.ranges.length,r)),i=Math.max(o,Math.min(c.ranges.length,n));return jt(c.ranges.slice(o,i))}function kr(c,r,n){if(!r)return null;let o="",i=!0;for(let g=0;g<c.length;g++){const p=c[g];let C;if(/\s/u.test(p))C=" ";else try{C=/[\p{P}\p{S}]/u.test(p)?" ":p.toLowerCase()}catch{C=/[^a-z0-9\s]/i.test(p)?" ":p.toLowerCase()}if(C===" "){if(i)continue;o+=" ",i=!0}else o+=C,i=!1;if(o.length===r.length){if(o!==r)return null;let v=g+1;if(n&&r.endsWith(" ")){let l=v;for(;l<c.length;){const y=c[l];if(/\s/u.test(y)){l+=1;continue}try{if(/[\p{P}\p{S}]/u.test(y)){l+=1;continue}}catch{if(/[^a-z0-9\s]/i.test(y)){l+=1;continue}}break}v=l}return v}if(o.length>r.length)return null}return null}function Mr(c,r){const n=jt(r);if(!n.length)return[{text:c,matched:!1}];const o=[];let i=0;for(const[g,p]of n)g>i&&o.push({text:c.slice(i,g),matched:!1}),o.push({text:c.slice(g,p),matched:!0}),i=p;return i<c.length&&o.push({text:c.slice(i),matched:!1}),o.filter(g=>g.text.length>0)}function jt(c){if(!c.length)return[];const r=c.map(([o,i])=>[Math.max(0,o),Math.max(0,i)]).filter(([o,i])=>i>o).sort((o,i)=>o[0]-i[0]||o[1]-i[1]);if(!r.length)return[];const n=[[r[0][0],r[0][1]]];for(let o=1;o<r.length;o++){const[i,g]=r[o],p=n[n.length-1];if(i<=p[1]){p[1]=Math.max(p[1],g);continue}n.push([i,g])}return n}var Pr=P('<form><h2 class="text-l mb-4 text-gray-300">Image URL</h2> <!> <!></form>'),Ar=P('<div class="my-2 flex w-full justify-center"><div class="rounded-full border border-rc-gray-650 bg-rc-gray-800/40 px-3 py-1 text-xs text-rc-gray-200"> </div></div>'),Nr=P('<div class="rounded-lg border border-rc-green-450 bg-transparent px-3 py-2 text-sm text-rc-gray-300">Generating 9 more variants…</div>'),Rr=P('<div class="rounded-lg border border-red-500/70 bg-red-950/20 px-3 py-2 text-sm text-red-200"> </div>'),Er=P('<button type="button"><div class="whitespace-pre-line break-words"> </div></button>'),Dr=P('<div class="ml-7 mt-2 flex flex-col gap-2"><!> <!> <!></div>'),Or=P('<!> <div class="log-element"><div><!></div> <!></div>',1),Fr=P('<div class="absolute bottom-2 left-2 right-2 z-10 flex items-center gap-3 rounded-lg border border-rc-green-450 bg-rc-gray-930/90 px-3 py-3 font-semibold text-rc-gray-100 shadow-inner-white-soft backdrop-blur-3xl"><span>Choose a variant above to continue</span> <button type="button" class="rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-300 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-100 focus:outline-none focus-visible:outline-none disabled:cursor-wait disabled:opacity-50">Regenerate</button> <button type="button" class="rounded border-0 bg-transparent px-1 py-0.5 text-rc-gray-300 transition-colors hover:bg-rc-gray-900 hover:text-rc-gray-100 focus:outline-none focus-visible:outline-none">Cancel</button></div>'),zr=P('<div class="absolute bottom-16 left-2 right-2 z-20 rounded-lg border border-red-500/60 bg-red-950/90 px-3 py-2 text-sm text-red-100 shadow-lg" role="alert"> </div>'),Hr=P("<span> </span>"),Vr=P('<button type="button" role="option" tabindex="-1"></button>'),Ur=P('<div class="absolute bottom-full left-0 right-0 mb-1 max-h-60 overflow-y-auto rounded-lg border border-rc-gray-110 bg-rc-gray-930 shadow-inner-white-soft backdrop-blur-2xl" role="listbox"></div>'),qr=P('<div class="pointer-events-none absolute inset-0 z-10 overflow-hidden rounded-lg" aria-hidden="true"><div class="whitespace-pre text-rc-gray-400/70"><span class="invisible"> </span><span> </span></div></div>'),Lr=P('<!> <form><fieldset class="absolute bottom-2 left-2 right-2 z-10 flex gap-2 disabled:opacity-35"><div class="relative flex-1"><!> <!> <button type="button" class="absolute bottom-0 left-3 top-0 z-20 inline-flex items-center border-r border-rc-gray-500/70 bg-transparent pr-2 text-base font-semibold leading-6 text-rc-gray-300 transition-colors duration-75 hover:text-rc-gray-300 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50"> </button> <!></div> <!> <!></fieldset></form>',1),Br=P('<div class="rc-scroll min-h-0 flex-1 overflow-y-auto pr-1"></div> <!>',1),jr=P("<!> <!>",1);function Jr(c,r){Qe(r,!0);let n=pe(r,"promptEditProposalId",3,null),o=pe(r,"analyzeDisabled",3,!1),i=pe(r,"variantSourceTrace",3,null),g=pe(r,"variantChoices",19,()=>[]),p=pe(r,"variantLoading",3,!1),C=pe(r,"variantApplyingId",3,null),v=pe(r,"variantError",3,null),l=Rt(new Set),y=j(""),le=j(""),de=j(""),E,Se=j(!1),Y=j(null),he=j(""),ne=j(!1),h=j("user"),z=j(null),A=j(Rt([])),D=j(null),W=j(!1),H=j(!1),k=j(null);const ue=f(()=>yr(e(y),e(A))),ge=f(()=>e(k)==null?null:e(ue)[e(k)]??null),Ae=f(()=>e(ge)?e(ge).text.slice(e(ge).prefixEndIndex):""),Ne=f(()=>!i()&&!e(de)&&e(y).trim().length===0),Oe=f(()=>r.mocks===null?r.context:{context:r.context??{},mocks:r.mocks});Pe(()=>{if(typeof window>"u")return;if(!e(Y)){s(he,"");return}const t=window.getComputedStyle(e(Y)),d=`calc(${t.paddingTop} + ${t.borderTopWidth})`,I=`calc(${t.paddingRight} + ${t.borderRightWidth})`,b=`calc(${t.paddingBottom} + ${t.borderBottomWidth})`,U=`calc(${t.paddingLeft} + ${t.borderLeftWidth})`;s(he,[`padding:${d} ${I} ${b} ${U}`,`font:${t.font}`,`letter-spacing:${t.letterSpacing}`,`line-height:${t.lineHeight}`,`text-indent:${t.textIndent}`,`text-transform:${t.textTransform}`,`text-align:${t.textAlign}`,`box-sizing:${t.boxSizing}`].join(";"),!0)}),Pe(()=>{e(k)!=null&&e(k)>=e(ue).length&&s(k,null)});const Fe=f(()=>i()||!e(W)||e(H)?!1:e(ue).length>0);function ze(t){s(y,t.text,!0),s(k,null),s(H,!0)}function Re(){s(W,!0),s(H,!1)}function ae(){s(W,!1),s(k,null),s(H,!1)}function fe(){s(k,null),s(H,!1)}function Ee(t){if(t.key==="Escape"){e(Fe)&&t.preventDefault(),s(H,!0),s(k,null);return}if(t.key==="ArrowUp"||t.key==="ArrowDown"){if(!e(ue).length)return;e(H)&&s(H,!1),t.preventDefault();const d=e(ue).length-1;if(e(k)===null)s(k,t.key==="ArrowUp"?d:0,!0);else{const I=t.key==="ArrowUp"?-1:1;s(k,Math.max(0,Math.min(d,e(k)+I)),!0)}return}if(t.key==="Enter"||t.key==="Tab"&&!t.shiftKey){if(e(k)===null)return;const d=e(ue)[e(k)];if(!d)return;t.preventDefault(),ze(d);return}}let we=null,Ce=!1,je=0;function et(){typeof window>"u"||E&&(!Ce&&l.has(E)||we==null&&(we=requestAnimationFrame(()=>{if(we=null,!E||!Ce&&l.has(E))return;const t=E.scrollHeight-(E.scrollTop+E.clientHeight),d=Ce||t>E.clientHeight?"auto":"smooth";E.scrollTo({top:E.scrollHeight,behavior:d}),Ce=!1})))}Pe(()=>{const t=re.length;t===0&&je>0&&(Ce=!0,E&&l.delete(E)),je=t,t>0&&et()});function tt(t){t.scrollTop+t.clientHeight+200>t.scrollHeight?l.delete(t):l.add(t)}function rt(t){if(e(ne))return;(e(y).trim().length>0||e(de))&&(s(A,xr(e(A),e(y)),!0),r.onmessage({sender:t,text:e(y),imageUrl:e(de)}),s(de,""),s(y,""),s(h,"user"),s(H,!1),s(k,null))}function it(t){t.preventDefault(),rt(e(h))}function nt(){s(h,e(h)==="system"?"user":"system",!0),requestAnimationFrame(()=>{var t;return(t=e(Y))==null?void 0:t.focus()})}function lt(t){t.preventDefault(),s(de,e(le),!0),s(le,""),s(Se,!1)}function at(t){return t&&typeof t.renderedPrompt=="string"?t.renderedPrompt:null}function ut(t,d){for(let I=d-1;I>=0;I--){const b=t[I];if(Ke(b)&&zt(b.name)&&at(b))return b}for(let I=d-1;I>=0;I--){const b=t[I];if(Ke(b)&&b.name==="prewarm"&&at(b))return b}return null}function ct(t){return(t.eventName==="received-message"||t.eventName==="llm-handler-stream-requested")&&!String(t.content??"").trim()?!1:t.eventName==="received-message"||t.eventName==="llm-handler-stream-requested"||t.eventName==="finished-main-streaming-step"||t.eventName==="sent-message"||t.eventName==="transfer-requested"||t.eventName==="hangup-requested"}function a(t){return!!(r.agentId&&r.agentId.trim())&&t.eventName!=="transfer-requested"&&(t.eventName==="finished-main-streaming-step"||t.eventName==="sent-message")}function u(t){return t.role==="user"||t.eventName==="received-message"||t.eventName==="llm-handler-stream-requested"}function m(t){const d=String(t??"").trim();return!d||/^\[image\]\s+/.test(d)?"":d}function F(t){const d=t==null?void 0:t.bosunInputMessageSender;return d==="system"?"system":d==="user"?"user":t.role==="system"?"system":"user"}function L(t){if(!r.onRevertToState)return;const d=t==null?void 0:t.bosunPrevStateId,I=typeof d=="string"&&d.trim().length>0?d:null;r.onRevertToState(I);const b=typeof(t==null?void 0:t.bosunUserMessage)=="string"?t.bosunUserMessage:t.content;s(y,m(b),!0),s(h,F(t),!0),s(H,!1),s(k,null),requestAnimationFrame(()=>{var U,me;try{(U=e(Y))==null||U.focus(),(me=e(Y))==null||me.select()}catch{}})}function X(){var t;r.agentType==="text"?s(Se,!0):r.agentType==="voice"&&((t=r.onHangup)==null||t.call(r))}const G=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _(t){if(typeof t!="number"||!Number.isFinite(t))return null;const d=new Date(t);if(Number.isNaN(d.getTime()))return null;const I=d.getFullYear(),b=String(d.getMonth()+1).padStart(2,"0"),U=String(d.getDate()).padStart(2,"0");return`${I}-${b}-${U}`}function Z(t){if(typeof t!="number"||!Number.isFinite(t))return null;const d=new Date(t);if(Number.isNaN(d.getTime()))return null;const I=d.getDate(),b=G[d.getMonth()],U=d.getFullYear();return`${I} ${b} ${U}`}const x=f(()=>re.filter(t=>Et(t)||Ke(t)||Dt(t)?!0:qe(t)?ct(t):!1)),Ie=f(()=>{var t;return((t=re.findLast(d=>qe(d)))==null?void 0:t.eventName)==="hangup-requested"}),Tt=f(()=>{const t=e(x).map((d,I)=>({entry:d,index:I})).reverse().find(({entry:d,index:I})=>!qe(d)||!a(d)?!1:e(x).slice(0,I).some(b=>qe(b)&&u(b)));return t&&qe(t.entry)?t.entry:null}),Ct=f(()=>{const t=e(Tt);if(!t)return null;try{const d=kt(t);return{model:d.model,stringifiedConversation:d.stringifiedConversation,response:d.response}}catch{return null}});function kt(t){if(!(r.agentId??"").trim())throw new Error("Agent id is not available; cannot analyze");const I=re.indexOf(t);if(I===-1)throw new Error("Could not locate trace in chat history");const b=It(re,I,{requireRenderedPrompt:!0});if(!b)throw new Error("Could not find main step trace for this message");const U=typeof b.renderedPrompt=="string"?b.renderedPrompt:"";if(!U.trim())throw new Error("Main step rendered prompt is missing");const me=typeof b.stringifiedConversation=="string"&&b.stringifiedConversation.trim()?b.stringifiedConversation:Ft(re,I)??"",_e=String((t==null?void 0:t.content)??"");if(!_e.trim())throw new Error("Message content is missing");const J=typeof(b==null?void 0:b.model)=="string"?String(b.model):void 0,N=t==null?void 0:t.createdAt,$=typeof N=="number"&&Number.isFinite(N)?N:void 0;return{trace:t,stepTrace:b,renderedPrompt:U,stringifiedConversation:me,response:_e,model:J,createdAt:$}}function Jt(t){if(r.onAnalyzeTrace)try{s(z,null),r.onAnalyzeTrace(kt(t))}catch(d){console.error(d),s(z,d instanceof Error?d.message:String(d),!0)}}function Wt(t){if(r.onRegenerateTrace)try{s(z,null),r.onRegenerateTrace(t)}catch(d){console.error(d),s(z,d instanceof Error?d.message:String(d),!0)}}async function Gt(){if(e(ne))return;const t=e(Ct);if(t){s(H,!0),s(k,null),s(ne,!0);try{const d=await Ze.agents.generateUserResponse.mutate(t);s(y,d.text,!0),s(H,!0),s(k,null),requestAnimationFrame(()=>{var I,b;try{(I=e(Y))==null||I.focus(),(b=e(Y))==null||b.setSelectionRange(d.text.length,d.text.length)}catch{}})}catch(d){console.error("Failed to generate suggested user response",d)}finally{s(ne,!1)}}}Pe(()=>{if(typeof window>"u")return;const t=(r.agentId??"").trim(),d=(r.region??"").trim()||null,I=`${t}::${d??""}`;if(!t||I===e(D))return;s(D,I),s(A,[],!0);const b=t,U=d,me=I;Ze.agents.userMessageHistory.query({agentId:b,region:U}).then(_e=>{if(e(D)!==me)return;const J=hr(_e);s(A,br(J,e(A)),!0),s(k,null)}).catch(_e=>{console.error("Failed to load user message history",_e),e(D)===me&&(s(A,[],!0),s(k,null))})}),Pe(()=>{const t=i(),d=g().length,I=p(),b=v(),U=C();!t&&!d&&!I&&!b&&!U||et()});var Mt=jr(),Pt=De(Mt);pr(Pt,{get isOpen(){return e(Se)},onClose:()=>s(Se,!1),showCloseButton:!0,children:(t,d)=>{Ot(t,{class:"p-4",children:(I,b)=>{var U=Pr(),me=M(T(U),2);Ht(me,{class:"mb-2 w-80",get value(){return e(le)},set value(J){s(le,J,!0)}});var _e=M(me,2);ie(_e,{variant:"secondary",type:"submit",class:"ml-2 p-2",children:(J,N)=>{Me();var $=ve("Attach");S(J,$)},$$slots:{default:!0}}),w(U),bt("submit",U,lt),S(I,U)}})},$$slots:{default:!0}});var Kt=M(Pt,2);Ot(Kt,{get class(){return`relative flex min-h-0 flex-col p-2 pb-16 ${r.class??""}`},children:(t,d)=>{var I=Br(),b=De(I);Ye(b,21,()=>e(x),_t,(J,N,$)=>{const He=f(()=>_(e(N).createdAt)),xe=f(()=>$>0?_(e(x)[$-1].createdAt):null),Ve=f(()=>Z(e(N).createdAt));var Ue=Or(),Je=De(Ue);{var dt=R=>{var V=Ar(),Q=T(V),te=T(Q,!0);w(Q),w(V),ee(()=>se(te,e(Ve))),S(R,V)};K(Je,R=>{e(He)&&e(Ve)&&e(He)!==e(xe)&&R(dt)})}var We=M(Je,2),be=T(We),gt=T(be);{var ft=R=>{$t(R,{get trace(){return e(N)}})},mt=f(()=>Et(e(N))),ot=R=>{mr(R,{get trace(){return e(N)}})},vt=f(()=>Dt(e(N))),pt=R=>{{let V=f(()=>It(e(x),$)),Q=f(()=>r.onAnalyzeTrace?Jt:void 0),te=f(()=>r.onRegenerateTrace?Wt:void 0),Te=f(()=>r.onRevertToState?L:void 0),Ge=f(()=>!!r.onSeeVariants&&!i()&&e(N)===e(Tt)),xt=f(()=>i()&&e(N)===i()?"source":"none"),ce=f(()=>C()===null&&i()&&e(N)===i()?r.onChooseOriginalVariant:void 0),ye=f(()=>!!i()&&e(N)===i());er(R,{testCreationMode:"direct",get trace(){return e(N)},get context(){return e(Oe)},get agentId(){return r.agentId},get region(){return r.region},get promptEditProposalId(){return n()},get testSourceStep(){return e(V)},get testEntries(){return e(x)},get analyzeDisabled(){return o()},get onAnalyze(){return e(Q)},get onRegenerate(){return e(te)},get onRevert(){return e(Te)},get showSeeVariants(){return e(Ge)},get onSeeVariants(){return r.onSeeVariants},get variantSelectionState(){return e(xt)},get onSelectInVariantMode(){return e(ce)},get suppressActionRow(){return e(ye)}})}},ht=f(()=>qe(e(N))),O=R=>{{let V=f(()=>Ft(e(x),$)),Q=f(()=>zt(e(N).name)?ut(e(x),$):null);tr(R,{testCreationMode:"direct",get trace(){return e(N)},get agentId(){return r.agentId},get region(){return r.region},get promptEditProposalId(){return n()},get fallbackConversation(){return e(V)},get runtimeContext(){return e(Oe)},get compareTrace(){return e(Q)}})}},B=f(()=>Ke(e(N)));K(gt,R=>{e(mt)?R(ft):e(vt)?R(ot,1):e(ht)?R(pt,2):e(B)&&R(O,3)})}w(be);var q=M(be,2);{var oe=R=>{var V=Dr(),Q=T(V);{var te=ce=>{var ye=Nr();S(ce,ye)};K(Q,ce=>{p()&&ce(te)})}var Te=M(Q,2);{var Ge=ce=>{var ye=Rr(),ke=T(ye,!0);w(ye),ee(()=>se(ke,v())),S(ce,ye)};K(Te,ce=>{v()&&ce(Ge)})}var xt=M(Te,2);Ye(xt,17,g,ce=>ce.id,(ce,ye)=>{var ke=Er(),At=T(ke),Yt=T(At,!0);w(At),w(ke),ee(()=>{ke.disabled=C()!==null,Xe(ke,1,`w-full max-w-[83%] cursor-pointer rounded-lg border border-rc-green-450 bg-transparent p-2 pt-1 text-left text-rc-gray-100 backdrop-blur-md transition-colors hover:bg-rc-green-700 focus:outline-none focus-visible:outline-none disabled:cursor-wait disabled:opacity-70 ${C()===e(ye).id?"bg-rc-green-700":""}`),se(Yt,e(ye).text)}),Le("click",ke,()=>{var Nt;return(Nt=r.onChooseVariant)==null?void 0:Nt.call(r,e(ye).id)}),S(ce,ke)}),w(V),S(R,V)};K(q,R=>{i()&&e(N)===i()&&R(oe)})}w(We),S(J,Ue)}),w(b),Bt(b,J=>E=J,()=>E);var U=M(b,2);{var me=J=>{var N=Fr(),$=M(T(N),2),He=M($,2);w(N),ee(()=>$.disabled=!r.onRegenerateVariants||p()||C()!==null),Le("click",$,()=>{var xe;return(xe=r.onRegenerateVariants)==null?void 0:xe.call(r)}),Le("click",He,()=>{var xe;return(xe=r.onCancelVariants)==null?void 0:xe.call(r)}),S(J,N)},_e=J=>{var N=Lr(),$=De(N);{var He=O=>{var B=zr(),q=T(B,!0);w(B),ee(()=>se(q,e(z))),S(O,B)};K($,O=>{e(z)&&O(He)})}var xe=M($,2),Ve=T(xe),Ue=T(Ve),Je=T(Ue);{var dt=O=>{var B=Ur();Ye(B,23,()=>e(ue),q=>q.text,(q,oe,R)=>{var V=Vr();Ye(V,21,()=>e(oe).segments,_t,(Q,te)=>{var Te=Hr(),Ge=T(Te,!0);w(Te),ee(()=>{Xe(Te,1,Lt(e(te).matched?"text-rc-green-200":"")),se(Ge,e(te).text)}),S(Q,Te)}),w(V),ee(()=>{yt(V,"aria-selected",e(k)===e(R)),Xe(V,1,`w-full select-none border-b border-rc-gray-110 px-3 py-2 text-left font-semibold text-rc-gray-100 last:border-b-0 hover:bg-rc-gray-700/70 ${e(k)===e(R)?"bg-rc-gray-700/70":""}`)}),Le("mousedown",V,Q=>{Q.preventDefault(),ze(e(oe))}),S(q,V)}),w(B),S(O,B)};K(Je,O=>{e(Fe)&&O(dt)})}var We=M(Je,2);{let O=f(()=>e(h)==="system"?"!border-emerald-500 !pl-[5.5rem] hover:!border-emerald-500 focus:!border-emerald-500":"!pl-[4.25rem]"),B=f(()=>e(ne)?"Generating":"Enter message...");Ht(We,{variant:"chat",get class(){return`!text-base !leading-6 !duration-75 ${e(O)??""}`},get placeholder(){return e(B)},autocomplete:"off",get readonly(){return e(ne)},onfocus:Re,onblur:ae,oninput:fe,onkeydown:Ee,get value(){return e(y)},set value(q){s(y,q,!0)},get el(){return e(Y)},set el(q){s(Y,q,!0)}})}var be=M(We,2),gt=T(be,!0);w(be);var ft=M(be,2);{var mt=O=>{var B=qr(),q=T(B),oe=T(q),R=T(oe,!0);w(oe);var V=M(oe),Q=T(V,!0);w(V),w(q),w(B),ee(()=>{Qt(q,e(he)),se(R,e(y)),se(Q,e(Ae))}),S(O,B)};K(ft,O=>{e(k)!==null&&e(Ae)&&O(mt)})}w(Ue);var ot=M(Ue,2);{let O=f(()=>e(ne)||!r.agentType);ie(ot,{size:"small",variant:"secondary",get disabled(){return e(O)},onclick:X,children:(B,q)=>{var oe=Ut(),R=De(oe);{var V=te=>{Be(te,{name:"paperclip"})},Q=te=>{Be(te,{name:"hangup"})};K(R,te=>{r.agentType==="text"?te(V):r.agentType==="voice"&&te(Q,1)})}S(B,oe)},$$slots:{default:!0}})}var vt=M(ot,2);{var pt=O=>{{let B=f(()=>e(ne)||!e(Ct));ie(O,{size:"small",type:"button",title:"Generate response","aria-label":"Generate response",get disabled(){return e(B)},class:"inline-flex !w-[59px] items-center justify-center !px-0",onclick:q=>{q.preventDefault(),Gt()},children:(q,oe)=>{Be(q,{name:"sparkles"})},$$slots:{default:!0}})}},ht=O=>{{let B=f(()=>e(h)==="system"?"Send as system":"Send as user"),q=f(()=>e(h)==="system"?"Send as system":"Send as user");ie(O,{size:"small",type:"submit",get title(){return e(B)},get"aria-label"(){return e(q)},get disabled(){return e(ne)},class:"inline-flex !w-[59px] items-center justify-center !px-0",children:(oe,R)=>{Be(oe,{name:"send"})},$$slots:{default:!0}})}};K(vt,O=>{e(Ne)?O(pt):O(ht,-1)})}w(Ve),w(xe),ee(()=>{Ve.disabled=e(Ie),yt(be,"title",e(h)==="system"?"Switch to user":"Switch to system"),yt(be,"aria-label",e(h)==="system"?"Switch to user":"Switch to system"),be.disabled=e(ne),se(gt,e(h)==="system"?"System":"User")}),bt("submit",xe,it),Le("click",be,O=>{O.preventDefault(),O.stopPropagation(),nt()}),S(J,N)};K(U,J=>{i()?J(me):J(_e,-1)})}bt("scroll",b,J=>tt(J.target)),S(t,I)}}),S(c,Mt),$e()}Vt(["click","mousedown"]);var Wr=P('<div class="mt-1 w-max overflow-hidden rounded-lg border border-rc-gray-110 bg-rc-gray-930 shadow-inner-white-soft backdrop-blur-2xl" role="listbox"><!> <!> <!></div>'),Gr=P('<div class="flex h-full items-center justify-center text-sm text-rc-gray-300">Connecting…</div>'),Kr=P('<div class="flex h-full items-center justify-center text-sm text-rc-gray-300">Select an agent to start chatting</div>'),Yr=P('<div class="h-full min-h-0 p-2"><!></div>'),Xr=P('<div class="relative flex h-full min-h-0 flex-col"><div class="flex flex-none flex-nowrap items-center gap-2 p-2"><!> <div class="ml-auto flex flex-none flex-nowrap items-center gap-2"><!> <!> <!> <!> <!></div></div> <div class="min-h-0 flex-1"><!></div></div>');function xn(c,r){Qe(r,!0);const{state:n,actions:o}=Zt();let i=j(!1),g=j(null);const p=f(()=>{var u,m;const a=(u=n.currentStep)==null?void 0:u.name;return a?((m=Object.values(n.promptEdits).find(F=>F.agentId===n.agentId&&F.step===a))==null?void 0:m.id)??null:null});let C=j(null),v=null,l=j(!1),y=j(null);const le=f(()=>{var u;const a=((u=n.agentStates.at(-1))==null?void 0:u.id)??null;return!!a&&n.currentState===a});Pe(()=>{!re.length&&!st.length&&e(l)&&s(l,!1)});function de(a){const u=(a||"").trim();return u?u.split("/").at(-1)??u:"Agent"}function E(a){if(typeof a!="number"||!Number.isFinite(a))return null;const u=new Date(a);if(Number.isNaN(u.getTime()))return null;const m=String(u.getHours()).padStart(2,"0"),F=String(u.getMinutes()).padStart(2,"0"),L=String(u.getSeconds()).padStart(2,"0");return`${m}:${F}:${L}`}async function Se(a){var X,G;if(e(i))return;s(i,!0);const u=o.openPopover("analyze"),m=E(a.createdAt),F=m?` • ${m}`:"",L=`Analysis — ${de(n.agentId)}${F}`;try{const _=await Ze.agents.analyzeTrace.mutate({agentId:n.agentId,traceId:(X=a.trace)==null?void 0:X.traceId,eventName:a.trace.eventName,createdAt:a.createdAt,model:a.model,renderedPrompt:a.renderedPrompt,stringifiedConversation:a.stringifiedConversation,response:a.response,stepTrace:a.stepTrace});if(((G=n.edit.popover)==null?void 0:G.requestId)!==u)return;o.setHighlightQuotes(_.quotes);let Z=null;try{Z=JSON.stringify(_.raw,null,2)}catch{Z=null}o.setPopoverReady(u,{title:L,quotes:_.quotes,rationales:_.rationales,parallelCalls:_.parallelCalls,raw:Z})}catch(_){console.error(_);const Z=typeof(_==null?void 0:_.message)=="string"?_.message:(()=>{try{return JSON.stringify(_)}catch{return String(_)}})();o.setPopoverError(u,Z||"Failed to analyze this response",{raw:Z})}finally{s(i,!1)}}function Y(a){return a?re:re.map(u=>{if(!Ke(u))return u;const{receivedPrompt:m,renderedPrompt:F,...L}=u;return L})}function he(a){s(C,a,!0),v&&clearTimeout(v),v=window.setTimeout(()=>{s(C,null),v=null},2e3)}async function ne(){try{await navigator.clipboard.writeText(JSON.stringify(st,null,2)),he("logs")}catch(a){console.error("Failed to copy logs",a)}}async function h(a){try{await navigator.clipboard.writeText(JSON.stringify(Y(a),null,2)),he(a?"with-prompts":"without-prompts")}catch(u){console.error("Failed to copy traces",u)}}function z(){H(),o.closePopover(),o.closeContextPopover(),o.selectState(null)}function A(a,u="user"){const m=String(a??"").trim();if(!m)return null;const F=/^\[image\]\s+(.+)$/.exec(m);if(F){const L=(F[1]??"").trim();return L?{sender:u,text:"",imageUrl:L}:null}return{sender:u,text:m}}function D(a){return a==="system"?"system":"user"}function W(a){H();const u=a==null?void 0:a.bosunPrevStateId,m=typeof u=="string"&&u.trim()?u:null,F=typeof(a==null?void 0:a.bosunUserMessage)=="string"&&a.bosunUserMessage||null,L=D(a==null?void 0:a.bosunInputMessageSender);let X=F?A(F,L):null;if(!X){const G=a==null?void 0:a.bosunStateId;if(typeof G=="string"&&G.trim()){const _=n.agentStates.find(Z=>Z.id===G);X=A((_==null?void 0:_.userMessage)??"",D(_==null?void 0:_.userMessageSender))}}if(!X){if(u===void 0)throw new Error("Cannot regenerate: this response has no saved state metadata");o.selectState(m);return}o.selectState(m),o.sendChatMessage({sender:X.sender,text:X.text,imageUrl:X.imageUrl})}function H(){s(g,null)}function k(a){const u=re.indexOf(a),m=u===-1?null:It(re,u);return m&&typeof m.receivedContext<"u"?St(m.receivedContext):St(n.context)}function ue(a){const u=k(a);return n.mocks===null?u:{context:u,mocks:St(n.mocks)}}async function ge(a){if(!n.agentId)return;const u=o.getPromptOverrides();await o.flushPromptSave(),s(g,{sourceTrace:a,choices:[],loading:!0,applyingId:null,error:null},!0);try{const m=await Ze.agents.generateVariants.mutate({agentId:n.agentId,region:n.region,context:ue(a),promptOverrides:u,count:9});if(!e(g)||e(g).sourceTrace!==a)return;s(g,{...e(g),choices:m,loading:!1,error:null},!0)}catch(m){if(console.error("Failed to generate variants",m),!e(g)||e(g).sourceTrace!==a)return;s(g,{...e(g),choices:[],loading:!1,error:typeof(m==null?void 0:m.message)=="string"?m.message:"Failed to generate variants"},!0)}}function Ae(a){ge(a)}function Ne(){o.hangup()}function Oe(){var u;const a=(u=e(g))==null?void 0:u.sourceTrace;a&&ge(a)}async function Fe(a){if(!e(g)||!n.agentId)return;const u=e(g).choices.find(m=>m.id===a);if(u){s(g,{...e(g),applyingId:a,error:null},!0);try{await Ze.agents.commitVariant.mutate({agentId:n.agentId,region:n.region,state:u.state}),H(),Xt(),ar(),o.sendAppEvent({type:"reload-project"})}catch(m){if(console.error("Failed to apply variant",m),!e(g))return;s(g,{...e(g),applyingId:null,error:typeof(m==null?void 0:m.message)=="string"?m.message:"Failed to apply variant"},!0)}}}function ze(){H()}Pe(()=>{const a=e(g),u=n.agentId,m=a==null?void 0:a.sourceTrace;!a||!m||(!u||!re.includes(m))&&s(g,null)});var Re=Xr(),ae=T(Re),fe=T(ae);{var Ee=a=>{dr(a,{get agentStates(){return n.agentStates},get currentState(){return n.currentState},class:"ml-9",onSelectState:u=>o.selectState(u)})};K(fe,a=>{n.agentStates.length>1&&a(Ee)})}var we=M(fe,2),Ce=T(we);{let a=f(()=>!n.agentId);ie(Ce,{variant:"secondary",size:"small",get disabled(){return e(a)},get"aria-expanded"(){return n.contextPopoverOpen},"aria-haspopup":"dialog",get onclick(){return o.toggleContextPopover},children:(u,m)=>{Me();var F=ve("Edit context");S(u,F)},$$slots:{default:!0}})}var je=M(Ce,2);{var et=a=>{{let u=f(()=>!n.agentId);ie(a,{variant:"secondary",size:"small",get disabled(){return e(u)},get"aria-expanded"(){return n.mocksPopoverOpen},"aria-haspopup":"dialog",get onclick(){return o.toggleMocksPopover},children:(m,F)=>{Me();var L=ve("Edit mocks");S(m,L)},$$slots:{default:!0}})}};K(je,a=>{n.playgroundMocks&&a(et)})}var tt=M(je,2);{let a=f(()=>!re.length&&!st.length);ie(tt,{variant:"secondary",size:"small",get disabled(){return e(a)},get"aria-expanded"(){return e(l)},"aria-haspopup":"listbox","aria-controls":"roleplay-copy-dropdown",onclick:u=>{u.stopPropagation(),s(l,!e(l))},get el(){return e(y)},set el(u){s(y,u,!0)},children:(u,m)=>{var F=Ut(),L=De(F);{var X=x=>{var Ie=ve("Copied logs");S(x,Ie)},G=x=>{var Ie=ve("Copied traces (with prompts)");S(x,Ie)},_=x=>{var Ie=ve("Copied traces (without prompts)");S(x,Ie)},Z=x=>{var Ie=ve("Copy...");S(x,Ie)};K(L,x=>{e(C)==="logs"?x(X):e(C)==="with-prompts"?x(G,1):e(C)==="without-prompts"?x(_,2):x(Z,-1)})}S(u,F)},$$slots:{default:!0}})}var rt=M(tt,2);qt(rt,{id:"roleplay-copy-dropdown",get open(){return e(l)},onClose:()=>s(l,!1),get anchorEl(){return e(y)},placement:"bottom-end",offset:[0,1],children:u=>{var m=Wr(),F=T(m);{let G=f(()=>!st.length);ie(F,{variant:"ghost",size:"small",role:"option",get disabled(){return e(G)},onclick:_=>{_.stopPropagation(),s(l,!1),ne()},class:"block rounded-none border-b border-rc-gray-110 py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400",children:(_,Z)=>{Me();var x=ve("Copy logs");S(_,x)},$$slots:{default:!0}})}var L=M(F,2);{let G=f(()=>!re.length);ie(L,{variant:"ghost",size:"small",role:"option",get disabled(){return e(G)},onclick:_=>{_.stopPropagation(),s(l,!1),h(!0)},class:"block rounded-none border-b border-rc-gray-110 py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400",children:(_,Z)=>{Me();var x=ve("Copy traces with prompts");S(_,x)},$$slots:{default:!0}})}var X=M(L,2);{let G=f(()=>!re.length);ie(X,{variant:"ghost",size:"small",role:"option",get disabled(){return e(G)},onclick:_=>{_.stopPropagation(),s(l,!1),h(!1)},class:"block rounded-none py-2 pr-3 text-left backdrop-blur-2xl hover:bg-rc-gray-700 focus:bg-rc-gray-400",children:(_,Z)=>{Me();var x=ve("Copy traces without prompts");S(_,x)},$$slots:{default:!0}})}w(m),S(u,m)},$$slots:{default:!0}});var it=M(rt,2);ie(it,{size:"small",onclick:z,children:(a,u)=>{Me();var m=ve("New chat");S(a,m)},$$slots:{default:!0}}),w(we),w(ae);var nt=M(ae,2),lt=T(nt);{var at=a=>{var u=Gr();S(a,u)},ut=a=>{var u=Kr();S(a,u)},ct=a=>{var u=Yr(),m=T(u);{let F=f(()=>e(le)?Ae:void 0),L=f(()=>{var x;return((x=e(g))==null?void 0:x.sourceTrace)??null}),X=f(()=>{var x;return((x=e(g))==null?void 0:x.choices)??[]}),G=f(()=>{var x;return((x=e(g))==null?void 0:x.loading)??!1}),_=f(()=>{var x;return((x=e(g))==null?void 0:x.applyingId)??null}),Z=f(()=>{var x;return((x=e(g))==null?void 0:x.error)??null});Jr(m,{class:"h-full min-w-0",get context(){return n.context},get mocks(){return n.mocks},get agentId(){return n.agentId},get region(){return n.region},get promptEditProposalId(){return e(p)},get agentType(){return n.agentType},onmessage:x=>o.sendChatMessage(x),get analyzeDisabled(){return e(i)},onAnalyzeTrace:Se,onRegenerateTrace:W,onRevertToState:x=>o.selectState(x),get onSeeVariants(){return e(F)},onHangup:Ne,get variantSourceTrace(){return e(L)},get variantChoices(){return e(X)},get variantLoading(){return e(G)},get variantApplyingId(){return e(_)},get variantError(){return e(Z)},onCancelVariants:H,onRegenerateVariants:Oe,onChooseOriginalVariant:ze,onChooseVariant:Fe})}w(u),S(a,u)};K(lt,a=>{!n.wsLoaded||!n.chatReady?a(at):n.agentId?a(ct,-1):a(ut,1)})}w(nt),w(Re),S(c,Re),$e()}export{xn as component};
@@ -1 +1 @@
1
- {"version":"1790937396597"}
1
+ {"version":"1791311215712"}
@@ -2,9 +2,9 @@ import './shims.js';
2
2
  import 'node:fs';
3
3
  import 'node:path';
4
4
  import 'node:process';
5
- export { h as handler } from './server/chunks/handler-CfBVe8pc.js';
6
- import './server/chunks/index.js-ve0cVNqU.js';
7
- import './server/chunks/manifest.js-BQtoc_eZ.js';
5
+ export { h as handler } from './server/chunks/handler-C5nNwvq2.js';
6
+ import './server/chunks/index.js-OQig22wo.js';
7
+ import './server/chunks/manifest.js-mMK7bnzv.js';
8
8
  import './env.js';
9
9
  import 'node:buffer';
10
10
  import 'node:crypto';
@@ -23,6 +23,6 @@ import './server/chunks/chunks/server.js-Bf8x1V_n.js';
23
23
  import './server/chunks/chunks/exports.js-8HOoaa4e.js';
24
24
  import './server/chunks/chunks/index4.js-C9gg2iSH.js';
25
25
  import './server/chunks/chunks/shared-server.js-DaWdgxVh.js';
26
- import './server/chunks/chunks/internal.js-B9o0piPQ.js';
26
+ import './server/chunks/chunks/internal.js-B2-81-og.js';
27
27
  import './server/chunks/chunks/root.js-CJvqqGUj.js';
28
28
  //# sourceMappingURL=handler.js.map
@@ -1,7 +1,7 @@
1
1
  import http from 'node:http';
2
2
  import fs__default from 'node:fs';
3
3
  import process from 'node:process';
4
- import { p as polka, h as handler, f as format_listening_address } from './server/chunks/handler-CfBVe8pc.js';
4
+ import { p as polka, h as handler, f as format_listening_address } from './server/chunks/handler-C5nNwvq2.js';
5
5
  import { env, timeout_env } from './env.js';
6
6
  import { rm } from 'node:fs/promises';
7
7
  import './shims.js';
@@ -11,7 +11,7 @@ import 'node:path';
11
11
  import 'node:timers';
12
12
  import 'node:querystring';
13
13
  import 'node:stream';
14
- import './server/chunks/index.js-ve0cVNqU.js';
14
+ import './server/chunks/index.js-OQig22wo.js';
15
15
  import './server/chunks/chunks/utils2.js-DyJSCbBx.js';
16
16
  import './server/chunks/chunks/utils.js-BQzn9ikS.js';
17
17
  import './server/chunks/chunks/uneval.js-5Y6J9rDU.js';
@@ -22,9 +22,9 @@ import './server/chunks/chunks/server.js-Bf8x1V_n.js';
22
22
  import './server/chunks/chunks/exports.js-8HOoaa4e.js';
23
23
  import './server/chunks/chunks/index4.js-C9gg2iSH.js';
24
24
  import './server/chunks/chunks/shared-server.js-DaWdgxVh.js';
25
- import './server/chunks/chunks/internal.js-B9o0piPQ.js';
25
+ import './server/chunks/chunks/internal.js-B2-81-og.js';
26
26
  import './server/chunks/chunks/root.js-CJvqqGUj.js';
27
- import './server/chunks/manifest.js-BQtoc_eZ.js';
27
+ import './server/chunks/manifest.js-mMK7bnzv.js';
28
28
  import 'node:url';
29
29
 
30
30
  const path = env('SOCKET_PATH', false);
@@ -95,7 +95,7 @@ const options = {
95
95
  app: ({ head, body, assets, nonce, env }) => '<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <link rel="icon" href="' + assets + '/favicon.png" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n ' + head + '\n </head>\n <body data-sveltekit-preload-data="hover">\n <div style="display: contents">' + body + "</div>\n </body>\n</html>\n",
96
96
  error
97
97
  },
98
- version_hash: "3vfyq8"
98
+ version_hash: "dr01kq"
99
99
  };
100
100
  async function get_hooks() {
101
101
  let handle;
@@ -118,4 +118,4 @@ async function get_hooks() {
118
118
  }
119
119
 
120
120
  export { get_hooks as g, options as o, read_implementation as r, set_read_implementation as s };
121
- //# sourceMappingURL=internal.js-B9o0piPQ.js.map
121
+ //# sourceMappingURL=internal.js-B2-81-og.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js-B9o0piPQ.js","sources":["../../../../.svelte-kit/output/server/chunks/internal.js"],"sourcesContent":["import { r as root } from \"./root.js\";\nimport \"./server.js\";\nimport \"./shared-server.js\";\nlet read_implementation = null;\nfunction set_read_implementation(fn) {\n read_implementation = fn;\n}\nfunction set_manifest(_) {\n}\nconst error = ({ status, message }) => '<!doctype html>\\n<html lang=\"en\">\\n\t<head>\\n\t\t<meta charset=\"utf-8\" />\\n\t\t<title>' + message + `</title>\n\n\t\t<style>\n\t\t\tbody {\n\t\t\t\t--bg: white;\n\t\t\t\t--fg: #222;\n\t\t\t\t--divider: #ccc;\n\t\t\t\tbackground: var(--bg);\n\t\t\t\tcolor: var(--fg);\n\t\t\t\tfont-family:\n\t\t\t\t\tsystem-ui,\n\t\t\t\t\t-apple-system,\n\t\t\t\t\tBlinkMacSystemFont,\n\t\t\t\t\t'Segoe UI',\n\t\t\t\t\tRoboto,\n\t\t\t\t\tOxygen,\n\t\t\t\t\tUbuntu,\n\t\t\t\t\tCantarell,\n\t\t\t\t\t'Open Sans',\n\t\t\t\t\t'Helvetica Neue',\n\t\t\t\t\tsans-serif;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.error {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tmax-width: 32rem;\n\t\t\t\tmargin: 0 1rem;\n\t\t\t}\n\n\t\t\t.status {\n\t\t\t\tfont-weight: 200;\n\t\t\t\tfont-size: 3rem;\n\t\t\t\tline-height: 1;\n\t\t\t\tposition: relative;\n\t\t\t\ttop: -0.05rem;\n\t\t\t}\n\n\t\t\t.message {\n\t\t\t\tborder-left: 1px solid var(--divider);\n\t\t\t\tpadding: 0 0 0 1rem;\n\t\t\t\tmargin: 0 0 0 1rem;\n\t\t\t\tmin-height: 2.5rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.message h1 {\n\t\t\t\tfont-weight: 400;\n\t\t\t\tfont-size: 1em;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t@media (prefers-color-scheme: dark) {\n\t\t\t\tbody {\n\t\t\t\t\t--bg: #222;\n\t\t\t\t\t--fg: #ddd;\n\t\t\t\t\t--divider: #666;\n\t\t\t\t}\n\t\t\t}\n\t\t</style>\n\t</head>\n\t<body>\n\t\t<div class=\"error\">\n\t\t\t<span class=\"status\">` + status + '</span>\\n\t\t\t<div class=\"message\">\\n\t\t\t\t<h1>' + message + \"</h1>\\n\t\t\t</div>\\n\t\t</div>\\n\t</body>\\n</html>\\n\";\nconst options = {\n app_template_contains_nonce: false,\n async: false,\n csp: { \"mode\": \"auto\", \"directives\": { \"upgrade-insecure-requests\": false, \"block-all-mixed-content\": false }, \"reportOnly\": { \"upgrade-insecure-requests\": false, \"block-all-mixed-content\": false } },\n csrf_check_origin: true,\n csrf_trusted_origins: [],\n embedded: false,\n env_public_prefix: \"PUBLIC_\",\n env_private_prefix: \"\",\n hash_routing: false,\n hooks: null,\n // added lazily, via `get_hooks`\n preload_strategy: \"modulepreload\",\n root,\n service_worker: false,\n service_worker_options: void 0,\n server_error_boundaries: false,\n templates: {\n app: ({ head, body, assets, nonce, env }) => '<!doctype html>\\n<html lang=\"en\">\\n <head>\\n <meta charset=\"utf-8\" />\\n <link rel=\"icon\" href=\"' + assets + '/favicon.png\" />\\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\\n ' + head + '\\n </head>\\n <body data-sveltekit-preload-data=\"hover\">\\n <div style=\"display: contents\">' + body + \"</div>\\n </body>\\n</html>\\n\",\n error\n },\n version_hash: \"3vfyq8\"\n};\nasync function get_hooks() {\n let handle;\n let handleFetch;\n let handleError;\n let handleValidationError;\n let init;\n let reroute;\n let transport;\n ({ reroute, transport } = await import(\"../entries/hooks.universal.js\"));\n return {\n handle,\n handleFetch,\n handleError,\n handleValidationError,\n init,\n reroute,\n transport\n };\n}\nexport {\n set_manifest as a,\n get_hooks as g,\n options as o,\n read_implementation as r,\n set_read_implementation as s\n};\n"],"names":[],"mappings":";;AAGG,IAAC,mBAAmB,GAAG;AAC1B,SAAS,uBAAuB,CAAC,EAAE,EAAE;AACrC,EAAE,mBAAmB,GAAG,EAAE;AAC1B;AAGA,MAAM,KAAK,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,mFAAmF,GAAG,OAAO,GAAG,CAAC;;AAExI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,CAAC,GAAG,MAAM,GAAG,6CAA6C,GAAG,OAAO,GAAG,iDAAiD;AAC3I,MAAC,OAAO,GAAG;AAChB,EAAE,2BAA2B,EAAE,KAAK;AACpC,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,2BAA2B,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,2BAA2B,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,EAAE;AACzM,EAAE,iBAAiB,EAAE,IAAI;AACzB,EAAE,oBAAoB,EAAE,EAAE;AAC1B,EAAE,QAAQ,EAAE,KAAK;AACjB,EAAE,iBAAiB,EAAE,SAAS;AAC9B,EAAE,kBAAkB,EAAE,EAAE;AACxB,EAAE,YAAY,EAAE,KAAK;AACrB,EAAE,KAAK,EAAE,IAAI;AACb;AACA,EAAE,gBAAgB,EAAE,eAAe;AACnC,EAAE,IAAI;AACN,EAAE,cAAc,EAAE,KAAK;AACvB,EAAE,sBAAsB,EAAE,MAAM;AAChC,EAAE,uBAAuB,EAAE,KAAK;AAChC,EAAE,SAAS,EAAE;AACb,IAAI,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,kHAAkH,GAAG,MAAM,GAAG,4GAA4G,GAAG,IAAI,GAAG,wGAAwG,GAAG,IAAI,GAAG,gCAAgC;AACvb,IAAI;AACJ,GAAG;AACH,EAAE,YAAY,EAAE;AAChB;AACA,eAAe,SAAS,GAAG;AAC3B,EAAE,IAAI,MAAM;AACZ,EAAE,IAAI,WAAW;AACjB,EAAE,IAAI,WAAW;AACjB,EAAE,IAAI,qBAAqB;AAC3B,EAAE,IAAI,IAAI;AACV,EAAE,IAAI,OAAO;AACb,EAAE,IAAI,SAAS;AACf,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,OAAO,2CAA+B,CAAC;AACzE,EAAE,OAAO;AACT,IAAI,MAAM;AACV,IAAI,WAAW;AACf,IAAI,WAAW;AACf,IAAI,qBAAqB;AACzB,IAAI,IAAI;AACR,IAAI,OAAO;AACX,IAAI;AACJ,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"internal.js-B2-81-og.js","sources":["../../../../.svelte-kit/output/server/chunks/internal.js"],"sourcesContent":["import { r as root } from \"./root.js\";\nimport \"./server.js\";\nimport \"./shared-server.js\";\nlet read_implementation = null;\nfunction set_read_implementation(fn) {\n read_implementation = fn;\n}\nfunction set_manifest(_) {\n}\nconst error = ({ status, message }) => '<!doctype html>\\n<html lang=\"en\">\\n\t<head>\\n\t\t<meta charset=\"utf-8\" />\\n\t\t<title>' + message + `</title>\n\n\t\t<style>\n\t\t\tbody {\n\t\t\t\t--bg: white;\n\t\t\t\t--fg: #222;\n\t\t\t\t--divider: #ccc;\n\t\t\t\tbackground: var(--bg);\n\t\t\t\tcolor: var(--fg);\n\t\t\t\tfont-family:\n\t\t\t\t\tsystem-ui,\n\t\t\t\t\t-apple-system,\n\t\t\t\t\tBlinkMacSystemFont,\n\t\t\t\t\t'Segoe UI',\n\t\t\t\t\tRoboto,\n\t\t\t\t\tOxygen,\n\t\t\t\t\tUbuntu,\n\t\t\t\t\tCantarell,\n\t\t\t\t\t'Open Sans',\n\t\t\t\t\t'Helvetica Neue',\n\t\t\t\t\tsans-serif;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.error {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tmax-width: 32rem;\n\t\t\t\tmargin: 0 1rem;\n\t\t\t}\n\n\t\t\t.status {\n\t\t\t\tfont-weight: 200;\n\t\t\t\tfont-size: 3rem;\n\t\t\t\tline-height: 1;\n\t\t\t\tposition: relative;\n\t\t\t\ttop: -0.05rem;\n\t\t\t}\n\n\t\t\t.message {\n\t\t\t\tborder-left: 1px solid var(--divider);\n\t\t\t\tpadding: 0 0 0 1rem;\n\t\t\t\tmargin: 0 0 0 1rem;\n\t\t\t\tmin-height: 2.5rem;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\n\t\t\t.message h1 {\n\t\t\t\tfont-weight: 400;\n\t\t\t\tfont-size: 1em;\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t@media (prefers-color-scheme: dark) {\n\t\t\t\tbody {\n\t\t\t\t\t--bg: #222;\n\t\t\t\t\t--fg: #ddd;\n\t\t\t\t\t--divider: #666;\n\t\t\t\t}\n\t\t\t}\n\t\t</style>\n\t</head>\n\t<body>\n\t\t<div class=\"error\">\n\t\t\t<span class=\"status\">` + status + '</span>\\n\t\t\t<div class=\"message\">\\n\t\t\t\t<h1>' + message + \"</h1>\\n\t\t\t</div>\\n\t\t</div>\\n\t</body>\\n</html>\\n\";\nconst options = {\n app_template_contains_nonce: false,\n async: false,\n csp: { \"mode\": \"auto\", \"directives\": { \"upgrade-insecure-requests\": false, \"block-all-mixed-content\": false }, \"reportOnly\": { \"upgrade-insecure-requests\": false, \"block-all-mixed-content\": false } },\n csrf_check_origin: true,\n csrf_trusted_origins: [],\n embedded: false,\n env_public_prefix: \"PUBLIC_\",\n env_private_prefix: \"\",\n hash_routing: false,\n hooks: null,\n // added lazily, via `get_hooks`\n preload_strategy: \"modulepreload\",\n root,\n service_worker: false,\n service_worker_options: void 0,\n server_error_boundaries: false,\n templates: {\n app: ({ head, body, assets, nonce, env }) => '<!doctype html>\\n<html lang=\"en\">\\n <head>\\n <meta charset=\"utf-8\" />\\n <link rel=\"icon\" href=\"' + assets + '/favicon.png\" />\\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\\n ' + head + '\\n </head>\\n <body data-sveltekit-preload-data=\"hover\">\\n <div style=\"display: contents\">' + body + \"</div>\\n </body>\\n</html>\\n\",\n error\n },\n version_hash: \"dr01kq\"\n};\nasync function get_hooks() {\n let handle;\n let handleFetch;\n let handleError;\n let handleValidationError;\n let init;\n let reroute;\n let transport;\n ({ reroute, transport } = await import(\"../entries/hooks.universal.js\"));\n return {\n handle,\n handleFetch,\n handleError,\n handleValidationError,\n init,\n reroute,\n transport\n };\n}\nexport {\n set_manifest as a,\n get_hooks as g,\n options as o,\n read_implementation as r,\n set_read_implementation as s\n};\n"],"names":[],"mappings":";;AAGG,IAAC,mBAAmB,GAAG;AAC1B,SAAS,uBAAuB,CAAC,EAAE,EAAE;AACrC,EAAE,mBAAmB,GAAG,EAAE;AAC1B;AAGA,MAAM,KAAK,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,mFAAmF,GAAG,OAAO,GAAG,CAAC;;AAExI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,CAAC,GAAG,MAAM,GAAG,6CAA6C,GAAG,OAAO,GAAG,iDAAiD;AAC3I,MAAC,OAAO,GAAG;AAChB,EAAE,2BAA2B,EAAE,KAAK;AACpC,EAAE,KAAK,EAAE,KAAK;AACd,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,2BAA2B,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,EAAE,YAAY,EAAE,EAAE,2BAA2B,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,EAAE;AACzM,EAAE,iBAAiB,EAAE,IAAI;AACzB,EAAE,oBAAoB,EAAE,EAAE;AAC1B,EAAE,QAAQ,EAAE,KAAK;AACjB,EAAE,iBAAiB,EAAE,SAAS;AAC9B,EAAE,kBAAkB,EAAE,EAAE;AACxB,EAAE,YAAY,EAAE,KAAK;AACrB,EAAE,KAAK,EAAE,IAAI;AACb;AACA,EAAE,gBAAgB,EAAE,eAAe;AACnC,EAAE,IAAI;AACN,EAAE,cAAc,EAAE,KAAK;AACvB,EAAE,sBAAsB,EAAE,MAAM;AAChC,EAAE,uBAAuB,EAAE,KAAK;AAChC,EAAE,SAAS,EAAE;AACb,IAAI,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,kHAAkH,GAAG,MAAM,GAAG,4GAA4G,GAAG,IAAI,GAAG,wGAAwG,GAAG,IAAI,GAAG,gCAAgC;AACvb,IAAI;AACJ,GAAG;AACH,EAAE,YAAY,EAAE;AAChB;AACA,eAAe,SAAS,GAAG;AAC3B,EAAE,IAAI,MAAM;AACZ,EAAE,IAAI,WAAW;AACjB,EAAE,IAAI,WAAW;AACjB,EAAE,IAAI,qBAAqB;AAC3B,EAAE,IAAI,IAAI;AACV,EAAE,IAAI,OAAO;AACb,EAAE,IAAI,SAAS;AACf,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,OAAO,2CAA+B,CAAC;AACzE,EAAE,OAAO;AACT,IAAI,MAAM;AACV,IAAI,WAAW;AACf,IAAI,WAAW;AACf,IAAI,qBAAqB;AACzB,IAAI,IAAI;AACR,IAAI,OAAO;AACX,IAAI;AACJ,GAAG;AACH;;;;"}
@@ -1,6 +1,6 @@
1
1
  const chatContent = [];
2
2
  function isStepTrace(entry) {
3
- return !isApiCallTrace(entry) && !isConversationalTrace(entry);
3
+ return !isApiCallTrace(entry) && !isConversationalTrace(entry) && !isPlaygroundMockTrace(entry);
4
4
  }
5
5
  function isApiCallTrace(entry) {
6
6
  return "operationName" in entry && "method" in entry && "path" in entry;
@@ -8,6 +8,9 @@ function isApiCallTrace(entry) {
8
8
  function isConversationalTrace(entry) {
9
9
  return "eventName" in entry && "role" in entry && "medium" in entry && "content" in entry;
10
10
  }
11
+ function isPlaygroundMockTrace(entry) {
12
+ return "changedMockKeys" in entry && "status" in entry && "summary" in entry;
13
+ }
11
14
  function clearChatContent() {
12
15
  chatContent.length = 0;
13
16
  }
@@ -16,5 +19,5 @@ function clearLogs() {
16
19
  logContent.length = 0;
17
20
  }
18
21
 
19
- export { clearLogs as a, isConversationalTrace as b, clearChatContent as c, isStepTrace as d, chatContent as e, isApiCallTrace as i, logContent as l };
20
- //# sourceMappingURL=log-content.svelte.js-C6EzbHLC.js.map
22
+ export { clearLogs as a, isPlaygroundMockTrace as b, clearChatContent as c, isConversationalTrace as d, isStepTrace as e, chatContent as f, isApiCallTrace as i, logContent as l };
23
+ //# sourceMappingURL=log-content.svelte.js-NCi6Gu4g.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-content.svelte.js-NCi6Gu4g.js","sources":["../../../../.svelte-kit/output/server/chunks/log-content.svelte.js"],"sourcesContent":["const chatContent = [];\nfunction isStepTrace(entry) {\n return !isApiCallTrace(entry) && !isConversationalTrace(entry) && !isPlaygroundMockTrace(entry);\n}\nfunction isApiCallTrace(entry) {\n return \"operationName\" in entry && \"method\" in entry && \"path\" in entry;\n}\nfunction isConversationalTrace(entry) {\n return \"eventName\" in entry && \"role\" in entry && \"medium\" in entry && \"content\" in entry;\n}\nfunction isPlaygroundMockTrace(entry) {\n return \"changedMockKeys\" in entry && \"status\" in entry && \"summary\" in entry;\n}\nfunction clearChatContent() {\n chatContent.length = 0;\n}\nconst logContent = [];\nfunction clearLogs() {\n logContent.length = 0;\n}\nexport {\n clearLogs as a,\n isPlaygroundMockTrace as b,\n clearChatContent as c,\n isConversationalTrace as d,\n isStepTrace as e,\n chatContent as f,\n isApiCallTrace as i,\n logContent as l\n};\n"],"names":[],"mappings":"AAAK,MAAC,WAAW,GAAG;AACpB,SAAS,WAAW,CAAC,KAAK,EAAE;AAC5B,EAAE,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;AACjG;AACA,SAAS,cAAc,CAAC,KAAK,EAAE;AAC/B,EAAE,OAAO,eAAe,IAAI,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK;AACzE;AACA,SAAS,qBAAqB,CAAC,KAAK,EAAE;AACtC,EAAE,OAAO,WAAW,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK;AAC3F;AACA,SAAS,qBAAqB,CAAC,KAAK,EAAE;AACtC,EAAE,OAAO,iBAAiB,IAAI,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK;AAC9E;AACA,SAAS,gBAAgB,GAAG;AAC5B,EAAE,WAAW,CAAC,MAAM,GAAG,CAAC;AACxB;AACK,MAAC,UAAU,GAAG;AACnB,SAAS,SAAS,GAAG;AACrB,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC;AACvB;;;;"}
@@ -23,7 +23,7 @@ import { A as AgentSidebar } from '../../../../chunks/AgentSidebar.js-CFHwsTeS.j
23
23
  import { g as getAgentsContext } from '../../../../chunks/agents-context.js-DdI5kzRS.js';
24
24
  import { s as setEditWorkspaceContext, g as getEditWorkspaceContext } from '../../../../chunks/edit-workspace-context.js-DGPpbvI5.js';
25
25
  import '../../../../chunks/js-yaml.js-Dx-xfeGn.js';
26
- import { c as clearChatContent, a as clearLogs } from '../../../../chunks/log-content.svelte.js-C6EzbHLC.js';
26
+ import { c as clearChatContent, a as clearLogs } from '../../../../chunks/log-content.svelte.js-NCi6Gu4g.js';
27
27
  import '../../../../chunks/uneval.js-5Y6J9rDU.js';
28
28
  import '../../../../chunks/index4.js-C9gg2iSH.js';
29
29
  import '../../../../chunks/root.js-CJvqqGUj.js';
@@ -117,6 +117,12 @@ class WebSocketClient {
117
117
  message.trace?.role,
118
118
  message.trace?.medium
119
119
  );
120
+ } else if (message.channel === "playground-mock-trace") {
121
+ console.log(
122
+ "MSG: playground-mock-trace",
123
+ message.trace.operationName,
124
+ message.trace.status
125
+ );
120
126
  }
121
127
  this.messageHandler?.(message);
122
128
  };
@@ -7690,7 +7696,12 @@ function ContextEditor($$renderer, $$props) {
7690
7696
  let editorDisposables = [];
7691
7697
  let persistViewStateTimeout = null;
7692
7698
  let {
7699
+ context,
7700
+ onContextChanged,
7693
7701
  class: className,
7702
+ suppressErrors = false,
7703
+ defaultFormat = "yaml",
7704
+ hideHeader = false,
7694
7705
  editorStateKey = "editorState/context/default"
7695
7706
  } = $$props;
7696
7707
  function persistViewStateNow() {
@@ -7740,13 +7751,36 @@ function ContextEditor($$renderer, $$props) {
7740
7751
  }
7741
7752
  function ModeContextPopoverContent($$renderer, $$props) {
7742
7753
  $$renderer.component(($$renderer2) => {
7743
- const tmp = getEditWorkspaceContext(), workspace = tmp.state;
7744
- tmp.actions;
7754
+ const tmp = getEditWorkspaceContext(), workspace = tmp.state, actions = tmp.actions;
7755
+ function handleContextChanged(newContext) {
7756
+ workspace.context = newContext;
7757
+ actions.sendAppEvent({ type: "context-updated", context: newContext });
7758
+ }
7745
7759
  $$renderer2.push(`<div class="min-h-0 flex-1 overflow-hidden p-3">`);
7746
7760
  ContextEditor($$renderer2, {
7747
7761
  class: "h-full min-h-0 border-thin border-rc-gray-650 shadow-inner-white-soft backdrop-blur-3xl focus:outline-none focus:ring-0",
7748
7762
  context: workspace.context,
7749
- editorStateKey: `editorState/context/${workspace.agentId}/${workspace.currentStep?.name ?? "main"}`
7763
+ onContextChanged: handleContextChanged,
7764
+ editorStateKey: `editorState/context/${workspace.agentId}/${workspace.currentStep?.name ?? "main"}`,
7765
+ suppressErrors: true
7766
+ });
7767
+ $$renderer2.push(`<!----></div>`);
7768
+ });
7769
+ }
7770
+ function ModeMocksPopoverContent($$renderer, $$props) {
7771
+ $$renderer.component(($$renderer2) => {
7772
+ const tmp = getEditWorkspaceContext(), workspace = tmp.state, actions = tmp.actions;
7773
+ function handleMocksChanged(mocks) {
7774
+ workspace.mocks = mocks;
7775
+ actions.sendAppEvent({ type: "mocks-updated", mocks });
7776
+ }
7777
+ $$renderer2.push(`<div class="min-h-0 flex-1 overflow-hidden p-3">`);
7778
+ ContextEditor($$renderer2, {
7779
+ class: "h-full min-h-0 border-thin border-rc-gray-650 shadow-inner-white-soft backdrop-blur-3xl focus:outline-none focus:ring-0",
7780
+ context: workspace.mocks,
7781
+ onContextChanged: handleMocksChanged,
7782
+ editorStateKey: `editorState/mocks/${workspace.agentId}`,
7783
+ suppressErrors: true
7750
7784
  });
7751
7785
  $$renderer2.push(`<!----></div>`);
7752
7786
  });
@@ -8059,6 +8093,7 @@ function _layout($$renderer, $$props) {
8059
8093
  availableRegions: [],
8060
8094
  defaultRegion: null,
8061
8095
  agentType: void 0,
8096
+ playgroundMocks: false,
8062
8097
  wsLoaded: false,
8063
8098
  chatReady: false,
8064
8099
  steps: [],
@@ -8066,10 +8101,12 @@ function _layout($$renderer, $$props) {
8066
8101
  promptDrafts: {},
8067
8102
  promptEdits: {},
8068
8103
  context: null,
8104
+ mocks: null,
8069
8105
  promptContext: null,
8070
8106
  agentStates: [],
8071
8107
  currentState: null,
8072
8108
  contextPopoverOpen: false,
8109
+ mocksPopoverOpen: false,
8073
8110
  edit: initEditState({ pathname: page.url.pathname })
8074
8111
  };
8075
8112
  const regionDropdownId = "region-dropdown";
@@ -8381,6 +8418,7 @@ function _layout($$renderer, $$props) {
8381
8418
  }
8382
8419
  function openModePopover(kind) {
8383
8420
  workspace.contextPopoverOpen = false;
8421
+ workspace.mocksPopoverOpen = false;
8384
8422
  workspace.edit = openPopover(workspace.edit, { kind });
8385
8423
  return workspace.edit.popover?.requestId ?? 0;
8386
8424
  }
@@ -8395,6 +8433,7 @@ function _layout($$renderer, $$props) {
8395
8433
  }
8396
8434
  function openContextPopover() {
8397
8435
  closeModePopover();
8436
+ workspace.mocksPopoverOpen = false;
8398
8437
  workspace.contextPopoverOpen = true;
8399
8438
  }
8400
8439
  function closeContextPopover() {
@@ -8404,9 +8443,22 @@ function _layout($$renderer, $$props) {
8404
8443
  if (workspace.contextPopoverOpen) closeContextPopover();
8405
8444
  else openContextPopover();
8406
8445
  }
8446
+ function openMocksPopover() {
8447
+ closeModePopover();
8448
+ workspace.contextPopoverOpen = false;
8449
+ workspace.mocksPopoverOpen = true;
8450
+ }
8451
+ function closeMocksPopover() {
8452
+ workspace.mocksPopoverOpen = false;
8453
+ }
8454
+ function toggleMocksPopover() {
8455
+ if (workspace.mocksPopoverOpen) closeMocksPopover();
8456
+ else openMocksPopover();
8457
+ }
8407
8458
  function closeAllPopovers() {
8408
8459
  closeModePopover();
8409
8460
  closeContextPopover();
8461
+ closeMocksPopover();
8410
8462
  }
8411
8463
  function popoverTitle(kind) {
8412
8464
  if (kind === "analyze") return "Analyze";
@@ -8544,6 +8596,9 @@ function _layout($$renderer, $$props) {
8544
8596
  openContextPopover,
8545
8597
  closeContextPopover,
8546
8598
  toggleContextPopover,
8599
+ openMocksPopover,
8600
+ closeMocksPopover,
8601
+ toggleMocksPopover,
8547
8602
  openAiEdit: (request) => openAiEditModal(request),
8548
8603
  sendAppEvent,
8549
8604
  sendChatMessage: (message) => {
@@ -8916,6 +8971,22 @@ function _layout($$renderer, $$props) {
8916
8971
  } else {
8917
8972
  $$renderer4.push("<!--[-1-->");
8918
8973
  }
8974
+ $$renderer4.push(`<!--]--> `);
8975
+ if (workspace.mocksPopoverOpen) {
8976
+ $$renderer4.push("<!--[0-->");
8977
+ {
8978
+ let children2 = function($$renderer5) {
8979
+ ModeMocksPopoverContent($$renderer5);
8980
+ };
8981
+ PopoverModal($$renderer4, {
8982
+ title: "Edit mocks",
8983
+ onClose: closeMocksPopover,
8984
+ children: children2
8985
+ });
8986
+ }
8987
+ } else {
8988
+ $$renderer4.push("<!--[-1-->");
8989
+ }
8919
8990
  $$renderer4.push(`<!--]-->`);
8920
8991
  }
8921
8992
  });
@@ -9086,4 +9157,4 @@ function _layout($$renderer, $$props) {
9086
9157
  }
9087
9158
 
9088
9159
  export { _layout as default };
9089
- //# sourceMappingURL=_layout.svelte.js-B2wHKJV7.js.map
9160
+ //# sourceMappingURL=_layout.svelte.js-bpxxSpHz.js.map