@rho-workspace/rho 0.5.4 → 0.5.6

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 (161) hide show
  1. package/dist/agent-connect.d.ts +8 -0
  2. package/dist/agent-connect.js +15 -0
  3. package/dist/browser-access.js +3 -2
  4. package/dist/capabilities.d.ts +2 -2
  5. package/dist/capabilities.js +6 -1
  6. package/dist/cli.js +219 -176
  7. package/dist/contract.generated.d.ts +472 -4
  8. package/dist/contract.generated.js +1 -1
  9. package/dist/contracts/owners.generated.js +455 -6
  10. package/dist/conversations.d.ts +157 -4
  11. package/dist/conversations.js +69 -6
  12. package/dist/discovery.d.ts +1 -0
  13. package/dist/discovery.js +3 -3
  14. package/dist/extension-contract.d.ts +99 -0
  15. package/dist/extension-contract.js +52 -0
  16. package/dist/extension-directory.d.ts +9 -0
  17. package/dist/extension-directory.js +11 -0
  18. package/dist/extension-worker.d.ts +1 -0
  19. package/dist/extension-worker.js +36 -0
  20. package/dist/extensions.d.ts +157 -0
  21. package/dist/extensions.js +349 -0
  22. package/dist/plugin-cli.d.ts +1 -0
  23. package/dist/plugin-cli.js +139 -0
  24. package/dist/plugin-inventory.json +18 -0
  25. package/dist/plugins.d.ts +3 -3
  26. package/dist/project-work.d.ts +3 -1
  27. package/dist/project-work.js +15 -2
  28. package/dist/protocol.d.ts +8 -0
  29. package/dist/protocol.js +16 -7
  30. package/dist/server.d.ts +5 -10
  31. package/dist/server.js +122 -12
  32. package/dist/web/.vite/manifest.json +67 -67
  33. package/dist/web/assets/{canvas-BXhC8RDZ.js → canvas-D8rDdfDz.js} +1 -1
  34. package/dist/web/assets/choices-D-YfnFP6.js +1 -0
  35. package/dist/web/assets/{console-Dbdo-5oO.js → console-Trqc0swD.js} +1 -1
  36. package/dist/web/assets/{dist-B2V0VDO0.js → dist-DZmszrjG.js} +2 -2
  37. package/dist/web/assets/dist-DpIHRk3B.js +1 -0
  38. package/dist/web/assets/{dist-D25Vn17i.js → dist-eMx6b8N1.js} +1 -1
  39. package/dist/web/assets/dist-pF902jHA.js +3 -0
  40. package/dist/web/assets/explore-in-BCHqjJ7B.js +1 -0
  41. package/dist/web/assets/graph-lENgfQNH.js +2 -0
  42. package/dist/web/assets/index-B3_OVy91.css +1 -0
  43. package/dist/web/assets/{index-BHQIaDsx.js → index-BpL_Kl_s.js} +87 -86
  44. package/dist/web/assets/{notes-meaning-DdPbtNzJ.js → notes-meaning-DcVGUBBY.js} +1 -1
  45. package/dist/web/assets/overview-CDnVKlOt.js +6 -0
  46. package/dist/web/assets/preview-BEC1E9MK.js +1 -0
  47. package/dist/web/assets/{review-CmWou4Iv.js → review-DYP0aCXb.js} +1 -1
  48. package/dist/web/assets/{skills-Dy7n3L9d.js → skills-1ec0Z-jx.js} +1 -1
  49. package/dist/web/assets/{skills-work-Cj0W6b-I.js → skills-work-DNexV4OJ.js} +1 -1
  50. package/dist/web/assets/{studio-process-QOY_n2_8.js → studio-process-EYQgikxq.js} +2 -2
  51. package/dist/web/assets/{timeline-events-DmX1BCh3.js → timeline-events-Chj2Gbx7.js} +1 -1
  52. package/dist/web/assets/{work-turns-Co0C71rJ.js → work-turns-CT9RVcWY.js} +1 -1
  53. package/dist/web/assets/workspace-COmCbGV3.js +5 -0
  54. package/dist/web/composition.json +65 -65
  55. package/dist/web/index.html +3 -3
  56. package/dist/web/renderer.json +1 -1
  57. package/dist/web-assets.d.ts +2 -1
  58. package/dist/web-assets.js +3 -2
  59. package/dist/work-contract.js +2 -2
  60. package/docs/FRONTEND.md +26 -18
  61. package/docs/HEADLESS.md +38 -28
  62. package/docs/PLUGIN-AUTHORING.md +4 -0
  63. package/docs/THIRD-PARTY-PLUGINS.md +190 -0
  64. package/node_modules/@rho-workspace/plugin-agent/README.md +68 -0
  65. package/node_modules/@rho-workspace/plugin-agent/dist/acp-command.d.ts +1 -0
  66. package/node_modules/@rho-workspace/plugin-agent/dist/acp-command.js +9 -1
  67. package/node_modules/@rho-workspace/plugin-agent/dist/acp-conversation.d.ts +1 -0
  68. package/node_modules/@rho-workspace/plugin-agent/dist/acp-conversation.js +10 -0
  69. package/node_modules/@rho-workspace/plugin-agent/dist/activity-normalize.d.ts +1 -0
  70. package/node_modules/@rho-workspace/plugin-agent/dist/activity-normalize.js +2 -2
  71. package/node_modules/@rho-workspace/plugin-agent/dist/dsh-session.d.ts +6 -0
  72. package/node_modules/@rho-workspace/plugin-agent/dist/dsh-session.js +174 -0
  73. package/node_modules/@rho-workspace/plugin-agent/dist/external-session-contract.d.ts +82 -0
  74. package/node_modules/@rho-workspace/plugin-agent/dist/external-session-contract.js +20 -0
  75. package/node_modules/@rho-workspace/plugin-agent/dist/external-session.d.ts +84 -0
  76. package/node_modules/@rho-workspace/plugin-agent/dist/external-session.js +190 -0
  77. package/node_modules/@rho-workspace/plugin-agent/dist/index.d.ts +373 -0
  78. package/node_modules/@rho-workspace/plugin-agent/dist/index.js +1 -0
  79. package/node_modules/@rho-workspace/plugin-agent/dist/native-sessions.d.ts +70 -0
  80. package/node_modules/@rho-workspace/plugin-agent/dist/native-sessions.js +538 -0
  81. package/node_modules/@rho-workspace/plugin-agent/dist/operations.d.ts +33 -0
  82. package/node_modules/@rho-workspace/plugin-agent/dist/operations.js +3 -0
  83. package/node_modules/@rho-workspace/plugin-agent/dist/presentation.d.ts +14 -0
  84. package/node_modules/@rho-workspace/plugin-agent/dist/presentation.js +2 -0
  85. package/node_modules/@rho-workspace/plugin-agent/dist/ui-external-session.d.ts +15 -0
  86. package/node_modules/@rho-workspace/plugin-agent/dist/ui-external-session.js +37 -0
  87. package/node_modules/@rho-workspace/plugin-agent/package.json +6 -1
  88. package/node_modules/hono/dist/adapter/aws-lambda/handler.js +1 -1
  89. package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +1 -1
  90. package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
  91. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
  92. package/node_modules/hono/dist/cjs/client/fetch-result-please.js +1 -1
  93. package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +2 -1
  94. package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +5 -3
  95. package/node_modules/hono/dist/cjs/jsx/base.js +49 -30
  96. package/node_modules/hono/dist/cjs/jsx/components.js +2 -2
  97. package/node_modules/hono/dist/cjs/jsx/constants.js +2 -0
  98. package/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +13 -17
  99. package/node_modules/hono/dist/cjs/middleware/etag/index.js +3 -1
  100. package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +1 -0
  101. package/node_modules/hono/dist/cjs/middleware/timing/timing.js +4 -3
  102. package/node_modules/hono/dist/cjs/utils/cookie.js +2 -2
  103. package/node_modules/hono/dist/cjs/utils/mime.js +1 -1
  104. package/node_modules/hono/dist/cjs/utils/url.js +1 -1
  105. package/node_modules/hono/dist/client/fetch-result-please.js +1 -1
  106. package/node_modules/hono/dist/helper/accepts/accepts.js +2 -1
  107. package/node_modules/hono/dist/helper/ssg/ssg.js +5 -3
  108. package/node_modules/hono/dist/jsx/base.js +49 -32
  109. package/node_modules/hono/dist/jsx/components.js +2 -2
  110. package/node_modules/hono/dist/jsx/constants.js +2 -1
  111. package/node_modules/hono/dist/jsx/jsx-runtime.js +15 -19
  112. package/node_modules/hono/dist/middleware/etag/index.js +3 -1
  113. package/node_modules/hono/dist/middleware/language/language.js +1 -1
  114. package/node_modules/hono/dist/middleware/pretty-json/index.js +1 -0
  115. package/node_modules/hono/dist/middleware/timing/timing.js +4 -3
  116. package/node_modules/hono/dist/utils/cookie.js +2 -2
  117. package/node_modules/hono/dist/utils/mime.js +1 -1
  118. package/node_modules/hono/dist/utils/url.js +1 -1
  119. package/node_modules/hono/package.json +1 -1
  120. package/package.json +5 -3
  121. package/protocol/index.json +93 -33
  122. package/protocol/operations/agent.sessions.list.json +146 -0
  123. package/protocol/operations/agent.sessions.read.json +315 -0
  124. package/protocol/operations/conversation.configure.json +29 -0
  125. package/protocol/operations/conversation.decide.json +29 -0
  126. package/protocol/operations/conversation.list.json +29 -0
  127. package/protocol/operations/conversation.permission.json +29 -0
  128. package/protocol/operations/conversation.read.json +29 -0
  129. package/protocol/operations/conversation.restore.json +29 -0
  130. package/protocol/operations/conversation.send.json +29 -0
  131. package/protocol/operations/conversation.settings.check.json +92 -0
  132. package/protocol/operations/conversation.settings.read.json +92 -0
  133. package/protocol/operations/conversation.settings.update.json +92 -0
  134. package/protocol/operations/conversation.start.json +46 -1
  135. package/protocol/operations/conversation.stop.json +29 -0
  136. package/protocol/operations/conversation.trash.json +29 -0
  137. package/protocol/operations/extension.call.json +132 -0
  138. package/protocol/operations/extension.content.json +78 -0
  139. package/protocol/operations/extension.describe.json +195 -0
  140. package/protocol/operations/extension.install.json +198 -0
  141. package/protocol/operations/extension.list.json +123 -0
  142. package/protocol/operations/extension.manage.json +55 -0
  143. package/protocol/operations/extension.read.json +112 -0
  144. package/protocol/operations/observation.snapshot.json +29 -0
  145. package/protocol/operations/project.work.read.json +3 -2
  146. package/protocol/operations/session.grant.json +9 -0
  147. package/protocol/operations/session.instructions.json +43 -0
  148. package/scripts/third-party-acceptance.mjs +77 -0
  149. package/vendor/composition.json +83 -83
  150. package/vendor/rho-workspace-plugin-agent-0.4.30.tgz +0 -0
  151. package/web/theme.css +12 -0
  152. package/dist/web/assets/choices-DU9kHlyQ.js +0 -1
  153. package/dist/web/assets/dist-BV3hWfn_.js +0 -3
  154. package/dist/web/assets/dist-CLNF2g-E.js +0 -1
  155. package/dist/web/assets/explore-in-8Q5ftt-E.js +0 -1
  156. package/dist/web/assets/graph-hS2kvHTI.js +0 -2
  157. package/dist/web/assets/index-Cj1_iqyK.css +0 -1
  158. package/dist/web/assets/overview-BV6ZO5TO.js +0 -6
  159. package/dist/web/assets/preview-n5lOOdjN.js +0 -1
  160. package/dist/web/assets/workspace-BKFefRfJ.js +0 -5
  161. package/vendor/rho-workspace-plugin-agent-0.4.28.tgz +0 -0
