@akira-tl/forgerelay 0.8.5 → 0.8.7

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 (63) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +8 -10
  3. package/dist/activity/audit-store.js +44 -6
  4. package/dist/activity/mcp-query-tools.js +53 -36
  5. package/dist/activity/query-service.js +41 -11
  6. package/dist/cli.js +16 -17
  7. package/dist/composite-activity.js +124 -33
  8. package/dist/config.js +8 -13
  9. package/dist/db/migrations.js +9 -0
  10. package/dist/db/schema.js +1 -0
  11. package/dist/lsp/test-support/server-fixture.js +7 -7
  12. package/dist/mcp/server-instructions.js +2 -2
  13. package/dist/process-sessions.js +2 -2
  14. package/dist/remote-auth.js +11 -1
  15. package/dist/remote-mcp-connection-pool.js +90 -0
  16. package/dist/remote-transport.js +28 -14
  17. package/dist/remote-workspace-relay.js +53 -23
  18. package/dist/server.js +105 -70
  19. package/dist/skills.js +1 -1
  20. package/dist/subagents/profiles.js +1 -2
  21. package/dist/subagents/providers/adapters/pi.js +2 -2
  22. package/dist/subagents/providers/availability.js +2 -2
  23. package/dist/subagents/providers/path.js +4 -4
  24. package/dist/ui/.vite/manifest.json +32 -32
  25. package/dist/ui/activity-panel-app.html +3 -3
  26. package/dist/ui/assets/{activity-panel-app-E1ju2dqI.js → activity-panel-app-CUAN6zyW.js} +1 -1
  27. package/dist/ui/assets/{heavy-payload-CeW-n9w5.js → heavy-payload-CgzrutLm.js} +1 -1
  28. package/dist/ui/assets/{review-payload-B9CO298v.js → review-payload-BrLbezbq.js} +1 -1
  29. package/dist/ui/assets/{scrollbar-C2twAENW.js → scrollbar-CbhpdW05.js} +1 -1
  30. package/dist/ui/assets/workspace-app-Bhj96tsR.js +1 -0
  31. package/dist/ui/assets/{workspace-app-CwbJnb_w.js → workspace-app-CxwJuZyS.js} +1 -1
  32. package/dist/ui/assets/{workspace-app-BztEvZIC.js → workspace-app-D6UR0AFl.js} +3 -3
  33. package/dist/ui/assets/workspace-app-ldjBmCJR.css +1 -0
  34. package/dist/ui/assets/workspace-lifecycle-app-Cqfhx9pV.js +1 -0
  35. package/dist/ui/workspace-app.html +4 -4
  36. package/dist/ui/workspace-lifecycle-app.html +4 -4
  37. package/dist/user-config.js +3 -19
  38. package/dist/workspace-presentation.js +69 -0
  39. package/dist/workspace-store.js +29 -1
  40. package/dist/workspaces.js +59 -19
  41. package/docs/agent-profile-schema.md +4 -9
  42. package/docs/artifact-exchange.md +2 -1
  43. package/docs/chatgpt-coding-workflow.md +21 -19
  44. package/docs/configuration.md +34 -39
  45. package/docs/gotchas.md +10 -7
  46. package/docs/roadmap.md +11 -4
  47. package/docs/security.md +3 -2
  48. package/docs/setup.md +8 -5
  49. package/docs/versioning.md +1 -1
  50. package/package.json +3 -2
  51. package/scripts/debug/accept.mjs +7 -1
  52. package/scripts/debug/relay-accept.mjs +0 -1
  53. package/scripts/debug/runtime.mjs +0 -4
  54. package/scripts/debug/runtime.test.mjs +0 -2
  55. package/scripts/debug/traffic/run.sh +5 -0
  56. package/scripts/debug/traffic/traffic-audit.mjs +907 -0
  57. package/scripts/release/push-ready.mjs +124 -0
  58. package/scripts/release/push-ready.test.mjs +108 -0
  59. package/scripts/release/release-gate.test.mjs +1 -0
  60. package/scripts/release-proof.mjs +16 -1
  61. package/dist/ui/assets/workspace-app-YnUST8IP.css +0 -1
  62. package/dist/ui/assets/workspace-app-rKuhdae8.js +0 -1
  63. package/dist/ui/assets/workspace-lifecycle-app-CEfMdudP.js +0 -1
