remote-codex 0.1.7 → 0.1.8
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/apps/supervisor-api/dist/index.js +1052 -878
- package/apps/supervisor-web/dist/assets/{highlighted-body-OFNGDK62-0cYcfOfd.js → highlighted-body-OFNGDK62-owvlMiML.js} +1 -1
- package/apps/supervisor-web/dist/assets/{index-nH6a8Wwn.js → index-CrcX157r.js} +70 -70
- package/apps/supervisor-web/dist/assets/{xterm-DisVWgDR.js → xterm-BQ_J5An_.js} +1 -1
- package/apps/supervisor-web/dist/index.html +1 -1
- package/package.json +1 -1
- package/packages/agent-runtime/src/types.ts +8 -5
- package/packages/codex/src/historyItems.ts +72 -1
- package/packages/codex/src/runtimeAdapter.ts +60 -9
- package/packages/db/src/repositories.ts +6 -1
- package/packages/shared/src/index.ts +4 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ce}from"./index-
|
|
1
|
+
import{g as Ce}from"./index-CrcX157r.js";function be(se,le){for(var ee=0;ee<le.length;ee++){const J=le[ee];if(typeof J!="string"&&!Array.isArray(J)){for(const V in J)if(V!=="default"&&!(V in se)){const te=Object.getOwnPropertyDescriptor(J,V);te&&Object.defineProperty(se,V,te.get?te:{enumerable:!0,get:()=>J[V]})}}}return Object.freeze(Object.defineProperty(se,Symbol.toStringTag,{value:"Module"}))}var ve={exports:{}},ge;function ye(){return ge||(ge=1,(function(se,le){(function(ee,J){se.exports=J()})(self,(()=>(()=>{var ee={4567:function(I,r,a){var c=this&&this.__decorate||function(i,o,l,v){var m,h=arguments.length,g=h<3?o:v===null?v=Object.getOwnPropertyDescriptor(o,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,o,l,v);else for(var b=i.length-1;b>=0;b--)(m=i[b])&&(g=(h<3?m(g):h>3?m(o,l,g):m(o,l))||g);return h>3&&g&&Object.defineProperty(o,l,g),g},_=this&&this.__param||function(i,o){return function(l,v){o(l,v,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=a(9042),d=a(6114),f=a(9924),p=a(844),u=a(5596),e=a(4725),s=a(3656);let t=r.AccessibilityManager=class extends p.Disposable{constructor(i,o){super(),this._terminal=i,this._renderService=o,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new f.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((l=>this._handleResize(l.rows)))),this.register(this._terminal.onRender((l=>this._refreshRows(l.start,l.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((l=>this._handleChar(l)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
2
2
|
`)))),this.register(this._terminal.onA11yTab((l=>this._handleTab(l)))),this.register(this._terminal.onKey((l=>this._handleKey(l.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._screenDprMonitor=new u.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener((()=>this._refreshRowsDimensions())),this.register((0,s.addDisposableDomListener)(window,"resize",(()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,p.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(i){for(let o=0;o<i;o++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)),d.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((()=>{this._accessibilityContainer.appendChild(this._liveRegion)}),0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,d.isMac&&this._liveRegion.remove()}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,o){this._liveRegionDebouncer.refresh(i,o,this._terminal.rows)}_renderRows(i,o){const l=this._terminal.buffer,v=l.lines.length.toString();for(let m=i;m<=o;m++){const h=l.translateBufferLineToString(l.ydisp+m,!0),g=(l.ydisp+m+1).toString(),b=this._rowElements[m];b&&(h.length===0?b.innerText=" ":b.textContent=h,b.setAttribute("aria-posinset",g),b.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,o){const l=i.target,v=this._rowElements[o===0?1:this._rowElements.length-2];if(l.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==v)return;let m,h;if(o===0?(m=l,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(m=this._rowElements.shift(),h=l,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const g=this._createAccessibilityTreeNode();this._rowElements.unshift(g),this._rowContainer.insertAdjacentElement("afterbegin",g)}else{const g=this._createAccessibilityTreeNode();this._rowElements.push(g),this._rowContainer.appendChild(g)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=document.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=t=c([_(1,e.IRenderService)],t)},3614:(I,r)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function c(d,f){return f?"\x1B[200~"+d+"\x1B[201~":d}function _(d,f,p,u){d=c(d=a(d),p.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),p.triggerDataEvent(d,!0),f.value=""}function n(d,f,p){const u=p.getBoundingClientRect(),e=d.clientX-u.left-10,s=d.clientY-u.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${e}px`,f.style.top=`${s}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=a,r.bracketTextForPaste=c,r.copyHandler=function(d,f){d.clipboardData&&d.clipboardData.setData("text/plain",f.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,f,p,u){d.stopPropagation(),d.clipboardData&&_(d.clipboardData.getData("text/plain"),f,p,u)},r.paste=_,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,f,p,u,e){n(d,f,p),e&&u.rightClickSelect(d),f.value=u.selectionText,f.select()}},7239:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const c=a(1505);r.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(_,n,d){this._css.set(_,n,d)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,d){this._color.set(_,n,d)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,c,_,n){a.addEventListener(c,_,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(c,_,n))}}}},6465:function(I,r,a){var c=this&&this.__decorate||function(e,s,t,i){var o,l=arguments.length,v=l<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(v=(l<3?o(v):l>3?o(s,t,v):o(s,t))||v);return l>3&&v&&Object.defineProperty(s,t,v),v},_=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const n=a(3656),d=a(8460),f=a(844),p=a(2585);let u=r.Linkifier2=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)((()=>{this._lastMouseEvent=void 0}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0})))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const s=this._linkProviders.indexOf(e);s!==-1&&this._linkProviders.splice(s,1)}}}attachToDom(e,s,t){this._element=e,this._mouseService=s,this._renderService=t,this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const t=e.composedPath();for(let i=0;i<t.length;i++){const o=t[i];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,s){var t,i;this._activeProviderReplies&&s||((t=this._activeProviderReplies)===null||t===void 0||t.forEach((l=>{l==null||l.forEach((v=>{v.link.dispose&&v.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let o=!1;for(const[l,v]of this._linkProviders.entries())s?!((i=this._activeProviderReplies)===null||i===void 0)&&i.get(l)&&(o=this._checkLinkProviderResult(l,e,o)):v.provideLinks(e.y,(m=>{var h,g;if(this._isMouseOut)return;const b=m==null?void 0:m.map((L=>({link:L})));(h=this._activeProviderReplies)===null||h===void 0||h.set(l,b),o=this._checkLinkProviderResult(l,e,o),((g=this._activeProviderReplies)===null||g===void 0?void 0:g.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,s){const t=new Set;for(let i=0;i<s.size;i++){const o=s.get(i);if(o)for(let l=0;l<o.length;l++){const v=o[l],m=v.link.range.start.y<e?0:v.link.range.start.x,h=v.link.range.end.y>e?this._bufferService.cols:v.link.range.end.x;for(let g=m;g<=h;g++){if(t.has(g)){o.splice(l--,1);break}t.add(g)}}}}_checkLinkProviderResult(e,s,t){var i;if(!this._activeProviderReplies)return t;const o=this._activeProviderReplies.get(e);let l=!1;for(let v=0;v<e;v++)this._activeProviderReplies.has(v)&&!this._activeProviderReplies.get(v)||(l=!0);if(!l&&o){const v=o.find((m=>this._linkAtPosition(m.link,s)));v&&(t=!0,this._handleNewLink(v))}if(this._activeProviderReplies.size===this._linkProviders.length&&!t)for(let v=0;v<this._activeProviderReplies.size;v++){const m=(i=this._activeProviderReplies.get(v))===null||i===void 0?void 0:i.find((h=>this._linkAtPosition(h.link,s)));if(m){t=!0,this._handleNewLink(m);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,s){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!s||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(e.link,s)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.pointerCursor},set:t=>{var i,o;!((i=this._currentLink)===null||i===void 0)&&i.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&((o=this._element)===null||o===void 0||o.classList.toggle("xterm-cursor-pointer",t)))}},underline:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.underline},set:t=>{var i,o,l;!((i=this._currentLink)===null||i===void 0)&&i.state&&((l=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||l===void 0?void 0:l.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t=>{if(!this._currentLink)return;const i=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(i,o),this._lastMouseEvent&&this._element)){const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}}))))}_linkHover(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(t,s.text)}_fireUnderlineEvent(e,s){const t=e.range,i=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-i-1,t.end.x,t.end.y-i-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(t,s.text)}_linkAtPosition(e,s){const t=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,o=s.y*this._bufferService.cols+s.x;return t<=o&&o<=i}_positionFromMouseEvent(e,s,t){const i=t.getCoords(e,s,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,s,t,i,o){return{x1:e,y1:s,x2:t,y2:i,cols:this._bufferService.cols,fg:o}}};r.Linkifier2=u=c([_(0,p.IBufferService)],u)},9042:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(I,r,a){var c=this&&this.__decorate||function(u,e,s,t){var i,o=arguments.length,l=o<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(u,e,s,t);else for(var v=u.length-1;v>=0;v--)(i=u[v])&&(l=(o<3?i(l):o>3?i(e,s,l):i(e,s))||l);return o>3&&l&&Object.defineProperty(e,s,l),l},_=this&&this.__param||function(u,e){return function(s,t){e(s,t,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=a(511),d=a(2585);let f=r.OscLinkProvider=class{constructor(u,e,s){this._bufferService=u,this._optionsService=e,this._oscLinkService=s}provideLinks(u,e){var s;const t=this._bufferService.buffer.lines.get(u-1);if(!t)return void e(void 0);const i=[],o=this._optionsService.rawOptions.linkHandler,l=new n.CellData,v=t.getTrimmedLength();let m=-1,h=-1,g=!1;for(let b=0;b<v;b++)if(h!==-1||t.hasContent(b)){if(t.loadCell(b,l),l.hasExtendedAttrs()&&l.extended.urlId){if(h===-1){h=b,m=l.extended.urlId;continue}g=l.extended.urlId!==m}else h!==-1&&(g=!0);if(g||h!==-1&&b===v-1){const L=(s=this._oscLinkService.getLinkData(m))===null||s===void 0?void 0:s.uri;if(L){const y={start:{x:h+1,y:u},end:{x:b+(g||b!==v-1?0:1),y:u}};let k=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{const x=new URL(L);["http:","https:"].includes(x.protocol)||(k=!0)}catch{k=!0}k||i.push({text:L,range:y,activate:(x,T)=>o?o.activate(x,T,y):p(0,T),hover:(x,T)=>{var O;return(O=o==null?void 0:o.hover)===null||O===void 0?void 0:O.call(o,x,T,y)},leave:(x,T)=>{var O;return(O=o==null?void 0:o.leave)===null||O===void 0?void 0:O.call(o,x,T,y)}})}g=!1,l.hasExtendedAttrs()&&l.extended.urlId?(h=b,m=l.extended.urlId):(h=-1,m=-1)}}e(i)}};function p(u,e){if(confirm(`Do you want to navigate to ${e}?
|
|
4
4
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Remote Codex Supervisor</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-CrcX157r.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-CbIt0KnL.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body class="bg-stone-950">
|
package/package.json
CHANGED
|
@@ -56,7 +56,7 @@ export interface AgentProviderCapabilities {
|
|
|
56
56
|
planMode: boolean;
|
|
57
57
|
permissionRequests: boolean;
|
|
58
58
|
sandboxMode: boolean;
|
|
59
|
-
|
|
59
|
+
performanceMode: boolean;
|
|
60
60
|
goals: boolean;
|
|
61
61
|
};
|
|
62
62
|
management: {
|
|
@@ -129,6 +129,8 @@ export interface AgentRuntimeManagementSchema {
|
|
|
129
129
|
hostConfigFiles: AgentRuntimeConfigFileSchema[];
|
|
130
130
|
toolboxItems: AgentRuntimeToolboxItemSchema[];
|
|
131
131
|
hookCommandTemplates: AgentRuntimeHookCommandTemplate[];
|
|
132
|
+
providerConfigFormat: 'toml' | 'json' | 'none';
|
|
133
|
+
mcpConfigFormat: 'codex-toml' | 'claude-json' | 'none';
|
|
132
134
|
configArchives: boolean;
|
|
133
135
|
buildRestart: boolean;
|
|
134
136
|
}
|
|
@@ -189,7 +191,7 @@ export interface StartAgentSessionInput {
|
|
|
189
191
|
model: string;
|
|
190
192
|
approvalMode: 'yolo' | 'guarded';
|
|
191
193
|
sandboxMode?: 'read-only' | 'workspace-write' | 'danger-full-access' | null;
|
|
192
|
-
|
|
194
|
+
performanceMode?: 'standard' | 'fast' | null;
|
|
193
195
|
}
|
|
194
196
|
|
|
195
197
|
export interface StartAgentSessionResult {
|
|
@@ -206,7 +208,7 @@ export interface ResumeAgentSessionInput {
|
|
|
206
208
|
providerSessionId: string;
|
|
207
209
|
model?: string | null;
|
|
208
210
|
sandboxMode?: 'read-only' | 'workspace-write' | 'danger-full-access' | null;
|
|
209
|
-
|
|
211
|
+
performanceMode?: 'standard' | 'fast' | null;
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
export interface StartAgentTurnInput {
|
|
@@ -215,8 +217,9 @@ export interface StartAgentTurnInput {
|
|
|
215
217
|
model?: string | null;
|
|
216
218
|
reasoningEffort?: string | null;
|
|
217
219
|
collaborationMode?: 'default' | 'plan' | null;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
+
sandboxMode?: 'read-only' | 'workspace-write' | 'danger-full-access' | null;
|
|
221
|
+
workspacePath?: string | null;
|
|
222
|
+
performanceMode?: 'standard' | 'fast' | null;
|
|
220
223
|
}
|
|
221
224
|
|
|
222
225
|
export interface SendAgentInputInput {
|
|
@@ -429,7 +429,78 @@ function sortTurnItemsByRecordedSequence(items: ThreadHistoryItemDto[]) {
|
|
|
429
429
|
index += 1;
|
|
430
430
|
}
|
|
431
431
|
|
|
432
|
-
|
|
432
|
+
const trailingItems = items.slice(index);
|
|
433
|
+
if (!trailingItems.some(hasHistoryItemSequence)) {
|
|
434
|
+
return items;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
const sequenceValues = trailingItems
|
|
438
|
+
.map((item) => historyItemSequence(item))
|
|
439
|
+
.filter(Number.isFinite);
|
|
440
|
+
const maxSequence = sequenceValues.length > 0 ? Math.max(...sequenceValues) : 0;
|
|
441
|
+
const orderedItems: Array<{
|
|
442
|
+
item: ThreadHistoryItemDto;
|
|
443
|
+
index: number;
|
|
444
|
+
order: number;
|
|
445
|
+
}> = [];
|
|
446
|
+
|
|
447
|
+
let cursor = 0;
|
|
448
|
+
while (cursor < trailingItems.length) {
|
|
449
|
+
const item = trailingItems[cursor]!;
|
|
450
|
+
if (hasHistoryItemSequence(item)) {
|
|
451
|
+
orderedItems.push({ item, index: cursor, order: historyItemSequence(item) });
|
|
452
|
+
cursor += 1;
|
|
453
|
+
continue;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
const blockStart = cursor;
|
|
457
|
+
while (
|
|
458
|
+
cursor < trailingItems.length &&
|
|
459
|
+
!hasHistoryItemSequence(trailingItems[cursor]!)
|
|
460
|
+
) {
|
|
461
|
+
cursor += 1;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
const block = trailingItems.slice(blockStart, cursor);
|
|
465
|
+
const previousSequenced = [...trailingItems.slice(0, blockStart)]
|
|
466
|
+
.reverse()
|
|
467
|
+
.find(hasHistoryItemSequence);
|
|
468
|
+
const nextSequenced = trailingItems.slice(cursor).find(hasHistoryItemSequence);
|
|
469
|
+
const previousSequence = previousSequenced
|
|
470
|
+
? historyItemSequence(previousSequenced)
|
|
471
|
+
: null;
|
|
472
|
+
const nextSequence = nextSequenced ? historyItemSequence(nextSequenced) : null;
|
|
473
|
+
|
|
474
|
+
block.forEach((blockItem, blockIndex) => {
|
|
475
|
+
let order: number;
|
|
476
|
+
if (previousSequence === null && nextSequence !== null) {
|
|
477
|
+
order = nextSequence - (block.length - blockIndex) / (block.length + 1);
|
|
478
|
+
} else if (
|
|
479
|
+
previousSequence !== null &&
|
|
480
|
+
nextSequence !== null &&
|
|
481
|
+
nextSequence > previousSequence
|
|
482
|
+
) {
|
|
483
|
+
const span = nextSequence - previousSequence;
|
|
484
|
+
order = previousSequence + ((blockIndex + 1) / (block.length + 1)) * span;
|
|
485
|
+
} else {
|
|
486
|
+
order = maxSequence + 1 + blockIndex / (block.length + 1);
|
|
487
|
+
}
|
|
488
|
+
orderedItems.push({
|
|
489
|
+
item: blockItem,
|
|
490
|
+
index: blockStart + blockIndex,
|
|
491
|
+
order,
|
|
492
|
+
});
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
const sortedTrailingItems = orderedItems
|
|
497
|
+
.sort((left, right) => {
|
|
498
|
+
const orderDelta = left.order - right.order;
|
|
499
|
+
return orderDelta === 0 ? left.index - right.index : orderDelta;
|
|
500
|
+
})
|
|
501
|
+
.map((entry) => entry.item);
|
|
502
|
+
|
|
503
|
+
return [...leadingItems, ...sortedTrailingItems];
|
|
433
504
|
}
|
|
434
505
|
|
|
435
506
|
function mergeHistoryItemsBySequence(
|
|
@@ -77,7 +77,7 @@ export const codexCapabilities: AgentProviderCapabilities = {
|
|
|
77
77
|
planMode: true,
|
|
78
78
|
permissionRequests: true,
|
|
79
79
|
sandboxMode: true,
|
|
80
|
-
|
|
80
|
+
performanceMode: true,
|
|
81
81
|
goals: true,
|
|
82
82
|
},
|
|
83
83
|
management: {
|
|
@@ -163,6 +163,51 @@ function mapGoal(goal: CodexThreadGoalRecord): AgentGoal {
|
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
function serviceTierForPerformanceMode(
|
|
167
|
+
performanceMode: StartAgentSessionInput['performanceMode'],
|
|
168
|
+
): 'fast' | null | undefined {
|
|
169
|
+
if (performanceMode === undefined) {
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
return performanceMode === 'fast' ? 'fast' : null;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function buildSandboxPolicy(
|
|
176
|
+
sandboxMode: StartAgentTurnInput['sandboxMode'],
|
|
177
|
+
workspacePath: StartAgentTurnInput['workspacePath'],
|
|
178
|
+
): SandboxPolicy | null | undefined {
|
|
179
|
+
if (sandboxMode === undefined) {
|
|
180
|
+
return undefined;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
switch (sandboxMode) {
|
|
184
|
+
case 'danger-full-access':
|
|
185
|
+
return {
|
|
186
|
+
type: 'dangerFullAccess',
|
|
187
|
+
};
|
|
188
|
+
case 'read-only':
|
|
189
|
+
return {
|
|
190
|
+
type: 'readOnly',
|
|
191
|
+
access: {
|
|
192
|
+
type: 'fullAccess',
|
|
193
|
+
},
|
|
194
|
+
networkAccess: false,
|
|
195
|
+
};
|
|
196
|
+
case 'workspace-write':
|
|
197
|
+
default:
|
|
198
|
+
return {
|
|
199
|
+
type: 'workspaceWrite',
|
|
200
|
+
writableRoots: workspacePath ? [workspacePath] : [],
|
|
201
|
+
readOnlyAccess: {
|
|
202
|
+
type: 'fullAccess',
|
|
203
|
+
},
|
|
204
|
+
networkAccess: false,
|
|
205
|
+
excludeTmpdirEnvVar: false,
|
|
206
|
+
excludeSlashTmp: false,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
166
211
|
function mapSession(thread: CodexThreadRecord): AgentSessionDetail {
|
|
167
212
|
return {
|
|
168
213
|
provider: 'codex',
|
|
@@ -451,6 +496,8 @@ export class CodexRuntimeAdapter extends EventEmitter implements AgentRuntime {
|
|
|
451
496
|
'node -e \'process.stdin.resume(); process.stdin.on("end", () => console.log(JSON.stringify({ systemMessage: "remote-codex hook ran" })))\'',
|
|
452
497
|
},
|
|
453
498
|
],
|
|
499
|
+
providerConfigFormat: 'toml',
|
|
500
|
+
mcpConfigFormat: 'codex-toml',
|
|
454
501
|
configArchives: true,
|
|
455
502
|
buildRestart: true,
|
|
456
503
|
};
|
|
@@ -539,8 +586,9 @@ export class CodexRuntimeAdapter extends EventEmitter implements AgentRuntime {
|
|
|
539
586
|
if (input.sandboxMode !== undefined) {
|
|
540
587
|
startInput.sandbox = input.sandboxMode as SandboxMode | null;
|
|
541
588
|
}
|
|
542
|
-
|
|
543
|
-
|
|
589
|
+
const serviceTier = serviceTierForPerformanceMode(input.performanceMode);
|
|
590
|
+
if (serviceTier !== undefined) {
|
|
591
|
+
startInput.serviceTier = serviceTier;
|
|
544
592
|
}
|
|
545
593
|
|
|
546
594
|
const response = await codexRuntimeCall(() => this.manager.startThread(startInput));
|
|
@@ -565,8 +613,9 @@ export class CodexRuntimeAdapter extends EventEmitter implements AgentRuntime {
|
|
|
565
613
|
if (input.sandboxMode !== undefined) {
|
|
566
614
|
resumeInput.sandbox = input.sandboxMode as SandboxMode | null;
|
|
567
615
|
}
|
|
568
|
-
|
|
569
|
-
|
|
616
|
+
const serviceTier = serviceTierForPerformanceMode(input.performanceMode);
|
|
617
|
+
if (serviceTier !== undefined) {
|
|
618
|
+
resumeInput.serviceTier = serviceTier;
|
|
570
619
|
}
|
|
571
620
|
|
|
572
621
|
const response = await codexRuntimeCall(() => this.manager.resumeThread(resumeInput));
|
|
@@ -595,11 +644,13 @@ export class CodexRuntimeAdapter extends EventEmitter implements AgentRuntime {
|
|
|
595
644
|
if (input.collaborationMode !== undefined) {
|
|
596
645
|
turnInput.collaborationMode = input.collaborationMode;
|
|
597
646
|
}
|
|
598
|
-
|
|
599
|
-
|
|
647
|
+
const sandboxPolicy = buildSandboxPolicy(input.sandboxMode, input.workspacePath);
|
|
648
|
+
if (sandboxPolicy !== undefined) {
|
|
649
|
+
turnInput.sandboxPolicy = sandboxPolicy;
|
|
600
650
|
}
|
|
601
|
-
|
|
602
|
-
|
|
651
|
+
const serviceTier = serviceTierForPerformanceMode(input.performanceMode);
|
|
652
|
+
if (serviceTier !== undefined) {
|
|
653
|
+
turnInput.serviceTier = serviceTier;
|
|
603
654
|
}
|
|
604
655
|
|
|
605
656
|
return mapTurn(await codexRuntimeCall(() => this.manager.startTurn(turnInput)));
|
|
@@ -109,6 +109,7 @@ export interface UpsertThreadGoalRecordInput {
|
|
|
109
109
|
threadId: string;
|
|
110
110
|
providerSessionId: string;
|
|
111
111
|
localGoalId?: string | null;
|
|
112
|
+
createNew?: boolean;
|
|
112
113
|
objective: string;
|
|
113
114
|
status: string;
|
|
114
115
|
tokenBudget?: number | null;
|
|
@@ -635,6 +636,10 @@ function getThreadGoalRecordForUpsert(
|
|
|
635
636
|
db: DatabaseClient,
|
|
636
637
|
input: UpsertThreadGoalRecordInput,
|
|
637
638
|
) {
|
|
639
|
+
if (input.createNew) {
|
|
640
|
+
return null;
|
|
641
|
+
}
|
|
642
|
+
|
|
638
643
|
if (input.localGoalId) {
|
|
639
644
|
const byId = db
|
|
640
645
|
.select()
|
|
@@ -647,7 +652,7 @@ function getThreadGoalRecordForUpsert(
|
|
|
647
652
|
}
|
|
648
653
|
|
|
649
654
|
const active = getActiveThreadGoalRecord(db, input.threadId);
|
|
650
|
-
if (active) {
|
|
655
|
+
if (active && active.objective === input.objective) {
|
|
651
656
|
return active;
|
|
652
657
|
}
|
|
653
658
|
|
|
@@ -2,7 +2,7 @@ export type ApiErrorCode =
|
|
|
2
2
|
| 'bad_request'
|
|
3
3
|
| 'not_found'
|
|
4
4
|
| 'conflict'
|
|
5
|
-
| '
|
|
5
|
+
| 'provider_goal_error'
|
|
6
6
|
| 'forbidden'
|
|
7
7
|
| 'goal_feature_disabled'
|
|
8
8
|
| 'internal_error'
|
|
@@ -57,7 +57,7 @@ export interface AgentProviderCapabilitiesDto {
|
|
|
57
57
|
planMode: boolean;
|
|
58
58
|
permissionRequests: boolean;
|
|
59
59
|
sandboxMode: boolean;
|
|
60
|
-
|
|
60
|
+
performanceMode: boolean;
|
|
61
61
|
goals: boolean;
|
|
62
62
|
};
|
|
63
63
|
management: {
|
|
@@ -120,6 +120,8 @@ export interface AgentBackendManagementSchemaDto {
|
|
|
120
120
|
hostConfigFiles: AgentBackendConfigFileSchemaDto[];
|
|
121
121
|
toolboxItems: AgentBackendToolboxItemSchemaDto[];
|
|
122
122
|
hookCommandTemplates: AgentBackendHookCommandTemplateDto[];
|
|
123
|
+
providerConfigFormat: 'toml' | 'json' | 'none';
|
|
124
|
+
mcpConfigFormat: 'codex-toml' | 'claude-json' | 'none';
|
|
123
125
|
configArchives: boolean;
|
|
124
126
|
buildRestart: boolean;
|
|
125
127
|
}
|