agl 44.0.0 → 44.0.1
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
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-11-19 - 44.0.1
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- ChatGPT accounts list GPT-6.2 Sol and GPT-6.2 Astra again: AGL uses FlexHarness 18.3.1, which asks for the account's ChatGPT model catalog as client version 0.170.0 instead of 0.159.0 (an older client version leaves the GPT-6.2 models out of the catalog).
|
|
8
|
+
|
|
9
|
+
### Maintenance
|
|
10
|
+
|
|
11
|
+
- Release tooling: pnpm 12.20.0 (from 12.19.0; 12.21.0 and later are younger than the seven-day minimum release age); @git.zone/tsrepo 2.2.0 and @types/node 26.6.6 are current.
|
|
12
|
+
- Release: the end-to-end suite (`pnpm test:e2e`, about an hour) no longer gates `gitzone release`; it runs after publishing.
|
|
13
|
+
|
|
3
14
|
## 2026-11-18 - 44.0.0
|
|
4
15
|
|
|
5
16
|
### Breaking Changes
|
package/dist_serve/bundle.js
CHANGED
|
@@ -49855,7 +49855,7 @@ description:
|
|
|
49855
49855
|
`},"renderProjectsSettings");var{html:DB}=oe,Pxr={claude:{name:"Claude Code",mark:"claude"},codex:{name:"Codex",mark:"codex"},opencode:{name:"OpenCode",mark:"opencode"},flex:{name:"Flex",mark:"flex"}},Tvs=n(i=>{let e=i?Date.parse(i):Number.NaN;return Number.isFinite(e)?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""},"clock"),Oxr=n(i=>{let e=i.files.filter(s=>s.kind!=="unchanged").length,t=n(s=>`${s} ${s===1?"file differs":"files differ"}`,"files");switch(i.state){case"in_sync":return{pill:"In sync",tone:"success",review:!1,text:i.targetId==="flex"?"The next Flex run picks up the latest projection.":"Its files match the latest projection."};case"changes_pending":return{pill:"Changes pending",tone:"warning",review:!0,text:e?`${t(e)} from the latest projection.`:"The latest projection is not applied yet."};case"drifted":return{pill:"Edited outside AGL",tone:"warning",review:!0,text:i.externallyEditedFiles?.length?`${i.externallyEditedFiles.join(", ")} ${i.externallyEditedFiles.length===1?"was":"were"} edited outside AGL.`:"Its files were edited outside AGL."};case"blocked":return{pill:"Blocked",tone:"error",review:!0,text:i.diagnostics.find(s=>s.severity==="error")?.message??"The latest projection cannot be applied to it as it is."};case"applying":return{pill:"Applying",tone:"primary",review:!1,text:"An apply is under way."};case"unbound":return{pill:"Not connected",tone:"default",review:!0,text:"AGL does not write its home yet; connect it in the configuration."}}},"configurationHarnessView"),Evs=n((i,e)=>{let s=(i.state==="read"?i.configuration:null)?.projection,r=[{rows:[{key:"open",icon:"lucide:Files",label:"One master configuration for every harness",description:"Instructions, drivers, inference, skills, agents, commands, MCP servers and command policy. Flex projects it onto each harness; you review and apply each one's changes.",control:DB`<dees-button class="settingsConfigurationOpen" data-action="openConfiguration" size="sm" type="accent"
|
|
49856
49856
|
text="Open configuration" @clicked=${()=>e.open()}></dees-button>`}]},{header:"Harnesses",headerSuffix:DB`<span>${s?Tvs(s.createdAt)?`Projected ${Tvs(s.createdAt)}`:"Projected":i.state==="read"?"Not projected yet":""}</span>`,footer:"Read when this section opens. Routing through the AGL proxy is set under Inference in the configuration; from a terminal, agl config does the same.",rows:i.state==="read"?i.configuration.harnesses.map(a=>{let o=Oxr(a),l=Pxr[a.targetId];return{key:`harness-${a.targetId}`,leading:DB`<mp-harness-mark .harness=${l.mark}></mp-harness-mark>`,label:l.name,description:o.text,accessory:DB`<dees-badge data-harness-state=${a.state} .type=${o.tone} .text=${o.pill}></dees-badge>`,...o.review?{control:DB`<dees-button class="settingsConfigurationReview" data-harness=${a.targetId}
|
|
49857
49857
|
size="sm" type="ghost" text="Review" @clicked=${()=>e.review(a.targetId)}></dees-button>`}:{}}}):[{key:"harnesses",label:i.state==="failed"?"The harnesses could not be read":"Reading the harnesses\u2026",...i.state==="failed"?{description:i.message,control:DB`<dees-button class="settingsConfigurationReread" size="sm" type="ghost" text="Read again"
|
|
49858
|
-
@clicked=${()=>e.reread()}></dees-button>`}:{}}]}];return DB`<dees-grouped-list class="settingsConfiguration" .inset=${!1} .sections=${r}></dees-grouped-list>`},"renderConfigurationSettings");var rCe={name:"agl",version:"44.0.0",description:"Agent Gateway Layer for OpenCode, FlexHarness, and Codex sessions"};fRe();var Rvs="agl",Ivs={handoff:"agl.auth.handoff",bundleReload:"agl.bundle.reload"},Axr=5e3,Lxr=1e3,Nxr=2e4,dYt=n(i=>typeof i=="object"&&i!==null&&!Array.isArray(i),"isRecord"),uYt=n(i=>typeof i=="string"&&i.length>0&&i.length<=256,"isShortString"),n8e=class{constructor(e){this.options=e;let{comms:t}=e;this.subscriptions.push(t.subscribe("signedIn",()=>e.onSignedIn()),t.subscribe("signedOut",()=>e.onSignedOut()),t.subscribe("layout",s=>this.receiveLayout(s)),t.subscribe("bundleReloaded",s=>this.receiveBundleOutcome(s)))}options;static{n(this,"ControllerTabSync")}subscriptions=[];pendingHandoffs=new Set;pendingReloads=new Map;handoffLease;handoffHandlerRemoved=Promise.resolve();releaseReloadLease;closed=!1;setAuthenticated(e){if(this.closed)return;if(!e){this.endHandoffLease();return}if(this.handoffLease)return;let t,s=new Promise(o=>{t=o}),r={abort:new AbortController,granted:s,grant:t};this.handoffLease=r;let{locks:a}=this.options;if(!a){this.answerHandoffs(r);return}a.request(Ivs.handoff,{signal:r.abort.signal},()=>new Promise(o=>{if(this.handoffLease!==r){o();return}r.release=o,this.answerHandoffs(r)})).catch(()=>{})}async announceSignedIn(){this.setAuthenticated(!0);let e=this.handoffLease;if(e){let t;await Promise.race([e.granted,new Promise(s=>{t=setTimeout(s,Lxr)})]),clearTimeout(t)}await this.send("signedIn",{})}announceSignedOut(){this.send("signedOut",{})}publishLayout(e){this.send("layout",e)}async requestHandoff(e=Axr){if(this.closed)return;let t=new AbortController;this.pendingHandoffs.add(t);try{let s=await this.options.comms.createTypedRequest("handoff").fire({},{timeoutMs:e,abortSignal:t.signal});return dYt(s)&&uYt(s.resumeToken)?s.resumeToken:void 0}catch{return}finally{this.pendingHandoffs.delete(t)}}coordinateBundleReload(e,t=Nxr){let{locks:s}=this.options;return this.closed||!s||this.releaseReloadLease?Promise.resolve("lead"):new Promise(r=>{s.request(Ivs.bundleReload,{ifAvailable:!0},async a=>{if(a){if(r("lead"),this.closed)return;await new Promise(o=>{this.releaseReloadLease=o});return}r(await this.awaitBundleOutcome(e,t))}).catch(()=>r("lead"))})}releaseBundleReloadLead(){this.releaseReloadLease?.(),this.releaseReloadLease=void 0}announceBundleOutcome(e,t){this.send("bundleReloaded",{version:e,outcome:t})}async close(){if(!this.closed){this.closed=!0;for(let e of this.subscriptions.splice(0))e.unsubscribe();for(let e of[...this.pendingHandoffs])e.abort();for(let e of[...this.pendingReloads.values()])for(let t of[...e])t("timeout");this.endHandoffLease(),this.releaseBundleReloadLead(),await this.options.comms.close()}}endHandoffLease(){let e=this.handoffLease;this.handoffLease=void 0,e&&(e.abort.abort(),e.handler&&(this.handoffHandlerRemoved=e.handler.then(t=>t?.remove())),e.release?.())}answerHandoffs(e){e.handler=this.handoffHandlerRemoved.then(()=>this.handoffLease===e?this.options.comms.createTypedHandler("handoff",()=>this.answerHandoff(e)):void 0).catch(()=>{}),e.handler.then(()=>e.grant())}async send(e,t){if(this.closed)return!1;try{return await this.options.comms.broadcast(e,t),!0}catch{return!1}}async answerHandoff(e){let t;if(this.handoffLease===e)try{t=await this.options.mintHandoff()}catch{t=void 0}if(this.handoffLease!==e||!uYt(t))throw new _g.TypedResponseError("handoff_unavailable");return{resumeToken:t}}receiveLayout(e){if(!dYt(e))return;let t={};typeof e.sidebarWidth=="number"&&Number.isFinite(e.sidebarWidth)&&(t.sidebarWidth=e.sidebarWidth),typeof e.browserSidebarVisible=="boolean"&&(t.browserSidebarVisible=e.browserSidebarVisible),(e.browserPresentation==="default"||e.browserPresentation==="paint"||e.browserPresentation==="video")&&(t.browserPresentation=e.browserPresentation),(e.paintRendering==="gpu"||e.paintRendering==="software")&&(t.paintRendering=e.paintRendering),Object.keys(t).length>0&&this.options.onLayout(t)}awaitBundleOutcome(e,t){return this.closed?Promise.resolve("timeout"):new Promise(s=>{let r=this.pendingReloads.get(e);r||(r=new Set,this.pendingReloads.set(e,r));let a=n(l=>{clearTimeout(o),r.delete(a),r.size===0&&this.pendingReloads.get(e)===r&&this.pendingReloads.delete(e),s(l)},"finish"),o=setTimeout(()=>a("timeout"),t);r.add(a)})}receiveBundleOutcome(e){if(!dYt(e)||!uYt(e.version)||e.outcome!=="current"&&e.outcome!=="stale")return;let t=e.outcome;for(let s of[...this.pendingReloads.get(e.version)??[]])s(t)}};var Mvs=n((i,e,t)=>{let{statuses:s,finished:r,errors:a,optimistic:o}=i;if(t.sessionError===!0){s.set(e,"error"),a.add(e),r.delete(e),o.delete(e);return}let l=t.sessionStatus;if(l===void 0)return;let c=s.get(e),d=c==="busy"||c==="retry"||o.has(e);s.set(e,l),l==="busy"||l==="retry"?(a.delete(e),r.delete(e),o.delete(e)):l==="idle"?(o.delete(e),d&&!a.has(e)&&r.add(e)):(a.add(e),r.delete(e),o.delete(e))},"applySessionCardEvent");var $xr=4,hYt="Show the page's video in Paint",Dvs=n(async(i,e)=>{e.throwIfAborted();let t;try{return await Promise.race([i(),new Promise((s,r)=>{t=n(()=>r(e.reason),"onAbort"),e.addEventListener("abort",t,{once:!0})})])}finally{t&&e.removeEventListener("abort",t)}},"settleWithin"),Fxr=n((i,e,t)=>Dvs(()=>i.send(e),t),"sendWithin"),Bxr=n(i=>{if(i instanceof ji.TypedResponseError){let t=i.errorData?.code;if(t==="paint_unavailable"||t==="paint_capture_unavailable")return{kind:"paint-refused",code:t,message:i.errorText}}let e=Bke(i);return e===void 0?void 0:{kind:"viewer-cannot-render",failure:e}},"paintOpenFallback"),nCe=class{constructor(e){this.options=e;this.switcher=new yB({surface:e.surface,capture:n(()=>this.renderer instanceof my?e.canvas:this.renderer?e.video:void 0,"capture"),open:n((t,s)=>t==="paint"?this.openPaint(s):this.openVideo(s),"open"),onError:n(t=>e.onError("Show the browser view",t),"onError")})}options;static{n(this,"ControllerBrowserPresentation")}switcher;renderer;paint;paintOpening=!1;pendingVideoRoutes=[];audio;closed=!1;currentChoice;get mode(){return this.switcher.mode}get choice(){return this.currentChoice}static initialChoice(e,t,s){let r=t==="default"?"controller":"device",a=t==="default"?e:t;return a==="paint"&&s?.paint.state==="unavailable"?{requested:a,reason:{source:r,fallback:{kind:"paint-unavailable",paint:s.paint}}}:{requested:a,reason:{source:r}}}async start(e,t){await this.present(e,t)}async switchTo(e,t){await this.present({requested:e,reason:{source:"view"}},t)}async present(e,t){if(this.closed)return;this.setChoice(e);let s=e.reason.fallback?"video":e.requested;try{await this.switcher.switchTo(s,t)}catch(r){if(this.closed||t?.aborted||s!=="paint")throw r;let a=Bxr(r);if(a===void 0)throw r;this.setChoice({requested:e.requested,reason:{...e.reason,fallback:a}}),await this.switcher.switchTo("video",t)}}fallBackToVideo(e){let t=this.currentChoice;this.closed||!t||(this.setChoice({requested:t.requested,reason:{...t.reason,fallback:e}}),this.switcher.switchTo("video").catch(s=>this.options.onError("Show the browser view",s)))}setChoice(e){this.currentChoice=e,this.options.onChoice(e)}async activateSound(){let e=this.renderer;if(!e)throw new Error("The browser view shows nothing yet.");await e.activateAudio()}get soundAvailable(){return this.options.presentation()?.audio.state==="available"}handlePaintTermination(e){let t=this.paint;!t||t.response.paintId!==e.paintId||t.presenter.terminateFromControl(e.source,e.termination)}handleVideoRouteRequest(e){let t=this.paint;if(t&&t.response.paintId===e.paintId){this.openVideoRoute(t,e.routeId).catch(s=>{this.isCurrentPaint(t)&&this.options.onError(hYt,s)});return}this.paintOpening&&this.pendingVideoRoutes.length<$xr&&this.pendingVideoRoutes.push({paintId:e.paintId,routeId:e.routeId})}async close(){if(this.closed)return;this.closed=!0,this.pendingVideoRoutes.length=0;let e=await Promise.allSettled([this.switcher.close()]),t=this.audio;this.audio=void 0;let s=await Promise.allSettled([t?.dispose()]),r=[...e,...s].flatMap(a=>a.status==="rejected"?[a.reason]:[]);if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Browser presentation cleanup is incomplete.")}async openVideo(e){let t=await this.audioLifecycle();e.throwIfAborted();let s=new CC({video:this.options.video,client:this.options.client,...t===void 0?{}:{audio:t},focusTarget:this.options.surface,resizeTarget:this.options.surface,onError:n(r=>this.options.onRendererError(r),"onError")});this.setRenderer(s);try{await this.options.startRenderer(s)}catch(r){throw await this.options.stopRenderer(s),this.clearRenderer(s),r}return{firstFrame:s.firstFrame,stop:n(async()=>{try{await this.options.stopRenderer(s)}finally{this.clearRenderer(s)}},"stop")}}async openPaint(e){let t=await this.options.assets(),s=await this.audioLifecycle();e.throwIfAborted();let r=new my({canvas:this.options.canvas,client:this.options.client,...s===void 0?{}:{audio:s},focusTarget:this.options.surface,resizeTarget:this.options.surface,picture:{...$8,...t.paint,...Vds(this.options.paintRendering())},originalVideo:Dke,onError:n(o=>{Bke(o.cause)===void 0&&this.options.onRendererError(o)},"onError")});this.setRenderer(r),this.paintOpening=!0;let a;try{await this.options.startRenderer(r);let o=r.pictureRenderer?.videoWorkerIncarnation;if(!o)throw new Error("The Paint renderer has no worker.");a=await this.options.socket.fire("controller.browser.paint.open",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration,workerIncarnation:o},{maxRetries:0,abortSignal:e});let l=a;await Dvs(()=>Promise.all([l.packets.opened,l.control.opened]),e);let c=new AbortController,d=new oB({expectedHello:l.hello,renderer:r,sendPacket:n((h,p)=>Fxr(l.control,h,p),"sendPacket"),closeSource:n(()=>this.closePaintSource(l),"closeSource"),onFailure:n(h=>{Bke(h)===void 0&&this.options.onError("Run the browser Paint view",h)},"onFailure"),onTermination:n(h=>this.onPaintTermination(l.paintId,h),"onTermination"),signal:c.signal}),u={response:l,presenter:d,renderer:r,routes:new Set,abortController:c,removeSessionEnd:r.observePaintSessionEnd(h=>{this.closeVideoRoutes(u),this.onPaintSessionEnd(u,h)})};this.paint=u,this.receivePaintPackets(u);for(let h of this.pendingVideoRoutes.splice(0))h.paintId===l.paintId&&this.openVideoRoute(u,h.routeId).catch(p=>{this.isCurrentPaint(u)&&this.options.onError(hYt,p)});return{firstFrame:r.firstFrame,stop:n(()=>this.stopPaint(u),"stop")}}catch(o){throw a&&await this.closePaintSource(a).catch(()=>{}),await r.stop().catch(()=>{}),this.clearRenderer(r),o}finally{this.paintOpening=!1,this.pendingVideoRoutes.length=0}}async receivePaintPackets(e){try{for(;!e.abortController.signal.aborted;){let t=await e.response.packets.receive();if(t===void 0){await e.response.packets.accept();return}e.presenter.receivePacket(t)}}catch(t){if(this.paint!==e||e.abortController.signal.aborted)return;this.options.onError("Run the browser Paint view",t),await this.stopPaint(e).catch(()=>{})}}onPaintTermination(e,t){this.paint?.response.paintId!==e||this.closed||(t.kind==="unsupported"?this.fallBackToVideo({kind:"page-unsupported",reasonCode:t.reasonCode}):t.kind==="failure"&&this.options.onError("Run the browser Paint view",new Error(t.message)))}onPaintSessionEnd(e,t){if(this.paint!==e||this.closed||t===void 0)return;let s=Bke(t);s!==void 0&&this.fallBackToVideo({kind:"viewer-cannot-render",failure:s})}isCurrentPaint(e){return this.paint===e&&!this.closed}async stopPaint(e){this.paint===e&&(this.paint=void 0),e.abortController.abort(new Error("The Paint stream closed.")),e.removeSessionEnd(),this.closeVideoRoutes(e);try{await e.presenter.close()}finally{this.clearRenderer(e.renderer)}}async closePaintSource(e){let t=new Error("The Paint stream closed.");await Promise.allSettled([e.packets.abort(t),e.control.abort(t)]),this.options.socket.isConnected&&await this.options.socket.fire("controller.browser.paint.close",{viewId:this.options.viewId,paintId:e.paintId,streamGeneration:this.options.streamGeneration},{maxRetries:0})}async openVideoRoute(e,t){let s=e.renderer.pictureRenderer;if(!s)throw new Error("The Paint renderer has no worker.");let r=await this.options.socket.fire("controller.browser.paint.video.openRoute",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration,paintId:e.response.paintId,routeId:t},{maxRetries:0,abortSignal:e.abortController.signal}),a=new bB({...Mke,routeId:r.routeId,packets:r.packets,receipts:r.receipts,renderer:s,signal:e.abortController.signal,onEnded:n(()=>{e.routes.delete(a)},"onEnded"),onFailure:n(o=>{e.routes.delete(a),this.isCurrentPaint(e)&&this.options.onError(hYt,o)},"onFailure")});e.routes.add(a);try{await a.start()}catch(o){throw e.routes.delete(a),o}}closeVideoRoutes(e){for(let t of e.routes)t.close().catch(s=>this.options.onError("Close the browser view's video",s));e.routes.clear()}async audioLifecycle(){if(this.options.presentation()?.audio.state!=="available")return;if(this.audio)return this.audio;let e=await this.options.assets();if(this.audio)return this.audio;let t={openAudioRelay:n(s=>this.openAudioRelay(s),"openAudioRelay")};return this.audio=new hB({viewerId:this.options.viewId,client:new pB(t),assets:e.audio,sampleCreditBytes:e.audioSampleCredit.bytes,sampleCreditEvents:e.audioSampleCredit.events,clockPolicy:Cke,onError:n(s=>this.options.onError("Play the browser sound",s),"onError")}),this.audio}async openAudioRelay(e){let t=await this.options.socket.fire("controller.browser.audio.open",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration},{maxRetries:0,abortSignal:e.signal}),r=await new mB({events:t.events,operations:t.operations,sampleCreditBytes:t.sampleCredit.bytes,sampleCreditEvents:t.sampleCredit.events,signal:e.signal}).openAudioRelay(e);return{sendCommand:n(a=>r.sendCommand(a),"sendCommand"),close:n(async()=>{try{await r.close()}finally{this.options.socket.isConnected&&await this.options.socket.fire("controller.browser.audio.close",{viewId:this.options.viewId,audioId:t.audioId,streamGeneration:this.options.streamGeneration},{maxRetries:0}).catch(()=>{})}},"close")}}setRenderer(e){this.renderer=e,this.options.surface.dataset.presentation=e instanceof my?"paint":"video",this.options.onRenderer(e)}clearRenderer(e){this.renderer===e&&(this.renderer=void 0,this.options.onRenderer(void 0))}};var pYt=n((i,e,t)=>`${i}:${e}\0${t}`,"projectMutationScope"),Pvs=n((i,e)=>pYt("draft",i,`${e}`),"draftScopeOf"),Ovs=n((i,e)=>pYt("conversation",i,e),"conversationScopeOf"),a8e=class{constructor(e){this.onChange=e}onChange;static{n(this,"ControllerMutationLocks")}held=new Map;startedCount=0;get started(){return this.startedCount}get anyHeld(){return this.held.size>0}isHeld(e){return this.held.has(e)}isProjectHeld(e){let t=["draft","conversation"].map(s=>pYt(s,e,""));return[...this.held.keys()].some(s=>t.some(r=>s.startsWith(r)))}holds(e){return[...this.held.values()].includes(e)}acquire(e){if(this.held.has(e))return;let t=Symbol(e);return this.held.set(e,t),this.startedCount+=1,this.onChange(),t}release(e){for(let[t,s]of this.held)if(s===e)return this.held.delete(t),this.onChange(),!0;return!1}releaseAll(){this.held.size!==0&&(this.held.clear(),this.onChange())}};var A$c=50,Avs=n((i,e)=>[...i,e].slice(-50),"appendErrorJournalEntry"),fYt=n(i=>Number.isFinite(i)?new Date(i).toISOString():"unknown","formatTimestamp"),zxr=n((i,e)=>{let t=[`[${e}] ${fYt(i.at)} - ${i.operation}`,`message: ${i.message}`];i.reference!==void 0&&t.push(`reference: ${i.reference}`);let s=i.detail;return s!==void 0?(t.push(`controller operation: ${s.operation}`,`controller time: ${fYt(s.at)}`,`controller cause: ${s.name}: ${s.message}`),s.stack&&t.push("controller stack:",s.stack)):i.reference!==void 0&&t.push("controller cause: unavailable"),t.join(`
|
|
49858
|
+
@clicked=${()=>e.reread()}></dees-button>`}:{}}]}];return DB`<dees-grouped-list class="settingsConfiguration" .inset=${!1} .sections=${r}></dees-grouped-list>`},"renderConfigurationSettings");var rCe={name:"agl",version:"44.0.1",description:"Agent Gateway Layer for OpenCode, FlexHarness, and Codex sessions"};fRe();var Rvs="agl",Ivs={handoff:"agl.auth.handoff",bundleReload:"agl.bundle.reload"},Axr=5e3,Lxr=1e3,Nxr=2e4,dYt=n(i=>typeof i=="object"&&i!==null&&!Array.isArray(i),"isRecord"),uYt=n(i=>typeof i=="string"&&i.length>0&&i.length<=256,"isShortString"),n8e=class{constructor(e){this.options=e;let{comms:t}=e;this.subscriptions.push(t.subscribe("signedIn",()=>e.onSignedIn()),t.subscribe("signedOut",()=>e.onSignedOut()),t.subscribe("layout",s=>this.receiveLayout(s)),t.subscribe("bundleReloaded",s=>this.receiveBundleOutcome(s)))}options;static{n(this,"ControllerTabSync")}subscriptions=[];pendingHandoffs=new Set;pendingReloads=new Map;handoffLease;handoffHandlerRemoved=Promise.resolve();releaseReloadLease;closed=!1;setAuthenticated(e){if(this.closed)return;if(!e){this.endHandoffLease();return}if(this.handoffLease)return;let t,s=new Promise(o=>{t=o}),r={abort:new AbortController,granted:s,grant:t};this.handoffLease=r;let{locks:a}=this.options;if(!a){this.answerHandoffs(r);return}a.request(Ivs.handoff,{signal:r.abort.signal},()=>new Promise(o=>{if(this.handoffLease!==r){o();return}r.release=o,this.answerHandoffs(r)})).catch(()=>{})}async announceSignedIn(){this.setAuthenticated(!0);let e=this.handoffLease;if(e){let t;await Promise.race([e.granted,new Promise(s=>{t=setTimeout(s,Lxr)})]),clearTimeout(t)}await this.send("signedIn",{})}announceSignedOut(){this.send("signedOut",{})}publishLayout(e){this.send("layout",e)}async requestHandoff(e=Axr){if(this.closed)return;let t=new AbortController;this.pendingHandoffs.add(t);try{let s=await this.options.comms.createTypedRequest("handoff").fire({},{timeoutMs:e,abortSignal:t.signal});return dYt(s)&&uYt(s.resumeToken)?s.resumeToken:void 0}catch{return}finally{this.pendingHandoffs.delete(t)}}coordinateBundleReload(e,t=Nxr){let{locks:s}=this.options;return this.closed||!s||this.releaseReloadLease?Promise.resolve("lead"):new Promise(r=>{s.request(Ivs.bundleReload,{ifAvailable:!0},async a=>{if(a){if(r("lead"),this.closed)return;await new Promise(o=>{this.releaseReloadLease=o});return}r(await this.awaitBundleOutcome(e,t))}).catch(()=>r("lead"))})}releaseBundleReloadLead(){this.releaseReloadLease?.(),this.releaseReloadLease=void 0}announceBundleOutcome(e,t){this.send("bundleReloaded",{version:e,outcome:t})}async close(){if(!this.closed){this.closed=!0;for(let e of this.subscriptions.splice(0))e.unsubscribe();for(let e of[...this.pendingHandoffs])e.abort();for(let e of[...this.pendingReloads.values()])for(let t of[...e])t("timeout");this.endHandoffLease(),this.releaseBundleReloadLead(),await this.options.comms.close()}}endHandoffLease(){let e=this.handoffLease;this.handoffLease=void 0,e&&(e.abort.abort(),e.handler&&(this.handoffHandlerRemoved=e.handler.then(t=>t?.remove())),e.release?.())}answerHandoffs(e){e.handler=this.handoffHandlerRemoved.then(()=>this.handoffLease===e?this.options.comms.createTypedHandler("handoff",()=>this.answerHandoff(e)):void 0).catch(()=>{}),e.handler.then(()=>e.grant())}async send(e,t){if(this.closed)return!1;try{return await this.options.comms.broadcast(e,t),!0}catch{return!1}}async answerHandoff(e){let t;if(this.handoffLease===e)try{t=await this.options.mintHandoff()}catch{t=void 0}if(this.handoffLease!==e||!uYt(t))throw new _g.TypedResponseError("handoff_unavailable");return{resumeToken:t}}receiveLayout(e){if(!dYt(e))return;let t={};typeof e.sidebarWidth=="number"&&Number.isFinite(e.sidebarWidth)&&(t.sidebarWidth=e.sidebarWidth),typeof e.browserSidebarVisible=="boolean"&&(t.browserSidebarVisible=e.browserSidebarVisible),(e.browserPresentation==="default"||e.browserPresentation==="paint"||e.browserPresentation==="video")&&(t.browserPresentation=e.browserPresentation),(e.paintRendering==="gpu"||e.paintRendering==="software")&&(t.paintRendering=e.paintRendering),Object.keys(t).length>0&&this.options.onLayout(t)}awaitBundleOutcome(e,t){return this.closed?Promise.resolve("timeout"):new Promise(s=>{let r=this.pendingReloads.get(e);r||(r=new Set,this.pendingReloads.set(e,r));let a=n(l=>{clearTimeout(o),r.delete(a),r.size===0&&this.pendingReloads.get(e)===r&&this.pendingReloads.delete(e),s(l)},"finish"),o=setTimeout(()=>a("timeout"),t);r.add(a)})}receiveBundleOutcome(e){if(!dYt(e)||!uYt(e.version)||e.outcome!=="current"&&e.outcome!=="stale")return;let t=e.outcome;for(let s of[...this.pendingReloads.get(e.version)??[]])s(t)}};var Mvs=n((i,e,t)=>{let{statuses:s,finished:r,errors:a,optimistic:o}=i;if(t.sessionError===!0){s.set(e,"error"),a.add(e),r.delete(e),o.delete(e);return}let l=t.sessionStatus;if(l===void 0)return;let c=s.get(e),d=c==="busy"||c==="retry"||o.has(e);s.set(e,l),l==="busy"||l==="retry"?(a.delete(e),r.delete(e),o.delete(e)):l==="idle"?(o.delete(e),d&&!a.has(e)&&r.add(e)):(a.add(e),r.delete(e),o.delete(e))},"applySessionCardEvent");var $xr=4,hYt="Show the page's video in Paint",Dvs=n(async(i,e)=>{e.throwIfAborted();let t;try{return await Promise.race([i(),new Promise((s,r)=>{t=n(()=>r(e.reason),"onAbort"),e.addEventListener("abort",t,{once:!0})})])}finally{t&&e.removeEventListener("abort",t)}},"settleWithin"),Fxr=n((i,e,t)=>Dvs(()=>i.send(e),t),"sendWithin"),Bxr=n(i=>{if(i instanceof ji.TypedResponseError){let t=i.errorData?.code;if(t==="paint_unavailable"||t==="paint_capture_unavailable")return{kind:"paint-refused",code:t,message:i.errorText}}let e=Bke(i);return e===void 0?void 0:{kind:"viewer-cannot-render",failure:e}},"paintOpenFallback"),nCe=class{constructor(e){this.options=e;this.switcher=new yB({surface:e.surface,capture:n(()=>this.renderer instanceof my?e.canvas:this.renderer?e.video:void 0,"capture"),open:n((t,s)=>t==="paint"?this.openPaint(s):this.openVideo(s),"open"),onError:n(t=>e.onError("Show the browser view",t),"onError")})}options;static{n(this,"ControllerBrowserPresentation")}switcher;renderer;paint;paintOpening=!1;pendingVideoRoutes=[];audio;closed=!1;currentChoice;get mode(){return this.switcher.mode}get choice(){return this.currentChoice}static initialChoice(e,t,s){let r=t==="default"?"controller":"device",a=t==="default"?e:t;return a==="paint"&&s?.paint.state==="unavailable"?{requested:a,reason:{source:r,fallback:{kind:"paint-unavailable",paint:s.paint}}}:{requested:a,reason:{source:r}}}async start(e,t){await this.present(e,t)}async switchTo(e,t){await this.present({requested:e,reason:{source:"view"}},t)}async present(e,t){if(this.closed)return;this.setChoice(e);let s=e.reason.fallback?"video":e.requested;try{await this.switcher.switchTo(s,t)}catch(r){if(this.closed||t?.aborted||s!=="paint")throw r;let a=Bxr(r);if(a===void 0)throw r;this.setChoice({requested:e.requested,reason:{...e.reason,fallback:a}}),await this.switcher.switchTo("video",t)}}fallBackToVideo(e){let t=this.currentChoice;this.closed||!t||(this.setChoice({requested:t.requested,reason:{...t.reason,fallback:e}}),this.switcher.switchTo("video").catch(s=>this.options.onError("Show the browser view",s)))}setChoice(e){this.currentChoice=e,this.options.onChoice(e)}async activateSound(){let e=this.renderer;if(!e)throw new Error("The browser view shows nothing yet.");await e.activateAudio()}get soundAvailable(){return this.options.presentation()?.audio.state==="available"}handlePaintTermination(e){let t=this.paint;!t||t.response.paintId!==e.paintId||t.presenter.terminateFromControl(e.source,e.termination)}handleVideoRouteRequest(e){let t=this.paint;if(t&&t.response.paintId===e.paintId){this.openVideoRoute(t,e.routeId).catch(s=>{this.isCurrentPaint(t)&&this.options.onError(hYt,s)});return}this.paintOpening&&this.pendingVideoRoutes.length<$xr&&this.pendingVideoRoutes.push({paintId:e.paintId,routeId:e.routeId})}async close(){if(this.closed)return;this.closed=!0,this.pendingVideoRoutes.length=0;let e=await Promise.allSettled([this.switcher.close()]),t=this.audio;this.audio=void 0;let s=await Promise.allSettled([t?.dispose()]),r=[...e,...s].flatMap(a=>a.status==="rejected"?[a.reason]:[]);if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Browser presentation cleanup is incomplete.")}async openVideo(e){let t=await this.audioLifecycle();e.throwIfAborted();let s=new CC({video:this.options.video,client:this.options.client,...t===void 0?{}:{audio:t},focusTarget:this.options.surface,resizeTarget:this.options.surface,onError:n(r=>this.options.onRendererError(r),"onError")});this.setRenderer(s);try{await this.options.startRenderer(s)}catch(r){throw await this.options.stopRenderer(s),this.clearRenderer(s),r}return{firstFrame:s.firstFrame,stop:n(async()=>{try{await this.options.stopRenderer(s)}finally{this.clearRenderer(s)}},"stop")}}async openPaint(e){let t=await this.options.assets(),s=await this.audioLifecycle();e.throwIfAborted();let r=new my({canvas:this.options.canvas,client:this.options.client,...s===void 0?{}:{audio:s},focusTarget:this.options.surface,resizeTarget:this.options.surface,picture:{...$8,...t.paint,...Vds(this.options.paintRendering())},originalVideo:Dke,onError:n(o=>{Bke(o.cause)===void 0&&this.options.onRendererError(o)},"onError")});this.setRenderer(r),this.paintOpening=!0;let a;try{await this.options.startRenderer(r);let o=r.pictureRenderer?.videoWorkerIncarnation;if(!o)throw new Error("The Paint renderer has no worker.");a=await this.options.socket.fire("controller.browser.paint.open",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration,workerIncarnation:o},{maxRetries:0,abortSignal:e});let l=a;await Dvs(()=>Promise.all([l.packets.opened,l.control.opened]),e);let c=new AbortController,d=new oB({expectedHello:l.hello,renderer:r,sendPacket:n((h,p)=>Fxr(l.control,h,p),"sendPacket"),closeSource:n(()=>this.closePaintSource(l),"closeSource"),onFailure:n(h=>{Bke(h)===void 0&&this.options.onError("Run the browser Paint view",h)},"onFailure"),onTermination:n(h=>this.onPaintTermination(l.paintId,h),"onTermination"),signal:c.signal}),u={response:l,presenter:d,renderer:r,routes:new Set,abortController:c,removeSessionEnd:r.observePaintSessionEnd(h=>{this.closeVideoRoutes(u),this.onPaintSessionEnd(u,h)})};this.paint=u,this.receivePaintPackets(u);for(let h of this.pendingVideoRoutes.splice(0))h.paintId===l.paintId&&this.openVideoRoute(u,h.routeId).catch(p=>{this.isCurrentPaint(u)&&this.options.onError(hYt,p)});return{firstFrame:r.firstFrame,stop:n(()=>this.stopPaint(u),"stop")}}catch(o){throw a&&await this.closePaintSource(a).catch(()=>{}),await r.stop().catch(()=>{}),this.clearRenderer(r),o}finally{this.paintOpening=!1,this.pendingVideoRoutes.length=0}}async receivePaintPackets(e){try{for(;!e.abortController.signal.aborted;){let t=await e.response.packets.receive();if(t===void 0){await e.response.packets.accept();return}e.presenter.receivePacket(t)}}catch(t){if(this.paint!==e||e.abortController.signal.aborted)return;this.options.onError("Run the browser Paint view",t),await this.stopPaint(e).catch(()=>{})}}onPaintTermination(e,t){this.paint?.response.paintId!==e||this.closed||(t.kind==="unsupported"?this.fallBackToVideo({kind:"page-unsupported",reasonCode:t.reasonCode}):t.kind==="failure"&&this.options.onError("Run the browser Paint view",new Error(t.message)))}onPaintSessionEnd(e,t){if(this.paint!==e||this.closed||t===void 0)return;let s=Bke(t);s!==void 0&&this.fallBackToVideo({kind:"viewer-cannot-render",failure:s})}isCurrentPaint(e){return this.paint===e&&!this.closed}async stopPaint(e){this.paint===e&&(this.paint=void 0),e.abortController.abort(new Error("The Paint stream closed.")),e.removeSessionEnd(),this.closeVideoRoutes(e);try{await e.presenter.close()}finally{this.clearRenderer(e.renderer)}}async closePaintSource(e){let t=new Error("The Paint stream closed.");await Promise.allSettled([e.packets.abort(t),e.control.abort(t)]),this.options.socket.isConnected&&await this.options.socket.fire("controller.browser.paint.close",{viewId:this.options.viewId,paintId:e.paintId,streamGeneration:this.options.streamGeneration},{maxRetries:0})}async openVideoRoute(e,t){let s=e.renderer.pictureRenderer;if(!s)throw new Error("The Paint renderer has no worker.");let r=await this.options.socket.fire("controller.browser.paint.video.openRoute",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration,paintId:e.response.paintId,routeId:t},{maxRetries:0,abortSignal:e.abortController.signal}),a=new bB({...Mke,routeId:r.routeId,packets:r.packets,receipts:r.receipts,renderer:s,signal:e.abortController.signal,onEnded:n(()=>{e.routes.delete(a)},"onEnded"),onFailure:n(o=>{e.routes.delete(a),this.isCurrentPaint(e)&&this.options.onError(hYt,o)},"onFailure")});e.routes.add(a);try{await a.start()}catch(o){throw e.routes.delete(a),o}}closeVideoRoutes(e){for(let t of e.routes)t.close().catch(s=>this.options.onError("Close the browser view's video",s));e.routes.clear()}async audioLifecycle(){if(this.options.presentation()?.audio.state!=="available")return;if(this.audio)return this.audio;let e=await this.options.assets();if(this.audio)return this.audio;let t={openAudioRelay:n(s=>this.openAudioRelay(s),"openAudioRelay")};return this.audio=new hB({viewerId:this.options.viewId,client:new pB(t),assets:e.audio,sampleCreditBytes:e.audioSampleCredit.bytes,sampleCreditEvents:e.audioSampleCredit.events,clockPolicy:Cke,onError:n(s=>this.options.onError("Play the browser sound",s),"onError")}),this.audio}async openAudioRelay(e){let t=await this.options.socket.fire("controller.browser.audio.open",{viewId:this.options.viewId,streamGeneration:this.options.streamGeneration},{maxRetries:0,abortSignal:e.signal}),r=await new mB({events:t.events,operations:t.operations,sampleCreditBytes:t.sampleCredit.bytes,sampleCreditEvents:t.sampleCredit.events,signal:e.signal}).openAudioRelay(e);return{sendCommand:n(a=>r.sendCommand(a),"sendCommand"),close:n(async()=>{try{await r.close()}finally{this.options.socket.isConnected&&await this.options.socket.fire("controller.browser.audio.close",{viewId:this.options.viewId,audioId:t.audioId,streamGeneration:this.options.streamGeneration},{maxRetries:0}).catch(()=>{})}},"close")}}setRenderer(e){this.renderer=e,this.options.surface.dataset.presentation=e instanceof my?"paint":"video",this.options.onRenderer(e)}clearRenderer(e){this.renderer===e&&(this.renderer=void 0,this.options.onRenderer(void 0))}};var pYt=n((i,e,t)=>`${i}:${e}\0${t}`,"projectMutationScope"),Pvs=n((i,e)=>pYt("draft",i,`${e}`),"draftScopeOf"),Ovs=n((i,e)=>pYt("conversation",i,e),"conversationScopeOf"),a8e=class{constructor(e){this.onChange=e}onChange;static{n(this,"ControllerMutationLocks")}held=new Map;startedCount=0;get started(){return this.startedCount}get anyHeld(){return this.held.size>0}isHeld(e){return this.held.has(e)}isProjectHeld(e){let t=["draft","conversation"].map(s=>pYt(s,e,""));return[...this.held.keys()].some(s=>t.some(r=>s.startsWith(r)))}holds(e){return[...this.held.values()].includes(e)}acquire(e){if(this.held.has(e))return;let t=Symbol(e);return this.held.set(e,t),this.startedCount+=1,this.onChange(),t}release(e){for(let[t,s]of this.held)if(s===e)return this.held.delete(t),this.onChange(),!0;return!1}releaseAll(){this.held.size!==0&&(this.held.clear(),this.onChange())}};var A$c=50,Avs=n((i,e)=>[...i,e].slice(-50),"appendErrorJournalEntry"),fYt=n(i=>Number.isFinite(i)?new Date(i).toISOString():"unknown","formatTimestamp"),zxr=n((i,e)=>{let t=[`[${e}] ${fYt(i.at)} - ${i.operation}`,`message: ${i.message}`];i.reference!==void 0&&t.push(`reference: ${i.reference}`);let s=i.detail;return s!==void 0?(t.push(`controller operation: ${s.operation}`,`controller time: ${fYt(s.at)}`,`controller cause: ${s.name}: ${s.message}`),s.stack&&t.push("controller stack:",s.stack)):i.reference!==void 0&&t.push("controller cause: unavailable"),t.join(`
|
|
49859
49859
|
`)},"formatEntry"),Lvs=n(i=>{let e=["AGL error report",`agl version: ${i.version||"unknown"}`,`generated: ${fYt(i.generatedAt)}`,`entries: ${i.entries.length}`].join(`
|
|
49860
49860
|
`);if(i.entries.length===0)return`${e}
|
|
49861
49861
|
`;let t=i.entries.map((s,r)=>zxr(s,r+1)).join(`
|
package/dist_serve/bundle.js.map
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: 'agl',
|
|
6
|
-
version: '44.0.
|
|
6
|
+
version: '44.0.1',
|
|
7
7
|
description: 'Agent Gateway Layer for OpenCode, FlexHarness, and Codex sessions'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxLQUFLO0lBQ1gsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLG1FQUFtRTtDQUNqRixDQUFBIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agl",
|
|
3
|
-
"version": "44.0.
|
|
3
|
+
"version": "44.0.1",
|
|
4
4
|
"controllerUpgradeManagementVersion": 2,
|
|
5
5
|
"controllerManagementProtocolVersion": 1,
|
|
6
6
|
"controllerGatewaySourcesVersion": 1,
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@lossless.org/objectstorage": "10.7.1",
|
|
40
40
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
41
41
|
"@modelprofile.com/catalog": "^1.1.0",
|
|
42
|
-
"@modelprofile.com/flexharness": "18.3.
|
|
43
|
-
"@modelprofile.com/flexharness-agent": "18.3.
|
|
44
|
-
"@modelprofile.com/flexharness-models": "18.3.
|
|
45
|
-
"@modelprofile.com/flexharness-providers": "18.3.
|
|
42
|
+
"@modelprofile.com/flexharness": "18.3.1",
|
|
43
|
+
"@modelprofile.com/flexharness-agent": "18.3.1",
|
|
44
|
+
"@modelprofile.com/flexharness-models": "18.3.1",
|
|
45
|
+
"@modelprofile.com/flexharness-providers": "18.3.1",
|
|
46
46
|
"@modelprofile.com/mcp-crossharness": "5.9.0",
|
|
47
47
|
"@modelprofile.com/mcp-system": "3.1.0",
|
|
48
48
|
"@opencode-ai/sdk": "1.18.15",
|
package/ts/00_commitinfo_data.ts
CHANGED