@@ -0,0 +1,5 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{n as t,t as n}from"./react-Dss-ouuy.js";import{r}from"./markdown-0ngRuTpW.js";import{A as i,C as a,D as o,E as s,O as c,S as l,T as u,_ as d,b as f,d as p,g as m,h,k as g,m as _,v,w as y,x as b,y as x}from"./canvas-D8rDdfDz.js";import{$ as S,Jt as C,Q as ee,Z as w,a as te,c as ne,d as T,et as re,f as E,h as ie,i as ae,l as oe,m as se,n as ce,nt as le,o as ue,p as de,r as fe,rt as D,s as pe,t as me,u as he,ut as ge,v as _e}from"./index-BpL_Kl_s.js";import{a as ve,i as ye,t as be}from"./console-Trqc0swD.js";import{a as xe,c as Se,i as Ce,l as we,n as Te,o as Ee,r as De,s as Oe,t as ke}from"./facts-BMO6V3-3.js";import{t as Ae}from"./snapshot-CAxBYPvV.js";import{t as je}from"./explore-in-BCHqjJ7B.js";var O=e(n(),1),Me=e(C(),1);function k(e){return e.at??e.after??null}var Ne=e=>e===null?null:Date.parse(e);function Pe(e=`following`){return{step:-1,time:null,attention:e,question:null,objects:{},order:[],views:[],active:null,agent:null,suggestions:[],escalations:[],digest:null,items:[],hidden:{catalog:0,rejected:0,retries:0},revealed:null,expanded:[],moves:[],lastMove:null,pending:null,away:null}}function Fe(e,t,n,r){e.presentationClock=r,We(e,t,{...n,seq:e.step+1})}function Ie(e,t,n){Xe(e,t,{...n,at:e.step})}function Le(e,t){let n=e.time;e.presentationClock=t,e.time=new Date(t).toISOString(),F(e),e.time=n}function Re(e){for(let t of e.views)t.newer=et(e,t);let{lastMove:t,pending:n,away:r,presentationClock:i,...a}=e;return structuredClone(a)}function ze(e,t){return e.objects[t.id]||(e.objects[t.id]=t,e.order.push(t.id)),e.objects[t.id]}var Be=(e,t,n)=>ze(e,{id:`source:`+t,kind:`source`,name:t,version:1,savedVersion:null,changedAt:n,touchedAt:n,hidden:0}),Ve=(e,t,n)=>ze(e,{id:`artifact:`+t,kind:`artifact`,name:t,versions:[],changedAt:n,touchedAt:n,hidden:0}),He=(e,t)=>e.views.find(e=>e.id===t),Ue=e=>e.openedBy===`person`||e.pinned,A=(e,t)=>He(e,t)??e.views.find(e=>e.object===t&&Ue(e))??e.views.find(e=>e.object===t),j=(e,t,n)=>{let r=He(e,e.active);return!!r&&r.object===t&&(n===null||r.run===n)};function M(e,t,n){let r=t;for(;He(e,r);)r+=`@`+n;return r}var N=(e,t,n,r,i)=>({id:M(e,t,n),object:t,run:n,openedBy:r,pinned:!1,preview:i,selection:[],newer:null});function We(e,t,n){e.step=n.seq,e.time=k(n)??e.time;let r=n.object?e.objects[n.object]:void 0;if(r&&(r.touchedAt=n.seq),n.outcome===`rejected`)return r?r.hidden++:e.hidden.rejected++,F(e);let i=n.effect;if(!i)return F(e);let a=t.principals[n.actor]?.kind===`agent`,o=(t,r)=>a?P(e,n,t,r):F(e);switch(i.kind){case`catalog`:return e.hidden.catalog++,F(e);case`open`:{if(i.source===null)return F(e);let t=!!e.objects[`source:`+i.source],r=Be(e,i.source,n.seq);return r.version=i.version,t||(r.savedVersion=i.version),o(r.id,null)}case`edit`:{let t=Be(e,i.source,n.seq);return t.version=i.version,t.changedAt=n.seq,o(t.id,null)}case`save`:{let t=Be(e,i.source,n.seq);return t.savedVersion=i.version,t.changedAt=n.seq,o(t.id,null)}case`source-state`:{let t=Be(e,i.source,n.seq);return t.version=i.version,t.savedVersion=i.savedVersion,t.changedAt=n.seq,F(e)}case`submit`:if(i.sourceVersion!==null&&!e.objects[`source:`+i.source]){let t=Be(e,i.source,n.seq);t.version=t.savedVersion=i.sourceVersion}return ze(e,{id:`run:`+i.run,kind:`run`,name:`Run `+i.run,run:i.run,source:i.source,sourceVersion:i.sourceVersion,state:i.state??`running`,exit:null,firstLine:null,verified:[],changedAt:n.seq,touchedAt:n.seq,hidden:0}),o(`run:`+i.run,null);case`retry`:{let t=e.objects[`run:`+i.run];return t&&t.hidden++,e.hidden.retries++,F(e)}case`run-state`:case`ended`:{let t=e.objects[`run:`+i.run];return t?(i.kind===`ended`?(t.exit=i.exit,t.state=i.state??(i.exit===0?`completed`:i.exit===null?`unknown`:`failed`)):t.state=i.state,t.changedAt=n.seq,(t.state===`failed`||t.state===`unknown`)&&Ye(e,t,n.seq),t.state===`completed`&&(e.escalations=e.escalations.filter(n=>{let r=e.objects[n.object];return!(r?.kind===`run`&&r.source===t.source&&r.run<t.run)})),o(t.id,null)):F(e)}case`observe`:return o(`run:`+i.run,null);case`output`:{let n=e.objects[`run:`+i.run],r=i.stream?t.runs[i.run]?.outputs[i.stream]??``:``;(i.stream===`stderr`||i.stream&&!n.firstLine)&&(n.firstLine=tt(r));let a=e.escalations.find(e=>e.object===n.id);return a&&n.firstLine&&(a.reason=n.firstLine),o(n.id,null)}case`verified`:{let r=e.objects[`run:`+i.run],a=t.runs[i.run]?.verified??[];if(!r)return F(e);r.verified=[...i.artifacts],r.changedAt=n.seq;for(let t of i.artifacts){let r=Ve(e,t,n.seq),o=a.find(e=>e.name===t)?.digest??`unknown`,s=r.versions.find(e=>e.digest===o);s?s.runs.includes(i.run)||s.runs.push(i.run):(r.versions.push({digest:o,runs:[i.run]}),r.changedAt=n.seq)}return o(r.id,null)}case`registered`:{let t=Ve(e,i.artifact,n.seq);t.name=i.name;let r=t.versions.find(e=>e.digest===i.version);return r?i.run!==null&&!r.runs.includes(i.run)&&r.runs.push(i.run):(t.versions.push({digest:i.version,runs:i.run===null?[]:[i.run]}),t.changedAt=n.seq),F(e)}case`read`:{if(i.artifact===null)return F(e);let t=Ve(e,i.artifact,n.seq);return t.touchedAt=n.seq,o(t.id,i.run)}case`layout`:return a?qe(e,n,i.views,i.replace):F(e);case`items`:return i.question!==null&&(e.question=i.question),i.items&&(e.items=i.items),F(e);case`ask`:return ze(e,{id:i.question,kind:`question`,name:i.text,author:n.actor,target:i.target,version:i.version,run:i.run,rows:[...i.rows],document:i.document,state:`prepared`,fetchedBy:null,fetchedAt:null,changedAt:n.seq,touchedAt:n.seq,hidden:0}),F(e);case`fetched`:{let t=e.objects[i.question];return t?.kind===`question`&&(t.state!==`responded`&&(t.state=`fetched`),t.fetchedBy=n.actor,t.fetchedAt=n.seq,t.changedAt=n.seq),F(e)}case`responded`:{let t=e.objects[i.question];return t?.kind===`question`&&(t.state=`responded`,t.changedAt=n.seq),F(e)}}}function P(e,t,n,r){e.attention===`following`?j(e,n,r)?(e.agent={object:n,run:r,seq:t.seq,placement:`main`},e.pending=null):I(e,t)?(e.pending={kind:`focus`,object:n,run:r},e.agent={object:n,run:r,seq:t.seq,placement:`pending`}):(e.pending=null,Ke(e,n,r,`agent`),e.agent={object:n,run:r,seq:t.seq,placement:`main`},Ge(e,t,`agent`,`agent-focus`)):e.agent={object:n,run:r,seq:t.seq,placement:`marker`}}function F(e){if(!e.pending||e.attention!==`following`)return;let t={seq:e.step,at:e.time};if(I(e,t))return;let n=e.pending;e.pending=null,n.kind===`focus`?(Ke(e,n.object,n.run,`agent`),e.agent&&(e.agent.placement=`main`),Ge(e,t,`agent`,`agent-focus`)):Je(e,t,n.views,n.replace)}function I(e,t){let n=e.presentationClock??Ne(k(t))??Ne(e.time);return e.lastMove!==null&&n!==null&&n-e.lastMove<8e3}function Ge(e,t,n,r){n===`agent`&&(e.lastMove=e.presentationClock??Ne(k(t))??Ne(e.time)??e.lastMove),e.moves.push({seq:t.seq,by:n,view:e.active,rule:r})}function Ke(e,t,n,r,i){let a=e.views.filter(e=>e.object===t),o=r===`person`?A(e,t):a.find(e=>(n===null||e.run===n)&&(!i||e.version===i))??a.find(e=>!Ue(e));if(o&&r===`agent`&&n!==null&&(o.run=n),!o){o=N(e,t,n,r,r===`agent`);let i=r===`agent`?e.views.findIndex(e=>e.preview):-1;i>=0?e.views[i]=o:e.views.push(o)}r===`person`&&(o.preview=!1,o.openedBy=`person`),i&&(o.version=i),e.active=o.id}function qe(e,t,n,r){let i=e.views.some(t=>t.pinned&&t.id===e.active);if(e.attention===`following`&&!i){if(I(e,t)){e.pending={kind:`layout`,views:n,replace:r};return}return Je(e,t,n,r)}let a=e.attention===`away`?`away`:i?`pinned`:`working`,o=e.suggestions.find(e=>e.id.startsWith(`layout`));o?(o.views=n,o.merged++,o.cause=a):e.suggestions.push({id:`layout:`+t.seq,views:n,cause:a,from:t.seq,merged:0})}function Je(e,t,n,r,i=`agent`){r&&(e.views=e.views.filter(Ue));let a=null;for(let t of n){let n=t.object??`artifact:`+t.artifact,r=e.views.filter(e=>e.object===n),o=r.find(e=>e.run===t.run&&(!t.version||e.version===t.version))??r.find(e=>!Ue(e));o?(o.run=t.run,o.preview=!1):e.views.push(o=N(e,n,t.run,i,!1)),t.version&&(o.version=t.version),a??=o.id}e.active=a??e.active,Ge(e,t,i===`agent`?`agent`:`person`,i===`agent`?`agent-layout`:`accept`)}function Ye(e,t,n){if(e.attention!==`working`||Object.values(e.objects).some(e=>e.kind===`run`&&e.source===t.source&&e.run>t.run&&e.state===`completed`))return;let r=e.objects[He(e,e.active)?.object??``];r&&(r.id===t.id||r.id===`source:`+t.source||r.kind===`run`&&r.source===t.source||r.kind===`artifact`&&r.versions.some(n=>n.runs.some(n=>e.objects[`run:`+n]?.source===t.source)))&&!e.escalations.some(e=>e.object===t.id)&&e.escalations.push({object:t.id,reason:t.state===`unknown`?`Outcome unknown`:t.exit===null?`Execution failed`:`Exit `+t.exit,from:n})}function Xe(e,t,n){let r={seq:Math.max(n.at,-1),at:e.time},i=()=>{e.attention===`following`&&(e.attention=`working`)};switch(n.kind){case`follow`:e.attention=`following`,e.agent&&!j(e,e.agent.object,e.agent.run)&&(Ke(e,e.agent.object,e.agent.run,`agent`),e.moves.push({seq:r.seq,by:`person`,view:e.active,rule:`catch-up`})),e.agent&&(e.agent.placement=`main`),e.pending=null;return;case`unfollow`:e.attention=`working`;return;case`open`:{if(i(),n.version!==void 0||n.run!==void 0){let t=e.views.find(e=>e.object===n.target&&e.run===(n.run??null)&&(!n.version||e.version===n.version));t||(t=N(e,n.target,n.run??null,`person`,!1),e.views.push(t)),n.version&&(t.version=n.version),t.openedBy=`person`,t.preview=!1,e.active=t.id,e.escalations=e.escalations.filter(e=>e.object!==n.target),e.moves.push({seq:r.seq,by:`person`,view:e.active,rule:`person`});return}let t=e.objects[n.target],a=e.items.find(e=>`item:`+e.id===n.target),o=t?.kind===`question`?{object:t.target,version:t.version,run:t.run}:a?.artifact;if(o){let t=e.views.find(t=>t.object===o.object&&(t.version??Qe(e,o.object,t.run))===o.version);if(t)t.preview=!1,t.openedBy=`person`,e.active=t.id;else{let t=N(e,o.object,o.run,`person`,!1);t.version=o.version,e.views.push(t),e.active=t.id}e.moves.push({seq:r.seq,by:`person`,view:e.active,rule:`person`});return}let s=A(e,n.target),c=s?.object??n.target;s?(s.preview=!1,s.openedBy=`person`,e.active=s.id):Ke(e,c,c.startsWith(`artifact:`)?$e(e,c):null,`person`),e.escalations=e.escalations.filter(e=>e.object!==c),e.moves.push({seq:r.seq,by:`person`,view:e.active,rule:`person`});return}case`select`:{i();let t=A(e,n.target);t&&(t.selection=[...n.rows],t.preview=!1,t.openedBy=`person`);return}case`type`:i();return;case`close`:{let t=A(e,n.target);e.views=e.views.filter(e=>e!==t),t&&e.active===t.id&&(e.active=e.views.at(-1)?.id??null);return}case`pin`:case`unpin`:{let t=A(e,n.target);t&&(t.pinned=n.kind===`pin`,t.preview=!1,t.openedBy=`person`);return}case`update`:{i();let t=A(e,n.target),a=t?et(e,t):null;if(!t||a===null)return;t.run=a,t.version&&=Qe(e,t.object,a)??void 0,e.views=e.views.filter(e=>e===t||e.pinned||e.object!==t.object||e.run!==a),e.active=t.id,e.moves.push({seq:r.seq,by:`person`,view:e.active,rule:`person`});return}case`leave`:if(e.attention===`away`)return;e.pending=null,e.away={from:e.step,prior:e.attention,baseline:structuredClone(e.objects),suggestions:e.suggestions.map(e=>e.id),items:JSON.stringify(e.items)},e.attention=`away`;return;case`return`:{if(!e.away)return;let t=Ze(e,e.away);e.digest=t.length?{from:e.away.from,to:e.step,lines:t}:null,e.attention=e.away.prior,e.away=null;return}case`accept`:{let t=e.suggestions.find(e=>e.id===n.suggestion);if(!t)return;e.suggestions=e.suggestions.filter(e=>e!==t),Je(e,r,t.views,!1,`person`);return}case`ask`:{i();let t=A(e,n.target),a=t?Qe(e,t.object,t.run):null;if(!t||a===null||t.run===null)return;ze(e,{id:`question:asked-`+(e.order.filter(e=>e.startsWith(`question:asked-`)).length+1),kind:`question`,name:n.text,author:null,target:t.object,version:a,run:t.run,rows:[...n.rows],document:null,state:`prepared`,fetchedBy:null,fetchedAt:null,changedAt:r.seq,touchedAt:r.seq,hidden:0});return}case`dismiss`:e.suggestions=e.suggestions.filter(e=>e.id!==n.suggestion);return;case`dismiss-digest`:e.digest=null;return;case`reveal`:e.revealed=n.target;return;case`expand`:e.expanded.includes(n.target)||e.expanded.push(n.target);return;case`collapse`:e.expanded=e.expanded.filter(e=>e!==n.target);return}}function Ze(e,t){let n=[],r={source:0,run:1,artifact:2,question:3};for(let i of[...e.order].sort((t,n)=>r[e.objects[t].kind]-r[e.objects[n].kind])){let r=e.objects[i],a=t.baseline[i];if(r.kind===`source`&&(!a||a.version!==r.version)&&n.push({kind:`source`,object:i,from:a?a.version:null,to:r.version}),r.kind===`run`&&(!a||a.state!==r.state||a.verified.length!==r.verified.length)){let t={kind:`run`,object:i,state:r.state,firstLine:r.state===`completed`?null:r.firstLine,verified:r.verified.length,earlier:[]},a=n.findIndex(t=>t.kind===`run`&&e.objects[t.object].source===r.source);if(a<0)n.push(t);else{let e=n[a];t.earlier=[...e.earlier,e.object],n[a]=t}}r.kind===`artifact`&&r.versions.length!==(a?.versions.length??0)&&n.push({kind:`artifact`,object:i,versions:r.versions.length-(a?.versions.length??0)}),r.kind===`question`&&(!a||a.state!==r.state)&&n.push({kind:`question`,object:i,state:r.state})}for(let r of e.suggestions)t.suggestions.includes(r.id)||n.push({kind:`suggestion`,id:r.id});return JSON.stringify(e.items)!==t.items&&n.push({kind:`items`,count:e.items.length}),n}var Qe=(e,t,n)=>{let r=e.objects[t];return r?.kind===`artifact`&&n!==null?r.versions.find(e=>e.runs.includes(n))?.digest??null:null},$e=(e,t)=>e.objects[t]?.versions.at(-1)?.runs.at(-1)??null;function et(e,t){let n=e.objects[t.object];if(n?.kind!==`artifact`||t.run===null||!Ue(t))return null;let r=n.versions.findIndex(e=>e.runs.includes(t.run));return r>=0&&r<n.versions.length-1?$e(e,t.object):null}function tt(e){return e.split(`
2
+ `).map(e=>e.trim()).find(Boolean)??null}var L=()=>({activity:0,runs:[],states:{},documents:{},resources:{},composition:0,questions:{}}),nt=e=>e.split(`/`).at(-1)??e;function rt(e,t,n,r,i){let a={format:`rho.replay-trace/1`,recorded:{experiment:`live`,project:e.project.id,from:``,to:``},facts:[],principals:{},sources:{},runs:{},artifacts:{}},o={},s={},c=(e,t,n,r,i,o)=>{a.principals[t]={kind:t.startsWith(`agent:`)?`agent`:t.startsWith(`browser:`)?`browser`:`operator`,name:null},a.facts.push({seq:a.facts.length,label:e,op:e,actor:t,at:n,effect:r,object:i,outcome:o?`rejected`:`returned`,...o?{reason:o}:{}})},l=e=>{let t=r.runs.indexOf(e);return t<0?null:t+1},u=new Set;for(let e of[...t].sort((e,t)=>e.acceptedAt.localeCompare(t.acceptedAt))){r.runs.includes(e.operationId)||r.runs.push(e.operationId);let t=l(e.operationId),n=e.sourceKey??e.operationId;o[`run:`+t]=e.operationId,a.runs[t]={operationId:e.operationId,source:n,sourceVersion:null,declared:e.declared.map(e=>e.path),acceptedAt:e.acceptedAt,exit:null,observedAt:null,outputs:{}};let i=JSON.stringify([e.execution,e.integrity]);r.states[e.operationId]!==i&&u.add(e.operationId),e.operationId in r.states||c(`action.accepted`,`operator`,e.acceptedAt,{kind:`submit`,run:t,source:n,sourceVersion:null,state:`unobserved`},`run:`+t),r.states[e.operationId]!==i&&c(`operation.observed`,`operator`,null,{kind:`run-state`,run:t,state:e.execution===`active`?`running`:[`completed`,`failed`,`unobserved`].includes(e.execution)?e.execution:`unknown`},`run:`+t),r.states[e.operationId]=i}for(let t of e.documents){let e=`source:`+t.path;o[e]=t.path,a.sources[t.path]={versions:{},edited:{},saved:{},authors:{}};let n=JSON.stringify([t.version,t.dirty]);r.documents[t.id]!==n&&(c(`document.observed`,`operator`,t.acknowledgedAt,{kind:`source-state`,source:t.path,version:t.version,savedVersion:t.dirty?null:t.version},e),r.documents[t.id]=n),s[`document:`+t.id]={object:e,artifact:``,run:null}}for(let n of e.resources){let e=n.provenance,i=t.find(t=>t.operationId===e.operationId),u=i?.declared.find(e=>n.path===e.path||n.path.endsWith(`/`+e.path)),d=r.resources[n.id],f=`@`+n.version,p=i?.sourceKey&&u?i.sourceKey+`/`+u.path:d?.endsWith(f)?d.slice(0,-f.length):n.id,m=`artifact:`+p,h=e.operationId?l(e.operationId):null,g={artifact:p,run:h,version:n.version};s[n.id+`@`+n.version]=g,o[m]=nt(n.path);let _=(a.artifacts[p]??={kind:n.kind,versions:{}}).versions,v=_[n.version]??={runs:[],bytes:n.bytes};h!==null&&v.runs.push(h),r.resources[n.id]!==p+`@`+n.version&&(c(`resource.registered`,`operator`,null,{kind:`registered`,artifact:p,name:nt(n.path),version:n.version,run:h},m),r.resources[n.id]=p+`@`+n.version)}for(let n of t)if(n.integrity===`verified`&&u.has(n.operationId)){let t=l(n.operationId),r=e.resources.filter(e=>e.provenance.operationId===n.operationId);a.runs[t].verified=r.map(e=>({name:s[e.id+`@`+e.version].artifact,digest:e.version,kind:e.kind})),c(`artifact.integrity.observed`,`operator`,null,{kind:`verified`,run:t,artifacts:a.runs[t].verified.map(e=>e.name)},`run:`+t)}for(let e of n.views){let t=at(e,s);t&&(s[`view:`+e.id]=t)}let d=e.activity.retainedFrom>r.activity+1;for(let t of e.activity.entries){let n=t;if(n.cursor<=r.activity)continue;let i=e.documents.find(e=>e.id===n.documentId),a=typeof n.operationId==`string`?l(n.operationId):null,o=n.resource,u=o?s[o.id+`@`+o.version]:void 0,d,f;i&&(f=`source:`+i.path),a!==null&&(f=`run:`+a),u&&(f=u.object??`artifact:`+u.artifact),n.outcome===`rejected`?c(n.method,n.principal,n.at,void 0,f,{kind:typeof n.errorKind==`string`?n.errorKind:`unrecorded`,message:null}):([`capability.index`,`capability.resolve`].includes(n.method)&&(d={kind:`catalog`}),i&&typeof n.returnedVersion==`number`&&[`document.open`,`document.read`,`document.edit`,`document.save`].includes(n.method)&&(d={kind:`open`,source:i.path,version:i.version}),a!==null&&[`action.submit`,`action.lookup`,`action.observe`,`artifact.check`,`action.output`].includes(n.method)&&(d={kind:`observe`,run:a}),n.method===`data.page`&&(d={kind:`read`,artifact:u?.artifact??null,run:u?.run??null}),c(n.method,n.principal,n.at,d,f))}if(r.activity=Math.max(r.activity,e.activity.cursor),n.version!==r.composition){let e=n.views.flatMap(e=>s[`view:`+e.id]?[s[`view:`+e.id]]:[]);c(`composition.observed`,n.author??`operator`,n.acknowledgedAt??null,{kind:`layout`,replace:!0,views:e},`layout`),r.composition=n.version}for(let t of e.annotations){let n=t,i=n.messages?.[0],a=n.anchor;if(a?.kind!==`table`||!i)continue;let o=s[a.resource.id+`@`+a.resource.version];if(!o)continue;let l=`question:`+n.annotationId,u=e.contexts.find(e=>e.responses?.some(e=>e.annotationId===n.annotationId)),d=n.messages.some(e=>e.replyTo===i.id&&e.author.startsWith(`agent:`)),f=u?.delivery===`tool-fetched`&&u.fetchedBy?.startsWith(`agent:`),p=d?`responded`:f?`fetched`:`prepared`;if(l in r.questions||c(`annotation.create`,i.author,i.at,{kind:`ask`,question:l,text:i.draft.text,target:`artifact:`+o.artifact,version:a.resource.version,run:o.run,rows:a.entities,document:null},l),r.questions[l]!==p){if(f&&c(`context.read`,u.fetchedBy,u.fetchedAt,{kind:`fetched`,question:l},l),d){let e=n.messages.find(e=>e.replyTo===i.id&&e.author.startsWith(`agent:`));c(`annotation.reply`,e.author,e.at,{kind:`responded`,question:l},l)}r.questions[l]=p}}if(i){let e=i.items.map(e=>it(e,i.vocabulary,s)),t=JSON.stringify([i.question,e]);if(r.items!==t){let n=i.items.reduce((e,t)=>!e||t.at>e.at?t:e,void 0);c(`task.map.observed`,n?.author??`operator`,n?.at??null,{kind:`items`,question:i.question,items:e},`map`),r.items=t}}return{trace:a,refs:s,names:o,gap:d}}function it(e,t,n){let r=e.artifact&&n[e.artifact.id+`@`+e.artifact.version];return{id:e.id,kind:t.kinds[e.kind]?.label??e.kind,state:t.states[e.state]?.label??e.state,title:e.title,author:e.author,...e.summary?{summary:e.summary}:{},...e.view?{view:e.view}:{},...e.from?{from:e.from}:{},...e.lines?{lines:e.lines}:{},...r&&r.run!==null?{artifact:{object:r.object??`artifact:`+r.artifact,version:e.artifact.version,run:r.run}}:{}}}function at(e,t){for(let n of Object.values(e.bindings??{})){let e=n.documentId?t[`document:`+n.documentId]:t[n.id+`@`+n.version];if(e)return e}}var R={maxViews:64,maxEvidence:256,maxCheckpointBytes:1048576},ot=e=>e.object??`artifact:`+e.artifact,st=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function ct(e){let t=e.catalog?.components.find(e=>e.id===`rho.editor`),n=t?e.documents.map(e=>({id:`source:`+e.id,component:t.id,version:t.version,props:{title:e.path},bindings:{document:{kind:`live-document`,documentId:e.id}}})):[];for(let t of e.resources){let r=e.catalog?.components.find(e=>e.id===(t.kind===`table`?`rho.table`:t.kind===`media`?`rho.media`:``));if(!r)continue;let i=Object.keys(r.bindings)[0];i&&n.push({id:`object:`+t.id.slice(0,32)+`:`+t.version.slice(0,32),component:r.id,version:r.version,props:{title:t.path.split(`/`).at(-1)},bindings:{[i]:{id:t.id,version:t.version}}})}return n}function z(e,t,n,r){let i=L(),a=rt(e,t,n,i,r),o=Pe(`working`);for(let e of a.trace.facts)Fe(o,a.trace,e);return o.attention=`following`,o.suggestions=[],o.moves=[],o.views=n.views.flatMap(e=>{let t=at(e,a.refs);return t?[{id:e.id,object:ot(t),run:t.run,...t.version?{version:t.version}:{},openedBy:`agent`,pinned:!!e.protected,preview:!1,selection:[],newer:null}]:[]}),o.active=o.views[0]?.id??null,{format:1,expression:o,index:i,layout:structuredClone(n),latest:structuredClone(n),held:{},refs:a.refs,available:ct(e),trace:a.trace,evidence:a.trace.facts.slice(-R.maxEvidence),gap:a.gap,limit:``,active:n.views[0]?.id??``,names:a.names}}function B(e){let t=structuredClone(e.latest),n=new Map;for(let r of t.views){let i=e.held[r.id];i&&!st(i.bindings,r.bindings)&&n.set(r.id,`new:`+r.id.slice(0,70)+`:`+t.version)}t.views=t.views.map(e=>({...e,id:n.get(e.id)??e.id})),t.nodes&&=t.nodes.map(e=>e.kind===`view`?{...e,id:n.get(e.id)??e.id}:{...e,children:e.children.map(e=>n.get(e)??e)});for(let n of Object.values(e.held))if(!t.views.some(e=>e.id===n.id)){t.views.push(n);let e=t.nodes?.find(e=>e.kind===`group`&&e.id===t.rootId);e?.kind===`group`&&(e.children.push(n.id),e.presentation?.weights&&e.presentation.weights.push(1),t.nodes.push({...n,kind:`view`}))}t.views.length>R.maxViews?e.limit=`The 64-view presentation limit was reached. Existing views are kept; close or unpin views before accepting another layout.`:(e.layout=t,e.preview=void 0)}function V(e,t){let n=e.expression.moves.slice(t);n.some(e=>e.rule===`agent-layout`||e.rule===`accept`)&&B(e);let r=e.expression.views.find(t=>t.id===e.expression.active);if(!r||!n.length)return;let i=[...e.layout.views,...e.latest.views,...e.available??[]].find(t=>{let n=at(t,e.refs);return n&&ot(n)===r.object&&(r.run===null||n.run===r.run)&&(!r.version||n.version===r.version)});if(i){let t=i.id,n=e.layout.views.find(e=>e.id===t);if(n&&!st(n.bindings,i.bindings)&&(t=`preview:`+t.slice(0,70)+`:`+e.latest.version),!e.layout.views.some(e=>e.id===t)){if(e.layout.views.length>=R.maxViews){e.limit=`The 64-view presentation limit was reached; the new object remains in recorded evidence.`;return}let n=e.layout.views.filter(t=>t.id!==e.preview||e.held[t.id]);e.layout={...e.layout,views:[...n,{...i,id:t}]},r.preview&&(e.preview=t)}e.active=t}else if(r.object.startsWith(`run:`)){let t=e.names[r.object];if(!t)return;let n=`execution:`+t;!e.layout.views.some(e=>e.id===n)&&e.layout.views.length<R.maxViews&&(e.layout={...e.layout,views:[...e.layout.views.filter(t=>t.component!==`rho.execution`&&t.id!==e.preview||e.held[t.id]),{id:n,component:`rho.execution`,version:`1`,props:{title:t,operationId:t},bindings:{}}]},e.preview=n),e.layout.views.some(e=>e.id===n)&&(e.active=n)}}function lt(e,t,n,r,i,a){let o=rt(t,n,r,e.index,a),s=e.expression.moves.length;e.latest=structuredClone(r),e.refs=o.refs,e.names=o.names,e.trace=o.trace,e.available=ct(t),e.gap||=o.gap;for(let t of o.trace.facts)Fe(e.expression,o.trace,t,i);e.evidence.push(...o.trace.facts),e.evidence=e.evidence.slice(-R.maxEvidence),V(e,s),!r.author?.startsWith(`agent:`)&&e.layout.version!==r.version&&B(e),e.expression.moves=e.expression.moves.slice(-32)}function H(e,t){let n=e.expression.moves.length;Ie(e.expression,e.trace,t),V(e,n)}function U(e,t){delete e.held[t]}function ut(e,t){let n=e.layout.views.find(e=>e.id===t);if(!n)return;e.held[t]=structuredClone(n),e.active=t;let r=at(n,e.refs);H(e,r?{kind:`open`,target:ot(r),run:r.run,version:r.version}:{kind:`unfollow`}),e.active=t}function dt(e,t){let n=e.expression.moves.length;Le(e.expression,t),V(e,n)}function ft(e){return Re(e.expression)}function pt(e,t,n,r,i=!1){let{runs:a,problem:o,readAgain:s}=Se(n,e.project.id,e.cursor),c=e.catalog.operations.some(e=>e.method===`task.map.read`&&e.authorized&&e.state===`available`),[l,u]=(0,O.useState)(null),[d,f]=(0,O.useState)(``);(0,O.useEffect)(()=>{if(!c)return;let t=!0;return n.call(`task.map.read`,{projectId:e.project.id}).then(e=>{t&&(u(e),f(``))},e=>{t&&f(`The Agent's declared items could not be read. `+(e?.message??``))}),()=>{t=!1}},[n,e.project.id,e.cursor,c]);let p=[`rho-expression/1`,e.project.id,t.compositionId,r].join(`:`),m=(0,O.useRef)(null),h=(0,O.useRef)(!1),g=(0,O.useRef)(null),_=(0,O.useRef)(`owners`),[,v]=(0,O.useState)(0),[y,b]=(0,O.useState)(``),x=()=>{if(m.current&&sessionStorage.getItem(`rho.browser.session.v1`))try{let e=JSON.stringify(m.current);if(new TextEncoder().encode(e).length>R.maxCheckpointBytes)throw Error(`The 1 MiB return checkpoint limit was reached. Current views are retained in this tab; reload cannot restore the latest attention state.`);sessionStorage.setItem(p,e)}catch(e){b(e.message??`The return checkpoint could not be stored.`)}};(0,O.useEffect)(()=>{if(a){if(m.current){let n=m.current.active;lt(m.current,e,a,t,Date.now(),l),m.current.active!==n&&(_.current=`owners`)}else{try{let e=sessionStorage.getItem(p);if(e&&e.length<=R.maxCheckpointBytes){let n=JSON.parse(e);n.format===1&&n.layout?.compositionId===t.compositionId&&(m.current=n)}}catch{}m.current?(lt(m.current,e,a,t,Date.now(),l),H(m.current,{kind:`return`})):m.current=z(e,a,t,l),h.current&&ut(m.current,g.current&&m.current.layout.views.some(e=>e.id===g.current)?g.current:m.current.active),document.hidden&&H(m.current,{kind:`leave`})}i&&(m.current.layout=structuredClone(t),m.current.held={}),x(),v(e=>e+1)}},[e,t,a,l]),(0,O.useEffect)(()=>{let e=()=>{m.current&&(H(m.current,{kind:document.hidden?`leave`:`return`}),x(),v(e=>e+1))},t=()=>{m.current&&(H(m.current,{kind:`leave`}),x())},n=setInterval(()=>{if(m.current?.expression.pending){let e=m.current.active;dt(m.current,Date.now()),m.current.active!==e&&(_.current=`owners`),x(),v(e=>e+1)}},1e3);return document.addEventListener(`visibilitychange`,e),window.addEventListener(`pagehide`,t),()=>{t(),clearInterval(n),document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`pagehide`,t)}},[p]);let S=e=>{_.current=`person`,m.current&&(e.kind===`unfollow`&&ut(m.current,m.current.active),H(m.current,e),x(),v(e=>e+1))},C=e=>{h.current=!0,g.current=e,_.current=`person`,m.current&&(ut(m.current,e),x(),v(e=>e+1))};return{state:m.current,screen:m.current?ft(m.current):null,layout:m.current?.layout??t,active:m.current?.active,movedBy:_.current,runs:a,readRuns:s,map:l,act:S,release:e=>{m.current&&(U(m.current,e),x())},hold:C,openResource:t=>{if(!m.current)return;let n=e.resources.find(e=>e.id===t.id&&e.version===t.version),r=e.compositions.flatMap(e=>e.views).find(e=>Object.values(e.bindings).some(e=>`id`in e&&e.id===t.id&&e.version===t.version)),i=e.catalog.components.find(e=>e.id===(n?.kind===`table`?`rho.table`:`rho.media`)),a=i&&Object.keys(i.bindings)[0];if(!n||!r&&(!i||!a)){b(`The linked result has no available resource viewer. Its exact reference is retained in the reply.`);return}let o=`result:`+t.id.slice(0,32)+`:`+t.version.slice(0,32);if(!m.current.layout.views.some(e=>e.id===o)){if(m.current.layout.views.length>=R.maxViews){b(`The 64-view limit was reached. The reply and linked result are retained.`);return}let e=r?{...r,id:o}:{id:o,component:i.id,version:i.version,props:{title:n.path.split(`/`).at(-1)},bindings:{[a]:t}};m.current.layout={...m.current.layout,views:[...m.current.layout.views,e]}}C(o)},problem:[o,d,y,m.current?.limit].filter(Boolean).join(` · `)}}var W=t();function mt(e){let t=n=>{let r=e.screen?.objects[n];return r?.kind===`question`?`Question about `+t(r.target):e.state?.names[n]??r?.name??n};return t}var ht={running:`running`,completed:`completed`,failed:`failed`,unknown:`outcome unknown`,unobserved:`accepted, not seen running yet`},G={prepared:`prepared, not fetched`,fetched:`fetched by the Agent`,responded:`answered by the Agent`};function K(e){return e?e.kind===`run`?ht[e.state]??e.state:e.kind===`source`?e.savedVersion!==null&&e.savedVersion!==e.version?`version ${e.version}, unsaved`:`version ${e.version}`:e.kind===`artifact`?e.versions.length===1?`1 version`:`${e.versions.length} versions`:G[e.state]??e.state:``}var q=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}),gt=e=>new Date(e).toLocaleDateString([],{month:`short`,day:`numeric`}),J=(e,t)=>new Date(e).toDateString()===new Date(t).toDateString(),Y=e=>{let t=Math.max(0,Math.round(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`},_t=e=>(J(e,new Date().toISOString())?``:gt(e)+` `)+q(e);function X({live:e,who:t=!0}){let n=e.screen,r=n.agent,i=mt(e);return r?(0,W.jsxs)(`button`,{className:`shell-agent`,"data-rho-agent":``,title:`The Agent's latest object: ${i(r.object)}`,onClick:()=>e.act({kind:`open`,target:r.object}),children:[(0,W.jsx)(`span`,{className:t?`shell-agent-who`:`visually-hidden`,children:`Agent`}),` `,(0,W.jsx)(`span`,{className:`shell-agent-object`,children:i(r.object)}),` `,(0,W.jsxs)(`span`,{className:`shell-agent-state`,children:[K(n.objects[r.object]),r.placement===`pending`?` · shows when you pause`:``]})]}):null}function vt({live:e,evidence:t,onEvidence:n,held:i,attention:a=!0}){let{screen:o,act:s}=e;if(!o||!e.state)return(0,W.jsx)(`div`,{className:`shell-bar`,role:`status`,children:`Reading workspace…`});let c=o.attention===`following`;return(0,W.jsxs)(`div`,{className:`shell-bar`,"data-attention":o.attention,children:[(0,W.jsx)(X,{live:e}),(0,W.jsx)(`span`,{className:`shell-break`}),i>0&&(0,W.jsxs)(`span`,{className:`shell-held`,role:`status`,children:[i,` updates`]}),a&&(0,W.jsxs)(`button`,{className:`shell-follow`,"aria-pressed":c,title:`Follow the Agent's current view. Your input stops following.`,onClick:()=>s({kind:c?`unfollow`:`follow`}),children:[(0,W.jsx)(r,{name:`eye`,size:14}),c?`Following Agent`:`Follow Agent`]}),a&&(0,W.jsx)(`button`,{className:`shell-quiet`,onClick:()=>s({kind:o.attention===`away`?`return`:`leave`}),children:o.attention===`away`?`Return`:`Step away`}),(0,W.jsxs)(`button`,{className:`shell-quiet shell-evidence-toggle`,"aria-expanded":t,title:`Activity: the calls recorded for this workspace`,onClick:n,children:[(0,W.jsx)(r,{name:`list`,size:15}),(0,W.jsx)(`span`,{children:`Activity`})]})]})}function Z(e,t){let n=e.map?.items.find(e=>e.id===t);return n?e.map.vocabulary.states[n.state]?.role??``:``}var Q={prepared:`Prepared · not fetched by the Agent`,fetched:`Fetched by the Agent · no linked response yet`,responded:`Answered by the Agent`};function yt({contextId:e,prepare:t}){let[n,r]=(0,O.useState)(!1),[i,a]=(0,O.useState)(``);async function o(){a(``);try{let n=e??await t();await navigator.clipboard.writeText(`Answer my question in Rho: read context ${n}. It holds the table version, the rows I asked about and my question. Reply to it with annotation.reply, and link any new result you make.`),r(!0)}catch{a(`Could not copy. Try again.`)}}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{className:`agent-question-copy`,onClick:o,children:n?`Copied`:`Copy request for the Agent`}),i&&(0,W.jsx)(`span`,{role:`alert`,children:i})]})}function bt({live:e,agents:t,contexts:n=[],prepare:i,principalId:a,evidence:o,onEvidence:s,focusObject:c,onClose:l}){let u=(0,O.useRef)(null),d=(0,O.useRef)(null);(0,O.useEffect)(()=>{o&&u.current?.scrollIntoView({block:`start`})},[o]),(0,O.useEffect)(()=>{l&&d.current?.focus()},[!!l]);let f=e.screen,p=e.state,m=mt(e),h=Object.values(f?.objects??{}).find(e=>e.kind===`run`&&e.state===`running`),[g,_]=(0,O.useState)(Date.now()),[v,y]=(0,O.useState)(!1);if((0,O.useEffect)(()=>{if(!h)return;let e=setInterval(()=>_(Date.now()),1e3);return()=>clearInterval(e)},[!!h]),!f||!p)return null;let b=[...t??[]].sort((e,t)=>(e.last?.at??``).localeCompare(t.last?.at??``)).at(-1),x=b?.label||Object.values(p.trace.principals).find(e=>e.kind===`agent`&&e.name)?.name||`The Agent`,S=b?.last?.at,C=h&&e.runs?.find(e=>e.operationId===m(h.id)&&e.execution===`active`),ee=C?C.startedAt??C.acceptedAt:void 0,w=Object.values(f.objects).filter(e=>e.kind===`question`).reverse(),te=f.items.find(e=>c&&e.artifact?.object===c)??f.items.find(t=>Z(e,t.id)===`working`),ne=te?.artifact&&Object.values(f.objects).find(e=>e.kind===`run`&&e.run===te.artifact.run),T=ne?e.runs?.find(e=>e.operationId===m(ne.id)):void 0,re=e=>T?.sourceKey?Object.values(p.refs).find(t=>t.artifact===T.sourceKey+`/`+e&&t.run===ne?.run):void 0,E=v?w:w.slice(0,1);return!h&&!f.items.length&&!T?.declared.length&&!w.length&&!o?null:(0,W.jsxs)(`aside`,{ref:d,className:`agent-column`+(l?` drawer`:``),"aria-label":x,"data-scroll-region":``,tabIndex:0,onKeyDown:e=>{l&&e.key===`Escape`&&(e.stopPropagation(),l())},children:[(0,W.jsxs)(`section`,{className:`agent-card`,children:[(0,W.jsxs)(`header`,{className:`agent-card-head`,children:[(0,W.jsx)(`span`,{className:`agent-dot`+(h?` running`:``),"aria-hidden":`true`}),(0,W.jsx)(`strong`,{children:x}),(0,W.jsx)(`span`,{className:`agent-card-meta`,children:h?`running`+(ee?` `+Y(g-Date.parse(ee)):``):S?`last action `+_t(S):`no recorded action`}),l&&(0,W.jsx)(`button`,{className:`icon-button agent-close`,"aria-label":`Close `+x,onClick:l,children:(0,W.jsx)(r,{name:`close`,size:14,stroke:2})})]}),(0,W.jsx)(X,{live:e,who:!1}),f.items.length>0&&(0,W.jsx)(`section`,{className:`agent-items`,"aria-label":`The Agent's notes`,children:(0,W.jsx)(`ol`,{children:f.items.map(t=>{let n=Z(e,t.id),r=t===te,i=t.artifact?.object,a=i&&!t.title.includes(m(i))?m(i):``;return(0,W.jsxs)(`li`,{className:`agent-item `+(n||`declared`)+(r?` current`:``),"data-fact":`agent`,children:[(0,W.jsx)(`span`,{className:`agent-item-mark`,"aria-hidden":`true`}),i?(0,W.jsx)(`button`,{className:`agent-item-title`,onClick:()=>e.act({kind:`open`,target:i,run:t.artifact.run,version:t.artifact.version}),children:t.title}):(0,W.jsx)(`span`,{className:`agent-item-title`,children:t.title}),(0,W.jsxs)(`span`,{className:`agent-item-meta`,children:[a,n===`done`?(0,W.jsxs)(`span`,{className:`visually-hidden`,children:[a&&` · `,t.state]}):(a&&` · `)+t.state]}),r&&(t.summary||t.lines?.length)?(0,W.jsxs)(`div`,{className:`agent-item-body`,children:[t.summary&&(0,W.jsx)(`p`,{children:t.summary}),t.lines?.map((e,t)=>(0,W.jsxs)(`p`,{children:[e.label?e.label+`: `:``,e.text,e.judgment?` · the Agent's reading`:``]},t))]}):null]},t.id)})})})]}),T&&T.declared.length>0&&(0,W.jsxs)(`section`,{className:`agent-card agent-outputs`,"aria-label":`Outputs of `+T.operationId,children:[(0,W.jsxs)(`header`,{className:`agent-card-head`,children:[(0,W.jsx)(`strong`,{children:`Outputs`}),(0,W.jsx)(`span`,{className:`agent-card-sub`,children:T.operationId}),(0,W.jsx)(`span`,{className:`agent-card-count`,children:T.declared.length})]}),(0,W.jsx)(`ul`,{children:T.declared.map(t=>{let n=re(t.path),i=n?`artifact:`+n.artifact:null,a=!!n&&i===c&&f.views.find(t=>t.id===e.active)?.version===n.version;return(0,W.jsxs)(`li`,{className:a?`current`:void 0,children:[(0,W.jsx)(r,{name:De(t.path),size:15,stroke:1.8}),i&&n?(0,W.jsx)(`button`,{className:`agent-output-name`,"aria-current":a||void 0,onClick:()=>e.act({kind:`open`,target:i,run:n.run,version:n.version}),children:t.path}):(0,W.jsx)(`span`,{className:`agent-output-name`,children:t.path}),T.integrity===`verified`&&t.present?(0,W.jsx)(`span`,{className:`agent-output-check`,title:`Bytes verified`,children:(0,W.jsx)(r,{name:`check`,size:14,stroke:2})}):t.present?null:(0,W.jsx)(`span`,{className:`agent-output-state`,children:`not on disk`})]},t.path)})})]}),w.length>0&&(0,W.jsxs)(`section`,{className:`agent-card`,"aria-label":`Your questions`,children:[(0,W.jsxs)(`header`,{className:`agent-card-head`,children:[(0,W.jsx)(`strong`,{children:`Your questions`}),w.length>1&&(0,W.jsx)(`button`,{className:`shell-quiet agent-card-meta`,"aria-expanded":v,onClick:()=>y(e=>!e),children:v?`Newest only`:`${w.length-1} earlier`})]}),(0,W.jsx)(`ul`,{className:`agent-questions`,children:E.map(t=>(0,W.jsxs)(`li`,{className:`agent-question `+t.state,children:[(0,W.jsx)(`p`,{"data-user-text":``,children:t.name}),(0,W.jsx)(`button`,{className:`shell-link`,onClick:()=>e.act({kind:`open`,target:t.target}),children:m(t.target)}),(()=>{let e=n.find(e=>e.responses?.some(e=>`question:`+e.annotationId===t.id)),r=t.state===`prepared`&&!e?`Question retained · context not confirmed`:Q[t.state]??t.state,a=e?.contextId??(i?void 0:null);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`agent-question-state`,children:r}),t.state!==`responded`&&a!==null&&(0,W.jsx)(yt,{contextId:a,prepare:()=>i(t.id.slice(9))})]})})()]},t.id))})]}),(0,W.jsxs)(`section`,{ref:u,className:`agent-card agent-record`,children:[(0,W.jsxs)(`button`,{className:`shell-quiet agent-record-toggle`,"aria-expanded":o,onClick:s,children:[`Recorded calls`,(0,W.jsx)(`span`,{className:`agent-card-meta`,children:p.evidence.length})]}),o&&(0,W.jsx)(Tt,{live:e,principalId:a,notes:!1})]})]})}function xt(e){let t=e.screen,n=[];e.problem&&n.push({key:`problem`,kind:`problem`,text:e.problem});for(let e of t?.escalations??[])n.push({key:`e:`+e.object,kind:`escalation`,object:e.object,text:e.reason});for(let e of t?.suggestions??[])n.push({key:`s:`+e.id,kind:`suggestion`,suggestion:e.id,text:`The Agent arranged a new layout`+(e.merged?` · ${e.merged+1} changes combined`:``)});return n}function St({live:e,items:t,onHide:n}){let[r,i]=(0,O.useState)(0),a=mt(e),o=t[Math.min(r,t.length-1)];return o?(0,W.jsxs)(`div`,{className:`shell-interruption `+o.kind,"data-rho-layer":`transient`,"data-rho-interruption":``,role:o.kind===`problem`?`alert`:`status`,children:[o.object&&(0,W.jsx)(`button`,{className:`shell-link`,onClick:()=>e.act({kind:`open`,target:o.object}),children:a(o.object)}),(0,W.jsx)(`span`,{className:`shell-interruption-text`,children:o.text}),o.suggestion&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{onClick:()=>e.act({kind:`accept`,suggestion:o.suggestion}),children:`Open update`}),(0,W.jsx)(`button`,{onClick:()=>e.act({kind:`dismiss`,suggestion:o.suggestion}),children:`Dismiss`})]}),t.length>1&&(0,W.jsxs)(`button`,{className:`shell-quiet`,onClick:()=>i(e=>(e+1)%t.length),children:[`Next of `,t.length]}),!o.suggestion&&(0,W.jsx)(`button`,{className:`shell-quiet`,"aria-label":`Hide until it changes`,onClick:()=>n(o.key+`:`+o.text),children:`Hide`})]}):null}function Ct(e){switch(e.kind){case`source`:return e.from===null?`edited, now version ${e.to}`:`version ${e.from} → ${e.to}`;case`run`:return[ht[e.state]??e.state,e.verified?`${e.verified} file${e.verified===1?``:`s`} verified`:``,e.firstLine??``,e.earlier.length?`${e.earlier.length} earlier run${e.earlier.length===1?``:`s`}`:``].filter(Boolean).join(` · `);case`artifact`:return e.versions===1?`1 new version`:`${e.versions} new versions`;case`question`:return G[e.state]??e.state;case`suggestion`:return`The Agent arranged a new layout`;case`items`:return`the Agent's notes changed · ${e.count} now`}}function wt({live:e}){let t=e.screen,n=mt(e),[r,i]=(0,O.useState)(!1);if(!t?.digest)return null;let a=t.digest.lines.filter(e=>e.kind!==`suggestion`||!t.suggestions.length),o=r?a:a.slice(0,a.length>6?5:6);return a.length?(0,W.jsxs)(`section`,{className:`shell-digest`,"data-rho-layer":`transient`,"data-rho-digest":``,"aria-label":`Changes while away`,...r?{"data-scroll-region":``,tabIndex:0}:{},children:[(0,W.jsxs)(`header`,{children:[(0,W.jsx)(`strong`,{children:`While you were away`}),(0,W.jsx)(`button`,{className:`shell-quiet`,onClick:()=>e.act({kind:`dismiss-digest`}),children:`Dismiss`})]}),(0,W.jsx)(`ul`,{children:o.map((t,r)=>(0,W.jsxs)(`li`,{children:[`object`in t?(0,W.jsx)(`button`,{className:`shell-link`,onClick:()=>e.act({kind:`open`,target:t.object}),children:n(t.object)}):null,(0,W.jsx)(`span`,{children:Ct(t)})]},r))}),o.length<a.length&&(0,W.jsxs)(`button`,{className:`shell-quiet`,onClick:()=>i(!0),children:[a.length-o.length,` more`]})]}):null}function Tt({live:e,principalId:t,notes:n=!0}){let r=e.state,i=mt(e);if(!r)return null;let a=e=>{if(t&&e===t)return`You`;let n=r.trace.principals[e],i=n?.kind??(e.startsWith(`agent:`)?`agent`:e.startsWith(`browser:`)?`browser`:void 0);return i===`agent`?n?.name??`The Agent`:i===`browser`?`Another browser tab`:e===`operator`?`Rho`:n?.name??`Unrecorded principal`},o=new Date().toISOString(),s=r.evidence.map((e,t)=>({f:e,i:t})).sort((e,t)=>(t.f.at??``).localeCompare(e.f.at??``)||t.i-e.i);return(0,W.jsxs)(`section`,{className:`shell-evidence`,"data-rho-layer":`transient`,"data-rho-evidence":``,"data-scroll-region":``,tabIndex:0,"aria-label":`Recorded activity`,children:[n&&e.screen&&e.screen.items.length>0&&(0,W.jsxs)(`section`,{"aria-label":`The Agent's notes`,className:`shell-notes`,children:[(0,W.jsxs)(`h3`,{children:[`The Agent's notes`,e.screen.question?` · `+e.screen.question:``]}),(0,W.jsx)(`ul`,{children:e.screen.items.map(t=>(0,W.jsxs)(`li`,{"data-fact":`agent`,children:[(0,W.jsx)(`strong`,{children:t.title}),(0,W.jsxs)(`span`,{children:[` · `,t.kind,` · `,t.state]}),t.artifact&&(0,W.jsx)(`button`,{className:`shell-link`,onClick:()=>e.act({kind:`open`,target:t.artifact.object,run:t.artifact.run,version:t.artifact.version}),children:i(t.artifact.object)}),t.summary&&(0,W.jsx)(`p`,{children:t.summary}),t.lines?.map((e,t)=>(0,W.jsxs)(`p`,{children:[e.label?e.label+`: `:``,e.text,e.judgment?` · the Agent's reading`:``]},t))]},t.id))})]}),r.gap&&(0,W.jsx)(`p`,{role:`status`,children:`Earlier activity is outside the retained window. No missing calls were reconstructed.`}),(0,W.jsx)(`ol`,{children:(()=>{let e=``;return s.map(({f:t,i:n})=>{let r=t.at&&!J(t.at,o)?gt(t.at):``,s=r===e?``:e=r;return(0,W.jsxs)(O.Fragment,{children:[s&&(0,W.jsx)(`li`,{className:`shell-evidence-day`,children:s}),(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`time`,{children:t.at?new Date(t.at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}):`Time not recorded`}),(0,W.jsx)(`strong`,{children:a(t.actor)}),(0,W.jsxs)(`span`,{className:`shell-evidence-what`,children:[(0,W.jsx)(`code`,{children:t.op}),` `,t.object?i(t.object):`Object not recorded`,t.outcome===`rejected`?` · refused (${t.reason?.kind??`reason not recorded`})`:``]})]})]},n)})})()}),(0,W.jsxs)(`p`,{children:[`The latest `,r.evidence.length,` facts are kept (limit `,R.maxEvidence,`). Calls an adapter refused on its own are not recorded here.`]})]})}var Et=e=>Array.isArray(e?.type)?void 0:e?.type,Dt=e=>!!e&&(Et(e)===`string`||!!e.oneOf?.some(Dt)||!!e.anyOf?.some(Dt)),Ot=e=>!!e&&(Et(e)===`null`||Array.isArray(e.type)&&e.type.includes(`null`)||!!e.oneOf?.some(Ot)||!!e.anyOf?.some(Ot)),kt=e=>typeof e==`string`?/^[a-f0-9]{64}$/.test(e):!!e&&typeof e==`object`&&Object.values(e).some(kt);function At(e,t){if(!e||typeof e!=`object`||Array.isArray(e))return null;let n=e;if(typeof n.path==`string`)return n.kind===`disk`?`${n.path} · the saved file the Agent proposed`:n.path;if(typeof n.documentId==`string`){let e=t.documents.find(e=>e.id===n.documentId);return e?`${e.path} · version ${n.version}`:`A document that is not open in this project`}let r=n.resource??n;if(typeof r.id==`string`){let e=t.resources.find(e=>e.id===r.id&&e.version===r.version);return e?`${e.path} · the version the Agent proposed`:`A file version that is not registered here`}return null}function jt(e,t){if(!e)return`json`;if(kt(t)&&(!Array.isArray(t)||t.every(e=>typeof e==`string`||kt(e))))return`reference`;if(e.enum?.every(e=>typeof e==`string`))return`choice`;let n=Et(e);return n===`string`&&(t===void 0||typeof t==`string`)?`text`:!n&&Dt(e)&&Ot(e)&&(t===null||typeof t==`string`)?`optional-text`:(n===`number`||n===`integer`)&&(t===void 0||typeof t==`number`)?`number`:n===`boolean`&&(t===void 0||typeof t==`boolean`)?`boolean`:n===`array`&&Array.isArray(t)&&t.every(e=>typeof e==`string`)&&Dt(e.items)?`lines`:n===`object`&&e.properties&&!e.oneOf&&!e.anyOf&&typeof t==`object`&&t&&!Array.isArray(t)?`object`:`json`}function Mt({view:e,snapshot:t,client:n,live:r}){let i=e.props,a=t.catalog.actions.find(e=>e.id===i.action&&e.version===i.actionVersion),o=a?.inputSchema??{},[s,c]=(0,O.useState)(()=>structuredClone(i.input??{})),[l,u]=(0,O.useState)({}),[d,f]=(0,O.useState)(null),[p,m]=(0,O.useState)(!1),[h,g]=(0,O.useState)(!1),[_,v]=(0,O.useState)(``),[y,b]=(0,O.useState)(!1),x=e=>t.catalog.operations.some(t=>t.method===e&&t.state===`available`&&t.authorized),S=r.runs?.find(e=>e.operationId===i.operationId),C=(0,O.useMemo)(()=>({projectId:t.project.id,operationId:i.operationId,action:i.action,actionVersion:i.actionVersion,input:s,...i.repairOf?{repairOf:i.repairOf}:{}}),[t.project.id,i.operationId,i.action,i.actionVersion,i.repairOf,s]);(0,O.useEffect)(()=>{if(S||!x(`protocol.validate`))return;let e=!0;m(!0);let t=setTimeout(()=>{n.call(`protocol.validate`,{method:`action.submit`,body:C},AbortSignal.timeout(15e3)).then(t=>{e&&f(t.problems.map(e=>({path:e.path,message:e.message,fix:e.fix})))},()=>{e&&f(null)}).finally(()=>{e&&m(!1)})},250);return()=>{e=!1,clearTimeout(t)}},[C,S,n]);let ee=Object.keys(l).length>0||p||!!d?.length;async function w(){g(!0),v(``),b(!1);try{await n.call(`action.submit`,C,AbortSignal.timeout(6e4))}catch(e){let t=e?.error;t?.kind?v(t.message??`The owner did not accept this run.`):b(!0)}finally{g(!1),r.readRuns()}}let te=e=>(d??[]).filter(t=>t.path===e||t.path.startsWith(e+`/`)||t.path.startsWith(e+`.`)),ne=e=>`/input/`+e;return a?(0,W.jsxs)(`section`,{className:`shell-action`,"data-owner-body":``,"data-rho-action-form":i.operationId,"aria-label":i.title??i.action,children:[(0,W.jsx)(`h2`,{children:i.title??a.presentation?.displayName??i.action}),(0,W.jsxs)(`p`,{className:`shell-action-identity`,children:[(0,W.jsx)(`code`,{children:i.operationId}),` · `,a.presentation?.displayName??i.action,` `,i.actionVersion,i.repairOf?(0,W.jsxs)(W.Fragment,{children:[` · repairs `,(0,W.jsx)(`code`,{children:i.repairOf})]}):null]}),S?(0,W.jsxs)(`p`,{role:`status`,"data-rho-submitted":i.operationId,children:[`Submitted · `,(0,W.jsx)(`span`,{className:`shell-state `+S.execution,children:we(S.execution)}),` `,(0,W.jsx)(`button`,{className:`shell-link`,onClick:()=>{let e=Ee(r,S.operationId);e&&r.act({kind:`open`,target:e})},children:`Open run`})]}):(0,W.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),!ee&&!h&&w()},children:[Object.entries(o.properties??{}).filter(([e])=>e in s||o.required?.includes(e)).map(([e,n])=>(0,W.jsx)(Nt,{name:e,path:ne(e),schema:n,value:s[e],snapshot:t,problems:te(ne(e)),onValue:t=>c(n=>({...n,[e]:t})),onUnparsed:(e,t)=>u(n=>{let r={...n};return t===null?delete r[e]:r[e]=t,r})},e)),d&&te(`/input`).filter(e=>!Object.keys(o.properties??{}).some(t=>e.path.startsWith(ne(t)))).map((e,t)=>(0,W.jsxs)(`p`,{role:`alert`,className:`shell-field-problem`,children:[e.message,e.fix?` · `+e.fix:``]},t)),_&&(0,W.jsx)(`p`,{role:`alert`,className:`shell-field-problem`,children:_}),y&&(0,W.jsxs)(`p`,{role:`status`,"data-rho-lost":i.operationId,children:[`The reply did not arrive, and the project's runs do not show `,i.operationId,` yet. Sending it again cannot start a second run.`]}),(0,W.jsxs)(`div`,{className:`shell-action-submit`,children:[(0,W.jsx)(`button`,{type:`submit`,disabled:ee||h||!x(`action.submit`),children:h?`Submitting…`:y?`Send again`:`Run`}),p?(0,W.jsx)(`span`,{role:`status`,children:`Checking…`}):d?.length?(0,W.jsxs)(`span`,{role:`status`,children:[d.length,` to fix`]}):null]})]})]}):(0,W.jsxs)(`section`,{className:`shell-action`,"data-owner-body":``,"aria-label":i.title??i.action,children:[(0,W.jsx)(`h2`,{children:i.title??i.action}),(0,W.jsxs)(`p`,{role:`status`,children:[i.action,` `,i.actionVersion,` is not registered in this project.`]})]})}function Nt({name:e,path:t,schema:n,value:r,snapshot:i,problems:a,onValue:o,onUnparsed:s}){let c=(0,O.useId)(),l=jt(n,r),u=a.filter(e=>l!==`object`||e.path===t),[d,f]=(0,O.useState)(()=>JSON.stringify(r??null,null,2)),[p,m]=(0,O.useState)(``),h=u.length||p?c+`-problem`:void 0,g={id:c,"aria-invalid":!!h||void 0,"aria-describedby":h},_;if(l===`object`){let c=r;return(0,W.jsxs)(`fieldset`,{className:`shell-field-group`,children:[(0,W.jsx)(`legend`,{children:e}),Object.entries(n.properties??{}).filter(([e])=>e in c||n.required?.includes(e)).map(([e,n])=>(0,W.jsx)(Nt,{name:e,path:t+`/`+e,schema:n,value:c[e],snapshot:i,problems:a.filter(n=>n.path===t+`/`+e||n.path.startsWith(t+`/`+e+`/`)),onValue:t=>o({...c,[e]:t}),onUnparsed:s},e)),u.map((e,t)=>(0,W.jsxs)(`p`,{role:`alert`,className:`shell-field-problem`,children:[e.message,e.fix?` · `+e.fix:``]},t))]})}if(l===`reference`){let t=(Array.isArray(r)?r:[r]).map(e=>typeof e==`string`?kt(e)?`A pinned version`:e:At(e,i)??`A pinned reference`);return(0,W.jsxs)(`div`,{className:`shell-field`,children:[(0,W.jsx)(`span`,{className:`shell-field-name`,id:c,children:e}),(0,W.jsx)(`ul`,{className:`shell-field-references`,"aria-labelledby":c,"data-rho-reference":e,children:t.map((e,t)=>(0,W.jsx)(`li`,{children:e},t))}),u.length>0&&(0,W.jsx)(`p`,{role:`alert`,className:`shell-field-problem`,children:u.map(e=>e.message+(e.fix?` · `+e.fix:``)).join(` · `)})]})}return _=l===`choice`?(0,W.jsx)(`select`,{...g,value:String(r??``),onChange:e=>o(e.target.value),children:n.enum.map(e=>(0,W.jsx)(`option`,{value:e,children:e},e))}):l===`text`?(0,W.jsx)(`input`,{...g,value:String(r??``),onChange:e=>o(e.target.value)}):l===`optional-text`?(0,W.jsx)(`input`,{...g,value:typeof r==`string`?r:``,onChange:e=>o(e.target.value===``?null:e.target.value)}):l===`number`?(0,W.jsx)(`input`,{...g,type:`number`,value:r===void 0?``:String(r),min:n.minimum,max:n.maximum,step:Et(n)===`integer`?1:`any`,onChange:e=>o(e.target.value===``?void 0:Number(e.target.value))}):l===`boolean`?(0,W.jsx)(`input`,{...g,type:`checkbox`,checked:r===!0,onChange:e=>o(e.target.checked)}):l===`lines`?(0,W.jsx)(`textarea`,{...g,rows:Math.min(8,Math.max(2,r.length+1)),value:r.join(`
3
+ `),onChange:e=>o(e.target.value===``?[]:e.target.value.split(`
4
+ `))}):(0,W.jsx)(`textarea`,{...g,className:`shell-field-json`,rows:Math.min(10,Math.max(2,d.split(`
5
+ `).length)),value:d,spellCheck:!1,onChange:e=>{f(e.target.value);try{o(JSON.parse(e.target.value)),m(``),s(t,null)}catch{m(`Not valid JSON yet`),s(t,e.target.value)}}}),(0,W.jsxs)(`div`,{className:`shell-field`+(l===`boolean`?` inline`:``),children:[(0,W.jsxs)(`label`,{htmlFor:c,children:[e,l===`lines`?` · one per line`:l===`json`?` · JSON`:``]}),_,h&&(0,W.jsx)(`p`,{id:c+`-problem`,role:`alert`,className:`shell-field-problem`,children:[p,...u.map(e=>e.message+(e.fix?` · `+e.fix:``))].filter(Boolean).join(` · `)})]})}function Pt({view:e,process:t,client:n,snapshot:i,children:a}){let o=t.every.find(t=>ye(t.path)===e.id);if(!o)return(0,W.jsx)(W.Fragment,{children:a});let s=o.path,c=t.files.find(e=>e.path===s),l=o.versions,u=c?.versions.length??0,d=c?.versions.at(-1),f=Object.values(e.bindings??{}).some(e=>e.kind===`live-document`),p=e=>t.setAt(e>=l.length?null:l[e].at),m=t.holds(s);return(0,W.jsxs)(`div`,{className:`process-frame`,children:[m&&(0,W.jsx)(ge,{className:`process-holds`,holds:m}),(0,W.jsx)(`div`,{className:`process-version`,"data-fact":`observed`,children:l.length?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{children:d?`Version ${u} of ${l.length} · kept ${D(d.at)}`:`Not kept yet`}),l.length>1&&(0,W.jsxs)(`span`,{className:`process-version-steps`,children:[(0,W.jsx)(`button`,{className:`icon-button`,"aria-label":`Earlier version of `+o.title,disabled:u<=1,onClick:()=>p(u-2),children:(0,W.jsx)(`span`,{className:`flip`,children:(0,W.jsx)(r,{name:`chevron`,size:13})})}),(0,W.jsx)(`button`,{className:`icon-button`,"aria-label":`Later version of `+o.title,disabled:t.at===null&&u>=l.length,onClick:()=>p(u),children:(0,W.jsx)(r,{name:`chevron`,size:13})})]})]}):(0,W.jsx)(`span`,{children:t.at===null?`No version of this file was kept; it shows as it is now.`:`No version of this file was kept.`})}),t.at!==null&&f?d?(0,W.jsx)(`div`,{className:`process-replay-file`,children:(0,W.jsx)(Ae,{client:n,projectId:i.project.id,resource:d.resource,path:s})}):l.length?(0,W.jsxs)(`p`,{className:`process-note`,children:[`The work had reached this file by `,D(t.at,!0),`; its first version was kept at `,D(l[0].at,!0),`.`,(0,W.jsxs)(`button`,{className:`text-button`,onClick:()=>p(0),children:[`Go to `,D(l[0].at,!0)]})]}):(0,W.jsxs)(`p`,{className:`process-note`,children:[`The work had reached this file by `,D(t.at,!0),`, but no version of it was kept, so it cannot be shown as it was then.`,(0,W.jsx)(`button`,{className:`text-button`,onClick:()=>t.setAt(null),children:`Show it now`})]}):a]})}var Ft=e=>{let t=e.getBoundingClientRect();return{x:t.left,y:t.bottom+4,above:t.top-4}};function It({at:e,label:t,anchor:n,onClose:r,className:i,role:a=`menu`,children:o}){let s=(0,O.useRef)(null);(0,O.useLayoutEffect)(()=>{let t=s.current,n=t.offsetWidth,r=innerHeight-e.y-8,i=(e.above??e.y)-8,a=r<Math.min(t.scrollHeight,320)&&i>r;t.style.left=Math.max(8,Math.min(e.x,innerWidth-n-8))+`px`,t.style.maxHeight=(a?i:r)+`px`,a?t.style.bottom=innerHeight-(e.above??e.y)+`px`:t.style.top=e.y+`px`,t.querySelector(`button:not(:disabled)`)?.focus({preventScroll:!0})},[]),(0,O.useEffect)(()=>{let e=e=>{let t=e.target;!s.current?.contains(t)&&!n?.contains(t)&&r(!1)},t=()=>r(!1);return document.addEventListener(`pointerdown`,e,!0),addEventListener(`resize`,t),addEventListener(`blur`,t),()=>{document.removeEventListener(`pointerdown`,e,!0),removeEventListener(`resize`,t),removeEventListener(`blur`,t)}},[n]);function c(e){let t=[...s.current.querySelectorAll(`button:not(:disabled)`)],n=t.indexOf(document.activeElement),i={ArrowDown:n+1,ArrowUp:n-1,Home:0,End:t.length-1}[e.key];e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),r(!0)):e.key===`Tab`?r(!1):i!==void 0&&t.length&&(e.preventDefault(),t[(i+t.length)%t.length].focus())}return(0,Me.createPortal)((0,W.jsx)(`div`,{ref:s,className:`floating-menu`+(i?` `+i:``),role:a,"aria-label":t,onKeyDown:c,onClick:e=>{e.target.closest(`button`)&&r(!1)},children:o}),document.body)}function Lt({items:e}){return(0,W.jsx)(W.Fragment,{children:e.map(e=>(0,W.jsxs)(`button`,{role:`menuitem`,onClick:e.run,children:[(0,W.jsx)(r,{name:e.icon,size:15}),(0,W.jsx)(`span`,{children:e.label}),e.keys&&(0,W.jsx)(`kbd`,{children:e.keys})]},e.id))})}var Rt=`application/x-rho-view`,zt=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Bt=e=>e&&`group`in e?e.group:null;function Vt(e){let t=e.currentTarget.getBoundingClientRect(),n=(e.clientX-t.left)/t.width,r=(e.clientY-t.top)/t.height,[i,a]=[[`left`,n],[`right`,1-n],[`top`,r],[`bottom`,1-r]].sort((e,t)=>e[1]-t[1])[0];return a<.25?i:`center`}var Ht=new WeakMap;function Ut(e,t){let n=document.activeElement,r=n instanceof HTMLElement&&e.contains(n)?n:Ht.get(e);Ht.delete(e),e.parentElement!==t&&t.appendChild(e),r&&e.contains(r)&&document.activeElement!==r&&r.focus({preventScroll:!0})}function Wt(e,t){if(e.parentElement!==t)return;let n=document.activeElement;n instanceof HTMLElement&&e.contains(n)&&Ht.set(e,n),t.removeChild(e)}function Gt({container:e,id:t,labelledBy:n}){let r=(0,O.useRef)(null);return(0,O.useLayoutEffect)(()=>{let t=r.current;return Ut(e,t),()=>Wt(e,t)},[e]),(0,W.jsx)(`div`,{ref:r,id:t,className:`shell-panel`,role:`tabpanel`,"aria-labelledby":n})}function Kt(e,t,n=!0){(0,O.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let n=()=>{let e=t.scrollLeft>1,n=t.scrollLeft+t.clientWidth<t.scrollWidth-1;e||n?t.dataset.overflow=e&&n?`both`:e?`start`:`end`:delete t.dataset.overflow};n();let r=new ResizeObserver(n),i=new MutationObserver(n);return r.observe(t),i.observe(t,{childList:!0,subtree:!0,characterData:!0}),t.addEventListener(`scroll`,n,{passive:!0}),()=>{r.disconnect(),i.disconnect(),t.removeEventListener(`scroll`,n)}},[e,n]),(0,O.useEffect)(()=>{e.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`,inline:`nearest`})},[e,t])}function qt({group:e,name:t,selected:n,onSelect:i,onHeader:a,render:o,drag:s,tools:c}){let l=(0,O.useRef)(null),[u,d]=(0,O.useState)(null);Kt(l,n);let f=`shell-`+e.id.replace(/[^A-Za-z0-9_-]/g,`_`),p=Math.max(0,e.views.indexOf(n)),m=()=>[...l.current?.querySelectorAll(`[role=tab]`)??[]];function h(t){let n=e.views.length,r={ArrowRight:(p+1)%n,ArrowLeft:(p-1+n)%n,Home:0,End:n-1}[t.key];r!==void 0&&(t.preventDefault(),i(e.views[r]),m()[r]?.focus())}function g(e,t){e.key===`Delete`&&c?.close?(e.preventDefault(),c.close(t)):(e.key===`ContextMenu`||e.key===`F10`&&e.shiftKey)&&c?.menu&&(e.preventDefault(),d({id:t,at:Ft(e.currentTarget),from:e.currentTarget}))}function _(e,t){c?.menu&&(e.preventDefault(),d({id:t,at:{x:e.clientX,y:e.clientY},from:e.currentTarget}))}let v=e=>{let t=u?.from;d(null),e&&t?.isConnected&&t.focus()},y=s?.dragging?.kind===`group`&&s.dragging.id===e.id;function b(t){if(!s?.dragging||y)return;t.preventDefault(),t.dataTransfer.dropEffect=`move`;let n=[...l.current?.querySelectorAll(`.shell-tab`)??[]].findIndex(e=>{let n=e.getBoundingClientRect();return t.clientX<n.left+n.width/2}),r={group:e.id,zone:`tab`,before:n<0?null:e.views[n]};zt(s.target,r)||s.over(r)}function x(t){if(!s?.dragging||y)return;t.preventDefault(),t.dataTransfer.dropEffect=`move`;let n={group:e.id,zone:Vt(t)};zt(s.target,n)||s.over(n)}let S=t=>{s?.dragging&&s.target&&Bt(s.target)===e.id&&(t.preventDefault(),s.drop(s.target))},C=s?.target&&`group`in s.target&&s.target.group===e.id?s.target:null,ee=s?.dragging?.kind===`view`?s.dragging.id:null,w=!!s&&!!c?.movable;return(0,W.jsxs)(`section`,{className:`shell-group`,"data-group":e.id,"data-dragging":y?``:void 0,"data-maximized":c?.maximized?``:void 0,children:[(0,W.jsxs)(`div`,{className:`shell-tabbar`,children:[(0,W.jsxs)(`div`,{className:`shell-tabstrip`,style:{"--tabs":e.views.length},onDragOver:b,onDrop:S,"data-drop":C?.zone===`tab`&&C.before===null?`end`:void 0,children:[(0,W.jsx)(`div`,{ref:l,className:`shell-tabs`,role:`tablist`,"aria-label":t,onKeyDown:h,children:e.views.map((e,t)=>(0,W.jsxs)(`div`,{className:`shell-tab`,"data-dragging":ee===e?``:void 0,"data-drop":C?.zone===`tab`&&C.before===e?`before`:void 0,"data-closable":c?.close?``:void 0,children:[(0,W.jsx)(`button`,{id:f+`-tab-`+t,role:`tab`,"aria-selected":e===n,"aria-controls":f+`-panel`,tabIndex:e===n?0:-1,title:o.label(e),onClick:()=>i(e),onKeyDown:t=>g(t,e),onContextMenu:t=>_(t,e),"aria-keyshortcuts":c?.close?`Delete`:void 0,onMouseDown:e=>{e.button===1&&c?.close&&e.preventDefault()},onAuxClick:t=>{t.button===1&&c?.close&&(t.preventDefault(),c.close(e))},draggable:!!s,onDragStart:t=>{s&&(t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(Rt,e),s.start({kind:`view`,id:e}))},onDragEnd:()=>s?.end(),children:o.title(e)}),c?.close&&e===n&&(0,W.jsx)(`button`,{className:`shell-tab-close`,tabIndex:-1,"aria-hidden":`true`,title:`Close `+o.label(e),draggable:!1,onClick:()=>c.close(e),children:(0,W.jsx)(r,{name:`close`,size:12,stroke:2})})]},e))}),c?.add&&(0,W.jsx)(Jt,{name:t,content:c.add}),(0,W.jsx)(`div`,{className:`shell-tabs-fill`,"aria-hidden":`true`,"data-movable":w?``:void 0,title:w?`Drag to move these views together. Double-click to maximize.`:c?.maximized?`Double-click to show every group`:void 0,draggable:w,onDoubleClick:()=>(w||c?.maximized)&&c?.onMaximize?.(),onDragStart:t=>{w&&(t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(Rt,e.id),l.current&&t.dataTransfer.setDragImage(l.current,16,16),s.start({kind:`group`,id:e.id}))},onDragEnd:()=>s?.end()})]}),(0,W.jsx)(`div`,{className:`shell-header-slot`,ref:a}),c?.maximized&&(0,W.jsxs)(`button`,{className:`shell-restore`,title:`Show every group again`,onClick:c.onMaximize,children:[(0,W.jsx)(r,{name:`restore`,size:14}),`Restore`]})]}),(0,W.jsxs)(`div`,{className:`shell-body`,children:[(0,W.jsx)(Gt,{container:o.container(n),id:f+`-panel`,labelledBy:f+`-tab-`+p},n),s?.dragging&&!y&&(0,W.jsx)(`div`,{className:`shell-drop`,"data-zone":C&&C.zone!==`tab`?C.zone:void 0,onDragOver:x,onDrop:S,"aria-hidden":`true`,onDragLeave:e=>{C&&!e.currentTarget.contains(e.relatedTarget)&&s.over(null)},children:(0,W.jsx)(`div`,{className:`shell-drop-preview`})})]}),u&&c?.menu&&(0,W.jsx)(It,{at:u.at,anchor:u.from,label:o.label(u.id),onClose:v,children:(0,W.jsx)(Lt,{items:c.menu(u.id)})})]})}function Jt({name:e,content:t}){let n=(0,O.useRef)(null),[i,a]=(0,O.useState)(null);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{ref:n,className:`shell-tab-add`,"aria-label":`Add a view to `+e,title:`Add a view here`,"aria-haspopup":`dialog`,"aria-expanded":!!i,onClick:e=>a(i?null:Ft(e.currentTarget)),children:(0,W.jsx)(r,{name:`plus`,size:15,stroke:1.8})}),i&&(0,W.jsx)(It,{at:i,anchor:n.current,label:`Add a view to `+e,role:`dialog`,className:`add-into`,onClose:e=>{a(null),e&&n.current?.focus()},children:t()})]})}function Yt({region:e,weights:t,onResize:n,label:r,children:i}){let a=(0,O.useRef)(null),o=e.axis===`horizontal`,s=t.reduce((e,t)=>e+t,0),c=o?{less:`ArrowLeft`,more:`ArrowRight`}:{less:`ArrowUp`,more:`ArrowDown`};function l(e,r){let i=r.key===c.less?-.05:r.key===c.more?.05:r.key===`Home`?-1:+(r.key===`End`);i&&(r.preventDefault(),n(y(t,e,i)))}function u(e,r){let i=a.current;if(!i)return;r.currentTarget.setPointerCapture(r.pointerId);let s=o?i.clientWidth:i.clientHeight,c=o?r.clientX:r.clientY,l=t,u=t=>n(y(l,e,((o?t.clientX:t.clientY)-c)/s)),d=r.currentTarget,f=()=>{d.removeEventListener(`pointermove`,u),d.removeEventListener(`pointerup`,f),d.removeEventListener(`pointercancel`,f)};d.addEventListener(`pointermove`,u),d.addEventListener(`pointerup`,f),d.addEventListener(`pointercancel`,f)}let d=[];return i.forEach((e,n)=>{if(n){let e=t.slice(0,n).reduce((e,t)=>e+t,0);d.push((0,W.jsx)(`div`,{className:`shell-divider`,role:`separator`,tabIndex:0,"aria-orientation":o?`vertical`:`horizontal`,"aria-label":r(n),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e/s*100),onKeyDown:e=>l(n-1,e),onPointerDown:e=>u(n-1,e)},`divider-`+n))}d.push((0,W.jsx)(`div`,{className:`shell-pane`,style:{flex:`${t[n]} 1 0`},children:e},`pane-`+n))}),(0,W.jsx)(`div`,{ref:a,className:`shell-split`,"data-axis":e.axis,"data-split":e.id,children:d})}var Xt={minSplitPx:640};function Zt({composition:e,snapshot:t,client:n,onAbout:y,contextTarget:C,principalId:D,onShowContext:ge,feedbackContextActive:ye,openView:Se,onCommands:we,agentTarget:Ee,onShowAgent:De,presence:Ae,onPersonMoved:k,onConversation:Ne,onExplore:Pe,onObject:Fe,empty:Ie,prepared:Le,onPrepare:Re,bar:ze=!0,barTarget:Be,attention:Ve=!0,following:He=!1,arrange:Ue=!0,addView:A}){let j=ve(),M=pt(t,e,n,D,!!j),N=M.layout;async function We(e){let r=t.annotations.find(t=>t.annotationId===e)?.version??1;return(await n.call(`context.create`,{projectId:t.project.id,changeId:r===1?e:e+`@`+r,expectedVersion:0,annotations:[{annotationId:e,version:r}]},AbortSignal.timeout(3e4))).contextId}let P=(0,O.useMemo)(()=>a(N),[N]),F=(0,O.useMemo)(()=>i(P),[P]),I=(0,O.useMemo)(()=>new Map(N.views.map(e=>[e.id,e])),[N]),[Ge,Ke]=(0,O.useState)(()=>matchMedia(`(max-width: 767px)`).matches);(0,O.useEffect)(()=>{let e=matchMedia(`(max-width: 767px)`),t=()=>Ke(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let qe=(0,O.useRef)(null),[Je,Ye]=(0,O.useState)(!1);(0,O.useLayoutEffect)(()=>{let e=qe.current;if(!e)return;let t=new ResizeObserver(([e])=>{e.contentRect.width&&Ye(e.contentRect.width<Xt.minSplitPx)});return t.observe(e),()=>t.disconnect()},[]);let[Xe,Ze]=(0,O.useState)({}),[Qe,$e]=(0,O.useState)(F[0]??``),et=e=>e.views.includes(Qe)?Qe:e.views.includes(Xe[e.id])?Xe[e.id]:e.views[0],tt=e=>{let t=d(P,e);t&&Ze(n=>({...n,[t.id]:e})),$e(e)},L=e=>{M.hold(e),tt(e)},nt=e=>{let t=N.views.find(t=>Object.values(t.bindings??{}).some(t=>`id`in t&&t.id===e.id&&t.version===e.version));t?L(t.id):M.openResource(e)},[rt,it]=(0,O.useState)(!1),[at,R]=(0,O.useState)([]),ot=xt(M),st=ot.filter(e=>!at.includes(e.key+`:`+e.text));(0,O.useEffect)(()=>{if(j||!M.active||!I.has(M.active))return;let e=document.activeElement?.closest(`[data-owner-view]`)?.dataset.ownerView;M.movedBy===`owners`&&e&&e!==M.active&&I.has(e)&&(V||d(P,e)?.id===d(P,M.active)?.id)?M.hold(e):tt(M.active)},[M.active,P]);let ct=(0,O.useRef)(``);(0,O.useEffect)(()=>{Se&&ct.current!==Se&&I.has(Se)&&(ct.current=Se,He?tt(Se):L(Se))},[Se,I]);let z=F.includes(Qe)?Qe:F[0]??``,B=P?g(P):[],V=Ge||Je&&B.length>1,[lt,H]=(0,O.useState)(null),U=!V&&B.length>1?B.find(e=>e.id===lt)??null:null;(0,O.useEffect)(()=>{U&&z&&!U.views.includes(z)&&H(null)},[z]);let ut=V?z?[z]:[]:U?[et(U)]:B.map(et),[dt,ft]=(0,O.useState)({version:N.version,values:{}}),mt=dt.version===N.version?dt.values:{},[ht,G]=(0,O.useState)(``),K=e=>(Ue||!e.startsWith(`composition.`))&&t.catalog.operations.some(t=>t.method===e&&t.state===`available`&&t.authorized),q=e.rootId&&e.nodes?.length?{rootId:e.rootId,nodes:e.nodes}:null,gt=(0,O.useRef)(null),J=(0,O.useRef)(e);J.current=gt.current&&gt.current.compositionId===e.compositionId&&gt.current.version>e.version?{...e,...gt.current}:e;let Y=()=>J.current.rootId&&J.current.nodes?.length?{rootId:J.current.rootId,nodes:J.current.nodes}:null,_t=e=>{gt.current={compositionId:e.compositionId,version:e.version,rootId:e.rootId,nodes:e.nodes},J.current={...J.current,...gt.current}},X=e=>`${e}-${crypto.randomUUID().slice(0,8)}`,Z=e=>G(e instanceof Error?e.message:`The layout change was not accepted.`);async function Q(e){if(!e)return!1;G(``);try{return _t(await n.call(`composition.apply`,{projectId:t.project.id,compositionId:J.current.compositionId,expectedVersion:J.current.version,changeId:`layout-`+crypto.randomUUID(),operations:[{op:`replace`,rootId:e.rootId,nodes:e.nodes}]},AbortSignal.timeout(3e4))),!0}catch(e){return Z(e),!1}}async function yt(){G(``);try{_t(await n.call(`composition.undo`,{projectId:t.project.id,compositionId:J.current.compositionId,expectedVersion:J.current.version,changeId:`layout-undo-`+crypto.randomUUID()},AbortSignal.timeout(3e4)))}catch(e){Z(e)}}async function Ct(e,r){let i=Y()?.nodes.find(t=>t.kind===`group`&&t.children?.includes(e));if(!i)return;G(``);let a=X(`view`);try{await n.call(`composition.apply`,{projectId:t.project.id,compositionId:J.current.compositionId,expectedVersion:J.current.version,changeId:`layout-beside-`+crypto.randomUUID(),operations:[{op:`insert`,parentId:i.id,index:i.children.indexOf(e)+1,node:{id:a,kind:`view`,...r}}]},AbortSignal.timeout(3e4)).then(e=>_t(e)),L(a)}catch(e){Z(e)}}let[Tt,Et]=(0,O.useState)(null),[Dt,Ot]=(0,O.useState)(!1),kt=Re?Le??null:Tt,At=Re??Et,jt=ae(t)&&(j?!!Pe:!!q);async function Nt(e,r,i,a){if(j)Pe?.(r,i);else{G(``),Ot(!0);try{let o=N.views.find(e=>e.component===ue)?.id;if(!o){let t=I.get(e),n=Y(),r=`notebook`,i=t&&n&&l(n,t,X),a=i&&p(i,pe(r),e,`right`,X);if(!K(`composition.apply`)||!a){G(`The Notebook could not be placed beside this view.`);return}if(!await Q(a))return;o=r}a?At(ne(r,i,a.dirty)):await te(n,t.project.id,r,i),k?.(),L(o)}catch(e){Z(e)}finally{Ot(!1)}}}let[Ft,It]=(0,O.useState)(null);(0,O.useEffect)(()=>{Ft&&I.has(Ft)&&(It(null),L(Ft))},[Ft,I]);function Lt(e,r){j?Fe?.(e,r):(G(``),ce(n,t.project.id,N.compositionId,e,r,qe.current?.clientWidth).then(e=>{k?.(),It(e)},Z))}function Rt(e,r){le(e,r);let i=N.views.find(e=>e.component===oe.servers)?.id;i?L(i):(G(``),fe(n,t.project.id,N.compositionId,`servers`).then(e=>{k?.(),It(e)},Z))}let zt=(0,O.useRef)(Promise.resolve()),Bt=(0,O.useRef)(async()=>{});Bt.current=async({viewId:e,language:r,code:i,purpose:a})=>{G(``);let o=N.views.find(e=>e.component===ue)?.id;if(o){let t=d(P,o);t&&t.id!==d(P,e)?.id&&Ze(e=>({...e,[t.id]:o}))}else{let t=I.get(e),n=Y(),r=t&&n&&l(n,t,X),i=r&&p(r,pe(`notebook`,`console`),e,`bottom`,X);K(`composition.apply`)&&i&&await Q(i)}let s=zt.current.then(()=>n.call(`kernel.run`,{projectId:t.project.id,language:r,code:i,purpose:a,changeId:`script-`+crypto.randomUUID()}));zt.current=s.catch(()=>{}),await s.catch(Z)};function Vt(e,t){let n=Y(),r=n&&o(n,e,t);r&&K(`composition.apply`)&&Q(r)}let Ht=(0,O.useContext)(se),Zt=!j&&!!q&&ae(t),Qt=(0,O.useMemo)(()=>Zt?{...Ht,runCode:e=>Bt.current(e)}:Ht,[Ht,Zt]);function $t(e,r,i){At({key:crypto.randomUUID(),language:e,code:r,note:`From the ${i} view. Build on it, then press Run.`});let a=N.views.find(e=>e.component===ue)?.id;a?L(a):j||me(n,t.project.id,N.compositionId,null).then(e=>L(e),Z)}let en=j?t.conversations?.find(e=>e.conversationId===j.conversationId)?.principal??null:null,tn=j?j.whole.turns.filter(e=>e.conversationId===j.conversationId).map(e=>e.start):[],nn={openValue:Lt,openRemote:Rt,toNotebook:(e,t,n)=>$t(e,t,n),prepared:kt,taken:()=>At(null),setProps:Vt,has:e=>N.views.some(t=>t.component===e),scope:j?{principal:en,since:tn.length?Math.min(...tn):null,at:j.at}:void 0,openConversation:Ne},rn=(0,O.useRef)(void 0);function an(e,t){ft(n=>({version:N.version,values:{...n.version===N.version?n.values:{},[e]:t}})),clearTimeout(rn.current),q&&K(`composition.apply`)&&(rn.current=setTimeout(()=>{let n=Y();Q(n&&u(n,e,t))},600))}(0,O.useEffect)(()=>()=>clearTimeout(rn.current),[]);let[on,sn]=(0,O.useState)(null);function cn(e){let t=on?.item;sn(null);let n=Y();if(!t||!n)return;let r=null,i;if(t.kind===`group`){let a=B.find(e=>e.id===t.id),o=m(t.id);if(!a)return;i=et(a),r=`edge`in e?f(n,o,e.edge,X):v(n,o,m(e.group),e.zone===`tab`?`center`:e.zone,e.zone===`tab`?e.before:null,X)}else{let a=I.get(t.id);if(!a||`group`in e&&e.zone===`center`&&d(P,a.id)?.id===e.group)return;let o=l(n,a,X);i=a.id,r=o?`edge`in e?f(o,a.id,e.edge,X):e.zone===`tab`?x(o,a.id,m(e.group),e.before,X):e.zone===`center`?x(o,a.id,m(e.group),null,X):h(o,a.id,m(e.group),e.zone,X):null}r&&(k?.(),i&&L(i),Q(r))}let ln=!!q&&K(`composition.apply`),$=ln?{dragging:on?.item??null,target:on?.target??null,start:e=>{H(null),sn({item:e,target:null})},end:()=>sn(null),over:e=>sn(t=>t&&{...t,target:e}),drop:cn}:void 0,[un,dn]=(0,O.useState)(null);(0,O.useEffect)(()=>{un&&e.version>un.version&&dn(null)},[e.version]),(0,O.useEffect)(()=>{if(!un)return;let e=setTimeout(()=>dn(null),1e4);return()=>clearTimeout(e)},[un]);async function fn(e,t){let n=Y(),r=n;for(let t of e)M.release(t),r&&=_(r,t)??r;k?.(),r&&r!==n&&await Q(r)&&dn({label:t,version:J.current.version})}let pn=e=>{let t=I.get(e);t&&fn([e],E(t))};async function mn(){let e=un;dn(null),e&&J.current.version===e.version&&await yt()}function hn(e){let t=I.get(e),n=Y(),r=d(P,e);if(!t||!n||!r)return[];let i=l(n,t,X),a=[{id:`close`,label:`Close`,icon:`close`,keys:`Del`,run:()=>pn(e)}],o=r.views.filter(t=>t!==e);o.length&&a.push({id:`close-others`,label:o.length===1?`Close the other tab`:`Close the ${o.length} other tabs`,icon:`close`,run:()=>void fn(o,o.length===1?E(I.get(o[0])):`${o.length} views`)});let s=n=>{let r=Y(),i=r&&l(r,t,X),a=i&&c(i,e,n,X);a&&(k?.(),L(e),Q(a))};return i&&c(i,e,`horizontal`,X)&&a.push({id:`split-right`,label:`Split right`,icon:`layout`,run:()=>s(`horizontal`)},{id:`split-down`,label:`Split down`,icon:`layout`,run:()=>s(`vertical`)}),B.length>1&&a.push(U?{id:`restore`,label:`Show every group`,icon:`restore`,run:()=>H(null)}:{id:`maximize`,label:`Maximize this group`,icon:`fit`,run:()=>{L(e),H(r.id)}}),a}let gn=e=>ln?{close:pn,menu:hn,add:A?()=>A(m(e.id)):void 0,movable:!U&&B.length>1,maximized:U?.id===e.id,onMaximize:()=>H(t=>t===e.id?null:e.id)}:void 0,_n=ie.entries.find(e=>e.component===`rho.feedback`),vn=!!t.feedback&&_n?.requiredOperations.every(e=>t.catalog.operations.some(t=>t.method===e&&t.authorized&&t.state===`available`)),[yn,bn]=(0,O.useState)(null),[xn,Sn]=(0,O.useState)(!1);(0,O.useEffect)(()=>{bn(null),Sn(!1)},[t.project.id,N.compositionId,t.feedback?.taskId,D]);let Cn=(0,O.useRef)(new Set),wn=(0,O.useRef)(new Set),Tn=(0,O.useRef)([]);for(let e of wn.current)I.has(e)||wn.current.delete(e);let En=ut.filter(e=>e&&I.has(e));Tn.current=[...En,...Tn.current.filter(e=>I.has(e)&&!En.includes(e))];let Dn=C&&ye&&yn&&!xn?1:0;Cn.current=new Set;for(let e of[...Tn.current,...F])Cn.current.size<8-Dn&&!Cn.current.has(e)&&T(I.get(e),t)&&Cn.current.add(e);for(let e of ut)wn.current.add(e);let On=vn?e=>{Sn(Cn.current.size>=8),bn(e),ge()}:void 0,kn=(0,O.useRef)(new Map);for(let e of kn.current.keys())I.has(e)||kn.current.delete(e);let An=e=>{let t=kn.current.get(e);return t||(t=document.createElement(`div`),t.className=`shell-view`,t.dataset.ownerView=e,kn.current.set(e,t)),t},[jn,Mn]=(0,O.useState)({}),Nn=(0,O.useRef)(new Map),Pn=(0,O.useCallback)(e=>{let t=Nn.current.get(e);return t||(t=t=>Mn(n=>n[e]===t?n:{...n,[e]:t}),Nn.current.set(e,t)),t},[]),Fn=e=>V?jn.narrow??null:jn[d(P,e)?.id??``]??null,In=(0,O.useRef)(new Map);for(let e of In.current.keys())I.has(e)||In.current.delete(e);let Ln=e=>{let t=In.current.get(e);return t||(t=document.createElement(`div`),t.className=`shell-view-header`,t.dataset.ownerHeader=e,In.current.set(e,t)),t};(0,O.useLayoutEffect)(()=>{for(let[e,t]of In.current){let n=ut.includes(e)?Fn(e):null;n?Ut(t,n):t.parentElement&&Wt(t,t.parentElement)}});let Rn=e=>{let r=I.get(e),i=ut.includes(e);if(r.component===`rho.action`)return(0,W.jsx)(Mt,{view:r,snapshot:t,client:n,live:M});if(r.component===`rho.console`)return(0,W.jsx)(be,{client:n,snapshot:t});if(r.component===`rho.execution`){let i=String(r.props.operationId??e);return(0,W.jsx)(ke,{snapshot:t,client:n,operationId:i,runs:M.runs,readRuns:M.readRuns,firstLine:xe(M,i),opener:e=>()=>nt(e),onOpenRun:e=>Ce(M,e),chain:!0})}let a=Oe(r,t.resources),o=r.bindings?.document,c=o?.kind===`live-document`?t.documents.find(e=>e.id===o.documentId):void 0,l=re(c?.path),u=a?.kind===`table`&&w(S(a))?S(a):null,d=jt&&i&&(u||c&&l)?(0,Me.createPortal)(u?(0,W.jsx)(je,{languages:[`r`,`python`],busy:Dt,title:e=>`${j?`Open it on your workspace with the Notebook beside it, and load `:`Load `}${u.split(`/`).at(-1)} as it is on disk now into the ${ee[e]} session as a new value${j?``:`, with the Notebook beside it`}`,onExplore:t=>void Nt(e,u,t,null)}):(0,W.jsx)(je,{languages:[l],busy:Dt,title:e=>`${j?`Open it on your workspace with the Notebook beside it, and put `:`Put `}a line that runs ${c.path.split(`/`).at(-1)} into the ${ee[e]} Notebook's line, for you to check and run`,onExplore:t=>void Nt(e,c.path,t,{dirty:c.dirty})}),Ln(e),`explore-`+e):null,f=t.catalog.plugins.find(e=>e.id===`annotations`),p=a?.kind===`table`&&f?.projectEnabled&&f.dependenciesSatisfied&&f.state===`available`?ie.entries.find(e=>e.component===`rho.feedback`)?.TableQuestion:void 0,m=(0,W.jsx)(he,{active:i,params:{view:r,snapshot:t,client:n,principalId:D,compositionId:N.compositionId,compositionVersion:N.version,contextTarget:e===z&&!ye?C:null,headerTarget:i?Ln(e):null,renderAllowed:Cn.current.has(e),onAbout:y,onRequestFeedback:On,onOpenBeside:q&&K(`composition.apply`)&&q.nodes.some(t=>t.id===e)?t=>void Ct(e,t):void 0}});return j?(0,W.jsxs)(W.Fragment,{children:[d,(0,W.jsx)(Pt,{view:r,process:j,client:n,snapshot:t,children:m})]}):a?(0,W.jsxs)(W.Fragment,{children:[d,(0,W.jsx)(Te,{live:M,snapshot:t,resource:a,viewId:e,onOpenRef:nt,children:p&&(0,W.jsx)(p,{projectId:t.project.id,viewId:e,resource:a,snapshot:t,client:n,principalId:D,headerTarget:Ln(e),selectionScope:s(r),onOpenResource:nt,requestFeedback:On?()=>On(e):void 0},a.id+a.version+e)}),m]}):(0,W.jsxs)(W.Fragment,{children:[d,m]})},zn={label:e=>E(I.get(e)),container:An,title:e=>{let n=I.get(e);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(r,{name:de(n,t),size:14,stroke:2}),(0,W.jsx)(`span`,{className:`shell-tab-name`,children:E(n)}),Ae?.viewId===e&&(0,W.jsxs)(`span`,{className:`agent-presence`+(Ae.live?` live`:``),title:Ae.label,children:[(0,W.jsx)(`span`,{className:`pulse-dot`,"aria-hidden":`true`}),Ae.verb]})]})}},Bn=e=>B.length===1?`Views`:`Views ${B.findIndex(t=>t.id===e)+1} of ${B.length}`,Vn=e=>{let t=e.kind===`tabs`?et(e):i(e)[0];return t?E(I.get(t)):`view`},Hn=e=>e.kind===`tabs`?(0,W.jsx)(qt,{group:e,name:Bn(e.id),selected:et(e),onSelect:t=>{t!==et(e)&&k?.(),L(t)},onHeader:Pn(e.id),render:zn,drag:$,tools:gn(e)},e.id):(0,W.jsx)(Yt,{region:e,weights:mt[e.id]??e.weights,onResize:t=>an(e.id,t),label:t=>`Resize ${Vn(e.children[t-1])} and ${Vn(e.children[t])}`,children:e.children.map(Hn)},e.id);(0,O.useEffect)(()=>{if(!we)return;let n=[],r=I.get(z),i=r?E(r):``;if(q&&r&&K(`composition.apply`)&&(q.nodes.some(e=>e.id===z)||T(r,t))){let e=z,t=(e,t,a)=>{let o=l(q,r,X);o&&a(o)&&n.push({id:e,label:t,icon:`layout`,meta:i,run:()=>{let e=Y(),t=e&&l(e,r,X),n=t&&a(t);n&&Q(n)}})};t(`layout-split-right`,`Split right`,t=>c(t,e,`horizontal`,X)),t(`layout-split-down`,`Split down`,t=>c(t,e,`vertical`,X)),t(`layout-next`,`Move to the next group`,t=>b(t,e,1,X)),t(`layout-previous`,`Move to the previous group`,t=>b(t,e,-1,X)),n.push({id:`layout-close`,label:`Close view`,icon:`close`,meta:i,run:()=>pn(e)})}K(`composition.undo`)&&e.history?.length&&n.push({id:`layout-undo`,label:`Undo layout change`,icon:`refresh`,run:()=>void yt()}),we(n.length?{label:`Layout`,commands:n}:null)},[z,e,t.catalog,N.views]),(0,O.useEffect)(()=>()=>we?.(null),[]);let Un=(0,O.useId)(),Wn=(0,O.useRef)(null);Kt(Wn,z,V);function Gn(e){let t=F.indexOf(z),n=F.length,r={ArrowRight:(t+1)%n,ArrowLeft:(t-1+n)%n,Home:0,End:n-1}[e.key];r!==void 0&&(e.preventDefault(),L(F[r]),e.currentTarget.querySelectorAll(`[role=tab]`)[r]?.focus())}let Kn=M.screen?.views.find(e=>e.id===z)?.object??null,qn=()=>{it(e=>!e),De?.(),M.act({kind:`reveal`,target:rt?null:M.screen?.agent?.object??`workspace`})},Jn=ze&&(0,W.jsx)(vt,{live:M,evidence:rt,held:ot.length-st.length,onEvidence:qn,attention:Ve});return(0,W.jsx)(se.Provider,{value:Qt,children:(0,W.jsx)(_e.Provider,{value:nn,children:(0,W.jsxs)(`section`,{className:`workspace shell`,"aria-label":`Layout`,children:[Jn&&(Be?(0,Me.createPortal)(Jn,Be):Be===void 0&&Jn),Ee&&(0,Me.createPortal)((0,W.jsx)(bt,{live:M,agents:t.agents,contexts:t.contexts,prepare:We,principalId:D,evidence:rt,onEvidence:qn,focusObject:Kn}),Ee),(0,W.jsx)(St,{live:M,items:st,onHide:e=>R(t=>[...t,e])}),ht&&(0,W.jsxs)(`div`,{className:`shell-interruption problem`,"data-rho-layer":`transient`,"data-rho-interruption":``,role:`alert`,children:[(0,W.jsx)(`span`,{className:`shell-interruption-text`,children:ht}),(0,W.jsx)(`button`,{className:`shell-quiet`,onClick:()=>G(``),children:`Dismiss`})]}),(0,W.jsx)(wt,{live:M}),(0,W.jsxs)(`div`,{ref:qe,className:`shell-stage`,onPointerDownCapture:e=>M.hold(e.target.closest(`[data-owner-view]`)?.dataset.ownerView??z),onKeyDownCapture:e=>{M.hold(z),!e.metaKey&&!e.ctrlKey&&e.key.length===1&&k?.()},onCompositionStartCapture:()=>M.hold(z),children:[C&&ye&&yn&&vn&&_n&&t.feedback?.draftDocumentId&&(0,Me.createPortal)(xn?(0,W.jsxs)(`section`,{className:`unavailable`,role:`status`,children:[(0,W.jsx)(`h3`,{children:`Close a view before opening feedback`}),(0,W.jsx)(`p`,{children:`Existing views and input are kept within this layout's view limit.`})]}):(0,W.jsx)(_n.View,{viewId:`feedback:`+yn,view:{id:`feedback:`+yn,component:_n.component,version:_n.componentVersion,props:{title:`Your question`,taskId:t.feedback.taskId,sourceSelectionScope:I.get(yn)?s(I.get(yn)):{kind:`shared`,id:yn}},bindings:{draft:{kind:`live-document`,documentId:t.feedback.draftDocumentId}}},projectId:t.project.id,snapshot:t,client:n,active:!0,principalId:D,contextTarget:null,feedbackConfiguration:{...t.feedback,draftDocumentId:t.feedback.draftDocumentId}},[t.project.id,t.feedback.taskId,yn,D].join(`:`)),C),P?V?(0,W.jsxs)(`section`,{className:`shell-group`,children:[(0,W.jsxs)(`div`,{className:`shell-tabbar`,children:[(0,W.jsx)(`div`,{ref:Wn,className:`shell-tabs`,role:`tablist`,"aria-label":`Views`,onKeyDown:Gn,children:F.map((e,t)=>(0,W.jsxs)(`div`,{className:`shell-tab`,"data-closable":ln?``:void 0,children:[(0,W.jsx)(`button`,{id:Un+t,role:`tab`,"aria-selected":e===z,"aria-controls":Un+`panel`,tabIndex:e===z?0:-1,"aria-keyshortcuts":ln?`Delete`:void 0,onClick:()=>{e!==z&&k?.(),L(e)},onKeyDown:t=>{t.key===`Delete`&&ln&&(t.preventDefault(),pn(e))},children:(0,W.jsx)(`span`,{className:`shell-tab-name`,children:E(I.get(e))})}),ln&&e===z&&(0,W.jsx)(`button`,{className:`shell-tab-close`,tabIndex:-1,"aria-hidden":`true`,title:`Close `+E(I.get(e)),onClick:()=>pn(e),children:(0,W.jsx)(r,{name:`close`,size:12,stroke:2})})]},e))}),ln&&A&&(0,W.jsx)(Jt,{name:`Views`,content:()=>A(m(d(P,z)?.id??P.id))})]}),(0,W.jsx)(`div`,{className:`shell-header-slot shell-header-narrow`,ref:Pn(`narrow`)}),z&&(0,W.jsx)(Gt,{container:An(z),id:Un+`panel`,labelledBy:Un+F.indexOf(z)},z)]}):Hn(U??P):Ie??(0,W.jsxs)(`div`,{className:`empty`,children:[(0,W.jsx)(`h2`,{children:`No views in this layout`}),(0,W.jsx)(`p`,{children:`The saved layout is empty. No view is created automatically.`})]}),$?.dragging&&!V&&(0,W.jsxs)(`div`,{className:`shell-edges`,"aria-hidden":`true`,children:[[`left`,`right`,`top`,`bottom`].map(e=>(0,W.jsx)(`div`,{className:`shell-edge`,"data-side":e,"data-over":$.target&&`edge`in $.target&&$.target.edge===e?``:void 0,onDragOver:t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,$.target&&`edge`in $.target&&$.target.edge===e||$.over({edge:e})},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||$.over(null)},onDrop:t=>{t.preventDefault(),$.drop({edge:e})}},e)),$.target&&`edge`in $.target&&(0,W.jsx)(`div`,{className:`shell-edge-preview`,"data-side":$.target.edge})]}),un&&ln&&(0,W.jsxs)(`div`,{className:`shell-closed`,role:`status`,children:[(0,W.jsxs)(`span`,{children:[`Closed `,un.label]}),(0,W.jsx)(`button`,{className:`shell-link`,onClick:()=>void mn(),children:`Undo`}),(0,W.jsx)(`button`,{className:`shell-quiet`,"aria-label":`Dismiss`,onClick:()=>dn(null),children:(0,W.jsx)(r,{name:`close`,size:13})})]}),[...wn.current].filter(e=>I.has(e)).map(e=>(0,Me.createPortal)(Rn(e),An(e),e))]})]})})})}export{Zt as Workspace};
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "format": "rho.web-build/1",
3
3
  "uiProtocol": "0.1-draft",
