orc-ai 0.1.67 → 0.1.68

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 (178) hide show
  1. package/dist/index.js +882 -842
  2. package/dist/skills/orc-platform/references/html-kit.md +3 -3
  3. package/dist/web/assets/Agents-DywRmYEM.js +34 -0
  4. package/dist/web/assets/Audit-Bwj_b97K.js +1 -0
  5. package/dist/web/assets/Bar-BEUEq4ZT.js +3 -0
  6. package/dist/web/assets/BarChart-DJZEJEg6.js +1 -0
  7. package/dist/web/assets/Chart-BMFNlgbS.js +1 -0
  8. package/dist/web/assets/ChatAnalyticsCharts-iTBR2Iod.js +1 -0
  9. package/dist/web/assets/ChatUiRenderer-C_zxzai1.js +4 -0
  10. package/dist/web/assets/ConfirmDialog-TrdcniMK.js +1 -0
  11. package/dist/web/assets/Dashboard-BgBJ-gaW.js +1 -0
  12. package/dist/web/assets/Dashboard-R9DrLwVP.css +1 -0
  13. package/dist/web/assets/DocumentWorkspace-LHgC6hHQ.js +1 -0
  14. package/dist/web/assets/FileEditor-dfjyLTPe.js +1 -0
  15. package/dist/web/assets/IntegrationCallback-DqJyQK0S.js +1 -0
  16. package/dist/web/assets/JobWebhooks-CKOr3jed.js +1 -0
  17. package/dist/web/assets/Jobs-DSxiN8po.js +3 -0
  18. package/dist/web/assets/Knowledge-BD44kGtr.js +1 -0
  19. package/dist/web/assets/Line-BwNoqzSJ.js +1 -0
  20. package/dist/web/assets/Markdown-wp7JBOSy.js +2 -0
  21. package/dist/web/assets/MarkdownEditor-C7LnwPSG.js +2 -0
  22. package/dist/web/assets/MarkdownRenderer-BSMKIlhI.js +155 -0
  23. package/dist/web/assets/{NativeFolderField-D-0kw2x4.js → NativeFolderField-Dhv4RPD1.js} +1 -1
  24. package/dist/web/assets/{Notifications-8mf4wQSZ.js → Notifications-DXEO3YYr.js} +1 -1
  25. package/dist/web/assets/PackageCatalog-B0iUVqDT.js +8 -0
  26. package/dist/web/assets/{PackageRunDialog-C4MAbUYz.js → PackageRunDialog-CLHkQ8eX.js} +47 -47
  27. package/dist/web/assets/{PriorityBadge-CzL7cjTr.js → PriorityBadge-CMPd6WIn.js} +1 -1
  28. package/dist/web/assets/Projects-DspRZmEB.js +3 -0
  29. package/dist/web/assets/{ResponsiveFilters-BDHgHwbe.js → ResponsiveFilters-DvvXTUvm.js} +1 -1
  30. package/dist/web/assets/ResumeActions-Cri_ELlT.js +1 -0
  31. package/dist/web/assets/Rules-DIEUqjom.js +18 -0
  32. package/dist/web/assets/ScratchpadDiagramEditor-DrhudDAR.js +1 -0
  33. package/dist/web/assets/Scratchpads-Dx63kejq.js +10 -0
  34. package/dist/web/assets/{SessionContextChart-CfkrwDME.js → SessionContextChart-DUt9FMyB.js} +1 -1
  35. package/dist/web/assets/Settings-mBKGeMDZ.js +14 -0
  36. package/dist/web/assets/Skills-DxA4iJbU.js +3 -0
  37. package/dist/web/assets/{SourceEditor-DGpMMbEA.js → SourceEditor-D6REoj6r.js} +4 -4
  38. package/dist/web/assets/TaskDetailSheet-gmBq89hq.js +1 -0
  39. package/dist/web/assets/Tasks-K21Wd_dl.js +22 -0
  40. package/dist/web/assets/Terminals-C6dIWjNm.js +1 -0
  41. package/dist/web/assets/UsageSettings-CCV85_v_.js +1 -0
  42. package/dist/web/assets/ViewHeader-B2ixMGCg.js +1 -0
  43. package/dist/web/assets/Webhooks-D7QgOM_f.js +1 -0
  44. package/dist/web/assets/{badge-DkZMrS1S.js → badge-Cq37de8d.js} +1 -1
  45. package/dist/web/assets/{button-DeTgVWBh.js → button-DaSTTBls.js} +1 -1
  46. package/dist/web/assets/chat-DGhEIqmi.js +69 -0
  47. package/dist/web/assets/chat-ui-chart-CdwnX81S.js +1 -0
  48. package/dist/web/assets/check-qe2BJPmy.js +1 -0
  49. package/dist/web/assets/chevron-down-BRt1smOS.js +1 -0
  50. package/dist/web/assets/{client-C0cF5m6-.js → client-BD4crXth.js} +1 -1
  51. package/dist/web/assets/coding-agents-UkijH6GA.js +1 -0
  52. package/dist/web/assets/dialog-CSqhD8HZ.js +1 -0
  53. package/dist/web/assets/{dist-DxPLB3GS.js → dist-BJbQo-dr.js} +1 -1
  54. package/dist/web/assets/dist-D8Wfxh48.js +1 -0
  55. package/dist/web/assets/{dist-CG7sCn9m.js → dist-DWfyUCyc.js} +1 -1
  56. package/dist/web/assets/{download-vwV9XGjB.js → download-CNL1ZoL6.js} +1 -1
  57. package/dist/web/assets/file-kind-BYU1kv95.js +1 -0
  58. package/dist/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  59. package/dist/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  60. package/dist/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  61. package/dist/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  62. package/dist/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  63. package/dist/web/assets/highlighted-body-JLMTFACH-Du_UMrf_.js +1 -0
  64. package/dist/web/assets/index-BHal5gcw.css +1 -0
  65. package/dist/web/assets/index-Q_RymVqx.js +236 -0
  66. package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  67. package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  68. package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  69. package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  70. package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  71. package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  72. package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  73. package/dist/web/assets/label-dQSF_SAL.js +1 -0
  74. package/dist/web/assets/{maximize-2-DkkQv64-.js → maximize-2-BAy-8JsG.js} +1 -1
  75. package/dist/web/assets/mermaid-WFAXDIZX-DSr9ZJx6.js +1 -0
  76. package/dist/web/assets/{orc-kit-BZEVA3Qv.js → orc-kit-TFHF-l0v.js} +32 -3
  77. package/dist/web/assets/scroll-area-BnIPAyIC.js +1 -0
  78. package/dist/web/assets/select-BJy2oop5.js +1 -0
  79. package/dist/web/assets/{table-BghcPb3T.js → table-CVtwh2DT.js} +1 -1
  80. package/dist/web/assets/tabs-BvxkGUc3.js +1 -0
  81. package/dist/web/assets/textarea-Cf2b0PUV.js +1 -0
  82. package/dist/web/assets/{upload-DM_myzsG.js → upload-DdD8zkeP.js} +1 -1
  83. package/dist/web/assets/useBackends-wj1KheAL.js +1 -0
  84. package/dist/web/assets/{useIntegrations-CwksniBf.js → useIntegrations-CsGP9sio.js} +1 -1
  85. package/dist/web/assets/{useJobs-CLj3jAlx.js → useJobs-DJfPRESN.js} +1 -1
  86. package/dist/web/assets/{useListSelection-BCmeXReo.js → useListSelection-DUGh7MfO.js} +1 -1
  87. package/dist/web/assets/{x-BbZ0euHI.js → x-Cli9YXXI.js} +1 -1
  88. package/dist/web/geist-LICENSE.txt +93 -0
  89. package/dist/web/index.html +50 -21
  90. package/dist/web/{ibm-plex-sans-LICENSE.txt → inter-LICENSE.txt} +1 -1
  91. package/package.json +1 -1
  92. package/dist/web/assets/Agents-Btw9GSoH.js +0 -34
  93. package/dist/web/assets/Audit-BrzyRS5i.js +0 -1
  94. package/dist/web/assets/BarChart-DAz5P98C.js +0 -3
  95. package/dist/web/assets/Chart-BNguc0T2.js +0 -1
  96. package/dist/web/assets/ChatAnalyticsCharts-B8DCNbHq.js +0 -1
  97. package/dist/web/assets/ChatUiRenderer-BR3sfc-Z.js +0 -4
  98. package/dist/web/assets/ConfirmDialog-CtTOXkX8.js +0 -1
  99. package/dist/web/assets/Dashboard-BKr-jp7s.css +0 -1
  100. package/dist/web/assets/Dashboard-C5mM9PJs.js +0 -1
  101. package/dist/web/assets/DocumentWorkspace-BbG32kAW.js +0 -1
  102. package/dist/web/assets/FileEditor-BCD6enuO.js +0 -1
  103. package/dist/web/assets/IntegrationCallback-Bik_7SCS.js +0 -1
  104. package/dist/web/assets/JobWebhooks-RIKnoQh3.js +0 -1
  105. package/dist/web/assets/Jobs-CsSOIqGB.js +0 -3
  106. package/dist/web/assets/Knowledge-DKb5Bndb.js +0 -1
  107. package/dist/web/assets/MarkdownRenderer-BCh_ruCd.js +0 -313
  108. package/dist/web/assets/PackageCatalog-DhD3xXBL.js +0 -8
  109. package/dist/web/assets/Projects-CvtUb494.js +0 -3
  110. package/dist/web/assets/ResumeActions-CIHfpmTC.js +0 -1
  111. package/dist/web/assets/Rules-D1bQTlzi.js +0 -18
  112. package/dist/web/assets/ScratchpadDiagramEditor-DukGReMq.js +0 -1
  113. package/dist/web/assets/Scratchpads-BPiujcq_.js +0 -10
  114. package/dist/web/assets/Settings-CM3tx3Gz.js +0 -14
  115. package/dist/web/assets/Skills-CwHwz6Er.js +0 -3
  116. package/dist/web/assets/TagInput-FeirXeiF.js +0 -1
  117. package/dist/web/assets/TaskDetailSheet-CK2rs3F0.js +0 -1
  118. package/dist/web/assets/Tasks-Dbxfmfm1.js +0 -22
  119. package/dist/web/assets/Terminals-CeK7rAIg.js +0 -1
  120. package/dist/web/assets/ViewHeader-CdTYgjcL.js +0 -1
  121. package/dist/web/assets/Webhooks-1EQvtBPS.js +0 -1
  122. package/dist/web/assets/check-LRl-dSYs.js +0 -1
  123. package/dist/web/assets/chevron-down-DtC3kwL9.js +0 -1
  124. package/dist/web/assets/circle-check-DmFYS6qN.js +0 -1
  125. package/dist/web/assets/highlighted-body-JLMTFACH-DBFcem9W.js +0 -1
  126. package/dist/web/assets/ibm-plex-sans-cyrillic-400-normal-BTotfTJu.woff +0 -0
  127. package/dist/web/assets/ibm-plex-sans-cyrillic-400-normal-DZqxrq2p.woff2 +0 -0
  128. package/dist/web/assets/ibm-plex-sans-cyrillic-500-normal-ByOcLdNv.woff +0 -0
  129. package/dist/web/assets/ibm-plex-sans-cyrillic-500-normal-CocWQlwt.woff2 +0 -0
  130. package/dist/web/assets/ibm-plex-sans-cyrillic-600-normal-71GNu3SW.woff2 +0 -0
  131. package/dist/web/assets/ibm-plex-sans-cyrillic-600-normal-BGq0mW3O.woff +0 -0
  132. package/dist/web/assets/ibm-plex-sans-cyrillic-700-normal-D_uavGvn.woff2 +0 -0
  133. package/dist/web/assets/ibm-plex-sans-cyrillic-700-normal-RFb1v-CK.woff +0 -0
  134. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-400-normal-Dsrv2Tcn.woff +0 -0
  135. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-400-normal-g30qAdWV.woff2 +0 -0
  136. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-500-normal-Cs5J6C77.woff2 +0 -0
  137. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-500-normal-DB5PtV2g.woff +0 -0
  138. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-600-normal-Bz0x94Yp.woff +0 -0
  139. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-600-normal-DUMzJB7m.woff2 +0 -0
  140. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-700-normal-BmRLXWpJ.woff2 +0 -0
  141. package/dist/web/assets/ibm-plex-sans-cyrillic-ext-700-normal-DCQwxkRk.woff +0 -0
  142. package/dist/web/assets/ibm-plex-sans-greek-400-normal-D9ESIMu3.woff +0 -0
  143. package/dist/web/assets/ibm-plex-sans-greek-400-normal-_efipK4i.woff2 +0 -0
  144. package/dist/web/assets/ibm-plex-sans-greek-500-normal-CuWXN6rf.woff +0 -0
  145. package/dist/web/assets/ibm-plex-sans-greek-500-normal-JMMifIXV.woff2 +0 -0
  146. package/dist/web/assets/ibm-plex-sans-greek-600-normal-D-CqTdkO.woff +0 -0
  147. package/dist/web/assets/ibm-plex-sans-greek-600-normal-DzTrcv_p.woff2 +0 -0
  148. package/dist/web/assets/ibm-plex-sans-greek-700-normal-CkZN0sRy.woff +0 -0
  149. package/dist/web/assets/ibm-plex-sans-greek-700-normal-wyJ6jzdA.woff2 +0 -0
  150. package/dist/web/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
  151. package/dist/web/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
  152. package/dist/web/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
  153. package/dist/web/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
  154. package/dist/web/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
  155. package/dist/web/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
  156. package/dist/web/assets/ibm-plex-sans-latin-700-normal-Bth3BMcD.woff +0 -0
  157. package/dist/web/assets/ibm-plex-sans-latin-700-normal-Bxkt5Cjx.woff2 +0 -0
  158. package/dist/web/assets/ibm-plex-sans-latin-ext-400-normal-C5H60-Va.woff2 +0 -0
  159. package/dist/web/assets/ibm-plex-sans-latin-ext-400-normal-RBey6euL.woff +0 -0
  160. package/dist/web/assets/ibm-plex-sans-latin-ext-500-normal-D0aIdm-b.woff +0 -0
  161. package/dist/web/assets/ibm-plex-sans-latin-ext-500-normal-DakdToA3.woff2 +0 -0
  162. package/dist/web/assets/ibm-plex-sans-latin-ext-600-normal-DIrixKbi.woff +0 -0
  163. package/dist/web/assets/ibm-plex-sans-latin-ext-600-normal-DOrvGEcy.woff2 +0 -0
  164. package/dist/web/assets/ibm-plex-sans-latin-ext-700-normal-DZH6Xh-4.woff +0 -0
  165. package/dist/web/assets/ibm-plex-sans-latin-ext-700-normal-aMgXseD4.woff2 +0 -0
  166. package/dist/web/assets/ibm-plex-sans-vietnamese-400-normal-DG4YqDda.woff2 +0 -0
  167. package/dist/web/assets/ibm-plex-sans-vietnamese-400-normal-fK1oJ5dG.woff +0 -0
  168. package/dist/web/assets/ibm-plex-sans-vietnamese-500-normal-BEb3_waV.woff +0 -0
  169. package/dist/web/assets/ibm-plex-sans-vietnamese-500-normal-e4dixQRQ.woff2 +0 -0
  170. package/dist/web/assets/ibm-plex-sans-vietnamese-600-normal-DgdngZtN.woff +0 -0
  171. package/dist/web/assets/ibm-plex-sans-vietnamese-600-normal-DpPYBSTl.woff2 +0 -0
  172. package/dist/web/assets/ibm-plex-sans-vietnamese-700-normal-BV5B8Are.woff +0 -0
  173. package/dist/web/assets/ibm-plex-sans-vietnamese-700-normal-CkEo6LDy.woff2 +0 -0
  174. package/dist/web/assets/index-BoyulwgO.js +0 -137
  175. package/dist/web/assets/index-CMgQ_c5f.css +0 -1
  176. package/dist/web/assets/mermaid-WFAXDIZX-DX9Leemp.js +0 -1
  177. package/dist/web/assets/scroll-area-Bz4B8g7w.js +0 -1
  178. package/dist/web/assets/useMemories-xytUq8G9.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-DSDNlrLa.js";import{n as t,t as n}from"./jsx-runtime-CVMpzJz9.js";import{t as r}from"./button-DaSTTBls.js";import{P as i}from"./client-BD4crXth.js";import{t as a}from"./check-qe2BJPmy.js";import{G as o,J as s,K as c,U as l,Y as u,q as d,t as f}from"./prod-C5uPTMUm.js";import{j as p,mi as m,v as h}from"./index-Q_RymVqx.js";import{t as g}from"./save-file-3ZpJah8W.js";import{n as _,r as v}from"./Scratchpads-Dx63kejq.js";var y={name:`image-down`,size:24,node:[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19 3 3v-5.5`,key:`9ldu5r`}],[`path`,{d:`m17 22 3-3`,key:`1nkfve`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};y.node;var b=i(y),x=e(t(),1),S=n();function C(e){let t=JSON.parse(e);return o(t,null,null)}function w(e){return T(C(e),e)}function T(e,t){return{text:t,json:u(e.elements,e.appState,e.files,`local`)}}function E(e,t){return p(e,`diagram`).replace(/\.excalidraw$/,t)}function D({pad:e}){let t=_(e),{theme:n}=h(),[i,o]=(0,x.useState)(null),[p,y]=(0,x.useState)(null),[D,O]=(0,x.useState)(!1),k=(0,x.useMemo)(()=>C(t.draft),[]),A=(0,x.useRef)(t.draft),[j]=(0,x.useState)(()=>T(k,t.draft)),M=(0,x.useRef)(j),N=(0,x.useRef)(!1),P=(0,x.useRef)(``);(0,x.useEffect)(()=>{if(!i||t.draft===A.current)return;let e=C(t.draft);A.current=t.draft,M.current=w(t.draft),N.current=!1,i.updateScene({elements:e.elements,appState:{viewBackgroundColor:e.appState.viewBackgroundColor},captureUpdate:l.NEVER});let n=Object.values(e.files);n.length&&i.addFiles(n),i.history.clear()},[i,t.draft]),(0,x.useEffect)(()=>{if(!D)return;let e=setTimeout(()=>O(!1),2e3);return()=>clearTimeout(e)},[D]);function F(e,n,r){let i=`${s(e)}:${n.viewBackgroundColor}:${Object.keys(r).length}`;if(i===P.current)return;P.current=i;let a=u(e,n,r,`local`);if(!N.current){M.current.json=a;return}let o=a===M.current.json?M.current.text:a;A.current=o,t.setDraft(o)}function I(){return i?{elements:i.getSceneElements(),appState:i.getAppState(),files:i.getFiles()}:null}async function L(e){return c({...e,appState:{...e.appState,exportBackground:!0},mimeType:`image/png`})}async function R(e){let t=I();if(t){if(y(null),t.elements.length===0)y(`Draw something first; an empty canvas has no image.`);else try{await e(t)}catch(e){y(e instanceof Error?e.message:`Export failed`)}}}return(0,S.jsxs)(`div`,{className:`space-y-3`,"data-testid":`scratchpad-diagram`,children:[(0,S.jsxs)(v,{draft:t,children:[(0,S.jsxs)(r,{type:`button`,size:`sm`,variant:`outline`,"data-testid":`scratchpad-export-png`,disabled:!i,onClick:()=>void R(async t=>g(await L(t),E(e.title,`.png`))),children:[(0,S.jsx)(b,{size:12,className:`mr-1`}),` PNG`]}),(0,S.jsxs)(r,{type:`button`,size:`sm`,variant:`outline`,"data-testid":`scratchpad-export-svg`,disabled:!i,onClick:()=>void R(async t=>{let n=await d({...t,appState:{...t.appState,exportBackground:!0}});g(new Blob([n.outerHTML],{type:`image/svg+xml`}),E(e.title,`.svg`))}),children:[(0,S.jsx)(b,{size:12,className:`mr-1`}),` SVG`]}),(0,S.jsxs)(r,{type:`button`,size:`sm`,variant:`outline`,"data-testid":`scratchpad-copy-image`,disabled:!i,onClick:()=>void R(async e=>{await navigator.clipboard.write([new ClipboardItem({"image/png":L(e)})]),O(!0)}),children:[D?(0,S.jsx)(a,{size:12,className:`mr-1`}):(0,S.jsx)(m,{size:12,className:`mr-1`}),D?`Copied`:`Copy image`]})]}),p&&(0,S.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:p}),(0,S.jsx)(`div`,{"data-testid":`scratchpad-canvas`,className:`h-(--pad-height,70vh) min-h-[420px] border border-outline-variant`,onPointerDownCapture:()=>{N.current=!0},onKeyDownCapture:()=>{N.current=!0},onDropCapture:()=>{N.current=!0},onPasteCapture:()=>{N.current=!0},children:(0,S.jsx)(f,{initialData:k,excalidrawAPI:o,onChange:F,theme:n===`dark`?`dark`:`light`,name:e.title,UIOptions:{canvasActions:{saveToActiveFile:!1}}})})]})}export{D as default};