@@ -1,2 +1,2 @@
1
- import{a as e,c as t,i as n,l as r,o as i,s as a,t as o,u as s}from"./workspace-app-CwbJnb_w.js";function c(e){let t=m(e._meta),n=m(e.structuredContent),r=m(t?.[`forgerelay/activityPanelWorkspace`])??m(n?.[`forgerelay/activityPanelWorkspace`]);if(r&&!(typeof r.workspaceId!=`string`||r.workspaceId.length===0)&&!(typeof r.root!=`string`||r.root.length===0)&&!(r.mode!==void 0&&r.mode!==`checkout`&&r.mode!==`worktree`))return r}var l=class{root;card=null;openInstructionKey=null;showAvailableInstructions=!1;constructor(e){this.root=e}get active(){return this.card!==null}get workspaceId(){return this.card?.workspaceId}accept(e){let t=c(e);return t?(this.card?.workspaceId!==t.workspaceId&&(this.openInstructionKey=null,this.showAvailableInstructions=!1),this.card=t,!0):!1}clear(){this.card=null,this.openInstructionKey=null,this.showAvailableInstructions=!1,this.root.replaceChildren()}render(){return this.card?(this.root.replaceChildren(this.renderPanel(this.card)),!0):!1}renderPanel(t){let n=h(`section`,`workspace-panel`),r=h(`div`,`workspace-panel-header`),a=h(`span`,`workspace-panel-icon`);a.setAttribute(`aria-hidden`,`true`),a.append(e(i.folderOpen,`workspace-panel-icon-svg`));let o=h(`span`,`workspace-panel-title-group`),s=h(`span`,`workspace-panel-title`,`Workspace`),c=h(`span`,`workspace-panel-subtitle`,p(t.root));c.title=t.root,o.append(s,c);let l=h(`span`,`workspace-panel-mode`,t.mode??`workspace`);r.append(a,o,l);let d=h(`div`,`workspace-details`),f=h(`div`,`workspace-rows`);return u(f,`Root`,t.root,i.folderOpen,!0),u(f,`Mode`,t.mode??`workspace`,i.folderTree),t.worktree&&this.appendWorktreeRows(f,t),t.sourceRoot&&t.sourceRoot!==t.root&&u(f,`Source checkout`,t.sourceRoot,i.sourceCheckout,!0),this.appendInstructions(f,t.agentsFiles??[],t.availableAgentsFiles??[]),this.appendSkills(f,t.skills??[]),this.appendAgents(f,t),d.append(f),n.append(r,d),n}appendWorktreeRows(t,n){let r=n.worktree;if(!r)return;let a=[r.baseRef,r.baseSha?.slice(0,8)].filter(e=>!!e);if(a.length>0){let n=h(`span`,`workspace-base-value`),o=h(`span`,`workspace-value`,a.join(` · `));if(o.title=a.join(` · `),n.append(o),r.dirtySource){let t=h(`span`,`workspace-base-warning`);t.title=`The source checkout had uncommitted changes when this worktree was created.`,t.setAttribute(`role`,`img`),t.setAttribute(`aria-label`,`Source checkout changes are not included in this worktree`),t.append(e(i.warning,`workspace-base-warning-svg`)),n.append(t)}d(t,`Base`,n,i.base)}r.branch&&u(t,`Worktree branch`,r.branch,i.gitBranch),r.targetBranch&&u(t,`Merge target`,r.targetBranch,i.gitBranch)}appendInstructions(e,t,n){let r=t.map((e,t)=>({key:`loaded:${t}`,path:e.path,label:e.path??`Loaded instructions`,content:e.content,status:`loaded`})),a=new Set(r.map(e=>e.path).filter(Boolean)),o=n.flatMap((e,t)=>e.path&&a.has(e.path)?[]:[{key:`available:${t}`,path:e.path,label:e.path??`Nested instructions`,status:`available`}]);if(r.length===0&&o.length===0)return;let s=this.showAvailableInstructions?[...r,...o]:r,c=h(`span`,`workspace-instruction-list`);for(let e of s)c.append(this.renderInstruction(e,c));if(o.length>0){let e=h(`button`,`workspace-instructions-toggle`,this.showAvailableInstructions?`Show less`:`View all`);e.type=`button`,e.setAttribute(`aria-expanded`,String(this.showAvailableInstructions)),e.addEventListener(`click`,()=>{this.showAvailableInstructions=!this.showAvailableInstructions,this.showAvailableInstructions||(this.openInstructionKey=null),this.render()}),c.append(e)}let l=h(`div`,`workspace-instructions-content`);l.append(c),d(e,`Instructions`,l,i.instructions,`workspace-instructions-row`)}renderInstruction(t,n){let r=h(`span`,`workspace-instruction-item`);r.dataset.instructionKey=t.key;let a=t.status===`loaded`&&t.content!==void 0,o=h(a?`button`:`span`,`workspace-instruction-header${a?` interactive`:``}`);o instanceof HTMLButtonElement&&(o.type=`button`,o.setAttribute(`aria-expanded`,String(this.openInstructionKey===t.key)));let s=h(`span`,`workspace-instruction-status ${t.status}`);s.setAttribute(`role`,`img`),s.setAttribute(`aria-label`,t.status===`loaded`?`Loaded into the current workspace context`:`Available for a nested directory`),s.append(e(t.status===`loaded`?i.instructionLoaded:i.instructionAvailable,`workspace-instruction-status-svg`));let c=h(`span`,`workspace-instruction-text`),l=p(t.label);if(c.append(h(`span`,`workspace-instruction-name`,l)),t.path&&t.path!==l){let e=h(`span`,`workspace-instruction-path`,t.path);e.title=t.path,c.append(e)}if(o.append(s,c),!a)return r.append(o),r;let u=h(`span`,`workspace-instruction-chevron`);u.setAttribute(`aria-hidden`,`true`),u.append(e(i.chevronDown,`workspace-instruction-chevron-svg`)),o.append(u);let d=h(`pre`,`workspace-instruction-preview`,t.content);return o.addEventListener(`click`,()=>{this.openInstructionKey=this.openInstructionKey===t.key?null:t.key;for(let e of n.querySelectorAll(`.workspace-instruction-item`)){let t=e.querySelector(`.workspace-instruction-header.interactive`),n=e.querySelector(`.workspace-instruction-preview`),r=e.dataset.instructionKey===this.openInstructionKey;e.classList.toggle(`expanded`,r),t?.setAttribute(`aria-expanded`,String(r)),n&&(n.hidden=!r)}}),r.append(o,d),(()=>{let e=this.openInstructionKey===t.key;r.classList.toggle(`expanded`,e),o.setAttribute(`aria-expanded`,String(e)),d.hidden=!e})(),r}appendSkills(e,t){if(t.length===0)return;let n=f(t.map(e=>({label:e.name??`Unnamed skill`,title:e.description||void 0})));n.classList.add(`workspace-skills-list`),d(e,`Skills`,n,i.skills,`workspace-skills-row`)}appendAgents(e,t){let r=t.agentProviders??[],a=(t.agents??[]).map(e=>{let t=e.provider?.trim(),r=e.providerAvailable===!1;return{label:e.name??`Unnamed agent`,logo:t?n(t):void 0,profile:!0,tone:r?`muted`:void 0,title:[e.description,t?`Provider: ${t}`:void 0,e.model?`Model: ${e.model}`:void 0,e.thinking?`Thinking: ${e.thinking}`:void 0,r?e.providerUnavailableReason??`Provider unavailable`:void 0].filter(Boolean).join(`
1
+ import{a as e,c as t,i as n,l as r,o as i,s as a,t as o,u as s}from"./workspace-app-CxwJuZyS.js";function c(e){let t=m(e._meta),n=m(e.structuredContent),r=m(t?.[`forgerelay/activityPanelWorkspace`])??m(n?.[`forgerelay/activityPanelWorkspace`]);if(r&&!(typeof r.workspaceId!=`string`||r.workspaceId.length===0)&&!(typeof r.root!=`string`||r.root.length===0)&&!(r.mode!==void 0&&r.mode!==`checkout`&&r.mode!==`worktree`))return r}var l=class{root;card=null;openInstructionKey=null;showAvailableInstructions=!1;constructor(e){this.root=e}get active(){return this.card!==null}get workspaceId(){return this.card?.workspaceId}accept(e){let t=c(e);return t?(this.card?.workspaceId!==t.workspaceId&&(this.openInstructionKey=null,this.showAvailableInstructions=!1),this.card=t,!0):!1}clear(){this.card=null,this.openInstructionKey=null,this.showAvailableInstructions=!1,this.root.replaceChildren()}render(){return this.card?(this.root.replaceChildren(this.renderPanel(this.card)),!0):!1}renderPanel(t){let n=h(`section`,`workspace-panel`),r=h(`div`,`workspace-panel-header`),a=h(`span`,`workspace-panel-icon`);a.setAttribute(`aria-hidden`,`true`),a.append(e(i.folderOpen,`workspace-panel-icon-svg`));let o=h(`span`,`workspace-panel-title-group`),s=h(`span`,`workspace-panel-title`,`Workspace`),c=h(`span`,`workspace-panel-subtitle`,p(t.root));c.title=t.root,o.append(s,c);let l=h(`span`,`workspace-panel-mode`,t.mode??`workspace`);r.append(a,o,l);let d=h(`div`,`workspace-details`),f=h(`div`,`workspace-rows`);return u(f,`Root`,t.root,i.folderOpen,!0),u(f,`Mode`,t.mode??`workspace`,i.folderTree),t.worktree&&this.appendWorktreeRows(f,t),t.sourceRoot&&t.sourceRoot!==t.root&&u(f,`Source checkout`,t.sourceRoot,i.sourceCheckout,!0),this.appendInstructions(f,t.agentsFiles??[],t.availableAgentsFiles??[]),this.appendSkills(f,t.skills??[]),this.appendAgents(f,t),d.append(f),n.append(r,d),n}appendWorktreeRows(t,n){let r=n.worktree;if(!r)return;let a=[r.baseRef,r.baseSha?.slice(0,8)].filter(e=>!!e);if(a.length>0){let n=h(`span`,`workspace-base-value`),o=h(`span`,`workspace-value`,a.join(` · `));if(o.title=a.join(` · `),n.append(o),r.dirtySource){let t=h(`span`,`workspace-base-warning`);t.title=`The source checkout had uncommitted changes when this worktree was created.`,t.setAttribute(`role`,`img`),t.setAttribute(`aria-label`,`Source checkout changes are not included in this worktree`),t.append(e(i.warning,`workspace-base-warning-svg`)),n.append(t)}d(t,`Base`,n,i.base)}r.branch&&u(t,`Worktree branch`,r.branch,i.gitBranch),r.targetBranch&&u(t,`Merge target`,r.targetBranch,i.gitBranch)}appendInstructions(e,t,n){let r=t.map((e,t)=>({key:`loaded:${t}`,path:e.path,label:e.path??`Loaded instructions`,content:e.content,status:`loaded`})),a=new Set(r.map(e=>e.path).filter(Boolean)),o=n.flatMap((e,t)=>e.path&&a.has(e.path)?[]:[{key:`available:${t}`,path:e.path,label:e.path??`Nested instructions`,status:`available`}]);if(r.length===0&&o.length===0)return;let s=this.showAvailableInstructions?[...r,...o]:r,c=h(`span`,`workspace-instruction-list`);for(let e of s)c.append(this.renderInstruction(e,c));if(o.length>0){let e=h(`button`,`workspace-instructions-toggle`,this.showAvailableInstructions?`Show less`:`View all`);e.type=`button`,e.setAttribute(`aria-expanded`,String(this.showAvailableInstructions)),e.addEventListener(`click`,()=>{this.showAvailableInstructions=!this.showAvailableInstructions,this.showAvailableInstructions||(this.openInstructionKey=null),this.render()}),c.append(e)}let l=h(`div`,`workspace-instructions-content`);l.append(c),d(e,`Instructions`,l,i.instructions,`workspace-instructions-row`)}renderInstruction(t,n){let r=h(`span`,`workspace-instruction-item`);r.dataset.instructionKey=t.key;let a=t.status===`loaded`&&t.content!==void 0,o=h(a?`button`:`span`,`workspace-instruction-header${a?` interactive`:``}`);o instanceof HTMLButtonElement&&(o.type=`button`,o.setAttribute(`aria-expanded`,String(this.openInstructionKey===t.key)));let s=h(`span`,`workspace-instruction-status ${t.status}`);s.setAttribute(`role`,`img`),s.setAttribute(`aria-label`,t.status===`loaded`?`Loaded into the current workspace context`:`Available for a nested directory`),s.append(e(t.status===`loaded`?i.instructionLoaded:i.instructionAvailable,`workspace-instruction-status-svg`));let c=h(`span`,`workspace-instruction-text`),l=p(t.label);if(c.append(h(`span`,`workspace-instruction-name`,l)),t.path&&t.path!==l){let e=h(`span`,`workspace-instruction-path`,t.path);e.title=t.path,c.append(e)}if(o.append(s,c),!a)return r.append(o),r;let u=h(`span`,`workspace-instruction-chevron`);u.setAttribute(`aria-hidden`,`true`),u.append(e(i.chevronDown,`workspace-instruction-chevron-svg`)),o.append(u);let d=h(`pre`,`workspace-instruction-preview`,t.content);return o.addEventListener(`click`,()=>{this.openInstructionKey=this.openInstructionKey===t.key?null:t.key;for(let e of n.querySelectorAll(`.workspace-instruction-item`)){let t=e.querySelector(`.workspace-instruction-header.interactive`),n=e.querySelector(`.workspace-instruction-preview`),r=e.dataset.instructionKey===this.openInstructionKey;e.classList.toggle(`expanded`,r),t?.setAttribute(`aria-expanded`,String(r)),n&&(n.hidden=!r)}}),r.append(o,d),(()=>{let e=this.openInstructionKey===t.key;r.classList.toggle(`expanded`,e),o.setAttribute(`aria-expanded`,String(e)),d.hidden=!e})(),r}appendSkills(e,t){if(t.length===0)return;let n=f(t.map(e=>({label:e.name??`Unnamed skill`,title:e.description||void 0})));n.classList.add(`workspace-skills-list`),d(e,`Skills`,n,i.skills,`workspace-skills-row`)}appendAgents(e,t){let r=t.agentProviders??[],a=(t.agents??[]).map(e=>{let t=e.provider?.trim(),r=e.providerAvailable===!1;return{label:e.name??`Unnamed agent`,logo:t?n(t):void 0,profile:!0,tone:r?`muted`:void 0,title:[e.description,t?`Provider: ${t}`:void 0,e.model?`Model: ${e.model}`:void 0,e.thinking?`Thinking: ${e.thinking}`:void 0,r?e.providerUnavailableReason??`Provider unavailable`:void 0].filter(Boolean).join(`
2
2
  `)||void 0}}),o=r.map(e=>{let t=e.name?.trim()||`Unknown provider`,r=n(t);return{label:t,logo:r,bareLogo:!!r,ariaLabel:t,tone:e.available===!1?`muted`:void 0,title:e.available===!1?e.reason??`Provider unavailable`:t}});if(a.length>0){let t=f([...a,...o]);t.classList.add(`workspace-agents-list`),d(e,`Agents`,t,i.agents,`workspace-agents-row`)}else o.length>0&&d(e,`Providers`,f(o),i.providers)}};function u(e,t,n,r,i=!1){let a=h(`span`,`workspace-value${i?` mono`:``}`,n);a.title=n,d(e,t,a,r)}function d(t,n,r,i,a){let o=h(`div`,[`workspace-row`,a].filter(Boolean).join(` `)),s=h(`span`,`workspace-row-icon`);s.setAttribute(`aria-hidden`,`true`),s.append(e(i,`workspace-row-icon-svg`)),o.append(s,h(`span`,`workspace-key`,n),r),t.append(o)}function f(e){let t=h(`span`,`workspace-chip-list`);for(let n of e){let e=!!(n.bareLogo&&n.logo),r=h(`span`,[e?`workspace-provider-logo`:n.profile?`workspace-agent-profile`:`workspace-chip`,n.tone].filter(Boolean).join(` `));if(n.title&&(r.title=n.title),e&&(r.setAttribute(`role`,`img`),r.setAttribute(`aria-label`,n.ariaLabel??n.label)),n.logo){let t=document.createElement(`img`);t.className=e?`workspace-provider-logo-image`:n.profile?`workspace-agent-profile-logo`:`workspace-chip-logo`,t.src=n.logo,t.alt=``,t.setAttribute(`aria-hidden`,`true`),r.append(t)}e||r.append(h(`span`,`workspace-chip-label`,n.label)),t.append(r)}return t}function p(e){return e.replaceAll(`\\`,`/`).split(`/`).filter(Boolean).at(-1)??e}function m(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function h(e,t,n){let r=document.createElement(e);return r.className=t,n!==void 0&&(r.textContent=n),r}document.documentElement.dataset.forgerelayApp=`panel`;var g=document.querySelector(`#app`);if(!g)throw Error(`Missing #app root element.`);var _=g,v=I(`section`,`forgerelay-panel`),y=I(`div`,`workspace-panel-slot`),b=I(`div`,`activity-panel-slot`);v.append(y,b),_.replaceChildren(v);var x=new l(y),S=new o(b,{embedded:!0}),C=null,w,T=!1,E=null,D,O=!1,k;A();async function A(){P(),C=new r({name:`forgerelay-panel`,version:`0.1.0`},{}),C.ontoolinput=e=>{let t=e.arguments?.workspaceId;typeof t==`string`&&t.length>0&&(D=t,T&&!S.active&&M()),P()},C.ontoolresult=e=>{j(e)},C.onhostcontextchanged=e=>{w={...w,...e},N()},C.onteardown=async()=>(T=!1,S.detach(),x.clear(),{});try{await C.connect();let e=C.getHostContext();e&&(w=e),N(),T=!0,S.attach(C),D&&!S.active&&M()}catch(e){E=e instanceof Error?e.message:String(e)}P()}function j(e){x.accept(e)&&(D=x.workspaceId),S.accept(e),P()}async function M(){let e=D;if(!(!C||!T||!e||S.active||O||k===e)&&C.getHostCapabilities()?.serverTools){k=e,O=!0,P();try{let t=await C.callServerTool({name:`activity_snapshot`,arguments:{workspaceId:e}});t.isError||j(t)}finally{O=!1,P()}}}function N(){w?.theme&&s(w.theme),w?.styles?.variables&&t(w.styles.variables),w?.styles?.css?.fonts&&a(w.styles.css.fonts);let e=w?.safeAreaInsets;e&&(document.body.style.padding=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`)}function P(){x.render()||F(),S.render()||b.replaceChildren()}function F(){let e=I(`section`,`workspace-panel pending`),t=I(`div`,`workspace-panel-header`),n=I(`span`,`workspace-panel-title-group`);n.append(I(`span`,`workspace-panel-title`,`Workspace`),I(`span`,`workspace-panel-subtitle`,E||(D?O?`Loading workspace…`:D:T?`Waiting for workspace…`:`Connecting to host…`))),t.append(n),e.append(t),y.replaceChildren(e)}function I(e,t,n){let r=document.createElement(e);return r.className=t,n!==void 0&&(r.textContent=n),r}
@@ -1,4 +1,4 @@
1
- import{a as e,c as t,i as n,o as r,s as i}from"./workspace-app-BztEvZIC.js";import{S as a,_ as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C,v as w,x as T,y as E}from"./scrollbar-C2twAENW.js";var D=new Set,O=null;function k(e){D.add(e),O??=requestAnimationFrame(A)}function A(e){let t=new Set(D);D.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}O=D.size>0?requestAnimationFrame(A):null}var j=class e{options;tokensStable=[];tokensUnstable=[];lastUnstableCodeChunk=``;lastStableGrammarState;constructor(e){this.options=e}async enqueue(e){let t=(this.lastUnstableCodeChunk+e).split(`
1
+ import{a as e,c as t,i as n,o as r,s as i}from"./workspace-app-D6UR0AFl.js";import{S as a,_ as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C,v as w,x as T,y as E}from"./scrollbar-CbhpdW05.js";var D=new Set,O=null;function k(e){D.add(e),O??=requestAnimationFrame(A)}function A(e){let t=new Set(D);D.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}O=D.size>0?requestAnimationFrame(A):null}var j=class e{options;tokensStable=[];tokensUnstable=[];lastUnstableCodeChunk=``;lastStableGrammarState;constructor(e){this.options=e}async enqueue(e){let t=(this.lastUnstableCodeChunk+e).split(`
2
2
  `),n=[],r=[],i=this.tokensUnstable.length;return t.forEach((e,i)=>{let a=i===t.length-1,o=this.options.highlighter.codeToTokens(e,{...this.options,grammarState:this.lastStableGrammarState}),s=o.tokens[0];a||s.push({content:`
3
3
  `,offset:0}),a?(r=s,this.lastUnstableCodeChunk=e):(this.lastStableGrammarState=o.grammarState,n.push(...s))}),this.tokensStable.push(...n),this.tokensUnstable=r,{recall:i,stable:n,unstable:r}}close(){let e=this.tokensUnstable;return this.tokensUnstable=[],this.lastUnstableCodeChunk=``,this.lastStableGrammarState=void 0,{stable:e}}clear(){this.tokensStable=[],this.tokensUnstable=[],this.lastUnstableCodeChunk=``,this.lastStableGrammarState=void 0}clone(){let t=new e(this.options);return t.lastUnstableCodeChunk=this.lastUnstableCodeChunk,t.tokensUnstable=this.tokensUnstable,t.tokensStable=this.tokensStable,t.lastStableGrammarState=this.lastStableGrammarState,t}},M=class extends TransformStream{tokenizer;options;constructor(e){let t=new j(e),{allowRecalls:n=!1}=e;super({async transform(e,r){let{stable:i,unstable:a,recall:o}=await t.enqueue(e);n&&o>0&&r.enqueue({recall:o});for(let e of i)r.enqueue(e);if(n)for(let e of a)r.enqueue(e)},async flush(e){let{stable:r}=t.close();if(!n)for(let t of r)e.enqueue(t)}}),this.tokenizer=t,this.options=e}};function N(e){let t=document.createElement(`span`);return t.style=w(e.htmlStyle??o(e)),t.textContent=e.content,t}var P=-1,F=class{__id=`file-stream:${++P}`;highlighter;stream;abortController;fileContainer;pre;code;gutterElement;contentElement;themeCSSStyle;appliedThemeCSS;currentRowCount=0;constructor(e={theme:E}){this.options=e,this.currentLineIndex=this.options.startingLineIndex??1}cleanUp(){this.abortController?.abort(),this.abortController=void 0}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.options={...this.options,themeType:e},!(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)&&this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType))}async initializeHighlighter(){return this.highlighter=await f(g(this.options.lang,this.options)),this.highlighter}queuedSetupArgs;async setup(e,t){let n=this.queuedSetupArgs!=null;if(this.queuedSetupArgs=[e,t],n)return;this.highlighter??=await this.initializeHighlighter();let[r,i]=this.queuedSetupArgs;this.queuedSetupArgs=void 0;let a=r;this.setupStream(a,i,this.highlighter)}setupStream(e,t,n){let{disableLineNumbers:r=!1,overflow:i=`scroll`,theme:a=E,themeType:o=`system`}=this.options,s=this.getOrCreateFileContainer();s.parentElement??t.appendChild(s),this.pre??=document.createElement(`pre`),this.pre.parentElement??s.shadowRoot?.appendChild(this.pre);let c=typeof a==`string`?n.getTheme(a).type:void 0,u=d({theme:a,highlighter:n});this.applyThemeState(s,u,o,c);let f=l(this.pre,{type:`file`,diffIndicators:`none`,disableBackground:!0,disableLineNumbers:r,overflow:i,split:!1,totalLines:0});f.textContent=``,this.pre=f,this.code=h({code:this.code,pre:f}),this.gutterElement=void 0,this.contentElement=void 0,this.currentRowCount=0,this.currentLineElement=void 0,this.currentLineIndex=this.options.startingLineIndex??1,this.abortController?.abort(),this.abortController=new AbortController;let{onStreamStart:p,onStreamClose:m,onStreamAbort:g}=this.options;this.stream?.cancel().catch(()=>{}),this.stream=e,this.stream.pipeThrough(typeof a==`string`?new M({...this.options,theme:a,highlighter:n,allowRecalls:!0,defaultColor:!1,cssVariablePrefix:y(`token`)}):new M({...this.options,themes:a,highlighter:n,allowRecalls:!0,defaultColor:!1,cssVariablePrefix:y(`token`)})).pipeTo(new WritableStream({start(e){p?.(e)},close(){m?.()},abort(e){g?.(e)},write:this.handleWrite}),{signal:this.abortController.signal}).catch(e=>{e.name!==`AbortError`&&console.error(`FileStream pipe error:`,e)})}queuedTokens=[];handleWrite=e=>{`recall`in e&&this.queuedTokens.length>=e.recall?this.queuedTokens.length=this.queuedTokens.length-e.recall:this.queuedTokens.push(e),k(this.render),this.options.onStreamWrite?.(e)};currentLineIndex;currentLineElement;render=()=>{this.options.onPreRender?.(this);let{gutter:e,content:t}=this.getOrCreateStreamColumns(),n=document.createDocumentFragment(),r=document.createDocumentFragment();for(let e of this.queuedTokens)if(`recall`in e){if(this.currentLineElement==null)throw Error(`FileStream.render: no current line element, shouldnt be possible to get here`);if(e.recall>this.currentLineElement.childNodes.length)throw Error(`FileStream.render: Token recall exceed the current line, there's probably a bug...`);for(let t=0;t<e.recall;t++)this.currentLineElement.lastChild?.remove()}else{let t=N(e);if(this.currentLineElement==null){let{gutterLine:e,contentLine:t}=this.createLine();n.appendChild(e),r.appendChild(t)}if(this.currentLineElement?.appendChild(t),e.content===`
4
4
  `){this.currentLineIndex++;let{gutterLine:e,contentLine:t}=this.createLine();n.appendChild(e),r.appendChild(t)}}n.childNodes.length>0&&e.appendChild(n),r.childNodes.length>0&&t.appendChild(r),this.queuedTokens.length=0,this.options.onPostRender?.(this)};getOrCreateStreamColumns(){if(this.code==null)throw Error(`FileStream: expected code element to exist`);if(this.gutterElement!=null&&this.contentElement!=null)return{gutter:this.gutterElement,content:this.contentElement};let e=document.createElement(`div`);e.dataset.gutter=``;let t=document.createElement(`div`);return t.dataset.content=``,this.code.appendChild(e),this.code.appendChild(t),this.gutterElement=e,this.contentElement=t,{gutter:e,content:t}}updateRowSpan(){this.gutterElement!=null&&(this.gutterElement.style.gridRow=`span ${this.currentRowCount}`),this.contentElement!=null&&(this.contentElement.style.gridRow=`span ${this.currentRowCount}`)}createLine(){let e=this.currentLineIndex,t=`${e-1}`,n=document.createElement(`div`);n.dataset.columnNumber=`${e}`,n.dataset.lineType=`context`,n.dataset.lineIndex=t;let r=document.createElement(`span`);r.dataset.lineNumberContent=``,r.textContent=`${e}`,n.appendChild(r);let i=document.createElement(`div`);return i.dataset.line=`${e}`,i.dataset.lineType=`context`,i.dataset.lineIndex=t,this.currentRowCount+=1,this.updateRowSpan(),this.currentLineElement=i,{gutterLine:n,contentLine:i}}getOrCreateFileContainer(e){return e!=null&&e===this.fileContainer||e==null&&this.fileContainer!=null?this.fileContainer:(this.fileContainer!=null&&e!=null&&e!==this.fileContainer&&(this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0),this.fileContainer=e??document.createElement(`diffs-container`),this.fileContainer)}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??E,s=typeof o==`string`?o:{...o},c=u(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}this.themeCSSStyle=x({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:C(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}};function I(e){let t=v(e);if(t.length!==1)throw console.error(t),Error(`PatchDiff: Provided patch must include only 1 patch, with 1 diff`);let{files:n}=t[0];if(n.length!==1)throw console.error(n),Error(`FileDiff: Provided patch must contain exactly 1 file diff`);return n[0]}var L=a(),R=s();function z({patch:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,className:a,style:o,prerenderedHTML:s,renderAnnotation:l,renderCustomHeader:u,renderHeaderPrefix:d,renderHeaderMetadata:f,renderGutterUtility:p,disableWorkerPool:h=!1}){let g=B(e),{ref:v,getHoveredLine:y}=_({fileDiff:g,options:t,metrics:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:s,hasGutterRenderUtility:p!=null,hasCustomHeader:u!=null,disableWorkerPool:h});return(0,R.jsx)(c,{ref:v,className:a,style:o,children:b(m({fileDiff:g,renderCustomHeader:u,renderHeaderPrefix:d,renderHeaderMetadata:f,renderAnnotation:l,lineAnnotations:r,renderGutterUtility:p,getHoveredLine:y}),s)})}function B(e){return(0,L.useMemo)(()=>I(e),[e])}var V=T();function H(e,t){let n=(0,V.createRoot)(e);return n.render((0,R.jsx)(U,{...t})),{update(e){n.render((0,R.jsx)(U,{...e}))},unmount(){n.unmount()}}}function U({card:a,hostContext:o,errorMessage:s=null}){let c=o?.theme===`light`?`light`:`dark`;if(s)return(0,R.jsx)(K,{message:s,tone:`error`});if(n(a.tool)||r(a.tool)){let e=a.payload?.patch||a.payload?.diff;return e?(0,R.jsx)(G,{patch:e,themeType:c}):(0,R.jsx)(K,{message:`Diff payload is not available.`})}let l=i(a.payload);return l?e(a.tool)?(0,R.jsx)(W,{path:a.path??`file`,text:l,startLine:t(a.summary,`offset`)??1,themeType:c}):(0,R.jsx)(`pre`,{className:`text-payload pretty-scrollbar ${a.tool}`,children:l}):(0,R.jsx)(K,{message:`No details available.`})}function W({path:e,text:t,startLine:n,themeType:r}){let i=(0,L.useRef)(null),a=(0,L.useMemo)(()=>({theme:{light:`pierre-light`,dark:`pierre-dark`},themeType:r,overflow:`scroll`,unsafeCSS:S}),[r]);return(0,L.useEffect)(()=>{let r=i.current;if(!r)return;let o=new F({...a,lang:p(e),startingLineIndex:n}),s=new ReadableStream({start(e){e.enqueue(t),e.close()}}),c=!1;return o.setup(s,r).then(()=>{c&&(o.cleanUp(),r.replaceChildren())}),()=>{c=!0,o.cleanUp(),r.replaceChildren()}},[a,e,n,t]),(0,R.jsx)(`div`,{ref:i,className:`pierre-file pretty-scrollbar`})}function G({patch:e,themeType:t}){return(0,R.jsx)(z,{patch:e,options:{theme:{light:`pierre-light`,dark:`pierre-dark`},themeType:t,diffStyle:`unified`,diffIndicators:`bars`,hunkSeparators:`line-info`,lineDiffType:`word-alt`,overflow:`scroll`,unsafeCSS:S,collapsedContextThreshold:4,expansionLineCount:20,stickyHeader:!0,disableFileHeader:!0},className:`pierre-diff pretty-scrollbar`})}function K({message:e,tone:t=`muted`}){return(0,R.jsx)(`div`,{className:`status ${t}`,children:e})}export{H as mountHeavyPayload};
@@ -1 +1 @@
1
- import{n as e,r as t,t as n}from"./workspace-app-BztEvZIC.js";import{S as r,a as i,b as a,i as o,n as s,o as c,r as l,t as u,x as d}from"./scrollbar-C2twAENW.js";var f=i();function p({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,className:c,style:u,prerenderedHTML:d,renderAnnotation:p,renderCustomHeader:m,renderHeaderPrefix:h,renderHeaderMetadata:g,renderGutterUtility:_,disableWorkerPool:v=!1}){let{ref:y,getHoveredLine:b}=s({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:d,hasGutterRenderUtility:_!=null,hasCustomHeader:m!=null,disableWorkerPool:v});return(0,f.jsx)(a,{ref:y,className:c,style:u,children:l(o({fileDiff:e,renderCustomHeader:m,renderHeaderPrefix:h,renderHeaderMetadata:g,renderAnnotation:p,renderGutterUtility:_,lineAnnotations:r,getHoveredLine:b}),d)})}var m=r(),h=d();function g(e,t){let n=(0,h.createRoot)(e);return n.render((0,f.jsx)(_,{...t})),{update(e){n.render((0,f.jsx)(_,{...e}))},unmount(){n.unmount()}}}function _({card:r,hostContext:i,errorMessage:a=null,visibleFileCount:o}){let s=r.payload?.patch,c=i?.theme===`light`?`light`:`dark`,l=(0,m.useMemo)(()=>y(s),[s]),u=typeof o==`number`?l.slice(0,o):l,[d,h]=(0,m.useState)(()=>new Set);if(a)return(0,f.jsx)(S,{message:a,tone:`error`});if(!s)return(0,f.jsx)(S,{message:`Diff payload is not available.`});if(l.length===0)return(0,f.jsx)(S,{message:`No diff hunks to review.`});let g=x(c);return l.length===1?(0,f.jsx)(`div`,{className:`review-single-file`,children:(0,f.jsx)(p,{fileDiff:l[0],options:g,className:`pierre-diff pretty-scrollbar`})}):(0,f.jsx)(`div`,{className:`review-diff pretty-scrollbar`,children:(0,f.jsx)(`div`,{className:`review-diff-files`,children:u.map((i,a)=>{let o=i.cacheKey??`${i.prevName??``}->${i.name}-${a}`,s=b(i),c=d.has(o),l=e(r.files??[],{path:i.name,previousPath:i.prevName,type:i.type},a),u=t(r.files??[],{path:i.name,previousPath:i.prevName},a);return(0,f.jsxs)(`div`,{className:`review-diff-file`,children:[(0,f.jsxs)(`button`,{type:`button`,className:`review-diff-file-header`,"aria-expanded":c,onClick:()=>{let e=new Set(d);e.has(o)?e.delete(o):e.add(o),h(e)},children:[(0,f.jsx)(`span`,{className:`review-file-kind ${l}`,role:`img`,title:n(l),"aria-label":n(l),children:v(l)}),u?.previous?(0,f.jsxs)(`span`,{className:`review-diff-file-name renamed`,title:u.title,children:[(0,f.jsx)(`span`,{className:`review-diff-file-path previous`,children:u.previous}),(0,f.jsx)(`span`,{className:`review-diff-file-arrow`,children:`→`}),(0,f.jsx)(`span`,{className:`review-diff-file-path current`,children:u.current})]}):(0,f.jsx)(`span`,{className:`review-diff-file-name`,title:u?.title??i.name,children:u?.current??i.name}),(0,f.jsxs)(`span`,{className:`review-diff-file-stats`,children:[(0,f.jsxs)(`span`,{className:`add`,children:[`+`,s.additions]}),(0,f.jsxs)(`span`,{className:`remove`,children:[`-`,s.removals]})]})]}),c?(0,f.jsx)(p,{fileDiff:i,options:g,className:`pierre-diff pretty-scrollbar`}):null]},o)})})})}function v(e){switch(e){case`added`:return`A`;case`edited`:return`M`;case`deleted`:return`D`;case`renamed`:case`renamed-edited`:return`R`;case`unknown`:return`•`}}function y(e){return e?c(e,`review`,!0).flatMap(e=>e.files):[]}function b(e){return e.hunks.reduce((e,t)=>({additions:e.additions+t.additionLines,removals:e.removals+t.deletionLines}),{additions:0,removals:0})}function x(e){return{theme:{light:`pierre-light`,dark:`pierre-dark`},themeType:e,diffStyle:`unified`,diffIndicators:`bars`,hunkSeparators:`line-info`,lineDiffType:`word-alt`,overflow:`scroll`,unsafeCSS:u,collapsedContextThreshold:4,expansionLineCount:20,stickyHeader:!1,disableFileHeader:!0}}function S({message:e,tone:t=`muted`}){return(0,f.jsx)(`div`,{className:`status ${t}`,children:e})}export{g as mountReviewPayload};
1
+ import{n as e,r as t,t as n}from"./workspace-app-D6UR0AFl.js";import{S as r,a as i,b as a,i as o,n as s,o as c,r as l,t as u,x as d}from"./scrollbar-CbhpdW05.js";var f=i();function p({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,className:c,style:u,prerenderedHTML:d,renderAnnotation:p,renderCustomHeader:m,renderHeaderPrefix:h,renderHeaderMetadata:g,renderGutterUtility:_,disableWorkerPool:v=!1}){let{ref:y,getHoveredLine:b}=s({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:d,hasGutterRenderUtility:_!=null,hasCustomHeader:m!=null,disableWorkerPool:v});return(0,f.jsx)(a,{ref:y,className:c,style:u,children:l(o({fileDiff:e,renderCustomHeader:m,renderHeaderPrefix:h,renderHeaderMetadata:g,renderAnnotation:p,renderGutterUtility:_,lineAnnotations:r,getHoveredLine:b}),d)})}var m=r(),h=d();function g(e,t){let n=(0,h.createRoot)(e);return n.render((0,f.jsx)(_,{...t})),{update(e){n.render((0,f.jsx)(_,{...e}))},unmount(){n.unmount()}}}function _({card:r,hostContext:i,errorMessage:a=null,visibleFileCount:o}){let s=r.payload?.patch,c=i?.theme===`light`?`light`:`dark`,l=(0,m.useMemo)(()=>y(s),[s]),u=typeof o==`number`?l.slice(0,o):l,[d,h]=(0,m.useState)(()=>new Set);if(a)return(0,f.jsx)(S,{message:a,tone:`error`});if(!s)return(0,f.jsx)(S,{message:`Diff payload is not available.`});if(l.length===0)return(0,f.jsx)(S,{message:`No diff hunks to review.`});let g=x(c);return l.length===1?(0,f.jsx)(`div`,{className:`review-single-file`,children:(0,f.jsx)(p,{fileDiff:l[0],options:g,className:`pierre-diff pretty-scrollbar`})}):(0,f.jsx)(`div`,{className:`review-diff pretty-scrollbar`,children:(0,f.jsx)(`div`,{className:`review-diff-files`,children:u.map((i,a)=>{let o=i.cacheKey??`${i.prevName??``}->${i.name}-${a}`,s=b(i),c=d.has(o),l=e(r.files??[],{path:i.name,previousPath:i.prevName,type:i.type},a),u=t(r.files??[],{path:i.name,previousPath:i.prevName},a);return(0,f.jsxs)(`div`,{className:`review-diff-file`,children:[(0,f.jsxs)(`button`,{type:`button`,className:`review-diff-file-header`,"aria-expanded":c,onClick:()=>{let e=new Set(d);e.has(o)?e.delete(o):e.add(o),h(e)},children:[(0,f.jsx)(`span`,{className:`review-file-kind ${l}`,role:`img`,title:n(l),"aria-label":n(l),children:v(l)}),u?.previous?(0,f.jsxs)(`span`,{className:`review-diff-file-name renamed`,title:u.title,children:[(0,f.jsx)(`span`,{className:`review-diff-file-path previous`,children:u.previous}),(0,f.jsx)(`span`,{className:`review-diff-file-arrow`,children:`→`}),(0,f.jsx)(`span`,{className:`review-diff-file-path current`,children:u.current})]}):(0,f.jsx)(`span`,{className:`review-diff-file-name`,title:u?.title??i.name,children:u?.current??i.name}),(0,f.jsxs)(`span`,{className:`review-diff-file-stats`,children:[(0,f.jsxs)(`span`,{className:`add`,children:[`+`,s.additions]}),(0,f.jsxs)(`span`,{className:`remove`,children:[`-`,s.removals]})]})]}),c?(0,f.jsx)(p,{fileDiff:i,options:g,className:`pierre-diff pretty-scrollbar`}):null]},o)})})})}function v(e){switch(e){case`added`:return`A`;case`edited`:return`M`;case`deleted`:return`D`;case`renamed`:case`renamed-edited`:return`R`;case`unknown`:return`•`}}function y(e){return e?c(e,`review`,!0).flatMap(e=>e.files):[]}function b(e){return e.hunks.reduce((e,t)=>({additions:e.additions+t.additionLines,removals:e.removals+t.deletionLines}),{additions:0,removals:0})}function x(e){return{theme:{light:`pierre-light`,dark:`pierre-dark`},themeType:e,diffStyle:`unified`,diffIndicators:`bars`,hunkSeparators:`line-info`,lineDiffType:`word-alt`,overflow:`scroll`,unsafeCSS:u,collapsedContextThreshold:4,expansionLineCount:20,stickyHeader:!1,disableFileHeader:!0}}function S({message:e,tone:t=`muted`}){return(0,f.jsx)(`div`,{className:`status ${t}`,children:e})}export{g as mountReviewPayload};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-BkgDQl-G.js","./chunk-EyZ2wyi3.js","./html-D-C6YZk4.js","./css-DEfus9J5.js","./javascript-DDTjKLlQ.js","./angular-ts-Bxh4-O1-.js","./scss-BfZXsAWQ.js","./apl-BmYHKQ6m.js","./json-Cw91r8h1.js","./xml-JnmX6vyS.js","./java-ppHvycj5.js","./astro-C51vqDKq.js","./postcss-BXeXVLqQ.js","./tsx-CTXzrBkN.js","./typescript--ElHoFkw.js","./blade-CdhVsmwq.js","./html-derivative-DJAQcZyc.js","./sql-Ccv_yeUm.js","./bsl-BkkzgIyY.js","./sdbl-bTVj8UrX.js","./c-IBzBpxAO.js","./cairo-DLTphjLi.js","./python-gzcpVVnB.js","./cobol-Cf6azoN_.js","./coffee-vVdGzlmt.js","./cpp-CVHeO-Jk.js","./glsl-_ooCjaeB.js","./regexp-iC9_nbSI.js","./crystal-5UZy6KIX.js","./shellscript-BC2srNaB.js","./edge-CESgo4ia.js","./elixir-9FKfw4cJ.js","./elm-Dv7A0aLa.js","./erb-DHFmDvM0.js","./ruby-C5zYZIyl.js","./graphql-B9LqP-cY.js","./jsx-04X2FT_1.js","./haml-BU5EoZBn.js","./lua-CiyBp52Y.js","./yaml-OAcZkP-w.js","./erlang-Cphh6RMH.js","./markdown-BYOwaDjH.js","./fortran-fixed-form-DEKoE2YW.js","./fortran-free-form-CYNrtFtB.js","./fsharp-D13ZGOAj.js","./gdresource-C0sCabJj.js","./gdscript-Cp2uCuqX.js","./gdshader-CBce3t8t.js","./git-commit-BSykSTBG.js","./diff-woXpYk--.js","./git-rebase-utbU6CzV.js","./glimmer-js-t2kiCkyB.js","./glimmer-ts-F0Jv5okV.js","./hack-8yjdbaSA.js","./handlebars-BBFEg4Lo.js","./http-Dg5LSYRK.js","./hurl-Y5uYzMZR.js","./csv-Dx-8-gkx.js","./hxml-B0Qn7Nwc.js","./haxe-OTjmBuCE.js","./jinja-Bt30h8Ik.js","./jison-D5uZ1Nyo.js","./julia-76hRaaGz.js","./r-DfFga4si.js","./just-CDE7W0vW.js","./perl-BBhWva19.js","./latex-CVO2Byab.js","./tex-t1rUiQCm.js","./liquid-CA-AS3EX.js","./marko-_BWrPfny.js","./less-DVTAwKKz.js","./mdc-PyJv85eS.js","./nextflow-Bbiyy34d.js","./nextflow-groovy-Dc_ddanL.js","./nginx-DAWVw8yu.js","./nim-CKE1dzpU.js","./php-ChIeaAoF.js","./pug-CMgI5afi.js","./qml-CjxTkcFH.js","./razor-i4DbHr8p.js","./csharp-Ct8U2NOr.js","./rst-oy_97Kl4.js","./cmake-Bj61d0ZC.js","./sas-BnMEh2S3.js","./shaderlab-TOUzSsQk.js","./hlsl-Cvrh5tZx.js","./shellsession-BpE5o7_3.js","./soy-COesmhTY.js","./sparql-D_iOobhT.js","./turtle-ByJddavk.js","./stata-CGQEuSZq.js","./surrealql-Bz4JbU-9.js","./svelte-1jM2ejXj.js","./templ-C-VwELcp.js","./go-BJwz_mda.js","./ts-tags-Bewoa6pS.js","./twig-DVg-vELl.js","./vue-wPQ7UlMy.js","./vue-html-BHtJ8geX.js","./vue-vine-CNSGAWwc.js","./stylus-B6D30XZt.js","./xsl-3_vJ27aE.js"])))=>i.map(i=>d[i]);
2
- import{n as e,t}from"./chunk-EyZ2wyi3.js";import{d as n}from"./workspace-app-CwbJnb_w.js";var r=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ae(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function oe(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,oe(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),oe(o,r,i,``,function(e){return e})):o!=null&&(te(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ie(a,u),c+=oe(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ie(a,u++),c+=oe(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return oe(ae(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function se(e,t,n){if(e==null)return e;var r=[],i=0;return oe(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ce(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var D=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},O={map:se,forEach:function(e,t,n){se(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return se(e,function(){t++}),t},toArray:function(e){return se(e,function(e){return e})||[]},only:function(e){if(!te(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=O,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=te,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ce}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,D)}catch(e){D(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),i=t(((e,t)=>{t.exports=r()})),a=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,te());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(ee)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=ee,te=function(){re.postMessage(null)}}else te=function(){_(ee,0)};function ie(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=t(((e,t)=>{t.exports=a()})),s=t((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.6`})),c=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=t((e=>{var t=o(),n=i(),r=c();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),te=Symbol.for(`react.lazy`),ne=Symbol.for(`react.activity`),re=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ne:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case te:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function A(e,t){ue++,le[ue]=e.current,e.current=t}var pe=de(null),me=de(null),he=de(null),ge=de(null);function _e(e,t){switch(A(he,t),A(me,e),A(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(pe),A(pe,e)}function ve(){fe(pe),fe(me),fe(he)}function ye(e){e.memoizedState!==null&&A(ge,e);var t=pe.current,n=Hd(t,e.type);t!==n&&(A(me,e),A(pe,n))}function be(e){me.current===e&&(fe(pe),fe(me)),ge.current===e&&(fe(ge),Qf._currentValue=k)}var xe,j;function M(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,j=-1<e.stack.indexOf(`
2
+ import{n as e,t}from"./chunk-EyZ2wyi3.js";import{d as n}from"./workspace-app-CxwJuZyS.js";var r=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ae(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function oe(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,oe(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),oe(o,r,i,``,function(e){return e})):o!=null&&(te(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ie(a,u),c+=oe(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ie(a,u++),c+=oe(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return oe(ae(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function se(e,t,n){if(e==null)return e;var r=[],i=0;return oe(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ce(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var D=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},O={map:se,forEach:function(e,t,n){se(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return se(e,function(){t++}),t},toArray:function(e){return se(e,function(e){return e})||[]},only:function(e){if(!te(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=O,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=te,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ce}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,D)}catch(e){D(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),i=t(((e,t)=>{t.exports=r()})),a=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,te());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(ee)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=ee,te=function(){re.postMessage(null)}}else te=function(){_(ee,0)};function ie(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=t(((e,t)=>{t.exports=a()})),s=t((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.6`})),c=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=t((e=>{var t=o(),n=i(),r=c();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),ee=Symbol.for(`react.memo`),te=Symbol.for(`react.lazy`),ne=Symbol.for(`react.activity`),re=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ne:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ee:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case te:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k={pending:!1,data:null,method:null,action:null},le=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=le[ue],le[ue]=null,ue--)}function A(e,t){ue++,le[ue]=e.current,e.current=t}var pe=de(null),me=de(null),he=de(null),ge=de(null);function _e(e,t){switch(A(he,t),A(me,e),A(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(pe),A(pe,e)}function ve(){fe(pe),fe(me),fe(he)}function ye(e){e.memoizedState!==null&&A(ge,e);var t=pe.current,n=Hd(t,e.type);t!==n&&(A(me,e),A(pe,n))}function be(e){me.current===e&&(fe(pe),fe(me)),ge.current===e&&(fe(ge),Qf._currentValue=k)}var xe,j;function M(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,j=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+xe+e+j}var Se=!1;function N(e,t){if(!e||Se)return``;Se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
5
  `),l=s.split(`
@@ -0,0 +1 @@
1
+ import"./workspace-app-CxwJuZyS.js";import"./workspace-app-D6UR0AFl.js";document.documentElement.dataset.forgerelayApp=`historical-tool-card`;
@@ -108,4 +108,4 @@ Boolean requesting whether a visible border and background is provided by the ho
108
108
  - omitted: host decides border`)}),R({method:U(`ui/request-display-mode`),params:R({mode:Rg.describe(`The display mode being requested.`)})});var e_=R({mode:Rg.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),t_=B([U(`model`),U(`app`)]).describe(`Tool visibility scope - who can access the tool.`);R({resourceUri:M().optional(),visibility:L(t_).optional().describe(`Who can access this tool. Default: ["model", "app"]
109
109
  - "model": Tool visible to and callable by the agent
110
110
  - "app": Tool callable by the app from this server only`),csp:cf().optional(),permissions:cf().optional()}),R({mimeTypes:L(M()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),R({method:U(`ui/download-file`),params:R({contents:L(B([Dh,Oh])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),R({method:U(`ui/message`),params:R({role:U(`user`).describe(`Message role, currently only "user" is supported.`),content:L(kh).describe(`Message content blocks (text, image, etc.).`)})}),R({method:U(`ui/notifications/sandbox-resource-ready`),params:R({html:M().describe(`HTML content to load into the inner iframe.`),sandbox:M().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:Ug.optional().describe(`CSP configuration from resource metadata.`),permissions:Wg.optional().describe(`Sandbox permissions from resource metadata.`)})});var n_=R({method:U(`ui/notifications/tool-result`),params:Rh.describe(`Standard MCP tool execution result.`)}),r_=R({toolInfo:R({id:im.optional().describe(`JSON-RPC id of the tools/call request.`),tool:Fh.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:Lg.optional().describe(`Current color theme preference.`),styles:Yg.optional().describe(`Style configuration for theming the app.`),displayMode:Rg.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:L(Rg).optional().describe(`Display modes the host supports.`),containerDimensions:B([R({height:P().describe(`Fixed container height in pixels.`)}),R({maxHeight:B([P(),ef()]).optional().describe(`Maximum container height in pixels.`)})]).and(B([R({width:P().describe(`Fixed container width in pixels.`)}),R({maxWidth:B([P(),ef()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
111
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:M().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:M().optional().describe(`User's timezone in IANA format.`),userAgent:M().optional().describe(`Host application identifier.`),platform:B([U(`web`),U(`desktop`),U(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:R({touch:F().optional().describe(`Whether the device supports touch input.`),hover:F().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:R({top:P().describe(`Top safe area inset in pixels.`),right:P().describe(`Right safe area inset in pixels.`),bottom:P().describe(`Bottom safe area inset in pixels.`),left:P().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),i_=R({method:U(`ui/notifications/host-context-changed`),params:r_.describe(`Partial context update containing only changed fields.`)});R({method:U(`ui/update-model-context`),params:R({content:L(kh).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:V(M(),I().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),R({method:U(`ui/initialize`),params:R({appInfo:ym.describe(`App identification (name and version).`),appCapabilities:$g.describe(`Features and capabilities this app provides.`),protocolVersion:M().describe(`Protocol version this app supports.`)})});var a_=R({protocolVersion:M().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:ym.describe(`Host application identification and version.`),hostCapabilities:Qg.describe(`Features and capabilities provided by the host.`),hostContext:r_.describe(`Rich context about the host environment.`)}).passthrough(),o_={target:`draft-2020-12`};async function s_(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](o_);if(n.vendor===`zod`){let{z:n}=await Ng(async()=>{let{z:e}=await Promise.resolve().then(()=>qp);return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function c_(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function l_(e){let t=document.documentElement;t.setAttribute(`data-theme`,e),t.style.colorScheme=e}function u_(e,t=document.documentElement){for(let[n,r]of Object.entries(e))r!==void 0&&t.style.setProperty(n,r)}function d_(e){if(document.getElementById(`__mcp-host-fonts`))return;let t=document.createElement(`style`);t.id=`__mcp-host-fonts`,t.textContent=e,document.head.appendChild(t)}var f_=class e extends Pg{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:Gg,toolinputpartial:Kg,toolresult:n_,toolcancelled:qg,hostcontextchanged:i_};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||l({jitless:!0}),this.setRequestHandler(km,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=kg(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await c_(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await c_(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await s_(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await s_(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(Xg,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(Bh,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(Ih,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){switch(e){case`sampling/createMessage`:if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},Rh,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},lh,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},rh,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?ng:tg;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},Hg,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},mm,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},Bg,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},Vg,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},e_,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new Ig(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Fg}},a_,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}},p_={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},m_=([e,t,n])=>{let r=document.createElementNS(`http://www.w3.org/2000/svg`,e);return Object.keys(t).forEach(e=>{r.setAttribute(e,String(t[e]))}),n?.length&&n.forEach(e=>{let t=m_(e);r.appendChild(t)}),r},h_=(e,t={})=>m_([`svg`,{...p_,...t},e]),g_=[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`}]],__=[[`path`,{d:`M12 8V4H8`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}],[`path`,{d:`M2 14h2`}],[`path`,{d:`M20 14h2`}],[`path`,{d:`M15 13v2`}],[`path`,{d:`M9 13v2`}]],v_=[[`path`,{d:`m6 9 6 6 6-6`}]],y_=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`}]],b_=[[`path`,{d:`M12 20v2`}],[`path`,{d:`M12 2v2`}],[`path`,{d:`M17 20v2`}],[`path`,{d:`M17 2v2`}],[`path`,{d:`M2 12h2`}],[`path`,{d:`M2 17h2`}],[`path`,{d:`M2 7h2`}],[`path`,{d:`M20 12h2`}],[`path`,{d:`M20 17h2`}],[`path`,{d:`M20 7h2`}],[`path`,{d:`M7 20v2`}],[`path`,{d:`M7 2v2`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`}]],x_=[[`path`,{d:`M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`m14 20 2 2 4-4`}]],S_=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M9 10h6`}],[`path`,{d:`M12 13V7`}],[`path`,{d:`M9 17h6`}]],C_=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M9 15h6`}]],w_=[[`path`,{d:`M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z`}],[`path`,{d:`M14.487 7.858A1 1 0 0 1 14 7V2`}],[`path`,{d:`M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516`}],[`path`,{d:`M8 18h1`}]],T_=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M9 15h6`}],[`path`,{d:`M12 18v-6`}]],E_=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10 9H8`}],[`path`,{d:`M16 13H8`}],[`path`,{d:`M16 17H8`}]],D_={agents:__,base:[[`circle`,{cx:`12`,cy:`12`,r:`3`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`}]],chevronDown:v_,deleteFile:C_,diff:S_,editFile:w_,files:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`}]],folderOpen:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`}]],folderTree:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`}]],gitBranch:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`}],[`circle`,{cx:`6`,cy:`18`,r:`3`}]],instructions:E_,instructionAvailable:E_,instructionLoaded:x_,loading:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]],providers:b_,readFile:E_,search:[[`path`,{d:`m21 21-4.34-4.34`}],[`circle`,{cx:`11`,cy:`11`,r:`8`}]],skills:g_,sourceCheckout:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`}],[`circle`,{cx:`13`,cy:`12`,r:`2`}],[`circle`,{cx:`20`,cy:`19`,r:`2`}]],terminal:[[`path`,{d:`M12 19h8`}],[`path`,{d:`m4 17 6-6-6-6`}]],terminalSquare:[[`path`,{d:`m7 11 2-2-2-2`}],[`path`,{d:`M11 13h4`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}]],warning:y_,writeFile:T_},O_={claude:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e`,``+import.meta.url).href,codex:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='260'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20260'%3e%3cpath%20fill='%23fff'%20d='M239.184%20106.203a64.716%2064.716%200%200%200-5.576-53.103C219.452%2028.459%20191%2015.784%20163.213%2021.74A65.586%2065.586%200%200%200%2052.096%2045.22a64.716%2064.716%200%200%200-43.23%2031.36c-14.31%2024.602-11.061%2055.634%208.033%2076.74a64.665%2064.665%200%200%200%205.525%2053.102c14.174%2024.65%2042.644%2037.324%2070.446%2031.36a64.72%2064.72%200%200%200%2048.754%2021.744c28.481.025%2053.714-18.361%2062.414-45.481a64.767%2064.767%200%200%200%2043.229-31.36c14.137-24.558%2010.875-55.423-8.083-76.483Zm-97.56%20136.338a48.397%2048.397%200%200%201-31.105-11.255l1.535-.87%2051.67-29.825a8.595%208.595%200%200%200%204.247-7.367v-72.85l21.845%2012.636c.218.111.37.32.409.563v60.367c-.056%2026.818-21.783%2048.545-48.601%2048.601Zm-104.466-44.61a48.345%2048.345%200%200%201-5.781-32.589l1.534.921%2051.722%2029.826a8.339%208.339%200%200%200%208.441%200l63.181-36.425v25.221a.87.87%200%200%201-.358.665l-52.335%2030.184c-23.257%2013.398-52.97%205.431-66.404-17.803ZM23.549%2085.38a48.499%2048.499%200%200%201%2025.58-21.333v61.39a8.288%208.288%200%200%200%204.195%207.316l62.874%2036.272-21.845%2012.636a.819.819%200%200%201-.767%200L41.353%20151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466%2041.695-63.08-36.63L161.73%2077.86a.819.819%200%200%201%20.768%200l52.233%2030.184a48.6%2048.6%200%200%201-7.316%2087.635v-61.391a8.544%208.544%200%200%200-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39%208.39%200%200%200-8.492%200L99.98%2099.808V74.587a.716.716%200%200%201%20.307-.665l52.233-30.133a48.652%2048.652%200%200%201%2072.236%2050.391v.205ZM88.061%20139.097l-21.845-12.585a.87.87%200%200%201-.41-.614V65.685a48.652%2048.652%200%200%201%2079.757-37.346l-1.535.87-51.67%2029.825a8.595%208.595%200%200%200-4.246%207.367l-.051%2072.697Zm11.868-25.58%2028.138-16.217%2028.188%2016.218v32.434l-28.086%2016.218-28.188-16.218-.052-32.434Z'/%3e%3c/svg%3e`,``+import.meta.url).href,copilot:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20208'%3e%3cpath%20fill='%23fff'%20d='M205.3%2031.4c14%2014.8%2020%2035.2%2022.5%2063.6%206.6%200%2012.8%201.5%2017%207.2l7.8%2010.6c2.2%203%203.4%206.6%203.4%2010.4v28.7a12%2012%200%200%201-4.8%209.5C215.9%20187.2%20172.3%20208%20128%20208c-49%200-98.2-28.3-123.2-46.6a12%2012%200%200%201-4.8-9.5v-28.7c0-3.8%201.2-7.4%203.4-10.5l7.8-10.5c4.2-5.7%2010.4-7.2%2017-7.2%202.5-28.4%208.4-48.8%2022.5-63.6C77.3%203.2%20112.6%200%20127.6%200h.4c14.7%200%2050.4%202.9%2077.3%2031.4ZM128%2078.7c-3%200-6.5.2-10.3.6a27.1%2027.1%200%200%201-6%2012.1%2045%2045%200%200%201-32%2013c-6.8%200-13.9-1.5-19.7-5.2-5.5%201.9-10.8%204.5-11.2%2011-.5%2012.2-.6%2024.5-.6%2036.8%200%206.1%200%2012.3-.2%2018.5%200%203.6%202.2%206.9%205.5%208.4C79.9%20185.9%20105%20192%20128%20192s48-6%2074.5-18.1a9.4%209.4%200%200%200%205.5-8.4c.3-18.4%200-37-.8-55.3-.4-6.6-5.7-9.1-11.2-11-5.8%203.7-13%205.1-19.7%205.1a45%2045%200%200%201-32-12.9%2027.1%2027.1%200%200%201-6-12.1c-3.4-.4-6.9-.5-10.3-.6Zm-27%2044c5.8%200%2010.5%204.6%2010.5%2010.4v19.2a10.4%2010.4%200%200%201-20.8%200V133c0-5.8%204.6-10.4%2010.4-10.4Zm53.4%200c5.8%200%2010.4%204.6%2010.4%2010.4v19.2a10.4%2010.4%200%200%201-20.8%200V133c0-5.8%204.7-10.4%2010.4-10.4Zm-73-94.4c-11.2%201.1-20.6%204.8-25.4%2010-10.4%2011.3-8.2%2040.1-2.2%2046.2A31.2%2031.2%200%200%200%2075%2091.7c6.8%200%2019.6-1.5%2030.1-12.2%204.7-4.5%207.5-15.7%207.2-27-.3-9.1-2.9-16.7-6.7-19.9-4.2-3.6-13.6-5.2-24.2-4.3Zm69%204.3c-3.8%203.2-6.4%2010.8-6.7%2019.9-.3%2011.3%202.5%2022.5%207.2%2027a41.7%2041.7%200%200%200%2030%2012.2c8.9%200%2017-2.9%2021.3-7.2%206-6.1%208.2-34.9-2.2-46.3-4.8-5-14.2-8.8-25.4-9.9-10.6-1-20%20.7-24.2%204.3ZM128%2056c-2.6%200-5.6.2-9%20.5.4%201.7.5%203.7.7%205.7%200%201.5%200%203-.2%204.5%203.2-.3%206-.3%208.5-.3%202.6%200%205.3%200%208.5.3-.2-1.6-.2-3-.2-4.5.2-2%20.3-4%20.7-5.7-3.4-.3-6.4-.5-9-.5Z'/%3e%3c/svg%3e`,``+import.meta.url).href,cursor:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20466.73%20532.09'%3e%3cpath%20fill='%23edecec'%20d='M457.43%20125.94%20244.42%202.96c-6.84-3.95-15.28-3.95-22.12%200L9.3%20125.94c-5.75%203.32-9.3%209.46-9.3%2016.11v247.99c0%206.65%203.55%2012.79%209.3%2016.11l213.01%20122.98c6.84%203.95%2015.28%203.95%2022.12%200l213.01-122.98c5.75-3.32%209.3-9.46%209.3-16.11V142.05c0-6.65-3.55-12.79-9.3-16.11ZM444.05%20151.99%20238.42%20508.15c-1.39%202.4-5.06%201.42-5.06-1.36V273.58c0-4.66-2.49-8.97-6.53-11.31L24.87%20145.67c-2.4-1.39-1.42-5.06%201.36-5.06h411.26c5.84%200%209.49%206.33%206.57%2011.39Z'/%3e%3c/svg%3e`,``+import.meta.url).href,opencode:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'/%3e%3cpath%20d='M320%20224v128H192V224h128Z'%20fill='%235A5858'/%3e%3cpath%20fill='%23fff'%20fill-rule='evenodd'%20d='M384%20416H128V96h256v320ZM320%20160H192v192h128V160Z'%20clip-rule='evenodd'/%3e%3c/svg%3e`,``+import.meta.url).href,pi:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20800'%3e%3cpath%20fill='%23fff'%20fill-rule='evenodd'%20d='M165.29%20165.29h352.07V400H400v117.36H282.65v117.36H165.29V165.29Zm117.36%20117.36V400H400V282.65H282.65Z'/%3e%3cpath%20fill='%23fff'%20d='M517.36%20400h117.36v234.72H517.36z'/%3e%3c/svg%3e`,``+import.meta.url).href};function k_(e){return O_[e.trim().toLowerCase()]}function A_(e,t=`icon-svg`){return h_(e,{class:t,"aria-hidden":`true`})}var j_=`forgerelay/activityPanelDefaultExpanded`,M_=`forgerelay/activityPanelWorkspace`;function N_(e){return K_(e)?e[j_]===!0:!1}function P_(e,t){return F_(t)?`activity`:e?`preserve-panel`:`tool-card`}function F_(e){return!K_(e)||typeof e.turnId!=`string`||!W_(e.revision)||typeof e.changed!=`boolean`||!H_(e.state)||!Array.isArray(e.activities)?!1:e.activities.every(V_)}function I_(e){return!K_(e)||!V_(e.activity)?!1:e.error===void 0||typeof e.error==`string`}function L_(e){return!K_(e)||typeof e.outputId!=`string`||typeof e.activityId!=`string`||!G_(e.processId)||typeof e.command!=`string`||typeof e.output!=`string`||e.status!==`running`&&e.status!==`done`&&e.status!==`failed`||typeof e.timedOut!=`boolean`||typeof e.startedAt!=`string`||e.exitCode!==void 0&&!Number.isInteger(e.exitCode)||e.signal!==void 0&&typeof e.signal!=`string`?!1:e.finishedAt===void 0||typeof e.finishedAt==`string`}function R_(e,t){return e&&e.turnId===t.turnId&&t.changed===!1?{...t,activities:e.activities}:t}function z_(e){let t=new Set(e.map(e=>e.activityId)),n=new Map;for(let r of e){if(!r.parentActivityId||!t.has(r.parentActivityId))continue;let e=n.get(r.parentActivityId)??[];e.push(r),n.set(r.parentActivityId,e)}return e.flatMap(e=>e.parentActivityId&&t.has(e.parentActivityId)?[]:[{activity:e,children:n.get(e.activityId)??[]}])}function B_(e,t=24){return e.scrollHeight-e.clientHeight-e.scrollTop<=t}function V_(e){return!K_(e)||e.member!==void 0&&typeof e.member!=`string`?!1:typeof e.activityId==`string`&&typeof e.tool==`string`&&typeof e.kind==`string`&&H_(e.status)&&U_(e.state)&&typeof e.title==`string`&&typeof e.target==`string`&&typeof e.detailAvailable==`boolean`&&typeof e.startedAt==`string`}function H_(e){return e===`working`||e===`done`||e===`error`}function U_(e){return e===`executing`||e===`returned`||e===`done`||e===`failed`||e===`blocked`}function W_(e){return typeof e==`number`&&Number.isInteger(e)&&e>=0}function G_(e){return typeof e==`number`&&Number.isInteger(e)&&e>0}function K_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var q_=1e3,J_=class{root;options;app=null;snapshot=null;expanded=!1;refreshTimer=null;refreshInFlight=!1;refreshError=null;followTail=!0;scrollTop=0;selectedActivityId=null;details=new Map;detailLoading=new Set;detailErrors=new Map;outputs=new Map;outputLoading=new Set;outputErrors=new Map;outputRefreshTimer=null;constructor(e,t={}){this.root=e,this.options=t}get active(){return this.snapshot!==null}accept(e){let t=e.structuredContent;if(!F_(t))return!1;let n=this.snapshot?.turnId!==t.turnId;return this.snapshot=R_(this.snapshot,t),this.refreshError=null,n&&(this.expanded=N_(e._meta),this.followTail=!0,this.scrollTop=0,this.resetDetails()),this.scheduleRefresh(),!0}attach(e){this.app=e,this.scheduleRefresh()}clear(){this.stopRefresh(),this.snapshot=null,this.refreshError=null,this.expanded=!1,this.followTail=!0,this.scrollTop=0,this.resetDetails()}detach(){this.clear(),this.app=null}render(){return this.snapshot?this.snapshot.activities.length===0?(this.root.replaceChildren(),!0):(this.renderPanel(this.snapshot),!0):!1}scheduleRefresh(e=q_){if(!(!this.app||!this.snapshot||this.refreshTimer!==null)){if(!this.app.getHostCapabilities()?.serverTools){this.refreshError=`Live Activity refresh is unavailable in this host.`,this.render();return}this.refreshTimer=window.setTimeout(()=>{this.refreshTimer=null,this.refreshSnapshot()},e)}}stopRefresh(){this.refreshTimer!==null&&(window.clearTimeout(this.refreshTimer),this.refreshTimer=null)}async refreshSnapshot(){if(!this.app||!this.snapshot||this.refreshInFlight)return;let e=this.snapshot.turnId,t=this.snapshot.revision;this.refreshInFlight=!0;try{let n=await this.app.callServerTool({name:`activity_snapshot`,arguments:{turnId:e,knownRevision:t}});if(n.isError)throw Error(`Activity snapshot refresh failed.`);let r=n.structuredContent;if(!F_(r)||r.turnId!==e)throw Error(`Activity snapshot refresh returned an invalid Host Turn snapshot.`);if(!this.snapshot||this.snapshot.turnId!==e)return;let i=R_(this.snapshot,r),a=r.changed||this.refreshError!==null;this.snapshot=i,this.refreshError=null,a&&this.render()}catch(e){let t=e instanceof Error?e.message:`Activity snapshot refresh failed.`;this.refreshError!==t&&(this.refreshError=t,this.render())}finally{this.refreshInFlight=!1,this.scheduleRefresh()}}resetDetails(){this.stopOutputRefresh(),this.selectedActivityId=null,this.details.clear(),this.detailLoading.clear(),this.detailErrors.clear(),this.outputs.clear(),this.outputLoading.clear(),this.outputErrors.clear()}toggleDetail(e){if(e.detailAvailable){if(this.stopOutputRefresh(),this.selectedActivityId===e.activityId){this.selectedActivityId=null,this.render();return}if(this.selectedActivityId=e.activityId,this.render(),Y_(e)){let t=this.outputs.get(e.outputId);t?.status===`running`&&this.scheduleOutputRefresh(e),!t&&!this.outputLoading.has(e.outputId)&&!this.outputErrors.has(e.outputId)&&this.loadOutput(e,!0);return}!this.details.has(e.activityId)&&!this.detailLoading.has(e.activityId)&&!this.detailErrors.has(e.activityId)&&this.loadDetail(e)}}async loadDetail(e){if(!this.app||!this.snapshot||!e.detailAvailable)return;let t=this.snapshot.turnId,n=e.activityId;this.detailLoading.add(n),this.detailErrors.delete(n),this.render();try{let e=await this.app.callServerTool({name:`activity_detail`,arguments:{turnId:t,activityId:n}});if(e.isError)throw Error(`Activity detail request failed.`);let r=e.structuredContent;if(!I_(r)||r.activity.activityId!==n)throw Error(`Activity detail returned an invalid Activity record.`);if(!this.snapshot||this.snapshot.turnId!==t)return;this.details.set(n,r)}catch(e){if(!this.snapshot||this.snapshot.turnId!==t)return;this.detailErrors.set(n,e instanceof Error?e.message:`Activity detail request failed.`)}finally{this.detailLoading.delete(n),this.snapshot?.turnId===t&&this.render()}}stopOutputRefresh(){this.outputRefreshTimer!==null&&(window.clearTimeout(this.outputRefreshTimer),this.outputRefreshTimer=null)}scheduleOutputRefresh(e){!Y_(e)||this.outputRefreshTimer!==null||this.selectedActivityId===e.activityId&&(this.outputRefreshTimer=window.setTimeout(()=>{this.outputRefreshTimer=null,this.selectedActivityId===e.activityId&&this.loadOutput(e,!1)},q_))}async loadOutput(e,t){if(!this.app||!this.snapshot||!Y_(e))return;let n=this.snapshot.turnId,r=e.outputId;t&&this.outputLoading.add(r),this.outputErrors.delete(r),t&&this.render();let i=!1;try{let e=await this.app.callServerTool({name:`activity_output`,arguments:{turnId:n,outputId:r}});if(e.isError)throw Error(`Bash output request failed.`);let t=e.structuredContent;if(!L_(t)||t.outputId!==r)throw Error(`Bash output returned an invalid durable output record.`);if(!this.snapshot||this.snapshot.turnId!==n)return;this.outputs.set(r,t),i=t.status===`running`}catch(e){if(!this.snapshot||this.snapshot.turnId!==n)return;this.outputErrors.set(r,e instanceof Error?e.message:`Bash output request failed.`)}finally{this.outputLoading.delete(r),this.snapshot?.turnId===n&&this.render(),i&&this.selectedActivityId===e.activityId&&this.scheduleOutputRefresh(e)}}renderActivityEntry(e,t){let n=this.selectedActivityId===e.activityId,r=$(`div`,{className:`activity-entry${n?` expanded`:``}`});return r.append(Z_(e,t,n,e.detailAvailable?()=>this.toggleDetail(e):void 0)),n&&r.append(this.renderActivityDetail(e)),r}renderActivityDetail(e){if(Y_(e))return this.renderBashOutput(e);let t=$(`div`,{className:`activity-detail`}),n=e.activityId;if(this.detailLoading.has(n))return t.append($(`div`,{className:`activity-detail-status`,text:`Loading details...`})),t;let r=this.detailErrors.get(n);if(r)return t.append($(`div`,{className:`activity-detail-status error`,text:r})),t;let i=this.details.get(n);return i?(i.error&&Q_(t,`Error`,i.error,!0),i.request!==void 0&&Q_(t,`Request`,i.request),i.result!==void 0&&Q_(t,`Result`,i.result),t.childElementCount===0&&t.append($(`div`,{className:`activity-detail-status`,text:`No additional details.`})),t):(t.append($(`div`,{className:`activity-detail-status`,text:`Details unavailable.`})),t)}renderBashOutput(e){let t=$(`div`,{className:`activity-detail activity-terminal`}),n=e.outputId;if(this.outputLoading.has(n))return t.append($(`div`,{className:`activity-detail-status`,text:`Loading terminal output...`})),t;let r=this.outputErrors.get(n);if(r)return t.append($(`div`,{className:`activity-detail-status error`,text:r})),t;let i=this.outputs.get(n);return i?(t.append($(`pre`,{className:`activity-terminal-command`,text:i.command}),$(`pre`,{className:`activity-terminal-output pretty-scrollbar`,text:i.output||`(no output)`}),$(`div`,{className:`activity-terminal-meta status-${i.status}`,text:X_(i)})),t):(t.append($(`div`,{className:`activity-detail-status`,text:`Terminal output unavailable.`})),t)}renderPanel(e){let t=this.root.querySelector(`.activity-viewport`);t&&(this.scrollTop=t.scrollTop);let n=$(`section`,{className:`activity-panel state-${e.state}`}),r=$(`button`,{className:`activity-panel-header`,type:`button`,ariaExpanded:String(this.expanded)});r.addEventListener(`click`,()=>{this.expanded=!this.expanded,this.render()});let i=$(`span`,{className:`activity-panel-status state-${e.state}`,ariaHidden:`true`}),a=$(`span`,{className:`activity-panel-title-group`});a.append($(`span`,{className:`activity-panel-title`,text:`Activity`}),$(`span`,{className:`activity-panel-subtitle`,text:`Host Turn · revision ${e.revision}`}));let o=e.activities.length,s=$(`span`,{className:`activity-panel-count`,text:`${o} ${o===1?`activity`:`activities`}`});if(r.append(i,a,s,sv(this.expanded)),n.append(r),this.expanded){let t=$(`div`,{className:`activity-panel-body`}),r=$(`div`,{className:`activity-viewport pretty-scrollbar`,ariaLabel:`ForgeRelay Activity Panel`});r.addEventListener(`scroll`,()=>{this.scrollTop=r.scrollTop,this.followTail=B_(r)});let i=z_(e.activities);if(i.length===0)r.append($(`div`,{className:`activity-empty`,text:`Waiting for ForgeRelay activity...`}));else{let e=$(`div`,{className:`activity-list`});for(let t of i){let n=$(`div`,{className:`activity-group${t.children.length>0?` grouped`:``}`});if(n.append(this.renderActivityEntry(t.activity,!1)),t.children.length>0){let e=$(`div`,{className:`activity-children`});for(let n of t.children)e.append(this.renderActivityEntry(n,!0));n.append(e)}e.append(n)}r.append(e)}this.refreshError&&t.append($(`div`,{className:`activity-refresh-error`,text:this.refreshError})),t.prepend(r),n.append(t),this.replacePanel(n),this.followTail?(r.scrollTop=r.scrollHeight,this.scrollTop=r.scrollTop):r.scrollTop=Math.min(this.scrollTop,Math.max(0,r.scrollHeight-r.clientHeight));return}this.replacePanel(n)}replacePanel(e){if(this.options.embedded){this.root.replaceChildren(e);return}let t=$(`main`,{className:`shell`});t.append(e),this.root.replaceChildren(t)}};function Y_(e){return(e.kind===`shell`||e.kind===`shell-result`)&&typeof e.outputId==`string`&&e.outputId.length>0}function X_(e){let t=[`Process ${e.processId}`,e.status];return e.timedOut?t.push(`timed out`):e.signal?t.push(`signal ${e.signal}`):e.exitCode!==void 0&&t.push(`exit ${e.exitCode}`),t.join(` · `)}function Z_(e,t,n,r){let i=r?$(`button`,{className:[`activity-row`,`interactive`,t?`child`:`parent`,`kind-${rv(e)}`,`phase-${iv(e)}`,e.kind===`shell-result`?`shell-result`:void 0].filter(Boolean).join(` `),type:`button`,ariaExpanded:String(n)}):$(`div`,{className:[`activity-row`,t?`child`:`parent`,`kind-${rv(e)}`,`phase-${iv(e)}`,e.kind===`shell-result`?`shell-result`:void 0].filter(Boolean).join(` `)});r&&i.addEventListener(`click`,r),i.dataset.activityId=e.activityId;let a=$(`span`,{className:`activity-icon`,ariaHidden:`true`});a.append(A_(nv(e),`activity-icon-svg`));let o=$(`span`,{className:`activity-main`}),s=$(`span`,{className:`activity-title-line`});s.append($(`span`,{className:`activity-title`,text:e.title})),e.member&&s.append($(`span`,{className:`activity-member`,text:e.member,title:`Composite member: ${e.member}`})),s.append($(`span`,{className:`activity-target`,text:e.target,title:e.target})),o.append(s),e.children&&o.append(ev(e.children));let c=$(`span`,{className:`activity-meta`}),l=$(`span`,{className:`activity-phase`,text:av(e)}),u=ov(e.durationMs);c.append(l),u&&c.append($(`span`,{className:`activity-duration`,text:u}));let d=e.detailAvailable?sv(n):$(`span`,{className:`activity-detail-spacer`,ariaHidden:`true`});return d.classList.add(`activity-detail-chevron`),i.append(a,o,c,d),i}function Q_(e,t,n,r=!1){let i=$(`section`,{className:`activity-detail-section${r?` error`:``}`});i.append($(`div`,{className:`activity-detail-label`,text:t}),$(`pre`,{className:`activity-detail-value pretty-scrollbar`,text:$_(n)})),e.append(i)}function $_(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function ev(e){let t=$(`span`,{className:`activity-progress-wrap`}),n=$(`span`,{className:`activity-progress-counts`,text:tv(e)}),r=$(`span`,{className:`activity-progress-track`,ariaHidden:`true`}),i=$(`span`,{className:`activity-progress-fill`}),a=e.done+e.error;return i.style.width=`${e.total>0?Math.min(100,a/e.total*100):0}%`,r.append(i),t.append(n,r),t}function tv(e){let t=[`${e.done+e.error}/${e.total}`];return e.working>0&&t.push(`${e.working} running`),e.error>0&&t.push(`${e.error} failed`),t.join(` · `)}function nv(e){switch(e.kind){case`read`:return D_.readFile;case`write`:return D_.writeFile;case`edit`:case`rename`:return D_.editFile;case`delete`:return D_.deleteFile;case`shell`:return D_.terminalSquare;case`shell-result`:return D_.terminal;case`capability`:case`batch`:return D_.skills;default:return D_.files}}function rv(e){switch(e.kind){case`read`:case`write`:case`edit`:case`rename`:case`delete`:case`shell`:case`shell-result`:case`capability`:case`batch`:return e.kind;default:return`tool`}}function iv(e){return e.bashPhase?e.bashPhase:e.status===`working`?`executing`:e.status===`error`?`error`:`done`}function av(e){if(e.state===`blocked`)return`Blocked`;switch(iv(e)){case`executing`:return`Running`;case`returned`:return`Returned`;case`done`:return`Done`;case`error`:return`Error`}}function ov(e){if(e!==void 0)return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(+(e<1e4))}s`}function sv(e){let t=$(`span`,{className:`chevron ${e?`expanded`:``}`,ariaHidden:`true`});return t.append(A_(D_.chevronDown)),t}function $(e,t={}){let n=document.createElement(e);return t.className&&(n.className=t.className),t.text!==void 0&&(n.textContent=t.text),t.type!==void 0&&`type`in n&&n.setAttribute(`type`,t.type),t.title!==void 0&&(n.title=t.title),t.ariaHidden!==void 0&&n.setAttribute(`aria-hidden`,t.ariaHidden),t.ariaLabel!==void 0&&n.setAttribute(`aria-label`,t.ariaLabel),t.ariaExpanded!==void 0&&n.setAttribute(`aria-expanded`,t.ariaExpanded),n}export{A_ as a,u_ as c,Ng as d,k_ as i,f_ as l,P_ as n,D_ as o,M_ as r,d_ as s,J_ as t,l_ as u};
111
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:M().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:M().optional().describe(`User's timezone in IANA format.`),userAgent:M().optional().describe(`Host application identifier.`),platform:B([U(`web`),U(`desktop`),U(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:R({touch:F().optional().describe(`Whether the device supports touch input.`),hover:F().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:R({top:P().describe(`Top safe area inset in pixels.`),right:P().describe(`Right safe area inset in pixels.`),bottom:P().describe(`Bottom safe area inset in pixels.`),left:P().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),i_=R({method:U(`ui/notifications/host-context-changed`),params:r_.describe(`Partial context update containing only changed fields.`)});R({method:U(`ui/update-model-context`),params:R({content:L(kh).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:V(M(),I().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),R({method:U(`ui/initialize`),params:R({appInfo:ym.describe(`App identification (name and version).`),appCapabilities:$g.describe(`Features and capabilities this app provides.`),protocolVersion:M().describe(`Protocol version this app supports.`)})});var a_=R({protocolVersion:M().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:ym.describe(`Host application identification and version.`),hostCapabilities:Qg.describe(`Features and capabilities provided by the host.`),hostContext:r_.describe(`Rich context about the host environment.`)}).passthrough(),o_={target:`draft-2020-12`};async function s_(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](o_);if(n.vendor===`zod`){let{z:n}=await Ng(async()=>{let{z:e}=await Promise.resolve().then(()=>qp);return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function c_(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function l_(e){let t=document.documentElement;t.setAttribute(`data-theme`,e),t.style.colorScheme=e}function u_(e,t=document.documentElement){for(let[n,r]of Object.entries(e))r!==void 0&&t.style.setProperty(n,r)}function d_(e){if(document.getElementById(`__mcp-host-fonts`))return;let t=document.createElement(`style`);t.id=`__mcp-host-fonts`,t.textContent=e,document.head.appendChild(t)}var f_=class e extends Pg{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:Gg,toolinputpartial:Kg,toolresult:n_,toolcancelled:qg,hostcontextchanged:i_};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||l({jitless:!0}),this.setRequestHandler(km,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=kg(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await c_(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await c_(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await s_(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await s_(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(Xg,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(Bh,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(Ih,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){switch(e){case`sampling/createMessage`:if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},Rh,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},lh,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},rh,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?ng:tg;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},Hg,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},mm,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},Bg,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},Vg,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},e_,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new Ig(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Fg}},a_,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}},p_={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},m_=([e,t,n])=>{let r=document.createElementNS(`http://www.w3.org/2000/svg`,e);return Object.keys(t).forEach(e=>{r.setAttribute(e,String(t[e]))}),n?.length&&n.forEach(e=>{let t=m_(e);r.appendChild(t)}),r},h_=(e,t={})=>m_([`svg`,{...p_,...t},e]),g_=[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`}]],__=[[`path`,{d:`M12 8V4H8`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}],[`path`,{d:`M2 14h2`}],[`path`,{d:`M20 14h2`}],[`path`,{d:`M15 13v2`}],[`path`,{d:`M9 13v2`}]],v_=[[`path`,{d:`m6 9 6 6 6-6`}]],y_=[[`circle`,{cx:`12`,cy:`12`,r:`10`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`}]],b_=[[`path`,{d:`M12 20v2`}],[`path`,{d:`M12 2v2`}],[`path`,{d:`M17 20v2`}],[`path`,{d:`M17 2v2`}],[`path`,{d:`M2 12h2`}],[`path`,{d:`M2 17h2`}],[`path`,{d:`M2 7h2`}],[`path`,{d:`M20 12h2`}],[`path`,{d:`M20 17h2`}],[`path`,{d:`M20 7h2`}],[`path`,{d:`M7 20v2`}],[`path`,{d:`M7 2v2`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`}]],x_=[[`path`,{d:`M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`m14 20 2 2 4-4`}]],S_=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M9 10h6`}],[`path`,{d:`M12 13V7`}],[`path`,{d:`M9 17h6`}]],C_=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M9 15h6`}]],w_=[[`path`,{d:`M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z`}],[`path`,{d:`M14.487 7.858A1 1 0 0 1 14 7V2`}],[`path`,{d:`M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516`}],[`path`,{d:`M8 18h1`}]],T_=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M9 15h6`}],[`path`,{d:`M12 18v-6`}]],E_=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`}],[`path`,{d:`M10 9H8`}],[`path`,{d:`M16 13H8`}],[`path`,{d:`M16 17H8`}]],D_={agents:__,base:[[`circle`,{cx:`12`,cy:`12`,r:`3`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`}]],chevronDown:v_,deleteFile:C_,diff:S_,editFile:w_,files:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`}]],folderOpen:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`}]],folderTree:[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`}]],gitBranch:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`}],[`circle`,{cx:`18`,cy:`6`,r:`3`}],[`circle`,{cx:`6`,cy:`18`,r:`3`}]],instructions:E_,instructionAvailable:E_,instructionLoaded:x_,loading:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}]],providers:b_,readFile:E_,search:[[`path`,{d:`m21 21-4.34-4.34`}],[`circle`,{cx:`11`,cy:`11`,r:`8`}]],skills:g_,sourceCheckout:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`}],[`circle`,{cx:`13`,cy:`12`,r:`2`}],[`circle`,{cx:`20`,cy:`19`,r:`2`}]],terminal:[[`path`,{d:`M12 19h8`}],[`path`,{d:`m4 17 6-6-6-6`}]],terminalSquare:[[`path`,{d:`m7 11 2-2-2-2`}],[`path`,{d:`M11 13h4`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`}]],warning:y_,writeFile:T_},O_={claude:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='257'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20257'%3e%3cpath%20fill='%23D97757'%20d='m50.228%20170.321%2050.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0%20125.796l.583-3.759%205.12-3.434%207.324.648%2016.202%201.101%2024.304%201.685%2017.629%201.037%2026.118%202.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758%207-7.713%209.397.649%202.398.648%209.527%207.323%2020.35%2015.75L94.817%2091.9l3.889%203.24%201.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42%200%2082.05%201.426l4.472%203.888%206.61%2015.101%2010.694%2023.786%2016.591%2032.34%204.861%209.592%202.592%208.879.973%202.722h1.685v-1.556l1.36-18.211%202.528-22.36%202.463-28.776.843-8.1%204.018-9.722%207.971-5.25%206.222%202.981%205.12%207.324-.713%204.73-3.046%2019.768-5.962%2030.98-3.889%2020.739h2.268l2.593-2.593%2010.499-13.934%2017.628-22.036%207.778-8.749%209.073-9.657%205.833-4.601h11.018l8.1%2012.055-3.628%2012.443-11.342%2014.388-9.398%2012.184-13.48%2018.147-8.426%2014.518.778%201.166%202.01-.194%2030.46-6.481%2016.462-2.982%2019.637-3.37%208.88%204.148.971%204.213-3.5%208.62-20.998%205.184-24.628%204.926-36.682%208.685-.454.324.519.648%2016.526%201.555%207.065.389h17.304l32.21%202.398%208.426%205.574%205.055%206.805-.843%205.184-12.962%206.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666%2011.406%2021.387%2019.314%2026.767%2024.887%201.36%206.157-3.434%204.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73%206.935%2025.017%2037.59%201.296%2011.536-1.814%203.76-6.481%202.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194%2077.448-3.37%203.953-7.778%202.981-6.48-4.925-3.436-7.972%203.435-15.749%204.148-20.544%203.37-16.333%203.046-20.285%201.815-6.74-.13-.454-1.49.194-15.295%2020.999-23.267%2031.433-18.406%2019.702-4.407%201.75-7.648-3.954.713-7.064%204.277-6.286%2025.47-32.405%2015.36-20.092%209.917-11.6-.065-1.686h-.583L44.07%20198.125l-12.055%201.555-5.185-4.86.648-7.972%202.463-2.593%2020.35-13.999-.064.065Z'/%3e%3c/svg%3e`,``+import.meta.url).href,codex:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='260'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20260'%3e%3cpath%20fill='%23fff'%20d='M239.184%20106.203a64.716%2064.716%200%200%200-5.576-53.103C219.452%2028.459%20191%2015.784%20163.213%2021.74A65.586%2065.586%200%200%200%2052.096%2045.22a64.716%2064.716%200%200%200-43.23%2031.36c-14.31%2024.602-11.061%2055.634%208.033%2076.74a64.665%2064.665%200%200%200%205.525%2053.102c14.174%2024.65%2042.644%2037.324%2070.446%2031.36a64.72%2064.72%200%200%200%2048.754%2021.744c28.481.025%2053.714-18.361%2062.414-45.481a64.767%2064.767%200%200%200%2043.229-31.36c14.137-24.558%2010.875-55.423-8.083-76.483Zm-97.56%20136.338a48.397%2048.397%200%200%201-31.105-11.255l1.535-.87%2051.67-29.825a8.595%208.595%200%200%200%204.247-7.367v-72.85l21.845%2012.636c.218.111.37.32.409.563v60.367c-.056%2026.818-21.783%2048.545-48.601%2048.601Zm-104.466-44.61a48.345%2048.345%200%200%201-5.781-32.589l1.534.921%2051.722%2029.826a8.339%208.339%200%200%200%208.441%200l63.181-36.425v25.221a.87.87%200%200%201-.358.665l-52.335%2030.184c-23.257%2013.398-52.97%205.431-66.404-17.803ZM23.549%2085.38a48.499%2048.499%200%200%201%2025.58-21.333v61.39a8.288%208.288%200%200%200%204.195%207.316l62.874%2036.272-21.845%2012.636a.819.819%200%200%201-.767%200L41.353%20151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466%2041.695-63.08-36.63L161.73%2077.86a.819.819%200%200%201%20.768%200l52.233%2030.184a48.6%2048.6%200%200%201-7.316%2087.635v-61.391a8.544%208.544%200%200%200-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39%208.39%200%200%200-8.492%200L99.98%2099.808V74.587a.716.716%200%200%201%20.307-.665l52.233-30.133a48.652%2048.652%200%200%201%2072.236%2050.391v.205ZM88.061%20139.097l-21.845-12.585a.87.87%200%200%201-.41-.614V65.685a48.652%2048.652%200%200%201%2079.757-37.346l-1.535.87-51.67%2029.825a8.595%208.595%200%200%200-4.246%207.367l-.051%2072.697Zm11.868-25.58%2028.138-16.217%2028.188%2016.218v32.434l-28.086%2016.218-28.188-16.218-.052-32.434Z'/%3e%3c/svg%3e`,``+import.meta.url).href,copilot:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20preserveAspectRatio='xMidYMid'%20viewBox='0%200%20256%20208'%3e%3cpath%20fill='%23fff'%20d='M205.3%2031.4c14%2014.8%2020%2035.2%2022.5%2063.6%206.6%200%2012.8%201.5%2017%207.2l7.8%2010.6c2.2%203%203.4%206.6%203.4%2010.4v28.7a12%2012%200%200%201-4.8%209.5C215.9%20187.2%20172.3%20208%20128%20208c-49%200-98.2-28.3-123.2-46.6a12%2012%200%200%201-4.8-9.5v-28.7c0-3.8%201.2-7.4%203.4-10.5l7.8-10.5c4.2-5.7%2010.4-7.2%2017-7.2%202.5-28.4%208.4-48.8%2022.5-63.6C77.3%203.2%20112.6%200%20127.6%200h.4c14.7%200%2050.4%202.9%2077.3%2031.4ZM128%2078.7c-3%200-6.5.2-10.3.6a27.1%2027.1%200%200%201-6%2012.1%2045%2045%200%200%201-32%2013c-6.8%200-13.9-1.5-19.7-5.2-5.5%201.9-10.8%204.5-11.2%2011-.5%2012.2-.6%2024.5-.6%2036.8%200%206.1%200%2012.3-.2%2018.5%200%203.6%202.2%206.9%205.5%208.4C79.9%20185.9%20105%20192%20128%20192s48-6%2074.5-18.1a9.4%209.4%200%200%200%205.5-8.4c.3-18.4%200-37-.8-55.3-.4-6.6-5.7-9.1-11.2-11-5.8%203.7-13%205.1-19.7%205.1a45%2045%200%200%201-32-12.9%2027.1%2027.1%200%200%201-6-12.1c-3.4-.4-6.9-.5-10.3-.6Zm-27%2044c5.8%200%2010.5%204.6%2010.5%2010.4v19.2a10.4%2010.4%200%200%201-20.8%200V133c0-5.8%204.6-10.4%2010.4-10.4Zm53.4%200c5.8%200%2010.4%204.6%2010.4%2010.4v19.2a10.4%2010.4%200%200%201-20.8%200V133c0-5.8%204.7-10.4%2010.4-10.4Zm-73-94.4c-11.2%201.1-20.6%204.8-25.4%2010-10.4%2011.3-8.2%2040.1-2.2%2046.2A31.2%2031.2%200%200%200%2075%2091.7c6.8%200%2019.6-1.5%2030.1-12.2%204.7-4.5%207.5-15.7%207.2-27-.3-9.1-2.9-16.7-6.7-19.9-4.2-3.6-13.6-5.2-24.2-4.3Zm69%204.3c-3.8%203.2-6.4%2010.8-6.7%2019.9-.3%2011.3%202.5%2022.5%207.2%2027a41.7%2041.7%200%200%200%2030%2012.2c8.9%200%2017-2.9%2021.3-7.2%206-6.1%208.2-34.9-2.2-46.3-4.8-5-14.2-8.8-25.4-9.9-10.6-1-20%20.7-24.2%204.3ZM128%2056c-2.6%200-5.6.2-9%20.5.4%201.7.5%203.7.7%205.7%200%201.5%200%203-.2%204.5%203.2-.3%206-.3%208.5-.3%202.6%200%205.3%200%208.5.3-.2-1.6-.2-3-.2-4.5.2-2%20.3-4%20.7-5.7-3.4-.3-6.4-.5-9-.5Z'/%3e%3c/svg%3e`,``+import.meta.url).href,cursor:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20466.73%20532.09'%3e%3cpath%20fill='%23edecec'%20d='M457.43%20125.94%20244.42%202.96c-6.84-3.95-15.28-3.95-22.12%200L9.3%20125.94c-5.75%203.32-9.3%209.46-9.3%2016.11v247.99c0%206.65%203.55%2012.79%209.3%2016.11l213.01%20122.98c6.84%203.95%2015.28%203.95%2022.12%200l213.01-122.98c5.75-3.32%209.3-9.46%209.3-16.11V142.05c0-6.65-3.55-12.79-9.3-16.11ZM444.05%20151.99%20238.42%20508.15c-1.39%202.4-5.06%201.42-5.06-1.36V273.58c0-4.66-2.49-8.97-6.53-11.31L24.87%20145.67c-2.4-1.39-1.42-5.06%201.36-5.06h411.26c5.84%200%209.49%206.33%206.57%2011.39Z'/%3e%3c/svg%3e`,``+import.meta.url).href,opencode:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%3e%3crect%20width='512'%20height='512'%20fill='%23131010'/%3e%3cpath%20d='M320%20224v128H192V224h128Z'%20fill='%235A5858'/%3e%3cpath%20fill='%23fff'%20fill-rule='evenodd'%20d='M384%20416H128V96h256v320ZM320%20160H192v192h128V160Z'%20clip-rule='evenodd'/%3e%3c/svg%3e`,``+import.meta.url).href,pi:new URL(`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20800'%3e%3cpath%20fill='%23fff'%20fill-rule='evenodd'%20d='M165.29%20165.29h352.07V400H400v117.36H282.65v117.36H165.29V165.29Zm117.36%20117.36V400H400V282.65H282.65Z'/%3e%3cpath%20fill='%23fff'%20d='M517.36%20400h117.36v234.72H517.36z'/%3e%3c/svg%3e`,``+import.meta.url).href};function k_(e){return O_[e.trim().toLowerCase()]}function A_(e,t=`icon-svg`){return h_(e,{class:t,"aria-hidden":`true`})}var j_=`forgerelay/activityPanelDefaultExpanded`,M_=`forgerelay/activityPanelWorkspace`;function N_(e,t,n){return!n||e!==`working`?null:t<=0?1e3:t===1?2e3:t===2?5e3:1e4}function P_(e){return J_(e)?e[j_]===!0:!1}function F_(e,t){return I_(t)?`activity`:e?`preserve-panel`:`tool-card`}function I_(e){return J_(e)?typeof e.turnId==`string`&&K_(e.revision)&&typeof e.changed==`boolean`&&W_(e.state):!1}function L_(e){return!I_(e)||!J_(e)||!Array.isArray(e.activities)?!1:e.activities.every(U_)}function R_(e){return!J_(e)||!U_(e.activity)?!1:e.error===void 0||typeof e.error==`string`}function z_(e){return!J_(e)||typeof e.outputId!=`string`||typeof e.activityId!=`string`||!q_(e.processId)||typeof e.command!=`string`||typeof e.output!=`string`||!K_(e.cursor)||e.status!==`running`&&e.status!==`done`&&e.status!==`failed`||typeof e.timedOut!=`boolean`||typeof e.startedAt!=`string`||e.exitCode!==void 0&&!Number.isInteger(e.exitCode)||e.signal!==void 0&&typeof e.signal!=`string`?!1:e.finishedAt===void 0||typeof e.finishedAt==`string`}function B_(e,t){if(!t.changed)return e;let n=new Map(t.activities.map(e=>[e.activityId,e])),r=e.map(e=>n.get(e.activityId)??e),i=new Set(e.map(e=>e.activityId));for(let e of t.activities)i.has(e.activityId)||r.push(e);return r}function V_(e){let t=new Set(e.map(e=>e.activityId)),n=new Map;for(let r of e){if(!r.parentActivityId||!t.has(r.parentActivityId))continue;let e=n.get(r.parentActivityId)??[];e.push(r),n.set(r.parentActivityId,e)}return e.flatMap(e=>e.parentActivityId&&t.has(e.parentActivityId)?[]:[{activity:e,children:n.get(e.activityId)??[]}])}function H_(e,t=24){return e.scrollHeight-e.clientHeight-e.scrollTop<=t}function U_(e){return!J_(e)||e.member!==void 0&&typeof e.member!=`string`?!1:typeof e.activityId==`string`&&typeof e.tool==`string`&&typeof e.kind==`string`&&W_(e.status)&&G_(e.state)&&typeof e.title==`string`&&typeof e.target==`string`&&typeof e.detailAvailable==`boolean`&&typeof e.startedAt==`string`}function W_(e){return e===`working`||e===`done`||e===`error`}function G_(e){return e===`executing`||e===`returned`||e===`done`||e===`failed`||e===`blocked`}function K_(e){return typeof e==`number`&&Number.isInteger(e)&&e>=0}function q_(e){return typeof e==`number`&&Number.isInteger(e)&&e>0}function J_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Y_=1e3,X_=class{root;options;app=null;snapshot=null;activities=[];indexRevision;indexLoading=!1;indexInFlight=!1;indexError=null;expanded=!1;refreshTimer=null;refreshInFlight=!1;refreshError=null;unchangedRefreshes=0;visibilityListenerAttached=!1;followTail=!0;scrollTop=0;selectedActivityId=null;details=new Map;detailLoading=new Set;detailErrors=new Map;outputs=new Map;outputLoading=new Set;outputErrors=new Map;outputRefreshTimer=null;handleVisibilityChange=()=>{if(document.hidden){this.stopRefresh(),this.stopOutputRefresh();return}this.snapshot&&(this.stopRefresh(),this.scheduleRefresh(0,!0));let e=this.activities.find(e=>e.activityId===this.selectedActivityId);e&&Z_(e)&&this.outputs.get(e.outputId)?.status===`running`&&this.scheduleOutputRefresh(e,0)};constructor(e,t={}){this.root=e,this.options=t}get active(){return this.snapshot!==null}accept(e){let t=e.structuredContent;if(!I_(t))return!1;let n=this.snapshot?.turnId!==t.turnId;return this.snapshot=t,this.refreshError=null,n?(this.unchangedRefreshes=0,this.expanded=P_(e._meta),this.followTail=!0,this.scrollTop=0,this.activities=[],this.indexRevision=void 0,this.indexError=null,this.resetDetails()):this.unchangedRefreshes=t.changed?0:this.unchangedRefreshes+1,this.stopRefresh(),this.scheduleRefresh(),this.expanded&&t.revision>0&&this.indexRevision!==t.revision&&this.loadIndex(!1),!0}attach(e){this.app=e,this.visibilityListenerAttached||=(document.addEventListener(`visibilitychange`,this.handleVisibilityChange),!0),this.scheduleRefresh()}clear(){this.stopRefresh(),this.snapshot=null,this.activities=[],this.indexRevision=void 0,this.indexLoading=!1,this.indexInFlight=!1,this.indexError=null,this.refreshError=null,this.unchangedRefreshes=0,this.expanded=!1,this.followTail=!0,this.scrollTop=0,this.resetDetails()}detach(){this.clear(),this.visibilityListenerAttached&&=(document.removeEventListener(`visibilitychange`,this.handleVisibilityChange),!1),this.app=null}render(){return this.snapshot?this.snapshot.revision===0?(this.root.replaceChildren(),!0):(this.renderPanel(this.snapshot),!0):!1}scheduleRefresh(e,t=!1){if(!this.app||!this.snapshot||this.refreshTimer!==null||document.hidden)return;let n=e??N_(this.snapshot.state,this.unchangedRefreshes,!0);if(!(!t&&n===null)&&n!==null){if(!this.app.getHostCapabilities()?.serverTools){this.refreshError=`Live Activity refresh is unavailable in this host.`,this.render();return}this.refreshTimer=window.setTimeout(()=>{this.refreshTimer=null,this.refreshSnapshot()},n)}}stopRefresh(){this.refreshTimer!==null&&(window.clearTimeout(this.refreshTimer),this.refreshTimer=null)}async refreshSnapshot(){if(!this.app||!this.snapshot||this.refreshInFlight)return;let e=this.snapshot.turnId,t=this.snapshot.revision;this.refreshInFlight=!0;try{let n=await this.app.callServerTool({name:`activity_snapshot`,arguments:{turnId:e,knownRevision:t}});if(n.isError)throw Error(`Activity snapshot refresh failed.`);let r=n.structuredContent;if(!I_(r)||r.turnId!==e)throw Error(`Activity snapshot refresh returned an invalid Host Turn state.`);if(!this.snapshot||this.snapshot.turnId!==e)return;let i=r.changed||this.refreshError!==null;this.snapshot=r,this.unchangedRefreshes=r.changed?0:this.unchangedRefreshes+1,this.refreshError=null,i&&this.render(),r.changed&&this.expanded&&r.revision>0&&this.loadIndex(!1)}catch(e){this.unchangedRefreshes+=1;let t=e instanceof Error?e.message:`Activity snapshot refresh failed.`;this.refreshError!==t&&(this.refreshError=t,this.render())}finally{this.refreshInFlight=!1,this.scheduleRefresh()}}async loadIndex(e){if(!this.app||!this.snapshot||!this.expanded||this.snapshot.revision===0||this.indexInFlight)return;let t=this.snapshot.turnId,n=this.indexRevision;this.indexInFlight=!0,e&&(this.indexLoading=!0,this.indexError=null,this.render());try{let e=await this.app.callServerTool({name:`activity_index`,arguments:{turnId:t,...n===void 0?{}:{knownRevision:n}}});if(e.isError)throw Error(`Activity index request failed.`);let r=e.structuredContent;if(!L_(r)||r.turnId!==t)throw Error(`Activity index returned an invalid Activity index.`);if(!this.snapshot||this.snapshot.turnId!==t)return;this.activities=B_(this.activities,r),this.indexRevision=r.revision,r.revision>=this.snapshot.revision&&(this.snapshot={turnId:r.turnId,revision:r.revision,changed:r.changed,state:r.state}),this.indexError=null}catch(e){if(!this.snapshot||this.snapshot.turnId!==t)return;this.indexError=e instanceof Error?e.message:`Activity index request failed.`}finally{this.indexLoading=!1,this.indexInFlight=!1,this.snapshot?.turnId===t&&this.render(),this.expanded&&this.snapshot?.turnId===t&&this.indexRevision!==void 0&&this.indexRevision!==this.snapshot.revision&&this.loadIndex(!1)}}resetDetails(){this.stopOutputRefresh(),this.selectedActivityId=null,this.details.clear(),this.detailLoading.clear(),this.detailErrors.clear(),this.outputs.clear(),this.outputLoading.clear(),this.outputErrors.clear()}toggleDetail(e){if(e.detailAvailable){if(this.stopOutputRefresh(),this.selectedActivityId===e.activityId){this.selectedActivityId=null,this.render();return}if(this.selectedActivityId=e.activityId,this.render(),Z_(e)){let t=this.outputs.get(e.outputId);t?.status===`running`&&this.scheduleOutputRefresh(e),!t&&!this.outputLoading.has(e.outputId)&&!this.outputErrors.has(e.outputId)&&this.loadOutput(e,!0);return}!this.details.has(e.activityId)&&!this.detailLoading.has(e.activityId)&&!this.detailErrors.has(e.activityId)&&this.loadDetail(e)}}async loadDetail(e){if(!this.app||!this.snapshot||!e.detailAvailable)return;let t=this.snapshot.turnId,n=e.activityId;this.detailLoading.add(n),this.detailErrors.delete(n),this.render();try{let e=await this.app.callServerTool({name:`activity_detail`,arguments:{turnId:t,activityId:n}});if(e.isError)throw Error(`Activity detail request failed.`);let r=e.structuredContent;if(!R_(r)||r.activity.activityId!==n)throw Error(`Activity detail returned an invalid Activity record.`);if(!this.snapshot||this.snapshot.turnId!==t)return;this.details.set(n,r)}catch(e){if(!this.snapshot||this.snapshot.turnId!==t)return;this.detailErrors.set(n,e instanceof Error?e.message:`Activity detail request failed.`)}finally{this.detailLoading.delete(n),this.snapshot?.turnId===t&&this.render()}}stopOutputRefresh(){this.outputRefreshTimer!==null&&(window.clearTimeout(this.outputRefreshTimer),this.outputRefreshTimer=null)}scheduleOutputRefresh(e,t=Y_){!Z_(e)||this.outputRefreshTimer!==null||document.hidden||this.selectedActivityId===e.activityId&&(this.outputRefreshTimer=window.setTimeout(()=>{this.outputRefreshTimer=null,this.selectedActivityId===e.activityId&&this.loadOutput(e,!1)},t))}async loadOutput(e,t){if(!this.app||!this.snapshot||!Z_(e))return;let n=this.snapshot.turnId,r=e.outputId;t&&this.outputLoading.add(r),this.outputErrors.delete(r),t&&this.render();let i=!1;try{let e=this.outputs.get(r),t=await this.app.callServerTool({name:`activity_output`,arguments:{turnId:n,outputId:r,...e?{cursor:e.cursor}:{}}});if(t.isError)throw Error(`Bash output request failed.`);let a=t.structuredContent;if(!z_(a)||a.outputId!==r)throw Error(`Bash output returned an invalid durable output record.`);if(e&&a.cursor<e.cursor)throw Error(`Bash output cursor moved backwards.`);if(!this.snapshot||this.snapshot.turnId!==n)return;this.outputs.set(r,e?{...a,output:e.output+a.output}:a),i=a.status===`running`}catch(e){if(!this.snapshot||this.snapshot.turnId!==n)return;this.outputErrors.set(r,e instanceof Error?e.message:`Bash output request failed.`)}finally{this.outputLoading.delete(r),this.snapshot?.turnId===n&&this.render(),i&&this.selectedActivityId===e.activityId&&this.scheduleOutputRefresh(e)}}renderActivityEntry(e,t){let n=this.selectedActivityId===e.activityId,r=$(`div`,{className:`activity-entry${n?` expanded`:``}`});return r.append($_(e,t,n,e.detailAvailable?()=>this.toggleDetail(e):void 0)),n&&r.append(this.renderActivityDetail(e)),r}renderActivityDetail(e){if(Z_(e))return this.renderBashOutput(e);let t=$(`div`,{className:`activity-detail`}),n=e.activityId;if(this.detailLoading.has(n))return t.append($(`div`,{className:`activity-detail-status`,text:`Loading details...`})),t;let r=this.detailErrors.get(n);if(r)return t.append($(`div`,{className:`activity-detail-status error`,text:r})),t;let i=this.details.get(n);return i?(i.error&&ev(t,`Error`,i.error,!0),i.request!==void 0&&ev(t,`Request`,i.request),i.result!==void 0&&ev(t,`Result`,i.result),t.childElementCount===0&&t.append($(`div`,{className:`activity-detail-status`,text:`No additional details.`})),t):(t.append($(`div`,{className:`activity-detail-status`,text:`Details unavailable.`})),t)}renderBashOutput(e){let t=$(`div`,{className:`activity-detail activity-terminal`}),n=e.outputId;if(this.outputLoading.has(n))return t.append($(`div`,{className:`activity-detail-status`,text:`Loading terminal output...`})),t;let r=this.outputErrors.get(n);if(r)return t.append($(`div`,{className:`activity-detail-status error`,text:r})),t;let i=this.outputs.get(n);return i?(t.append($(`pre`,{className:`activity-terminal-command`,text:i.command}),$(`pre`,{className:`activity-terminal-output pretty-scrollbar`,text:i.output||`(no output)`}),$(`div`,{className:`activity-terminal-meta status-${i.status}`,text:Q_(i)})),t):(t.append($(`div`,{className:`activity-detail-status`,text:`Terminal output unavailable.`})),t)}renderPanel(e){let t=this.root.querySelector(`.activity-viewport`);t&&(this.scrollTop=t.scrollTop);let n=$(`section`,{className:`activity-panel state-${e.state}`}),r=$(`button`,{className:`activity-panel-header`,type:`button`,ariaExpanded:String(this.expanded)});r.addEventListener(`click`,()=>{this.expanded=!this.expanded,this.expanded||this.stopOutputRefresh(),this.render(),this.expanded&&e.revision>0&&this.indexRevision!==e.revision&&this.loadIndex(!0)});let i=$(`span`,{className:`activity-panel-status state-${e.state}`,ariaHidden:`true`}),a=$(`span`,{className:`activity-panel-title-group`});a.append($(`span`,{className:`activity-panel-title`,text:`Activity`}),$(`span`,{className:`activity-panel-subtitle`,text:`Host Turn · revision ${e.revision}`}));let o=this.activities.length,s=$(`span`,{className:`activity-panel-count state-${e.state}`,text:this.expanded&&this.indexRevision!==void 0?`${o} ${o===1?`activity`:`activities`}`:sv(e.state)});if(r.append(i,a,s,uv(this.expanded)),n.append(r),this.expanded){let e=$(`div`,{className:`activity-panel-body`}),t=$(`div`,{className:`activity-viewport pretty-scrollbar`,ariaLabel:`ForgeRelay Activity Panel`});t.addEventListener(`scroll`,()=>{this.scrollTop=t.scrollTop,this.followTail=H_(t)});let r=V_(this.activities);if(this.indexLoading&&this.indexRevision===void 0)t.append($(`div`,{className:`activity-empty`,text:`Loading Activity index...`}));else if(this.indexError)t.append($(`div`,{className:`activity-empty error`,text:this.indexError}));else if(r.length===0)t.append($(`div`,{className:`activity-empty`,text:`Waiting for ForgeRelay activity...`}));else{let e=$(`div`,{className:`activity-list`});for(let t of r){let n=$(`div`,{className:`activity-group${t.children.length>0?` grouped`:``}`});if(n.append(this.renderActivityEntry(t.activity,!1)),t.children.length>0){let e=$(`div`,{className:`activity-children`});for(let n of t.children)e.append(this.renderActivityEntry(n,!0));n.append(e)}e.append(n)}t.append(e)}this.refreshError&&e.append($(`div`,{className:`activity-refresh-error`,text:this.refreshError})),e.prepend(t),n.append(e),this.replacePanel(n),this.followTail?(t.scrollTop=t.scrollHeight,this.scrollTop=t.scrollTop):t.scrollTop=Math.min(this.scrollTop,Math.max(0,t.scrollHeight-t.clientHeight));return}this.replacePanel(n)}replacePanel(e){if(this.options.embedded){this.root.replaceChildren(e);return}let t=$(`main`,{className:`shell`});t.append(e),this.root.replaceChildren(t)}};function Z_(e){return(e.kind===`shell`||e.kind===`shell-result`)&&typeof e.outputId==`string`&&e.outputId.length>0}function Q_(e){let t=[`Process ${e.processId}`,e.status];return e.timedOut?t.push(`timed out`):e.signal?t.push(`signal ${e.signal}`):e.exitCode!==void 0&&t.push(`exit ${e.exitCode}`),t.join(` · `)}function $_(e,t,n,r){let i=r?$(`button`,{className:[`activity-row`,`interactive`,t?`child`:`parent`,`kind-${av(e)}`,`phase-${ov(e)}`,e.kind===`shell-result`?`shell-result`:void 0].filter(Boolean).join(` `),type:`button`,ariaExpanded:String(n)}):$(`div`,{className:[`activity-row`,t?`child`:`parent`,`kind-${av(e)}`,`phase-${ov(e)}`,e.kind===`shell-result`?`shell-result`:void 0].filter(Boolean).join(` `)});r&&i.addEventListener(`click`,r),i.dataset.activityId=e.activityId;let a=$(`span`,{className:`activity-icon`,ariaHidden:`true`});a.append(A_(iv(e),`activity-icon-svg`));let o=$(`span`,{className:`activity-main`}),s=$(`span`,{className:`activity-title-line`});s.append($(`span`,{className:`activity-title`,text:e.title})),e.member&&s.append($(`span`,{className:`activity-member`,text:e.member,title:`Composite member: ${e.member}`})),s.append($(`span`,{className:`activity-target`,text:e.target,title:e.target})),o.append(s),e.children&&o.append(nv(e.children));let c=$(`span`,{className:`activity-meta`}),l=$(`span`,{className:`activity-phase`,text:cv(e)}),u=lv(e.durationMs);c.append(l),u&&c.append($(`span`,{className:`activity-duration`,text:u}));let d=e.detailAvailable?uv(n):$(`span`,{className:`activity-detail-spacer`,ariaHidden:`true`});return d.classList.add(`activity-detail-chevron`),i.append(a,o,c,d),i}function ev(e,t,n,r=!1){let i=$(`section`,{className:`activity-detail-section${r?` error`:``}`});i.append($(`div`,{className:`activity-detail-label`,text:t}),$(`pre`,{className:`activity-detail-value pretty-scrollbar`,text:tv(n)})),e.append(i)}function tv(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)??String(e)}catch{return String(e)}}function nv(e){let t=$(`span`,{className:`activity-progress-wrap`}),n=$(`span`,{className:`activity-progress-counts`,text:rv(e)}),r=$(`span`,{className:`activity-progress-track`,ariaHidden:`true`}),i=$(`span`,{className:`activity-progress-fill`}),a=e.done+e.error;return i.style.width=`${e.total>0?Math.min(100,a/e.total*100):0}%`,r.append(i),t.append(n,r),t}function rv(e){let t=[`${e.done+e.error}/${e.total}`];return e.working>0&&t.push(`${e.working} running`),e.error>0&&t.push(`${e.error} failed`),t.join(` · `)}function iv(e){switch(e.kind){case`read`:return D_.readFile;case`write`:return D_.writeFile;case`edit`:case`rename`:return D_.editFile;case`delete`:return D_.deleteFile;case`shell`:return D_.terminalSquare;case`shell-result`:return D_.terminal;case`capability`:case`batch`:return D_.skills;default:return D_.files}}function av(e){switch(e.kind){case`read`:case`write`:case`edit`:case`rename`:case`delete`:case`shell`:case`shell-result`:case`capability`:case`batch`:return e.kind;default:return`tool`}}function ov(e){return e.bashPhase?e.bashPhase:e.status===`working`?`executing`:e.status===`error`?`error`:`done`}function sv(e){switch(e){case`working`:return`Working`;case`done`:return`Done`;case`error`:return`Error`}}function cv(e){if(e.state===`blocked`)return`Blocked`;switch(ov(e)){case`executing`:return`Running`;case`returned`:return`Returned`;case`done`:return`Done`;case`error`:return`Error`}}function lv(e){if(e!==void 0)return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(+(e<1e4))}s`}function uv(e){let t=$(`span`,{className:`chevron ${e?`expanded`:``}`,ariaHidden:`true`});return t.append(A_(D_.chevronDown)),t}function $(e,t={}){let n=document.createElement(e);return t.className&&(n.className=t.className),t.text!==void 0&&(n.textContent=t.text),t.type!==void 0&&`type`in n&&n.setAttribute(`type`,t.type),t.title!==void 0&&(n.title=t.title),t.ariaHidden!==void 0&&n.setAttribute(`aria-hidden`,t.ariaHidden),t.ariaLabel!==void 0&&n.setAttribute(`aria-label`,t.ariaLabel),t.ariaExpanded!==void 0&&n.setAttribute(`aria-expanded`,t.ariaExpanded),n}export{A_ as a,u_ as c,Ng as d,k_ as i,f_ as l,F_ as n,D_ as o,M_ as r,d_ as s,X_ as t,l_ as u};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./heavy-payload-CeW-n9w5.js","./scrollbar-C2twAENW.js","./chunk-EyZ2wyi3.js","./workspace-app-CwbJnb_w.js","./workspace-app-YnUST8IP.css","./review-payload-B9CO298v.js"])))=>i.map(i=>d[i]);
2
- import{a as e,c as t,d as n,i as r,l as i,n as a,o,s,t as c,u as l}from"./workspace-app-CwbJnb_w.js";function u(e){return e===`open_workspace`||e===`close_workspace`||e===`capability`||e===`apply_patch`||e===`exec_command`||e===`write_stdin`||e===`read`||e===`write`||e===`edit`||e===`rename`||e===`delete`||e===`grep`||e===`glob`||e===`ls`||e===`bash`}function d(e){return e===`read`}function f(e){return e===`write`}function p(e){return e===`edit`}function m(e){return e===`apply_patch`}function ee(e){return e===`bash`||e===`exec_command`||e===`write_stdin`}function h(e){return e.tool===`capability`&&e.capabilityName===`review.changes`}function te(e){return!!(e&&typeof e==`object`)}function ne(e){return e?.content?.map(e=>e.type===`text`?e.text??``:`[${e.mimeType??`image`} image payload]`).filter(Boolean).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./heavy-payload-CgzrutLm.js","./scrollbar-CbhpdW05.js","./chunk-EyZ2wyi3.js","./workspace-app-CxwJuZyS.js","./workspace-app-ldjBmCJR.css","./review-payload-BrLbezbq.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,c as t,d as n,i as r,l as i,n as a,o,s,t as c,u as l}from"./workspace-app-CxwJuZyS.js";function u(e){return e===`open_workspace`||e===`close_workspace`||e===`capability`||e===`apply_patch`||e===`exec_command`||e===`write_stdin`||e===`read`||e===`write`||e===`edit`||e===`rename`||e===`delete`||e===`grep`||e===`glob`||e===`ls`||e===`bash`}function d(e){return e===`read`}function f(e){return e===`write`}function p(e){return e===`edit`}function m(e){return e===`apply_patch`}function ee(e){return e===`bash`||e===`exec_command`||e===`write_stdin`}function h(e){return e.tool===`capability`&&e.capabilityName===`review.changes`}function te(e){return!!(e&&typeof e==`object`)}function ne(e){return e?.content?.map(e=>e.type===`text`?e.text??``:`[${e.mimeType??`image`} image payload]`).filter(Boolean).join(`
3
3
 
4
- `)??``}function g(e,t){let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function _(e){return e.tool===`open_workspace`?Number(e.summary?.agentsFiles??0)>0||Number(e.summary?.skills??0)>0||Number(e.summary?.agentProviders??0)>0||Number(e.summary?.agents??0)>0||!!e.agentsFiles?.length||!!e.availableAgentsFiles?.length||!!e.skills?.length||!!e.agentProviders?.length||!!e.agents?.length||!!e.worktree||!!e.instruction:h(e)?!!(e.files?.length||e.payload?.patch):m(e.tool)?!!e.payload?.patch:!!e.payload}function re(e){return e.tool===`open_workspace`||h(e)?_(e):m(e.tool)?e.files?.length===1&&_(e):!1}var ie={added:`Added`,edited:`Edited`,deleted:`Deleted`,renamed:`Renamed`,"renamed-edited":`Renamed and edited`};function ae(e,t={}){let n=e.files??[],r=le(n);if(r===0)return{title:t.emptyTitle??`Applied patch`,tone:`edit`};let i=new Set(n.map(v)),a=i.size===1?[...i][0]:void 0,o={title:ue(a,r),tone:de(a)};return a&&a!==`unknown`&&(o.iconKind=a),o}function v(e){switch(e.operation){case`add`:return`added`;case`update`:return`edited`;case`delete`:return`deleted`;case`move`:return`renamed`}switch(e.type){case`new`:return`added`;case`change`:return`edited`;case`deleted`:return`deleted`;case`rename-pure`:return`renamed`;case`rename-changed`:return`renamed-edited`;default:return`unknown`}}function oe(e,t,n){let r=v(t);if(r!==`edited`&&r!==`unknown`)return r;let i=e[n];return i?.operation===`move`&&(!t.path||i.path===t.path)||e.find(e=>e.operation===`move`&&e.path===t.path&&(!t.previousPath||e.previousPath===t.previousPath))?`renamed`:r===`edited`?`edited`:i?v(i):`unknown`}function y(e){let t=e.path??e.previousPath;if(!t)return;let n=e.previousPath;if(!n||n===t)return{current:t,title:t};let r=x(n)===x(t);return{current:r?S(t):t,previous:r?S(n):n,title:`${n} → ${t}`}}function se(e,t,n){let r=e[n],i=(r?.path===t.path?r:e.find(e=>e.path===t.path&&(!t.previousPath||!e.previousPath||e.previousPath===t.previousPath)))??r;return y({path:t.path??i?.path,previousPath:t.previousPath??i?.previousPath})}function ce(e){return e===`unknown`?`Changed`:ie[e]}function le(e){let t=new Set,n=0;for(let r of e){let e=r.path??r.previousPath;e?t.add(e):n+=1}return t.size+n}function ue(e,t){return e&&e!==`unknown`?`${ie[e]} ${t} ${b(t)}`:`Changed ${t} ${b(t)}`}function de(e){return e===`added`?`write`:e===`deleted`?`delete`:`edit`}function b(e){return e===1?`file`:`files`}function x(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t===-1?``:e.slice(0,t)}function S(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t===-1?e:e.slice(t+1)}function fe(e){switch(e.tool){case`open_workspace`:return{icon:e.mode===`worktree`?o.gitBranch:o.folderOpen,title:he(e),label:e.kind===`composite`?e.name:e.root??e.path,tone:`workspace`};case`close_workspace`:return{icon:e.mode===`worktree`?o.gitBranch:o.folderOpen,title:e.kind===`composite`?`Dissolved composite workspace`:`Closed workspace`,label:e.kind===`composite`?e.name??e.workspaceId:e.sourceRoot??e.root??e.path??e.workspaceId,tone:`workspace`};case`read`:return{icon:o.readFile,title:`Read file`,label:e.path,tone:`read`};case`write`:return{icon:o.writeFile,title:`Wrote file`,label:e.path,tone:`write`};case`edit`:return{icon:o.editFile,title:`Edited file`,label:e.path,tone:`edit`};case`rename`:return{icon:o.editFile,title:`Renamed path`,label:e.path,tone:`edit`};case`delete`:return{icon:o.deleteFile,title:`Deleted path`,label:e.path,tone:`delete`};case`apply_patch`:{let t=ae(e);return{icon:me(t.iconKind),title:t.title,label:C(e),tone:t.tone}}case`grep`:return{icon:o.search,title:`Searched files`,label:ge(e),tone:`search`};case`glob`:return{icon:o.files,title:`Found files`,label:ge(e),tone:`search`};case`ls`:return{icon:o.folderTree,title:`Listed directory`,label:e.path,tone:`directory`};case`bash`:case`exec_command`:return{icon:o.terminalSquare,title:_e(e,`command`),label:w(e),tone:`shell`,state:ve(e)};case`write_stdin`:return{icon:o.terminal,title:_e(e,`process`),label:w(e),tone:`shell`,state:ve(e)};case`capability`:if(h(e)){let t=ae(e,{emptyTitle:`Changes ready`}),n=e.files?.length??0;return{icon:o.diff,title:n>0||e.payload?.patch?t.title:`No changes`,label:C(e),tone:`review`}}return{icon:o.skills,title:e.capabilityName?`Capability: ${e.capabilityName}`:`Capability completed`,tone:`workspace`}}}function pe(e){let t=e.summary??{};if(h(e)||m(e.tool)||p(e.tool)||f(e.tool))return{kind:`diff`,additions:g(t,`additions`)??0,removals:g(t,`removals`)??0};if(e.tool===`open_workspace`){let e=[T(g(t,`agentsFiles`),`instruction`),T(g(t,`skills`),`skill`)].filter(e=>!!e);return e.length>0?{kind:`text`,text:e.join(` · `)}:{kind:`empty`}}if(ee(e.tool)){let e=[T(g(t,`lines`),`line`),ye(g(t,`wallTimeMs`))].filter(e=>!!e);return e.length>0?{kind:`text`,text:e.join(` · `)}:{kind:`empty`}}if(e.tool===`grep`||e.tool===`read`||e.tool===`ls`){let e=T(g(t,`lines`),`line`);return e?{kind:`text`,text:e}:{kind:`empty`}}return{kind:`empty`}}function me(e){return e===`added`?o.writeFile:e===`deleted`?o.deleteFile:e===`renamed`||e===`renamed-edited`?o.files:o.editFile}function he(e){return e.kind===`composite`?`${e.workspaceReused?`Reused`:`Opened`} composite workspace`:`${e.workspaceReused?`Reused`:`Opened`} workspace`}function C(e){if(e.files?.length===1)return y(e.files[0])?.title??e.path}function ge(e){let t=e.summary?.pattern,n=e.summary?.scope;return typeof t==`string`?typeof n==`string`&&n!==`.`?`${t} in ${n}`:t:e.path}function _e(e,t){if(e.summary?.running===!0)return t===`command`?`Command running`:`Process running`;let n=g(e.summary,`exitCode`);return n!==void 0&&n!==0?t===`command`?`Command failed`:`Process failed`:t===`command`?`Ran command`:`Process finished`}function ve(e){if(e.summary?.running===!0)return`running`;let t=g(e.summary,`exitCode`);return t!==void 0&&t!==0?`error`:t===0?`success`:void 0}function w(e){let t=e.summary?.command;if(typeof t==`string`)return t;let n=e.summary?.sessionId;return typeof n==`number`||typeof n==`string`?`Session ${String(n)}`:e.path}function T(e,t){if(e!==void 0)return`${e} ${t}${e===1?``:`s`}`}function ye(e){if(e!==void 0)return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(+(e<1e4))}s`}var E=null,D=!1,O=null,k,A=null,j=!1,M=!1,N=null,P=null,F=null,I=null,L=!1,R=document.querySelector(`#app`);if(!R)throw Error(`Missing #app root element.`);var z=R,B=new c(z);be();async function be(){H(),E=new i({name:`forgerelay-tool-cards`,version:`0.1.0`},{}),E.ontoolresult=e=>{let t=a(B.active,e.structuredContent);if(t===`activity`&&B.accept(e)){A=null,j=!1,M=!1,I=null,L=!1,N=null,H();return}if(t===`preserve-panel`)return;let n=Re(e),r=Le(e),i=r?{...n,...r}:n,o=Ie(e);if(!o||!te(i)){A=null,j=!1,M=!1,I=null,L=!1,N=`No result card is available for this tool result.`,H();return}let s={...i,tool:o};A=s,j=re(s),M=!1,I=null,L=!1,N=null,H()},E.onhostcontextchanged=e=>{k={...k,...e},V(),B.active?B.render():A?.tool!==`open_workspace`&&W()},E.onteardown=async()=>(D=!1,B.detach(),G(),{});try{await E.connect();let e=E.getHostContext();e&&(k=e),V(),D=!0,B.attach(E)}catch(e){O=e instanceof Error?e.message:String(e)}H()}function V(){k?.theme&&l(k.theme),k?.styles?.variables&&t(k.styles.variables),k?.styles?.css?.fonts&&s(k.styles.css.fonts);let e=k?.safeAreaInsets;e&&(document.body.style.padding=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`)}function H(){if(G(),O){U(O,`error`);return}if(!D){U(`Connecting to host...`);return}if(B.render())return;if(!A){U(N??`Waiting for a tool result.`,N?`error`:`muted`);return}let t=fe(A);if(h(A)){Ce(A,t);return}let n=_(A),r=$(`main`,{className:`shell`}),i=$(`section`,{className:Te(t)}),a=$(`button`,{className:`tool-header`,type:`button`,ariaExpanded:String(j),disabled:!n});n&&a.addEventListener(`click`,()=>{j=!j,H()});let o=$(`span`,{className:`tool-icon`,ariaHidden:`true`});o.append(e(t.icon));let s=$(`span`,{className:`tool-main`}),c=$(`span`,{className:`tool-title`,text:t.title});if(s.append(c),t.label&&s.append($(`span`,{className:`tool-label`,text:t.label,title:t.label})),a.append(o,s,J(A),we(j,n)),i.append(a),j){let e=$(`div`,{className:`tool-body`});F=e,i.append(e)}r.append(i),z.replaceChildren(r),W()}function U(e,t=`muted`){let n=$(`main`,{className:`shell`});n.append($(`section`,{className:`empty ${t}`,text:e})),z.replaceChildren(n)}async function W(){if(!A||!F||!j)return;let e=F;if(N){q(e,N,`error`);return}if(A.tool===`open_workspace`){Ee(e,A);return}if(xe(A)){if(P){P.update({card:A,hostContext:k,errorMessage:N});return}Y(e,!0);try{let{mountHeavyPayload:t}=await n(async()=>{let{mountHeavyPayload:e}=await import(`./heavy-payload-CeW-n9w5.js`);return{mountHeavyPayload:e}},__vite__mapDeps([0,1,2,3,4]),import.meta.url);if(e!==F||!j||!A)return;Y(e,!1),P=t(e,{card:A,hostContext:k,errorMessage:N})}catch(t){if(e!==F||!j)return;Y(e,!1),q(e,t instanceof Error?t.message:`Unable to load details.`,`error`)}return}if(h(A)||m(A.tool)){let t=h(A)&&!M?Math.max(3,(A.files??[]).slice(0,3).length):void 0;if(P){P.update({card:A,hostContext:k,errorMessage:N,visibleFileCount:t});return}q(e,h(A)?`Loading review...`:`Loading diff...`);let{mountReviewPayload:r}=await n(async()=>{let{mountReviewPayload:e}=await import(`./review-payload-B9CO298v.js`);return{mountReviewPayload:e}},__vite__mapDeps([5,1,2,3,4]),import.meta.url);if(e!==F||!A)return;P=r(e,{card:A,hostContext:k,errorMessage:N,visibleFileCount:t});return}let t=ne(A.payload);if(!t){q(e,`No details available.`);return}Se(e,t,A.tool)}function xe(e){return d(e.tool)||p(e.tool)||f(e.tool)}function G(){K(),P=null,F=null}function K(){P?.unmount(),P=null}function q(e,t,n=`muted`){K(),e.replaceChildren($(`div`,{className:`status ${n}`,text:t}))}function Se(e,t,n){K(),e.replaceChildren($(`pre`,{className:`text-payload pretty-scrollbar ${n}`,text:t}))}function J(e){let t=pe(e);if(t.kind===`diff`){let e=$(`span`,{className:`stats`});return e.setAttribute(`aria-label`,`Diff statistics`),e.append($(`span`,{className:`add`,text:`+${String(t.additions)}`}),$(`span`,{className:`remove`,text:`-${String(t.removals)}`})),e}let n=$(`span`,{className:`header-meta ${t.kind===`empty`?`empty`:``}`,text:t.kind===`text`?t.text:``});return t.kind===`empty`&&n.setAttribute(`aria-hidden`,`true`),n}function Ce(t,n){G();let r=t.files??[],i=M?r:r.slice(0,3),a=Math.max(0,r.length-i.length),o=_(t),s=$(`main`,{className:`shell`}),c=$(`section`,{className:Te(n)}),l=$(`button`,{className:`tool-header review-header`,type:`button`,ariaExpanded:String(j),disabled:!o});o&&l.addEventListener(`click`,()=>{j=!j,H()});let u=$(`span`,{className:`tool-icon`,ariaHidden:`true`});u.append(e(n.icon));let d=$(`span`,{className:`tool-main review-title-group`});if(d.append($(`span`,{className:`tool-title`,text:n.title})),n.label&&d.append($(`span`,{className:`tool-label`,text:n.label,title:n.label})),l.append(u,d,J(t),we(j,o)),c.append(l),j){let e=$(`div`,{className:`review-summary`}),t=$(`div`,{className:`review-payload`});if(F=t,e.append(t),a>0){let t=$(`button`,{className:`review-more`,type:`button`,text:`Show ${a} more ${a===1?`file`:`files`}`});t.addEventListener(`click`,()=>{M=!0,H()}),e.append(t)}c.append(e)}s.append(c),z.replaceChildren(s),W()}function we(t,n){let r=$(`span`,{className:n?`chevron ${t?`expanded`:``}`:`chevron`,ariaHidden:`true`});return n&&r.append(e(o.chevronDown)),r}function Te(e){return[`tool-card`,e.tone,e.state?`state-${e.state}`:void 0].filter(Boolean).join(` `)}function Y(t,n){let r=t.previousElementSibling,i=r?.querySelector(`.chevron`);if(!i)return;i.classList.toggle(`loading`,n),i.replaceChildren(e(n?o.loading:o.chevronDown));let a=r instanceof HTMLButtonElement?r:null;a&&a.setAttribute(`aria-busy`,String(n))}function Ee(t,n){K();let i=$(`div`,{className:`workspace-details pretty-scrollbar`}),a=$(`div`,{className:`workspace-rows`}),s=n.worktree;if(s){let t=[s.baseRef,s.baseSha?.slice(0,8)].filter(e=>!!e).join(` · `)||`Worktree`,n=$(`span`,{className:`workspace-base-value`});if(n.append($(`span`,{className:`workspace-value`,text:t,title:t})),s.dirtySource){let t=$(`span`,{className:`workspace-base-warning`,title:`The source checkout had uncommitted changes when this worktree was created. Those changes are not included here.`,ariaLabel:`Source checkout changes are not included in this worktree`});t.append(e(o.warning,`workspace-base-warning-svg`)),n.append(t)}Z(a,`Base`,n,o.base),s.branch&&X(a,`Worktree branch`,s.branch,o.gitBranch,!1),s.targetBranch&&X(a,`Merge target`,s.targetBranch,o.gitBranch,!1)}n.sourceRoot&&n.sourceRoot!==n.root&&X(a,`Source checkout`,n.sourceRoot,o.sourceCheckout,!0),De(a,n.agentsFiles??[],n.availableAgentsFiles??[]);let c=n.skills??[];c.length>0&&Pe(a,c);let l=n.agentProviders??[],u=(n.agents??[]).map(e=>{let t=e.name??`Unnamed agent`,n=e.provider?.trim(),i=e.providerAvailable===!1,a=[e.description,n?`Provider: ${n}`:void 0,e.model?`Model: ${e.model}`:void 0,e.thinking?`Thinking: ${e.thinking}`:void 0,i?e.providerUnavailableReason??`Provider unavailable`:void 0].filter(e=>!!e).join(`
4
+ `)??``}function g(e,t){let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function _(e){return e.tool===`open_workspace`?Number(e.summary?.agentsFiles??0)>0||Number(e.summary?.skills??0)>0||Number(e.summary?.agentProviders??0)>0||Number(e.summary?.agents??0)>0||!!e.agentsFiles?.length||!!e.availableAgentsFiles?.length||!!e.skills?.length||!!e.agentProviders?.length||!!e.agents?.length||!!e.worktree||!!e.instruction:h(e)?!!(e.files?.length||e.payload?.patch):m(e.tool)?!!e.payload?.patch:!!e.payload}function re(e){return e.tool===`open_workspace`||h(e)?_(e):m(e.tool)?e.files?.length===1&&_(e):!1}var ie={added:`Added`,edited:`Edited`,deleted:`Deleted`,renamed:`Renamed`,"renamed-edited":`Renamed and edited`};function ae(e,t={}){let n=e.files??[],r=le(n);if(r===0)return{title:t.emptyTitle??`Applied patch`,tone:`edit`};let i=new Set(n.map(v)),a=i.size===1?[...i][0]:void 0,o={title:ue(a,r),tone:de(a)};return a&&a!==`unknown`&&(o.iconKind=a),o}function v(e){switch(e.operation){case`add`:return`added`;case`update`:return`edited`;case`delete`:return`deleted`;case`move`:return`renamed`}switch(e.type){case`new`:return`added`;case`change`:return`edited`;case`deleted`:return`deleted`;case`rename-pure`:return`renamed`;case`rename-changed`:return`renamed-edited`;default:return`unknown`}}function oe(e,t,n){let r=v(t);if(r!==`edited`&&r!==`unknown`)return r;let i=e[n];return i?.operation===`move`&&(!t.path||i.path===t.path)||e.find(e=>e.operation===`move`&&e.path===t.path&&(!t.previousPath||e.previousPath===t.previousPath))?`renamed`:r===`edited`?`edited`:i?v(i):`unknown`}function y(e){let t=e.path??e.previousPath;if(!t)return;let n=e.previousPath;if(!n||n===t)return{current:t,title:t};let r=x(n)===x(t);return{current:r?S(t):t,previous:r?S(n):n,title:`${n} → ${t}`}}function se(e,t,n){let r=e[n],i=(r?.path===t.path?r:e.find(e=>e.path===t.path&&(!t.previousPath||!e.previousPath||e.previousPath===t.previousPath)))??r;return y({path:t.path??i?.path,previousPath:t.previousPath??i?.previousPath})}function ce(e){return e===`unknown`?`Changed`:ie[e]}function le(e){let t=new Set,n=0;for(let r of e){let e=r.path??r.previousPath;e?t.add(e):n+=1}return t.size+n}function ue(e,t){return e&&e!==`unknown`?`${ie[e]} ${t} ${b(t)}`:`Changed ${t} ${b(t)}`}function de(e){return e===`added`?`write`:e===`deleted`?`delete`:`edit`}function b(e){return e===1?`file`:`files`}function x(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t===-1?``:e.slice(0,t)}function S(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t===-1?e:e.slice(t+1)}function fe(e){switch(e.tool){case`open_workspace`:return{icon:e.mode===`worktree`?o.gitBranch:o.folderOpen,title:he(e),label:e.kind===`composite`?e.name:e.root??e.path,tone:`workspace`};case`close_workspace`:return{icon:e.mode===`worktree`?o.gitBranch:o.folderOpen,title:e.kind===`composite`?`Dissolved composite workspace`:`Closed workspace`,label:e.kind===`composite`?e.name??e.workspaceId:e.sourceRoot??e.root??e.path??e.workspaceId,tone:`workspace`};case`read`:return{icon:o.readFile,title:`Read file`,label:e.path,tone:`read`};case`write`:return{icon:o.writeFile,title:`Wrote file`,label:e.path,tone:`write`};case`edit`:return{icon:o.editFile,title:`Edited file`,label:e.path,tone:`edit`};case`rename`:return{icon:o.editFile,title:`Renamed path`,label:e.path,tone:`edit`};case`delete`:return{icon:o.deleteFile,title:`Deleted path`,label:e.path,tone:`delete`};case`apply_patch`:{let t=ae(e);return{icon:me(t.iconKind),title:t.title,label:C(e),tone:t.tone}}case`grep`:return{icon:o.search,title:`Searched files`,label:ge(e),tone:`search`};case`glob`:return{icon:o.files,title:`Found files`,label:ge(e),tone:`search`};case`ls`:return{icon:o.folderTree,title:`Listed directory`,label:e.path,tone:`directory`};case`bash`:case`exec_command`:return{icon:o.terminalSquare,title:_e(e,`command`),label:w(e),tone:`shell`,state:ve(e)};case`write_stdin`:return{icon:o.terminal,title:_e(e,`process`),label:w(e),tone:`shell`,state:ve(e)};case`capability`:if(h(e)){let t=ae(e,{emptyTitle:`Changes ready`}),n=e.files?.length??0;return{icon:o.diff,title:n>0||e.payload?.patch?t.title:`No changes`,label:C(e),tone:`review`}}return{icon:o.skills,title:e.capabilityName?`Capability: ${e.capabilityName}`:`Capability completed`,tone:`workspace`}}}function pe(e){let t=e.summary??{};if(h(e)||m(e.tool)||p(e.tool)||f(e.tool))return{kind:`diff`,additions:g(t,`additions`)??0,removals:g(t,`removals`)??0};if(e.tool===`open_workspace`){let e=[T(g(t,`agentsFiles`),`instruction`),T(g(t,`skills`),`skill`)].filter(e=>!!e);return e.length>0?{kind:`text`,text:e.join(` · `)}:{kind:`empty`}}if(ee(e.tool)){let e=[T(g(t,`lines`),`line`),ye(g(t,`wallTimeMs`))].filter(e=>!!e);return e.length>0?{kind:`text`,text:e.join(` · `)}:{kind:`empty`}}if(e.tool===`grep`||e.tool===`read`||e.tool===`ls`){let e=T(g(t,`lines`),`line`);return e?{kind:`text`,text:e}:{kind:`empty`}}return{kind:`empty`}}function me(e){return e===`added`?o.writeFile:e===`deleted`?o.deleteFile:e===`renamed`||e===`renamed-edited`?o.files:o.editFile}function he(e){return e.kind===`composite`?`${e.workspaceReused?`Reused`:`Opened`} composite workspace`:`${e.workspaceReused?`Reused`:`Opened`} workspace`}function C(e){if(e.files?.length===1)return y(e.files[0])?.title??e.path}function ge(e){let t=e.summary?.pattern,n=e.summary?.scope;return typeof t==`string`?typeof n==`string`&&n!==`.`?`${t} in ${n}`:t:e.path}function _e(e,t){if(e.summary?.running===!0)return t===`command`?`Command running`:`Process running`;let n=g(e.summary,`exitCode`);return n!==void 0&&n!==0?t===`command`?`Command failed`:`Process failed`:t===`command`?`Ran command`:`Process finished`}function ve(e){if(e.summary?.running===!0)return`running`;let t=g(e.summary,`exitCode`);return t!==void 0&&t!==0?`error`:t===0?`success`:void 0}function w(e){let t=e.summary?.command;if(typeof t==`string`)return t;let n=e.summary?.sessionId;return typeof n==`number`||typeof n==`string`?`Session ${String(n)}`:e.path}function T(e,t){if(e!==void 0)return`${e} ${t}${e===1?``:`s`}`}function ye(e){if(e!==void 0)return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(+(e<1e4))}s`}var E=null,D=!1,O=null,k,A=null,j=!1,M=!1,N=null,P=null,F=null,I=null,L=!1,R=document.querySelector(`#app`);if(!R)throw Error(`Missing #app root element.`);var z=R,B=new c(z);be();async function be(){H(),E=new i({name:`forgerelay-tool-cards`,version:`0.1.0`},{}),E.ontoolresult=e=>{let t=a(B.active,e.structuredContent);if(t===`activity`&&B.accept(e)){A=null,j=!1,M=!1,I=null,L=!1,N=null,H();return}if(t===`preserve-panel`)return;let n=Re(e),r=Le(e),i=r?{...n,...r}:n,o=Ie(e);if(!o||!te(i)){A=null,j=!1,M=!1,I=null,L=!1,N=`No result card is available for this tool result.`,H();return}let s={...i,tool:o};A=s,j=re(s),M=!1,I=null,L=!1,N=null,H()},E.onhostcontextchanged=e=>{k={...k,...e},V(),B.active?B.render():A?.tool!==`open_workspace`&&W()},E.onteardown=async()=>(D=!1,B.detach(),G(),{});try{await E.connect();let e=E.getHostContext();e&&(k=e),V(),D=!0,B.attach(E)}catch(e){O=e instanceof Error?e.message:String(e)}H()}function V(){k?.theme&&l(k.theme),k?.styles?.variables&&t(k.styles.variables),k?.styles?.css?.fonts&&s(k.styles.css.fonts);let e=k?.safeAreaInsets;e&&(document.body.style.padding=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`)}function H(){if(G(),O){U(O,`error`);return}if(!D){U(`Connecting to host...`);return}if(B.render())return;if(!A){U(N??`Waiting for a tool result.`,N?`error`:`muted`);return}let t=fe(A);if(h(A)){Ce(A,t);return}let n=_(A),r=$(`main`,{className:`shell`}),i=$(`section`,{className:Te(t)}),a=$(`button`,{className:`tool-header`,type:`button`,ariaExpanded:String(j),disabled:!n});n&&a.addEventListener(`click`,()=>{j=!j,H()});let o=$(`span`,{className:`tool-icon`,ariaHidden:`true`});o.append(e(t.icon));let s=$(`span`,{className:`tool-main`}),c=$(`span`,{className:`tool-title`,text:t.title});if(s.append(c),t.label&&s.append($(`span`,{className:`tool-label`,text:t.label,title:t.label})),a.append(o,s,J(A),we(j,n)),i.append(a),j){let e=$(`div`,{className:`tool-body`});F=e,i.append(e)}r.append(i),z.replaceChildren(r),W()}function U(e,t=`muted`){let n=$(`main`,{className:`shell`});n.append($(`section`,{className:`empty ${t}`,text:e})),z.replaceChildren(n)}async function W(){if(!A||!F||!j)return;let e=F;if(N){q(e,N,`error`);return}if(A.tool===`open_workspace`){Ee(e,A);return}if(xe(A)){if(P){P.update({card:A,hostContext:k,errorMessage:N});return}Y(e,!0);try{let{mountHeavyPayload:t}=await n(async()=>{let{mountHeavyPayload:e}=await import(`./heavy-payload-CgzrutLm.js`);return{mountHeavyPayload:e}},__vite__mapDeps([0,1,2,3,4]),import.meta.url);if(e!==F||!j||!A)return;Y(e,!1),P=t(e,{card:A,hostContext:k,errorMessage:N})}catch(t){if(e!==F||!j)return;Y(e,!1),q(e,t instanceof Error?t.message:`Unable to load details.`,`error`)}return}if(h(A)||m(A.tool)){let t=h(A)&&!M?Math.max(3,(A.files??[]).slice(0,3).length):void 0;if(P){P.update({card:A,hostContext:k,errorMessage:N,visibleFileCount:t});return}q(e,h(A)?`Loading review...`:`Loading diff...`);let{mountReviewPayload:r}=await n(async()=>{let{mountReviewPayload:e}=await import(`./review-payload-BrLbezbq.js`);return{mountReviewPayload:e}},__vite__mapDeps([5,1,2,3,4]),import.meta.url);if(e!==F||!A)return;P=r(e,{card:A,hostContext:k,errorMessage:N,visibleFileCount:t});return}let t=ne(A.payload);if(!t){q(e,`No details available.`);return}Se(e,t,A.tool)}function xe(e){return d(e.tool)||p(e.tool)||f(e.tool)}function G(){K(),P=null,F=null}function K(){P?.unmount(),P=null}function q(e,t,n=`muted`){K(),e.replaceChildren($(`div`,{className:`status ${n}`,text:t}))}function Se(e,t,n){K(),e.replaceChildren($(`pre`,{className:`text-payload pretty-scrollbar ${n}`,text:t}))}function J(e){let t=pe(e);if(t.kind===`diff`){let e=$(`span`,{className:`stats`});return e.setAttribute(`aria-label`,`Diff statistics`),e.append($(`span`,{className:`add`,text:`+${String(t.additions)}`}),$(`span`,{className:`remove`,text:`-${String(t.removals)}`})),e}let n=$(`span`,{className:`header-meta ${t.kind===`empty`?`empty`:``}`,text:t.kind===`text`?t.text:``});return t.kind===`empty`&&n.setAttribute(`aria-hidden`,`true`),n}function Ce(t,n){G();let r=t.files??[],i=M?r:r.slice(0,3),a=Math.max(0,r.length-i.length),o=_(t),s=$(`main`,{className:`shell`}),c=$(`section`,{className:Te(n)}),l=$(`button`,{className:`tool-header review-header`,type:`button`,ariaExpanded:String(j),disabled:!o});o&&l.addEventListener(`click`,()=>{j=!j,H()});let u=$(`span`,{className:`tool-icon`,ariaHidden:`true`});u.append(e(n.icon));let d=$(`span`,{className:`tool-main review-title-group`});if(d.append($(`span`,{className:`tool-title`,text:n.title})),n.label&&d.append($(`span`,{className:`tool-label`,text:n.label,title:n.label})),l.append(u,d,J(t),we(j,o)),c.append(l),j){let e=$(`div`,{className:`review-summary`}),t=$(`div`,{className:`review-payload`});if(F=t,e.append(t),a>0){let t=$(`button`,{className:`review-more`,type:`button`,text:`Show ${a} more ${a===1?`file`:`files`}`});t.addEventListener(`click`,()=>{M=!0,H()}),e.append(t)}c.append(e)}s.append(c),z.replaceChildren(s),W()}function we(t,n){let r=$(`span`,{className:n?`chevron ${t?`expanded`:``}`:`chevron`,ariaHidden:`true`});return n&&r.append(e(o.chevronDown)),r}function Te(e){return[`tool-card`,e.tone,e.state?`state-${e.state}`:void 0].filter(Boolean).join(` `)}function Y(t,n){let r=t.previousElementSibling,i=r?.querySelector(`.chevron`);if(!i)return;i.classList.toggle(`loading`,n),i.replaceChildren(e(n?o.loading:o.chevronDown));let a=r instanceof HTMLButtonElement?r:null;a&&a.setAttribute(`aria-busy`,String(n))}function Ee(t,n){K();let i=$(`div`,{className:`workspace-details pretty-scrollbar`}),a=$(`div`,{className:`workspace-rows`}),s=n.worktree;if(s){let t=[s.baseRef,s.baseSha?.slice(0,8)].filter(e=>!!e).join(` · `)||`Worktree`,n=$(`span`,{className:`workspace-base-value`});if(n.append($(`span`,{className:`workspace-value`,text:t,title:t})),s.dirtySource){let t=$(`span`,{className:`workspace-base-warning`,title:`The source checkout had uncommitted changes when this worktree was created. Those changes are not included here.`,ariaLabel:`Source checkout changes are not included in this worktree`});t.append(e(o.warning,`workspace-base-warning-svg`)),n.append(t)}Z(a,`Base`,n,o.base),s.branch&&X(a,`Worktree branch`,s.branch,o.gitBranch,!1),s.targetBranch&&X(a,`Merge target`,s.targetBranch,o.gitBranch,!1)}n.sourceRoot&&n.sourceRoot!==n.root&&X(a,`Source checkout`,n.sourceRoot,o.sourceCheckout,!0),De(a,n.agentsFiles??[],n.availableAgentsFiles??[]);let c=n.skills??[];c.length>0&&Pe(a,c);let l=n.agentProviders??[],u=(n.agents??[]).map(e=>{let t=e.name??`Unnamed agent`,n=e.provider?.trim(),i=e.providerAvailable===!1,a=[e.description,n?`Provider: ${n}`:void 0,e.model?`Model: ${e.model}`:void 0,e.thinking?`Thinking: ${e.thinking}`:void 0,i?e.providerUnavailableReason??`Provider unavailable`:void 0].filter(e=>!!e).join(`
5
5
  `);return{label:t,logo:n?r(n):void 0,profile:!0,tone:i?`muted`:void 0,title:a||void 0}}),d=l.map(e=>{let t=e.name?.trim()||`Unknown provider`,n=e.available===!1,i=r(t);return{label:t,logo:i,bareLogo:!!i,ariaLabel:t,tone:n?`muted`:void 0,title:n?e.reason??`Provider unavailable`:t}});if(u.length>0){let e=Q([...u,...d]);e.classList.add(`workspace-agents-list`),Z(a,`Agents`,e,o.agents,`workspace-agents-row`)}else d.length>0&&Ne(a,`Providers`,d,o.providers);a.childElementCount>0&&i.append(a),i.childElementCount===0&&i.append($(`div`,{className:`status muted`,text:`No workspace details available.`})),t.replaceChildren(i)}function De(e,t,n){let r=[],i=new Set;for(let[e,n]of t.entries())r.push({key:`loaded:${e}`,path:n.path,label:n.path??`Loaded instructions`,content:n.content,status:`loaded`}),n.path&&i.add(n.path);let a=[];for(let[e,t]of n.entries())t.path&&i.has(t.path)||a.push({key:`available:${e}`,path:t.path,label:t.path??`Nested instructions`,status:`available`});if(r.length===0&&a.length===0)return;let s=Oe(L?[...r,...a]:r);if(a.length>0){let e=L,t=$(`button`,{className:`workspace-instructions-toggle`,type:`button`,text:e?`Show less`:`View all`,ariaLabel:e?`Show only loaded instruction files`:`View all ${a.length} available instruction files`,ariaExpanded:String(e)});t.addEventListener(`click`,()=>{L=!L,L||(I=null),H()}),s.append(t)}let c=$(`div`,{className:`workspace-instructions-content`});c.append(s),Z(e,`Instructions`,c,o.instructions,`workspace-instructions-row`)}function Oe(t){let n=$(`span`,{className:`workspace-instruction-list`});for(let r of t){let t=$(`span`,{className:`workspace-instruction-item`});t.dataset.instructionKey=r.key;let i=r.status===`loaded`&&r.content!==void 0,a=$(i?`button`:`span`,{className:`workspace-instruction-header${i?` interactive`:``}`,type:i?`button`:void 0,ariaLabel:i?`View ${r.label}`:void 0,ariaExpanded:i?`false`:void 0}),s=$(`span`,{className:`workspace-instruction-text`}),c=Me(r.label);if(s.append($(`span`,{className:`workspace-instruction-name`,text:c})),r.path&&r.path!==c&&s.append($(`span`,{className:`workspace-instruction-path`,text:r.path,title:r.path})),a.append(Ae(r.status),s),i){let i=$(`span`,{className:`workspace-instruction-chevron`,ariaHidden:`true`});i.append(e(o.chevronDown,`workspace-instruction-chevron-svg`)),a.append(i),a.addEventListener(`click`,()=>{I=I===r.key?null:r.key,ke(n)});let s=$(`pre`,{className:`workspace-instruction-preview pretty-scrollbar`,text:r.content});s.hidden=!0,t.append(a,s)}else t.append(a);n.append(t)}return ke(n),n}function ke(e){for(let t of e.querySelectorAll(`.workspace-instruction-item`)){let e=t.dataset.instructionKey===I;t.classList.toggle(`expanded`,e),t.querySelector(`.workspace-instruction-header.interactive`)?.setAttribute(`aria-expanded`,String(e));let n=t.querySelector(`.workspace-instruction-preview`);n&&(n.hidden=!e)}}function Ae(t){let n=je(t),r=$(`span`,{className:`workspace-instruction-status ${t}`,title:n,ariaLabel:n});return r.setAttribute(`role`,`img`),r.append(e(t===`loaded`?o.instructionLoaded:o.instructionAvailable,`workspace-instruction-status-svg`)),r}function je(e){return e===`loaded`?`Loaded into the current workspace context`:`Available for a nested directory`}function Me(e){return e.replaceAll(`\\`,`/`).split(`/`).filter(Boolean).at(-1)??e}function X(e,t,n,r,i=!1){Z(e,t,$(`span`,{className:`workspace-value${i?` mono`:``}`,text:n,title:n}),r)}function Ne(e,t,n,r){Z(e,t,Q(n),r)}function Z(e,t,n,r,i){let a=$(`div`,{className:[`workspace-row`,i].filter(Boolean).join(` `)});a.append(Fe(r),$(`span`,{className:`workspace-key`,text:t}),n),e.append(a)}function Pe(e,t){let n=Q(t.map(e=>({label:e.name??`Unnamed skill`,title:e.description||void 0})));n.classList.add(`workspace-skills-list`),Z(e,`Skills`,n,o.skills,`workspace-skills-row`)}function Fe(t){let n=$(`span`,{className:`workspace-row-icon`,ariaHidden:`true`});return n.append(e(t,`workspace-row-icon-svg`)),n}function Q(e){let t=$(`span`,{className:`workspace-chip-list`});for(let n of e){let e=!!(n.bareLogo&&n.logo),r=$(`span`,{className:[e?`workspace-provider-logo`:n.profile?`workspace-agent-profile`:`workspace-chip`,n.tone].filter(Boolean).join(` `),title:n.title});if(e&&(r.setAttribute(`role`,`img`),r.setAttribute(`aria-label`,n.ariaLabel??n.label)),n.logo){let t=document.createElement(`img`);t.className=e?`workspace-provider-logo-image`:n.profile?`workspace-agent-profile-logo`:`workspace-chip-logo`,t.src=n.logo,t.alt=``,t.setAttribute(`aria-hidden`,`true`),r.append(t)}e||r.append($(`span`,{className:`workspace-chip-label`,text:n.label})),t.append(r)}return t}function Ie(e){let t=e._meta?.tool;return u(t)?t:void 0}function Le(e){let t=e._meta?.card;return t&&typeof t==`object`?t:void 0}function Re(e){return e.structuredContent}function $(e,t={}){let n=document.createElement(e);return t.className&&(n.className=t.className),t.text!==void 0&&(n.textContent=t.text),t.type!==void 0&&`type`in n&&n.setAttribute(`type`,t.type),t.title!==void 0&&(n.title=t.title),t.ariaHidden!==void 0&&n.setAttribute(`aria-hidden`,t.ariaHidden),t.ariaLabel!==void 0&&n.setAttribute(`aria-label`,t.ariaLabel),t.ariaExpanded!==void 0&&n.setAttribute(`aria-expanded`,t.ariaExpanded),t.disabled!==void 0&&`disabled`in n&&(n.disabled=t.disabled),n}export{d as a,g as c,p as i,oe as n,f as o,se as r,ne as s,ce as t};
@@ -0,0 +1 @@
1
+ .forgerelay-panel{border:1px solid var(--tool-card-border);background:var(--tool-card-header-bg);width:100%;color:var(--color-text-primary,#f5f5f6);border-radius:12px;overflow:hidden}.workspace-panel{background:var(--tool-card-header-bg);width:100%}.workspace-panel-header{grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:58px;padding:9px 12px;display:grid}.workspace-panel-icon{background:color-mix(in srgb, var(--tool-accent) 9%, transparent);width:22px;height:22px;color:color-mix(in srgb, var(--tool-accent) 72%, var(--color-text-tertiary,#a3a3aa));border-radius:6px;place-items:center;display:grid}.workspace-panel-icon-svg{stroke-width:1.8px;width:14px;height:14px}.workspace-panel-title-group{gap:2px;min-width:0;display:grid}.workspace-panel-title{font-size:var(--font-text-sm-size,14px);font-weight:600;line-height:1.3}.workspace-panel-subtitle,.workspace-panel-mode{color:var(--color-text-tertiary,#a3a3aa);font-size:var(--font-text-xs-size,11px);line-height:1.35}.workspace-panel-subtitle{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.workspace-panel-mode{border:1px solid color-mix(in srgb, var(--tool-card-divider) 76%, transparent);white-space:nowrap;border-radius:999px;padding:2px 7px}.workspace-panel .workspace-details{border-top:1px solid var(--tool-card-divider);background:var(--tool-card-body-bg);max-height:none}.workspace-panel-pending-dot{background:var(--color-text-info,#38bdf8);width:8px;height:8px;box-shadow:0 0 0 3px color-mix(in srgb, var(--color-text-info,#38bdf8) 12%, transparent);border-radius:999px;justify-self:center}.activity-panel{border:1px solid var(--tool-card-border);background:var(--tool-card-header-bg);width:100%;color:var(--color-text-primary,#f5f5f6);border-radius:12px;overflow:hidden}.forgerelay-panel .activity-panel{border:0;border-top:1px solid var(--tool-card-divider);border-radius:0}.activity-panel-header{width:100%;min-height:58px;color:inherit;cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;grid-template-columns:14px minmax(0,1fr) auto 20px;align-items:center;gap:10px;padding:9px 12px;display:grid}.activity-panel-header:hover{background:var(--tool-card-hover-bg)}.activity-panel-header:focus-visible{outline:2px solid color-mix(in srgb, var(--color-text-info,#38bdf8) 72%, transparent);outline-offset:-2px}.activity-panel-header-pending{cursor:default}.activity-panel-header-pending:hover{background:0 0}.activity-panel-pending-spacer{width:20px}.activity-panel-status{background:var(--color-text-info,#38bdf8);width:8px;height:8px;box-shadow:0 0 0 3px color-mix(in srgb, var(--color-text-info,#38bdf8) 12%, transparent);border-radius:9999px;justify-self:center}.activity-panel-status.state-done{background:var(--color-success-text,#6fda83);box-shadow:0 0 0 3px color-mix(in srgb, var(--color-success-text,#6fda83) 12%, transparent)}.activity-panel-status.state-error{background:var(--color-danger-text,#ee7676);box-shadow:0 0 0 3px color-mix(in srgb, var(--color-danger-text,#ee7676) 12%, transparent)}.activity-panel-title-group{gap:2px;min-width:0;display:grid}.activity-panel-title{font-size:var(--font-text-sm-size,14px);font-weight:600;line-height:1.3}.activity-panel-subtitle,.activity-panel-count{color:var(--color-text-tertiary,#a3a3aa);font-size:var(--font-text-xs-size,11px);line-height:1.35}.activity-panel-count{white-space:nowrap;font-weight:600}.activity-panel-count.state-working{color:var(--color-text-info,#38bdf8)}.activity-panel-count.state-done{color:var(--color-success-text,#6fda83)}.activity-panel-count.state-error{color:var(--color-danger-text,#ee7676)}.activity-panel-body{border-top:1px solid var(--tool-card-divider);background:var(--tool-card-body-bg);display:grid}.activity-viewport{overscroll-behavior:contain;max-height:420px;overflow:hidden auto}.activity-list{display:grid}.activity-group+.activity-group{border-top:1px solid var(--tool-card-divider)}.activity-group.grouped>.activity-row.parent{background:color-mix(in srgb, var(--color-background-secondary,#272727) 54%, transparent)}.activity-children{border-top:1px solid color-mix(in srgb, var(--tool-card-divider) 72%, transparent);display:grid}.activity-row{--activity-accent:var(--color-text-secondary,#b6b6bd);--activity-phase:var(--color-text-tertiary,#a3a3aa);width:100%;min-height:46px;color:inherit;font:inherit;text-align:left;background:0 0;border:0;grid-template-columns:28px minmax(0,1fr) auto 16px;align-items:center;gap:10px;padding:7px 12px;display:grid}.activity-row.interactive{cursor:pointer}.activity-row.interactive:hover{background:var(--tool-card-hover-bg)}.activity-row.interactive:focus-visible{outline:2px solid color-mix(in srgb, var(--activity-accent) 68%, transparent);outline-offset:-2px}.activity-row.child{padding-left:34px;position:relative}.activity-row.child:before{background:color-mix(in srgb, var(--activity-accent) 26%, var(--tool-card-divider));content:"";width:1px;position:absolute;top:0;bottom:0;left:20px}.activity-row.child+.activity-row.child{border-top:1px solid color-mix(in srgb, var(--tool-card-divider) 52%, transparent)}.activity-row.kind-read{--activity-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 32%, #06b6d4 68%)}.activity-row.kind-write{--activity-accent:var(--color-success-text,#6fda83)}.activity-row.kind-edit,.activity-row.kind-rename{--activity-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 28%, #d99742 72%)}.activity-row.kind-delete{--activity-accent:var(--color-danger-text,#ee7676)}.activity-row.kind-shell{--activity-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 42%, #64748b 58%)}.activity-row.kind-shell-result{--activity-accent:color-mix(in srgb, var(--color-success-text,#6fda83) 72%, var(--color-text-secondary,#b6b6bd))}.activity-row.kind-capability{--activity-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 34%, #3b82f6 66%)}.activity-row.kind-batch{--activity-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 34%, #8b5cf6 66%)}.activity-row.phase-executing{--activity-phase:var(--color-text-info,#38bdf8)}.activity-row.phase-returned{--activity-phase:var(--color-warning-text,#e6b566)}.activity-row.phase-done{--activity-phase:var(--color-success-text,#6fda83)}.activity-row.phase-error{--activity-phase:var(--color-danger-text,#ee7676)}.activity-row.phase-executing{box-shadow:inset 2px 0 0 color-mix(in srgb, var(--activity-phase) 76%, transparent);background:color-mix(in srgb, var(--activity-phase) 5%, transparent)}.activity-row.phase-returned{box-shadow:inset 2px 0 0 color-mix(in srgb, var(--activity-phase) 68%, transparent)}.activity-row.phase-error{box-shadow:inset 2px 0 0 color-mix(in srgb, var(--activity-phase) 72%, transparent)}.activity-row.shell-result{box-shadow:inset 2px 0 0 color-mix(in srgb, var(--activity-accent) 68%, transparent)}.activity-icon{border:1px solid color-mix(in srgb, var(--activity-accent) 18%, transparent);background:color-mix(in srgb, var(--activity-accent) 9%, transparent);width:28px;height:28px;color:var(--activity-accent);border-radius:7px;place-items:center;display:grid}.activity-icon-svg{stroke-width:1.8px;width:15px;height:15px}.activity-main{gap:4px;min-width:0;display:grid}.activity-title-line{align-items:baseline;gap:8px;min-width:0;display:flex}.activity-title{color:var(--color-text-primary,#f5f5f6);font-size:var(--font-text-sm-size,12px);flex:none;font-weight:600;line-height:1.35}.activity-member{color:var(--color-text-secondary,#d4d4d8);font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);font-size:var(--font-text-xs-size,10px);flex:none;line-height:1.4}.activity-target{min-width:0;color:var(--color-text-tertiary,#a3a3aa);font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);font-size:var(--font-text-xs-size,11px);text-overflow:ellipsis;white-space:nowrap;line-height:1.4;overflow:hidden}.activity-meta{color:var(--color-text-tertiary,#a3a3aa);font-size:var(--font-text-xs-size,10px);font-variant-numeric:tabular-nums;white-space:nowrap;justify-content:flex-end;align-items:center;gap:8px;display:inline-flex}.activity-phase{color:var(--activity-phase);align-items:center;gap:5px;display:inline-flex}.activity-phase:before{content:"";background:currentColor;border-radius:9999px;width:6px;height:6px}.activity-progress-wrap{grid-template-columns:auto minmax(48px,110px);align-items:center;gap:8px;max-width:220px;display:grid}.activity-progress-counts{color:var(--color-text-tertiary,#a3a3aa);font-size:var(--font-text-xs-size,10px);font-variant-numeric:tabular-nums;white-space:nowrap}.activity-progress-track{background:color-mix(in srgb, var(--activity-accent) 14%, var(--tool-card-divider));border-radius:9999px;height:3px;display:block;overflow:hidden}.activity-progress-fill{border-radius:inherit;background:var(--activity-accent);height:100%;display:block}.activity-empty,.activity-refresh-error{color:var(--color-text-secondary,#b7b7bf);font-size:var(--font-text-sm-size,12px);padding:12px}.activity-refresh-error{border-top:1px solid var(--tool-card-divider);color:var(--color-danger-text,#ee7676)}.activity-detail-chevron,.activity-detail-spacer,.activity-detail-chevron.chevron{width:16px;height:16px}.activity-detail-chevron .icon-svg{width:13px;height:13px}.activity-entry.expanded>.activity-row{background:color-mix(in srgb, var(--activity-accent) 6%, transparent)}.activity-detail{border-top:1px solid color-mix(in srgb, var(--tool-card-divider) 72%, transparent);background:color-mix(in srgb, var(--color-background-primary,#101114) 90%, transparent);display:grid}.activity-detail-section+.activity-detail-section{border-top:1px solid color-mix(in srgb, var(--tool-card-divider) 62%, transparent)}.activity-detail-label{color:var(--color-text-tertiary,#a3a3aa);font-size:var(--font-text-xs-size,10px);letter-spacing:.02em;padding:8px 12px 0;font-weight:600}.activity-detail-section.error .activity-detail-label,.activity-detail-section.error .activity-detail-value{color:var(--color-danger-text,#ee7676)}.activity-detail-value{max-height:260px;color:var(--color-text-secondary,#c7c7ce);font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);font-size:var(--font-text-xs-size,11px);white-space:pre-wrap;overflow-wrap:break-word;margin:0;padding:6px 12px 10px;line-height:1.5;overflow:auto}.activity-detail-status{color:var(--color-text-secondary,#b7b7bf);font-size:var(--font-text-sm-size,12px);padding:10px 12px}.activity-detail-status.error{color:var(--color-danger-text,#ee7676)}.activity-terminal{background:var(--color-background-primary,#101114)}.activity-terminal-command,.activity-terminal-output{color:var(--color-text-primary,#f5f5f6);font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);font-size:var(--font-text-xs-size,11px);white-space:pre-wrap;overflow-wrap:break-word;background:0 0;border:0;border-radius:0;margin:0;line-height:1.55}.activity-terminal-command{border-bottom:1px solid color-mix(in srgb, var(--tool-card-divider) 74%, transparent);color:var(--color-text-secondary,#c7c7ce);padding:9px 12px}.activity-terminal-output{max-height:320px;padding:10px 12px;overflow:auto}.activity-terminal-meta{border-top:1px solid color-mix(in srgb, var(--tool-card-divider) 74%, transparent);color:var(--color-text-tertiary,#a3a3aa);font-size:var(--font-text-xs-size,10px);font-variant-numeric:tabular-nums;padding:7px 12px}.activity-terminal-meta.status-running{color:var(--color-text-info,#38bdf8)}.activity-terminal-meta.status-done{color:var(--color-success-text,#6fda83)}.activity-terminal-meta.status-failed{color:var(--color-danger-text,#ee7676)}@media (width<=520px){.activity-panel-header{grid-template-columns:12px minmax(0,1fr) auto 18px;gap:8px;min-height:54px;padding:8px 10px}.activity-panel-subtitle,.activity-panel-count{font-size:10px}.activity-row{grid-template-columns:26px minmax(0,1fr) 18px;gap:6px 8px;min-height:48px;padding:8px 10px}.activity-row.child{padding-left:28px}.activity-row.child:before{left:16px}.activity-icon{align-self:start;width:26px;height:26px}.activity-title-line{gap:2px;display:grid}.activity-meta{grid-column:2;justify-content:flex-start}.activity-detail-chevron,.activity-detail-spacer{grid-area:1/3/span 2}.activity-progress-wrap{grid-template-columns:auto minmax(40px,1fr);max-width:none}}:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark;font-family:var(--font-sans,ui-sans-serif, system-ui, sans-serif);color:var(--color-text-primary,#f5f5f6);--tool-card-border:color-mix(in srgb, var(--color-border-primary,#414141) 74%, transparent);--tool-card-header-bg:color-mix(in srgb, var(--color-background-secondary,#272727) 88%, transparent);--tool-card-body-bg:color-mix(in srgb, var(--color-background-primary,#181818) 94%, transparent);--tool-card-hover-bg:color-mix(in srgb, var(--color-background-tertiary,#343434) 46%, transparent);--tool-card-divider:color-mix(in srgb, var(--color-border-primary,#414141) 66%, transparent);--tool-accent:var(--color-text-secondary,#b6b6bd);--scrollbar-thumb:color-mix(in srgb, var(--color-text-tertiary,#8a8a8a) 56%, transparent);--scrollbar-thumb-hover:color-mix(in srgb, var(--color-text-secondary,#a8a8a8) 82%, transparent);background:0 0}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial}}*{box-sizing:border-box}html,body{background:0 0;margin:0;overflow:hidden}.shell{width:100%;padding:0;overflow:hidden}.empty,.tool-card{--tool-accent-soft:color-mix(in srgb, var(--tool-accent) 12%, transparent);border:1px solid var(--tool-card-border);background:var(--tool-card-header-bg);width:100%;box-shadow:none;color:var(--color-text-primary,#f5f5f6);border-radius:12px;overflow:hidden}.tool-card.workspace,.tool-card.directory{--tool-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 34%, #3b82f6 66%)}.tool-card.read,.tool-card.search{--tool-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 32%, #06b6d4 68%)}.tool-card.write{--tool-accent:var(--color-success-text,#6fda83)}.tool-card.edit,.tool-card.review{--tool-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 28%, #d99742 72%)}.tool-card.delete{--tool-accent:var(--color-danger-text,#ee7676)}.tool-card.shell{--tool-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 42%, #64748b 58%)}.tool-card.state-success{--tool-accent:var(--color-success-text,#6fda83)}.tool-card.state-error{--tool-accent:var(--color-danger-text,#ee7676)}.tool-card.state-running{--tool-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 30%, #38bdf8 70%)}@supports selector(::-webkit-scrollbar){.pretty-scrollbar::-webkit-scrollbar{width:12px;height:12px}.pretty-scrollbar::-webkit-scrollbar-button{width:0;height:0;display:none}.pretty-scrollbar::-webkit-scrollbar-track{background:0 0}.pretty-scrollbar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);background-clip:content-box;border:4px solid #0000;border-radius:9999px}.pretty-scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover)}.pretty-scrollbar::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-hover)}.pretty-scrollbar::-webkit-scrollbar-corner{background:0 0}}.empty{color:var(--color-text-secondary,#b6b6bd);font-size:var(--font-text-sm-size,13px);padding:14px 16px}.tool-header{width:100%;min-height:64px;color:inherit;cursor:pointer;text-align:left;background:0 0;border:0;border-radius:11px;grid-template-columns:40px minmax(0,1fr) auto 20px;align-items:center;gap:12px;padding:10px 12px;display:grid}.tool-header:focus-visible,.review-diff-file-header:focus-visible,.review-more:focus-visible{outline:2px solid color-mix(in srgb, var(--tool-accent) 72%, transparent);outline-offset:-2px}.tool-header:hover:not(:disabled){background:var(--tool-card-hover-bg)}.tool-header:disabled{cursor:default}.tool-icon{border:1px solid color-mix(in srgb, var(--tool-accent) 18%, transparent);background:var(--tool-accent-soft);width:40px;height:40px;color:var(--tool-accent);border-radius:10px;place-items:center;display:grid}.icon-svg{stroke-width:1.8px;width:20px;height:20px;display:block}.tool-main{gap:2px;min-width:0;display:grid}.tool-title{color:var(--color-text-primary,#f5f5f6);font-size:var(--font-text-sm-size,14px);font-weight:550;line-height:1.3}.tool-label{color:var(--color-text-tertiary,#a3a3aa);font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);font-size:var(--font-text-xs-size,12px);text-overflow:ellipsis;white-space:nowrap;line-height:1.4;overflow:hidden}.stats{font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);font-size:var(--font-text-xs-size,12px);font-variant-numeric:tabular-nums;white-space:nowrap;align-items:center;gap:5px;display:inline-flex}.header-meta{color:var(--color-text-tertiary,#a3a3aa);font-size:var(--font-text-sm-size,12px);text-align:right;white-space:nowrap;line-height:1.35}.header-meta.empty{width:0}.add{color:var(--color-success-text,#6fda83)}.remove{color:var(--color-danger-text,#ee7676)}.chevron{width:20px;height:20px;color:var(--color-text-tertiary,#a3a3aa);border-radius:7px;place-items:center;transition:background .14s,color .14s,transform .14s;display:grid}.tool-header:hover:not(:disabled) .chevron{color:var(--color-text-primary,#f5f5f6)}.chevron .icon-svg{width:15px;height:15px}.chevron.expanded{transform:rotate(180deg)}.chevron.loading{transform:none}.chevron.loading .icon-svg{fill:none;stroke-linecap:round;stroke-dasharray:38 14;animation:.7s linear infinite payload-spinner}@keyframes payload-spinner{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.chevron.loading .icon-svg{animation:none}}.tool-body{border-top:1px solid var(--tool-card-divider);background:var(--tool-card-body-bg)}.workspace-details{max-height:420px;display:grid;overflow:auto}.workspace-rows{padding:4px 0;display:grid}.workspace-row{--workspace-row-accent:var(--tool-accent);grid-template-columns:22px minmax(116px,.24fr) minmax(0,1fr);align-items:center;gap:10px;min-height:40px;padding:7px 12px;display:grid}.workspace-row-icon{background:color-mix(in srgb, var(--workspace-row-accent) 9%, transparent);width:22px;height:22px;color:color-mix(in srgb, var(--workspace-row-accent) 72%, var(--color-text-tertiary,#a3a3aa));border-radius:6px;place-items:center;display:grid}.workspace-row-icon-svg{stroke-width:1.8px;width:14px;height:14px}.workspace-key{min-height:22px;color:var(--color-text-tertiary,#a3a3aa);font-size:var(--font-text-sm-size,12px);align-items:center;font-weight:500;display:flex}.workspace-value{min-width:0;color:var(--color-text-secondary,#c7c7ce);font-size:var(--font-text-sm-size,12px);text-overflow:ellipsis;white-space:nowrap;line-height:1.45;overflow:hidden}.workspace-value.mono{font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace)}.workspace-base-value{align-items:center;gap:7px;min-width:0;display:flex}.workspace-base-value .workspace-value{flex:0 auto}.workspace-base-warning{width:18px;height:18px;color:var(--color-warning-text,#e6b566);cursor:help;flex:none;place-items:center;display:grid}.workspace-base-warning-svg{stroke-width:2px;width:14px;height:14px}.workspace-chip-list{flex-wrap:nowrap;align-items:center;gap:6px;min-width:0;display:flex;overflow:hidden}.workspace-chip{border:1px solid color-mix(in srgb, var(--tool-accent) 16%, var(--tool-card-divider));background:color-mix(in srgb, var(--tool-accent) 7%, transparent);max-width:100%;min-height:24px;color:var(--color-text-secondary,#c7c7ce);text-overflow:ellipsis;white-space:nowrap;border-radius:9999px;flex:none;align-items:center;gap:5px;padding:3px 8px;font-size:11px;line-height:1.25;display:inline-flex;overflow:hidden}.workspace-chip-logo{object-fit:contain;flex:none;width:13px;height:13px;display:block}.workspace-chip-label{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.workspace-agent-profile{border:0;border-bottom:1px solid color-mix(in srgb, var(--tool-accent) 34%, var(--tool-card-divider));max-width:100%;min-height:24px;color:var(--color-text-secondary,#c7c7ce);white-space:nowrap;background:0 0;border-radius:0;align-items:center;gap:5px;padding:3px 2px 4px;font-size:11px;line-height:1.25;display:inline-flex;overflow:hidden}.workspace-agent-profile-logo{object-fit:contain;flex:none;width:14px;height:14px;display:block}.workspace-agent-profile:hover{border-bottom-color:var(--tool-accent);color:var(--color-text-primary,#f5f5f6)}.workspace-agent-profile.muted{color:var(--color-text-tertiary,#a3a3aa);opacity:.72;border-bottom-style:dashed}.workspace-provider-logo{cursor:help;flex:none;place-items:center;width:20px;height:24px;display:inline-grid}.workspace-provider-logo-image{object-fit:contain;width:16px;height:16px;display:block}.workspace-provider-logo.muted{opacity:.62}.workspace-chip.muted{color:var(--color-text-tertiary,#a3a3aa);opacity:.72;border-style:dashed}.workspace-skills-row,.workspace-instructions-row,.workspace-agents-row{align-items:start}.workspace-instructions-row{--workspace-row-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 28%, #d99742 72%)}.workspace-skills-row{--workspace-row-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 28%, #14b8a6 72%)}.workspace-agents-row{--workspace-row-accent:color-mix(in srgb, var(--color-text-primary,#f5f5f6) 30%, #8b5cf6 70%)}.workspace-skills-row .workspace-chip,.workspace-agents-row .workspace-chip,.workspace-agents-row .workspace-agent-profile{border-color:color-mix(in srgb, var(--workspace-row-accent) 28%, var(--tool-card-divider))}.workspace-skills-row .workspace-chip{background:color-mix(in srgb, var(--workspace-row-accent) 7%, transparent)}.workspace-skills-list,.workspace-agents-list{flex-wrap:wrap;overflow:visible}.workspace-instruction-status{border-radius:5px;flex:none;place-items:center;width:18px;height:18px;display:grid}.workspace-instruction-status.loaded{background:color-mix(in srgb, var(--color-success-text,#6fda83) 12%, transparent);color:var(--color-success-text,#6fda83)}.workspace-instruction-status.available{background:color-mix(in srgb, var(--color-text-tertiary,#a3a3aa) 9%, transparent);color:var(--color-text-tertiary,#a3a3aa)}.workspace-instruction-status-svg{stroke-width:1.9px;width:12px;height:12px}.workspace-instruction-list{border:1px solid var(--tool-card-divider);background:color-mix(in srgb, var(--tool-card-body-bg) 88%, transparent);border-radius:9px;min-width:0;display:grid;overflow:hidden}.workspace-instructions-content{min-width:0;display:block}.workspace-instructions-toggle{border:0;border-top:1px solid var(--tool-card-divider);background:color-mix(in srgb, var(--tool-card-body-bg) 72%, transparent);width:100%;min-height:32px;color:var(--tool-accent);cursor:pointer;font:inherit;font-size:var(--font-text-sm-size,11px);white-space:nowrap;border-radius:0 0 9px 9px;justify-content:center;align-items:center;padding:6px 10px;font-weight:550;line-height:1.25;display:flex}.workspace-instructions-toggle:hover{background:var(--tool-card-hover-bg)}.workspace-instructions-toggle:focus-visible{outline:2px solid color-mix(in srgb, var(--tool-accent) 72%, transparent);outline-offset:2px}.workspace-instruction-item+.workspace-instruction-item{border-top:1px solid var(--tool-card-divider)}.workspace-instruction-header{width:100%;min-width:0;color:inherit;font:inherit;text-align:left;background:0 0;border:0;grid-template-columns:22px minmax(0,1fr) 18px;align-items:center;gap:9px;padding:8px 10px;display:grid}.workspace-instruction-header.interactive{cursor:pointer}.workspace-instruction-header.interactive:hover{background:var(--tool-card-hover-bg)}.workspace-instruction-header.interactive:focus-visible{outline:2px solid color-mix(in srgb, var(--tool-accent) 72%, transparent);outline-offset:-2px}.workspace-instruction-text{gap:2px;min-width:0;display:grid}.workspace-instruction-name{min-width:0;color:var(--color-text-primary,#f5f5f6);font-size:var(--font-text-sm-size,12px);text-overflow:ellipsis;white-space:nowrap;font-weight:550;overflow:hidden}.workspace-instruction-path{min-width:0;color:var(--color-text-tertiary,#a3a3aa);font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:1.35;overflow:hidden}.workspace-instruction-chevron{width:18px;height:18px;color:var(--color-text-tertiary,#a3a3aa);place-items:center;transition:transform .14s;display:grid}.workspace-instruction-item.expanded .workspace-instruction-chevron{transform:rotate(180deg)}.workspace-instruction-chevron-svg{width:14px;height:14px}.workspace-instruction-preview{border-top:1px solid var(--tool-card-divider);background:color-mix(in srgb, var(--color-background-primary,#101114) 92%, transparent);max-height:300px;color:var(--color-text-secondary,#c7c7ce);font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);white-space:pre-wrap;overflow-wrap:break-word;margin:0;padding:10px 12px;font-size:11px;line-height:1.55;overflow:auto}.workspace-instruction-preview[hidden]{display:none}.review-header{grid-template-columns:40px minmax(0,1fr) auto 20px}.review-title-group{gap:3px;min-width:0;display:grid}.review-summary{border-top:1px solid var(--tool-card-divider);background:var(--tool-card-body-bg);display:grid}.review-diff-file-stats{align-items:center;gap:8px;display:flex}.review-empty{color:var(--color-text-secondary,#b7b7bf);font-size:var(--font-text-sm-size,13px)}.review-more{border:0;border-top:1px solid var(--tool-card-divider);width:100%;min-height:40px;color:var(--color-text-tertiary,#a3a3aa);cursor:pointer;font:inherit;font-size:var(--font-text-sm-size,12px);text-align:left;background:0 0;padding:0 12px}.review-more:hover{background:var(--tool-card-hover-bg);color:var(--color-text-primary,#f5f5f6)}.review-diff{max-height:520px;display:grid;overflow:hidden auto}.review-diff-files{gap:0;padding:0;display:grid}.review-diff-file{border:0;border-radius:0;overflow:hidden}.review-diff-file+.review-diff-file{border-top:1px solid var(--tool-card-divider)}.review-diff-file-header{width:100%;min-height:42px;color:var(--color-text-primary,#f5f5f6);cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:10px;padding:0 12px;display:grid}.review-file-kind{background:color-mix(in srgb, var(--color-text-tertiary,#a3a3aa) 10%, transparent);width:20px;height:20px;color:var(--color-text-tertiary,#a3a3aa);font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);border-radius:6px;align-self:center;place-items:center;font-size:10px;font-weight:700;display:grid}.review-file-kind.added{background:color-mix(in srgb, var(--color-success-text,#6fda83) 12%, transparent);color:var(--color-success-text,#6fda83)}.review-file-kind.edited,.review-file-kind.renamed,.review-file-kind.renamed-edited{background:color-mix(in srgb, var(--color-warning-text,#e6b566) 12%, transparent);color:var(--color-warning-text,#e6b566)}.review-file-kind.deleted{background:color-mix(in srgb, var(--color-danger-text,#ee7676) 12%, transparent);color:var(--color-danger-text,#ee7676)}.review-single-file{overflow:hidden}.review-diff-file-header:hover{background:var(--tool-card-hover-bg)}.review-diff-file-name,.review-diff-file-stats{text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:20px;overflow:hidden}.review-diff-file-name{font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace)}.review-diff-file-name.renamed{text-overflow:clip;align-items:center;gap:6px;min-width:0;display:flex}.review-diff-file-path{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:calc(50% - 10px);overflow:hidden}.review-diff-file-path.previous{color:var(--color-text-tertiary,#a3a3aa)}.review-diff-file-path.current{color:var(--color-text-primary,#f5f5f6)}.review-diff-file-arrow{color:var(--color-text-tertiary,#a3a3aa);font-family:var(--font-sans,ui-sans-serif, system-ui, sans-serif);flex:none}.review-diff-file-stats{font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);font-size:var(--font-text-sm-size,12px);font-variant-numeric:tabular-nums;justify-content:flex-end;overflow:visible}.status{font-size:var(--font-text-sm-size,12px);padding:10px 12px}.status.muted{color:var(--color-text-secondary,#b7b7bf)}.status.error{color:var(--color-danger-text,#ee7676)}.pierre-diff,.pierre-file{--diffs-bg:var(--tool-payload-bg,var(--color-background-primary,#101114));--diffs-light-bg:var(--color-background-primary,#fff);--diffs-dark-bg:var(--tool-payload-bg,var(--color-background-primary,#101114));--diffs-font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);--diffs-header-font-family:var(--font-sans,ui-sans-serif, system-ui, sans-serif);--diffs-font-size:var(--font-text-sm-size,12px);--diffs-line-height:20px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;max-height:420px;display:block;overflow:auto}.text-payload{max-height:420px;color:var(--color-text-secondary,#c7c7ce);font-family:var(--font-mono,ui-monospace, SFMono-Regular, monospace);font-size:var(--font-text-sm-size,12px);white-space:pre-wrap;overflow-wrap:break-word;margin:0;padding:10px 12px;line-height:1.55;overflow:auto}.text-payload.bash{color:var(--color-text-primary,#f5f5f6);background:var(--color-background-primary,#101114)}@media (width<=520px){.tool-header{grid-template-columns:36px minmax(0,1fr) auto 18px;gap:9px;min-height:58px;padding:9px 10px}.tool-icon{border-radius:9px;width:36px;height:36px}.chevron{width:18px;height:18px}.review-header{grid-template-columns:36px minmax(0,1fr) auto 18px}.workspace-row{grid-template-columns:22px minmax(0,1fr);gap:2px 8px;padding-block:8px}.workspace-row-icon{grid-row:1/span 2;align-self:start}.workspace-row>.workspace-key,.workspace-row>.workspace-value,.workspace-row>.workspace-chip-list,.workspace-row>.workspace-instructions-content{grid-column:2}}
@@ -0,0 +1 @@
1
+ import"./workspace-app-CxwJuZyS.js";import"./workspace-app-D6UR0AFl.js";document.documentElement.dataset.forgerelayApp=`workspace-lifecycle-compatibility`;