4
- "rendererBuild": "485f1b19e789f432be41a9566199b3dddf2ff479e48ab4e3c1cd4ea75fe16033",
4
+ "rendererBuild": "094bee327d7964c2c6ea9fe3db6d35899545d090074c964d0cdb056f556471f1",
5
5
  "ownerEntries": [
6
6
  {
7
7
  "plugin": "documents",
@@ -60,7 +60,7 @@
60
60
  "component": "rho.agent-note",
61
61
  "version": "0.2.0",
62
62
  "source": "web/entries/agent.tsx",
63
- "packageVersion": "0.4.28",
63
+ "packageVersion": "0.4.30",
64
64
  "entrySha256": "0e18d175dfc25fd8e237ec0341422e0d1311d2d8882e487962e8c7c25794d69e"
65
65
  },
66
66
  {
@@ -255,7 +255,7 @@
255
255
  {
256
256
  "path": ".vite/manifest.json",
257
257
  "bytes": 23614,
258
- "sha256": "3f5cd1589d4c851c00b0e6dedecf2df169dba3eae111302f38bdb6b7fed51460"
258
+ "sha256": "2dc60f63158b05c257607125515a2cdd1c31059f96cf596a31c88bb20dbf6576"
259
259
  },
260
260
  {
261
261
  "path": "assets/answer-board-CBkGbSLD.js",
@@ -263,59 +263,59 @@
263
263
  "sha256": "2d1a41d6ce8a1ad1e06c6eb26bf33520b467b1fcb3a158d6c585c6b9140a0bc6"
264
264
  },
265
265
  {
266
- "path": "assets/canvas-BXhC8RDZ.js",
267
- "bytes": 20280,
268
- "sha256": "b2e4c27b4627f85ce52f421d07921fcb64c1c0c816429cb8c094af6a724ba297"
266
+ "path": "assets/canvas-D8rDdfDz.js",
267
+ "bytes": 20318,
268
+ "sha256": "cd9dfbef068bacb28e1327cd137b26fff32004288a0827152ec532abc24f7558"
269
+ },
270
+ {
271
+ "path": "assets/choices-D-YfnFP6.js",
272
+ "bytes": 11096,
273
+ "sha256": "29d0563c9bf57492a6aee0c373d1da152594435c35708b5d2b6a7c79f18f6a33"
269
274
  },
270
275
  {
271
276
  "path": "assets/choices-DLah50GC.css",
272
277
  "bytes": 1659,
273
278
  "sha256": "2285c02644e12f379880df802cd34ed6262d73a159aeb9a12e80de44f12db447"
274
279
  },
275
- {
276
- "path": "assets/choices-DU9kHlyQ.js",
277
- "bytes": 11095,
278
- "sha256": "85b5a4a9e61cc761c32c5f09bc8c760681cfc57d829088dc932e0aeff77990c9"
279
- },
280
280
  {
281
281
  "path": "assets/console-By4Mvn1y.css",
282
282
  "bytes": 3779,
283
283
  "sha256": "38fdefe20f181e6a050793f715a13bcbde2e9c167f80f554a775e3578dcd78bc"
284
284
  },
285
285
  {
286
- "path": "assets/console-Dbdo-5oO.js",
286
+ "path": "assets/console-Trqc0swD.js",
287
287
  "bytes": 21020,
288
- "sha256": "6a39c3e3abc4d95d81a9cb6790c7ba1c9d88045c3be266916bbf455be1f642eb"
288
+ "sha256": "c0e7821902b6e19724d259aec4aa115ed7462402eec0a3f6452df10f3152a10c"
289
289
  },
290
290
  {
291
- "path": "assets/dist-B2V0VDO0.js",
292
- "bytes": 183314,
293
- "sha256": "3ab47b21fad70499d77744c23d95b1320a2c7fdcd00e2a57e4b108bdbf935004"
291
+ "path": "assets/dist-DCtcCJPs.js",
292
+ "bytes": 34901,
293
+ "sha256": "9deb65f8b227a08473b422b448735f045aa2251acf498f169640f7d38d96173e"
294
294
  },
295
295
  {
296
- "path": "assets/dist-BV3hWfn_.js",
297
- "bytes": 37498,
298
- "sha256": "eb2266a7b0b351d4975a1964d7fb473c7d980ac055365ca142f03e1ed5029b39"
296
+ "path": "assets/dist-DpIHRk3B.js",
297
+ "bytes": 35411,
298
+ "sha256": "22bf26faa31efb7f46296f6fc4f3b831bcf9303056c1b9bf9bb1b0fc0c58cdd3"
299
299
  },
300
300
  {
301
- "path": "assets/dist-CLNF2g-E.js",
302
- "bytes": 35411,
303
- "sha256": "07fd5602ed1daf630dd57c1783d6c93f5a31fb53fdcf0be9582660ec2d7cdad3"
301
+ "path": "assets/dist-DZmszrjG.js",
302
+ "bytes": 183314,
303
+ "sha256": "0879df241ab3ba4064054d6c5f44a70ee10ad2f32b7d249107c143578dd891de"
304
304
  },
305
305
  {
306
- "path": "assets/dist-D25Vn17i.js",
306
+ "path": "assets/dist-eMx6b8N1.js",
307
307
  "bytes": 44651,
308
- "sha256": "88fcb93008219182ced64313e5c93fe4cb47b67320ce98fc257291b707e12ad6"
308
+ "sha256": "f0e536da7c98837e3b7841fbaf1e6eef294bb1d6fb5a939e923ec6d605ef56cd"
309
309
  },
310
310
  {
311
- "path": "assets/dist-DCtcCJPs.js",
312
- "bytes": 34901,
313
- "sha256": "9deb65f8b227a08473b422b448735f045aa2251acf498f169640f7d38d96173e"
311
+ "path": "assets/dist-pF902jHA.js",
312
+ "bytes": 37492,
313
+ "sha256": "d2af94b048491a451eb7225abd3c581843d8e4370708c7a5f2dd4d984b7fc2f5"
314
314
  },
315
315
  {
316
- "path": "assets/explore-in-8Q5ftt-E.js",
317
- "bytes": 783,
318
- "sha256": "6ebe9c13e83db24b8ca8a2e4f3786ef7881f28fafb9ce8c85ace154567dea030"
316
+ "path": "assets/explore-in-BCHqjJ7B.js",
317
+ "bytes": 782,
318
+ "sha256": "75cea34047fd256982cea015a63bc82a39e3819c6bd8bcabe684893852ec7127"
319
319
  },
320
320
  {
321
321
  "path": "assets/facts-BMO6V3-3.js",
@@ -333,9 +333,9 @@
333
333
  "sha256": "e84aa51d7376fc0a6104c0b140821c54bc25a2b55be32be6005e08b85dd7e0df"
334
334
  },
335
335
  {
336
- "path": "assets/graph-hS2kvHTI.js",
337
- "bytes": 48764,
338
- "sha256": "8044be54a3190fe3c827e3f8a35d1f9b77fedc596f1903a4af40d71e5a68b2b6"
336
+ "path": "assets/graph-lENgfQNH.js",
337
+ "bytes": 48768,
338
+ "sha256": "39361c04da7930383cb5b0fd9753b1cbdb28d186c514da92cc13a4524ef3ef97"
339
339
  },
340
340
  {
341
341
  "path": "assets/home-CCbP6kS-.js",
@@ -343,14 +343,14 @@
343
343
  "sha256": "6bbbe67af01bd03b2777abcc02e63dda1bad1fa7aaf9296b07cda04ac481e7cb"
344
344
  },
345
345
  {
346
- "path": "assets/index-BHQIaDsx.js",
347
- "bytes": 1762439,
348
- "sha256": "bf3f31d63d0e5440f7c52c8948ef756d25d73062eb6dcd937f50a14abaee62f6"
346
+ "path": "assets/index-B3_OVy91.css",
347
+ "bytes": 114009,
348
+ "sha256": "15692810923cc0bcc8e4eb08df8a9ec0ca8ebaf8a05c754b6589052603869201"
349
349
  },
350
350
  {
351
- "path": "assets/index-Cj1_iqyK.css",
352
- "bytes": 111026,
353
- "sha256": "289f0730221144e47d64798dd722e39289c5f119b258e09ba1a501e97fb816ea"
351
+ "path": "assets/index-BpL_Kl_s.js",
352
+ "bytes": 1779367,
353
+ "sha256": "0944ee8e42207a963f7be95c817b58648651f8cd2ccae0f475c265a105234038"
354
354
  },
355
355
  {
356
356
  "path": "assets/KaTeX_AMS-Regular-BQhdFMY1.woff2",
@@ -663,14 +663,14 @@
663
663
  "sha256": "717274e2c02c05db67e7f1bf6fec4dfae799f3a2780ea7a95c4fdf0d160dfab8"
664
664
  },
665
665
  {
666
- "path": "assets/notes-meaning-DdPbtNzJ.js",
666
+ "path": "assets/notes-meaning-DcVGUBBY.js",
667
667
  "bytes": 5850,
668
- "sha256": "8fa69b98fa48426a9eed7998f4c890906739e203e9e36156afb25ab9903e143e"
668
+ "sha256": "4af65e597d04917ac151c30f91f0811139350b3758132686729f8d49f63f849b"
669
669
  },
670
670
  {
671
- "path": "assets/overview-BV6ZO5TO.js",
672
- "bytes": 48360,
673
- "sha256": "f0fe461d635c2f04b7066cabea7419a186e880588de4d4e0b94b48937ac91174"
671
+ "path": "assets/overview-CDnVKlOt.js",
672
+ "bytes": 48647,
673
+ "sha256": "a4e4bf4b0bfbbd3a73fbb216dcee730e46e83bb260fab25f836406db93840b14"
674
674
  },
675
675
  {
676
676
  "path": "assets/overview-CmC7mah4.css",
@@ -678,9 +678,9 @@
678
678
  "sha256": "f6b19e1fbbb7cc884faff634b6f7b016f806313b946600b11bbf76dc59caf1a9"
679
679
  },
680
680
  {
681
- "path": "assets/preview-n5lOOdjN.js",
682
- "bytes": 4705,
683
- "sha256": "bfe4a5b0af6059c01e9051f2573802abc5aa690228b4792cb89013455f94de07"
681
+ "path": "assets/preview-BEC1E9MK.js",
682
+ "bytes": 4703,
683
+ "sha256": "9888dc22cea50e3757542e144c09fc85bf53fc3abc212955a8af6ae059d155fa"
684
684
  },
685
685
  {
686
686
  "path": "assets/r-CxDmU1I4.js",
@@ -698,9 +698,9 @@
698
698
  "sha256": "364a909acd2231cafe737e8f9b19ad58ba16d3b6cbb90b0de78015dd437bd56b"
699
699
  },
700
700
  {
701
- "path": "assets/review-CmWou4Iv.js",
701
+ "path": "assets/review-DYP0aCXb.js",
702
702
  "bytes": 4860,
703
- "sha256": "1665cca29b3db5e5c7a70ed7ed053b48d797d026dbf2336b325270bcad8d9287"
703
+ "sha256": "6059e4b493405b191cae348f63ce7ae32ae97e8165710adeee0d26672405576e"
704
704
  },
705
705
  {
706
706
  "path": "assets/rolldown-runtime-XKyaHtl9.js",
@@ -708,9 +708,9 @@
708
708
  "sha256": "548d1dbf321e7d2ae804fcc158b588706a7c52f8ca175de1490c6ccb4dbe55b7"
709
709
  },
710
710
  {
711
- "path": "assets/skills-Dy7n3L9d.js",
711
+ "path": "assets/skills-1ec0Z-jx.js",
712
712
  "bytes": 12538,
713
- "sha256": "2779f6bc30eecb6a28d973a6b58582ccf4a000319cb95fdba4e134909ec3c240"
713
+ "sha256": "aeaf67104b99a56d368f41e6f2ddceb82c179f5309281258a8cecf50c8cc264b"
714
714
  },
715
715
  {
716
716
  "path": "assets/skills-WkE0KCzn.css",
@@ -718,9 +718,9 @@
718
718
  "sha256": "162823ce43fd1e1f2bd92a330516c171280b59a0b5460752f0d7aba5f194f3eb"
719
719
  },
720
720
  {
721
- "path": "assets/skills-work-Cj0W6b-I.js",
721
+ "path": "assets/skills-work-DNexV4OJ.js",
722
722
  "bytes": 2528,
723
- "sha256": "89756a0567fcad66589853d68a007adc07842ee1cc1ec34af2b12da0a2393170"
723
+ "sha256": "3f30614690b9199ece7838ab8076bb902f6f2fb619ff03dd568806b562ac1fa9"
724
724
  },
725
725
  {
726
726
  "path": "assets/snapshot-CAxBYPvV.js",
@@ -733,29 +733,29 @@
733
733
  "sha256": "7acddf1303643a15a8df990808a42e218033edf56b8c03b0fcc8271683b0195f"
734
734
  },
735
735
  {
736
- "path": "assets/studio-process-QOY_n2_8.js",
736
+ "path": "assets/studio-process-EYQgikxq.js",
737
737
  "bytes": 22888,
738
- "sha256": "1304e5eb2ca890173dd7252bcb9dc54e6e2f041d60fb253a94e201f17719234e"
738
+ "sha256": "055ece65b0ba5c0b6787daaa834bdd4e09aeb66a0fb062735114a5fa40c0fa3e"
739
739
  },
740
740
  {
741
- "path": "assets/timeline-events-DmX1BCh3.js",
741
+ "path": "assets/timeline-events-Chj2Gbx7.js",
742
742
  "bytes": 2227,
743
- "sha256": "71dfdab4a0cd37bfb42c81433a906ac4158ff0e7681ff84bdb0de7f70075db3f"
743
+ "sha256": "be716e87f5a47e4e602a0d326e84cfb8e5e701abe10ae484e3f23fdb3587c3ff"
744
744
  },
745
745
  {
746
- "path": "assets/work-turns-Co0C71rJ.js",
746
+ "path": "assets/work-turns-CT9RVcWY.js",
747
747
  "bytes": 1460,
748
- "sha256": "4aa3aef0ffcbfc25cbfed3c82eabe46fb81a23c946ef1aaa6938b744bae8e9ed"
748
+ "sha256": "2270b5c2510a3b04a642621a345ead825c44bc7896b7231a3fbfb24903f62e3f"
749
749
  },
750
750
  {
751
- "path": "assets/workspace-BKFefRfJ.js",
752
- "bytes": 81806,
753
- "sha256": "56ada93c5dd4e4ea68f3c020d3d56df20418b72710dcdf017129bda524cc196e"
751
+ "path": "assets/workspace-COmCbGV3.js",
752
+ "bytes": 81815,
753
+ "sha256": "d55693dd507204b35dd28f7e8723e9e15a425d05f8b727c55d73e7866b1f7562"
754
754
  },
755
755
  {
756
756
  "path": "index.html",
757
757
  "bytes": 1142,
758
- "sha256": "59d7727507695bb05eb2c28e08978e50536dbd272dc63bf93818a2ef1f7c7c54"
758
+ "sha256": "d304ba22383bd32eba1e0ab88319c127fe05a0d255fc178253a79a0b6ce22425"
759
759
  },
760
760
  {
761
761
  "path": "licenses.md",
@@ -765,10 +765,10 @@
765
765
  {
766
766
  "path": "renderer.json",
767
767
  "bytes": 85,
768
- "sha256": "aaac148d95413846299416f8f8314510ae658869308342c54b2db2c576cc7602"
768
+ "sha256": "05327600965d5e945f3f6b239255194b3a90324408889b7dc2508a98cf4c1440"
769
769
  }
770
770
  ],
771
- "assetsSha256": "c3e8d826c3113df961293ef759a581501caa44f869cf279b118cd4c4e5cc7424",
771
+ "assetsSha256": "75bcc4b9c1aee998d3112cc11bae15e86356104151ecea4f81826d5c3d13ec5a",
772
772
  "licenses": "licenses.md",
773
773
  "node": "v22.23.4"
774
774
  }
@@ -6,13 +6,13 @@
6
6
  <meta name="color-scheme" content="light" />
7
7
  <title>Rho Workspace</title>
8
8
  <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%231e6b52'/%3E%3Ctext x='16' y='23' font-family='Georgia,serif' font-size='22' text-anchor='middle' fill='white'%3E%CF%81%3C/text%3E%3C/svg%3E" />
9
- <script type="module" crossorigin src="/assets/index-BHQIaDsx.js"></script>
9
+ <script type="module" crossorigin src="/assets/index-BpL_Kl_s.js"></script>
10
10
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/react-Dss-ouuy.js">
12
12
  <link rel="modulepreload" crossorigin href="/assets/markdown-0ngRuTpW.js">
13
13
  <link rel="modulepreload" crossorigin href="/assets/home-CCbP6kS-.js">
14
- <link rel="modulepreload" crossorigin href="/assets/canvas-BXhC8RDZ.js">
15
- <link rel="stylesheet" crossorigin href="/assets/index-Cj1_iqyK.css">
14
+ <link rel="modulepreload" crossorigin href="/assets/canvas-D8rDdfDz.js">
15
+ <link rel="stylesheet" crossorigin href="/assets/index-B3_OVy91.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="root"></div>
@@ -1 +1 @@
1
- {"rendererBuild":"485f1b19e789f432be41a9566199b3dddf2ff479e48ab4e3c1cd4ea75fe16033"}
1
+ {"rendererBuild":"094bee327d7964c2c6ea9fe3db6d35899545d090074c964d0cdb056f556471f1"}
@@ -3,6 +3,7 @@ import { type InstalledUiEntry } from './ui-extension.js';
3
3
  export declare const webRoot: string;
4
4
  export declare function installedWebEntries(root?: string): Promise<InstalledUiEntry[]>;
5
5
  export declare const pageFramePath = "/frame.html";
6
+ export declare const extensionFramePath = "/extension-frame.html";
6
7
  export declare const pageFramePolicy = "sandbox allow-scripts; default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' data: blob:; style-src 'unsafe-inline' data: blob:; img-src data: blob:; font-src data: blob:; media-src data: blob:; base-uri 'none'; form-action 'none'; frame-ancestors 'self'";
7
- export declare function servePageFrame(response: ServerResponse, head?: boolean): void;
8
+ export declare function servePageFrame(response: ServerResponse, head?: boolean, allowForms?: boolean): void;
8
9
  export declare function serveWeb(pathname: string, response: ServerResponse, root?: string, head?: boolean): Promise<void>;
@@ -30,6 +30,7 @@ export async function installedWebEntries(root = webRoot) {
30
30
  // from the network and lets the page's own inline scripts, styles and data run. It tells the
31
31
  // view that embeds it that it is ready, then writes the one page that view sends it.
32
32
  export const pageFramePath = '/frame.html';
33
+ export const extensionFramePath = '/extension-frame.html';
33
34
  export const pageFramePolicy = "sandbox allow-scripts; default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' data: blob:; style-src 'unsafe-inline' data: blob:; img-src data: blob:; font-src data: blob:; media-src data: blob:; base-uri 'none'; form-action 'none'; frame-ancestors 'self'";
34
35
  const pageFrame = `<!DOCTYPE html><html><head><meta charset="utf-8"><title>Page</title></head><body><script>
35
36
  (function () {
@@ -43,9 +44,9 @@ const pageFrame = `<!DOCTYPE html><html><head><meta charset="utf-8"><title>Page<
43
44
  })();
