@akira-tl/forgerelay 0.8.5 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +8 -10
- package/dist/activity/audit-store.js +44 -6
- package/dist/activity/mcp-query-tools.js +53 -36
- package/dist/activity/query-service.js +41 -11
- package/dist/cli.js +16 -17
- package/dist/composite-activity.js +124 -33
- package/dist/config.js +8 -13
- package/dist/lsp/test-support/server-fixture.js +7 -7
- package/dist/process-sessions.js +2 -2
- package/dist/remote-auth.js +11 -1
- package/dist/remote-mcp-connection-pool.js +90 -0
- package/dist/remote-transport.js +28 -14
- package/dist/remote-workspace-relay.js +53 -23
- package/dist/server.js +70 -39
- package/dist/skills.js +1 -1
- package/dist/subagents/profiles.js +1 -2
- package/dist/subagents/providers/adapters/pi.js +2 -2
- package/dist/subagents/providers/availability.js +2 -2
- package/dist/subagents/providers/path.js +4 -4
- package/dist/ui/.vite/manifest.json +32 -32
- package/dist/ui/activity-panel-app.html +3 -3
- package/dist/ui/assets/{activity-panel-app-E1ju2dqI.js → activity-panel-app-CUAN6zyW.js} +1 -1
- package/dist/ui/assets/{heavy-payload-CeW-n9w5.js → heavy-payload-CgzrutLm.js} +1 -1
- package/dist/ui/assets/{review-payload-B9CO298v.js → review-payload-BrLbezbq.js} +1 -1
- package/dist/ui/assets/{scrollbar-C2twAENW.js → scrollbar-CbhpdW05.js} +1 -1
- package/dist/ui/assets/workspace-app-Bhj96tsR.js +1 -0
- package/dist/ui/assets/{workspace-app-CwbJnb_w.js → workspace-app-CxwJuZyS.js} +1 -1
- package/dist/ui/assets/{workspace-app-BztEvZIC.js → workspace-app-D6UR0AFl.js} +3 -3
- package/dist/ui/assets/workspace-app-ldjBmCJR.css +1 -0
- package/dist/ui/assets/workspace-lifecycle-app-Cqfhx9pV.js +1 -0
- package/dist/ui/workspace-app.html +4 -4
- package/dist/ui/workspace-lifecycle-app.html +4 -4
- package/dist/user-config.js +3 -19
- package/dist/workspace-presentation.js +69 -0
- package/docs/agent-profile-schema.md +4 -9
- package/docs/artifact-exchange.md +2 -1
- package/docs/chatgpt-coding-workflow.md +9 -9
- package/docs/configuration.md +20 -29
- package/docs/gotchas.md +10 -7
- package/docs/roadmap.md +6 -3
- package/docs/security.md +3 -2
- package/docs/setup.md +8 -5
- package/docs/versioning.md +1 -1
- package/package.json +3 -2
- package/scripts/debug/accept.mjs +7 -1
- package/scripts/debug/relay-accept.mjs +0 -1
- package/scripts/debug/runtime.mjs +0 -4
- package/scripts/debug/runtime.test.mjs +0 -2
- package/scripts/debug/traffic/run.sh +5 -0
- package/scripts/debug/traffic/traffic-audit.mjs +907 -0
- package/scripts/release/push-ready.mjs +124 -0
- package/scripts/release/push-ready.test.mjs +108 -0
- package/scripts/release/release-gate.test.mjs +1 -0
- package/scripts/release-proof.mjs +16 -1
- package/dist/ui/assets/workspace-app-YnUST8IP.css +0 -1
- package/dist/ui/assets/workspace-app-rKuhdae8.js +0 -1
- package/dist/ui/assets/workspace-lifecycle-app-CEfMdudP.js +0 -1
|
@@ -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-
|
|
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-
|
|
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`;
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>ForgeRelay Diff</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/workspace-app-
|
|
7
|
+
<script type="module" crossorigin src="./assets/workspace-app-Bhj96tsR.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="./assets/chunk-EyZ2wyi3.js">
|
|
9
|
-
<link rel="modulepreload" crossorigin href="./assets/workspace-app-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="./assets/workspace-app-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="./assets/workspace-app-
|
|
9
|
+
<link rel="modulepreload" crossorigin href="./assets/workspace-app-CxwJuZyS.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/workspace-app-D6UR0AFl.js">
|
|
11
|
+
<link rel="stylesheet" crossorigin href="./assets/workspace-app-ldjBmCJR.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<main id="app" class="shell">
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>ForgeRelay Workspace Lifecycle</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/workspace-lifecycle-app-
|
|
7
|
+
<script type="module" crossorigin src="./assets/workspace-lifecycle-app-Cqfhx9pV.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="./assets/chunk-EyZ2wyi3.js">
|
|
9
|
-
<link rel="modulepreload" crossorigin href="./assets/workspace-app-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="./assets/workspace-app-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="./assets/workspace-app-
|
|
9
|
+
<link rel="modulepreload" crossorigin href="./assets/workspace-app-CxwJuZyS.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/workspace-app-D6UR0AFl.js">
|
|
11
|
+
<link rel="stylesheet" crossorigin href="./assets/workspace-app-ldjBmCJR.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<main id="app" class="shell">
|
package/dist/user-config.js
CHANGED
|
@@ -9,14 +9,10 @@ const AUTH_LOCK_TIMEOUT_MS = 5_000;
|
|
|
9
9
|
const AUTH_LOCK_STALE_MS = 30_000;
|
|
10
10
|
const AUTH_LOCK_SLEEP = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
|
|
11
11
|
export function forgerelayConfigDir(env = process.env) {
|
|
12
|
-
const explicit = env.FORGERELAY_CONFIG_DIR
|
|
12
|
+
const explicit = env.FORGERELAY_CONFIG_DIR;
|
|
13
13
|
if (explicit)
|
|
14
14
|
return resolve(expandHomePath(explicit));
|
|
15
|
-
|
|
16
|
-
const legacy = join(homedir(), ".devspace");
|
|
17
|
-
if (existsSync(current) || !existsSync(legacy))
|
|
18
|
-
return resolve(current);
|
|
19
|
-
return resolve(legacy);
|
|
15
|
+
return resolve(join(homedir(), ".forgerelay"));
|
|
20
16
|
}
|
|
21
17
|
export function forgerelayConfigPath(env = process.env) {
|
|
22
18
|
return join(forgerelayConfigDir(env), "config.json");
|
|
@@ -56,7 +52,6 @@ export function loadForgeRelayFiles(env = process.env) {
|
|
|
56
52
|
auth: authExists ? readJsonFile(authPath) : {},
|
|
57
53
|
hooks: hooksExists ? readJsonFile(hooksPath) : {},
|
|
58
54
|
hookFiles: readHookFiles(join(dir, "hooks")),
|
|
59
|
-
usingLegacyDir: dir === resolve(join(homedir(), ".devspace")),
|
|
60
55
|
};
|
|
61
56
|
}
|
|
62
57
|
export function writeForgeRelayConfig(config, env = process.env) {
|
|
@@ -153,22 +148,11 @@ export function ensureForgeRelayDefaultSkills(env = process.env) {
|
|
|
153
148
|
return [targetPath];
|
|
154
149
|
}
|
|
155
150
|
export function resolveSubagentsFlag(config, env = process.env) {
|
|
156
|
-
const value = env.FORGERELAY_SUBAGENTS
|
|
151
|
+
const value = env.FORGERELAY_SUBAGENTS;
|
|
157
152
|
if (value === undefined)
|
|
158
153
|
return config.subagents;
|
|
159
154
|
return ["1", "true", "yes", "on"].includes(value.toLowerCase());
|
|
160
155
|
}
|
|
161
|
-
// Legacy exported names remain temporarily so existing integrations and tests do not
|
|
162
|
-
// break while the public product surface migrates to ForgeRelay.
|
|
163
|
-
export const devspaceConfigDir = forgerelayConfigDir;
|
|
164
|
-
export const devspaceConfigPath = forgerelayConfigPath;
|
|
165
|
-
export const devspaceAuthPath = forgerelayAuthPath;
|
|
166
|
-
export const devspaceSkillsDir = forgerelaySkillsDir;
|
|
167
|
-
export const devspaceAgentsDir = forgerelayAgentsDir;
|
|
168
|
-
export const loadDevspaceFiles = loadForgeRelayFiles;
|
|
169
|
-
export const writeDevspaceConfig = writeForgeRelayConfig;
|
|
170
|
-
export const writeDevspaceAuth = writeForgeRelayAuth;
|
|
171
|
-
export const ensureDevspaceDefaultSkills = ensureForgeRelayDefaultSkills;
|
|
172
156
|
function readHookFiles(directory) {
|
|
173
157
|
if (!existsSync(directory))
|
|
174
158
|
return {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
const PRESENTATION_FIELDS = [
|
|
3
|
+
"workspaceId",
|
|
4
|
+
"kind",
|
|
5
|
+
"name",
|
|
6
|
+
"members",
|
|
7
|
+
"root",
|
|
8
|
+
"path",
|
|
9
|
+
"mode",
|
|
10
|
+
"sourceRoot",
|
|
11
|
+
"workspaceReused",
|
|
12
|
+
"includeBootstrapContext",
|
|
13
|
+
"worktree",
|
|
14
|
+
"summary",
|
|
15
|
+
];
|
|
16
|
+
export function compactWorkspacePresentation(card) {
|
|
17
|
+
const presentation = {};
|
|
18
|
+
for (const field of PRESENTATION_FIELDS) {
|
|
19
|
+
const value = card[field];
|
|
20
|
+
if (value !== undefined)
|
|
21
|
+
presentation[field] = value;
|
|
22
|
+
}
|
|
23
|
+
assignProjectedArray(presentation, "agentsFiles", card.agentsFiles, (entry) => pickFields(entry, ["path"]));
|
|
24
|
+
assignProjectedArray(presentation, "availableAgentsFiles", card.availableAgentsFiles, (entry) => pickFields(entry, ["path"]));
|
|
25
|
+
assignProjectedArray(presentation, "skills", card.skills, (entry) => pickFields(entry, ["name"]));
|
|
26
|
+
assignProjectedArray(presentation, "agentProviders", card.agentProviders, (entry) => pickFields(entry, ["name", "available", "reason"]));
|
|
27
|
+
assignProjectedArray(presentation, "agents", card.agents, (entry) => pickFields(entry, [
|
|
28
|
+
"name",
|
|
29
|
+
"provider",
|
|
30
|
+
"model",
|
|
31
|
+
"providerAvailable",
|
|
32
|
+
]));
|
|
33
|
+
presentation.presentationRevision = presentationRevision(card, presentation);
|
|
34
|
+
return presentation;
|
|
35
|
+
}
|
|
36
|
+
function assignProjectedArray(target, field, value, project) {
|
|
37
|
+
if (!Array.isArray(value))
|
|
38
|
+
return;
|
|
39
|
+
const projected = value.flatMap((entry) => {
|
|
40
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry))
|
|
41
|
+
return [];
|
|
42
|
+
const item = project(entry);
|
|
43
|
+
return Object.keys(item).length > 0 ? [item] : [];
|
|
44
|
+
});
|
|
45
|
+
target[field] = projected;
|
|
46
|
+
}
|
|
47
|
+
function pickFields(value, fields) {
|
|
48
|
+
const projected = {};
|
|
49
|
+
for (const field of fields) {
|
|
50
|
+
const entry = value[field];
|
|
51
|
+
if (typeof entry === "string" ||
|
|
52
|
+
typeof entry === "boolean" ||
|
|
53
|
+
typeof entry === "number") {
|
|
54
|
+
projected[field] = entry;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return projected;
|
|
58
|
+
}
|
|
59
|
+
function presentationRevision(card, presentation) {
|
|
60
|
+
if (typeof card.presentationRevision === "string" && card.presentationRevision.length > 0) {
|
|
61
|
+
return card.presentationRevision;
|
|
62
|
+
}
|
|
63
|
+
if (typeof card.contextFingerprint === "string" && card.contextFingerprint.length > 0) {
|
|
64
|
+
return card.contextFingerprint;
|
|
65
|
+
}
|
|
66
|
+
return createHash("sha256")
|
|
67
|
+
.update(JSON.stringify(presentation))
|
|
68
|
+
.digest("hex");
|
|
69
|
+
}
|
|
@@ -13,15 +13,10 @@ New locations:
|
|
|
13
13
|
.forgerelay/agents/*.md
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
.devspace/agents/*.md
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
When an existing legacy config directory is reused, its global `agents` folder
|
|
24
|
-
remains active automatically.
|
|
16
|
+
Rename-era DevSpace profile discovery has ended. `~/.devspace/agents/*.md` and
|
|
17
|
+
`.devspace/agents/*.md` are not scanned automatically. Move older profiles into
|
|
18
|
+
a canonical ForgeRelay location, or temporarily point `FORGERELAY_CONFIG_DIR`
|
|
19
|
+
at the old global config directory while migrating.
|
|
25
20
|
|
|
26
21
|
## Example
|
|
27
22
|
|
|
@@ -9,7 +9,8 @@ Enable the capability with:
|
|
|
9
9
|
FORGERELAY_ARTIFACTS=1 forgerelay serve
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Use the canonical `FORGERELAY_ARTIFACTS` variable; the old
|
|
13
|
+
`DEVSPACE_ARTIFACTS` name is no longer read.
|
|
13
14
|
|
|
14
15
|
## Workflow
|
|
15
16
|
|
|
@@ -244,14 +244,15 @@ files in the skill directory.
|
|
|
244
244
|
|
|
245
245
|
## Local subagent profiles
|
|
246
246
|
|
|
247
|
-
With `FORGERELAY_SUBAGENTS=1`, profiles are discovered from the active
|
|
248
|
-
config directory plus:
|
|
247
|
+
With `FORGERELAY_SUBAGENTS=1`, profiles are discovered from the active ForgeRelay
|
|
248
|
+
global config directory plus:
|
|
249
249
|
|
|
250
250
|
```text
|
|
251
251
|
.forgerelay/agents/*.md
|
|
252
|
-
.devspace/agents/*.md # migration compatibility
|
|
253
252
|
```
|
|
254
253
|
|
|
254
|
+
Rename-era `.devspace/agents` discovery has ended.
|
|
255
|
+
|
|
255
256
|
The workspace result exposes only compact profile metadata so the host can
|
|
256
257
|
choose a provider/profile without loading full provider launch details. Read the
|
|
257
258
|
ForgeRelay-owned `subagents` capability guide when delegation is actually needed;
|
|
@@ -349,9 +350,8 @@ and keeps widget usage focused on workspace/change review.
|
|
|
349
350
|
|
|
350
351
|
## Legacy configuration
|
|
351
352
|
|
|
352
|
-
`FORGERELAY_*` is the canonical environment-variable prefix.
|
|
353
|
-
`DEVSPACE_*`
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
[Configuration Reference](configuration.md) for the compatibility rules.
|
|
353
|
+
`FORGERELAY_*` is the canonical environment-variable prefix. Rename-era
|
|
354
|
+
`DEVSPACE_*` fallbacks and automatic `~/.devspace` reuse have ended. Migrate
|
|
355
|
+
older installations explicitly; persisted internal identifiers that would
|
|
356
|
+
otherwise orphan state remain compatible. See
|
|
357
|
+
[Configuration Reference](configuration.md) for the current rules.
|