@@ -0,0 +1,10 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ScratchpadDiagramEditor-DrhudDAR.js","assets/rolldown-runtime-DSDNlrLa.js","assets/jsx-runtime-CVMpzJz9.js","assets/button-DaSTTBls.js","assets/react-dom-DTbwZiiP.js","assets/floating-ui.react-dom-BDMgcqWu.js","assets/clsx-DB0hHKMi.js","assets/bundle-mjs-Dvhef5Db.js","assets/client-BD4crXth.js","assets/check-qe2BJPmy.js","assets/prod-C5uPTMUm.js","assets/es2015-w69PgVrA.js","assets/preload-helper-BLdHbfdN.js","assets/with-selector-DSvXfKhy.js","assets/index-Q_RymVqx.js","assets/QueryClientProvider-DlPztvhd.js","assets/useMutation-CRAWY7v2.js","assets/chunk-OB3PAWPO-BD6ylT0A.js","assets/x-Cli9YXXI.js","assets/dist-BJbQo-dr.js","assets/chevron-down-BRt1smOS.js","assets/select-BJy2oop5.js","assets/dist-DWfyUCyc.js","assets/dist-Ct6061MC.js","assets/dist-D8Wfxh48.js","assets/maximize-2-BAy-8JsG.js","assets/MarkdownEditor-C7LnwPSG.js","assets/Markdown-wp7JBOSy.js","assets/document-display-BQ5dM8QT.js","assets/file-kind-BYU1kv95.js","assets/textarea-Cf2b0PUV.js","assets/tabs-BvxkGUc3.js","assets/label-dQSF_SAL.js","assets/schemas-BQZhekae.js","assets/chat-DGhEIqmi.js","assets/bulk-actions-C8S1Gt4W.js","assets/coding-agents-UkijH6GA.js","assets/dialog-CSqhD8HZ.js","assets/useBackends-wj1KheAL.js","assets/index-BHal5gcw.css","assets/save-file-3ZpJah8W.js","assets/ScratchpadDiagramEditor-DtRVLazd.css"])))=>i.map(i=>d[i]);
2
+ import{a as e,n as t}from"./rolldown-runtime-DSDNlrLa.js";import{n,t as r}from"./jsx-runtime-CVMpzJz9.js";import{f as i,p as a,t as o,u as s}from"./chunk-OB3PAWPO-BD6ylT0A.js";import{c,t as l}from"./button-DaSTTBls.js";import{P as u,i as d,n as f,r as p}from"./client-BD4crXth.js";import{t as m}from"./check-qe2BJPmy.js";import{a as h,i as g,n as _,r as v,t as y}from"./select-BJy2oop5.js";import{t as b}from"./download-CNL1ZoL6.js";import{t as x}from"./maximize-2-BAy-8JsG.js";import{n as S,r as C}from"./MarkdownEditor-C7LnwPSG.js";import{t as w}from"./ResponsiveFilters-DvvXTUvm.js";import{t as T}from"./preload-helper-BLdHbfdN.js";import{A as E,Br as D,D as O,Di as k,G as A,H as j,Hr as ee,Ir as M,J as te,K as ne,Kr as re,Nr as ie,Rr as ae,U as N,W as oe,X as se,Y as ce,_ as le,_t as P,dr as ue,j as F,k as de,q as I,ti as fe,tn as pe,v as me,xr as L}from"./index-Q_RymVqx.js";import{t as R}from"./ConfirmDialog-TrdcniMK.js";import{t as he}from"./orc-kit-TFHF-l0v.js";import{t as ge}from"./save-file-3ZpJah8W.js";import{t as _e}from"./ViewHeader-B2ixMGCg.js";import{t as z}from"./view-params-YEmeZppw.js";import{t as ve}from"./EmptyState-YM4VSLR9.js";import{a as ye,i as B,n as be,o as V,r as H,t as xe}from"./table-CVtwh2DT.js";import{t as Se}from"./DocumentWorkspace-LHgC6hHQ.js";var U={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]};U.node;var Ce=u(U),W=e(n(),1),G=r();function K({draft:e,children:t}){let n=e.saving?`Saving…`:e.dirty?`Unsaved changes`:`Saved`;return(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-1.5`,children:t}),(0,G.jsx)(`span`,{"data-testid":`scratchpad-save-status`,role:`status`,className:`text-xs text-outline`,children:n}),(e.dirty||e.saving)&&(0,G.jsxs)(G.Fragment,{children:[e.stale&&(0,G.jsx)(l,{type:`button`,size:`sm`,variant:`ghost`,"data-testid":`scratchpad-overwrite`,disabled:e.saving,onClick:e.overwrite,children:`Keep mine`}),(0,G.jsx)(l,{type:`button`,size:`sm`,variant:`ghost`,"data-testid":`scratchpad-discard`,disabled:e.saving,onClick:e.discard,children:`Discard`}),(0,G.jsx)(l,{type:`button`,size:`sm`,"data-testid":`scratchpad-save`,disabled:e.saving,onClick:()=>void e.save(),children:`Save`})]})]}),e.error&&(0,G.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[e.error,` Your draft has been kept.`,e.stale&&` Discard loads their version; Keep mine lets you save over it.`]}),e.stale&&!e.error&&(0,G.jsx)(`p`,{role:`status`,className:`text-sm text-outline`,children:`This scratchpad changed elsewhere. Your draft is preserved: Discard loads their version; Keep mine lets you save over it.`})]})}function we({active:e,onClick:t,children:n,testId:r}){return(0,G.jsx)(`button`,{type:`button`,"data-testid":r,"aria-pressed":e,onClick:t,className:`inline-flex min-h-9 items-center gap-1.5 font-label text-sm px-3 py-1.5 border transition-colors ${e?`bg-surface-highest text-on-surface border-transparent`:`bg-transparent border-transparent text-muted-foreground hover:bg-surface-low hover:text-on-surface`}`,children:n})}function q(e){let t=I(),[n,r]=(0,W.useState)(e.content),[i,a]=(0,W.useState)({content:e.content,revision:e.revision}),[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(null),u=(0,W.useRef)(e.content),d=n!==i.content;(0,W.useEffect)(()=>{e.revision<=i.revision||(e.content===i.content?a({content:e.content,revision:e.revision}):u.current===i.content&&(u.current=e.content,r(e.content),a({content:e.content,revision:e.revision})))},[e.content,e.revision,i]),(0,W.useEffect)(()=>{if(!d)return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[d]);let p=(0,W.useCallback)(e=>{u.current=e,r(e)},[]);async function m(){if(!d||o)return;s(!0),l(null);let n=u.current;try{let t=await f.scratchpads.update(e.id,{content:n,if_revision:i.revision});a({content:t.content,revision:t.revision})}catch(e){l(e instanceof Error?e.message:`Could not save scratchpad`)}finally{s(!1),await t()}}function h(){a({content:e.content,revision:e.revision}),l(null)}function g(){u.current=e.content,r(e.content),a({content:e.content,revision:e.revision}),l(null)}return{draft:n,setDraft:p,dirty:d,stale:d&&e.revision!==i.revision,saving:o,error:c,save:m,overwrite:h,discard:g}}function Te(e,t,n){if(!/^\/(?![/\\])/.test(e))return!1;let r=new URL(t,n),i=new URL(`${t}${e}`,n),a=r.pathname.replace(/\/$/,``);return i.origin===r.origin&&i.pathname.startsWith(`${a}/`)}var J=[`preview`,`code`,`split`],Ee={preview:`Preview`,code:`Code`,split:`Split`},De=400,Oe=`allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-modals`,ke=`orc:fetch`,Y=`orc:fetch:result`,Ae=e=>`<script>(()=>{const pending=new Map();let next=0;
3
+ addEventListener("message",(e)=>{const d=e.data;if(e.source!==parent||!d||d.type!=="${Y}")return;
4
+ const p=pending.get(d.id);if(!p)return;pending.delete(d.id);
5
+ if(d.error)p.reject(new Error(d.error));
6
+ else p.resolve(new Response(d.body,{status:d.status,statusText:d.statusText,headers:d.headers}));});
7
+ window.orc=Object.freeze({fetch:(path,init={})=>new Promise((resolve,reject)=>{const id=++next;
8
+ pending.set(id,{resolve,reject});
9
+ parent.postMessage({type:"${ke}",nonce:"${e}",id,path:String(path),method:init.method,
10
+ headers:[...new Headers(init.headers)],body:init.body},"*");})});})();<\/script>`,je=()=>Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,`0`)).join(``);function Me(e,t){let n=Ae(t),r=/^\s*<!doctype[^>]*>/i.exec(e);return r?`${r[0]}${n}${e.slice(r[0].length)}`:`${n}${e}`}function Ne(e,t){let n=e;return n?.type===ke&&n.nonce===t&&typeof n.id==`number`&&typeof n.path==`string`&&Array.isArray(n.headers)}async function Pe(e,t){try{if(!Te(t.path,d(),window.location.href))throw Error(`orc.fetch path must be an ORC API path: ${t.path}`);let n=await p(t.path,{method:t.method,headers:t.headers,body:t.body??null}),r=await n.arrayBuffer();e.postMessage({type:Y,id:t.id,status:n.status,statusText:n.statusText,headers:[...n.headers],body:r.byteLength?r:null},`*`,r.byteLength?[r]:[])}catch(n){e.postMessage({type:Y,id:t.id,error:n instanceof Error?n.message:`Request failed`},`*`)}}function Fe({html:e,title:t,trusted:n=!1}){let r=(0,W.useRef)(null),{theme:i}=me(),{darkBackground:a}=le(),o=(0,W.useMemo)(()=>n?je():``,[n,e]),s=(0,W.useMemo)(()=>{let t=he(e,i,a);return o?Me(t,o):t},[e,i,a,o]);return(0,W.useEffect)(()=>{if(!o)return;let e=e=>{let t=r.current?.contentWindow;t&&e.source===t&&Ne(e.data,o)&&Pe(t,e.data)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[o]),(0,G.jsx)(`iframe`,{ref:r,"data-testid":`scratchpad-html-preview`,"data-trusted":n||void 0,title:`${t} preview`,sandbox:Oe,referrerPolicy:`no-referrer`,srcDoc:s,className:`h-(--pad-height,70vh) w-full border bg-white ${n?`border-destructive`:`border-outline-variant`}`},n?`trusted`:`sandboxed`)}function Ie({pad:e}){let t=q(e),[n,r]=z(`padView`,`preview`,J),[i,a]=(0,W.useState)(!1),[o,s]=(0,W.useState)(!1),c=(0,W.useRef)(e.revision);(0,W.useEffect)(()=>{e.revision!==c.current&&(c.current=e.revision,e.content!==t.draft&&a(!1))},[e.revision,e.content,t.draft]);let u={...t,discard:()=>{e.content!==t.draft&&a(!1),t.discard()}},[d,f]=(0,W.useState)(t.draft);(0,W.useEffect)(()=>{let e=setTimeout(()=>f(t.draft),De);return()=>clearTimeout(e)},[t.draft]);let p=(0,G.jsx)(S,{path:F(e.title,`html`),value:t.draft,onChange:t.setDraft,onSave:()=>void t.save(),readOnly:t.saving,height:`var(--pad-height, 70vh)`,label:`HTML source`,testId:`scratchpad-html-source`});return(0,G.jsxs)(`div`,{className:`space-y-3`,"data-testid":`scratchpad-html`,children:[(0,G.jsxs)(K,{draft:u,children:[J.map(e=>(0,G.jsx)(we,{active:n===e,onClick:()=>r(e),testId:`scratchpad-view-${e}`,children:Ee[e]},e)),n!==`code`&&(i?(0,G.jsxs)(l,{type:`button`,size:`sm`,variant:`outline`,"data-testid":`scratchpad-html-sandbox`,onClick:()=>a(!1),children:[(0,G.jsx)(Ce,{size:12,className:`mr-1`}),` Back to sandbox`]}):(0,G.jsxs)(l,{type:`button`,size:`sm`,variant:`outline`,"data-testid":`scratchpad-html-trust`,onClick:()=>s(!0),children:[(0,G.jsx)(ae,{size:12,className:`mr-1`}),` Render with ORC access`]}))]}),i&&n!==`code`&&(0,G.jsxs)(`p`,{role:`status`,className:`text-sm text-destructive`,children:[`This page runs with ORC access: its scripts act as you and can call the API through`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`orc.fetch()`}),`.`]}),n===`preview`?(0,G.jsx)(Fe,{html:d,title:e.title,trusted:i}):n===`code`?p:(0,G.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 lg:grid-cols-2`,children:[(0,G.jsx)(`div`,{className:`min-w-0`,children:p}),(0,G.jsx)(Fe,{html:d,title:e.title,trusted:i})]}),(0,G.jsx)(R,{open:o,title:`Render with ORC access?`,description:`The page's scripts will be able to call the ORC API as you through orc.fetch: read and change anything, including starting agents and terminals. They stay in the sandbox; the dashboard does not hand them your API secret, though API calls such as terminals can reach anything you can. Only do this for a page you trust. Access ends when you go back to the sandbox, leave the page, or someone else edits it.`,confirmLabel:`Render with access`,variant:`destructive`,onCancel:()=>s(!1),onConfirm:()=>{s(!1),a(!0)}})]})}var Le=(0,W.lazy)(()=>T(()=>import(`./ScratchpadDiagramEditor-DrhudDAR.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41])));function Re({pad:e}){return e.kind===`doc`?(0,G.jsx)(ze,{pad:e}):e.kind===`html`?(0,G.jsx)(Ie,{pad:e}):(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(`div`,{role:`status`,className:`p-3 text-sm text-outline`,children:`Loading diagram editor…`}),children:(0,G.jsx)(Le,{pad:e})})}function ze({pad:e}){let t=I(),n=(0,W.useRef)(e.revision);return(0,G.jsx)(Se,{documentId:`scratchpad:${e.id}`,path:F(e.title,`doc`),content:e.content,testId:`scratchpad-doc`,layout:`page`,pageTitle:e.title,onSave:async(r,i)=>{try{let t=await f.scratchpads.update(e.id,{content:r,if_revision:i===e.content?e.revision:n.current});return n.current=t.revision,r}finally{await t()}}})}var Be=t({default:()=>Ue}),X=`all`,Z=`unassigned`,Ve=200;function He(e,t){if(e===Z)return``;for(let n of[e,t])if(n&&n!==X&&n!==Z)return n;return``}function Q(e){return new Date(e*1e3).toLocaleString()}function Ue({projectId:e}){let{scratchpadId:t}=a();return t?(0,G.jsx)(Ge,{id:t},t):(0,G.jsx)(We,{defaultProjectId:e})}function $({kind:e}){let{label:t,icon:n}=A[e];return(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-label text-xs text-muted-foreground`,children:[(0,G.jsx)(n,{size:12,"aria-hidden":!0}),` `,t]})}function We({defaultProjectId:e}){let t=ue(`lg`),n=i(),r=s(),[a,u]=z(`project`,e);(0,W.useEffect)(()=>{let e=new URLSearchParams(r.search),t=e.get(`padProject`);t&&(e.has(`project`)||e.set(`project`,t),e.delete(`padProject`),n({search:e.toString()},{replace:!0}))},[r.search,n]);let[d,f]=z(`padKind`,X,[X,...E]),[p,m]=z(`padQuery`,``),[b,x]=(0,W.useState)(p);(0,W.useEffect)(()=>x(p),[p]),(0,W.useEffect)(()=>{if(b===p)return;let e=setTimeout(()=>m(b,{replace:!0}),350);return()=>clearTimeout(e)},[b,p,m]);let[S,C]=(0,W.useState)(!1);(0,W.useEffect)(()=>{let e=new URLSearchParams(r.search);e.get(`new`)===`1`&&(C(!0),e.delete(`new`),n({search:e.toString()},{replace:!0}))},[r.search,n]);let{data:T}=L({status:`active`}),D=ce({kind:d===X?void 0:d,project_id:a===X||a===Z?void 0:a,include_global:a!==X&&a!==Z?`true`:void 0,unassigned:a===Z?`true`:void 0,q:p||void 0,limit:Ve}),k=D.data?.scratchpads??[],j=e=>e?T?.find(t=>t.id===e)?.name??e:`Global`,M=!!p||d!==X||a!==X;return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(_e,{title:`Scratchpads`,compact:!0,help:(0,G.jsxs)(G.Fragment,{children:[`Working docs, diagrams and HTML pages you or an agent keep and come back to. Agents create and edit them with the `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`pad_*`}),` tools; share one by copying its link.`]}),meta:D.data?D.data.total:void 0,action:(0,G.jsxs)(l,{"data-testid":`new-scratchpad-button`,size:`sm`,onClick:()=>C(!0),className:`font-label text-sm`,children:[(0,G.jsx)(re,{size:12,className:`mr-1`}),` New`,(0,G.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:` scratchpad`})]})}),(0,G.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,G.jsxs)(`div`,{className:`relative min-w-0 flex-1 lg:max-w-md`,children:[(0,G.jsx)(ee,{size:14,className:`absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground`}),(0,G.jsx)(ie,{type:`search`,"aria-label":`Search scratchpads`,"data-testid":`scratchpad-search-input`,value:b,onChange:e=>x(e.target.value),onKeyDown:e=>e.key===`Enter`&&m(e.currentTarget.value),placeholder:`Search scratchpads…`,className:`h-11 pl-9 text-base lg:h-9 lg:text-sm`})]}),(0,G.jsxs)(w,{activeCount:Number(d!==X)+Number(a!==X),children:[(0,G.jsxs)(y,{value:a,onValueChange:e=>u(e),children:[(0,G.jsx)(g,{"aria-label":`Project`,"data-testid":`scratchpad-project-filter`,className:`h-11 w-48 max-w-full bg-background font-body text-base text-on-surface lg:h-9 lg:text-sm`,children:(0,G.jsx)(h,{})}),(0,G.jsxs)(_,{className:`bg-surface border-outline-variant`,children:[(0,G.jsx)(v,{value:X,className:`font-body text-sm`,children:`All projects`}),(0,G.jsx)(v,{value:Z,className:`font-body text-sm`,children:`Global`}),T?.map(e=>(0,G.jsx)(v,{value:e.id,"data-testid":`scratchpad-project-${e.id}`,className:`font-body text-sm`,children:e.name},e.id))]})]}),(0,G.jsx)(`div`,{className:`flex shrink-0 flex-wrap gap-1.5`,children:[X,...E].map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>f(e),"data-testid":`scratchpad-kind-${e}`,"aria-pressed":d===e,className:`min-h-11 rounded-md font-label text-sm px-3 py-1.5 border transition-colors lg:min-h-9 focus-visible:outline-2 focus-visible:outline-focus ${d===e?`bg-surface-highest text-on-surface border-transparent`:`bg-transparent border-transparent text-muted-foreground hover:bg-surface-low hover:text-on-surface`}`,children:e===X?`All`:A[e].label},e))})]})]}),D.error?(0,G.jsx)(se,{message:D.error.message,onRetry:()=>void D.refetch()}):D.isLoading?(0,G.jsx)(`div`,{className:`space-y-2`,children:[...[,,,,,]].map((e,t)=>(0,G.jsx)(P,{className:`h-10 w-full bg-surface-highest`},t))}):k.length===0?(0,G.jsx)(ve,{message:M?`No scratchpads match`:`No scratchpads yet`}):(0,G.jsx)(`div`,{className:`overflow-hidden`,children:t?(0,G.jsxs)(xe,{children:[(0,G.jsx)(ye,{children:(0,G.jsxs)(V,{className:`border-b border-outline-variant hover:bg-transparent`,children:[(0,G.jsx)(B,{className:`font-label text-sm text-muted-foreground`,children:`Title`}),(0,G.jsx)(B,{className:`font-label text-sm text-muted-foreground w-28`,children:`Kind`}),(0,G.jsx)(B,{className:`font-label text-sm text-muted-foreground`,children:`Project`}),(0,G.jsx)(B,{className:`font-label text-sm text-muted-foreground hidden md:table-cell`,children:`Author`}),(0,G.jsx)(B,{className:`font-label text-sm text-muted-foreground w-20 hidden md:table-cell`,children:`Size`}),(0,G.jsx)(B,{className:`font-label text-sm text-muted-foreground w-44`,children:`Updated`})]})}),(0,G.jsx)(be,{children:k.map(e=>(0,G.jsxs)(V,{"data-testid":`scratchpad-row`,"data-scratchpad-id":e.id,className:`border-b border-outline-variant/50 hover:bg-surface-low cursor-pointer`,onClick:()=>n(`${N(e.id)}${r.search}`),children:[(0,G.jsxs)(H,{className:`font-body text-sm font-medium text-on-surface`,children:[(0,G.jsx)(o,{to:`${N(e.id)}${r.search}`,className:`inline-flex min-h-11 items-center hover:text-primary`,onClick:e=>e.stopPropagation(),children:e.title}),e.tags.length>0&&(0,G.jsx)(`span`,{className:`ml-2 font-label text-xs text-outline`,children:e.tags.map(e=>`#${e}`).join(` `)})]}),(0,G.jsx)(H,{children:(0,G.jsx)($,{kind:e.kind})}),(0,G.jsx)(H,{className:`font-body text-sm text-muted-foreground`,children:j(e.project_id)}),(0,G.jsx)(H,{className:`font-body text-sm text-muted-foreground hidden md:table-cell`,children:e.author}),(0,G.jsx)(H,{className:`font-label text-sm text-muted-foreground hidden md:table-cell`,children:c(e.size_bytes)}),(0,G.jsx)(H,{className:`font-label text-sm text-muted-foreground`,children:Q(e.updated_at)})]},e.id))})]}):(0,G.jsx)(`div`,{className:`divide-y divide-border`,children:k.map(e=>(0,G.jsxs)(o,{to:`${N(e.id)}${r.search}`,"data-testid":`scratchpad-row`,"data-scratchpad-id":e.id,className:`block min-h-11 py-3 text-sm hover:bg-surface focus-visible:outline-2 focus-visible:outline-focus`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsx)(`span`,{className:`min-w-0 break-words font-medium`,children:e.title}),(0,G.jsx)(`time`,{className:`shrink-0 text-xs text-outline`,dateTime:new Date(e.updated_at*1e3).toISOString(),title:Q(e.updated_at),children:pe(new Date(e.updated_at*1e3).toISOString())})]}),(0,G.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-outline`,children:[(0,G.jsx)($,{kind:e.kind}),(0,G.jsx)(`span`,{children:j(e.project_id)}),(0,G.jsx)(`span`,{children:e.author}),e.tags.length>0&&(0,G.jsx)(`span`,{children:e.tags.map(e=>`#${e}`).join(` `)})]})]},e.id))})}),S&&(0,G.jsx)(O,{defaultProjectId:He(a,e),onClose:()=>C(!1),onSaved:e=>n(N(e.id))})]})}function Ge({id:e}){let t=i(),n=s(),{data:r,isLoading:a,error:c,refetch:u}=te(e),{data:d}=L(),[f,p]=(0,W.useState)(!1),[h,g]=(0,W.useState)(!1),[_,v]=(0,W.useState)(`idle`),[y,S]=(0,W.useState)(!1),w=ne(),T=`${j}${n.search}`;(0,W.useEffect)(()=>{if(_!==`copied`)return;let e=setTimeout(()=>v(`idle`),2e3);return()=>clearTimeout(e)},[_]),(0,W.useEffect)(()=>{if(!y)return;function e(e){e.key!==`Escape`||e.defaultPrevented||document.querySelector(`[role="dialog"], [role="alertdialog"]`)||S(!1)}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[y]);async function E(){try{await navigator.clipboard.writeText(oe(e)),v(`copied`)}catch{v(`failed`)}}let A=(0,G.jsxs)(o,{to:T,className:`inline-flex min-h-11 items-center gap-1.5 font-label text-sm text-muted-foreground hover:text-on-surface`,children:[(0,G.jsx)(k,{size:14,"aria-hidden":!0}),` Scratchpads`]});if(c)return(0,G.jsxs)(`div`,{children:[A,(0,G.jsx)(se,{message:c.message,onRetry:()=>void u()})]});if(a||!r)return(0,G.jsxs)(`div`,{className:`space-y-3`,children:[A,(0,G.jsx)(P,{className:`h-8 w-1/2 bg-surface-highest`}),(0,G.jsx)(P,{className:`h-64 w-full bg-surface-highest`})]});let ee=r.project_id?d?.find(e=>e.id===r.project_id):void 0;return(0,G.jsxs)(`div`,{"data-testid":`scratchpad-page`,"data-scratchpad-kind":r.kind,className:`min-w-0`,children:[A,(0,G.jsxs)(`div`,{className:`mt-2 mb-4 flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,G.jsx)(`h1`,{"data-testid":`scratchpad-title`,className:`font-headline font-medium text-2xl tracking-tight text-on-surface wrap-break-word`,children:r.title}),(0,G.jsxs)(`div`,{"data-testid":`scratchpad-meta`,className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-outline`,children:[(0,G.jsx)($,{kind:r.kind}),(0,G.jsxs)(`span`,{children:[`revision `,r.revision]}),(0,G.jsxs)(`span`,{children:[`by `,(0,G.jsx)(`span`,{"data-testid":`scratchpad-author`,children:r.author}),`,`,` `,Q(r.updated_at)]}),(0,G.jsx)(`span`,{children:ee?.name??(r.project_id?r.project_id:`No project`)}),r.session_id&&(0,G.jsxs)(`span`,{title:`Agent session that created it`,children:[`session `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:r.session_id.slice(0,8)})]}),r.tags.length>0&&(0,G.jsx)(`span`,{children:r.tags.map(e=>`#${e}`).join(` `)})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsxs)(l,{"data-testid":`scratchpad-fullscreen`,size:`sm`,variant:`outline`,onClick:()=>S(!0),children:[(0,G.jsx)(x,{size:12,className:`mr-1`}),` Full screen`]}),(0,G.jsxs)(l,{"data-testid":`scratchpad-copy-link`,size:`sm`,variant:`outline`,onClick:()=>void E(),children:[_===`copied`?(0,G.jsx)(m,{size:12,className:`mr-1`}):(0,G.jsx)(fe,{size:12,className:`mr-1`}),_===`copied`?`Copied`:`Copy link`]}),(0,G.jsxs)(l,{"data-testid":`scratchpad-download`,size:`sm`,variant:`outline`,title:`Download the saved file`,onClick:()=>ge(new Blob([r.content],{type:de[r.kind].mime}),F(r.title,r.kind)),children:[(0,G.jsx)(b,{size:12,className:`mr-1`}),` Download`]}),(0,G.jsxs)(l,{"data-testid":`scratchpad-properties`,size:`sm`,variant:`outline`,onClick:()=>p(!0),children:[(0,G.jsx)(D,{size:12,className:`mr-1`}),` Properties`]}),(0,G.jsxs)(l,{"data-testid":`scratchpad-delete`,size:`sm`,variant:`outline`,onClick:()=>g(!0),children:[(0,G.jsx)(M,{size:12,className:`mr-1`}),` Delete`]})]})]}),_===`failed`&&(0,G.jsx)(`p`,{role:`alert`,className:`mb-3 text-sm text-destructive`,children:`Clipboard access failed. Copy the link from the address bar instead.`}),(0,G.jsxs)(`div`,{"data-testid":`scratchpad-stage`,"data-fullscreen":y||void 0,className:y?`fixed inset-0 z-40 flex flex-col gap-3 overflow-auto bg-background p-3 [--pad-height:calc(100dvh-8.5rem)] sm:p-4`:`min-w-0`,children:[y&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`h2`,{className:`min-w-0 flex-1 truncate font-headline text-lg font-medium text-on-surface`,children:r.title}),(0,G.jsxs)(l,{"data-testid":`scratchpad-exit-fullscreen`,size:`sm`,variant:`outline`,onClick:()=>S(!1),children:[(0,G.jsx)(C,{size:12,className:`mr-1`}),` Exit full screen`]})]}),(0,G.jsx)(Re,{pad:r})]}),f&&(0,G.jsx)(O,{pad:r,onClose:()=>p(!1)}),h&&(0,G.jsx)(R,{open:!0,title:`Delete scratchpad`,description:`Delete "${r.title}"? This cannot be undone.`,confirmLabel:`Delete`,variant:`destructive`,isPending:w.isPending,onConfirm:()=>w.mutate(r.id,{onSuccess:()=>{g(!1),t(T)}}),onCancel:()=>g(!1)}),w.error&&(0,G.jsx)(`p`,{role:`alert`,className:`mt-2 text-sm text-destructive`,children:w.error.message})]})}export{Ue as default,q as n,K as r,Be as t};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-CVMpzJz9.js";import{Ln as t}from"./index-BoyulwgO.js";import{P as n,a as r,d as i,dt as a,i as o,r as s,t as c}from"./AreaChart-DcUZ3SzF.js";import{t as l}from"./ReferenceLine-BPBQytfV.js";var u=e(),d=new Intl.NumberFormat;function f({timeline:e,compactions:f}){let p=f.flatMap(n=>{let r=n.recorded_at,i=r&&e.find(e=>e.recorded_at&&e.recorded_at>=r);if(!i)return[];let a=n.pre_tokens!==null&&n.post_tokens!==null?`${t(n.pre_tokens,!1)} → ${t(n.post_tokens,!1)}`:null;return[{request:i.request,drop:a}]});return(0,u.jsxs)(`figure`,{"data-testid":`session-context-chart`,className:`w-full`,children:[(0,u.jsxs)(`figcaption`,{className:`flex items-center gap-4 text-muted-foreground`,children:[(0,u.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 w-4 bg-series-1`}),`Context`]}),p.length>0&&(0,u.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,className:`w-4 border-t-[1.5px] border-dashed border-series-2`}),`Compacted`]})]}),(0,u.jsx)(`div`,{className:`h-36 w-full`,children:(0,u.jsx)(a,{width:`100%`,height:`100%`,children:(0,u.jsxs)(c,{data:e,margin:{top:8,right:8,bottom:0,left:0},children:[(0,u.jsx)(i,{vertical:!1,stroke:`var(--color-border)`}),(0,u.jsx)(o,{dataKey:`request`,tick:{fill:`var(--color-muted-foreground)`,fontSize:10},tickLine:!1,axisLine:{stroke:`var(--color-border)`},minTickGap:24}),(0,u.jsx)(s,{width:40,tick:{fill:`var(--color-muted-foreground)`,fontSize:10},tickLine:!1,axisLine:!1,tickFormatter:e=>t(e,!1)}),(0,u.jsx)(n,{cursor:{stroke:`var(--color-muted-foreground)`},content:({active:e,payload:t})=>{let n=e?t?.[0]?.payload:void 0;if(!n)return null;let r=p.find(e=>e.request===n.request);return(0,u.jsxs)(`div`,{className:`rounded-md border border-border bg-surface px-2 py-1.5 text-xs tabular-nums shadow-sm`,children:[(0,u.jsxs)(`p`,{className:`font-medium text-on-surface`,children:[`Request `,d.format(n.request),n.recorded_at&&(0,u.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[` `,`· `,new Date(n.recorded_at).toLocaleString()]})]}),(0,u.jsxs)(`p`,{children:[`Context `,d.format(n.context_tokens)]}),(0,u.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Cached `,d.format(n.cached_input_tokens)]}),r&&(0,u.jsxs)(`p`,{className:`text-on-surface`,children:[`Compacted`,r.drop&&` ${r.drop}`]}),n.output_tokens!==null&&(0,u.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Output `,d.format(n.output_tokens)]})]})}}),p.map(e=>(0,u.jsx)(l,{x:e.request,label:e.drop?{value:e.drop,position:`insideTopLeft`,fill:`var(--color-muted-foreground)`,fontSize:10}:void 0,stroke:`var(--color-series-2)`,strokeDasharray:`4 3`,strokeWidth:1.5},e.request)),(0,u.jsx)(r,{type:`linear`,dataKey:`context_tokens`,stroke:`var(--color-series-1)`,strokeWidth:2,fill:`var(--color-series-1)`,fillOpacity:.15,isAnimationActive:!1})]})})})]})}export{f as default};
1
+ import{t as e}from"./jsx-runtime-CVMpzJz9.js";import{an as t}from"./index-Q_RymVqx.js";import{P as n,a as r,d as i,dt as a,i as o,r as s,t as c}from"./AreaChart-DcUZ3SzF.js";import{t as l}from"./ReferenceLine-BPBQytfV.js";var u=e(),d=new Intl.NumberFormat;function f({timeline:e,compactions:f}){let p=f.flatMap(n=>{let r=n.recorded_at,i=r&&e.find(e=>e.recorded_at&&e.recorded_at>=r);if(!i)return[];let a=n.pre_tokens!==null&&n.post_tokens!==null?`${t(n.pre_tokens,!1)} → ${t(n.post_tokens,!1)}`:null;return[{request:i.request,drop:a}]});return(0,u.jsxs)(`figure`,{"data-testid":`session-context-chart`,className:`w-full`,children:[(0,u.jsxs)(`figcaption`,{className:`flex items-center gap-4 text-muted-foreground`,children:[(0,u.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,className:`h-0.5 w-4 bg-series-1`}),`Context`]}),p.length>0&&(0,u.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,className:`w-4 border-t-[1.5px] border-dashed border-series-2`}),`Compacted`]})]}),(0,u.jsx)(`div`,{className:`h-36 w-full`,children:(0,u.jsx)(a,{width:`100%`,height:`100%`,children:(0,u.jsxs)(c,{data:e,margin:{top:8,right:8,bottom:0,left:0},children:[(0,u.jsx)(i,{vertical:!1,stroke:`var(--color-border)`}),(0,u.jsx)(o,{dataKey:`request`,tick:{fill:`var(--color-muted-foreground)`,fontSize:10},tickLine:!1,axisLine:{stroke:`var(--color-border)`},minTickGap:24}),(0,u.jsx)(s,{width:40,tick:{fill:`var(--color-muted-foreground)`,fontSize:10},tickLine:!1,axisLine:!1,tickFormatter:e=>t(e,!1)}),(0,u.jsx)(n,{cursor:{stroke:`var(--color-muted-foreground)`},content:({active:e,payload:t})=>{let n=e?t?.[0]?.payload:void 0;if(!n)return null;let r=p.find(e=>e.request===n.request);return(0,u.jsxs)(`div`,{className:`rounded-md border border-border bg-surface px-2 py-1.5 text-xs tabular-nums shadow-sm`,children:[(0,u.jsxs)(`p`,{className:`font-medium text-on-surface`,children:[`Request `,d.format(n.request),n.recorded_at&&(0,u.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[` `,`· `,new Date(n.recorded_at).toLocaleString()]})]}),(0,u.jsxs)(`p`,{children:[`Context `,d.format(n.context_tokens)]}),(0,u.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Cached `,d.format(n.cached_input_tokens)]}),r&&(0,u.jsxs)(`p`,{className:`text-on-surface`,children:[`Compacted`,r.drop&&` ${r.drop}`]}),n.output_tokens!==null&&(0,u.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Output `,d.format(n.output_tokens)]})]})}}),p.map(e=>(0,u.jsx)(l,{x:e.request,label:e.drop?{value:e.drop,position:`insideTopLeft`,fill:`var(--color-muted-foreground)`,fontSize:10}:void 0,stroke:`var(--color-series-2)`,strokeDasharray:`4 3`,strokeWidth:1.5},e.request)),(0,u.jsx)(r,{type:`linear`,dataKey:`context_tokens`,stroke:`var(--color-series-1)`,strokeWidth:2,fill:`var(--color-series-1)`,fillOpacity:.15,isAnimationActive:!1})]})})})]})}export{f as default};