44
45
  </script></body></html>
45
46
  `;
46
- export function servePageFrame(response, head = false) {
47
+ export function servePageFrame(response, head = false, allowForms = false) {
47
48
  const bytes = Buffer.from(pageFrame);
48
- response.writeHead(200, { 'content-type': 'text/html; charset=utf-8', 'content-length': bytes.length, 'content-security-policy': pageFramePolicy });
49
+ response.writeHead(200, { 'content-type': 'text/html; charset=utf-8', 'content-length': bytes.length, 'content-security-policy': allowForms ? pageFramePolicy.replace('sandbox allow-scripts;', 'sandbox allow-scripts allow-forms;') : pageFramePolicy });
49
50
  response.end(head ? undefined : bytes);
50
51
  }
51
52
  const types = { '.html': 'text/html; charset=utf-8', '.js': 'text/javascript; charset=utf-8', '.css': 'text/css; charset=utf-8', '.woff2': 'font/woff2', '.svg': 'image/svg+xml' };
@@ -7,11 +7,11 @@ export function projectWorkSchema(observation) {
7
7
  projectId: text, cursor: count, observedAt: text,
8
8
  notes: obj({ path: text, documentId: text, version: count, dirty: { type: 'boolean' } }, ['path']),
9
9
  sessions: array(obj({
10
- id: text, source: { enum: ['acp', 'claude-cli', 'native-transcript', 'external-acp'] }, sessionId: nullable(text),
10
+ id: text, source: { enum: ['acp', 'claude-cli', 'native-transcript', 'external-acp', 'external-session'] }, sessionId: nullable(text),
11
11
  title: text, agent: text, connected: { type: 'boolean' }, lastMessage: text, omittedMessageChars: count, pendingPermissions: count, state: text, conversationId: text, streamId: text, principal: nullable(text),
12
12
  version: count, cursor: count, droppedEvents: count, retainedFrom: count,
13
13
  observation: nullable(observation), operationIds: array(text, 256), resourceRefs: array(obj({ id: text, version: text }), 256)
14
- }, ['id', 'source', 'sessionId', 'title', 'state', 'observation', 'operationIds', 'resourceRefs']), 80),
14
+ }, ['id', 'source', 'sessionId', 'title', 'state', 'observation', 'operationIds', 'resourceRefs']), 88),
15
15
  files: array(obj({ path: text, state: { enum: ['observed', 'missing', 'unavailable', 'changed', 'file-byte-limit'] }, observedAt: text, bytes: count, sha256: text,
16
16
  references: array(obj({ session: text, tool: text }), 32) }, ['path', 'state', 'observedAt', 'references']), 16),
17
17
  native: obj({ state: { enum: ['available', 'unavailable'] }, message: text }),
package/docs/FRONTEND.md CHANGED
@@ -249,21 +249,25 @@ inspect what happened. The application gives those actions direct places:
249
249
  - **Files** opens documents, browses the project's folder and the source folders it
250
250
  works in, and filters the current folder. A source folder is named as the person
251
251
  named it and opens one level at a time, the same way any other folder does.
252
- - **Agent** (the sidebar row) has three tabs. Conversations lists those started in Rho
253
- by day, searchable and by Agent: each row its title, model, effort, messages, state,
254
- context use and cost, with Continue, export as Markdown and the trash; opened, its
255
- facts beside what its latest messages did (the files changed and looked at, each
256
- shown in place when chosen, the commands and the answer). The trash restores or
257
- deletes. Runs follow when there are any, with their execution records, output,
258
- repair context and exports. Agents shows Claude Code and Codex: version, whether
259
- asked, the default, model, settings, Claude Code's own model names and the providers
260
- with their models. Outside Rho adds Rho to the person's own Claude Code or Codex with
261
- one button (`session.connect`) and shows three steps in the state Rho observes:
262
- access to this project, Rho in that Agent, its first call; Other ACP clients gives
263
- the `rho --acp` commands. Core-backed Claude Code/dsh activity streams, native errors
264
- and observed output files sit below in a section read only while it is open
265
- ([activity episode](AGENT-ACTIVITY.md), [Agents and conversations](AGENT-PAGE-EPISODE.md),
266
- [Agents outside Rho](AGENT-PANEL-EPISODE.md#agents-outside-rho)).
252
+ - **Agent** (the sidebar row) has two tabs. Conversations lists every session in
253
+ the project folder by day, searchable and by Agent: Rho's conversations, Claude
254
+ Code and Codex sessions read from the Agents' own records, and observed Harness
255
+ conversations. Each row names where the session started (Terminal, VS Code, Codex
256
+ app, Script…) and whether another window has it open now, and offers Continue,
257
+ the terminal resume command, Markdown export and the trash
258
+ ([session continuity](SESSION-CONTINUITY-EPISODE.md)). Agents lists the Agents
259
+ this service can start, with the one new conversations use, its model and folded
260
+ settings; an Agent not found on this computer is greyed out. Below it, one setup
261
+ prompt is for the person's own local MCP client. The prompt names
262
+ the running installation and exact existing project; the Agent configures its
263
+ own client. Reading or copying grants no access. Connections are listed by their
264
+ actual session labels, with access waiting for a call, a verified last call,
265
+ refusal or ended access. Copy failure leaves selectable text; request failure
266
+ offers retry. ACP observations and Host activity remain under a disclosure
267
+ ([connection episode](AGENT-CONNECT-EPISODE.md)). Conversation rows retain title,
268
+ model, effort, messages, state, usage, cost and their files, commands and answers;
269
+ the trash restores or deletes. Runs follow when present
270
+ ([Agents and conversations](AGENT-PAGE-EPISODE.md)).
267
271
  - **Project settings** manages source folders and explicitly checks available tools.
268
272
  - **Studio** shows how a conversation's work was done. The sidebar lists under Studio
269
273
  each session started in Rho, newest first (eight, then All sessions), and then the
@@ -572,8 +576,9 @@ Shared notes opens `project-notes.md` in the existing Documents owner. A failed
572
576
  view and offers Refresh. The cursor invalidates the read model; individual sources
573
577
  and resources retain their own versions. See the [observed loop](ACP-EPISODE.md#shared-workspace-loop).
574
578
  External ACP sessions use the same work surface with their own source identity,
575
- plans, usage and read-only latest reply. Their input and permission choices stay
576
- in the original client. The visible Overview rereads external projections every
579
+ plans, usage and read-only latest reply there. Their permission choices stay in the
580
+ original client; the Agent panel continues such a session in the folder once no
581
+ other window holds it. The visible Overview rereads external projections every
577
582
  1.5 seconds; it does not start a collector, Agent or Host. Turn cancellation keeps
578
583
  unfinished tool outcomes unknown and does not claim all native processes exited.
579
584
 
@@ -607,7 +612,10 @@ A conversation's messages, steps and endings belong to the service's record, not
607
612
  the tab. The tab keeps only an unsent message per conversation and the identity of
608
613
  a message being sent. When the reply to a send is lost, Retry sends that same message
609
614
  once; when the service refuses it, the words go back into the box. A session started
610
- elsewhere has no message box in Rho: its input stays in its own window.
615
+ elsewhere opens in the same panel with its history, its turns marked with where they
616
+ were sent, and its next message continues that session. While another window holds
617
+ it, the box is disabled with where it is open and a link to continue a copy; Rho
618
+ reloads a session whose record changed after its own last message.
611
619
 
612
620
  The palette and responsive dialogs use native dialog focus containment and Escape.
613
621
  Typography, color and layout are implemented in the three CSS files under `web/`.