@hyperdrive.bot/paseo-server 0.3.40 → 0.3.41
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/dist/server/server/agent/agent-manager.js +15 -0
- package/dist/server/server/agent/agent-projections.js +3 -0
- package/dist/server/server/agent/agent-sdk-types.d.ts +23 -0
- package/dist/server/server/agent/agent-storage.d.ts +2 -1
- package/dist/server/server/agent/agent-storage.js +4 -0
- package/dist/server/server/agent/mcp-shared.js +5 -2
- package/dist/server/server/agent/providers/claude/agent.d.ts +34 -0
- package/dist/server/server/agent/providers/claude/agent.js +74 -0
- package/dist/server/server/agent/providers/claude/pty-session-launcher.d.ts +7 -0
- package/dist/server/server/agent/providers/claude/pty-session-launcher.js +6 -0
- package/dist/server/server/agent/providers/claude/tool-allowlist-guard.d.ts +41 -0
- package/dist/server/server/agent/providers/claude/tool-allowlist-guard.js +93 -0
- package/dist/server/server/agent/providers/claude/tool-allowlist.d.ts +68 -0
- package/dist/server/server/agent/providers/claude/tool-allowlist.js +133 -0
- package/dist/server/server/agent/tools/paseo-tools.d.ts +19 -0
- package/dist/server/server/agent/tools/paseo-tools.js +213 -38
- package/dist/server/server/agent/tools/read-only-surface.d.ts +1 -0
- package/dist/server/server/agent/tools/read-only-surface.js +1 -0
- package/dist/server/server/persistence-hooks.js +2 -0
- package/dist/server/web-ui/_expo/static/js/web/{index-73ebfe5c6b82437cad59d50a40d2c8ef.js → index-cb251ddad56c08c3021036af3a43fc0f.js} +5 -5
- package/dist/server/web-ui/_expo/static/js/web/index-cb251ddad56c08c3021036af3a43fc0f.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/index-cb251ddad56c08c3021036af3a43fc0f.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{index-73ebfe5c6b82437cad59d50a40d2c8ef.js.map.br → index-cb251ddad56c08c3021036af3a43fc0f.js.map.br} +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{index-73ebfe5c6b82437cad59d50a40d2c8ef.js.map.gz → index-cb251ddad56c08c3021036af3a43fc0f.js.map.gz} +0 -0
- package/dist/server/web-ui/index.html +1 -1
- package/dist/server/web-ui/index.html.br +0 -0
- package/dist/server/web-ui/index.html.gz +0 -0
- package/package.json +6 -6
- package/dist/server/web-ui/_expo/static/js/web/index-73ebfe5c6b82437cad59d50a40d2c8ef.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/index-73ebfe5c6b82437cad59d50a40d2c8ef.js.gz +0 -0
|
@@ -1103,7 +1103,7 @@ __d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?
|
|
|
1103
1103
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"AppOwnership",{enumerable:!0,get:function(){return l.AppOwnership}}),Object.defineProperty(_e,"ExecutionEnvironment",{enumerable:!0,get:function(){return l.ExecutionEnvironment}}),Object.defineProperty(_e,"UserInterfaceIdiom",{enumerable:!0,get:function(){return l.UserInterfaceIdiom}});var n=e(r(d[0])),t=r(d[1]);r(d[2]);var u=e(r(d[3])),l=r(d[4]),o=e(r(d[5]));o.default||console.warn("No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?");const s=(0,t.requireOptionalNativeModule)('ExpoUpdates');let f=null;if(s){let e;s.manifest?e=s.manifest:s.manifestString&&(e=JSON.parse(s.manifestString)),e&&Object.keys(e).length>0&&(f=e)}let c=null;if(u.default.EXDevLauncher){let e;u.default.EXDevLauncher.manifestString&&(e=JSON.parse(u.default.EXDevLauncher.manifestString)),e&&Object.keys(e).length>0&&(c=e)}let p=null;if(o.default&&o.default.manifest){const e=o.default.manifest;p='string'==typeof e?JSON.parse(e):e}let b=f??c??p;const E=o.default||{},{appOwnership:O}=E,x=(0,n.default)(E,["name","appOwnership"]),v=Object.assign({},x,{appOwnership:O??null});function _(e){return!h(e)}function h(e){return'metadata'in e}function S(e=!1){if(!b){const e=null===b?'null':'undefined';if(x.executionEnvironment,l.ExecutionEnvironment.Bare,x.executionEnvironment===l.ExecutionEnvironment.StoreClient||x.executionEnvironment===l.ExecutionEnvironment.Standalone)throw new t.CodedError('ERR_CONSTANTS_MANIFEST_UNAVAILABLE',`Constants.manifest is ${e}, must be an object.`)}return b}Object.defineProperties(v,{__unsafeNoWarnManifest:{get(){const e=S(!0);return e&&_(e)?e:null},enumerable:!1},__unsafeNoWarnManifest2:{get(){const e=S(!0);return e&&h(e)?e:null},enumerable:!1},manifest:{get(){const e=S();return e&&_(e)?e:null},enumerable:!0},manifest2:{get(){const e=S();return e&&h(e)?e:null},enumerable:!0},expoConfig:{get(){const e=S(!0);return e?s&&s.isEmbeddedLaunch?p:h(e)?e.extra?.expoClient??null:_(e)?e:null:null},enumerable:!0},expoGoConfig:{get(){const e=S(!0);return e?h(e)?e.extra?.expoGo??null:_(e)?e:null:null},enumerable:!0},easConfig:{get(){const e=S(!0);return e?h(e)?e.extra?.eas??null:_(e)?e:null:null},enumerable:!0},__rawManifest_TEST:{get:()=>b,set(e){b=e},enumerable:!1}});var N=v},1006,[35,4,25,1007,1008,1009]);
|
|
1104
1104
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u={UIManager:((e=t)&&e.__esModule?e:{default:e}).default}},1007,[159]);
|
|
1105
1105
|
__d(function(g,r,i,a,m,e,d){"use strict";var t,n,o;Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AppOwnership",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ExecutionEnvironment",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"UserInterfaceIdiom",{enumerable:!0,get:function(){return o}}),(function(t){t.Expo="expo"})(t||(t={})),(function(t){t.Bare="bare",t.Standalone="standalone",t.StoreClient="storeClient"})(n||(n={})),(function(t){t.Handset="handset",t.Tablet="tablet",t.Desktop="desktop",t.TV="tv",t.Unsupported="unsupported"})(o||(o={}))},1008,[]);
|
|
1106
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var t=r(d[0]);const n=(Date.now()+'-'+Math.floor(1e9*Math.random())).toString();function o(){if('undefined'!=typeof navigator&&'string'==typeof navigator.userAgent){const t=navigator.userAgent.toLowerCase();if(t.includes('edge'))return'Edge';if(t.includes('edg'))return'Chromium Edge';if(t.includes('opr')&&'opr'in window&&window.opr)return'Opera';if(t.includes('chrome')&&'chrome'in window&&window.chrome)return'Chrome';if(t.includes('trident'))return'IE';if(t.includes('firefox'))return'Firefox';if(t.includes('safari'))return'Safari'}}var s={get appOwnership(){return null},get executionEnvironment(){return t.ExecutionEnvironment.Bare},get sessionId(){return n},get isHeadless(){return'undefined'==typeof navigator||/\bHeadlessChrome\//.test(navigator.userAgent)},get expoVersion(){return this.manifest.sdkVersion||null},get linkingUri(){return'undefined'!=typeof location?location.origin:''},get expoRuntimeVersion(){return this.expoVersion},get deviceName(){return o()},get systemFonts(){return[]},get statusBarHeight(){return 0},get deviceYearClass(){return null},get manifest(){return"{\"name\":\"Paseo\",\"slug\":\"paseo-hyperdrive\",\"version\":\"0.3.
|
|
1106
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var t=r(d[0]);const n=(Date.now()+'-'+Math.floor(1e9*Math.random())).toString();function o(){if('undefined'!=typeof navigator&&'string'==typeof navigator.userAgent){const t=navigator.userAgent.toLowerCase();if(t.includes('edge'))return'Edge';if(t.includes('edg'))return'Chromium Edge';if(t.includes('opr')&&'opr'in window&&window.opr)return'Opera';if(t.includes('chrome')&&'chrome'in window&&window.chrome)return'Chrome';if(t.includes('trident'))return'IE';if(t.includes('firefox'))return'Firefox';if(t.includes('safari'))return'Safari'}}var s={get appOwnership(){return null},get executionEnvironment(){return t.ExecutionEnvironment.Bare},get sessionId(){return n},get isHeadless(){return'undefined'==typeof navigator||/\bHeadlessChrome\//.test(navigator.userAgent)},get expoVersion(){return this.manifest.sdkVersion||null},get linkingUri(){return'undefined'!=typeof location?location.origin:''},get expoRuntimeVersion(){return this.expoVersion},get deviceName(){return o()},get systemFonts(){return[]},get statusBarHeight(){return 0},get deviceYearClass(){return null},get manifest(){return"{\"name\":\"Paseo\",\"slug\":\"paseo-hyperdrive\",\"version\":\"0.3.41\",\"orientation\":\"portrait\",\"icon\":\"./assets/images/icon.png\",\"scheme\":\"paseo\",\"userInterfaceStyle\":\"automatic\",\"newArchEnabled\":true,\"web\":{\"output\":\"single\",\"favicon\":\"./assets/images/favicon.png\",\"shortName\":\"Paseo\",\"orientation\":\"portrait\",\"name\":\"Paseo\"},\"autolinking\":{\"searchPaths\":[\"../../node_modules\",\"./node_modules\"]},\"experiments\":{\"typedRoutes\":true,\"reactCompiler\":true,\"autolinkingModuleResolution\":true},\"extra\":{\"router\":{},\"eas\":{\"build\":{\"experimental\":{\"ios\":{\"appExtensions\":[{\"bundleIdentifier\":\"bot.hyperdrive.paseo.AgentActivity\",\"targetName\":\"AgentActivity\"}]}}}}},\"sdkVersion\":\"54.0.0\",\"platforms\":[\"ios\",\"android\",\"web\"]}"},get manifest2(){return null},get experienceUrl(){return'undefined'!=typeof location?location.origin:''},get debugMode(){return!1},getWebViewUserAgentAsync:async()=>'undefined'!=typeof navigator?navigator.userAgent:null}},1009,[1008]);
|
|
1107
1107
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),n=r(d[1]),o=(e=n)&&e.__esModule?e:{default:e};async function u(){if(!o.default.unregisterForNotificationsAsync)throw new t.UnavailabilityError('ExpoNotifications','unregisterForNotificationsAsync');return o.default.unregisterForNotificationsAsync()}},1010,[4,1011]);
|
|
1108
1108
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}}),r(d[0]);let t=!1;var n={addListener:()=>(t||(console.warn("[expo-notifications] Listening to push token changes is not yet fully supported on web. Adding a listener will have no effect."),t=!0),{remove:()=>{}}),removeListener:()=>{},removeAllListeners:()=>{},emit:()=>{},listenerCount:()=>0}},1011,[4]);
|
|
1109
1109
|
__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}),t.default=e,t})(r(_d[0])),o=e(r(_d[1])),n=r(_d[2]),c=r(_d[3]),s=e(r(_d[4])),d=e(r(_d[5]));const p='https://exp.host/--/api/v2/';async function u(e={}){const s=e.devicePushToken||await(0,d.default)(),u=e.deviceId||await h(),R=e.projectId||o.default.easConfig?.projectId||o.default.expoConfig?.extra?.eas?.projectId;if(!R)throw new n.CodedError('ERR_NOTIFICATIONS_NO_EXPERIENCE_ID',"No \"projectId\" found. If \"projectId\" can't be inferred from the manifest (for instance, in bare workflow), you have to pass it in yourself.");const w=e.applicationId||t.applicationId;if(!w)throw new n.CodedError('ERR_NOTIFICATIONS_NO_APPLICATION_ID',"No \"applicationId\" found. If it can't be inferred from native configuration by expo-application, you have to pass it in yourself.");const O=e.type||y(s),_=e.development||await I(),v=e.baseUrl??p,N=e.url??`${v}push/getExpoPushToken`,x={type:O,deviceId:u.toLowerCase(),development:_,appId:w,deviceToken:E(s),projectId:R},T=await fetch(N,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(x)}).catch(e=>{throw new n.CodedError('ERR_NOTIFICATIONS_NETWORK_ERROR',`Error encountered while fetching Expo token: ${e}.`)});if(!T.ok){const e=T.statusText||T.status;let t;try{t=await T.text()}catch{}throw new n.CodedError('ERR_NOTIFICATIONS_SERVER_ERROR',`Error encountered while fetching Expo token, expected an OK response, received: ${e} (body: "${t}").`)}const b=l(await f(T));try{e.url||e.baseUrl?console.debug("[expo-notifications] Since the URL endpoint to register in has been customized in the options, expo-notifications won't try to auto-update the device push token on the server."):await(0,c.setAutoServerRegistrationEnabledAsync)(!0)}catch(e){console.warn('[expo-notifications] Could not enable automatically registering new device tokens with the Expo notification service',e)}return{type:'expo',data:b}}async function f(e){try{return await e.json()}catch{try{throw new n.CodedError('ERR_NOTIFICATIONS_SERVER_ERROR',`Expected a JSON response from server when fetching Expo token, received body: ${JSON.stringify(await e.text())}.`)}catch{throw new n.CodedError('ERR_NOTIFICATIONS_SERVER_ERROR',`Expected a JSON response from server when fetching Expo token, received response: ${JSON.stringify(e)}.`)}}}function l(e){if(!e||'object'!=typeof e||!e.data||'object'!=typeof e.data||!e.data.expoPushToken||'string'!=typeof e.data.expoPushToken)throw new n.CodedError('ERR_NOTIFICATIONS_SERVER_ERROR',`Malformed response from server, expected "{ data: { expoPushToken: string } }", received: ${JSON.stringify(e,null,2)}.`);return e.data.expoPushToken}async function h(){try{if(!s.default.getInstallationIdAsync)throw new n.UnavailabilityError('ExpoServerRegistrationModule','getInstallationIdAsync');return await s.default.getInstallationIdAsync()}catch(e){throw new n.CodedError('ERR_NOTIF_DEVICE_ID',`Could not have fetched installation ID of the application: ${e}.`)}}function E(e){return'string'==typeof e.data?e.data:JSON.stringify(e.data)}async function I(){return!1}function y(e){switch(e.type){case'ios':return'apns';case'android':return'fcm';default:return e.type}}},1012,[1013,1006,4,1016,1020,1005]);
|
|
@@ -14923,7 +14923,7 @@ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',
|
|
|
14923
14923
|
__d(function(g,r,_i,_a,m,e,d){'use strict';m.exports=function t(n,f){if(n===f)return!0;if(n&&f&&'object'==typeof n&&'object'==typeof f){if(n.constructor!==f.constructor)return!1;var i,o,u;if(Array.isArray(n)){if((i=n.length)!=f.length)return!1;for(o=i;0!==o--;)if(!t(n[o],f[o]))return!1;return!0}if(n instanceof Map&&f instanceof Map){if(n.size!==f.size)return!1;for(o of n.entries())if(!f.has(o[0]))return!1;for(o of n.entries())if(!t(o[1],f.get(o[0])))return!1;return!0}if(n instanceof Set&&f instanceof Set){if(n.size!==f.size)return!1;for(o of n.entries())if(!f.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(n)&&ArrayBuffer.isView(f)){if((i=n.length)!=f.length)return!1;for(o=i;0!==o--;)if(n[o]!==f[o])return!1;return!0}if(n.constructor===RegExp)return n.source===f.source&&n.flags===f.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===f.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===f.toString();if((i=(u=Object.keys(n)).length)!==Object.keys(f).length)return!1;for(o=i;0!==o--;)if(!Object.prototype.hasOwnProperty.call(f,u[o]))return!1;for(o=i;0!==o--;){var s=u[o];if(!t(n[s],f[s]))return!1}return!0}return n!=n&&f!=f}},3278,[]);
|
|
14924
14924
|
__d(function(e,s,t,r,n,o,a){"use strict";const i=["requestId"],c=["config","provider","cwd","env","workspaceId","initialPrompt","images","git","worktreeName","requestId","labels"];Object.defineProperty(o,'__esModule',{value:!0}),Object.defineProperty(o,"UploadCancelledError",{enumerable:!0,get:function(){return M}}),Object.defineProperty(o,"UploadCapExceededError",{enumerable:!0,get:function(){return E}}),Object.defineProperty(o,"UploadFailedError",{enumerable:!0,get:function(){return P}}),Object.defineProperty(o,"DaemonClient",{enumerable:!0,get:function(){return B}});var d,u=s(a[0]),p=(d=u)&&d.__esModule?d:{default:d},l=s(a[1]),h=s(a[2]),m=s(a[3]),g=s(a[4]),y=s(a[5]),I=s(a[6]),q=s(a[7]),f=s(a[8]),w=s(a[9]),_=s(a[10]),S=s(a[11]);const b={debug:()=>{},info:(e,s)=>console.log(s,e),warn:(e,s)=>console.warn(s,e),error:(e,s)=>console.error(s,e)},v="undefined"!=typeof performance&&"function"==typeof performance.now?()=>performance.now():()=>Date.now();function k(e){return"string"!=typeof e?null:e.length>0?e:null}function R(e,s){return"string"!=typeof e?e:"string"==typeof s?{agentId:e,requestId:s}:Object.assign({agentId:e},s)}function T(e,s){return"string"!=typeof e?e:"string"==typeof s?{agentId:e,requestId:s}:Object.assign({agentId:e},s)}class C extends Error{constructor(e){const s=[e.error];e.requestType&&s.push(`requestType=${e.requestType}`),e.code&&s.push(`code=${e.code}`),super(s.join(" ")),this.name="DaemonRpcError",this.requestId=e.requestId,this.requestType=e.requestType,this.code=e.code}}class M extends Error{constructor(e){super("Upload cancelled"),this.name="UploadCancelledError",this.uploadId=e}}class E extends Error{constructor(e,s){super(s??"Upload exceeds the size cap"),this.name="UploadCapExceededError",this.uploadId=e,this.code="too_large"}}class P extends Error{constructor(e,s,t){super(s),this.name="UploadFailedError",this.uploadId=e,t&&(this.code=t)}}function A(e,s,t){return"too_large"===s?new E(e,t):new P(e,t??`Upload failed: ${s}`,s)}class j extends Error{constructor(e){super(`Ping timed out (${e}ms)`),this.timeoutMs=e,this.name="PingTimeoutError"}}function O(e,s,t){return e instanceof j?new Error(`${s} timed out (${t}ms)`):e instanceof Error?e:new Error(String(e))}const F=6e4;function L(e){return e instanceof Error&&e.message.startsWith("Timeout waiting for message")}function x(e){if("string"!=typeof e)return null;const s=e.trim();return s.length>0?s:null}function D(e){const s=globalThis.atob(e),t=new Uint8Array(s.length);for(let e=0;e<s.length;e+=1)t[e]=s.charCodeAt(e);return t}function Q(e){let s="";for(let t=0;t<e.length;t+=32768)s+=String.fromCharCode.apply(null,e.subarray(t,t+32768));return globalThis.btoa(s)}function H(e){let s;return s="base64"===e.encoding&&e.content?D(e.content):"utf-8"===e.encoding&&e.content?(new TextEncoder).encode(e.content):new Uint8Array,{bytes:s,mime:e.mimeType??"application/octet-stream",size:e.size,path:e.path,kind:e.kind,modifiedAt:e.modifiedAt}}function N(e,s){const t=new Uint8Array(s);let r=0;for(const s of e)t.set(s,r),r+=s.byteLength;return t}function U(e){let s=0;for(let t=0;t<e.length;t+=1)s=31*s+e.charCodeAt(t)|0;return`h_${Math.abs(s).toString(16)}`}function W(e){if(!e)return null;const s=e.toLowerCase();return s.includes("timed out")?"connect_timeout":s.includes("disposed")?"disposed":s.includes("client closed")?"client_closed":s.includes("transport")?"transport_error":s.includes("failed to connect")?"connect_failed":"unknown"}class B{constructor(e){this.config=e,this.transport=null,this.transportCleanup=[],this.rawMessageListeners=new Set,this.messageHandlers=new Map,this.eventListeners=new Set,this.waiters=new Set,this.checkoutStatusInFlight=new Map,this.connectionListeners=new Set,this.reconnectTimeout=null,this.connectTimeout=null,this.pendingGenericTransportErrorTimeout=null,this.reconnectAttempt=0,this.shouldReconnect=!0,this.connectPromise=null,this.connectResolve=null,this.connectReject=null,this.lastErrorValue=null,this.connectionState={status:"idle"},this.checkoutDiffSubscriptions=new Map,this.terminalDirectorySubscriptions=new Map,this.terminalStreams=new S.TerminalStreamRouter,this.pendingBinaryFileReads=new Map,this.activeBinaryFileTransfers=new Map,this.completedBinaryFileReads=new Map,this.pendingSendQueue=[],this.lastServerInfoMessage=null,this.runtimeMetricsInterval=null,this.runtimeMetrics=null,this.pingProbe=null,this.livenessHeartbeatTimer=null,this.lastLivenessRttMs=null,this.consecutiveLivenessFailures=0,this.logger=e.logger??b,this.logConnectionPath=(0,g.isRelayClientWebSocketUrl)(this.config.url)?"relay":"direct";let s=null;try{s=new URL(this.config.url)}catch{s=null}const t=x(s?.searchParams.get("serverId"));this.logServerId=t??s?.host??null;const r=x(this.config.clientId);if(!r)throw new Error("Daemon client requires a non-empty clientId");this.config.clientId=r,this.logClientIdHash=U(r),this.logGeneration="number"==typeof this.config.runtimeGeneration&&Number.isFinite(this.config.runtimeGeneration)?this.config.runtimeGeneration:null;const n="number"==typeof e.runtimeMetricsIntervalMs&&e.runtimeMetricsIntervalMs>0?e.runtimeMetricsIntervalMs:0;if(n>0){const s="number"==typeof e.runtimeMetricsWindowMs&&e.runtimeMetricsWindowMs>0?Math.max(e.runtimeMetricsWindowMs,n):void 0;this.runtimeMetrics=new w.DaemonClientRuntimeMetrics(this.logger,{connectionPath:this.logConnectionPath,serverId:this.logServerId,getConnectionStatus:()=>this.connectionState.status},s?{windowMs:s}:void 0),this.runtimeMetricsInterval=setInterval(()=>{this.runtimeMetrics?.flush()},n)}}async connect(){if("disposed"===this.connectionState.status)throw new Error("Daemon client is disposed");if("connected"!==this.connectionState.status)return this.connectPromise||(this.shouldReconnect=!0,this.connectPromise=new Promise((e,s)=>{this.connectResolve=e,this.connectReject=s,this.attemptConnect()})),this.connectPromise}attemptConnect(){if("disposed"===this.connectionState.status)return void this.rejectConnect(new Error("Daemon client is disposed"));if(!this.shouldReconnect)return void this.rejectConnect(new Error("Daemon client is closed"));if("connecting"===this.connectionState.status)return;const e={},s=k(this.config.password);s?e.Authorization=`Bearer ${s}`:this.config.authHeader&&(e.Authorization=this.config.authHeader);const t=s?[`paseo.bearer.${s}`]:void 0;try{this.disposeTransport();const s=this.config.transportFactory??(0,f.createWebSocketTransportFactory)(this.config.webSocketFactory??f.defaultWebSocketFactory),r=!0===this.config.e2ee?.enabled&&(0,g.isRelayClientWebSocketUrl)(this.config.url);let n=s;if(r){const e=this.config.e2ee?.daemonPublicKeyB64;if(!e)throw new Error("daemonPublicKeyB64 is required for relay E2EE");n=(0,f.createRelayE2eeTransportFactory)({baseFactory:s,daemonPublicKeyB64:e,logger:this.logger})}const o=this.resolveTransportUrlForAttempt(),a=n(Object.assign({url:o,headers:e},t?{protocols:t}:{}));this.transport=a,this.lastServerInfoMessage=null,this.updateConnectionState({status:"connecting",attempt:this.reconnectAttempt},{event:"CONNECT_REQUEST"}),this.resetConnectTimeout();const i=Math.max(1,this.config.connectTimeoutMs??15e3);this.connectTimeout=setTimeout(()=>{"connecting"===this.connectionState.status&&(this.lastErrorValue="Connection timed out",this.disposeTransport(1001,"Connection timed out"),this.scheduleReconnect({reason:"Connection timed out",event:"CONNECT_TIMEOUT",reasonCode:"connect_timeout"}))},i),this.transportCleanup=[a.onOpen(()=>{this.pendingGenericTransportErrorTimeout&&(clearTimeout(this.pendingGenericTransportErrorTimeout),this.pendingGenericTransportErrorTimeout=null),this.lastErrorValue=null,this.sendHelloMessage()}),a.onClose(e=>{this.resetConnectTimeout(),this.pendingGenericTransportErrorTimeout&&(clearTimeout(this.pendingGenericTransportErrorTimeout),this.pendingGenericTransportErrorTimeout=null);const s=(0,f.describeTransportClose)(e);s&&(this.lastErrorValue=s),this.scheduleReconnect({reason:s,event:"TRANSPORT_CLOSE",reasonCode:"transport_closed"})}),a.onError(e=>{this.resetConnectTimeout();const s=(0,f.describeTransportError)(e);if("Transport error"===s)return this.lastErrorValue??(this.lastErrorValue=s),void(this.pendingGenericTransportErrorTimeout||(this.pendingGenericTransportErrorTimeout=setTimeout(()=>{this.pendingGenericTransportErrorTimeout=null,"connected"!==this.connectionState.status&&"connecting"!==this.connectionState.status||(this.lastErrorValue=s,this.scheduleReconnect({reason:s,event:"TRANSPORT_ERROR",reasonCode:"transport_error"}))},250)));this.pendingGenericTransportErrorTimeout&&(clearTimeout(this.pendingGenericTransportErrorTimeout),this.pendingGenericTransportErrorTimeout=null),this.lastErrorValue=s,this.scheduleReconnect({reason:s,event:"TRANSPORT_ERROR",reasonCode:"transport_error"})}),a.onMessage(e=>this.handleTransportMessage(e))]}catch(e){this.resetConnectTimeout();const s=e instanceof Error?e.message:"Failed to connect";this.lastErrorValue=s,this.scheduleReconnect({reason:s,event:"CONNECT_FAILED",reasonCode:"connect_failed"}),this.rejectConnect(e instanceof Error?e:new Error(s))}}resolveConnect(){this.connectResolve&&this.connectResolve(),this.connectPromise=null,this.connectResolve=null,this.connectReject=null}rejectConnect(e){this.connectReject&&this.connectReject(e),this.connectPromise=null,this.connectResolve=null,this.connectReject=null}async close(){"disposed"!==this.connectionState.status&&(this.shouldReconnect=!1,this.connectPromise=null,this.connectResolve=null,this.connectReject=null,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.resetConnectTimeout(),this.disposeTransport(1e3,"Client closed"),this.clearWaiters(new Error("Daemon client closed")),this.rejectPendingSendQueue(new Error("Daemon client closed")),this.rejectPingProbe(new Error("Daemon client closed")),this.terminalStreams.clearSlots(),this.lastServerInfoMessage=null,this.runtimeMetricsInterval&&(clearInterval(this.runtimeMetricsInterval),this.runtimeMetricsInterval=null,this.runtimeMetrics?.flush({final:!0}),this.runtimeMetrics=null),this.updateConnectionState({status:"disposed"},{event:"DISPOSE",reason:"Client closed",reasonCode:"disposed"}))}ensureConnected(){"disposed"!==this.connectionState.status&&(this.shouldReconnect||(this.shouldReconnect=!0),"connected"!==this.connectionState.status&&"connecting"!==this.connectionState.status&&this.connect())}getConnectionState(){return this.connectionState}subscribeConnectionStatus(e){return this.connectionListeners.add(e),e(this.connectionState),()=>{this.connectionListeners.delete(e)}}get isConnected(){return"connected"===this.connectionState.status}get isConnecting(){return"connecting"===this.connectionState.status}get lastError(){return this.lastErrorValue}getLastLivenessRttMs(){return this.lastLivenessRttMs}subscribe(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}subscribeRawMessages(e){return this.rawMessageListeners.add(e),()=>{this.rawMessageListeners.delete(e)}}on(e,s){if("function"==typeof e)return this.subscribe(e);const t=e,r=s;return this.messageHandlers.has(t)||this.messageHandlers.set(t,new Set),this.messageHandlers.get(t).add(r),()=>{const e=this.messageHandlers.get(t);e&&(e.delete(r),0===e.size&&this.messageHandlers.delete(t))}}sendSessionMessage(e){if(!this.transport||"connected"!==this.connectionState.status){if(this.config.suppressSendErrors)return;throw new Error(`Transport not connected (status: ${this.connectionState.status})`)}const s=h.SessionInboundMessageSchema.parse(e);try{this.transport.send(JSON.stringify({type:"session",message:s}))}catch(e){if(this.config.suppressSendErrors)return;throw e instanceof Error?e:new Error(String(e))}}sendBinaryFrame(e){if(!this.transport||"connected"!==this.connectionState.status){if(this.config.suppressSendErrors)return;throw new Error(`Transport not connected (status: ${this.connectionState.status})`)}try{this.transport.send(e)}catch(e){if(this.config.suppressSendErrors)return;throw e instanceof Error?e:new Error(String(e))}}sendSessionMessageOrThrow(e){const s=this.connectionState.status;if(this.transport&&"connected"===s){const s=h.SessionInboundMessageSchema.parse(e);return this.transport.send(JSON.stringify({type:"session",message:s})),Promise.resolve()}return"connecting"===s?new Promise((s,t)=>{const r=setTimeout(()=>{const e=this.pendingSendQueue.findIndex(e=>e.resolve===s);-1!==e&&this.pendingSendQueue.splice(e,1),t(new Error("Timed out waiting for connection to send message"))},this.config.defaultSendQueueTimeoutMs??6e4);this.pendingSendQueue.push({message:e,resolve:s,reject:t,timeoutHandle:r})}):Promise.reject(new Error(`Transport not connected (status: ${s})`))}flushPendingSendQueue(){const e=this.pendingSendQueue;this.pendingSendQueue=[];for(const s of e){clearTimeout(s.timeoutHandle);try{if(this.transport&&"connected"===this.connectionState.status){const e=h.SessionInboundMessageSchema.parse(s.message);this.transport.send(JSON.stringify({type:"session",message:e})),s.resolve()}else s.reject(new Error("Connection lost before message could be sent"))}catch(e){s.reject(e instanceof Error?e:new Error(String(e)))}}}rejectPendingSendQueue(e){const s=this.pendingSendQueue;this.pendingSendQueue=[];for(const t of s)clearTimeout(t.timeoutHandle),t.reject(e)}async sendRequest(e){const s=e.timeout??F,{promise:t,cancel:r}=this.waitForWithCancel(s=>{if("rpc_error"===s.type&&s.payload.requestId===e.requestId)return{kind:"error",error:new C({requestId:s.payload.requestId,error:s.payload.error,requestType:s.payload.requestType,code:s.payload.code})};const t=e.select(s);return null===t?null:{kind:"ok",value:t}},s,e.options);try{await this.sendSessionMessageOrThrow(e.message)}catch(e){const s=e instanceof Error?e:new Error(String(e));throw r(s),t.catch(()=>{}),s}const n=await t;if("error"===n.kind)throw n.error;return n.value}async sendCorrelatedRequest(e){return this.sendRequest({requestId:e.requestId,message:e.message,timeout:e.timeout,options:e.options,select:s=>{const t=s;if(t.type!==e.responseType)return null;const r=t.payload;return r.requestId!==e.requestId?null:e.selectPayload?e.selectPayload(r):r}})}sendCorrelatedSessionRequest(e){const s=this.createRequestId(e.requestId),t=h.SessionInboundMessageSchema.parse(Object.assign({},e.message,{requestId:s}));return this.sendCorrelatedRequest(Object.assign({requestId:s,message:t,responseType:e.responseType,timeout:e.timeout,options:{skipQueue:!0}},e.selectPayload?{selectPayload:e.selectPayload}:{}))}sendNamespacedCorrelatedSessionRequest(e){const s=e.message.type.replace(/\.request$/,".response");return this.sendCorrelatedSessionRequest(Object.assign({},e,{responseType:s}))}sendSessionMessageStrict(e){if(!this.transport||"connected"!==this.connectionState.status)throw new Error("Transport not connected");const s=h.SessionInboundMessageSchema.parse(e);try{this.transport.send(JSON.stringify({type:"session",message:s}))}catch(e){throw e instanceof Error?e:new Error(String(e))}}async clearAgentAttention(e){const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse({type:"clear_agent_attention",agentId:e,requestId:s});await this.sendRequest({requestId:s,message:t,options:{skipQueue:!0},select:e=>"clear_agent_attention_response"!==e.type||e.payload.requestId!==s?null:e.payload})}async clearWorkspaceAttention(e){const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse({type:"workspace.clear_attention.request",workspaceId:e,requestId:s}),r=await this.sendRequest({requestId:s,message:t,options:{skipQueue:!0},select:e=>"workspace.clear_attention.response"!==e.type||e.payload.requestId!==s?null:e.payload});if(!r.success)throw new Error(r.error??"Failed to clear workspace attention")}sendHeartbeat(e){this.sendSessionMessage({type:"client_heartbeat",deviceType:e.deviceType,focusedAgentId:e.focusedAgentId,focusedTerminalId:e.focusedTerminalId??null,lastActivityAt:e.lastActivityAt,appVisible:e.appVisible,appVisibilityChangedAt:e.appVisibilityChangedAt})}registerPushToken(e){this.sendSessionMessage({type:"register_push_token",token:e})}sendWatchAction(e){this.sendSessionMessage(e)}async ping(e){const s=e?.requestId??`ping-${Date.now()}-${Math.random().toString(36).slice(2)}`,t=Date.now(),r=await this.sendRequest({requestId:s,message:{type:"ping",requestId:s,clientSentAt:t},timeout:e?.timeoutMs??5e3,select:e=>"pong"!==e.type||e.payload.requestId!==s||"number"!=typeof e.payload.serverReceivedAt||"number"!=typeof e.payload.serverSentAt?null:e.payload});return{requestId:s,clientSentAt:t,serverReceivedAt:r.serverReceivedAt,serverSentAt:r.serverSentAt,rttMs:Date.now()-t}}measureLatency(e){const s=Math.max(1,e?.timeoutMs??5e3);return this.sendPingAwaitRtt({timeoutMs:s,drivesLivenessFailure:!1}).catch(e=>{throw O(e,"Latency measurement",s)})}async livenessPing(e){const s=Math.max(1,e?.timeoutMs??5e3);try{const e=await this.sendPingAwaitRtt({timeoutMs:s,drivesLivenessFailure:!0});return this.lastLivenessRttMs=e,e}catch(e){throw O(e,"Liveness check",s)}}sendPingAwaitRtt(e){if("connected"!==this.connectionState.status||!this.transport)return Promise.reject(new Error(`Transport not connected (status: ${this.connectionState.status})`));if(this.pingProbe)return this.pingProbe.promise;const s=v(),t=e.timeoutMs;let r=null,n=null;const o=new Promise((e,s)=>{r=e,n=s}),a={promise:o,resolve:e=>r?.(e),reject:e=>n?.(e),timeoutHandle:setTimeout(()=>{if(this.pingProbe!==a)return;this.pingProbe=null;const e=new j(t);a.reject(e),a.drivesLivenessFailure&&this.recordLivenessFailure(O(e,"Liveness check",t))},t),startedAt:s,drivesLivenessFailure:e.drivesLivenessFailure};this.pingProbe=a;try{this.transport.send(JSON.stringify({type:"ping"}))}catch(e){this.clearPingProbe();const s=e instanceof Error?e:new Error(String(e));return a.drivesLivenessFailure&&this.recordLivenessFailure(s),Promise.reject(s)}return o}startLivenessHeartbeat(){this.stopLivenessHeartbeat(),this.lastLivenessRttMs=null,this.scheduleNextLivenessHeartbeat()}stopLivenessHeartbeat(){this.livenessHeartbeatTimer&&(clearTimeout(this.livenessHeartbeatTimer),this.livenessHeartbeatTimer=null)}scheduleNextLivenessHeartbeat(){"connected"!==this.connectionState.status||this.livenessHeartbeatTimer||(this.livenessHeartbeatTimer=setTimeout(()=>{this.livenessHeartbeatTimer=null,this.livenessPing({timeoutMs:15e3}).catch(()=>{}).finally(()=>{this.scheduleNextLivenessHeartbeat()})},1e4))}async fetchAgents(e){const s=this.createRequestId(e?.requestId),t=h.SessionInboundMessageSchema.parse(Object.assign({type:"fetch_agents_request",requestId:s},e?.scope?{scope:e.scope}:{},e?.filter?{filter:e.filter}:{},e?.sort?{sort:e.sort}:{},e?.page?{page:e.page}:{},e?.subscribe?{subscribe:e.subscribe}:{}));return this.sendRequest({requestId:s,message:t,timeout:e?.timeout,options:{skipQueue:!0},select:e=>"fetch_agents_response"!==e.type||e.payload.requestId!==s?null:e.payload})}async fetchAgentHistory(e){const s=this.createRequestId(e?.requestId),t=h.SessionInboundMessageSchema.parse(Object.assign({type:"fetch_agent_history_request",requestId:s},e?.filter?{filter:e.filter}:{},e?.sort?{sort:e.sort}:{},e?.page?{page:e.page}:{}));return this.sendRequest({requestId:s,message:t,options:{skipQueue:!0},select:e=>"fetch_agent_history_response"!==e.type||e.payload.requestId!==s?null:e.payload})}async fetchRecentProviderSessions(e){const s=this.createRequestId(e?.requestId),t=h.SessionInboundMessageSchema.parse(Object.assign({type:"fetch_recent_provider_sessions_request",requestId:s},e?.cwd?{cwd:e.cwd}:{},e?.providers?{providers:e.providers}:{},e?.since?{since:e.since}:{},e?.limit?{limit:e.limit}:{}));return this.sendRequest({requestId:s,message:t,options:{skipQueue:!0},select:e=>"fetch_recent_provider_sessions_response"!==e.type||e.payload.requestId!==s?null:e.payload})}async fetchWorkspaces(e){const s=this.createRequestId(e?.requestId),t=h.SessionInboundMessageSchema.parse(Object.assign({type:"fetch_workspaces_request",requestId:s},e?.filter?{filter:e.filter}:{},e?.sort?{sort:e.sort}:{},e?.page?{page:e.page}:{},e?.subscribe?{subscribe:e.subscribe}:{}));return this.sendRequest({requestId:s,message:t,options:{skipQueue:!0},select:e=>"fetch_workspaces_response"!==e.type||e.payload.requestId!==s?null:e.payload})}async openProject(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"open_project_request",cwd:e},responseType:"open_project_response"})}async addProject(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"project.add.request",cwd:e},responseType:"project.add.response"})}async startWorkspaceScript(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"start_workspace_script_request",workspaceId:e,scriptName:s},responseType:"start_workspace_script_response"})}async archiveWorkspace(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"archive_workspace_request",workspaceId:e},responseType:"archive_workspace_response"})}async renameProject(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"project.rename.request",projectId:e,customName:s},responseType:"project.rename.response",timeout:1e4})}async fetchWorkspaceSetupStatus(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"workspace_setup_status_request",workspaceId:e},responseType:"workspace_setup_status_response"})}async fetchAgent(e,s){const t=R(e,s),r=this.createRequestId(t.requestId),n=h.SessionInboundMessageSchema.parse({type:"fetch_agent_request",requestId:r,agentId:t.agentId}),o=await this.sendRequest({requestId:r,message:n,timeout:t.timeout,options:{skipQueue:!0},select:e=>"fetch_agent_response"!==e.type||e.payload.requestId!==r?null:e.payload});if(o.error)throw new Error(o.error);return o.agent?{agent:o.agent,project:o.project??null}:null}resubscribeCheckoutDiffSubscriptions(){if(0!==this.checkoutDiffSubscriptions.size)for(const[e,s]of this.checkoutDiffSubscriptions){const t=h.SessionInboundMessageSchema.parse({type:"subscribe_checkout_diff_request",subscriptionId:e,cwd:s.cwd,compare:s.compare,requestId:this.createRequestId()});this.sendSessionMessage(t)}}resubscribeTerminalDirectorySubscriptions(){if(0!==this.terminalDirectorySubscriptions.size)for(const e of this.terminalDirectorySubscriptions.values())this.sendSessionMessage(Object.assign({type:"subscribe_terminals_request",cwd:e.cwd},void 0!==e.workspaceId?{workspaceId:e.workspaceId}:{}))}async createAgent(e){const s=this.createRequestId(e.requestId),t=$(e),r=h.SessionInboundMessageSchema.parse(Object.assign({type:"create_agent_request",requestId:s,config:t},e.env?{env:e.env}:{},void 0!==e.workspaceId?{workspaceId:e.workspaceId}:{},e.initialPrompt?{initialPrompt:e.initialPrompt}:{},e.clientMessageId?{clientMessageId:e.clientMessageId}:{},e.outputSchema?{outputSchema:e.outputSchema}:{},e.images&&e.images.length>0?{images:e.images}:{},e.attachments&&e.attachments.length>0?{attachments:e.attachments}:{},e.git?{git:e.git}:{},e.worktree?{worktree:e.worktree}:{},void 0!==e.autoArchive?{autoArchive:e.autoArchive}:{},e.worktreeName?{worktreeName:e.worktreeName}:{},e.labels&&Object.keys(e.labels).length>0?{labels:e.labels}:{},e.resumeSessionId?{resumeSessionId:e.resumeSessionId}:{})),n=await this.sendRequest({requestId:s,message:r,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const t=h.AgentCreatedStatusPayloadSchema.safeParse(e.payload);if(t.success&&t.data.requestId===s)return t.data;const r=h.AgentCreateFailedStatusPayloadSchema.safeParse(e.payload);return r.success&&r.data.requestId===s?r.data:null}});if("agent_create_failed"===n.status)throw new Error(n.error);return n.agent}async deleteAgent(e){const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse({type:"delete_agent_request",agentId:e,requestId:s});await this.sendRequest({requestId:s,message:t,options:{skipQueue:!0},select:e=>"agent_deleted"!==e.type||e.payload.requestId!==s?null:e.payload})}async archiveAgent(e){const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse({type:"archive_agent_request",agentId:e,requestId:s});return{archivedAt:(await this.sendRequest({requestId:s,message:t,options:{skipQueue:!0},select:e=>"agent_archived"!==e.type||e.payload.requestId!==s?null:e.payload})).archivedAt}}async listBackgroundTasks(e){const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse(Object.assign({type:"list_background_tasks_request"},void 0===e?{}:{agentId:e},{requestId:s}));return(await this.sendCorrelatedRequest({requestId:s,message:t,responseType:"list_background_tasks_response",options:{skipQueue:!0}})).tasks}async readBackgroundTaskOutput(e,s,t){const r=this.createRequestId(),n=h.SessionInboundMessageSchema.parse(Object.assign({type:"background_task_output_request",agentId:e,taskId:s},void 0===t?.maxBytes?{}:{maxBytes:t.maxBytes},{requestId:r})),o=await this.sendCorrelatedRequest({requestId:r,message:n,responseType:"background_task_output_response",options:{skipQueue:!0}});return{text:o.text,truncated:o.truncated,byteSize:o.byteSize}}async dismissBackgroundTask(e,s){const t=this.createRequestId(),r=h.SessionInboundMessageSchema.parse({type:"dismiss_background_task_request",agentId:e,taskId:s,requestId:t});return{dismissed:(await this.sendRequest({requestId:t,message:r,timeout:1e4,options:{skipQueue:!0},select:e=>"background_task_dismissed"!==e.type||e.payload.requestId!==t?null:e.payload})).dismissed}}async detachAgent(e){const s=await this.sendNamespacedCorrelatedSessionRequest({message:{type:"agent.detach.request",agentId:e}});if(!s.accepted)throw new Error(s.error??"detachAgent rejected")}async updateAgent(e,s){const t=this.createRequestId(),r=h.SessionInboundMessageSchema.parse(Object.assign({type:"update_agent_request",agentId:e},void 0!==s.name?{name:s.name}:{},s.labels&&Object.keys(s.labels).length>0?{labels:s.labels}:{},{requestId:t})),n=await this.sendRequest({requestId:t,message:r,options:{skipQueue:!0},select:e=>"update_agent_response"!==e.type||e.payload.requestId!==t?null:e.payload});if(!n.accepted)throw new Error(n.error??"updateAgent rejected")}async rewindSession(e,s){const t=this.createRequestId(),r=h.SessionInboundMessageSchema.parse({type:"rewind_session_request",requestId:t,agentId:e,turnId:s}),n=await this.sendRequest({requestId:t,message:r,timeout:3e4,options:{skipQueue:!0},select:e=>"rewind_session_response"!==e.type||e.payload.requestId!==t?null:e.payload});if(n.error||!n.newSessionId)throw new Error(n.error??"rewind: daemon response missing newSessionId");return{newSessionId:n.newSessionId}}async editMessage(e,s,t){const r=this.createRequestId(),n=h.SessionInboundMessageSchema.parse(Object.assign({type:"edit_message_request",requestId:r,agentId:e,turnId:s},"string"==typeof t?{newContent:t}:{})),o=await this.sendRequest({requestId:r,message:n,timeout:3e4,options:{skipQueue:!0},select:e=>"edit_message_response"!==e.type||e.payload.requestId!==r?null:e.payload});if(o.error||!o.newSessionId)throw new Error(o.error??"editMessage: daemon response missing newSessionId");return{newSessionId:o.newSessionId}}async listWorkspaceSessions(e,s){const t=this.createRequestId(),r=h.SessionInboundMessageSchema.parse({type:"list_workspace_sessions_request",requestId:t,workspaceId:e}),n=await this.sendRequest({requestId:t,message:r,timeout:3e4,options:{skipQueue:!0},select:e=>"list_workspace_sessions_response"!==e.type||e.payload.requestId!==t?null:e.payload});if(n.error)throw new Error(n.error);return Array.isArray(n.sessions)?n.sessions:[]}async subscribePush(e){const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse({type:"subscribe_push_request",requestId:s,subscription:e}),r=await this.sendRequest({requestId:s,message:t,timeout:15e3,options:{skipQueue:!0},select:e=>"subscribe_push_response"!==e.type||e.payload.requestId!==s?null:e.payload});if(!r.ok||r.error)throw new Error(r.error??"subscribePush rejected");return Object.assign({ok:r.ok},r.vapidPublicKey?{vapidPublicKey:r.vapidPublicKey}:{})}async getVapidPublicKey(){const e=this.createRequestId(),s=h.SessionInboundMessageSchema.parse({type:"get_vapid_public_key_request",requestId:e});return(await this.sendRequest({requestId:e,message:s,timeout:15e3,options:{skipQueue:!0},select:s=>"get_vapid_public_key_response"!==s.type||s.payload.requestId!==e?null:s.payload})).publicKey}async listAllSessions(e){if(this.lastServerInfoMessage?.features?.sessionsListRpc||(0,g.isRelayClientWebSocketUrl)(this.config.url)){const e=this.createRequestId(),s=h.SessionInboundMessageSchema.parse({type:"list_all_sessions_request",requestId:e}),t=await this.sendRequest({requestId:e,message:s,timeout:15e3,options:{skipQueue:!0},select:s=>"list_all_sessions_response"!==s.type||s.payload.requestId!==e?null:s.payload});if(t.error)throw new Error(`list_all_sessions failed: ${t.error}`);return Array.isArray(t.sessions)?t.sessions:[]}const s=await this.daemonHttpJson({method:"GET",path:"/sessions",signal:e?.signal});return Array.isArray(s.sessions)?s.sessions:[]}async listWorkflows(){if(!0!==this.lastServerInfoMessage?.features?.workflows)return[];const e=this.createRequestId(),s=h.SessionInboundMessageSchema.parse({type:"workflow.list.request",requestId:e});return this.sendRequest({requestId:e,message:s,timeout:15e3,options:{skipQueue:!0},select:s=>"workflow.list.response"!==s.type||s.payload.requestId!==e?null:s.payload.workflows})}async getWorkflow(e){if(!0!==this.lastServerInfoMessage?.features?.workflows)return null;const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse({type:"workflow.get.request",requestId:s,workflowId:e});return this.sendRequest({requestId:s,message:t,timeout:15e3,options:{skipQueue:!0},select:e=>"workflow.get.response"!==e.type||e.payload.requestId!==s?null:e.payload.workflow})}async cancelWorkflow(e){if(!0!==this.lastServerInfoMessage?.features?.workflows)throw new Error("This host does not support workflows. Update the host to use this.");const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse({type:"workflow.cancel.request",requestId:s,workflowId:e});return this.sendRequest({requestId:s,message:t,timeout:15e3,options:{skipQueue:!0},select:e=>"workflow.cancel.response"!==e.type||e.payload.requestId!==s?null:e.payload.workflow})}async startWorkflow(e){if(!0!==this.lastServerInfoMessage?.features?.workflows)throw new Error("This host does not support workflows. Update the host to use this.");const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse(Object.assign({type:"workflow.start.request",requestId:s,graph:e.graph,provider:e.provider,cwd:e.cwd},e.model?{model:e.model}:{},e.title?{title:e.title}:{},e.labels?{labels:e.labels}:{}));return this.sendRequest({requestId:s,message:t,timeout:3e4,options:{skipQueue:!0},select:e=>"workflow.start.response"!==e.type||e.payload.requestId!==s?null:{workflowId:e.payload.workflowId,childAgentIds:e.payload.childAgentIds,status:e.payload.status}})}async listExtensions(){if(!this.lastServerInfoMessage?.features?.extensions)return[];const e=this.createRequestId(),s=h.SessionInboundMessageSchema.parse({type:"extensions.list.request",requestId:e}),t=await this.sendRequest({requestId:e,message:s,timeout:15e3,options:{skipQueue:!0},select:s=>"extensions.list.response"!==s.type||s.payload.requestId!==e?null:s.payload});if(t.error)throw new Error(`extensions.list failed: ${t.error}`);return t.extensions}async executeExtensionCommand(e,s){const t=this.createRequestId(),r=h.SessionInboundMessageSchema.parse({type:"extensions.command.execute.request",requestId:t,commandId:e,args:s}),n=await this.sendRequest({requestId:t,message:r,timeout:3e4,options:{skipQueue:!0},select:e=>"extensions.command.execute.response"!==e.type||e.payload.requestId!==t?null:e.payload});if(!n.ok)throw new Error(n.error??"extension command failed");return n.result}async searchSessions(e){if(this.lastServerInfoMessage?.features?.sessionsListRpc||(0,g.isRelayClientWebSocketUrl)(this.config.url)){const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse(Object.assign({type:"search_sessions_request",requestId:s,query:e.query},"number"==typeof e.limit?{limit:e.limit}:{},e.sources&&e.sources.length>0?{sources:[...e.sources]}:{})),r=await this.sendRequest({requestId:s,message:t,timeout:15e3,options:{skipQueue:!0},select:e=>"search_sessions_response"!==e.type||e.payload.requestId!==s?null:e.payload});if(r.error)throw new Error(`search_sessions failed: ${r.error}`);return Array.isArray(r.results)?r.results:[]}const s=new URLSearchParams;s.set("q",e.query),"number"==typeof e.limit&&s.set("limit",String(e.limit)),e.sources&&e.sources.length>0&&s.set("source",e.sources.join(","));const t=await this.daemonHttpJson({method:"GET",path:`/sessions/search?${s.toString()}`,signal:e.signal});return Array.isArray(t.results)?t.results:[]}getHttpBaseUrl(){const e=this.config.url;if((0,g.isRelayClientWebSocketUrl)(e))throw new Error("HTTP routes are not available over relay transport");let s;try{s=new URL(e)}catch{throw new Error(`Cannot derive HTTP base from WS url: ${e}`)}return"ws:"===s.protocol?s.protocol="http:":"wss:"===s.protocol&&(s.protocol="https:"),s.username="",s.password="",s.pathname=s.pathname.replace(/\/ws\/?$/,"/"),s.search="",s.hash="",s.origin}buildAuthHeader(){const e=k(this.config.password);return e?`Bearer ${e}`:this.config.authHeader?this.config.authHeader:null}async daemonHttpJson(e){const s=this.getHttpBaseUrl(),t=new URL(e.path,s).toString(),r={},n=this.buildAuthHeader();let o;n&&(r.Authorization=n),void 0!==e.body&&(r["Content-Type"]="application/json");try{o=await fetch(t,Object.assign({method:e.method,headers:r},void 0!==e.body?{body:JSON.stringify(e.body)}:{},e.signal?{signal:e.signal}:{}))}catch(s){const t=s instanceof Error?s.message:String(s);throw new Error(`daemon HTTP ${e.method} ${e.path} failed: ${t}`,{cause:s})}if(!o.ok){let s=null;try{s=await o.json()}catch{s=null}const t=s&&"object"==typeof s&&"error"in s?String(s.error):`http_${o.status}`;throw new Error(`daemon HTTP ${e.method} ${e.path} ${o.status}: ${t}`)}return await o.json()}async removeProject(e,s){const t=await this.sendNamespacedCorrelatedSessionRequest({requestId:s,message:{type:"project.remove.request",projectId:e}});if(!t.accepted)throw new Error(t.error??"removeProject rejected");return{removedWorkspaceIds:t.removedWorkspaceIds}}async setWorkspaceTitle(e,s,t){const r=await this.sendCorrelatedSessionRequest({requestId:t,message:{type:"workspace.title.set.request",workspaceId:e,title:s},responseType:"workspace.title.set.response"});if(!r.accepted)throw new Error(r.error??"setWorkspaceTitle rejected");return{title:r.title}}async resumeAgent(e,s){const t=this.createRequestId(),r=h.SessionInboundMessageSchema.parse(Object.assign({type:"resume_agent_request",requestId:t,handle:e},s?{overrides:s}:{}));return(await this.sendRequest({requestId:t,message:r,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const s=h.AgentResumedStatusPayloadSchema.safeParse(e.payload);return s.success&&s.data.requestId===t?s.data:null}})).agent}async importAgent(e){const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse(Object.assign({type:"import_agent_request",requestId:s},"providerId"in e?{providerId:e.providerId,providerHandleId:e.providerHandleId}:{provider:e.provider,sessionId:e.sessionId},e.cwd?{cwd:e.cwd}:{},e.labels&&Object.keys(e.labels).length>0?{labels:e.labels}:{})),r=await this.sendRequest({requestId:s,message:t,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const t=h.AgentResumedStatusPayloadSchema.safeParse(e.payload);if(t.success&&t.data.requestId===s)return t.data;const r=h.AgentCreateFailedStatusPayloadSchema.safeParse(e.payload);return r.success&&r.data.requestId===s?r.data:null}});if("agent_create_failed"===r.status)throw new Error(r.error);return r.agent}async refreshAgent(e,s){const t=this.createRequestId(s),r=h.SessionInboundMessageSchema.parse({type:"refresh_agent_request",agentId:e,requestId:t});return this.sendRequest({requestId:t,message:r,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const s=h.AgentRefreshedStatusPayloadSchema.safeParse(e.payload);return s.success&&s.data.requestId===t?s.data:null}})}async fetchAgentTimeline(e,s={}){const t=this.createRequestId(s.requestId),r=h.SessionInboundMessageSchema.parse(Object.assign({type:"fetch_agent_timeline_request",agentId:e,requestId:t},s.direction?{direction:s.direction}:{},s.cursor?{cursor:s.cursor}:{},"number"==typeof s.limit?{limit:s.limit}:{},s.projection?{projection:s.projection}:{})),n=await this.sendRequest({requestId:t,message:r,timeout:s.timeout,options:{skipQueue:!0},select:e=>"fetch_agent_timeline_response"!==e.type||e.payload.requestId!==t?null:e.payload});if(n.error)throw new Error(n.error);return n}async buildAgentForkContext(e,s={}){const t=this.createRequestId(s.requestId),r=h.SessionInboundMessageSchema.parse(Object.assign({type:"agent.fork_context.request",agentId:e,requestId:t},s.boundaryMessageId?{boundaryMessageId:s.boundaryMessageId}:{})),n=await this.sendRequest({requestId:t,message:r,timeout:15e3,options:{skipQueue:!0},select:e=>"agent.fork_context.response"!==e.type||e.payload.requestId!==t?null:e.payload});if(n.error)throw new Error(n.error);return n}async sendAgentMessage(e,s,t){const r=this.createRequestId(),n=t?.messageId??crypto.randomUUID(),o=h.SessionInboundMessageSchema.parse(Object.assign({type:"send_agent_message_request",requestId:r,agentId:e,text:s},n?{messageId:n}:{},t?.images?{images:t.images}:{},t?.attachments?{attachments:t.attachments}:{})),a=await this.sendRequest({requestId:r,message:o,options:{skipQueue:!0},select:e=>"send_agent_message_response"!==e.type||e.payload.requestId!==r?null:e.payload});if(!a.accepted)throw new Error(a.error??"sendAgentMessage rejected")}async sendMessage(e,s,t){await this.sendAgentMessage(e,s,t)}async rewindAgent(e,s,t){const r=this.createRequestId(),n=h.SessionInboundMessageSchema.parse({type:"agent.rewind.request",requestId:r,agentId:e,messageId:s,mode:t}),o=await this.sendRequest({requestId:r,message:n,options:{skipQueue:!0},select:e=>"agent.rewind.response"!==e.type||e.payload.requestId!==r?null:e.payload});if(!o.ok)throw new Error(o.error??"Agent rewind failed");return o}async cancelAgent(e){const s=this.createRequestId(),t=h.SessionInboundMessageSchema.parse({type:"cancel_agent_request",agentId:e,requestId:s});await this.sendRequest({requestId:s,message:t,options:{skipQueue:!0},select:e=>"cancel_agent_response"!==e.type||e.payload.requestId!==s?null:e.payload})}async setAgentMode(e,s){const t=this.createRequestId(),r=h.SessionInboundMessageSchema.parse({type:"set_agent_mode_request",agentId:e,modeId:s,requestId:t}),n=await this.sendRequest({requestId:t,message:r,options:{skipQueue:!0},select:e=>"set_agent_mode_response"!==e.type||e.payload.requestId!==t?null:e.payload});if(!n.accepted)throw new Error(n.error??"setAgentMode rejected");return n.notice??null}async setAgentModel(e,s){const t=this.createRequestId(),r=h.SessionInboundMessageSchema.parse({type:"set_agent_model_request",agentId:e,modelId:s,requestId:t}),n=await this.sendRequest({requestId:t,message:r,options:{skipQueue:!0},select:e=>"set_agent_model_response"!==e.type||e.payload.requestId!==t?null:e.payload});if(!n.accepted)throw new Error(n.error??"setAgentModel rejected")}async swapAgentProvider(e,s,t){const r=this.createRequestId(),n=h.SessionInboundMessageSchema.parse(Object.assign({type:"swap_agent_provider_request",agentId:e,newProviderId:s,requestId:r},t?{overrides:t}:{})),o=await this.sendRequest({requestId:r,message:n,timeout:3e4,options:{skipQueue:!0},select:e=>"swap_agent_provider_response"!==e.type||e.payload.requestId!==r?null:e.payload});if(!o.accepted)throw new Error(o.error??"swapAgentProvider rejected")}async setAgentFeature(e,s,t){const r=this.createRequestId(),n=h.SessionInboundMessageSchema.parse({type:"set_agent_feature_request",agentId:e,featureId:s,value:t,requestId:r}),o=await this.sendRequest({requestId:r,message:n,options:{skipQueue:!0},select:e=>"set_agent_feature_response"!==e.type||e.payload.requestId!==r?null:e.payload});if(!o.accepted)throw new Error(o.error??"setAgentFeature rejected")}async setAgentThinkingOption(e,s){const t=this.createRequestId(),r=h.SessionInboundMessageSchema.parse({type:"set_agent_thinking_request",agentId:e,thinkingOptionId:s,requestId:t}),n=await this.sendRequest({requestId:t,message:r,options:{skipQueue:!0},select:e=>"set_agent_thinking_response"!==e.type||e.payload.requestId!==t?null:e.payload});if(!n.accepted)throw new Error(n.error??"setAgentThinkingOption rejected");return n.notice??null}async restartServer(e,s){const t=this.createRequestId(s),r=h.SessionInboundMessageSchema.parse(Object.assign({type:"restart_server_request"},e&&e.trim().length>0?{reason:e}:{},{requestId:t}));return this.sendRequest({requestId:t,message:r,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const s=h.RestartRequestedStatusPayloadSchema.safeParse(e.payload);return s.success?s.data.requestId!==t?null:s.data:null}})}async shutdownServer(e){const s=this.createRequestId(e?.requestId),t=h.SessionInboundMessageSchema.parse({type:"shutdown_server_request",requestId:s});return this.sendRequest({requestId:s,message:t,timeout:e?.timeout,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const t=h.ShutdownRequestedStatusPayloadSchema.safeParse(e.payload);return t.success?t.data.requestId!==s?null:t.data:null}})}async updateDaemon(e){const s=this.createRequestId(e),t=h.SessionInboundMessageSchema.parse({type:"daemon.update.request",requestId:s});return this.sendRequest({requestId:s,message:t,timeout:3e5,options:{skipQueue:!0},select:e=>{const t=h.DaemonUpdateResponseSchema.safeParse(e);return t.success?t.data.payload.requestId!==s?null:t.data.payload:null}})}async setVoiceMode(e,s){const t=this.createRequestId(),r=h.SessionInboundMessageSchema.parse(Object.assign({type:"set_voice_mode",enabled:e},s?{agentId:s}:{},{requestId:t})),n=await this.sendRequest({requestId:t,message:r,select:e=>"set_voice_mode_response"!==e.type||e.payload.requestId!==t?null:e.payload});if(!n.accepted){const e="string"==typeof n.reasonCode&&n.reasonCode.trim().length>0?` (${n.reasonCode})`:"";throw new Error((n.error??"Failed to set voice mode")+e)}return n}async sendVoiceAudioChunk(e,s,t=!1){this.sendSessionMessage({type:"voice_audio_chunk",audio:e,format:s,isLast:t})}async startDictationStream(e,s){const t=this.waitForWithCancel(s=>"dictation_stream_ack"!==s.type||s.payload.dictationId!==e||-1!==s.payload.ackSeq?null:s.payload,3e4,{skipQueue:!0}),r=t.promise.then(()=>{}),n=this.waitForWithCancel(s=>"dictation_stream_error"!==s.type||s.payload.dictationId!==e?null:s.payload,3e4,{skipQueue:!0}),o=n.promise.then(e=>{throw new Error(e.error)}),a=new Error("Cancelled dictation start waiter");try{this.sendSessionMessageStrict({type:"dictation_stream_start",dictationId:e,format:s}),await Promise.race([r,o])}finally{t.cancel(a),n.cancel(a),r.catch(()=>{}),o.catch(()=>{})}}sendDictationStreamChunk(e,s,t,r){this.sendSessionMessageStrict({type:"dictation_stream_chunk",dictationId:e,seq:s,audio:t,format:r})}async finishDictationStream(e,s){const t=this.waitForWithCancel(s=>"dictation_stream_final"!==s.type||s.payload.dictationId!==e?null:s.payload,0,{skipQueue:!0}),r=this.waitForWithCancel(s=>"dictation_stream_error"!==s.type||s.payload.dictationId!==e?null:s.payload,0,{skipQueue:!0}),n=this.waitForWithCancel(s=>"dictation_stream_finish_accepted"!==s.type||s.payload.dictationId!==e?null:s.payload,6e4,{skipQueue:!0}),o=t.promise,a=r.promise.then(e=>{throw new Error(e.error)}),i=n.promise,c=o.then(e=>({kind:"final",payload:e})),d=a.then(()=>({kind:"error",error:new Error("Unexpected dictation stream error state")}),e=>({kind:"error",error:e instanceof Error?e:new Error(String(e))})),u=i.then(e=>({kind:"accepted",payload:e}),e=>L(e)?{kind:"accepted_timeout"}:{kind:"accepted_error",error:e instanceof Error?e:new Error(String(e))}),p=async e=>{if(!Number.isFinite(e)||e<=0){const e=await Promise.race([c,d]);if("error"===e.kind)throw e.error;return e.payload}let s=null;const t=new Promise(t=>{s=setTimeout(()=>t({kind:"timeout"}),e)}),r=await Promise.race([c,d,t]);if(s&&clearTimeout(s),"timeout"===r.kind)throw new Error(`Timeout waiting for dictation finalization (${e}ms)`);if("error"===r.kind)throw r.error;return r.payload},l=new Error("Cancelled dictation finish waiter");try{this.sendSessionMessageStrict({type:"dictation_stream_finish",dictationId:e,finalSeq:s});const t=await Promise.race([c,d,u]);if("final"===t.kind)return t.payload;if("error"===t.kind)throw t.error;return"accepted"===t.kind?await p(t.payload.timeoutMs+5e3):await p(3e5)}finally{t.cancel(l),r.cancel(l),n.cancel(l),o.catch(()=>{}),a.catch(()=>{}),i.catch(()=>{})}}cancelDictationStream(e){this.sendSessionMessageStrict({type:"dictation_stream_cancel",dictationId:e})}async abortRequest(){this.sendSessionMessage({type:"abort_request"})}async audioPlayed(e){this.sendSessionMessage({type:"audio_played",id:e})}async getCheckoutStatus(e,s){const t=s?.requestId;if(!t){const s=this.checkoutStatusInFlight.get(e);if(s)return s}const r=this.createRequestId(t),n=h.SessionInboundMessageSchema.parse({type:"checkout_status_request",cwd:e,requestId:r}),o=this.sendRequest({requestId:r,message:n,options:{skipQueue:!0},select:e=>"checkout_status_response"!==e.type||e.payload.requestId!==r?null:e.payload});return t||(this.checkoutStatusInFlight.set(e,o),o.finally(()=>{this.checkoutStatusInFlight.get(e)===o&&this.checkoutStatusInFlight.delete(e)}).catch(()=>{})),o}normalizeCheckoutDiffCompare(e){if("uncommitted"===e.mode)return!0===e.ignoreWhitespace?{mode:"uncommitted",ignoreWhitespace:!0}:{mode:"uncommitted"};const s=e.baseRef?.trim();return s?!0===e.ignoreWhitespace?{mode:"base",baseRef:s,ignoreWhitespace:!0}:{mode:"base",baseRef:s}:!0===e.ignoreWhitespace?{mode:"base",ignoreWhitespace:!0}:{mode:"base"}}async getCheckoutDiff(e,s,t){const r=`oneshot-checkout-diff:${crypto.randomUUID()}`;try{const n=await this.subscribeCheckoutDiff(e,s,{subscriptionId:r,requestId:t});return{cwd:n.cwd,files:n.files,error:n.error,requestId:n.requestId}}finally{try{this.unsubscribeCheckoutDiff(r)}catch{}}}async subscribeCheckoutDiff(e,s,t){const r=t?.subscriptionId??crypto.randomUUID(),n=this.normalizeCheckoutDiffCompare(s),o=this.checkoutDiffSubscriptions.get(r)??null;this.checkoutDiffSubscriptions.set(r,{cwd:e,compare:n});const a=this.createRequestId(t?.requestId),i=h.SessionInboundMessageSchema.parse({type:"subscribe_checkout_diff_request",subscriptionId:r,cwd:e,compare:n,requestId:a});try{return await this.sendCorrelatedRequest({requestId:a,message:i,responseType:"subscribe_checkout_diff_response",options:{skipQueue:!0},selectPayload:e=>e.subscriptionId!==r?null:e})}catch(e){throw o?this.checkoutDiffSubscriptions.set(r,o):this.checkoutDiffSubscriptions.delete(r),e}}unsubscribeCheckoutDiff(e){this.checkoutDiffSubscriptions.delete(e),this.sendSessionMessage({type:"unsubscribe_checkout_diff_request",subscriptionId:e})}async checkoutCommit(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"checkout_commit_request",cwd:e,message:s.message,addAll:s.addAll},responseType:"checkout_commit_response"})}async checkoutMerge(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"checkout_merge_request",cwd:e,baseRef:s.baseRef,strategy:s.strategy,requireCleanTarget:s.requireCleanTarget},responseType:"checkout_merge_response"})}async checkoutMergeFromBase(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"checkout_merge_from_base_request",cwd:e,baseRef:s.baseRef,requireCleanTarget:s.requireCleanTarget},responseType:"checkout_merge_from_base_response"})}async checkoutPull(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"checkout_pull_request",cwd:e},responseType:"checkout_pull_response"})}async checkoutPush(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"checkout_push_request",cwd:e},responseType:"checkout_push_response"})}async checkoutRefresh(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"checkout.refresh.request",cwd:e},responseType:"checkout.refresh.response"})}async checkoutPrCreate(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"checkout_pr_create_request",cwd:e,title:s.title,body:s.body,baseRef:s.baseRef},responseType:"checkout_pr_create_response"})}async checkoutPrMerge(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"checkout_pr_merge_request",cwd:e,mergeMethod:s.method},responseType:"checkout_pr_merge_response"})}async checkoutGithubSetAutoMerge(e,s,t){return this.sendNamespacedCorrelatedSessionRequest({requestId:t,message:Object.assign({type:"checkout.github.set_auto_merge.request",cwd:e,enabled:s.enabled},s.enabled?{mergeMethod:s.method}:{})})}async checkoutGithubGetCheckDetails(e,s){return this.sendNamespacedCorrelatedSessionRequest({requestId:s,message:{type:"checkout.github.get_check_details.request",cwd:e.cwd,repoOwner:e.repoOwner,repoName:e.repoName,checkRunId:e.checkRunId,workflowRunId:e.workflowRunId}})}async checkoutPrStatus(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"checkout_pr_status_request",cwd:e},responseType:"checkout_pr_status_response"})}async pullRequestTimeline(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"pull_request_timeline_request",cwd:e.cwd,prNumber:e.prNumber,repoOwner:e.repoOwner,repoName:e.repoName},responseType:"pull_request_timeline_response"})}async checkoutSwitchBranch(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"checkout_switch_branch_request",cwd:e,branch:s},responseType:"checkout_switch_branch_response"})}async renameBranch(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"checkout.rename_branch.request",cwd:e.cwd,branch:e.branch},responseType:"checkout.rename_branch.response"})}async stashSave(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"stash_save_request",cwd:e,branch:s?.branch},responseType:"stash_save_response"})}async stashPop(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"stash_pop_request",cwd:e,stashIndex:s},responseType:"stash_pop_response"})}async stashList(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"stash_list_request",cwd:e,paseoOnly:s?.paseoOnly},responseType:"stash_list_response"})}async getPaseoWorktreeList(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"paseo_worktree_list_request",cwd:e.cwd,repoRoot:e.repoRoot},responseType:"paseo_worktree_list_response"})}async archivePaseoWorktree(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:Object.assign({type:"paseo_worktree_archive_request",worktreePath:e.worktreePath,repoRoot:e.repoRoot,branchName:e.branchName},void 0!==e.workspaceId?{workspaceId:e.workspaceId}:{},void 0!==e.scope?{scope:e.scope}:{}),responseType:"paseo_worktree_archive_response"})}async createPaseoWorktree(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:Object.assign({type:"create_paseo_worktree_request",cwd:e.cwd},void 0!==e.projectId?{projectId:e.projectId}:{},{worktreeSlug:e.worktreeSlug},void 0!==e.firstAgentContext?{firstAgentContext:e.firstAgentContext}:{},void 0!==e.refName?{refName:e.refName}:{},void 0!==e.action?{action:e.action}:{},void 0!==e.githubPrNumber?{githubPrNumber:e.githubPrNumber}:{}),responseType:"create_paseo_worktree_response"})}async createWorkspace(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:Object.assign({type:"workspace.create.request",source:e.source},void 0!==e.title?{title:e.title}:{},void 0!==e.firstAgentContext?{firstAgentContext:e.firstAgentContext}:{}),responseType:"workspace.create.response"})}async validateBranch(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"validate_branch_request",cwd:e.cwd,branchName:e.branchName},responseType:"validate_branch_response"})}async getBranchSuggestions(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"branch_suggestions_request",cwd:e.cwd,query:e.query,limit:e.limit},responseType:"branch_suggestions_response"})}async searchGitHub(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"github_search_request",cwd:e.cwd,query:e.query,limit:e.limit,kinds:e.kinds},responseType:"github_search_response"})}async getDirectorySuggestions(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"directory_suggestions_request",query:e.query,cwd:e.cwd,includeFiles:e.includeFiles,includeDirectories:e.includeDirectories,matchMode:e.matchMode,limit:e.limit},responseType:"directory_suggestions_response"})}async requestFileExplorer(e,s,t,r,n=!1){return this.sendCorrelatedSessionRequest({requestId:r,message:Object.assign({type:"file_explorer_request",cwd:e,path:s,mode:t},n?{acceptBinary:!0}:{}),responseType:"file_explorer_response"})}async listDirectory(e,s,t){const r=await this.requestFileExplorer(e,s,"list",t);if(r.error)throw new Error(r.error);if(!r.directory)throw new Error("Directory listing unavailable.");return r.directory}async readFile(e,s,t){const r=this.createRequestId(t);this.pendingBinaryFileReads.set(r,{cwd:e,path:s});try{const t=await this.requestFileExplorer(e,s,"file",r,!0);if(t.error)throw new Error(t.error);const n=this.completedBinaryFileReads.get(r);if(n)return this.completedBinaryFileReads.delete(r),n;if(!t.file)throw new Error("File unavailable.");return H(t.file)}finally{this.pendingBinaryFileReads.delete(r),this.activeBinaryFileTransfers.delete(r)}}async requestDownloadToken(e,s,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"file_download_token_request",cwd:e,path:s},responseType:"file_download_token_response"})}async requestProjectIcon(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"project_icon_request",cwd:e},responseType:"project_icon_response"})}async listProviderModels(e,s){const t=await this.sendCorrelatedSessionRequest({requestId:s?.requestId,message:{type:"list_provider_models_request",provider:e,cwd:s?.cwd},responseType:"list_provider_models_response",timeout:9e4});return(0,_.normalizeListProviderModelsPayload)(t)}async listProviderModes(e,s){return this.sendCorrelatedSessionRequest({requestId:s?.requestId,message:{type:"list_provider_modes_request",provider:e,cwd:s?.cwd},responseType:"list_provider_modes_response",timeout:9e4})}async listProviderFeatures(e,s){return this.sendCorrelatedSessionRequest({requestId:s?.requestId,message:{type:"list_provider_features_request",draftConfig:e},responseType:"list_provider_features_response",timeout:9e4})}async listAvailableProviders(e){return this.sendCorrelatedSessionRequest({requestId:e?.requestId,message:{type:"list_available_providers_request"},responseType:"list_available_providers_response"})}async getProvidersSnapshot(e){const s=await this.sendCorrelatedSessionRequest({requestId:e?.requestId,message:{type:"get_providers_snapshot_request",cwd:e?.cwd},responseType:"get_providers_snapshot_response"});return(0,_.normalizeProvidersSnapshotPayload)(s)}async reloadProviderConfig(e){return this.sendCorrelatedSessionRequest({requestId:e?.requestId,message:{type:"providers.reload_config.request"},responseType:"providers.reload_config.response",timeout:15e3})}async getDaemonConfig(e){return this.sendCorrelatedSessionRequest({requestId:e,message:{type:"get_daemon_config_request"},responseType:"get_daemon_config_response"})}async getDaemonStatus(e){return this.sendCorrelatedSessionRequest({requestId:e?.requestId,message:{type:"daemon.get_status.request"},responseType:"daemon.get_status.response",timeout:e?.timeout})}async getDaemonPairingOffer(e){return this.sendCorrelatedSessionRequest({requestId:e?.requestId,message:{type:"daemon.get_pairing_offer.request"},responseType:"daemon.get_pairing_offer.response",timeout:e?.timeout})}async collectDiagnostics(e){return this.sendNamespacedCorrelatedSessionRequest({requestId:e,message:{type:"diagnostics.request"}})}async patchDaemonConfig(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"set_daemon_config_request",config:e},responseType:"set_daemon_config_response"})}sendBrowserAutomationExecuteResponse(e){this.sendSessionMessageStrict(e)}async readProjectConfig(e,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"read_project_config_request",repoRoot:e},responseType:"read_project_config_response"})}async writeProjectConfig(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"write_project_config_request",repoRoot:e.repoRoot,config:e.config,expectedRevision:e.expectedRevision},responseType:"write_project_config_response"})}async refreshProvidersSnapshot(e){return this.sendCorrelatedSessionRequest({requestId:e?.requestId,message:{type:"refresh_providers_snapshot_request",cwd:e?.cwd,providers:e?.providers},responseType:"refresh_providers_snapshot_response",timeout:12e4})}async getProviderDiagnostic(e,s){return this.sendCorrelatedSessionRequest({requestId:s?.requestId,message:{type:"provider_diagnostic_request",provider:e},responseType:"provider_diagnostic_response",timeout:18e4})}async listProviderUsage(e){return this.sendNamespacedCorrelatedSessionRequest({requestId:e?.requestId,message:{type:"provider.usage.list.request"}})}async listCommands(e,s){const t=T(e,s);return this.sendCorrelatedSessionRequest({requestId:t.requestId,message:Object.assign({type:"list_commands_request",agentId:t.agentId},t.draftConfig?{draftConfig:t.draftConfig}:{}),responseType:"list_commands_response"})}async respondToPermission(e,s,t){this.sendSessionMessage({type:"agent_permission_response",agentId:e,requestId:s,response:t})}async respondToPermissionAndWait(e,s,t,r=15e3){const n=h.SessionInboundMessageSchema.parse({type:"agent_permission_response",agentId:e,requestId:s,response:t});return this.sendRequest({requestId:s,message:n,timeout:r,options:{skipQueue:!0},select:t=>"agent_permission_resolved"!==t.type||t.payload.requestId!==s||t.payload.agentId!==e?null:t.payload})}async waitForAgentUpsert(e,s,t=6e4){const r=Date.now()+t,n=()=>new Error(`Timed out waiting for agent ${e}`),o=()=>this.fetchAgent({agentId:e,timeout:Math.max(1,r-Date.now())}).catch(()=>null),a=await o();if(a&&s(a.agent))return a.agent;if(Date.now()>=r)throw n();return await new Promise((t,a)=>{let i=!1,c=!1,d=null,u=null,p=null;const l=e=>{i||(i=!0,u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null),p&&(p(),p=null),"ok"!==e.kind?a(e.error):t(e.snapshot))},h=e=>!!e&&(!!s(e)&&(l({kind:"ok",snapshot:e}),!0)),m=async()=>{if(!i&&!c){c=!0;try{const e=await o();h(e?.agent??null)}finally{c=!1}}};p=this.on("agent_update",s=>{if(i)return;if("upsert"!==s.payload.kind)return;const t=s.payload.agent;t.id===e&&h(t)});const g=Math.max(1,r-Date.now());u=setTimeout(()=>{l({kind:"error",error:n()})},g),d=setInterval(()=>{m()},250),m()})}async waitForFinish(e,s=6e4){const t=this.createRequestId(),r=Number.isFinite(s)&&s>0,n=h.SessionInboundMessageSchema.parse(Object.assign({type:"wait_for_finish_request",requestId:t,agentId:e},r?{timeoutMs:s}:{})),o=await this.sendCorrelatedRequest({requestId:t,message:n,responseType:"wait_for_finish_response",timeout:r?s+5e3:0,options:{skipQueue:!0}});return{status:o.status,final:o.final,error:o.error,lastMessage:o.lastMessage}}subscribeTerminals(e){this.terminalDirectorySubscriptions.set((0,y.terminalSubscriptionKey)(e.cwd,e.workspaceId),{cwd:e.cwd,workspaceId:e.workspaceId}),this.transport&&"connected"===this.connectionState.status&&this.sendSessionMessage(Object.assign({type:"subscribe_terminals_request",cwd:e.cwd},void 0!==e.workspaceId?{workspaceId:e.workspaceId}:{}))}unsubscribeTerminals(e){this.terminalDirectorySubscriptions.delete((0,y.terminalSubscriptionKey)(e.cwd,e.workspaceId)),this.transport&&"connected"===this.connectionState.status&&this.sendSessionMessage(Object.assign({type:"unsubscribe_terminals_request",cwd:e.cwd},void 0!==e.workspaceId?{workspaceId:e.workspaceId}:{}))}async listTerminals(e,s,t){const r=this.createRequestId(s),n=h.SessionInboundMessageSchema.parse(Object.assign({type:"list_terminals_request"},void 0===e?{}:{cwd:e},void 0!==t?.workspaceId?{workspaceId:t.workspaceId}:{},{requestId:r}));return this.sendCorrelatedRequest({requestId:r,message:n,responseType:"list_terminals_response",options:{skipQueue:!0}})}async createTerminal(e,s,t,r){const n=this.createRequestId(t),o=h.SessionInboundMessageSchema.parse(Object.assign({type:"create_terminal_request",cwd:e,name:s,agentId:r?.agentId,command:r?.command,args:r?.args},void 0!==r?.workspaceId?{workspaceId:r.workspaceId}:{},{requestId:n}));return this.sendCorrelatedRequest({requestId:n,message:o,responseType:"create_terminal_response",options:{skipQueue:!0}})}async renameTerminal(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"terminal.rename.request",terminalId:e.terminalId,title:e.title},responseType:"terminal.rename.response"})}async subscribeTerminal(e,s){const t="object"==typeof s?s.restore:void 0,r="object"==typeof s?s.requestId:s,n=this.createRequestId(r),o=h.SessionInboundMessageSchema.parse(Object.assign({type:"subscribe_terminal_request",terminalId:e,requestId:n},t?{restore:t}:{})),a=await this.sendCorrelatedRequest({requestId:n,message:o,responseType:"subscribe_terminal_response",options:{skipQueue:!0}});return null===a.error&&this.terminalStreams.setSlot(e,a.slot),a}unsubscribeTerminal(e){this.terminalStreams.removeTerminal(e),this.sendSessionMessage({type:"unsubscribe_terminal_request",terminalId:e})}sendTerminalInput(e,s){const t=this.terminalStreams.encodeInput(e,s);t?this.sendBinaryFrame(t):this.sendSessionMessage({type:"terminal_input",terminalId:e,message:s})}async killTerminal(e,s){const t=this.createRequestId(s),r=h.SessionInboundMessageSchema.parse({type:"kill_terminal_request",terminalId:e,requestId:t});return this.sendCorrelatedRequest({requestId:t,message:r,responseType:"kill_terminal_response",options:{skipQueue:!0}})}async closeItems(e,s){const t=this.createRequestId(s),r=h.SessionInboundMessageSchema.parse({type:"close_items_request",agentIds:e.agentIds??[],terminalIds:e.terminalIds??[],requestId:t});return this.sendCorrelatedRequest({requestId:t,message:r,responseType:"close_items_response",options:{skipQueue:!0}})}async captureTerminal(e,s,t){const r=this.createRequestId(t),n=h.SessionInboundMessageSchema.parse(Object.assign({type:"capture_terminal_request",terminalId:e},void 0===s?.start?{}:{start:s.start},void 0===s?.end?{}:{end:s.end},void 0===s?.stripAnsi?{}:{stripAnsi:s.stripAnsi},{requestId:r}));return this.sendCorrelatedRequest({requestId:r,message:n,responseType:"capture_terminal_response",options:{skipQueue:!0}})}async createChatRoom(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:Object.assign({type:"chat/create",name:e.name},e.purpose?{purpose:e.purpose}:{}),responseType:"chat/create/response"})}async listChatRooms(e){return this.sendCorrelatedSessionRequest({requestId:e,message:{type:"chat/list"},responseType:"chat/list/response"})}async inspectChatRoom(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"chat/inspect",room:e.room},responseType:"chat/inspect/response"})}async deleteChatRoom(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"chat/delete",room:e.room},responseType:"chat/delete/response"})}async postChatMessage(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:Object.assign({type:"chat/post",room:e.room,body:e.body},e.authorAgentId?{authorAgentId:e.authorAgentId}:{},e.replyToMessageId?{replyToMessageId:e.replyToMessageId}:{}),responseType:"chat/post/response"})}async readChatMessages(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:Object.assign({type:"chat/read",room:e.room},"number"==typeof e.limit?{limit:e.limit}:{},e.since?{since:e.since}:{},e.authorAgentId?{authorAgentId:e.authorAgentId}:{}),responseType:"chat/read/response",timeout:e.timeout})}async waitForChatMessages(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:Object.assign({type:"chat/wait",room:e.room},e.afterMessageId?{afterMessageId:e.afterMessageId}:{},"number"==typeof e.timeoutMs?{timeoutMs:e.timeoutMs}:{}),responseType:"chat/wait/response",timeout:(e.timeoutMs??0)+1e4})}async scheduleCreate(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:Object.assign({type:"schedule/create",prompt:e.prompt,cadence:e.cadence,target:e.target},e.name?{name:e.name}:{},"number"==typeof e.maxRuns?{maxRuns:e.maxRuns}:{},e.expiresAt?{expiresAt:e.expiresAt}:{},"boolean"==typeof e.runOnCreate?{runOnCreate:e.runOnCreate}:{}),responseType:"schedule/create/response"})}async scheduleList(e){return this.sendCorrelatedSessionRequest({requestId:e,message:{type:"schedule/list"},responseType:"schedule/list/response"})}async fleetList(e){return this.sendCorrelatedSessionRequest({requestId:e,message:{type:"fleet/list"},responseType:"fleet/list/response"})}async fleetInspect(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"fleet/inspect",name:e.name},responseType:"fleet/inspect/response"})}async fleetRunNow(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"fleet/run-now",name:e.name},responseType:"fleet/run-now/response"})}async fleetPause(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"fleet/pause",name:e.name},responseType:"fleet/pause/response"})}async fleetAsk(e){const{requestId:s}=e,t=(0,p.default)(e,i);return this.sendCorrelatedSessionRequest({requestId:s,message:Object.assign({type:"fleet/ask"},t),responseType:"fleet/ask/response"})}async fleetDecisions(e={}){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"fleet/decisions",name:e.name,includeResolved:e.includeResolved},responseType:"fleet/decisions/response"})}async fleetResolveDecision(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"fleet/resolve-decision",decisionId:e.decisionId,optionId:e.optionId},responseType:"fleet/resolve-decision/response"})}async fleetSetParams(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"fleet/set-params",name:e.name,values:e.values},responseType:"fleet/set-params/response"})}async fleetSetMode(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"fleet/set-mode",name:e.name,mode:e.mode},responseType:"fleet/set-mode/response"})}async fleetResume(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"fleet/resume",name:e.name},responseType:"fleet/resume/response"})}async fleetCreate(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:Object.assign({type:"fleet/create",name:e.name,description:e.description,cron:e.cron,action:e.action},void 0!==e.mode?{mode:e.mode}:{},void 0!==e.rails?{rails:e.rails}:{},void 0!==e.allowed?{allowed:e.allowed}:{}),responseType:"fleet/create/response"})}async fleetExecutions(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"fleet/executions",name:e.name},responseType:"fleet/executions/response"})}async scheduleInspect(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"schedule/inspect",scheduleId:e.id},responseType:"schedule/inspect/response"})}async scheduleLogs(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"schedule/logs",scheduleId:e.id},responseType:"schedule/logs/response"})}async schedulePause(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"schedule/pause",scheduleId:e.id},responseType:"schedule/pause/response"})}async scheduleResume(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"schedule/resume",scheduleId:e.id},responseType:"schedule/resume/response"})}async scheduleDelete(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"schedule/delete",scheduleId:e.id},responseType:"schedule/delete/response"})}async scheduleRunOnce(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:{type:"schedule/run-once",scheduleId:e.id},responseType:"schedule/run-once/response"})}async scheduleUpdate(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:Object.assign({type:"schedule/update",scheduleId:e.id},void 0!==e.name?{name:e.name}:{},void 0!==e.prompt?{prompt:e.prompt}:{},void 0!==e.cadence?{cadence:e.cadence}:{},void 0!==e.newAgentConfig?{newAgentConfig:e.newAgentConfig}:{},void 0!==e.maxRuns?{maxRuns:e.maxRuns}:{},void 0!==e.expiresAt?{expiresAt:e.expiresAt}:{}),responseType:"schedule/update/response"})}async loopRun(e){return this.sendCorrelatedSessionRequest({requestId:e.requestId,message:Object.assign({type:"loop/run",prompt:e.prompt,cwd:e.cwd},e.provider?{provider:e.provider}:{},e.model?{model:e.model}:{},e.modeId?{modeId:e.modeId}:{},e.verifierProvider?{verifierProvider:e.verifierProvider}:{},e.verifierModel?{verifierModel:e.verifierModel}:{},e.verifierModeId?{verifierModeId:e.verifierModeId}:{},e.verifyPrompt?{verifyPrompt:e.verifyPrompt}:{},e.verifyChecks&&e.verifyChecks.length>0?{verifyChecks:e.verifyChecks}:{},e.name?{name:e.name}:{},"number"==typeof e.sleepMs?{sleepMs:e.sleepMs}:{},"number"==typeof e.maxIterations?{maxIterations:e.maxIterations}:{},"number"==typeof e.maxTimeMs?{maxTimeMs:e.maxTimeMs}:{}),responseType:"loop/run/response"})}async loopList(e){return this.sendCorrelatedSessionRequest({requestId:e,message:{type:"loop/list"},responseType:"loop/list/response"})}async loopInspect(e){const s="string"==typeof e?{id:e}:e;return this.sendCorrelatedSessionRequest({requestId:s.requestId,message:{type:"loop/inspect",id:s.id},responseType:"loop/inspect/response"})}async loopLogs(e,s){const t="string"==typeof e?{id:e,afterSeq:s}:e;return this.sendCorrelatedSessionRequest({requestId:t.requestId,message:Object.assign({type:"loop/logs",id:t.id},"number"==typeof t.afterSeq?{afterSeq:t.afterSeq}:{}),responseType:"loop/logs/response"})}async loopStop(e){const s="string"==typeof e?{id:e}:e;return this.sendCorrelatedSessionRequest({requestId:s.requestId,message:{type:"loop/stop",id:s.id},responseType:"loop/stop/response"})}onTerminalStreamEvent(e){return this.terminalStreams.onEvent(e)}async waitForTerminalStreamEvent(e,s=5e3){return new Promise((t,r)=>{const n=setTimeout(()=>{o(),r(new Error(`Timeout waiting for terminal stream event (${s}ms)`))},s),o=this.onTerminalStreamEvent(s=>{e(s)&&(clearTimeout(n),o(),t(s))})})}async uploadFile(e,s){const t=this.createRequestId(),r=crypto.randomUUID(),n=e.bytes.byteLength,o=s.signal;if(o?.aborted)throw new M(r);const a=[];for(let s=0;s<n;s+=q.UPLOAD_CHUNK_SIZE_BYTES)a.push(e.bytes.subarray(s,Math.min(s+q.UPLOAD_CHUNK_SIZE_BYTES,n)));const i=a.length;let c;try{c=await this.sendCorrelatedRequest({requestId:t,message:h.SessionInboundMessageSchema.parse({type:"files.upload.begin.request",requestId:t,agentId:s.agentId,uploadId:r,metadata:{mime:e.mime,size:n,encoding:"binary",modifiedAt:e.modifiedAt,fileName:e.path.split(/[\\/]/).at(-1)||e.path}}),responseType:"files.upload.begin.response",timeout:3e4,options:{skipQueue:!0}})}catch(e){throw new P(r,e instanceof Error?e.message:String(e))}if(!c.accepted||c.error)throw A(r,c.error??"write_failed");const d=new Map;let u=0,p=0,l=0,m=!1,g=!1;const y=[],I=()=>{for(const e of y.splice(0))try{e()}catch{}d.clear()};let f;await new Promise((e,c)=>{const h=()=>{g||(g=!0,I(),e())},q=e=>{g||(g=!0,I(),c(e))},f=()=>{for(;d.size<8&&u<i;){if(m||g)return;const e=u,s=a[e];if(u+=1,d.set(e,s.byteLength),d.size>8)return void q(new P(r,`upload window invariant violated: ${d.size} chunks in flight`));try{this.sendSessionMessage({type:"files.upload.chunk",payload:{requestId:t,uploadId:r,chunkIndex:e,data:Q(s)}})}catch(e){return void q(new P(r,e instanceof Error?e.message:String(e)))}}};y.push(this.on("files.upload.chunk.ack",e=>{if(e.payload.requestId!==t)return;const r=e.payload.chunkIndex,o=d.get(r);void 0!==o&&(d.delete(r),l+=1,p+=o,s.onProgress?.(p,n),l>=i?h():f())})),y.push(this.on("files.upload.error",e=>{e.payload.requestId!==t&&e.payload.uploadId!==r||q(A(r,e.payload.code,e.payload.message))}));const w=()=>{m=!0;try{this.sendSessionMessage({type:"files.upload.error",payload:{requestId:t,uploadId:r,code:"aborted"}})}catch{}q(new M(r))};o&&(o.addEventListener("abort",w,{once:!0}),y.push(()=>o.removeEventListener("abort",w))),0!==i?o?.aborted?w():f():h()});try{f=await this.sendCorrelatedRequest({requestId:t,message:h.SessionInboundMessageSchema.parse({type:"files.upload.complete.request",requestId:t,uploadId:r,totalChunks:i}),responseType:"files.upload.complete.response",timeout:3e4,options:{skipQueue:!0}})}catch(e){throw new P(r,e instanceof Error?e.message:String(e))}if(f.error)throw A(r,f.error);return{fileId:f.fileId,path:f.path,size:f.size,mimeType:f.mimeType}}createRequestId(e){return e??crypto.randomUUID()}getLastServerInfoMessage(){return this.lastServerInfoMessage}getFileUploadsCapability(){return this.lastServerInfoMessage?.features?.fileUploads??!1}resolveTransportUrlForAttempt(){return this.config.url}sendHelloMessage(){if(this.transport)try{this.transport.send(JSON.stringify(Object.assign({type:"hello",clientId:this.config.clientId,clientType:this.config.clientType??"cli",protocolVersion:1,capabilities:Object.assign({[l.CLIENT_CAPS.customModeIcons]:!0,[l.CLIENT_CAPS.reasoningMergeEnum]:!0,[l.CLIENT_CAPS.terminalReflowableSnapshot]:!0},this.config.capabilities)},this.config.appVersion?{appVersion:this.config.appVersion}:{})))}catch(e){const s=e instanceof Error?e.message:"Failed to send hello message";this.lastErrorValue=s,this.scheduleReconnect({reason:s,event:"HELLO_SEND_FAILED",reasonCode:"transport_error"})}else this.scheduleReconnect({reason:"Transport unavailable before hello",event:"HELLO_TRANSPORT_MISSING",reasonCode:"transport_error"})}disposeTransport(e=1001,s="Reconnecting"){if(this.stopLivenessHeartbeat(),this.cleanupTransport(),this.transport){try{this.transport.close(e,s)}catch{}this.transport=null}}cleanupTransport(){this.resetConnectTimeout(),this.pendingGenericTransportErrorTimeout&&(clearTimeout(this.pendingGenericTransportErrorTimeout),this.pendingGenericTransportErrorTimeout=null);for(const e of this.transportCleanup)try{e()}catch{}this.transportCleanup=[]}resetConnectTimeout(){this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=null)}handleTransportMessage(e){const s=e&&"object"==typeof e&&"data"in e?e.data:e;if("undefined"!=typeof Blob&&s instanceof Blob&&"function"==typeof s.arrayBuffer)return void s.arrayBuffer().then(e=>{this.handleTransportMessage(e)}).catch(()=>{});const t=(0,I.asUint8Array)(s);if(t&&this.tryHandleBinaryFrame(t))return;const r=(0,f.decodeMessageData)(s);r&&this.handleJsonPayload(r,t?.byteLength)}handleJsonPayload(e,s){const t=s??e.length,r=v();let n;try{n=JSON.parse(e)}catch{return}const o=(0,m.validateWSOutboundMessage)(n);if(!o.success){const e=null!=n&&"object"==typeof n&&"type"in n&&"string"==typeof n.type?n.type:"unknown";return void this.logger.warn({msgType:e,error:o.error.message},"Message validation failed")}if(this.consecutiveLivenessFailures=0,"pong"===o.data.type)return this.resolvePingProbe(),void this.runtimeMetrics?.recordMessage("pong",t,v()-r);this.handleSessionMessage(o.data.message);const a=o.data.message.type;this.runtimeMetrics?.recordMessage(a,t,v()-r),"agent_stream"===o.data.message.type&&this.runtimeMetrics?.recordAgentStream(o.data.message.payload)}tryHandleBinaryFrame(e){const s=(0,I.decodeFileTransferFrame)(e);if(s)return this.consecutiveLivenessFailures=0,this.handleFileTransferFrame(s),this.runtimeMetrics?.recordBinaryFrame("other",e.byteLength,0),!0;const t=(0,I.decodeTerminalStreamFrame)(e);if(!t)return!1;this.consecutiveLivenessFailures=0;const r=v();this.terminalStreams.handleFrame(t);let n="other";return t.opcode===I.TerminalStreamOpcode.Output?n="output":t.opcode===I.TerminalStreamOpcode.Snapshot?n="snapshot":t.opcode===I.TerminalStreamOpcode.Restore&&(n="output"),this.runtimeMetrics?.recordBinaryFrame(n,e.byteLength,v()-r),!0}handleFileTransferFrame(e){if(e.opcode===I.FileTransferOpcode.FileBegin){const s=this.pendingBinaryFileReads.get(e.requestId);if(!s)return;return void this.activeBinaryFileTransfers.set(e.requestId,Object.assign({},s,{mime:e.metadata.mime,size:e.metadata.size,encoding:e.metadata.encoding,modifiedAt:e.metadata.modifiedAt,chunks:[]}))}const s=this.activeBinaryFileTransfers.get(e.requestId);if(!s)return;if(e.opcode===I.FileTransferOpcode.FileChunk)return void s.chunks.push(e.payload);const t=N(s.chunks,s.size);var r,n;this.activeBinaryFileTransfers.delete(e.requestId),this.completedBinaryFileReads.set(e.requestId,{bytes:t,mime:s.mime,size:s.size,path:s.path,kind:(r=s.mime,n=s.encoding,r.startsWith("image/")?"image":"utf-8"===n||r.startsWith("text/")||"application/json"===r?"text":"binary"),modifiedAt:s.modifiedAt}),this.handleSessionMessage({type:"file_explorer_response",payload:{cwd:s.cwd,path:s.path,mode:"file",directory:null,file:null,error:null,requestId:e.requestId}})}updateConnectionState(e,s){const t=this.connectionState;this.connectionState=e;const r="disconnected"===e.status&&"string"==typeof e.reason?e.reason:null,n=s?.reason??r,o=s?.reasonCode??W(n);this.logger.debug({serverId:this.logServerId,clientIdHash:this.logClientIdHash,from:t.status,to:e.status,event:s?.event??"STATE_UPDATE",connectionPath:this.logConnectionPath,generation:this.logGeneration,reasonCode:o,reason:n},"DaemonClientTransition");for(const s of this.connectionListeners)try{s(e)}catch{}}setReconnectEnabled(e){this.config=Object.assign({},this.config,{reconnect:Object.assign({},this.config.reconnect,{enabled:e})})}scheduleReconnect(e){this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null);const s="disposed"===this.connectionState.status,t=e?.reason;"string"==typeof t&&t.trim().length>0&&(this.lastErrorValue=t.trim()),this.clearWaiters(new Error(t??"Connection lost")),this.rejectPendingSendQueue(new Error(t??"Connection lost")),this.rejectPingProbe(new Error(t??"Connection lost")),this.terminalStreams.clearSlots(),this.lastServerInfoMessage=null,s?this.rejectConnect(new Error(t??"Daemon client is disposed")):(this.emitDisconnectedStateForReconnect(t,e),this.shouldReconnect&&!1!==this.config.reconnect?.enabled?this.armReconnectTimer():this.rejectConnect(new Error(t??"Transport disconnected before connect")))}emitDisconnectedStateForReconnect(e,s){this.updateConnectionState(Object.assign({status:"disconnected"},e?{reason:e}:{}),Object.assign({event:s?.event??"TRANSPORT_CLOSE"},e?{reason:e}:{},s?.reasonCode?{reasonCode:s.reasonCode}:{}))}armReconnectTimer(){const e=this.reconnectAttempt,s=this.config.reconnect?.baseDelayMs??1500,t=this.config.reconnect?.maxDelayMs??3e4,r=Math.min(s*2**e,t);this.reconnectAttempt=e+1,this.reconnectTimeout=setTimeout(()=>{this.reconnectTimeout=null,this.shouldReconnect&&this.attemptConnect()},r)}resolvePingProbe(){const e=this.pingProbe;e&&(this.pingProbe=null,clearTimeout(e.timeoutHandle),e.resolve(v()-e.startedAt))}clearPingProbe(){const e=this.pingProbe;e&&(this.pingProbe=null,clearTimeout(e.timeoutHandle))}rejectPingProbe(e){const s=this.pingProbe;s&&(this.pingProbe=null,clearTimeout(s.timeoutHandle),s.reject(e))}recordLivenessFailure(e){this.consecutiveLivenessFailures+=1,this.consecutiveLivenessFailures<2||(this.consecutiveLivenessFailures=0,this.lastErrorValue=e.message,this.disposeTransport(1001,"Liveness check timed out"),this.scheduleReconnect({reason:e.message,event:"LIVENESS_TIMEOUT",reasonCode:"liveness_timeout"}))}handleSessionMessage(e){const s=(0,_.normalizeProviderSnapshotUpdateMessage)(e);if("status"===s.type){const e=(0,h.parseServerInfoStatusPayload)(s.payload);e&&(this.lastServerInfoMessage=e,"connecting"===this.connectionState.status&&(this.resetConnectTimeout(),this.reconnectAttempt=0,this.updateConnectionState({status:"connected"},{event:"HELLO_SERVER_INFO"}),this.startLivenessHeartbeat(),this.resubscribeCheckoutDiffSubscriptions(),this.resubscribeTerminalDirectorySubscriptions(),this.flushPendingSendQueue(),this.resolveConnect()))}if("terminal_stream_exit"===s.type&&this.terminalStreams.removeTerminal(s.payload.terminalId),this.rawMessageListeners.size>0)for(const e of this.rawMessageListeners)try{e(s)}catch{}const t=this.messageHandlers.get(s.type);if(t)for(const e of t)try{e(s)}catch{}const r=this.toEvent(s);if(r)for(const e of this.eventListeners)e(r);this.resolveWaiters(s)}resolveWaiters(e){for(const s of Array.from(this.waiters)){const t=s.predicate(e);null!==t&&(this.waiters.delete(s),s.timeoutHandle&&clearTimeout(s.timeoutHandle),s.resolve(t))}}clearWaiters(e){for(const s of Array.from(this.waiters))s.timeoutHandle&&clearTimeout(s.timeoutHandle),s.reject(e);this.waiters.clear()}toEvent(e){switch(e.type){case"agent_update":return{type:"agent_update",agentId:"upsert"===e.payload.kind?e.payload.agent.id:e.payload.agentId,payload:e.payload};case"workspace_update":return{type:"workspace_update",workspaceId:"upsert"===e.payload.kind?e.payload.workspace.id:e.payload.id,payload:e.payload};case"workspace_setup_progress":return{type:"workspace_setup_progress",workspaceId:e.payload.workspaceId,payload:e.payload};case"agent_stream":return Object.assign({type:"agent_stream",agentId:e.payload.agentId,event:e.payload.event,timestamp:e.payload.timestamp},"number"==typeof e.payload.seq?{seq:e.payload.seq}:{},"string"==typeof e.payload.epoch?{epoch:e.payload.epoch}:{});case"status":return{type:"status",payload:e.payload};case"agent_deleted":return{type:"agent_deleted",agentId:e.payload.agentId};case"agent_permission_request":return{type:"agent_permission_request",agentId:e.payload.agentId,request:e.payload.request};case"agent_permission_resolved":return{type:"agent_permission_resolved",agentId:e.payload.agentId,requestId:e.payload.requestId,resolution:e.payload.resolution};case"providers_snapshot_update":return{type:"providers_snapshot_update",payload:e.payload};default:return null}}waitForWithCancel(e,s=3e4,t){const r=new Error(`Timeout waiting for message (${s}ms)`);let n=null,o=!1,a=null;return{promise:new Promise((t,i)=>{const c=e=>{o||(o=!0,i(e))};a=c;const d=s>0?setTimeout(()=>{n&&this.waiters.delete(n),c(r)},s):null;n={predicate:e,resolve:e=>{o||(o=!0,t(e))},reject:c,timeoutHandle:d},this.waiters.add(n)}),cancel:e=>{o||(n&&(this.waiters.delete(n),n.timeoutHandle&&clearTimeout(n.timeoutHandle)),a?a(e):queueMicrotask(()=>{!o&&a&&a(e)}))}}}}function $(e){const{config:s,provider:t,cwd:r}=e,n=(0,p.default)(e,c),o=Object.assign({},t?{provider:t}:{},r?{cwd:r}:{},n),a=s?Object.assign({},o,s):o;if(!a.provider||!a.cwd)throw new Error("createAgent requires provider and cwd");return Object.assign({},a,{provider:a.provider,cwd:a.cwd})}},3279,[35,3280,3281,3380,3383,3384,3385,3387,3388,3398,3399,3400]);
|
|
14925
14925
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CLIENT_CAPS",{enumerable:!0,get:function(){return o}});const o={reasoningMergeEnum:"reasoning_merge_enum",customModeIcons:"custom_mode_icons",terminalReflowableSnapshot:"terminal_reflowable_snapshot",browserHost:"browser_host"}},3280,[]);
|
|
14926
|
-
__d(function(e,t,n,r,o,a,i){"use strict";const s=["contextKind"];Object.defineProperty(a,'__esModule',{value:!0}),Object.defineProperty(a,"PaseoConfigRawSchema",{enumerable:!0,get:function(){return I.PaseoConfigRawSchema}}),Object.defineProperty(a,"PaseoLifecycleCommandRawSchema",{enumerable:!0,get:function(){return I.PaseoLifecycleCommandRawSchema}}),Object.defineProperty(a,"PaseoMetadataGenerationEntrySchema",{enumerable:!0,get:function(){return I.PaseoMetadataGenerationEntrySchema}}),Object.defineProperty(a,"PaseoMetadataGenerationSchema",{enumerable:!0,get:function(){return I.PaseoMetadataGenerationSchema}}),Object.defineProperty(a,"PaseoScriptEntryRawSchema",{enumerable:!0,get:function(){return I.PaseoScriptEntryRawSchema}}),Object.defineProperty(a,"PaseoWorktreeConfigRawSchema",{enumerable:!0,get:function(){return I.PaseoWorktreeConfigRawSchema}}),Object.defineProperty(a,"TerminalProfileSchema",{enumerable:!0,get:function(){return v}}),Object.defineProperty(a,"KanbanBucketDefSchema",{enumerable:!0,get:function(){return A}}),Object.defineProperty(a,"KanbanBoardConfigSchema",{enumerable:!0,get:function(){return M}}),Object.defineProperty(a,"MutableDaemonConfigSchema",{enumerable:!0,get:function(){return T}}),Object.defineProperty(a,"MutableDaemonConfigPatchSchema",{enumerable:!0,get:function(){return x}}),Object.defineProperty(a,"AgentStatusSchema",{enumerable:!0,get:function(){return L}}),Object.defineProperty(a,"WORKFLOW_STATUSES",{enumerable:!0,get:function(){return D}}),Object.defineProperty(a,"WorkflowStatusSchema",{enumerable:!0,get:function(){return W}}),Object.defineProperty(a,"WorkflowPhaseSchema",{enumerable:!0,get:function(){return E}}),Object.defineProperty(a,"WorkflowSnapshotSchema",{enumerable:!0,get:function(){return N}}),Object.defineProperty(a,"STORED_WORKFLOW_SCHEMA",{enumerable:!0,get:function(){return U}}),Object.defineProperty(a,"WORKFLOW_EVENT_TYPES",{enumerable:!0,get:function(){return F}}),Object.defineProperty(a,"WorkflowEventTypeSchema",{enumerable:!0,get:function(){return B}}),Object.defineProperty(a,"WorkflowLifecycleEventSchema",{enumerable:!0,get:function(){return G}}),Object.defineProperty(a,"WorkflowListRequestSchema",{enumerable:!0,get:function(){return H}}),Object.defineProperty(a,"WorkflowListResponseSchema",{enumerable:!0,get:function(){return K}}),Object.defineProperty(a,"WorkflowGetRequestSchema",{enumerable:!0,get:function(){return V}}),Object.defineProperty(a,"WorkflowGetResponseSchema",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(a,"WorkflowCancelRequestSchema",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(a,"WorkflowCancelResponseSchema",{enumerable:!0,get:function(){return X}}),Object.defineProperty(a,"WorkflowEventsRequestSchema",{enumerable:!0,get:function(){return $}}),Object.defineProperty(a,"WorkflowEventsResponseSchema",{enumerable:!0,get:function(){return J}}),Object.defineProperty(a,"WorkflowTaskNodeSchema",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(a,"WorkflowTaskGraphSchema",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(a,"WorkflowStartRequestSchema",{enumerable:!0,get:function(){return te}}),Object.defineProperty(a,"WorkflowStartResponseSchema",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(a,"AgentFeatureToggleSchema",{enumerable:!0,get:function(){return se}}),Object.defineProperty(a,"AgentFeatureSelectSchema",{enumerable:!0,get:function(){return le}}),Object.defineProperty(a,"AgentFeatureSchema",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(a,"ProviderSnapshotEntrySchema",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(a,"AgentPermissionResponseSchema",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(a,"AgentPermissionRequestPayloadSchema",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(a,"AgentTimelineItemPayloadSchema",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(a,"AgentStreamEventPayloadSchema",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(a,"SessionDigestLinkSchema",{enumerable:!0,get:function(){return We}}),Object.defineProperty(a,"SessionDigestSchema",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(a,"AgentSnapshotPayloadSchema",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(a,"AgentListItemPayloadSchema",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(a,"RecentProviderSessionDescriptorPayloadSchema",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(a,"VoiceAudioChunkMessageSchema",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(a,"AbortRequestMessageSchema",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(a,"AudioPlayedMessageSchema",{enumerable:!0,get:function(){return He}}),Object.defineProperty(a,"DeleteAgentRequestMessageSchema",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(a,"ArchiveAgentRequestMessageSchema",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(a,"BackgroundTaskStatusSchema",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(a,"BackgroundTaskPayloadSchema",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(a,"ListBackgroundTasksRequestMessageSchema",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(a,"ListBackgroundTasksResponseSchema",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(a,"BackgroundTaskOutputRequestMessageSchema",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(a,"BackgroundTaskOutputResponseSchema",{enumerable:!0,get:function(){return et}}),Object.defineProperty(a,"DismissBackgroundTaskRequestMessageSchema",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(a,"BackgroundTaskDismissedMessageSchema",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(a,"CloseItemsRequestMessageSchema",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(a,"UpdateAgentRequestMessageSchema",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(a,"ProjectRenameRequestSchema",{enumerable:!0,get:function(){return at}}),Object.defineProperty(a,"ProjectRemoveRequestSchema",{enumerable:!0,get:function(){return it}}),Object.defineProperty(a,"WorkspaceTitleSetRequestSchema",{enumerable:!0,get:function(){return st}}),Object.defineProperty(a,"SetVoiceModeMessageSchema",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(a,"GitHubPrAttachmentSchema",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(a,"GitHubIssueAttachmentSchema",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(a,"TextAttachmentSchema",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(a,"ReviewAttachmentContextLineSchema",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(a,"ReviewAttachmentCommentSchema",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(a,"ReviewAttachmentSchema",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(a,"FileAttachmentSchema",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(a,"UploadedFileAttachmentSchema",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(a,"AgentAttachmentSchema",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(a,"SendAgentMessageSchema",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(a,"FetchAgentsRequestMessageSchema",{enumerable:!0,get:function(){return St}}),Object.defineProperty(a,"FetchWorkspacesRequestMessageSchema",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(a,"FetchAgentHistoryRequestMessageSchema",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(a,"FetchRecentProviderSessionsRequestMessageSchema",{enumerable:!0,get:function(){return It}}),Object.defineProperty(a,"FetchAgentRequestMessageSchema",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(a,"SendAgentMessageRequestSchema",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(a,"WaitForFinishRequestSchema",{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(a,"DaemonGetStatusRequestSchema",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(a,"DaemonGetPairingOfferRequestSchema",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(a,"DiagnosticsRequestSchema",{enumerable:!0,get:function(){return At}}),Object.defineProperty(a,"GetDaemonConfigRequestMessageSchema",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(a,"SetDaemonConfigRequestMessageSchema",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(a,"ReadProjectConfigRequestMessageSchema",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(a,"WriteProjectConfigRequestMessageSchema",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(a,"DictationStreamStartMessageSchema",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(a,"DictationStreamChunkMessageSchema",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(a,"DictationStreamFinishMessageSchema",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(a,"DictationStreamCancelMessageSchema",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(a,"CreateAgentWorktreeTargetSchema",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(a,"CreateAgentRequestMessageSchema",{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(a,"ListProviderModelsRequestMessageSchema",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(a,"ListProviderModesRequestMessageSchema",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(a,"ListAvailableProvidersRequestMessageSchema",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(a,"GetProvidersSnapshotRequestMessageSchema",{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(a,"ProvidersReloadConfigRequestMessageSchema",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(a,"RefreshProvidersSnapshotRequestMessageSchema",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(a,"ProviderDiagnosticRequestMessageSchema",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(a,"ProviderUsageListRequestMessageSchema",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(a,"ResumeAgentRequestMessageSchema",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(a,"ImportAgentRequestMessageSchema",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(a,"RefreshAgentRequestMessageSchema",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(a,"CancelAgentRequestMessageSchema",{enumerable:!0,get:function(){return en}}),Object.defineProperty(a,"RestartServerRequestMessageSchema",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(a,"ShutdownServerRequestMessageSchema",{enumerable:!0,get:function(){return nn}}),Object.defineProperty(a,"DaemonUpdateRequestMessageSchema",{enumerable:!0,get:function(){return rn}}),Object.defineProperty(a,"AgentTimelineCursorSchema",{enumerable:!0,get:function(){return on}}),Object.defineProperty(a,"FetchAgentTimelineRequestMessageSchema",{enumerable:!0,get:function(){return an}}),Object.defineProperty(a,"AgentForkContextRequestMessageSchema",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(a,"SetAgentModeRequestMessageSchema",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(a,"SetAgentModeResponseMessageSchema",{enumerable:!0,get:function(){return un}}),Object.defineProperty(a,"SetAgentModelRequestMessageSchema",{enumerable:!0,get:function(){return zn}}),Object.defineProperty(a,"SetAgentModelResponseMessageSchema",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(a,"SwapAgentProviderRequestMessageSchema",{enumerable:!0,get:function(){return gn}}),Object.defineProperty(a,"SwapAgentProviderResponseMessageSchema",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(a,"AgentProviderSwappedEventSchema",{enumerable:!0,get:function(){return dn}}),Object.defineProperty(a,"SetAgentThinkingRequestMessageSchema",{enumerable:!0,get:function(){return mn}}),Object.defineProperty(a,"SetAgentThinkingResponseMessageSchema",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(a,"SetAgentFeatureRequestMessageSchema",{enumerable:!0,get:function(){return yn}}),Object.defineProperty(a,"SetAgentFeatureResponseMessageSchema",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(a,"AgentDetachRequestMessageSchema",{enumerable:!0,get:function(){return jn}}),Object.defineProperty(a,"AgentDetachResponseMessageSchema",{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(a,"AgentRewindModeSchema",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(a,"AgentRewindRequestMessageSchema",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(a,"AgentRewindResponseMessageSchema",{enumerable:!0,get:function(){return qn}}),Object.defineProperty(a,"UpdateAgentResponseMessageSchema",{enumerable:!0,get:function(){return In}}),Object.defineProperty(a,"ProjectRenameResponsePayloadSchema",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(a,"ProjectRenameResponseSchema",{enumerable:!0,get:function(){return On}}),Object.defineProperty(a,"ProjectRemoveResponsePayloadSchema",{enumerable:!0,get:function(){return Rn}}),Object.defineProperty(a,"ProjectRemoveResponseSchema",{enumerable:!0,get:function(){return wn}}),Object.defineProperty(a,"WorkspaceTitleSetResponsePayloadSchema",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(a,"WorkspaceTitleSetResponseSchema",{enumerable:!0,get:function(){return An}}),Object.defineProperty(a,"SetVoiceModeResponseMessageSchema",{enumerable:!0,get:function(){return Mn}}),Object.defineProperty(a,"AgentPermissionResponseMessageSchema",{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(a,"WatchNotificationActionMessageSchema",{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(a,"WatchSessionSearchMessageSchema",{enumerable:!0,get:function(){return xn}}),Object.defineProperty(a,"WatchComposerDictateMessageSchema",{enumerable:!0,get:function(){return Ln}}),Object.defineProperty(a,"CheckoutStatusRequestSchema",{enumerable:!0,get:function(){return Nn}}),Object.defineProperty(a,"SubscribeCheckoutDiffRequestSchema",{enumerable:!0,get:function(){return Un}}),Object.defineProperty(a,"UnsubscribeCheckoutDiffRequestSchema",{enumerable:!0,get:function(){return Fn}}),Object.defineProperty(a,"CheckoutCommitRequestSchema",{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(a,"CheckoutMergeRequestSchema",{enumerable:!0,get:function(){return Gn}}),Object.defineProperty(a,"CheckoutMergeFromBaseRequestSchema",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(a,"CheckoutPullRequestSchema",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(a,"CheckoutPushRequestSchema",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(a,"CheckoutRefreshRequestSchema",{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(a,"CheckoutPrCreateRequestSchema",{enumerable:!0,get:function(){return Qn}}),Object.defineProperty(a,"CheckoutPrMergeRequestSchema",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(a,"CheckoutGithubSetAutoMergeRequestSchema",{enumerable:!0,get:function(){return $n}}),Object.defineProperty(a,"FileUploadErrorCodeSchema",{enumerable:!0,get:function(){return Jn}}),Object.defineProperty(a,"FilesUploadBeginRequestSchema",{enumerable:!0,get:function(){return Zn}}),Object.defineProperty(a,"FilesUploadCompleteRequestSchema",{enumerable:!0,get:function(){return er}}),Object.defineProperty(a,"FilesUploadChunkSchema",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(a,"FilesUploadErrorSchema",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(a,"CheckoutGithubGetCheckDetailsRequestSchema",{enumerable:!0,get:function(){return or}}),Object.defineProperty(a,"CheckoutPrStatusRequestSchema",{enumerable:!0,get:function(){return ar}}),Object.defineProperty(a,"PullRequestTimelineRequestSchema",{enumerable:!0,get:function(){return ir}}),Object.defineProperty(a,"ValidateBranchRequestSchema",{enumerable:!0,get:function(){return sr}}),Object.defineProperty(a,"CheckoutSwitchBranchRequestSchema",{enumerable:!0,get:function(){return lr}}),Object.defineProperty(a,"CheckoutRenameBranchRequestSchema",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(a,"StashSaveRequestSchema",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(a,"StashPopRequestSchema",{enumerable:!0,get:function(){return zr}}),Object.defineProperty(a,"StashListRequestSchema",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(a,"BranchSuggestionsRequestSchema",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(a,"GitHubSearchItemSchema",{enumerable:!0,get:function(){return br}}),Object.defineProperty(a,"GitHubSearchKindSchema",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(a,"GitHubSearchRequestSchema",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(a,"DirectorySuggestionsRequestSchema",{enumerable:!0,get:function(){return fr}}),Object.defineProperty(a,"PaseoWorktreeListRequestSchema",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(a,"PaseoWorktreeArchiveRequestSchema",{enumerable:!0,get:function(){return hr}}),Object.defineProperty(a,"FirstAgentContextSchema",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(a,"CreatePaseoWorktreeRequestSchema",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(a,"WorkspaceSetupStatusRequestSchema",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(a,"LEGACY_EDITOR_TARGET_IDS",{enumerable:!0,get:function(){return _r}}),Object.defineProperty(a,"KNOWN_EDITOR_TARGET_IDS",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(a,"KnownEditorTargetIdSchema",{enumerable:!0,get:function(){return Ir}}),Object.defineProperty(a,"LegacyEditorTargetIdSchema",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(a,"EditorTargetIdSchema",{enumerable:!0,get:function(){return Or}}),a.isKnownEditorTargetId=function(e){return Rr.has(e)},a.isLegacyEditorTargetId=function(e){return wr.has(e)},Object.defineProperty(a,"EditorTargetDescriptorPayloadSchema",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(a,"LegacyListAvailableEditorsRequestSchema",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(a,"LegacyOpenInEditorRequestSchema",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(a,"OpenProjectRequestSchema",{enumerable:!0,get:function(){return Cr}}),Object.defineProperty(a,"ProjectAddRequestSchema",{enumerable:!0,get:function(){return Tr}}),Object.defineProperty(a,"ArchiveWorkspaceRequestSchema",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(a,"WorkspaceCreateRequestSchema",{enumerable:!0,get:function(){return Lr}}),Object.defineProperty(a,"WorkspaceClearAttentionRequestSchema",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(a,"FileExplorerRequestSchema",{enumerable:!0,get:function(){return Hr}}),Object.defineProperty(a,"ProjectIconRequestSchema",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(a,"FileDownloadTokenRequestSchema",{enumerable:!0,get:function(){return Vr}}),Object.defineProperty(a,"FileUploadRequestSchema",{enumerable:!0,get:function(){return Yr}}),Object.defineProperty(a,"ClearAgentAttentionMessageSchema",{enumerable:!0,get:function(){return Qr}}),Object.defineProperty(a,"ClientHeartbeatMessageSchema",{enumerable:!0,get:function(){return Xr}}),Object.defineProperty(a,"PingMessageSchema",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(a,"ListProviderFeaturesRequestMessageSchema",{enumerable:!0,get:function(){return Zr}}),Object.defineProperty(a,"ListCommandsRequestSchema",{enumerable:!0,get:function(){return eo}}),Object.defineProperty(a,"RegisterPushTokenMessageSchema",{enumerable:!0,get:function(){return to}}),Object.defineProperty(a,"RewindSessionRequestMessageSchema",{enumerable:!0,get:function(){return no}}),Object.defineProperty(a,"RewindSessionResponseMessageSchema",{enumerable:!0,get:function(){return ro}}),Object.defineProperty(a,"EditMessageRequestMessageSchema",{enumerable:!0,get:function(){return oo}}),Object.defineProperty(a,"EditMessageResponseMessageSchema",{enumerable:!0,get:function(){return ao}}),Object.defineProperty(a,"ListWorkspaceSessionsRequestMessageSchema",{enumerable:!0,get:function(){return io}}),Object.defineProperty(a,"ListWorkspaceSessionsResponseMessageSchema",{enumerable:!0,get:function(){return lo}}),Object.defineProperty(a,"ListAllSessionsRequestMessageSchema",{enumerable:!0,get:function(){return co}}),Object.defineProperty(a,"ListAllSessionsResponseMessageSchema",{enumerable:!0,get:function(){return zo}}),Object.defineProperty(a,"ListExtensionsRequestMessageSchema",{enumerable:!0,get:function(){return fo}}),Object.defineProperty(a,"ListExtensionsResponseMessageSchema",{enumerable:!0,get:function(){return yo}}),Object.defineProperty(a,"ExecuteExtensionCommandRequestMessageSchema",{enumerable:!0,get:function(){return ho}}),Object.defineProperty(a,"ExecuteExtensionCommandResponseMessageSchema",{enumerable:!0,get:function(){return jo}}),Object.defineProperty(a,"SearchSessionsRequestMessageSchema",{enumerable:!0,get:function(){return So}}),Object.defineProperty(a,"SearchSessionsResponseMessageSchema",{enumerable:!0,get:function(){return _o}}),Object.defineProperty(a,"SubscribePushRequestMessageSchema",{enumerable:!0,get:function(){return ko}}),Object.defineProperty(a,"SubscribePushResponseMessageSchema",{enumerable:!0,get:function(){return Oo}}),Object.defineProperty(a,"GetVapidPublicKeyRequestMessageSchema",{enumerable:!0,get:function(){return Ro}}),Object.defineProperty(a,"GetVapidPublicKeyResponseMessageSchema",{enumerable:!0,get:function(){return wo}}),Object.defineProperty(a,"ListTerminalsRequestSchema",{enumerable:!0,get:function(){return vo}}),Object.defineProperty(a,"SubscribeTerminalsRequestSchema",{enumerable:!0,get:function(){return Ao}}),Object.defineProperty(a,"UnsubscribeTerminalsRequestSchema",{enumerable:!0,get:function(){return Mo}}),Object.defineProperty(a,"CreateTerminalRequestSchema",{enumerable:!0,get:function(){return Co}}),Object.defineProperty(a,"RenameTerminalRequestSchema",{enumerable:!0,get:function(){return To}}),Object.defineProperty(a,"StartWorkspaceScriptRequestSchema",{enumerable:!0,get:function(){return xo}}),Object.defineProperty(a,"SubscribeTerminalRequestSchema",{enumerable:!0,get:function(){return Lo}}),Object.defineProperty(a,"UnsubscribeTerminalRequestSchema",{enumerable:!0,get:function(){return Do}}),Object.defineProperty(a,"TerminalInputSchema",{enumerable:!0,get:function(){return Eo}}),Object.defineProperty(a,"KillTerminalRequestSchema",{enumerable:!0,get:function(){return No}}),Object.defineProperty(a,"CaptureTerminalRequestSchema",{enumerable:!0,get:function(){return Uo}}),Object.defineProperty(a,"SessionInboundMessageSchema",{enumerable:!0,get:function(){return Fo}}),Object.defineProperty(a,"ActivityLogPayloadSchema",{enumerable:!0,get:function(){return Bo}}),Object.defineProperty(a,"ActivityLogMessageSchema",{enumerable:!0,get:function(){return Go}}),Object.defineProperty(a,"AssistantChunkMessageSchema",{enumerable:!0,get:function(){return Ho}}),Object.defineProperty(a,"AudioOutputMessageSchema",{enumerable:!0,get:function(){return Ko}}),Object.defineProperty(a,"TranscriptionResultMessageSchema",{enumerable:!0,get:function(){return Vo}}),Object.defineProperty(a,"VoiceInputStateMessageSchema",{enumerable:!0,get:function(){return Yo}}),Object.defineProperty(a,"DictationStreamAckMessageSchema",{enumerable:!0,get:function(){return Qo}}),Object.defineProperty(a,"DictationStreamFinishAcceptedMessageSchema",{enumerable:!0,get:function(){return Xo}}),Object.defineProperty(a,"DictationStreamPartialMessageSchema",{enumerable:!0,get:function(){return $o}}),Object.defineProperty(a,"DictationStreamFinalMessageSchema",{enumerable:!0,get:function(){return Jo}}),Object.defineProperty(a,"DictationStreamErrorMessageSchema",{enumerable:!0,get:function(){return Zo}}),Object.defineProperty(a,"ServerCapabilityStateSchema",{enumerable:!0,get:function(){return ea}}),Object.defineProperty(a,"ServerVoiceCapabilitiesSchema",{enumerable:!0,get:function(){return ta}}),Object.defineProperty(a,"ServerCapabilitiesSchema",{enumerable:!0,get:function(){return na}}),Object.defineProperty(a,"ServerInfoStatusPayloadSchema",{enumerable:!0,get:function(){return ia}}),Object.defineProperty(a,"StatusMessageSchema",{enumerable:!0,get:function(){return sa}}),Object.defineProperty(a,"PongMessageSchema",{enumerable:!0,get:function(){return la}}),Object.defineProperty(a,"RpcErrorMessageSchema",{enumerable:!0,get:function(){return ca}}),Object.defineProperty(a,"AgentCreatedStatusPayloadSchema",{enumerable:!0,get:function(){return pa}}),Object.defineProperty(a,"AgentCreateFailedStatusPayloadSchema",{enumerable:!0,get:function(){return ga}}),Object.defineProperty(a,"AgentResumedStatusPayloadSchema",{enumerable:!0,get:function(){return ba}}),Object.defineProperty(a,"AgentRefreshedStatusPayloadSchema",{enumerable:!0,get:function(){return da}}),Object.defineProperty(a,"RestartRequestedStatusPayloadSchema",{enumerable:!0,get:function(){return ma}}),Object.defineProperty(a,"ShutdownRequestedStatusPayloadSchema",{enumerable:!0,get:function(){return fa}}),Object.defineProperty(a,"DaemonConfigChangedStatusPayloadSchema",{enumerable:!0,get:function(){return ya}}),Object.defineProperty(a,"KnownStatusPayloadSchema",{enumerable:!0,get:function(){return ha}}),Object.defineProperty(a,"ArtifactMessageSchema",{enumerable:!0,get:function(){return ja}}),Object.defineProperty(a,"ProjectCheckoutLiteNotGitPayloadSchema",{enumerable:!0,get:function(){return Sa}}),Object.defineProperty(a,"ProjectCheckoutLiteGitNonPaseoPayloadSchema",{enumerable:!0,get:function(){return Pa}}),Object.defineProperty(a,"ProjectCheckoutLiteGitPaseoPayloadSchema",{enumerable:!0,get:function(){return _a}}),Object.defineProperty(a,"ProjectCheckoutLitePayloadSchema",{enumerable:!0,get:function(){return qa}}),Object.defineProperty(a,"ProjectPlacementPayloadSchema",{enumerable:!0,get:function(){return Ia}}),Object.defineProperty(a,"WorkspaceScriptLifecycleSchema",{enumerable:!0,get:function(){return ka}}),Object.defineProperty(a,"WorkspaceScriptHealthSchema",{enumerable:!0,get:function(){return Oa}}),Object.defineProperty(a,"WorkspaceScriptPayloadSchema",{enumerable:!0,get:function(){return Ra}}),Object.defineProperty(a,"WorkspaceDescriptorPayloadSchema",{enumerable:!0,get:function(){return Aa}}),Object.defineProperty(a,"AgentUpdateMessageSchema",{enumerable:!0,get:function(){return Ma}}),Object.defineProperty(a,"OpenUrlMessageSchema",{enumerable:!0,get:function(){return Ca}}),Object.defineProperty(a,"AgentStreamMessageSchema",{enumerable:!0,get:function(){return Ta}}),Object.defineProperty(a,"AgentStatusMessageSchema",{enumerable:!0,get:function(){return xa}}),Object.defineProperty(a,"AgentListMessageSchema",{enumerable:!0,get:function(){return La}}),Object.defineProperty(a,"FetchAgentsResponseMessageSchema",{enumerable:!0,get:function(){return Ea}}),Object.defineProperty(a,"FetchAgentHistoryResponseMessageSchema",{enumerable:!0,get:function(){return Na}}),Object.defineProperty(a,"FetchRecentProviderSessionsResponseMessageSchema",{enumerable:!0,get:function(){return Ua}}),Object.defineProperty(a,"WorkspaceProjectDescriptorPayloadSchema",{enumerable:!0,get:function(){return Fa}}),Object.defineProperty(a,"FetchWorkspacesResponseMessageSchema",{enumerable:!0,get:function(){return Ba}}),Object.defineProperty(a,"WorkspaceUpdateMessageSchema",{enumerable:!0,get:function(){return Ga}}),Object.defineProperty(a,"ScriptStatusUpdateMessageSchema",{enumerable:!0,get:function(){return Ha}}),Object.defineProperty(a,"WorkspaceSetupProgressMessageSchema",{enumerable:!0,get:function(){return Ka}}),Object.defineProperty(a,"WorkspaceSetupSnapshotSchema",{enumerable:!0,get:function(){return Va}}),Object.defineProperty(a,"WorkspaceSetupStatusResponseMessageSchema",{enumerable:!0,get:function(){return Ya}}),Object.defineProperty(a,"OpenProjectResponseMessageSchema",{enumerable:!0,get:function(){return Qa}}),Object.defineProperty(a,"ProjectAddResponseSchema",{enumerable:!0,get:function(){return Xa}}),Object.defineProperty(a,"StartWorkspaceScriptResponseMessageSchema",{enumerable:!0,get:function(){return $a}}),Object.defineProperty(a,"LegacyListAvailableEditorsResponseMessageSchema",{enumerable:!0,get:function(){return Ja}}),Object.defineProperty(a,"LegacyOpenInEditorResponseMessageSchema",{enumerable:!0,get:function(){return Za}}),Object.defineProperty(a,"ArchiveWorkspaceResponseMessageSchema",{enumerable:!0,get:function(){return ei}}),Object.defineProperty(a,"FetchAgentResponseMessageSchema",{enumerable:!0,get:function(){return ti}}),Object.defineProperty(a,"AgentTimelineEntryPayloadSchema",{enumerable:!0,get:function(){return ri}}),Object.defineProperty(a,"FetchAgentTimelineResponseMessageSchema",{enumerable:!0,get:function(){return oi}}),Object.defineProperty(a,"AgentForkContextResponseMessageSchema",{enumerable:!0,get:function(){return ai}}),Object.defineProperty(a,"CancelAgentResponseMessageSchema",{enumerable:!0,get:function(){return ii}}),Object.defineProperty(a,"ClearAgentAttentionResponseMessageSchema",{enumerable:!0,get:function(){return si}}),Object.defineProperty(a,"WorkspaceCreateResponseSchema",{enumerable:!0,get:function(){return li}}),Object.defineProperty(a,"WorkspaceClearAttentionResponseSchema",{enumerable:!0,get:function(){return ci}}),Object.defineProperty(a,"SendAgentMessageResponseMessageSchema",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(a,"WaitForFinishResponseMessageSchema",{enumerable:!0,get:function(){return zi}}),Object.defineProperty(a,"GetDaemonConfigResponseMessageSchema",{enumerable:!0,get:function(){return pi}}),Object.defineProperty(a,"DaemonGetStatusResponseSchema",{enumerable:!0,get:function(){return gi}}),Object.defineProperty(a,"DaemonGetPairingOfferResponseSchema",{enumerable:!0,get:function(){return bi}}),Object.defineProperty(a,"DiagnosticsResponseSchema",{enumerable:!0,get:function(){return di}}),Object.defineProperty(a,"SetDaemonConfigResponseMessageSchema",{enumerable:!0,get:function(){return mi}}),Object.defineProperty(a,"ReadProjectConfigResponseMessageSchema",{enumerable:!0,get:function(){return fi}}),Object.defineProperty(a,"WriteProjectConfigResponseMessageSchema",{enumerable:!0,get:function(){return yi}}),Object.defineProperty(a,"AgentPermissionRequestMessageSchema",{enumerable:!0,get:function(){return hi}}),Object.defineProperty(a,"WatchActionSchema",{enumerable:!0,get:function(){return ji}}),Object.defineProperty(a,"WatchActionablePushMessageSchema",{enumerable:!0,get:function(){return Si}}),Object.defineProperty(a,"WatchActionableResolvedMessageSchema",{enumerable:!0,get:function(){return Pi}}),Object.defineProperty(a,"WatchSessionMatchSchema",{enumerable:!0,get:function(){return _i}}),Object.defineProperty(a,"WatchSessionSearchResultMessageSchema",{enumerable:!0,get:function(){return qi}}),Object.defineProperty(a,"AgentPermissionResolvedMessageSchema",{enumerable:!0,get:function(){return Ii}}),Object.defineProperty(a,"AgentDeletedMessageSchema",{enumerable:!0,get:function(){return ki}}),Object.defineProperty(a,"AgentArchivedMessageSchema",{enumerable:!0,get:function(){return Oi}}),Object.defineProperty(a,"CloseItemsResponseSchema",{enumerable:!0,get:function(){return vi}}),Object.defineProperty(a,"CheckoutStatusResponseSchema",{enumerable:!0,get:function(){return Li}}),Object.defineProperty(a,"CheckoutPrStatusSchema",{enumerable:!0,get:function(){return Ni}}),Object.defineProperty(a,"CheckoutStatusUpdateSchema",{enumerable:!0,get:function(){return Bi}}),Object.defineProperty(a,"SubscribeCheckoutDiffResponseSchema",{enumerable:!0,get:function(){return Hi}}),Object.defineProperty(a,"CheckoutDiffUpdateSchema",{enumerable:!0,get:function(){return Ki}}),Object.defineProperty(a,"CheckoutCommitResponseSchema",{enumerable:!0,get:function(){return Vi}}),Object.defineProperty(a,"CheckoutMergeResponseSchema",{enumerable:!0,get:function(){return Yi}}),Object.defineProperty(a,"CheckoutMergeFromBaseResponseSchema",{enumerable:!0,get:function(){return Qi}}),Object.defineProperty(a,"CheckoutPullResponseSchema",{enumerable:!0,get:function(){return Xi}}),Object.defineProperty(a,"CheckoutPushResponseSchema",{enumerable:!0,get:function(){return $i}}),Object.defineProperty(a,"CheckoutRefreshResponseSchema",{enumerable:!0,get:function(){return Ji}}),Object.defineProperty(a,"CheckoutPrCreateResponseSchema",{enumerable:!0,get:function(){return Zi}}),Object.defineProperty(a,"CheckoutPrMergeResponseSchema",{enumerable:!0,get:function(){return es}}),Object.defineProperty(a,"CheckoutGithubSetAutoMergeResponseSchema",{enumerable:!0,get:function(){return ts}}),Object.defineProperty(a,"FilesUploadBeginResponseSchema",{enumerable:!0,get:function(){return ns}}),Object.defineProperty(a,"FilesUploadChunkAckSchema",{enumerable:!0,get:function(){return rs}}),Object.defineProperty(a,"FilesUploadCompleteResponseSchema",{enumerable:!0,get:function(){return os}}),Object.defineProperty(a,"CheckoutGithubCheckDetailsSchema",{enumerable:!0,get:function(){return ss}}),Object.defineProperty(a,"CheckoutGithubGetCheckDetailsResponseSchema",{enumerable:!0,get:function(){return ls}}),Object.defineProperty(a,"CheckoutPrStatusResponseSchema",{enumerable:!0,get:function(){return cs}}),Object.defineProperty(a,"PullRequestTimelineItemSchema",{enumerable:!0,get:function(){return bs}}),Object.defineProperty(a,"PullRequestTimelineResponseSchema",{enumerable:!0,get:function(){return ds}}),Object.defineProperty(a,"CheckoutSwitchBranchResponseSchema",{enumerable:!0,get:function(){return ms}}),Object.defineProperty(a,"CheckoutRenameBranchResponseSchema",{enumerable:!0,get:function(){return fs}}),Object.defineProperty(a,"StashSaveResponseSchema",{enumerable:!0,get:function(){return hs}}),Object.defineProperty(a,"StashPopResponseSchema",{enumerable:!0,get:function(){return js}}),Object.defineProperty(a,"StashListResponseSchema",{enumerable:!0,get:function(){return Ss}}),Object.defineProperty(a,"ValidateBranchResponseSchema",{enumerable:!0,get:function(){return Ps}}),Object.defineProperty(a,"BranchSuggestionsResponseSchema",{enumerable:!0,get:function(){return _s}}),Object.defineProperty(a,"GitHubSearchResponseSchema",{enumerable:!0,get:function(){return qs}}),Object.defineProperty(a,"DirectorySuggestionsResponseSchema",{enumerable:!0,get:function(){return Is}}),Object.defineProperty(a,"PaseoWorktreeListResponseSchema",{enumerable:!0,get:function(){return Os}}),Object.defineProperty(a,"PaseoWorktreeArchiveResponseSchema",{enumerable:!0,get:function(){return Rs}}),Object.defineProperty(a,"CreatePaseoWorktreeResponseSchema",{enumerable:!0,get:function(){return ws}}),Object.defineProperty(a,"FileExplorerResponseSchema",{enumerable:!0,get:function(){return vs}}),Object.defineProperty(a,"ProjectIconResponseSchema",{enumerable:!0,get:function(){return Ms}}),Object.defineProperty(a,"FileDownloadTokenResponseSchema",{enumerable:!0,get:function(){return Cs}}),Object.defineProperty(a,"FileUploadResponseSchema",{enumerable:!0,get:function(){return Ts}}),Object.defineProperty(a,"ListProviderModelsResponseMessageSchema",{enumerable:!0,get:function(){return xs}}),Object.defineProperty(a,"ListProviderModesResponseMessageSchema",{enumerable:!0,get:function(){return Ls}}),Object.defineProperty(a,"ListProviderFeaturesResponseMessageSchema",{enumerable:!0,get:function(){return Ds}}),Object.defineProperty(a,"ListAvailableProvidersResponseSchema",{enumerable:!0,get:function(){return Es}}),Object.defineProperty(a,"GetProvidersSnapshotResponseMessageSchema",{enumerable:!0,get:function(){return Ns}}),Object.defineProperty(a,"ProvidersReloadConfigResponseMessageSchema",{enumerable:!0,get:function(){return Us}}),Object.defineProperty(a,"ProvidersSnapshotUpdateMessageSchema",{enumerable:!0,get:function(){return Fs}}),Object.defineProperty(a,"RefreshProvidersSnapshotResponseMessageSchema",{enumerable:!0,get:function(){return Bs}}),Object.defineProperty(a,"ProviderDiagnosticResponseMessageSchema",{enumerable:!0,get:function(){return Gs}}),Object.defineProperty(a,"ProviderUsageToneSchema",{enumerable:!0,get:function(){return Hs}}),Object.defineProperty(a,"ProviderUsageStatusSchema",{enumerable:!0,get:function(){return Ks}}),Object.defineProperty(a,"ProviderUsageWindowSchema",{enumerable:!0,get:function(){return Vs}}),Object.defineProperty(a,"ProviderUsageBalanceSchema",{enumerable:!0,get:function(){return Ys}}),Object.defineProperty(a,"ProviderUsageDetailSchema",{enumerable:!0,get:function(){return Qs}}),Object.defineProperty(a,"ProviderUsageSchema",{enumerable:!0,get:function(){return Xs}}),Object.defineProperty(a,"ProviderUsageListResponseMessageSchema",{enumerable:!0,get:function(){return $s}}),Object.defineProperty(a,"ListCommandsResponseSchema",{enumerable:!0,get:function(){return Zs}}),Object.defineProperty(a,"TerminalCellSchema",{enumerable:!0,get:function(){return tl}}),Object.defineProperty(a,"TerminalCursorStyleSchema",{enumerable:!0,get:function(){return nl}}),Object.defineProperty(a,"TerminalCursorSchema",{enumerable:!0,get:function(){return rl}}),Object.defineProperty(a,"TerminalStateSchema",{enumerable:!0,get:function(){return ol}}),Object.defineProperty(a,"ListTerminalsResponseSchema",{enumerable:!0,get:function(){return al}}),Object.defineProperty(a,"TerminalsChangedSchema",{enumerable:!0,get:function(){return il}}),Object.defineProperty(a,"CreateTerminalResponseSchema",{enumerable:!0,get:function(){return sl}}),Object.defineProperty(a,"RenameTerminalResponseSchema",{enumerable:!0,get:function(){return ll}}),Object.defineProperty(a,"SubscribeTerminalResponseSchema",{enumerable:!0,get:function(){return cl}}),Object.defineProperty(a,"KillTerminalResponseSchema",{enumerable:!0,get:function(){return ul}}),Object.defineProperty(a,"CaptureTerminalResponseSchema",{enumerable:!0,get:function(){return zl}}),Object.defineProperty(a,"TerminalStreamExitSchema",{enumerable:!0,get:function(){return pl}}),Object.defineProperty(a,"TerminalAttentionRequiredSchema",{enumerable:!0,get:function(){return gl}}),Object.defineProperty(a,"DaemonUpdateResponseSchema",{enumerable:!0,get:function(){return bl}}),Object.defineProperty(a,"DaemonUpdateProgressMessageSchema",{enumerable:!0,get:function(){return dl}}),Object.defineProperty(a,"SessionOutboundMessageSchema",{enumerable:!0,get:function(){return ml}}),Object.defineProperty(a,"WSPingMessageSchema",{enumerable:!0,get:function(){return fl}}),Object.defineProperty(a,"WSPongMessageSchema",{enumerable:!0,get:function(){return yl}}),Object.defineProperty(a,"WSHelloMessageSchema",{enumerable:!0,get:function(){return hl}}),Object.defineProperty(a,"WSRecordingStateMessageSchema",{enumerable:!0,get:function(){return jl}}),Object.defineProperty(a,"WSSessionInboundSchema",{enumerable:!0,get:function(){return Sl}}),Object.defineProperty(a,"WSSessionOutboundSchema",{enumerable:!0,get:function(){return Pl}}),Object.defineProperty(a,"WSInboundMessageSchema",{enumerable:!0,get:function(){return _l}}),Object.defineProperty(a,"WSOutboundMessageSchema",{enumerable:!0,get:function(){return ql}}),a.extractSessionMessage=function(e){if("session"===e.type)return e.message;return null},a.wrapSessionMessage=function(e){return{type:"session",message:e}},a.parseServerInfoStatusPayload=function(e){const t=ia.safeParse(e);if(!t.success)return null;return t.data},Object.defineProperty(a,"PermissionHookEventSchema",{enumerable:!0,get:function(){return Il}}),Object.defineProperty(a,"PreToolHookEventSchema",{enumerable:!0,get:function(){return kl}}),Object.defineProperty(a,"PostToolHookEventSchema",{enumerable:!0,get:function(){return Ol}}),Object.defineProperty(a,"StatusLineHookEventSchema",{enumerable:!0,get:function(){return Rl}}),Object.defineProperty(a,"SessionStartHookEventSchema",{enumerable:!0,get:function(){return wl}}),Object.defineProperty(a,"SessionEndHookEventSchema",{enumerable:!0,get:function(){return vl}}),Object.defineProperty(a,"AssistantMessageDeltaHookEventSchema",{enumerable:!0,get:function(){return Al}}),Object.defineProperty(a,"UsageUpdateHookEventSchema",{enumerable:!0,get:function(){return Ml}}),Object.defineProperty(a,"HookEventSchema",{enumerable:!0,get:function(){return Cl}});var l,c=t(i[0]),u=(l=c)&&l.__esModule?l:{default:l},z=t(i[1]),p=t(i[2]),g=t(i[3]),b=t(i[4]),d=t(i[5]),m=t(i[6]),f=t(i[7]),y=t(i[8]),h=t(i[9]),j=t(i[10]),S=t(i[11]),P=t(i[12]),_=t(i[13]),q=t(i[14]),I=t(i[15]);const k=z.z.object({id:z.z.string().min(1),label:z.z.string().min(1),description:z.z.string().optional(),isDefault:z.z.boolean().optional()}).passthrough(),O=z.z.object({enabled:z.z.boolean().optional(),additionalModels:z.z.array(k).optional()}).passthrough(),R=z.z.object({provider:z.z.string().min(1),model:z.z.string().min(1).optional(),thinkingOptionId:z.z.string().min(1).optional()}).passthrough(),w=z.z.object({providers:z.z.array(R).default([])}).passthrough(),v=z.z.object({id:z.z.string(),name:z.z.string(),command:z.z.string(),args:z.z.array(z.z.string()).optional(),icon:z.z.string().optional()}).passthrough(),A=z.z.object({id:z.z.string().min(1),label:z.z.string().min(1),limit:z.z.number().int().positive().optional()}).passthrough(),M=z.z.object({buckets:z.z.array(A).default([]),defaultBucketId:z.z.string().nullable().default(null)}).passthrough(),C=z.z.object({enabled:z.z.boolean().default(!1)}).passthrough(),T=z.z.object({mcp:z.z.object({injectIntoAgents:z.z.boolean()}).passthrough(),browserTools:C.default({enabled:!1}),providers:z.z.record(z.z.string(),O).default({}),metadataGeneration:w.default({providers:[]}),autoArchiveAfterMerge:z.z.boolean().default(!1),enableTerminalAgentHooks:z.z.boolean().default(!1),appendSystemPrompt:z.z.string().default(""),terminalProfiles:z.z.array(v).optional(),kanbanBoard:M.optional()}).passthrough(),x=z.z.object({mcp:T.shape.mcp.partial().optional(),browserTools:C.partial().optional(),providers:z.z.record(z.z.string(),O.partial().passthrough()).optional(),metadataGeneration:w.partial().optional(),autoArchiveAfterMerge:z.z.boolean().optional(),enableTerminalAgentHooks:z.z.boolean().optional(),appendSystemPrompt:z.z.string().optional(),terminalProfiles:z.z.array(v).optional(),kanbanBoard:M.optional()}).partial().passthrough(),L=z.z.enum(b.AGENT_LIFECYCLE_STATUSES),D=["pending","running","completed","failed","cancelled"],W=z.z.enum(D),E=z.z.object({id:z.z.string(),title:z.z.string(),status:W,storyCount:z.z.number().int().nonnegative().optional(),completedStoryCount:z.z.number().int().nonnegative().optional()}),N=z.z.object({id:z.z.string(),cwd:z.z.string(),status:W,title:z.z.string().nullable().optional(),labels:z.z.record(z.z.string(),z.z.string()).default({}),phases:z.z.array(E).default([]),childAgentIds:z.z.array(z.z.string()).default([]),totalStoryCount:z.z.number().int().nonnegative().optional(),completedStoryCount:z.z.number().int().nonnegative().default(0),createdAt:z.z.string(),updatedAt:z.z.string(),startedAt:z.z.string().nullable().optional(),completedAt:z.z.string().nullable().optional(),archivedAt:z.z.string().nullable().optional()}),U=N,F=["created","started","completed","failed","cancelled","archived"],B=z.z.enum(F),G=z.z.object({workflowId:z.z.string(),type:B,status:W,at:z.z.string()}),H=z.z.object({type:z.z.literal("workflow.list.request"),requestId:z.z.string()}),K=z.z.object({type:z.z.literal("workflow.list.response"),payload:z.z.object({requestId:z.z.string(),workflows:z.z.array(N)})}),V=z.z.object({type:z.z.literal("workflow.get.request"),requestId:z.z.string(),workflowId:z.z.string()}),Y=z.z.object({type:z.z.literal("workflow.get.response"),payload:z.z.object({requestId:z.z.string(),workflow:N.nullable()})}),Q=z.z.object({type:z.z.literal("workflow.cancel.request"),requestId:z.z.string(),workflowId:z.z.string()}),X=z.z.object({type:z.z.literal("workflow.cancel.response"),payload:z.z.object({requestId:z.z.string(),workflow:N})}),$=z.z.object({type:z.z.literal("workflow.events.request"),requestId:z.z.string(),workflowId:z.z.string()}),J=z.z.object({type:z.z.literal("workflow.events.response"),payload:z.z.object({requestId:z.z.string(),workflowId:z.z.string(),events:z.z.array(G)})}),Z=z.z.object({id:z.z.string(),dependencies:z.z.array(z.z.string()),description:z.z.string(),prompt:z.z.string(),title:z.z.string(),outputFile:z.z.string(),parallelizable:z.z.boolean(),estimatedMinutes:z.z.number(),agentType:z.z.string().optional(),targetFiles:z.z.array(z.z.string()).optional()}),ee=z.z.object({goal:z.z.string(),masterPrompt:z.z.string(),metadata:z.z.object({executionLayers:z.z.array(z.z.array(z.z.string())),maxParallelism:z.z.number(),totalTasks:z.z.number(),estimatedDuration:z.z.number(),perFileMode:z.z.boolean(),storyFormat:z.z.boolean().optional(),totalFiles:z.z.number().optional()}),session:z.z.object({id:z.z.string(),createdAt:z.z.string(),outputDirectory:z.z.string()}),tasks:z.z.array(Z)}),te=z.z.object({type:z.z.literal("workflow.start.request"),requestId:z.z.string(),graph:ee,provider:z.z.string(),cwd:z.z.string(),model:z.z.string().optional(),title:z.z.string().optional(),labels:z.z.record(z.z.string(),z.z.string()).optional()}),ne=z.z.object({type:z.z.literal("workflow.start.response"),payload:z.z.object({requestId:z.z.string(),workflowId:z.z.string(),childAgentIds:z.z.array(z.z.string()),status:W})}),re=z.z.object({id:z.z.string(),label:z.z.string(),description:z.z.string().optional(),icon:z.z.string().optional(),colorTier:z.z.string().optional()}),oe=z.z.enum(["ready","loading","error","unavailable"]),ae=z.z.object({id:z.z.string(),label:z.z.string(),description:z.z.string().optional(),isDefault:z.z.boolean().optional(),metadata:z.z.record(z.z.string(),z.z.unknown()).optional()}),ie=z.z.discriminatedUnion("type",[z.z.object({type:z.z.literal("info"),message:z.z.string()}),z.z.object({type:z.z.literal("warning"),message:z.z.string()}),z.z.object({type:z.z.literal("error"),message:z.z.string()})]),se=z.z.object({type:z.z.literal("toggle"),id:z.z.string(),label:z.z.string(),description:z.z.string().optional(),tooltip:z.z.string().optional(),icon:z.z.string().optional(),value:z.z.boolean()}),le=z.z.object({type:z.z.literal("select"),id:z.z.string(),label:z.z.string(),description:z.z.string().optional(),tooltip:z.z.string().optional(),icon:z.z.string().optional(),value:z.z.string().nullable(),options:z.z.array(ae)}),ce=z.z.discriminatedUnion("type",[se,le]),ue=z.z.object({provider:m.AgentProviderSchema,id:z.z.string(),label:z.z.string(),description:z.z.string().optional(),isDefault:z.z.boolean().optional(),metadata:z.z.record(z.z.string(),z.z.unknown()).optional(),contextWindowMaxTokens:z.z.number().optional(),thinkingOptions:z.z.array(ae).optional(),defaultThinkingOptionId:z.z.string().optional()}),ze=z.z.object({provider:m.AgentProviderSchema,status:oe,enabled:z.z.boolean().optional().default(!0),error:z.z.string().optional(),models:z.z.array(ue).optional(),modes:z.z.array(re).optional(),fetchedAt:z.z.string().optional(),label:z.z.string().optional(),description:z.z.string().optional(),defaultModeId:z.z.string().nullable().optional(),wireFamily:z.z.enum(["anthropic-messages","openai-compatible","generic-acp"]).optional(),compatibleProviders:z.z.array(z.z.string()).optional()}),pe=z.z.object({supportsStreaming:z.z.boolean(),supportsSessionPersistence:z.z.boolean(),supportsSessionListing:z.z.boolean().optional(),supportsDynamicModes:z.z.boolean(),supportsMcpServers:z.z.boolean(),supportsReasoningStream:z.z.boolean(),supportsToolInvocations:z.z.boolean(),supportsRewindConversation:z.z.boolean().optional().default(!1),supportsRewindFiles:z.z.boolean().optional().default(!1),supportsRewindBoth:z.z.boolean().optional().default(!1)}).catchall(z.z.boolean()),ge=z.z.object({inputTokens:z.z.number().optional(),cachedInputTokens:z.z.number().optional(),outputTokens:z.z.number().optional(),totalCostUsd:z.z.number().optional(),contextWindowMaxTokens:z.z.number().optional(),contextWindowUsedTokens:z.z.number().optional()}),be=z.z.object({type:z.z.literal("stdio"),command:z.z.string(),args:z.z.array(z.z.string()).optional(),env:z.z.record(z.z.string(),z.z.string()).optional(),alwaysLoad:z.z.boolean().optional()}),de=z.z.object({type:z.z.literal("http"),url:z.z.string(),headers:z.z.record(z.z.string(),z.z.string()).optional(),alwaysLoad:z.z.boolean().optional()}),me=z.z.object({type:z.z.literal("sse"),url:z.z.string(),headers:z.z.record(z.z.string(),z.z.string()).optional(),alwaysLoad:z.z.boolean().optional()}),fe=z.z.discriminatedUnion("type",[be,de,me]),ye=z.z.object({provider:m.AgentProviderSchema,cwd:z.z.string(),modeId:z.z.string().optional(),model:z.z.string().optional(),thinkingOptionId:z.z.string().optional(),featureValues:z.z.record(z.z.string(),z.z.unknown()).optional(),title:z.z.string().trim().min(1).max(d.MAX_EXPLICIT_AGENT_TITLE_CHARS).optional().nullable(),approvalPolicy:z.z.string().optional(),sandboxMode:z.z.string().optional(),networkAccess:z.z.boolean().optional(),webSearch:z.z.boolean().optional(),extra:z.z.object({codex:z.z.record(z.z.string(),z.z.unknown()).optional(),claude:z.z.record(z.z.string(),z.z.unknown()).optional()}).partial().optional(),systemPrompt:z.z.string().optional(),mcpServers:z.z.record(z.z.string(),fe).optional()}),he=z.z.record(z.z.string(),z.z.unknown()),je=z.z.object({id:z.z.string(),label:z.z.string(),behavior:z.z.enum(["allow","deny"]),variant:z.z.enum(["primary","secondary","danger"]).optional(),intent:z.z.enum(["implement","implement_resume","dismiss"]).optional()}),Se=z.z.discriminatedUnion("behavior",[z.z.object({behavior:z.z.literal("allow"),selectedActionId:z.z.string().optional(),updatedInput:z.z.record(z.z.string(),z.z.unknown()).optional(),updatedPermissions:z.z.array(he).optional()}),z.z.object({behavior:z.z.literal("deny"),selectedActionId:z.z.string().optional(),message:z.z.string().optional(),interrupt:z.z.boolean().optional()})]),Pe=z.z.object({id:z.z.string(),provider:m.AgentProviderSchema,name:z.z.string(),kind:z.z.enum(["tool","plan","question","mode","other"]),title:z.z.string().optional(),description:z.z.string().optional(),input:z.z.record(z.z.string(),z.z.unknown()).optional(),detail:z.z.lazy(()=>Oe).optional(),suggestions:z.z.array(he).optional(),actions:z.z.array(je).optional(),metadata:z.z.record(z.z.string(),z.z.unknown()).optional()}),_e=z.z.union([z.z.null(),z.z.boolean(),z.z.number(),z.z.string(),z.z.array(z.z.unknown()),z.z.object({}).passthrough()]),qe=z.z.union([z.z.boolean(),z.z.number(),z.z.string(),z.z.array(z.z.unknown()),z.z.object({}).passthrough()]),Ie=z.z.object({index:z.z.number().int().positive(),command:z.z.string(),cwd:z.z.string(),log:z.z.string().optional().default(""),status:z.z.enum(["running","completed","failed"]),exitCode:z.z.number().nullable(),durationMs:z.z.number().nonnegative().optional()}),ke=z.z.object({type:z.z.literal("worktree_setup"),worktreePath:z.z.string(),branchName:z.z.string(),log:z.z.string(),commands:z.z.array(Ie),truncated:z.z.boolean().optional()}),Oe=z.z.discriminatedUnion("type",[ke,z.z.object({type:z.z.literal("shell"),command:z.z.string(),cwd:z.z.string().optional(),output:z.z.string().optional(),exitCode:z.z.number().nullable().optional()}),z.z.object({type:z.z.literal("read"),filePath:z.z.string(),content:z.z.string().optional(),offset:z.z.number().optional(),limit:z.z.number().optional()}),z.z.object({type:z.z.literal("edit"),filePath:z.z.string(),oldString:z.z.string().optional(),newString:z.z.string().optional(),unifiedDiff:z.z.string().optional()}),z.z.object({type:z.z.literal("write"),filePath:z.z.string(),content:z.z.string().optional()}),z.z.object({type:z.z.literal("search"),query:z.z.string(),toolName:z.z.enum(["search","grep","glob","web_search"]).optional(),content:z.z.string().optional(),filePaths:z.z.array(z.z.string()).optional(),webResults:z.z.array(z.z.object({title:z.z.string(),url:z.z.string()})).optional(),annotations:z.z.array(z.z.string()).optional(),numFiles:z.z.number().optional(),numMatches:z.z.number().optional(),durationMs:z.z.number().optional(),durationSeconds:z.z.number().optional(),truncated:z.z.boolean().optional(),mode:z.z.enum(["content","files_with_matches","count"]).optional()}),z.z.object({type:z.z.literal("fetch"),url:z.z.string(),prompt:z.z.string().optional(),result:z.z.string().optional(),code:z.z.number().optional(),codeText:z.z.string().optional(),bytes:z.z.number().optional(),durationMs:z.z.number().optional()}),z.z.object({type:z.z.literal("sub_agent"),subAgentType:z.z.string().optional(),description:z.z.string().optional(),childSessionId:z.z.string().optional(),log:z.z.string(),actions:z.z.array(z.z.object({index:z.z.number().int().positive(),toolName:z.z.string(),summary:z.z.string().optional()})).optional()}),z.z.object({type:z.z.literal("plain_text"),label:z.z.string().optional(),text:z.z.string().optional(),icon:z.z.enum(f.TOOL_CALL_ICON_NAMES).optional()}),z.z.object({type:z.z.literal("plan"),text:z.z.string()}),z.z.object({type:z.z.literal("unknown"),input:_e,output:_e})]),Re=z.z.object({type:z.z.literal("tool_call"),callId:z.z.string(),name:z.z.string(),detail:Oe,metadata:z.z.record(z.z.string(),z.z.unknown()).optional()}),we=Re.extend({status:z.z.literal("running"),error:z.z.null()}),ve=Re.extend({status:z.z.literal("completed"),error:z.z.null()}),Ae=Re.extend({status:z.z.literal("failed"),error:qe}),Me=Re.extend({status:z.z.literal("canceled"),error:z.z.null()}),Ce=z.z.discriminatedUnion("status",[we,ve,Ae,Me]),Te=z.z.union([z.z.object({type:z.z.literal("user_message"),text:z.z.string(),messageId:z.z.string().optional()}),z.z.object({type:z.z.literal("assistant_message"),text:z.z.string(),messageId:z.z.string().optional()}),z.z.object({type:z.z.literal("reasoning"),text:z.z.string()}),Ce,z.z.object({type:z.z.literal("todo"),items:z.z.array(z.z.object({text:z.z.string(),completed:z.z.boolean()}))}),z.z.object({type:z.z.literal("error"),message:z.z.string()}),z.z.object({type:z.z.literal("compaction"),status:z.z.enum(["loading","completed"]),trigger:z.z.enum(["auto","manual"]).optional(),preTokens:z.z.number().optional()})]),xe=z.z.discriminatedUnion("type",[z.z.object({type:z.z.literal("thread_started"),sessionId:z.z.string(),provider:m.AgentProviderSchema}),z.z.object({type:z.z.literal("turn_started"),provider:m.AgentProviderSchema}),z.z.object({type:z.z.literal("turn_completed"),provider:m.AgentProviderSchema,usage:ge.optional()}),z.z.object({type:z.z.literal("turn_failed"),provider:m.AgentProviderSchema,error:z.z.string(),code:z.z.string().optional(),diagnostic:z.z.string().optional()}),z.z.object({type:z.z.literal("turn_canceled"),provider:m.AgentProviderSchema,reason:z.z.string()}),z.z.object({type:z.z.literal("timeline"),provider:m.AgentProviderSchema,item:Te}),z.z.object({type:z.z.literal("permission_requested"),provider:m.AgentProviderSchema,request:Pe}),z.z.object({type:z.z.literal("permission_resolved"),provider:m.AgentProviderSchema,requestId:z.z.string(),resolution:Se}),z.z.object({type:z.z.literal("attention_required"),provider:m.AgentProviderSchema,reason:z.z.enum(["finished","error","permission"]),timestamp:z.z.string(),shouldNotify:z.z.boolean(),notification:z.z.object({title:z.z.string(),body:z.z.string(),data:z.z.object({serverId:z.z.string(),agentId:z.z.string(),reason:z.z.enum(["finished","error","permission"])})}).optional()})]),Le=z.z.object({provider:m.AgentProviderSchema,sessionId:z.z.string(),nativeHandle:z.z.string().optional(),metadata:z.z.record(z.z.string(),z.z.unknown()).optional()}).nullable(),De=z.z.object({provider:m.AgentProviderSchema,sessionId:z.z.string().nullable(),model:z.z.string().nullable().optional(),thinkingOptionId:z.z.string().nullable().optional(),modeId:z.z.string().nullable().optional(),extra:z.z.record(z.z.string(),z.z.unknown()).optional()}),We=z.z.object({kind:z.z.enum(["pr","mr","issue","deploy","preview","doc","other"]),url:z.z.string(),label:z.z.string().optional()}),Ee=z.z.object({goal:z.z.string().optional(),nextStep:z.z.string().optional(),blockers:z.z.array(z.z.string()).optional(),links:z.z.array(We).optional(),keyFiles:z.z.array(z.z.string()).optional(),summary:z.z.string().optional(),accomplishments:z.z.array(z.z.string()).optional(),selfReportedAt:z.z.string().optional(),generatedAt:z.z.string().optional(),derivedNextStep:z.z.string().optional(),derivedBlockers:z.z.array(z.z.string()).optional(),urgency:z.z.enum(["low","normal","high"]).optional(),deadline:z.z.string().optional(),derivedDeadline:z.z.string().optional()}),Ne=z.z.object({id:z.z.string(),provider:m.AgentProviderSchema,cwd:z.z.string(),workspaceId:z.z.string().optional(),model:z.z.string().nullable(),features:z.z.array(ce).optional(),thinkingOptionId:z.z.string().nullable().optional(),effectiveThinkingOptionId:z.z.string().nullable().optional(),createdAt:z.z.string(),updatedAt:z.z.string(),lastUserMessageAt:z.z.string().nullable(),status:L,capabilities:pe,currentModeId:z.z.string().nullable(),availableModes:z.z.array(re),pendingPermissions:z.z.array(Pe),persistence:Le.nullable(),runtimeInfo:De.optional(),lastUsage:ge.optional(),lastError:z.z.string().optional(),title:z.z.string().nullable(),labels:z.z.record(z.z.string(),z.z.string()).default({}),digest:Ee.optional(),requiresAttention:z.z.boolean().optional(),attentionReason:z.z.enum(["finished","error","permission"]).nullable().optional(),attentionTimestamp:z.z.string().nullable().optional(),archivedAt:z.z.string().nullable().optional(),activeBackgroundTaskCount:z.z.number().int().nonnegative().optional(),providerUnavailable:z.z.boolean().optional()}),Ue=z.z.object({id:z.z.string(),shortId:z.z.string(),title:z.z.string().nullable(),provider:m.AgentProviderSchema,model:z.z.string().nullable(),thinkingOptionId:z.z.string().nullable().optional(),effectiveThinkingOptionId:z.z.string().nullable().optional(),status:L,cwd:z.z.string(),createdAt:z.z.string(),updatedAt:z.z.string(),lastUserMessageAt:z.z.string().nullable(),archivedAt:z.z.string().nullable().optional(),requiresAttention:z.z.boolean().optional(),attentionReason:z.z.enum(["finished","error","permission"]).nullable().optional(),attentionTimestamp:z.z.string().nullable().optional(),labels:z.z.record(z.z.string(),z.z.string()).default({}),digest:Ee.optional(),activeBackgroundTaskCount:z.z.number().int().nonnegative().optional(),providerUnavailable:z.z.boolean().optional()}),Fe=z.z.object({providerId:z.z.string(),providerLabel:z.z.string(),providerHandleId:z.z.string(),cwd:z.z.string(),title:z.z.string().nullable(),firstPromptPreview:z.z.string().nullable(),lastPromptPreview:z.z.string().nullable(),lastActivityAt:z.z.string()}),Be=z.z.object({type:z.z.literal("voice_audio_chunk"),audio:z.z.string(),format:z.z.string(),isLast:z.z.boolean()}),Ge=z.z.object({type:z.z.literal("abort_request")}),He=z.z.object({type:z.z.literal("audio_played"),id:z.z.string()}),Ke=z.z.object({labels:z.z.record(z.z.string(),z.z.string()).optional(),projectKeys:z.z.array(z.z.string()).optional(),statuses:z.z.array(L).optional(),includeArchived:z.z.boolean().optional(),requiresAttention:z.z.boolean().optional(),thinkingOptionId:z.z.string().nullable().optional()}),Ve=z.z.object({type:z.z.literal("delete_agent_request"),agentId:z.z.string(),requestId:z.z.string()}),Ye=z.z.object({type:z.z.literal("archive_agent_request"),agentId:z.z.string(),requestId:z.z.string()}),Qe=z.z.enum(["running","completed","failed","canceled"]),Xe=z.z.object({agentId:z.z.string(),agentTitle:z.z.string().nullable().optional(),taskId:z.z.string(),command:z.z.string().nullable(),description:z.z.string().nullable(),status:Qe,startedAt:z.z.string(),endedAt:z.z.string().nullable(),summary:z.z.string().nullable(),hasOutput:z.z.boolean()}),$e=z.z.object({type:z.z.literal("list_background_tasks_request"),agentId:z.z.string().optional(),requestId:z.z.string()}),Je=z.z.object({type:z.z.literal("list_background_tasks_response"),payload:z.z.object({tasks:z.z.array(Xe),requestId:z.z.string()})}),Ze=z.z.object({type:z.z.literal("background_task_output_request"),agentId:z.z.string(),taskId:z.z.string(),maxBytes:z.z.number().int().positive().optional(),requestId:z.z.string()}),et=z.z.object({type:z.z.literal("background_task_output_response"),payload:z.z.object({agentId:z.z.string(),taskId:z.z.string(),text:z.z.string().nullable(),truncated:z.z.boolean(),byteSize:z.z.number().int().nonnegative(),requestId:z.z.string()})}),tt=z.z.object({type:z.z.literal("dismiss_background_task_request"),agentId:z.z.string(),taskId:z.z.string(),requestId:z.z.string()}),nt=z.z.object({type:z.z.literal("background_task_dismissed"),payload:z.z.object({agentId:z.z.string(),taskId:z.z.string(),dismissed:z.z.boolean(),requestId:z.z.string()})}),rt=z.z.object({type:z.z.literal("close_items_request"),agentIds:z.z.array(z.z.string()).default([]),terminalIds:z.z.array(z.z.string()).default([]),requestId:z.z.string()}),ot=z.z.object({type:z.z.literal("update_agent_request"),agentId:z.z.string(),name:z.z.string().optional(),labels:z.z.record(z.z.string(),z.z.string()).optional(),requestId:z.z.string()}),at=z.z.object({type:z.z.literal("project.rename.request"),projectId:z.z.string(),customName:z.z.string().nullable(),requestId:z.z.string()}),it=z.z.object({type:z.z.literal("project.remove.request"),projectId:z.z.string(),requestId:z.z.string()}),st=z.z.object({type:z.z.literal("workspace.title.set.request"),workspaceId:z.z.string(),title:z.z.string().nullable(),requestId:z.z.string()}),lt=z.z.object({type:z.z.literal("set_voice_mode"),enabled:z.z.boolean(),agentId:z.z.string().optional(),requestId:z.z.string().optional()}),ct=z.z.object({type:z.z.literal("github_pr"),mimeType:z.z.literal("application/github-pr"),number:z.z.number().int().positive(),title:z.z.string(),url:z.z.string(),body:z.z.string().nullable().optional(),baseRefName:z.z.string().nullable().optional(),headRefName:z.z.string().nullable().optional()}),ut=z.z.object({type:z.z.literal("github_issue"),mimeType:z.z.literal("application/github-issue"),number:z.z.number().int().positive(),title:z.z.string(),url:z.z.string(),body:z.z.string().nullable().optional()}),zt=z.z.object({type:z.z.literal("text"),mimeType:z.z.literal("text/plain"),contextKind:z.z.string().optional(),title:z.z.string().nullable().optional(),text:z.z.string()}).transform(e=>{let{contextKind:t}=e,n=(0,u.default)(e,s);return Object.assign({},n,"chat_history"===t?{contextKind:t}:{})}),pt=z.z.object({oldLineNumber:z.z.number().int().positive().nullable(),newLineNumber:z.z.number().int().positive().nullable(),type:z.z.enum(["add","remove","context"]),content:z.z.string()}),gt=z.z.object({filePath:z.z.string(),side:z.z.enum(["old","new"]),lineNumber:z.z.number().int().positive(),body:z.z.string(),context:z.z.object({hunkHeader:z.z.string(),targetLine:pt,lines:z.z.array(pt)})}),bt=z.z.object({type:z.z.literal("review"),mimeType:z.z.literal("application/paseo-review"),cwd:z.z.string(),mode:z.z.enum(["uncommitted","base"]),baseRef:z.z.string().nullable().optional(),comments:z.z.array(gt)}),dt=z.z.object({type:z.z.literal("file"),name:z.z.string(),mimeType:z.z.string(),size:z.z.number().int().nonnegative(),fileId:z.z.string(),path:z.z.string()}),mt=z.z.object({type:z.z.literal("uploaded_file"),id:z.z.string(),fileName:z.z.string(),mimeType:z.z.string(),size:z.z.number().int().nonnegative(),path:z.z.string()}),ft=z.z.discriminatedUnion("type",[ct,ut,zt,bt,dt,mt]);const yt=z.z.unknown().transform(function(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){const e=ft.safeParse(n);if(e.success){t.push(e.data);continue}const r="object"==typeof n&&null!==n&&"type"in n?String(n.type):"<missing>";console.warn(`[protocol] dropping unparseable agent attachment (type: ${r}):`,e.error.issues)}return t}).optional(),ht=z.z.object({data:z.z.string(),mimeType:z.z.string()}),jt=z.z.object({type:z.z.literal("send_agent_message"),agentId:z.z.string(),text:z.z.string(),messageId:z.z.string().optional(),images:z.z.array(ht).optional(),attachments:yt}),St=z.z.object({type:z.z.literal("fetch_agents_request"),requestId:z.z.string(),scope:z.z.enum(["active"]).optional(),filter:Ke.optional(),sort:z.z.array(z.z.object({key:z.z.enum(["status_priority","created_at","updated_at","title"]),direction:z.z.enum(["asc","desc"])})).optional(),page:z.z.object({limit:z.z.number().int().positive().max(200),cursor:z.z.string().min(1).optional()}).optional(),subscribe:z.z.object({subscriptionId:z.z.string().optional()}).optional()}),Pt=z.z.enum(["needs_input","failed","running","attention","done"]),_t=z.z.object({type:z.z.literal("fetch_workspaces_request"),requestId:z.z.string(),filter:z.z.object({query:z.z.string().optional(),projectId:z.z.string().optional(),idPrefix:z.z.string().optional()}).optional(),sort:z.z.array(z.z.object({key:z.z.enum(["status_priority","activity_at","name","project_id"]),direction:z.z.enum(["asc","desc"])})).optional(),page:z.z.object({limit:z.z.number().int().positive().max(200),cursor:z.z.string().min(1).optional()}).optional(),subscribe:z.z.object({subscriptionId:z.z.string().optional()}).optional()}),qt=z.z.object({type:z.z.literal("fetch_agent_history_request"),requestId:z.z.string(),filter:Ke.optional(),sort:z.z.array(z.z.object({key:z.z.enum(["status_priority","created_at","updated_at","title"]),direction:z.z.enum(["asc","desc"])})).optional(),page:z.z.object({limit:z.z.number().int().positive().max(200),cursor:z.z.string().min(1).optional()}).optional()}),It=z.z.object({type:z.z.literal("fetch_recent_provider_sessions_request"),requestId:z.z.string(),cwd:z.z.string().optional(),providers:z.z.array(z.z.string()).optional(),since:z.z.string().optional(),limit:z.z.number().int().positive().max(200).optional()}),kt=z.z.object({type:z.z.literal("fetch_agent_request"),requestId:z.z.string(),agentId:z.z.string()}),Ot=z.z.object({type:z.z.literal("send_agent_message_request"),requestId:z.z.string(),agentId:z.z.string(),text:z.z.string(),messageId:z.z.string().optional(),images:z.z.array(ht).optional(),attachments:yt}),Rt=z.z.object({type:z.z.literal("wait_for_finish_request"),requestId:z.z.string(),agentId:z.z.string(),timeoutMs:z.z.number().int().positive().optional()}),wt=z.z.object({type:z.z.literal("daemon.get_status.request"),requestId:z.z.string()}),vt=z.z.object({type:z.z.literal("daemon.get_pairing_offer.request"),requestId:z.z.string()}),At=z.z.object({type:z.z.literal("diagnostics.request"),requestId:z.z.string()}),Mt=z.z.object({type:z.z.literal("get_daemon_config_request"),requestId:z.z.string()}),Ct=z.z.object({type:z.z.literal("set_daemon_config_request"),requestId:z.z.string(),config:x}),Tt=z.z.object({type:z.z.literal("read_project_config_request"),requestId:z.z.string(),repoRoot:z.z.string()}),xt=z.z.object({type:z.z.literal("write_project_config_request"),requestId:z.z.string(),repoRoot:z.z.string(),config:I.PaseoConfigRawSchema,expectedRevision:I.PaseoConfigRevisionSchema.nullable()}),Lt=z.z.object({type:z.z.literal("dictation_stream_start"),dictationId:z.z.string(),format:z.z.string()}),Dt=z.z.object({type:z.z.literal("dictation_stream_chunk"),dictationId:z.z.string(),seq:z.z.number().int().nonnegative(),audio:z.z.string(),format:z.z.string()}),Wt=z.z.object({type:z.z.literal("dictation_stream_finish"),dictationId:z.z.string(),finalSeq:z.z.number().int().nonnegative()}),Et=z.z.object({type:z.z.literal("dictation_stream_cancel"),dictationId:z.z.string()}),Nt=z.z.object({baseBranch:z.z.string().optional(),createNewBranch:z.z.boolean().optional(),newBranchName:z.z.string().optional(),createWorktree:z.z.boolean().optional(),worktreeSlug:z.z.string().optional(),refName:z.z.string().min(1).optional(),action:z.z.enum(["branch-off","checkout"]).optional(),githubPrNumber:z.z.number().int().positive().optional()}),Ut=z.z.discriminatedUnion("mode",[z.z.object({mode:z.z.literal("branch-off"),newBranch:z.z.string().min(1),base:z.z.string().min(1).optional()}),z.z.object({mode:z.z.literal("checkout-branch"),branch:z.z.string().min(1)}),z.z.object({mode:z.z.literal("checkout-pr"),prNumber:z.z.number().int().positive()})]),Ft=z.z.object({type:z.z.literal("create_agent_request"),config:ye,env:z.z.record(z.z.string(),z.z.string()).optional(),workspaceId:z.z.string().optional(),worktreeName:z.z.string().optional(),initialPrompt:z.z.string().optional(),clientMessageId:z.z.string().optional(),outputSchema:z.z.record(z.z.string(),z.z.unknown()).optional(),images:z.z.array(ht).optional(),attachments:yt,git:Nt.optional(),worktree:Ut.optional(),autoArchive:z.z.boolean().optional(),labels:z.z.record(z.z.string(),z.z.string()).default({}),resumeSessionId:z.z.string().min(1).optional(),requestId:z.z.string()}),Bt=z.z.object({type:z.z.literal("list_provider_models_request"),provider:m.AgentProviderSchema,cwd:z.z.string().optional(),requestId:z.z.string()}),Gt=z.z.object({type:z.z.literal("list_provider_modes_request"),provider:m.AgentProviderSchema,cwd:z.z.string().optional(),requestId:z.z.string()}),Ht=z.z.object({type:z.z.literal("list_available_providers_request"),requestId:z.z.string()}),Kt=z.z.object({type:z.z.literal("get_providers_snapshot_request"),cwd:z.z.string().optional(),requestId:z.z.string()}),Vt=z.z.object({type:z.z.literal("providers.reload_config.request"),requestId:z.z.string()}),Yt=z.z.object({type:z.z.literal("refresh_providers_snapshot_request"),cwd:z.z.string().optional(),providers:z.z.array(m.AgentProviderSchema).optional(),requestId:z.z.string()}),Qt=z.z.object({type:z.z.literal("provider_diagnostic_request"),provider:m.AgentProviderSchema,requestId:z.z.string()}),Xt=z.z.object({type:z.z.literal("provider.usage.list.request"),requestId:z.z.string()}),$t=z.z.object({type:z.z.literal("resume_agent_request"),handle:Le,overrides:ye.partial().optional(),requestId:z.z.string()}),Jt=z.z.object({type:z.z.literal("import_agent_request"),provider:m.AgentProviderSchema.optional(),providerId:z.z.string().optional(),sessionId:z.z.string().optional(),providerHandleId:z.z.string().optional(),cwd:z.z.string().optional(),labels:z.z.record(z.z.string(),z.z.string()).optional(),requestId:z.z.string()}),Zt=z.z.object({type:z.z.literal("refresh_agent_request"),agentId:z.z.string(),requestId:z.z.string()}),en=z.z.object({type:z.z.literal("cancel_agent_request"),agentId:z.z.string(),requestId:z.z.string().optional()}),tn=z.z.object({type:z.z.literal("restart_server_request"),reason:z.z.string().optional(),requestId:z.z.string()}),nn=z.z.object({type:z.z.literal("shutdown_server_request"),requestId:z.z.string()}),rn=z.z.object({type:z.z.literal("daemon.update.request"),requestId:z.z.string()}),on=z.z.object({epoch:z.z.string(),seq:z.z.number().int().nonnegative()}),an=z.z.object({type:z.z.literal("fetch_agent_timeline_request"),agentId:z.z.string(),requestId:z.z.string(),direction:z.z.enum(["tail","before","after"]).optional(),cursor:on.optional(),limit:z.z.number().int().nonnegative().optional(),projection:z.z.enum(["projected","canonical"]).optional()}),sn=z.z.object({type:z.z.literal("agent.fork_context.request"),agentId:z.z.string(),boundaryMessageId:z.z.string().optional(),requestId:z.z.string()}),ln=z.z.object({type:z.z.literal("set_agent_mode_request"),agentId:z.z.string(),modeId:z.z.string(),requestId:z.z.string()}),cn=z.z.object({requestId:z.z.string(),agentId:z.z.string(),accepted:z.z.boolean(),error:z.z.string().nullable(),notice:ie.nullable().optional()}),un=z.z.object({type:z.z.literal("set_agent_mode_response"),payload:cn}),zn=z.z.object({type:z.z.literal("set_agent_model_request"),agentId:z.z.string(),modelId:z.z.string().nullable(),requestId:z.z.string()}),pn=z.z.object({type:z.z.literal("set_agent_model_response"),payload:cn}),gn=z.z.object({type:z.z.literal("swap_agent_provider_request"),requestId:z.z.string(),agentId:z.z.string(),newProviderId:z.z.string(),overrides:z.z.object({model:z.z.string().nullable().optional(),modeId:z.z.string().optional()}).optional()}),bn=z.z.object({type:z.z.literal("swap_agent_provider_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),accepted:z.z.boolean(),error:z.z.string().nullable(),oldProvider:z.z.string().optional(),newProvider:z.z.string().optional()})}),dn=z.z.object({type:z.z.literal("agent_provider_swapped"),payload:z.z.object({agentId:z.z.string(),oldProvider:z.z.string(),newProvider:z.z.string(),timestamp:z.z.string()})}),mn=z.z.object({type:z.z.literal("set_agent_thinking_request"),agentId:z.z.string(),thinkingOptionId:z.z.string().nullable(),requestId:z.z.string()}),fn=z.z.object({type:z.z.literal("set_agent_thinking_response"),payload:cn}),yn=z.z.object({type:z.z.literal("set_agent_feature_request"),agentId:z.z.string(),featureId:z.z.string(),value:z.z.unknown(),requestId:z.z.string()}),hn=z.z.object({type:z.z.literal("set_agent_feature_response"),payload:cn}),jn=z.z.object({type:z.z.literal("agent.detach.request"),agentId:z.z.string(),requestId:z.z.string()}),Sn=z.z.object({type:z.z.literal("agent.detach.response"),payload:cn}),Pn=z.z.enum(["conversation","files","both"]),_n=z.z.object({type:z.z.literal("agent.rewind.request"),agentId:z.z.string(),messageId:z.z.string(),mode:Pn,requestId:z.z.string()}),qn=z.z.object({type:z.z.literal("agent.rewind.response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),ok:z.z.boolean(),error:z.z.string().nullable()})}),In=z.z.object({type:z.z.literal("update_agent_response"),payload:cn}),kn=z.z.object({requestId:z.z.string(),projectId:z.z.string(),accepted:z.z.boolean(),customName:z.z.string().nullable(),error:z.z.string().nullable()}),On=z.z.object({type:z.z.literal("project.rename.response"),payload:kn}),Rn=z.z.object({requestId:z.z.string(),projectId:z.z.string(),accepted:z.z.boolean(),removedWorkspaceIds:z.z.array(z.z.string()).default([]),error:z.z.string().nullable()}),wn=z.z.object({type:z.z.literal("project.remove.response"),payload:Rn}),vn=z.z.object({requestId:z.z.string(),workspaceId:z.z.string(),accepted:z.z.boolean(),title:z.z.string().nullable(),error:z.z.string().nullable()}),An=z.z.object({type:z.z.literal("workspace.title.set.response"),payload:vn}),Mn=z.z.object({type:z.z.literal("set_voice_mode_response"),payload:z.z.object({requestId:z.z.string(),enabled:z.z.boolean(),agentId:z.z.string().nullable(),accepted:z.z.boolean(),error:z.z.string().nullable(),reasonCode:z.z.string().optional(),retryable:z.z.boolean().optional(),missingModelIds:z.z.array(z.z.string()).optional()})}),Cn=z.z.object({type:z.z.literal("agent_permission_response"),agentId:z.z.string(),requestId:z.z.string(),response:Se}),Tn=z.z.object({type:z.z.literal("watch.notificationAction"),notificationId:z.z.string(),action:z.z.enum(["approve","deny","reply"]),replyText:z.z.string().optional()}),xn=z.z.object({type:z.z.literal("watch.sessionSearch"),requestId:z.z.string(),query:z.z.string()}),Ln=z.z.object({type:z.z.literal("watch.composerDictate"),sessionId:z.z.string(),text:z.z.string()}),Dn=z.z.enum(["NOT_GIT_REPO","NOT_ALLOWED","MERGE_CONFLICT","UNKNOWN"]),Wn=z.z.object({code:Dn,message:z.z.string()}),En=z.z.object({mode:z.z.enum(["uncommitted","base"]),baseRef:z.z.string().optional(),ignoreWhitespace:z.z.boolean().optional()}),Nn=z.z.object({type:z.z.literal("checkout_status_request"),cwd:z.z.string(),requestId:z.z.string()}),Un=z.z.object({type:z.z.literal("subscribe_checkout_diff_request"),subscriptionId:z.z.string(),cwd:z.z.string(),compare:En,requestId:z.z.string()}),Fn=z.z.object({type:z.z.literal("unsubscribe_checkout_diff_request"),subscriptionId:z.z.string()}),Bn=z.z.object({type:z.z.literal("checkout_commit_request"),cwd:z.z.string(),message:z.z.string().optional(),addAll:z.z.boolean().optional(),requestId:z.z.string()}),Gn=z.z.object({type:z.z.literal("checkout_merge_request"),cwd:z.z.string(),baseRef:z.z.string().optional(),strategy:z.z.enum(["merge","squash"]).optional(),requireCleanTarget:z.z.boolean().optional(),requestId:z.z.string()}),Hn=z.z.object({type:z.z.literal("checkout_merge_from_base_request"),cwd:z.z.string(),baseRef:z.z.string().optional(),requireCleanTarget:z.z.boolean().optional(),requestId:z.z.string()}),Kn=z.z.object({type:z.z.literal("checkout_pull_request"),cwd:z.z.string(),requestId:z.z.string()}),Vn=z.z.object({type:z.z.literal("checkout_push_request"),cwd:z.z.string(),requestId:z.z.string()}),Yn=z.z.object({type:z.z.literal("checkout.refresh.request"),cwd:z.z.string(),requestId:z.z.string()}),Qn=z.z.object({type:z.z.literal("checkout_pr_create_request"),cwd:z.z.string(),title:z.z.string().optional(),body:z.z.string().optional(),baseRef:z.z.string().optional(),requestId:z.z.string()}),Xn=z.z.object({type:z.z.literal("checkout_pr_merge_request"),cwd:z.z.string(),mergeMethod:z.z.enum(["merge","squash","rebase"]),requestId:z.z.string()}),$n=z.z.object({type:z.z.literal("checkout.github.set_auto_merge.request"),cwd:z.z.string(),enabled:z.z.boolean(),mergeMethod:z.z.enum(["merge","squash","rebase"]).optional(),requestId:z.z.string()}),Jn=z.z.enum(["too_large","checksum_mismatch","aborted","write_failed","unsupported"]),Zn=z.z.object({type:z.z.literal("files.upload.begin.request"),requestId:z.z.string(),agentId:z.z.string(),uploadId:z.z.string(),metadata:z.z.lazy(()=>y.FileBeginMetadataSchema)}),er=z.z.object({type:z.z.literal("files.upload.complete.request"),requestId:z.z.string(),uploadId:z.z.string(),totalChunks:z.z.number().int().nonnegative()}),tr=z.z.object({type:z.z.literal("files.upload.chunk"),payload:z.z.object({requestId:z.z.string(),uploadId:z.z.string(),chunkIndex:z.z.number().int().nonnegative(),data:z.z.string()})}),nr=z.z.object({type:z.z.literal("files.upload.error"),payload:z.z.object({requestId:z.z.string(),uploadId:z.z.string(),code:Jn,message:z.z.string().optional()})}),rr=z.z.string().regex(/^[A-Za-z0-9._-]+$/),or=z.z.object({type:z.z.literal("checkout.github.get_check_details.request"),cwd:z.z.string(),repoOwner:rr,repoName:rr,checkRunId:z.z.number().int().positive(),workflowRunId:z.z.number().int().positive().optional(),requestId:z.z.string()}),ar=z.z.object({type:z.z.literal("checkout_pr_status_request"),cwd:z.z.string(),requestId:z.z.string()}),ir=z.z.object({type:z.z.literal("pull_request_timeline_request"),cwd:z.z.string(),prNumber:z.z.number(),repoOwner:z.z.string(),repoName:z.z.string(),requestId:z.z.string()}),sr=z.z.object({type:z.z.literal("validate_branch_request"),cwd:z.z.string(),branchName:z.z.string(),requestId:z.z.string()}),lr=z.z.object({type:z.z.literal("checkout_switch_branch_request"),cwd:z.z.string(),branch:z.z.string(),requestId:z.z.string()}),cr=z.z.object({type:z.z.literal("checkout.rename_branch.request"),cwd:z.z.string(),branch:z.z.string(),requestId:z.z.string()}),ur=z.z.object({type:z.z.literal("stash_save_request"),cwd:z.z.string(),branch:z.z.string().optional(),requestId:z.z.string()}),zr=z.z.object({type:z.z.literal("stash_pop_request"),cwd:z.z.string(),stashIndex:z.z.number().int().min(0),requestId:z.z.string()}),pr=z.z.object({type:z.z.literal("stash_list_request"),cwd:z.z.string(),paseoOnly:z.z.boolean().optional(),requestId:z.z.string()}),gr=z.z.object({type:z.z.literal("branch_suggestions_request"),cwd:z.z.string(),query:z.z.string().optional(),limit:z.z.number().int().min(1).max(200).optional(),requestId:z.z.string()}),br=z.z.object({kind:z.z.enum(["issue","pr"]),number:z.z.number(),title:z.z.string(),url:z.z.string(),state:z.z.string(),body:z.z.string().nullable(),labels:z.z.array(z.z.string()),baseRefName:z.z.string().nullable().optional(),headRefName:z.z.string().nullable().optional(),updatedAt:z.z.string().optional()}),dr=z.z.enum(["github-issue","github-pr"]),mr=z.z.object({type:z.z.literal("github_search_request"),cwd:z.z.string(),query:z.z.string(),limit:z.z.number().int().min(1).max(50).optional(),kinds:z.z.array(dr).optional(),requestId:z.z.string()}),fr=z.z.object({type:z.z.literal("directory_suggestions_request"),query:z.z.string(),cwd:z.z.string().optional(),includeFiles:z.z.boolean().optional(),includeDirectories:z.z.boolean().optional(),matchMode:z.z.enum(["fuzzy","suffix"]).optional(),limit:z.z.number().int().min(1).max(100).optional(),requestId:z.z.string()}),yr=z.z.object({type:z.z.literal("paseo_worktree_list_request"),cwd:z.z.string().optional(),repoRoot:z.z.string().optional(),requestId:z.z.string()}),hr=z.z.object({type:z.z.literal("paseo_worktree_archive_request"),worktreePath:z.z.string().optional(),repoRoot:z.z.string().optional(),branchName:z.z.string().optional(),workspaceId:z.z.string().optional(),scope:z.z.enum(["workspace","worktree"]).optional().default("workspace"),deleteWorktreeFromDisk:z.z.boolean().optional().default(!1),requestId:z.z.string()}),jr=z.z.object({prompt:z.z.string().optional(),attachments:yt}),Sr=z.z.object({type:z.z.literal("create_paseo_worktree_request"),cwd:z.z.string(),projectId:z.z.string().optional(),worktreeSlug:z.z.string().optional(),nameContext:z.z.string().optional(),attachments:yt.optional(),firstAgentContext:jr.optional(),refName:z.z.string().min(1).optional(),action:z.z.enum(["branch-off","checkout"]).optional(),githubPrNumber:z.z.number().int().positive().optional(),requestId:z.z.string()}),Pr=z.z.object({type:z.z.literal("workspace_setup_status_request"),workspaceId:z.z.string(),requestId:z.z.string()}),_r=["cursor","vscode","zed","finder","explorer","file-manager"],qr=[..._r,"webstorm"],Ir=z.z.enum(qr),kr=z.z.enum(_r),Or=z.z.string().trim().min(1),Rr=new Set(qr),wr=new Set(_r);const vr=z.z.object({id:Or,label:z.z.string()}),Ar=z.z.object({type:z.z.literal("list_available_editors_request"),requestId:z.z.string()}),Mr=z.z.object({type:z.z.literal("open_in_editor_request"),path:z.z.string(),editorId:z.z.string().trim().min(1),mode:z.z.enum(["open","reveal"]).optional(),cwd:z.z.string().optional(),requestId:z.z.string()}),Cr=z.z.object({type:z.z.literal("open_project_request"),cwd:z.z.string(),requestId:z.z.string()}),Tr=z.z.object({type:z.z.literal("project.add.request"),cwd:z.z.string(),requestId:z.z.string()}),xr=z.z.object({type:z.z.literal("archive_workspace_request"),workspaceId:z.z.string(),requestId:z.z.string()}),Lr=z.z.object({type:z.z.literal("workspace.create.request"),requestId:z.z.string(),title:z.z.string().optional(),firstAgentContext:jr.optional(),source:z.z.discriminatedUnion("kind",[z.z.object({kind:z.z.literal("directory"),path:z.z.string(),projectId:z.z.string().optional()}),z.z.object({kind:z.z.literal("worktree"),cwd:z.z.string().optional(),projectId:z.z.string().optional(),action:z.z.enum(["branch-off","checkout"]).optional(),refName:z.z.string().min(1).optional(),baseBranch:z.z.string().optional(),githubPrNumber:z.z.number().int().positive().optional(),worktreeSlug:z.z.string().optional()})])}),Dr=z.z.object({type:z.z.literal("workspace.clear_attention.request"),workspaceId:z.z.union([z.z.string(),z.z.array(z.z.string())]),requestId:z.z.string()}),Wr=z.z.object({text:z.z.string(),style:z.z.string().nullable()}),Er=z.z.object({type:z.z.enum(["add","remove","context","header"]),content:z.z.string(),tokens:z.z.array(Wr).optional()}),Nr=z.z.object({oldStart:z.z.number(),oldCount:z.z.number(),newStart:z.z.number(),newCount:z.z.number(),lines:z.z.array(Er)}),Ur=z.z.object({path:z.z.string(),isNew:z.z.boolean(),isDeleted:z.z.boolean(),additions:z.z.number(),deletions:z.z.number(),hunks:z.z.array(Nr),status:z.z.enum(["ok","too_large","binary"]).optional()}),Fr=z.z.object({name:z.z.string(),path:z.z.string(),kind:z.z.enum(["file","directory"]),size:z.z.number(),modifiedAt:z.z.string()}),Br=z.z.object({path:z.z.string(),kind:z.z.enum(["text","image","binary"]),encoding:z.z.enum(["utf-8","base64","none"]),content:z.z.string().optional(),mimeType:z.z.string().optional(),size:z.z.number(),modifiedAt:z.z.string()}),Gr=z.z.object({path:z.z.string(),entries:z.z.array(Fr)}),Hr=z.z.object({type:z.z.literal("file_explorer_request"),cwd:z.z.string(),path:z.z.string().optional(),mode:z.z.enum(["list","file"]),requestId:z.z.string(),acceptBinary:z.z.boolean().optional()}),Kr=z.z.object({type:z.z.literal("project_icon_request"),cwd:z.z.string(),requestId:z.z.string()}),Vr=z.z.object({type:z.z.literal("file_download_token_request"),cwd:z.z.string(),path:z.z.string(),requestId:z.z.string()}),Yr=z.z.object({type:z.z.literal("file.upload.request"),fileName:z.z.string().min(1),mimeType:z.z.string().min(1),size:z.z.number().int().nonnegative(),modifiedAt:z.z.string(),requestId:z.z.string()}),Qr=z.z.object({type:z.z.literal("clear_agent_attention"),agentId:z.z.union([z.z.string(),z.z.array(z.z.string())]),requestId:z.z.string().optional()}),Xr=z.z.object({type:z.z.literal("client_heartbeat"),deviceType:z.z.enum(["web","mobile"]),focusedAgentId:z.z.string().nullable(),focusedTerminalId:z.z.string().nullable().optional().default(null),lastActivityAt:z.z.string(),appVisible:z.z.boolean(),appVisibilityChangedAt:z.z.string().optional()}),$r=z.z.object({type:z.z.literal("ping"),requestId:z.z.string(),clientSentAt:z.z.number().int().optional()}),Jr=z.z.object({provider:m.AgentProviderSchema,cwd:z.z.string(),modeId:z.z.string().optional(),model:z.z.string().optional(),thinkingOptionId:z.z.string().optional(),featureValues:z.z.record(z.z.string(),z.z.unknown()).optional()}),Zr=z.z.object({type:z.z.literal("list_provider_features_request"),draftConfig:Jr,requestId:z.z.string()}),eo=z.z.object({type:z.z.literal("list_commands_request"),agentId:z.z.string(),draftConfig:Jr.optional(),requestId:z.z.string()}),to=z.z.object({type:z.z.literal("register_push_token"),token:z.z.string()}),no=z.z.object({type:z.z.literal("rewind_session_request"),requestId:z.z.string(),agentId:z.z.string(),turnId:z.z.string()}),ro=z.z.object({type:z.z.literal("rewind_session_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),newSessionId:z.z.string().optional(),linesCopied:z.z.number().int().nonnegative().optional(),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),oo=z.z.object({type:z.z.literal("edit_message_request"),requestId:z.z.string(),agentId:z.z.string(),turnId:z.z.string(),newContent:z.z.string().optional()}),ao=z.z.object({type:z.z.literal("edit_message_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),newSessionId:z.z.string().optional(),linesCopied:z.z.number().int().nonnegative().optional(),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),io=z.z.object({type:z.z.literal("list_workspace_sessions_request"),requestId:z.z.string(),workspaceId:z.z.string()}),so=z.z.object({sid:z.z.string(),title:z.z.string().nullable(),lastActivity:z.z.string(),cwd:z.z.string(),agentName:z.z.string().nullable()}),lo=z.z.object({type:z.z.literal("list_workspace_sessions_response"),payload:z.z.object({requestId:z.z.string(),workspaceId:z.z.string(),sessions:z.z.array(so),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),co=z.z.object({type:z.z.literal("list_all_sessions_request"),requestId:z.z.string()}),uo=z.z.object({sid:z.z.string(),title:z.z.string().nullable(),lastActivity:z.z.string(),cwd:z.z.string(),agentName:z.z.string().nullable()}),zo=z.z.object({type:z.z.literal("list_all_sessions_response"),payload:z.z.object({requestId:z.z.string(),sessions:z.z.array(uo),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),po=z.z.object({id:z.z.string(),title:z.z.string(),icon:z.z.string().optional()}),go=z.z.object({id:z.z.string(),title:z.z.string(),icon:z.z.string().optional(),command:z.z.string().optional(),view:z.z.string().optional(),order:z.z.number().optional()}),bo=z.z.object({id:z.z.string(),title:z.z.string(),location:z.z.enum(["sidebar","panel"]).optional(),ui:z.z.string(),uiUrl:z.z.string().optional()}),mo=z.z.object({id:z.z.string(),name:z.z.string(),version:z.z.string(),commands:z.z.array(po),sidebarItems:z.z.array(go),views:z.z.array(bo)}),fo=z.z.object({type:z.z.literal("extensions.list.request"),requestId:z.z.string()}),yo=z.z.object({type:z.z.literal("extensions.list.response"),payload:z.z.object({requestId:z.z.string(),extensions:z.z.array(mo),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),ho=z.z.object({type:z.z.literal("extensions.command.execute.request"),requestId:z.z.string(),commandId:z.z.string(),args:z.z.array(z.z.unknown()).optional()}),jo=z.z.object({type:z.z.literal("extensions.command.execute.response"),payload:z.z.object({requestId:z.z.string(),ok:z.z.boolean(),result:z.z.unknown().optional(),error:z.z.string().optional()})}),So=z.z.object({type:z.z.literal("search_sessions_request"),requestId:z.z.string(),query:z.z.string(),limit:z.z.number().int().positive().optional(),sources:z.z.array(z.z.string()).optional()}),Po=z.z.object({sid:z.z.string(),source:z.z.string(),cwd:z.z.string(),timestamp:z.z.string(),snippet:z.z.string(),resumeCommand:z.z.string()}),_o=z.z.object({type:z.z.literal("search_sessions_response"),payload:z.z.object({requestId:z.z.string(),query:z.z.string(),results:z.z.array(Po),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),qo=z.z.object({endpoint:z.z.string(),keys:z.z.object({p256dh:z.z.string(),auth:z.z.string()}),expirationTime:z.z.union([z.z.number(),z.z.null()]).optional()}),Io=z.z.discriminatedUnion("type",[z.z.object({type:z.z.literal("expo"),token:z.z.string().min(1)}),z.z.object({type:z.z.literal("web"),subscription:qo})]),ko=z.z.object({type:z.z.literal("subscribe_push_request"),requestId:z.z.string(),subscription:Io}),Oo=z.z.object({type:z.z.literal("subscribe_push_response"),payload:z.z.object({requestId:z.z.string(),ok:z.z.boolean(),error:z.z.string().optional(),errorCode:z.z.string().optional(),vapidPublicKey:z.z.string().optional()})}),Ro=z.z.object({type:z.z.literal("get_vapid_public_key_request"),requestId:z.z.string()}),wo=z.z.object({type:z.z.literal("get_vapid_public_key_response"),payload:z.z.object({requestId:z.z.string(),publicKey:z.z.string().nullable(),error:z.z.string().optional()})}),vo=z.z.object({type:z.z.literal("list_terminals_request"),cwd:z.z.string().optional(),workspaceId:z.z.string().optional(),requestId:z.z.string()}),Ao=z.z.object({type:z.z.literal("subscribe_terminals_request"),cwd:z.z.string(),workspaceId:z.z.string().optional()}),Mo=z.z.object({type:z.z.literal("unsubscribe_terminals_request"),cwd:z.z.string(),workspaceId:z.z.string().optional()}),Co=z.z.object({type:z.z.literal("create_terminal_request"),cwd:z.z.string(),workspaceId:z.z.string().optional(),name:z.z.string().optional(),agentId:z.z.string().optional(),command:z.z.string().optional(),args:z.z.array(z.z.string()).optional(),requestId:z.z.string()}),To=z.z.object({type:z.z.literal("terminal.rename.request"),terminalId:z.z.string(),title:z.z.string(),requestId:z.z.string()}),xo=z.z.object({type:z.z.literal("start_workspace_script_request"),workspaceId:z.z.string(),scriptName:z.z.string(),requestId:z.z.string()}),Lo=z.z.object({type:z.z.literal("subscribe_terminal_request"),terminalId:z.z.string(),requestId:z.z.string(),restore:z.z.object({mode:z.z.enum(["live","visible-snapshot","full-snapshot"]),scrollbackLines:z.z.number().int().nonnegative().optional(),size:z.z.object({rows:z.z.number().int().positive(),cols:z.z.number().int().positive()}).optional()}).optional()}),Do=z.z.object({type:z.z.literal("unsubscribe_terminal_request"),terminalId:z.z.string()}),Wo=z.z.discriminatedUnion("type",[z.z.object({type:z.z.literal("input"),data:z.z.string()}),z.z.object({type:z.z.literal("resize"),rows:z.z.number(),cols:z.z.number()}),z.z.object({type:z.z.literal("mouse"),row:z.z.number(),col:z.z.number(),button:z.z.number(),action:z.z.enum(["down","up","move"])})]),Eo=z.z.object({type:z.z.literal("terminal_input"),terminalId:z.z.string(),message:Wo}),No=z.z.object({type:z.z.literal("kill_terminal_request"),terminalId:z.z.string(),requestId:z.z.string()}),Uo=z.z.object({type:z.z.literal("capture_terminal_request"),terminalId:z.z.string(),start:z.z.number().int().optional(),end:z.z.number().int().optional(),stripAnsi:z.z.boolean().default(!0),requestId:z.z.string()}),Fo=z.z.discriminatedUnion("type",[_.BrowserAutomationExecuteResponseSchema,Be,Ge,He,St,qt,It,_t,kt,Ve,Ye,tt,$e,Ze,rt,ot,at,it,st,lt,Ot,Rt,wt,vt,H,V,Q,$,te,At,Mt,Ct,Tt,xt,Lt,Dt,Wt,Et,Ft,Bt,Gt,Zr,Ht,Kt,Vt,Yt,Qt,Xt,$t,Jt,Zt,en,nn,tn,rn,an,sn,ln,zn,gn,mn,yn,jn,_n,Cn,Nn,Un,Fn,Bn,Gn,Hn,Kn,Vn,Yn,Qn,Xn,$n,Zn,er,tr,nr,or,ar,ir,lr,cr,ur,zr,pr,sr,gr,mr,fr,yr,hr,Sr,Pr,Ar,Mr,Cr,Tr,xr,Lr,Dr,Hr,Kr,Vr,Yr,Qr,Xr,$r,eo,to,no,oo,io,co,fo,ho,So,ko,Ro,vo,Ao,Mo,Co,To,xo,Lo,Do,Eo,No,Uo,h.ChatCreateRequestSchema,h.ChatListRequestSchema,h.ChatInspectRequestSchema,h.ChatDeleteRequestSchema,h.ChatPostRequestSchema,h.ChatReadRequestSchema,h.ChatWaitRequestSchema,j.ScheduleCreateRequestSchema,j.ScheduleListRequestSchema,j.ScheduleInspectRequestSchema,j.ScheduleLogsRequestSchema,j.SchedulePauseRequestSchema,j.ScheduleResumeRequestSchema,j.ScheduleDeleteRequestSchema,j.ScheduleRunOnceRequestSchema,j.ScheduleUpdateRequestSchema,S.LoopRunRequestSchema,S.LoopListRequestSchema,S.LoopInspectRequestSchema,S.LoopLogsRequestSchema,S.LoopStopRequestSchema,P.FleetListRequestSchema,P.FleetInspectRequestSchema,P.FleetRunNowRequestSchema,P.FleetPauseRequestSchema,P.FleetResumeRequestSchema,P.FleetSetModeRequestSchema,P.FleetAskRequestSchema,P.FleetDecisionsRequestSchema,P.FleetResolveDecisionRequestSchema,P.FleetSetParamsRequestSchema,P.FleetCreateRequestSchema,P.FleetExecutionsRequestSchema,Tn,xn,Ln]),Bo=z.z.object({id:z.z.string(),timestamp:z.z.coerce.date(),type:z.z.enum(["transcript","assistant","tool_call","tool_result","error","system"]),content:z.z.string(),metadata:z.z.record(z.z.string(),z.z.unknown()).optional()}),Go=z.z.object({type:z.z.literal("activity_log"),payload:Bo}),Ho=z.z.object({type:z.z.literal("assistant_chunk"),payload:z.z.object({chunk:z.z.string()})}),Ko=z.z.object({type:z.z.literal("audio_output"),payload:z.z.object({audio:z.z.string(),format:z.z.string(),id:z.z.string(),isVoiceMode:z.z.boolean(),groupId:z.z.string().optional(),chunkIndex:z.z.number().int().nonnegative().optional(),isLastChunk:z.z.boolean().optional()})}),Vo=z.z.object({type:z.z.literal("transcription_result"),payload:z.z.object({text:z.z.string(),language:z.z.string().optional(),duration:z.z.number().optional(),requestId:z.z.string(),avgLogprob:z.z.number().optional(),isLowConfidence:z.z.boolean().optional(),byteLength:z.z.number().optional(),format:z.z.string().optional(),debugRecordingPath:z.z.string().optional()})}),Yo=z.z.object({type:z.z.literal("voice_input_state"),payload:z.z.object({isSpeaking:z.z.boolean()})}),Qo=z.z.object({type:z.z.literal("dictation_stream_ack"),payload:z.z.object({dictationId:z.z.string(),ackSeq:z.z.number().int()})}),Xo=z.z.object({type:z.z.literal("dictation_stream_finish_accepted"),payload:z.z.object({dictationId:z.z.string(),timeoutMs:z.z.number().int().positive()})}),$o=z.z.object({type:z.z.literal("dictation_stream_partial"),payload:z.z.object({dictationId:z.z.string(),text:z.z.string()})}),Jo=z.z.object({type:z.z.literal("dictation_stream_final"),payload:z.z.object({dictationId:z.z.string(),text:z.z.string(),debugRecordingPath:z.z.string().optional()})}),Zo=z.z.object({type:z.z.literal("dictation_stream_error"),payload:z.z.object({dictationId:z.z.string(),error:z.z.string(),retryable:z.z.boolean(),reasonCode:z.z.string().optional(),missingModelIds:z.z.array(z.z.string()).optional(),debugRecordingPath:z.z.string().optional()})}),ea=z.z.object({enabled:z.z.boolean(),reason:z.z.string()}),ta=z.z.object({dictation:ea,voice:ea}),na=z.z.object({voice:ta.optional()}).passthrough(),ra=z.z.unknown().transform(e=>{if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null}),oa=z.z.unknown().transform(e=>{if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null}),aa=z.z.unknown().optional().transform(e=>{if(void 0===e)return;const t=na.safeParse(e);return t.success?t.data:void 0}),ia=z.z.object({status:z.z.literal("server_info"),serverId:z.z.string().trim().min(1),hostname:ra.optional(),version:oa.optional(),capabilities:aa.optional(),features:z.z.object({providersSnapshot:z.z.boolean().optional(),checkoutGithubSetAutoMerge:z.z.boolean().optional(),githubCheckDetails:z.z.boolean().optional(),daemonStatusRpc:z.z.boolean().optional(),"terminal-restore-modes":z.z.boolean().optional(),rewind:z.z.boolean().optional(),checkoutRefresh:z.z.boolean().optional(),recallSearch:z.z.boolean().optional(),fileUploads:z.z.boolean().optional(),sessionsListRpc:z.z.boolean().optional(),loopDecisions:z.z.boolean().optional(),workflows:z.z.boolean().optional(),extensions:z.z.boolean().optional(),sessionDigest:z.z.boolean().optional(),workspaceMultiplicity:z.z.boolean().optional(),projectRemove:z.z.boolean().optional(),projectAdd:z.z.boolean().optional(),worktreeRestore:z.z.boolean().optional(),providerUsageList:z.z.boolean().optional(),agentDetach:z.z.boolean().optional(),daemonDiagnostics:z.z.boolean().optional(),daemonSelfUpdate:z.z.boolean().optional(),agentForkContext:z.z.boolean().optional(),meetingsLiveCapture:z.z.boolean().optional(),kanbanBoardConfig:z.z.boolean().optional()}).optional()}).passthrough().transform(e=>Object.assign({},e,{hostname:e.hostname??null,version:e.version??null})),sa=z.z.object({type:z.z.literal("status"),payload:z.z.object({status:z.z.string()}).passthrough()}),la=z.z.object({type:z.z.literal("pong"),payload:z.z.object({requestId:z.z.string(),clientSentAt:z.z.number().int().optional(),serverReceivedAt:z.z.number().int(),serverSentAt:z.z.number().int()})}),ca=z.z.object({type:z.z.literal("rpc_error"),payload:z.z.object({requestId:z.z.string(),requestType:z.z.string().optional(),error:z.z.string(),code:z.z.string().optional()})}),ua=z.z.object({agentId:z.z.string(),requestId:z.z.string()}),za=ua.extend({timelineSize:z.z.number().optional()}),pa=z.z.object({status:z.z.literal("agent_created"),agent:Ne}).extend(ua.shape),ga=z.z.object({status:z.z.literal("agent_create_failed"),requestId:z.z.string(),error:z.z.string(),errorCode:z.z.string().optional()}),ba=z.z.object({status:z.z.literal("agent_resumed"),agent:Ne}).extend(za.shape),da=z.z.object({status:z.z.literal("agent_refreshed")}).extend(za.shape),ma=z.z.object({status:z.z.literal("restart_requested"),clientId:z.z.string(),reason:z.z.string().optional(),requestId:z.z.string()}),fa=z.z.object({status:z.z.literal("shutdown_requested"),clientId:z.z.string(),requestId:z.z.string()}),ya=z.z.object({status:z.z.literal("daemon_config_changed"),config:T}).passthrough(),ha=z.z.discriminatedUnion("status",[pa,ga,ba,da,fa,ma,ya]),ja=z.z.object({type:z.z.literal("artifact"),payload:z.z.object({type:z.z.enum(["markdown","diff","image","code"]),id:z.z.string(),title:z.z.string(),content:z.z.string(),isBase64:z.z.boolean()})}),Sa=z.z.object({cwd:z.z.string(),isGit:z.z.literal(!1),currentBranch:z.z.null(),remoteUrl:z.z.null(),worktreeRoot:z.z.null().optional(),isPaseoOwnedWorktree:z.z.literal(!1),mainRepoRoot:z.z.null()}).transform(e=>Object.assign({},e,{worktreeRoot:null})),Pa=z.z.object({cwd:z.z.string(),isGit:z.z.literal(!0),currentBranch:z.z.string().nullable(),remoteUrl:z.z.string().nullable(),worktreeRoot:z.z.string().optional(),isPaseoOwnedWorktree:z.z.literal(!1),mainRepoRoot:z.z.string().nullable().optional().default(null)}).transform(e=>Object.assign({},e,{worktreeRoot:e.worktreeRoot??e.cwd})),_a=z.z.object({cwd:z.z.string(),isGit:z.z.literal(!0),currentBranch:z.z.string().nullable(),remoteUrl:z.z.string().nullable(),worktreeRoot:z.z.string().optional(),isPaseoOwnedWorktree:z.z.literal(!0),mainRepoRoot:z.z.string()}).transform(e=>Object.assign({},e,{worktreeRoot:e.worktreeRoot??e.cwd})),qa=z.z.union([Sa,Pa,_a]),Ia=z.z.object({projectKey:z.z.string(),projectName:z.z.string(),workspaceName:z.z.string().nullable().optional(),checkout:qa}),ka=z.z.enum(["running","stopped"]),Oa=z.z.enum(["healthy","unhealthy"]),Ra=z.z.object({scriptName:z.z.string(),type:z.z.enum(["script","service"]).optional().default("service"),hostname:z.z.string(),port:z.z.number().int().positive().nullable(),localProxyUrl:z.z.string().nullable().optional(),publicProxyUrl:z.z.string().nullable().optional(),proxyUrl:z.z.string().nullable().optional().default(null),lifecycle:ka,health:Oa.nullable(),exitCode:z.z.number().nullable().optional().default(null),terminalId:z.z.string().nullable().optional().default(null)}),wa=z.z.object({currentBranch:z.z.string().nullable().optional(),remoteUrl:z.z.string().nullable().optional(),isPaseoOwnedWorktree:z.z.boolean().optional(),isDirty:z.z.boolean().nullable().optional(),aheadBehind:z.z.object({ahead:z.z.number(),behind:z.z.number()}).nullable().optional(),aheadOfOrigin:z.z.number().nullable().optional(),behindOfOrigin:z.z.number().nullable().optional()}).optional().nullable(),va=z.z.object({featuresEnabled:z.z.boolean().optional(),pullRequest:z.z.object({number:z.z.number().optional(),url:z.z.string(),title:z.z.string(),state:z.z.string(),baseRefName:z.z.string(),headRefName:z.z.string(),isMerged:z.z.boolean(),isDraft:z.z.boolean().optional(),mergeable:z.z.enum(["MERGEABLE","CONFLICTING","UNKNOWN"]).catch("UNKNOWN").optional(),checks:z.z.array(z.z.object({name:z.z.string(),status:z.z.enum(["success","failure","pending","skipped","cancelled"]),url:z.z.string().nullable(),workflow:z.z.string().optional(),duration:z.z.string().optional()})).optional(),checksStatus:z.z.enum(["none","pending","success","failure"]).optional(),reviewDecision:z.z.enum(["approved","changes_requested","pending"]).nullable().optional(),repoOwner:z.z.string().optional(),repoName:z.z.string().optional(),github:z.z.unknown().optional()}).nullable().optional(),error:z.z.object({message:z.z.string()}).nullable().optional(),refreshedAt:z.z.string().nullable().optional()}).optional().nullable(),Aa=z.z.object({id:z.z.string(),projectId:z.z.string(),projectDisplayName:z.z.string(),projectCustomName:z.z.string().nullable().optional(),projectRootPath:z.z.string(),workspaceDirectory:z.z.string().optional(),projectKind:z.z.enum(["git","non_git","directory"]),workspaceKind:z.z.enum(["directory","local_checkout","checkout","worktree"]),name:z.z.string(),title:z.z.string().nullable().optional(),archivingAt:z.z.string().nullable().optional().default(null),status:Pt,statusEnteredAt:z.z.string().nullish().transform(e=>e??null),activityAt:z.z.string().nullable(),diffStat:z.z.object({additions:z.z.number(),deletions:z.z.number()}).nullable().optional(),scripts:z.z.array(Ra).default([]),gitRuntime:wa,githubRuntime:va,project:Ia.optional()}).transform(e=>Object.assign({},e,{workspaceDirectory:e.workspaceDirectory??e.projectRootPath})),Ma=z.z.object({type:z.z.literal("agent_update"),payload:z.z.discriminatedUnion("kind",[z.z.object({kind:z.z.literal("upsert"),agent:Ne,project:Ia.nullable().optional()}),z.z.object({kind:z.z.literal("remove"),agentId:z.z.string()})])}),Ca=z.z.object({type:z.z.literal("open_url"),payload:z.z.object({url:z.z.string(),agentId:z.z.string().optional()})}),Ta=z.z.object({type:z.z.literal("agent_stream"),payload:z.z.object({agentId:z.z.string(),event:xe,timestamp:z.z.string(),seq:z.z.number().int().nonnegative().optional(),epoch:z.z.string().optional()})}),xa=z.z.object({type:z.z.literal("agent_status"),payload:z.z.object({agentId:z.z.string(),status:z.z.string(),info:Ne})}),La=z.z.object({type:z.z.literal("agent_list"),payload:z.z.object({agents:z.z.array(Ne)})}),Da=z.z.object({agent:Ne,project:Ia}),Wa=z.z.object({nextCursor:z.z.string().nullable(),prevCursor:z.z.string().nullable(),hasMore:z.z.boolean()}),Ea=z.z.object({type:z.z.literal("fetch_agents_response"),payload:z.z.object({requestId:z.z.string(),subscriptionId:z.z.string().nullable().optional(),entries:z.z.array(Da),pageInfo:Wa})}),Na=z.z.object({type:z.z.literal("fetch_agent_history_response"),payload:z.z.object({requestId:z.z.string(),entries:z.z.array(Da),pageInfo:Wa})}),Ua=z.z.object({type:z.z.literal("fetch_recent_provider_sessions_response"),payload:z.z.object({requestId:z.z.string(),entries:z.z.array(Fe),filteredAlreadyImportedCount:z.z.number().int().nonnegative().optional()})}),Fa=z.z.object({projectId:z.z.string(),projectDisplayName:z.z.string(),projectCustomName:z.z.string().nullable().optional(),projectRootPath:z.z.string(),projectKind:z.z.enum(["git","non_git","directory"])}),Ba=z.z.object({type:z.z.literal("fetch_workspaces_response"),payload:z.z.object({requestId:z.z.string(),subscriptionId:z.z.string().nullable().optional(),entries:z.z.array(Aa),emptyProjects:z.z.array(Fa).optional().default([]),pageInfo:z.z.object({nextCursor:z.z.string().nullable(),prevCursor:z.z.string().nullable(),hasMore:z.z.boolean()})})}),Ga=z.z.object({type:z.z.literal("workspace_update"),payload:z.z.discriminatedUnion("kind",[z.z.object({kind:z.z.literal("upsert"),workspace:Aa}),z.z.object({kind:z.z.literal("remove"),id:z.z.string(),emptyProject:Fa.optional(),removedProjectId:z.z.string().optional()})])}),Ha=z.z.object({type:z.z.literal("script_status_update"),payload:z.z.object({workspaceId:z.z.string(),scripts:z.z.array(Ra)})}),Ka=z.z.object({type:z.z.literal("workspace_setup_progress"),payload:z.z.object({workspaceId:z.z.string(),status:z.z.enum(["running","completed","failed"]),detail:ke,error:z.z.string().nullable()})}),Va=z.z.object({status:z.z.enum(["running","completed","failed"]),detail:ke,error:z.z.string().nullable()}),Ya=z.z.object({type:z.z.literal("workspace_setup_status_response"),payload:z.z.object({requestId:z.z.string(),workspaceId:z.z.string(),snapshot:Va.nullable()})}),Qa=z.z.object({type:z.z.literal("open_project_response"),payload:z.z.object({requestId:z.z.string(),workspace:Aa.nullable(),error:z.z.string().nullable(),errorCode:z.z.enum(["directory_not_found"]).nullish().catch(null)})}),Xa=z.z.object({type:z.z.literal("project.add.response"),payload:z.z.object({requestId:z.z.string(),project:Fa.nullable(),error:z.z.string().nullable(),errorCode:z.z.enum(["directory_not_found"]).nullish().catch(null)})}),$a=z.z.object({type:z.z.literal("start_workspace_script_response"),payload:z.z.object({requestId:z.z.string(),workspaceId:z.z.string(),scriptName:z.z.string(),terminalId:z.z.string().nullable(),error:z.z.string().nullable()})}),Ja=z.z.object({type:z.z.literal("list_available_editors_response"),payload:z.z.object({requestId:z.z.string(),editors:z.z.array(z.z.object({id:z.z.string().trim().min(1),label:z.z.string()})),error:z.z.string().nullable()})}),Za=z.z.object({type:z.z.literal("open_in_editor_response"),payload:z.z.object({requestId:z.z.string(),error:z.z.string().nullable()})}),ei=z.z.object({type:z.z.literal("archive_workspace_response"),payload:z.z.object({requestId:z.z.string(),workspaceId:z.z.string(),archivedAt:z.z.string().nullable(),error:z.z.string().nullable()})}),ti=z.z.object({type:z.z.literal("fetch_agent_response"),payload:z.z.object({requestId:z.z.string(),agent:Ne.nullable(),project:Ia.nullable().optional(),error:z.z.string().nullable()})}),ni=z.z.object({startSeq:z.z.number().int().nonnegative(),endSeq:z.z.number().int().nonnegative()}),ri=z.z.object({provider:m.AgentProviderSchema,item:Te,timestamp:z.z.string(),seqStart:z.z.number().int().nonnegative(),seqEnd:z.z.number().int().nonnegative(),sourceSeqRanges:z.z.array(ni),collapsed:z.z.array(z.z.enum(["assistant_merge","reasoning_merge","tool_lifecycle"]))}),oi=z.z.object({type:z.z.literal("fetch_agent_timeline_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),agent:Ne.nullable(),direction:z.z.enum(["tail","before","after"]),projection:z.z.enum(["projected","canonical"]),epoch:z.z.string(),reset:z.z.boolean(),staleCursor:z.z.boolean(),gap:z.z.boolean(),window:z.z.object({minSeq:z.z.number().int().nonnegative(),maxSeq:z.z.number().int().nonnegative(),nextSeq:z.z.number().int().nonnegative()}),startCursor:on.nullable(),endCursor:on.nullable(),hasOlder:z.z.boolean(),hasNewer:z.z.boolean(),entries:z.z.array(ri),error:z.z.string().nullable()})}),ai=z.z.object({type:z.z.literal("agent.fork_context.response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),attachment:zt.nullable(),itemCount:z.z.number().int().nonnegative(),boundaryMessageId:z.z.string().nullable(),error:z.z.string().nullable()})}),ii=z.z.object({type:z.z.literal("cancel_agent_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),agent:Ne.nullable()})}),si=z.z.object({type:z.z.literal("clear_agent_attention_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string().or(z.z.array(z.z.string())),agents:z.z.array(Ne)})}),li=z.z.object({type:z.z.literal("workspace.create.response"),payload:z.z.object({workspace:Aa.nullable(),setupTerminalId:z.z.string().nullable(),error:z.z.string().nullable(),errorCode:z.z.string().optional(),requestId:z.z.string()})}),ci=z.z.object({type:z.z.literal("workspace.clear_attention.response"),payload:z.z.object({requestId:z.z.string(),workspaceId:z.z.union([z.z.string(),z.z.array(z.z.string())]),clearedAgentIds:z.z.array(z.z.string()),results:z.z.array(z.z.object({workspaceId:z.z.string(),clearedAgentIds:z.z.array(z.z.string()),success:z.z.boolean(),error:z.z.string().nullable()})),success:z.z.boolean(),error:z.z.string().nullable()})}),ui=z.z.object({type:z.z.literal("send_agent_message_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),accepted:z.z.boolean(),error:z.z.string().nullable()})}),zi=z.z.object({type:z.z.literal("wait_for_finish_response"),payload:z.z.object({requestId:z.z.string(),status:z.z.enum(["idle","error","permission","timeout"]),final:Ne.nullable(),error:z.z.string().nullable(),lastMessage:z.z.string().nullable()})}),pi=z.z.object({type:z.z.literal("get_daemon_config_response"),payload:z.z.object({requestId:z.z.string(),config:T}).passthrough()}),gi=z.z.object({type:z.z.literal("daemon.get_status.response"),payload:z.z.object({requestId:z.z.string(),serverId:z.z.string(),version:z.z.string().nullable().optional(),pid:z.z.number(),nodePath:z.z.string(),startedAt:z.z.string().nullable().optional(),listen:z.z.string().nullable(),relay:z.z.object({enabled:z.z.boolean(),endpoint:z.z.string(),publicEndpoint:z.z.string(),useTls:z.z.boolean(),publicUseTls:z.z.boolean()}).nullable().optional(),providers:z.z.array(z.z.object({provider:z.z.string(),available:z.z.boolean(),error:z.z.string().nullable().optional()}))}).passthrough()}),bi=z.z.object({type:z.z.literal("daemon.get_pairing_offer.response"),payload:z.z.object({requestId:z.z.string(),url:z.z.string(),qr:z.z.string().nullable().optional(),relayEnabled:z.z.boolean()}).passthrough()}),di=z.z.object({type:z.z.literal("diagnostics.response"),payload:z.z.object({requestId:z.z.string(),diagnostic:z.z.string()}).passthrough()}),mi=z.z.object({type:z.z.literal("set_daemon_config_response"),payload:z.z.object({requestId:z.z.string(),config:T}).passthrough()}),fi=z.z.object({type:z.z.literal("read_project_config_response"),payload:z.z.union([z.z.object({requestId:z.z.string(),repoRoot:z.z.string(),ok:z.z.literal(!0),config:I.PaseoConfigRawSchema.nullable(),revision:I.PaseoConfigRevisionSchema.nullable()}),z.z.object({requestId:z.z.string(),repoRoot:z.z.string(),ok:z.z.literal(!1),error:I.ProjectConfigRpcErrorSchema})])}),yi=z.z.object({type:z.z.literal("write_project_config_response"),payload:z.z.union([z.z.object({requestId:z.z.string(),repoRoot:z.z.string(),ok:z.z.literal(!0),config:I.PaseoConfigRawSchema,revision:I.PaseoConfigRevisionSchema}),z.z.object({requestId:z.z.string(),repoRoot:z.z.string(),ok:z.z.literal(!1),error:I.ProjectConfigRpcErrorSchema})])}),hi=z.z.object({type:z.z.literal("agent_permission_request"),payload:z.z.object({agentId:z.z.string(),request:Pe})}),ji=z.z.object({id:z.z.string(),label:z.z.string(),action:z.z.enum(["approve","deny","reply"])}),Si=z.z.object({type:z.z.literal("watch.actionablePush"),notificationId:z.z.string(),sessionId:z.z.string(),kind:z.z.string(),summary:z.z.string(),actions:z.z.array(ji)}),Pi=z.z.object({type:z.z.literal("watch.actionableResolved"),notificationId:z.z.string()}),_i=z.z.object({id:z.z.string(),title:z.z.string(),lastActivity:z.z.string(),snippet:z.z.string()}),qi=z.z.object({type:z.z.literal("watch.sessionSearchResult"),requestId:z.z.string(),results:z.z.array(_i),error:z.z.string().optional()}),Ii=z.z.object({type:z.z.literal("agent_permission_resolved"),payload:z.z.object({agentId:z.z.string(),requestId:z.z.string(),resolution:Se})}),ki=z.z.object({type:z.z.literal("agent_deleted"),payload:z.z.object({agentId:z.z.string(),requestId:z.z.string()})}),Oi=z.z.object({type:z.z.literal("agent_archived"),payload:z.z.object({agentId:z.z.string(),archivedAt:z.z.string(),requestId:z.z.string()})}),Ri=z.z.object({agentId:z.z.string(),archivedAt:z.z.string()}),wi=z.z.object({terminalId:z.z.string(),success:z.z.boolean()}),vi=z.z.object({type:z.z.literal("close_items_response"),payload:z.z.object({agents:z.z.array(Ri),terminals:z.z.array(wi),requestId:z.z.string()})}),Ai=z.z.object({ahead:z.z.number(),behind:z.z.number()}),Mi=z.z.object({cwd:z.z.string(),error:Wn.nullable(),requestId:z.z.string()}),Ci=Mi.extend({isGit:z.z.literal(!1),isPaseoOwnedWorktree:z.z.literal(!1),repoRoot:z.z.null(),currentBranch:z.z.null(),isDirty:z.z.null(),baseRef:z.z.null(),aheadBehind:z.z.null(),aheadOfOrigin:z.z.null(),behindOfOrigin:z.z.null(),hasRemote:z.z.boolean(),remoteUrl:z.z.null()}),Ti=Mi.extend({isGit:z.z.literal(!0),isPaseoOwnedWorktree:z.z.literal(!1),repoRoot:z.z.string(),mainRepoRoot:z.z.string().nullable().optional().default(null),currentBranch:z.z.string().nullable(),isDirty:z.z.boolean(),baseRef:z.z.string().nullable(),aheadBehind:Ai.nullable(),aheadOfOrigin:z.z.number().nullable(),behindOfOrigin:z.z.number().nullable(),hasRemote:z.z.boolean(),remoteUrl:z.z.string().nullable()}),xi=Mi.extend({isGit:z.z.literal(!0),isPaseoOwnedWorktree:z.z.literal(!0),repoRoot:z.z.string(),mainRepoRoot:z.z.string(),currentBranch:z.z.string().nullable(),isDirty:z.z.boolean(),baseRef:z.z.string(),aheadBehind:Ai.nullable(),aheadOfOrigin:z.z.number().nullable(),behindOfOrigin:z.z.number().nullable(),hasRemote:z.z.boolean(),remoteUrl:z.z.string().nullable()}),Li=z.z.object({type:z.z.literal("checkout_status_response"),payload:z.z.union([Ci,Ti,xi])}),Di=z.z.object({enabledAt:z.z.string().nullable().optional().default(null),mergeMethod:z.z.string().nullable().optional().default(null),enabledBy:z.z.string().nullable().optional().default(null)}).nullable().optional().default(null),Wi=z.z.object({autoMergeAllowed:z.z.boolean().optional().default(!1),mergeCommitAllowed:z.z.boolean().optional().default(!1),squashMergeAllowed:z.z.boolean().optional().default(!1),rebaseMergeAllowed:z.z.boolean().optional().default(!1),viewerDefaultMergeMethod:z.z.string().nullable().optional().default(null)}).optional().default({autoMergeAllowed:!1,mergeCommitAllowed:!1,squashMergeAllowed:!1,rebaseMergeAllowed:!1,viewerDefaultMergeMethod:null}),Ei=z.z.object({mergeStateStatus:z.z.string().nullable().optional().default(null),autoMergeRequest:Di,viewerCanEnableAutoMerge:z.z.boolean().optional().default(!1),viewerCanDisableAutoMerge:z.z.boolean().optional().default(!1),viewerCanMergeAsAdmin:z.z.boolean().optional().default(!1),viewerCanUpdateBranch:z.z.boolean().optional().default(!1),repository:Wi,isMergeQueueEnabled:z.z.boolean().optional().default(!1),isInMergeQueue:z.z.boolean().optional().default(!1)}).optional(),Ni=z.z.object({number:z.z.number().optional(),url:z.z.string(),title:z.z.string(),state:z.z.string(),baseRefName:z.z.string(),headRefName:z.z.string(),isMerged:z.z.boolean(),isDraft:z.z.boolean().optional().default(!1),mergeable:z.z.enum(["MERGEABLE","CONFLICTING","UNKNOWN"]).catch("UNKNOWN").optional().default("UNKNOWN"),checks:z.z.array(z.z.object({name:z.z.string(),status:z.z.string(),url:z.z.string().nullable(),workflow:z.z.string().optional(),duration:z.z.string().optional(),checkRunId:z.z.number().optional(),workflowRunId:z.z.number().optional()})).optional().default([]),checksStatus:z.z.string().optional(),reviewDecision:z.z.string().nullable().optional(),repoOwner:z.z.string().optional(),repoName:z.z.string().optional(),github:Ei}),Ui=z.z.object({cwd:z.z.string(),status:Ni.nullable(),githubFeaturesEnabled:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()}),Fi=z.z.object({prStatus:Ui.optional()}),Bi=z.z.object({type:z.z.literal("checkout_status_update"),payload:z.z.union([Ci,Ti,xi]).and(Fi)}),Gi=z.z.object({subscriptionId:z.z.string(),cwd:z.z.string(),files:z.z.array(Ur),error:Wn.nullable()}),Hi=z.z.object({type:z.z.literal("subscribe_checkout_diff_response"),payload:Gi.extend({requestId:z.z.string()})}),Ki=z.z.object({type:z.z.literal("checkout_diff_update"),payload:Gi}),Vi=z.z.object({type:z.z.literal("checkout_commit_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Yi=z.z.object({type:z.z.literal("checkout_merge_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Qi=z.z.object({type:z.z.literal("checkout_merge_from_base_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Xi=z.z.object({type:z.z.literal("checkout_pull_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),$i=z.z.object({type:z.z.literal("checkout_push_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Ji=z.z.object({type:z.z.literal("checkout.refresh.response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Zi=z.z.object({type:z.z.literal("checkout_pr_create_response"),payload:z.z.object({cwd:z.z.string(),url:z.z.string().nullable(),number:z.z.number().nullable(),error:Wn.nullable(),requestId:z.z.string()})}),es=z.z.object({type:z.z.literal("checkout_pr_merge_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),ts=z.z.object({type:z.z.literal("checkout.github.set_auto_merge.response"),payload:z.z.object({cwd:z.z.string(),enabled:z.z.boolean(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),ns=z.z.object({type:z.z.literal("files.upload.begin.response"),payload:z.z.object({requestId:z.z.string(),uploadId:z.z.string(),accepted:z.z.boolean(),chunkSize:z.z.number().int().positive(),error:Jn.nullable()})}),rs=z.z.object({type:z.z.literal("files.upload.chunk.ack"),payload:z.z.object({requestId:z.z.string(),uploadId:z.z.string(),chunkIndex:z.z.number().int().nonnegative(),bytesReceived:z.z.number().int().nonnegative()})}),os=z.z.object({type:z.z.literal("files.upload.complete.response"),payload:z.z.object({requestId:z.z.string(),uploadId:z.z.string(),fileId:z.z.string(),path:z.z.string(),size:z.z.number().int().nonnegative(),mimeType:z.z.string(),error:Jn.nullable()})}),as=z.z.object({path:z.z.string().optional(),startLine:z.z.number().optional(),endLine:z.z.number().optional(),annotationLevel:z.z.string().optional(),message:z.z.string().optional(),title:z.z.string().optional(),rawDetails:z.z.string().optional()}),is=z.z.object({jobId:z.z.number(),name:z.z.string(),status:z.z.string().nullable().optional(),conclusion:z.z.string().nullable().optional(),url:z.z.string().nullable().optional(),logTail:z.z.string().optional(),logTruncated:z.z.boolean().optional()}),ss=z.z.object({checkRunId:z.z.number(),workflowRunId:z.z.number().nullable().optional(),name:z.z.string(),status:z.z.string().nullable().optional(),conclusion:z.z.string().nullable().optional(),url:z.z.string().nullable().optional(),detailsUrl:z.z.string().nullable().optional(),output:z.z.object({title:z.z.string().nullable().optional(),summary:z.z.string().nullable().optional(),text:z.z.string().nullable().optional()}).nullable().optional(),annotations:z.z.array(as).optional().default([]),failedJobs:z.z.array(is).optional().default([]),truncated:z.z.boolean().optional().default(!1)}),ls=z.z.object({type:z.z.literal("checkout.github.get_check_details.response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),details:ss.nullable().optional().default(null),error:Wn.nullable(),requestId:z.z.string()})}),cs=z.z.object({type:z.z.literal("checkout_pr_status_response"),payload:Ui}),us=z.z.discriminatedUnion("kind",[z.z.object({kind:z.z.literal("not_found"),message:z.z.string().optional().default("")}),z.z.object({kind:z.z.literal("forbidden"),message:z.z.string().optional().default("")}),z.z.object({kind:z.z.literal("unknown"),message:z.z.string().optional().default("")})]),zs=z.z.preprocess(e=>{if(!e||"object"!=typeof e||Array.isArray(e))return{kind:"unknown",message:""};const t=e;return"not_found"===t.kind||"forbidden"===t.kind||"unknown"===t.kind?t:Object.assign({},t,{kind:"unknown"})},us),ps=z.z.object({id:z.z.string().optional().default(""),kind:z.z.literal("review"),author:z.z.string().optional().default("unknown"),authorUrl:z.z.string().nullable().optional(),avatarUrl:z.z.string().nullable().optional(),body:z.z.string().optional().default(""),createdAt:z.z.number().optional().default(0),url:z.z.string().optional().default(""),reviewState:z.z.enum(["approved","changes_requested","commented"]).optional().default("commented")}),gs=z.z.object({id:z.z.string().optional().default(""),kind:z.z.literal("comment"),author:z.z.string().optional().default("unknown"),authorUrl:z.z.string().nullable().optional(),avatarUrl:z.z.string().nullable().optional(),body:z.z.string().optional().default(""),createdAt:z.z.number().optional().default(0),url:z.z.string().optional().default(""),reviewId:z.z.string().optional(),location:z.z.object({path:z.z.string(),line:z.z.number().optional(),startLine:z.z.number().optional(),threadId:z.z.string().optional(),isResolved:z.z.boolean().optional(),isOutdated:z.z.boolean().optional()}).optional()}),bs=z.z.preprocess(e=>{if(!e||"object"!=typeof e||Array.isArray(e))return e;const t=e;return"review"===t.kind||"comment"===t.kind?t:Object.assign({},t,{kind:"comment"})},z.z.discriminatedUnion("kind",[ps,gs])),ds=z.z.object({type:z.z.literal("pull_request_timeline_response"),payload:z.z.object({cwd:z.z.string().optional().default(""),prNumber:z.z.number().nullable().optional().default(null),items:z.z.array(bs).optional().default([]),truncated:z.z.boolean().optional().default(!1),error:zs.nullable().optional().default(null),requestId:z.z.string().optional().default(""),githubFeaturesEnabled:z.z.boolean().optional().default(!0)}).optional().prefault({})}),ms=z.z.object({type:z.z.literal("checkout_switch_branch_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),branch:z.z.string(),source:z.z.enum(["local","remote"]).optional(),error:Wn.nullable(),requestId:z.z.string()})}),fs=z.z.object({type:z.z.literal("checkout.rename_branch.response"),payload:z.z.object({requestId:z.z.string(),success:z.z.boolean(),cwd:z.z.string(),currentBranch:z.z.string().nullable(),error:Wn.nullable()})}),ys=z.z.object({index:z.z.number().int().min(0),message:z.z.string(),branch:z.z.string().nullable(),isPaseo:z.z.boolean()}),hs=z.z.object({type:z.z.literal("stash_save_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),js=z.z.object({type:z.z.literal("stash_pop_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Ss=z.z.object({type:z.z.literal("stash_list_response"),payload:z.z.object({cwd:z.z.string(),entries:z.z.array(ys),error:Wn.nullable(),requestId:z.z.string()})}),Ps=z.z.object({type:z.z.literal("validate_branch_response"),payload:z.z.object({exists:z.z.boolean(),resolvedRef:z.z.string().nullable(),isRemote:z.z.boolean(),error:z.z.string().nullable(),requestId:z.z.string()})}),_s=z.z.object({type:z.z.literal("branch_suggestions_response"),payload:z.z.object({branches:z.z.array(z.z.string()),branchDetails:z.z.array(z.z.object({name:z.z.string(),committerDate:z.z.number(),hasLocal:z.z.boolean().optional(),hasRemote:z.z.boolean().optional()})).optional(),error:z.z.string().nullable(),requestId:z.z.string()})}),qs=z.z.object({type:z.z.literal("github_search_response"),payload:z.z.object({items:z.z.array(br),githubFeaturesEnabled:z.z.boolean(),error:z.z.string().nullable(),requestId:z.z.string()})}),Is=z.z.object({type:z.z.literal("directory_suggestions_response"),payload:z.z.object({directories:z.z.array(z.z.string()),entries:z.z.array(z.z.object({path:z.z.string(),kind:z.z.enum(["file","directory"])})).optional().default([]),error:z.z.string().nullable(),requestId:z.z.string()})}),ks=z.z.object({worktreePath:z.z.string(),createdAt:z.z.string(),branchName:z.z.string().nullable().optional(),head:z.z.string().nullable().optional()}),Os=z.z.object({type:z.z.literal("paseo_worktree_list_response"),payload:z.z.object({worktrees:z.z.array(ks),error:Wn.nullable(),requestId:z.z.string()})}),Rs=z.z.object({type:z.z.literal("paseo_worktree_archive_response"),payload:z.z.object({success:z.z.boolean(),removedAgents:z.z.array(z.z.string()).optional(),error:Wn.nullable(),requestId:z.z.string()})}),ws=z.z.object({type:z.z.literal("create_paseo_worktree_response"),payload:z.z.object({workspace:Aa.nullable(),error:z.z.string().nullable(),errorCode:z.z.string().optional(),setupTerminalId:z.z.string().nullable(),requestId:z.z.string()})}),vs=z.z.object({type:z.z.literal("file_explorer_response"),payload:z.z.object({cwd:z.z.string(),path:z.z.string(),mode:z.z.enum(["list","file"]),directory:Gr.nullable(),file:Br.nullable(),error:z.z.string().nullable(),requestId:z.z.string()})}),As=z.z.object({data:z.z.string(),mimeType:z.z.string()}),Ms=z.z.object({type:z.z.literal("project_icon_response"),payload:z.z.object({cwd:z.z.string(),icon:As.nullable(),error:z.z.string().nullable(),requestId:z.z.string()})}),Cs=z.z.object({type:z.z.literal("file_download_token_response"),payload:z.z.object({cwd:z.z.string(),path:z.z.string(),token:z.z.string().nullable(),fileName:z.z.string().nullable(),mimeType:z.z.string().nullable(),size:z.z.number().nullable(),error:z.z.string().nullable(),requestId:z.z.string()})}),Ts=z.z.object({type:z.z.literal("file.upload.response"),payload:z.z.object({requestId:z.z.string(),file:mt.nullable(),error:z.z.string().nullable()})}),xs=z.z.object({type:z.z.literal("list_provider_models_response"),payload:z.z.object({provider:m.AgentProviderSchema,models:z.z.array(ue).optional(),error:z.z.string().nullable().optional(),fetchedAt:z.z.string(),requestId:z.z.string()})}),Ls=z.z.object({type:z.z.literal("list_provider_modes_response"),payload:z.z.object({provider:m.AgentProviderSchema,modes:z.z.array(re).optional(),error:z.z.string().nullable().optional(),fetchedAt:z.z.string(),requestId:z.z.string()})}),Ds=z.z.object({type:z.z.literal("list_provider_features_response"),payload:z.z.object({provider:m.AgentProviderSchema,features:z.z.array(ce).optional(),error:z.z.string().nullable().optional(),fetchedAt:z.z.string(),requestId:z.z.string()})}),Ws=z.z.object({provider:m.AgentProviderSchema,available:z.z.boolean(),error:z.z.string().nullable().optional()}),Es=z.z.object({type:z.z.literal("list_available_providers_response"),payload:z.z.object({providers:z.z.array(Ws),error:z.z.string().nullable().optional(),fetchedAt:z.z.string(),requestId:z.z.string()})}),Ns=z.z.object({type:z.z.literal("get_providers_snapshot_response"),payload:z.z.object({entries:z.z.array(ze),generatedAt:z.z.string(),requestId:z.z.string()})}),Us=z.z.object({type:z.z.literal("providers.reload_config.response"),payload:z.z.object({added:z.z.array(z.z.string()),updated:z.z.array(z.z.string()),removed:z.z.array(z.z.string()),unchanged:z.z.array(z.z.string()),providers:z.z.array(z.z.object({provider:z.z.string(),label:z.z.string(),enabled:z.z.boolean()})),requestId:z.z.string()})}),Fs=z.z.object({type:z.z.literal("providers_snapshot_update"),payload:z.z.object({cwd:z.z.string().optional(),entries:z.z.array(ze),generatedAt:z.z.string()})}),Bs=z.z.object({type:z.z.literal("refresh_providers_snapshot_response"),payload:z.z.object({requestId:z.z.string(),acknowledged:z.z.boolean()})}),Gs=z.z.object({type:z.z.literal("provider_diagnostic_response"),payload:z.z.object({provider:m.AgentProviderSchema,diagnostic:z.z.string(),requestId:z.z.string()})}),Hs=z.z.enum(["default","ok","warning","danger"]),Ks=z.z.enum(["available","unavailable","error"]),Vs=z.z.object({id:z.z.string(),label:z.z.string(),usedPct:z.z.number().nullable().optional(),remainingPct:z.z.number().nullable().optional(),resetsAt:z.z.string().nullable().optional(),runsOutAt:z.z.string().nullable().optional(),shortfallPct:z.z.number().nullable().optional(),tone:Hs.optional()}),Ys=z.z.object({id:z.z.string(),label:z.z.string(),used:z.z.number().nullable().optional(),remaining:z.z.number().nullable().optional(),limit:z.z.number().nullable().optional(),unit:z.z.enum(["usd","credits","requests","tokens"]),resetsAt:z.z.string().nullable().optional(),tone:Hs.optional()}),Qs=z.z.object({id:z.z.string(),label:z.z.string(),value:z.z.string(),tone:Hs.optional()}),Xs=z.z.object({providerId:z.z.string(),displayName:z.z.string(),status:Ks,planLabel:z.z.string().nullable(),sourceLabel:z.z.string().nullable().optional(),fetchedAt:z.z.string().nullable().optional(),nextRefreshAt:z.z.string().nullable().optional(),windows:z.z.array(Vs),balances:z.z.array(Ys).optional(),details:z.z.array(Qs).optional(),error:z.z.string().nullable().optional()}),$s=z.z.object({type:z.z.literal("provider.usage.list.response"),payload:z.z.object({requestId:z.z.string(),fetchedAt:z.z.string(),providers:z.z.array(Xs)})}),Js=z.z.object({name:z.z.string(),description:z.z.string(),argumentHint:z.z.string(),kind:z.z.enum(["command","skill"]).optional().catch("command")}),Zs=z.z.object({type:z.z.literal("list_commands_response"),payload:z.z.object({agentId:z.z.string(),commands:z.z.array(Js),error:z.z.string().nullable(),requestId:z.z.string()})}),el=z.z.object({id:z.z.string(),name:z.z.string(),cwd:z.z.string(),workspaceId:z.z.string().optional(),title:z.z.string().optional(),activity:p.TerminalActivitySchema.nullable().optional()}),tl=z.z.object({char:z.z.string(),fg:z.z.number().optional(),bg:z.z.number().optional(),fgMode:z.z.number().optional(),bgMode:z.z.number().optional(),bold:z.z.boolean().optional(),italic:z.z.boolean().optional(),underline:z.z.boolean().optional(),dim:z.z.boolean().optional(),inverse:z.z.boolean().optional(),strikethrough:z.z.boolean().optional()}),nl=z.z.enum(["block","underline","bar"]),rl=z.z.object({row:z.z.number(),col:z.z.number(),hidden:z.z.boolean().optional(),style:nl.optional(),blink:z.z.boolean().optional()}),ol=z.z.object({rows:z.z.number(),cols:z.z.number(),grid:z.z.array(z.z.array(tl)),scrollback:z.z.array(z.z.array(tl)),cursor:rl,title:z.z.string().optional(),gridWrapped:z.z.array(z.z.boolean()).optional(),scrollbackWrapped:z.z.array(z.z.boolean()).optional()}),al=z.z.object({type:z.z.literal("list_terminals_response"),payload:z.z.object({cwd:z.z.string().optional(),terminals:z.z.array(el.omit({cwd:!0})),requestId:z.z.string()})}),il=z.z.object({type:z.z.literal("terminals_changed"),payload:z.z.object({cwd:z.z.string(),terminals:z.z.array(el.omit({cwd:!0}))})}),sl=z.z.object({type:z.z.literal("create_terminal_response"),payload:z.z.object({terminal:el.nullable(),error:z.z.string().nullable(),requestId:z.z.string()})}),ll=z.z.object({type:z.z.literal("terminal.rename.response"),payload:z.z.object({requestId:z.z.string(),success:z.z.boolean(),error:z.z.string().nullable()})}),cl=z.z.object({type:z.z.literal("subscribe_terminal_response"),payload:z.z.union([z.z.object({terminalId:z.z.string(),slot:z.z.number().int().min(0).max(255),error:z.z.null(),requestId:z.z.string()}),z.z.object({terminalId:z.z.string(),error:z.z.string(),requestId:z.z.string()})])}),ul=z.z.object({type:z.z.literal("kill_terminal_response"),payload:z.z.object({terminalId:z.z.string(),success:z.z.boolean(),requestId:z.z.string()})}),zl=z.z.object({type:z.z.literal("capture_terminal_response"),payload:z.z.object({terminalId:z.z.string(),lines:z.z.array(z.z.string()),totalLines:z.z.number().int().nonnegative(),requestId:z.z.string()})}),pl=z.z.object({type:z.z.literal("terminal_stream_exit"),payload:z.z.object({terminalId:z.z.string()})}),gl=z.z.object({type:z.z.literal("terminal_attention_required"),payload:z.z.object({serverId:z.z.string().optional(),terminalId:z.z.string(),cwd:z.z.string(),workspaceId:z.z.string().optional(),reason:z.z.enum(["finished","needs_input"]),title:z.z.string(),body:z.z.string(),shouldNotify:z.z.boolean()})}),bl=z.z.object({type:z.z.literal("daemon.update.response"),payload:z.z.object({requestId:z.z.string(),success:z.z.boolean(),error:z.z.string().nullable(),previousVersion:z.z.string().nullable(),newVersion:z.z.string().nullable()})}),dl=z.z.object({type:z.z.literal("daemon.update.progress"),payload:z.z.object({requestId:z.z.string(),phase:z.z.enum(["starting","downloading","installing","complete"])})}),ml=z.z.discriminatedUnion("type",[_.BrowserAutomationExecuteRequestSchema,Go,Ho,Ko,Vo,Yo,Qo,Xo,$o,Jo,Zo,sa,la,ca,ja,Ma,Ca,Ga,Ha,Ka,Ya,Ta,xa,Ea,Na,Ua,Ba,Xa,Qa,$a,Ja,Za,ei,ti,oi,ai,ii,si,li,ci,ui,Mn,gi,bi,K,Y,X,J,ne,di,pi,mi,fi,yi,un,pn,bn,dn,fn,hn,Sn,qn,In,On,wn,An,zi,hi,Ii,ki,Oi,nt,Je,et,vi,Li,Bi,Hi,Ki,Vi,Yi,Qi,Xi,$i,Ji,Zi,es,ts,ns,rs,os,nr,ls,cs,ds,ms,fs,hs,js,Ss,Ps,_s,qs,Is,Os,Rs,ws,vs,Ms,Cs,Ts,xs,Ls,Ds,Es,Ns,Us,Fs,Bs,Gs,$s,Zs,al,il,sl,ll,cl,ul,zl,pl,gl,h.ChatCreateResponseSchema,h.ChatListResponseSchema,h.ChatInspectResponseSchema,h.ChatDeleteResponseSchema,h.ChatPostResponseSchema,h.ChatReadResponseSchema,h.ChatWaitResponseSchema,j.ScheduleCreateResponseSchema,j.ScheduleListResponseSchema,j.ScheduleInspectResponseSchema,j.ScheduleLogsResponseSchema,j.SchedulePauseResponseSchema,j.ScheduleResumeResponseSchema,j.ScheduleDeleteResponseSchema,j.ScheduleRunOnceResponseSchema,j.ScheduleUpdateResponseSchema,S.LoopRunResponseSchema,S.LoopListResponseSchema,S.LoopInspectResponseSchema,S.LoopLogsResponseSchema,S.LoopStopResponseSchema,P.FleetListResponseSchema,P.FleetInspectResponseSchema,P.FleetRunNowResponseSchema,P.FleetPauseResponseSchema,P.FleetResumeResponseSchema,P.FleetSetModeResponseSchema,P.FleetAskResponseSchema,P.FleetDecisionsResponseSchema,P.FleetResolveDecisionResponseSchema,P.FleetSetParamsResponseSchema,P.FleetCreateResponseSchema,P.FleetExecutionsResponseSchema,ro,ao,lo,zo,yo,jo,_o,Oo,wo,Si,Pi,qi,dl,bl]),fl=z.z.object({type:z.z.literal("ping")}),yl=z.z.object({type:z.z.literal("pong")}),hl=z.z.object({type:z.z.literal("hello"),clientId:z.z.string().min(1),clientType:z.z.enum(["mobile","browser","cli","mcp"]),protocolVersion:z.z.number().int(),appVersion:z.z.string().optional(),capabilities:z.z.object({voice:z.z.boolean().optional(),pushNotifications:z.z.boolean().optional(),[g.CLIENT_CAPS.reasoningMergeEnum]:z.z.boolean().optional(),[g.CLIENT_CAPS.customModeIcons]:z.z.boolean().optional(),[g.CLIENT_CAPS.terminalReflowableSnapshot]:z.z.boolean().optional(),[g.CLIENT_CAPS.browserHost]:q.BrowserAutomationHostCapabilitySchema.optional()}).passthrough().optional()}),jl=z.z.object({type:z.z.literal("recording_state"),isRecording:z.z.boolean()}),Sl=z.z.object({type:z.z.literal("session"),message:Fo}),Pl=z.z.object({type:z.z.literal("session"),message:ml}),_l=z.z.discriminatedUnion("type",[fl,hl,jl,Sl]),ql=z.z.discriminatedUnion("type",[yl,Pl]);const Il=z.z.object({kind:z.z.literal("permission"),tool_name:z.z.string(),tool_input:z.z.unknown(),agent_id:z.z.string()}),kl=z.z.object({kind:z.z.literal("pre-tool"),tool_name:z.z.string(),tool_input:z.z.unknown(),agent_id:z.z.string()}),Ol=z.z.object({kind:z.z.literal("post-tool"),tool_name:z.z.string(),tool_input:z.z.unknown(),tool_response:z.z.unknown(),agent_id:z.z.string()}),Rl=z.z.object({kind:z.z.literal("status-line"),statusText:z.z.string(),agent_id:z.z.string()}),wl=z.z.object({kind:z.z.literal("session-start"),session_id:z.z.string(),transcript_path:z.z.string(),agent_id:z.z.string()}),vl=z.z.object({kind:z.z.literal("session-end"),session_id:z.z.string(),transcript_path:z.z.string(),agent_id:z.z.string()}),Al=z.z.object({kind:z.z.literal("assistant_message_delta"),delta:z.z.object({text:z.z.string()})}),Ml=z.z.object({kind:z.z.literal("usage_update"),usage:z.z.object({input_tokens:z.z.number().optional(),output_tokens:z.z.number().optional(),cache_creation_input_tokens:z.z.number().optional(),cache_read_input_tokens:z.z.number().optional(),total_cost_usd:z.z.number().optional()})}),Cl=z.z.discriminatedUnion("kind",[Il,kl,Ol,Rl,wl,vl,Al,Ml])},3281,[35,3282,3361,3280,3362,3363,3364,3365,3366,3368,3370,3372,3373,3377,3378,3379]);
|
|
14926
|
+
__d(function(e,t,n,r,o,a,i){"use strict";const s=["contextKind"];Object.defineProperty(a,'__esModule',{value:!0}),Object.defineProperty(a,"PaseoConfigRawSchema",{enumerable:!0,get:function(){return I.PaseoConfigRawSchema}}),Object.defineProperty(a,"PaseoLifecycleCommandRawSchema",{enumerable:!0,get:function(){return I.PaseoLifecycleCommandRawSchema}}),Object.defineProperty(a,"PaseoMetadataGenerationEntrySchema",{enumerable:!0,get:function(){return I.PaseoMetadataGenerationEntrySchema}}),Object.defineProperty(a,"PaseoMetadataGenerationSchema",{enumerable:!0,get:function(){return I.PaseoMetadataGenerationSchema}}),Object.defineProperty(a,"PaseoScriptEntryRawSchema",{enumerable:!0,get:function(){return I.PaseoScriptEntryRawSchema}}),Object.defineProperty(a,"PaseoWorktreeConfigRawSchema",{enumerable:!0,get:function(){return I.PaseoWorktreeConfigRawSchema}}),Object.defineProperty(a,"TerminalProfileSchema",{enumerable:!0,get:function(){return v}}),Object.defineProperty(a,"KanbanBucketDefSchema",{enumerable:!0,get:function(){return A}}),Object.defineProperty(a,"KanbanBoardConfigSchema",{enumerable:!0,get:function(){return M}}),Object.defineProperty(a,"MutableDaemonConfigSchema",{enumerable:!0,get:function(){return T}}),Object.defineProperty(a,"MutableDaemonConfigPatchSchema",{enumerable:!0,get:function(){return x}}),Object.defineProperty(a,"AgentStatusSchema",{enumerable:!0,get:function(){return L}}),Object.defineProperty(a,"WORKFLOW_STATUSES",{enumerable:!0,get:function(){return D}}),Object.defineProperty(a,"WorkflowStatusSchema",{enumerable:!0,get:function(){return W}}),Object.defineProperty(a,"WorkflowPhaseSchema",{enumerable:!0,get:function(){return E}}),Object.defineProperty(a,"WorkflowSnapshotSchema",{enumerable:!0,get:function(){return N}}),Object.defineProperty(a,"STORED_WORKFLOW_SCHEMA",{enumerable:!0,get:function(){return U}}),Object.defineProperty(a,"WORKFLOW_EVENT_TYPES",{enumerable:!0,get:function(){return F}}),Object.defineProperty(a,"WorkflowEventTypeSchema",{enumerable:!0,get:function(){return B}}),Object.defineProperty(a,"WorkflowLifecycleEventSchema",{enumerable:!0,get:function(){return G}}),Object.defineProperty(a,"WorkflowListRequestSchema",{enumerable:!0,get:function(){return H}}),Object.defineProperty(a,"WorkflowListResponseSchema",{enumerable:!0,get:function(){return K}}),Object.defineProperty(a,"WorkflowGetRequestSchema",{enumerable:!0,get:function(){return V}}),Object.defineProperty(a,"WorkflowGetResponseSchema",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(a,"WorkflowCancelRequestSchema",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(a,"WorkflowCancelResponseSchema",{enumerable:!0,get:function(){return X}}),Object.defineProperty(a,"WorkflowEventsRequestSchema",{enumerable:!0,get:function(){return $}}),Object.defineProperty(a,"WorkflowEventsResponseSchema",{enumerable:!0,get:function(){return J}}),Object.defineProperty(a,"WorkflowTaskNodeSchema",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(a,"WorkflowTaskGraphSchema",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(a,"WorkflowStartRequestSchema",{enumerable:!0,get:function(){return te}}),Object.defineProperty(a,"WorkflowStartResponseSchema",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(a,"AgentFeatureToggleSchema",{enumerable:!0,get:function(){return se}}),Object.defineProperty(a,"AgentFeatureSelectSchema",{enumerable:!0,get:function(){return le}}),Object.defineProperty(a,"AgentFeatureSchema",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(a,"ProviderSnapshotEntrySchema",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(a,"AgentPermissionResponseSchema",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(a,"AgentPermissionRequestPayloadSchema",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(a,"AgentTimelineItemPayloadSchema",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(a,"AgentStreamEventPayloadSchema",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(a,"SessionDigestLinkSchema",{enumerable:!0,get:function(){return We}}),Object.defineProperty(a,"SessionDigestSchema",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(a,"AgentSnapshotPayloadSchema",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(a,"AgentListItemPayloadSchema",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(a,"RecentProviderSessionDescriptorPayloadSchema",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(a,"VoiceAudioChunkMessageSchema",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(a,"AbortRequestMessageSchema",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(a,"AudioPlayedMessageSchema",{enumerable:!0,get:function(){return He}}),Object.defineProperty(a,"DeleteAgentRequestMessageSchema",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(a,"ArchiveAgentRequestMessageSchema",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(a,"BackgroundTaskStatusSchema",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(a,"BackgroundTaskPayloadSchema",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(a,"ListBackgroundTasksRequestMessageSchema",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(a,"ListBackgroundTasksResponseSchema",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(a,"BackgroundTaskOutputRequestMessageSchema",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(a,"BackgroundTaskOutputResponseSchema",{enumerable:!0,get:function(){return et}}),Object.defineProperty(a,"DismissBackgroundTaskRequestMessageSchema",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(a,"BackgroundTaskDismissedMessageSchema",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(a,"CloseItemsRequestMessageSchema",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(a,"UpdateAgentRequestMessageSchema",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(a,"ProjectRenameRequestSchema",{enumerable:!0,get:function(){return at}}),Object.defineProperty(a,"ProjectRemoveRequestSchema",{enumerable:!0,get:function(){return it}}),Object.defineProperty(a,"WorkspaceTitleSetRequestSchema",{enumerable:!0,get:function(){return st}}),Object.defineProperty(a,"SetVoiceModeMessageSchema",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(a,"GitHubPrAttachmentSchema",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(a,"GitHubIssueAttachmentSchema",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(a,"TextAttachmentSchema",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(a,"ReviewAttachmentContextLineSchema",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(a,"ReviewAttachmentCommentSchema",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(a,"ReviewAttachmentSchema",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(a,"FileAttachmentSchema",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(a,"UploadedFileAttachmentSchema",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(a,"AgentAttachmentSchema",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(a,"SendAgentMessageSchema",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(a,"FetchAgentsRequestMessageSchema",{enumerable:!0,get:function(){return St}}),Object.defineProperty(a,"FetchWorkspacesRequestMessageSchema",{enumerable:!0,get:function(){return _t}}),Object.defineProperty(a,"FetchAgentHistoryRequestMessageSchema",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(a,"FetchRecentProviderSessionsRequestMessageSchema",{enumerable:!0,get:function(){return It}}),Object.defineProperty(a,"FetchAgentRequestMessageSchema",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(a,"SendAgentMessageRequestSchema",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(a,"WaitForFinishRequestSchema",{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(a,"DaemonGetStatusRequestSchema",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(a,"DaemonGetPairingOfferRequestSchema",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(a,"DiagnosticsRequestSchema",{enumerable:!0,get:function(){return At}}),Object.defineProperty(a,"GetDaemonConfigRequestMessageSchema",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(a,"SetDaemonConfigRequestMessageSchema",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(a,"ReadProjectConfigRequestMessageSchema",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(a,"WriteProjectConfigRequestMessageSchema",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(a,"DictationStreamStartMessageSchema",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(a,"DictationStreamChunkMessageSchema",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(a,"DictationStreamFinishMessageSchema",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(a,"DictationStreamCancelMessageSchema",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(a,"CreateAgentWorktreeTargetSchema",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(a,"CreateAgentRequestMessageSchema",{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(a,"ListProviderModelsRequestMessageSchema",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(a,"ListProviderModesRequestMessageSchema",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(a,"ListAvailableProvidersRequestMessageSchema",{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(a,"GetProvidersSnapshotRequestMessageSchema",{enumerable:!0,get:function(){return Kt}}),Object.defineProperty(a,"ProvidersReloadConfigRequestMessageSchema",{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(a,"RefreshProvidersSnapshotRequestMessageSchema",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(a,"ProviderDiagnosticRequestMessageSchema",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(a,"ProviderUsageListRequestMessageSchema",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(a,"ResumeAgentRequestMessageSchema",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(a,"ImportAgentRequestMessageSchema",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(a,"RefreshAgentRequestMessageSchema",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(a,"CancelAgentRequestMessageSchema",{enumerable:!0,get:function(){return en}}),Object.defineProperty(a,"RestartServerRequestMessageSchema",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(a,"ShutdownServerRequestMessageSchema",{enumerable:!0,get:function(){return nn}}),Object.defineProperty(a,"DaemonUpdateRequestMessageSchema",{enumerable:!0,get:function(){return rn}}),Object.defineProperty(a,"AgentTimelineCursorSchema",{enumerable:!0,get:function(){return on}}),Object.defineProperty(a,"FetchAgentTimelineRequestMessageSchema",{enumerable:!0,get:function(){return an}}),Object.defineProperty(a,"AgentForkContextRequestMessageSchema",{enumerable:!0,get:function(){return sn}}),Object.defineProperty(a,"SetAgentModeRequestMessageSchema",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(a,"SetAgentModeResponseMessageSchema",{enumerable:!0,get:function(){return un}}),Object.defineProperty(a,"SetAgentModelRequestMessageSchema",{enumerable:!0,get:function(){return zn}}),Object.defineProperty(a,"SetAgentModelResponseMessageSchema",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(a,"SwapAgentProviderRequestMessageSchema",{enumerable:!0,get:function(){return gn}}),Object.defineProperty(a,"SwapAgentProviderResponseMessageSchema",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(a,"AgentProviderSwappedEventSchema",{enumerable:!0,get:function(){return dn}}),Object.defineProperty(a,"SetAgentThinkingRequestMessageSchema",{enumerable:!0,get:function(){return mn}}),Object.defineProperty(a,"SetAgentThinkingResponseMessageSchema",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(a,"SetAgentFeatureRequestMessageSchema",{enumerable:!0,get:function(){return yn}}),Object.defineProperty(a,"SetAgentFeatureResponseMessageSchema",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(a,"AgentDetachRequestMessageSchema",{enumerable:!0,get:function(){return jn}}),Object.defineProperty(a,"AgentDetachResponseMessageSchema",{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(a,"AgentRewindModeSchema",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(a,"AgentRewindRequestMessageSchema",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(a,"AgentRewindResponseMessageSchema",{enumerable:!0,get:function(){return qn}}),Object.defineProperty(a,"UpdateAgentResponseMessageSchema",{enumerable:!0,get:function(){return In}}),Object.defineProperty(a,"ProjectRenameResponsePayloadSchema",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(a,"ProjectRenameResponseSchema",{enumerable:!0,get:function(){return On}}),Object.defineProperty(a,"ProjectRemoveResponsePayloadSchema",{enumerable:!0,get:function(){return Rn}}),Object.defineProperty(a,"ProjectRemoveResponseSchema",{enumerable:!0,get:function(){return wn}}),Object.defineProperty(a,"WorkspaceTitleSetResponsePayloadSchema",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(a,"WorkspaceTitleSetResponseSchema",{enumerable:!0,get:function(){return An}}),Object.defineProperty(a,"SetVoiceModeResponseMessageSchema",{enumerable:!0,get:function(){return Mn}}),Object.defineProperty(a,"AgentPermissionResponseMessageSchema",{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(a,"WatchNotificationActionMessageSchema",{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(a,"WatchSessionSearchMessageSchema",{enumerable:!0,get:function(){return xn}}),Object.defineProperty(a,"WatchComposerDictateMessageSchema",{enumerable:!0,get:function(){return Ln}}),Object.defineProperty(a,"CheckoutStatusRequestSchema",{enumerable:!0,get:function(){return Nn}}),Object.defineProperty(a,"SubscribeCheckoutDiffRequestSchema",{enumerable:!0,get:function(){return Un}}),Object.defineProperty(a,"UnsubscribeCheckoutDiffRequestSchema",{enumerable:!0,get:function(){return Fn}}),Object.defineProperty(a,"CheckoutCommitRequestSchema",{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(a,"CheckoutMergeRequestSchema",{enumerable:!0,get:function(){return Gn}}),Object.defineProperty(a,"CheckoutMergeFromBaseRequestSchema",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(a,"CheckoutPullRequestSchema",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(a,"CheckoutPushRequestSchema",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(a,"CheckoutRefreshRequestSchema",{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(a,"CheckoutPrCreateRequestSchema",{enumerable:!0,get:function(){return Qn}}),Object.defineProperty(a,"CheckoutPrMergeRequestSchema",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(a,"CheckoutGithubSetAutoMergeRequestSchema",{enumerable:!0,get:function(){return $n}}),Object.defineProperty(a,"FileUploadErrorCodeSchema",{enumerable:!0,get:function(){return Jn}}),Object.defineProperty(a,"FilesUploadBeginRequestSchema",{enumerable:!0,get:function(){return Zn}}),Object.defineProperty(a,"FilesUploadCompleteRequestSchema",{enumerable:!0,get:function(){return er}}),Object.defineProperty(a,"FilesUploadChunkSchema",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(a,"FilesUploadErrorSchema",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(a,"CheckoutGithubGetCheckDetailsRequestSchema",{enumerable:!0,get:function(){return or}}),Object.defineProperty(a,"CheckoutPrStatusRequestSchema",{enumerable:!0,get:function(){return ar}}),Object.defineProperty(a,"PullRequestTimelineRequestSchema",{enumerable:!0,get:function(){return ir}}),Object.defineProperty(a,"ValidateBranchRequestSchema",{enumerable:!0,get:function(){return sr}}),Object.defineProperty(a,"CheckoutSwitchBranchRequestSchema",{enumerable:!0,get:function(){return lr}}),Object.defineProperty(a,"CheckoutRenameBranchRequestSchema",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(a,"StashSaveRequestSchema",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(a,"StashPopRequestSchema",{enumerable:!0,get:function(){return zr}}),Object.defineProperty(a,"StashListRequestSchema",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(a,"BranchSuggestionsRequestSchema",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(a,"GitHubSearchItemSchema",{enumerable:!0,get:function(){return br}}),Object.defineProperty(a,"GitHubSearchKindSchema",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(a,"GitHubSearchRequestSchema",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(a,"DirectorySuggestionsRequestSchema",{enumerable:!0,get:function(){return fr}}),Object.defineProperty(a,"PaseoWorktreeListRequestSchema",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(a,"PaseoWorktreeArchiveRequestSchema",{enumerable:!0,get:function(){return hr}}),Object.defineProperty(a,"FirstAgentContextSchema",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(a,"CreatePaseoWorktreeRequestSchema",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(a,"WorkspaceSetupStatusRequestSchema",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(a,"LEGACY_EDITOR_TARGET_IDS",{enumerable:!0,get:function(){return _r}}),Object.defineProperty(a,"KNOWN_EDITOR_TARGET_IDS",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(a,"KnownEditorTargetIdSchema",{enumerable:!0,get:function(){return Ir}}),Object.defineProperty(a,"LegacyEditorTargetIdSchema",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(a,"EditorTargetIdSchema",{enumerable:!0,get:function(){return Or}}),a.isKnownEditorTargetId=function(e){return Rr.has(e)},a.isLegacyEditorTargetId=function(e){return wr.has(e)},Object.defineProperty(a,"EditorTargetDescriptorPayloadSchema",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(a,"LegacyListAvailableEditorsRequestSchema",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(a,"LegacyOpenInEditorRequestSchema",{enumerable:!0,get:function(){return Mr}}),Object.defineProperty(a,"OpenProjectRequestSchema",{enumerable:!0,get:function(){return Cr}}),Object.defineProperty(a,"ProjectAddRequestSchema",{enumerable:!0,get:function(){return Tr}}),Object.defineProperty(a,"ArchiveWorkspaceRequestSchema",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(a,"WorkspaceCreateRequestSchema",{enumerable:!0,get:function(){return Lr}}),Object.defineProperty(a,"WorkspaceClearAttentionRequestSchema",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(a,"FileExplorerRequestSchema",{enumerable:!0,get:function(){return Hr}}),Object.defineProperty(a,"ProjectIconRequestSchema",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(a,"FileDownloadTokenRequestSchema",{enumerable:!0,get:function(){return Vr}}),Object.defineProperty(a,"FileUploadRequestSchema",{enumerable:!0,get:function(){return Yr}}),Object.defineProperty(a,"ClearAgentAttentionMessageSchema",{enumerable:!0,get:function(){return Qr}}),Object.defineProperty(a,"ClientHeartbeatMessageSchema",{enumerable:!0,get:function(){return Xr}}),Object.defineProperty(a,"PingMessageSchema",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(a,"ListProviderFeaturesRequestMessageSchema",{enumerable:!0,get:function(){return Zr}}),Object.defineProperty(a,"ListCommandsRequestSchema",{enumerable:!0,get:function(){return eo}}),Object.defineProperty(a,"RegisterPushTokenMessageSchema",{enumerable:!0,get:function(){return to}}),Object.defineProperty(a,"RewindSessionRequestMessageSchema",{enumerable:!0,get:function(){return no}}),Object.defineProperty(a,"RewindSessionResponseMessageSchema",{enumerable:!0,get:function(){return ro}}),Object.defineProperty(a,"EditMessageRequestMessageSchema",{enumerable:!0,get:function(){return oo}}),Object.defineProperty(a,"EditMessageResponseMessageSchema",{enumerable:!0,get:function(){return ao}}),Object.defineProperty(a,"ListWorkspaceSessionsRequestMessageSchema",{enumerable:!0,get:function(){return io}}),Object.defineProperty(a,"ListWorkspaceSessionsResponseMessageSchema",{enumerable:!0,get:function(){return lo}}),Object.defineProperty(a,"ListAllSessionsRequestMessageSchema",{enumerable:!0,get:function(){return co}}),Object.defineProperty(a,"ListAllSessionsResponseMessageSchema",{enumerable:!0,get:function(){return zo}}),Object.defineProperty(a,"ListExtensionsRequestMessageSchema",{enumerable:!0,get:function(){return fo}}),Object.defineProperty(a,"ListExtensionsResponseMessageSchema",{enumerable:!0,get:function(){return yo}}),Object.defineProperty(a,"ExecuteExtensionCommandRequestMessageSchema",{enumerable:!0,get:function(){return ho}}),Object.defineProperty(a,"ExecuteExtensionCommandResponseMessageSchema",{enumerable:!0,get:function(){return jo}}),Object.defineProperty(a,"SearchSessionsRequestMessageSchema",{enumerable:!0,get:function(){return So}}),Object.defineProperty(a,"SearchSessionsResponseMessageSchema",{enumerable:!0,get:function(){return _o}}),Object.defineProperty(a,"SubscribePushRequestMessageSchema",{enumerable:!0,get:function(){return ko}}),Object.defineProperty(a,"SubscribePushResponseMessageSchema",{enumerable:!0,get:function(){return Oo}}),Object.defineProperty(a,"GetVapidPublicKeyRequestMessageSchema",{enumerable:!0,get:function(){return Ro}}),Object.defineProperty(a,"GetVapidPublicKeyResponseMessageSchema",{enumerable:!0,get:function(){return wo}}),Object.defineProperty(a,"ListTerminalsRequestSchema",{enumerable:!0,get:function(){return vo}}),Object.defineProperty(a,"SubscribeTerminalsRequestSchema",{enumerable:!0,get:function(){return Ao}}),Object.defineProperty(a,"UnsubscribeTerminalsRequestSchema",{enumerable:!0,get:function(){return Mo}}),Object.defineProperty(a,"CreateTerminalRequestSchema",{enumerable:!0,get:function(){return Co}}),Object.defineProperty(a,"RenameTerminalRequestSchema",{enumerable:!0,get:function(){return To}}),Object.defineProperty(a,"StartWorkspaceScriptRequestSchema",{enumerable:!0,get:function(){return xo}}),Object.defineProperty(a,"SubscribeTerminalRequestSchema",{enumerable:!0,get:function(){return Lo}}),Object.defineProperty(a,"UnsubscribeTerminalRequestSchema",{enumerable:!0,get:function(){return Do}}),Object.defineProperty(a,"TerminalInputSchema",{enumerable:!0,get:function(){return Eo}}),Object.defineProperty(a,"KillTerminalRequestSchema",{enumerable:!0,get:function(){return No}}),Object.defineProperty(a,"CaptureTerminalRequestSchema",{enumerable:!0,get:function(){return Uo}}),Object.defineProperty(a,"SessionInboundMessageSchema",{enumerable:!0,get:function(){return Fo}}),Object.defineProperty(a,"ActivityLogPayloadSchema",{enumerable:!0,get:function(){return Bo}}),Object.defineProperty(a,"ActivityLogMessageSchema",{enumerable:!0,get:function(){return Go}}),Object.defineProperty(a,"AssistantChunkMessageSchema",{enumerable:!0,get:function(){return Ho}}),Object.defineProperty(a,"AudioOutputMessageSchema",{enumerable:!0,get:function(){return Ko}}),Object.defineProperty(a,"TranscriptionResultMessageSchema",{enumerable:!0,get:function(){return Vo}}),Object.defineProperty(a,"VoiceInputStateMessageSchema",{enumerable:!0,get:function(){return Yo}}),Object.defineProperty(a,"DictationStreamAckMessageSchema",{enumerable:!0,get:function(){return Qo}}),Object.defineProperty(a,"DictationStreamFinishAcceptedMessageSchema",{enumerable:!0,get:function(){return Xo}}),Object.defineProperty(a,"DictationStreamPartialMessageSchema",{enumerable:!0,get:function(){return $o}}),Object.defineProperty(a,"DictationStreamFinalMessageSchema",{enumerable:!0,get:function(){return Jo}}),Object.defineProperty(a,"DictationStreamErrorMessageSchema",{enumerable:!0,get:function(){return Zo}}),Object.defineProperty(a,"ServerCapabilityStateSchema",{enumerable:!0,get:function(){return ea}}),Object.defineProperty(a,"ServerVoiceCapabilitiesSchema",{enumerable:!0,get:function(){return ta}}),Object.defineProperty(a,"ServerCapabilitiesSchema",{enumerable:!0,get:function(){return na}}),Object.defineProperty(a,"ServerInfoStatusPayloadSchema",{enumerable:!0,get:function(){return ia}}),Object.defineProperty(a,"StatusMessageSchema",{enumerable:!0,get:function(){return sa}}),Object.defineProperty(a,"PongMessageSchema",{enumerable:!0,get:function(){return la}}),Object.defineProperty(a,"RpcErrorMessageSchema",{enumerable:!0,get:function(){return ca}}),Object.defineProperty(a,"AgentCreatedStatusPayloadSchema",{enumerable:!0,get:function(){return pa}}),Object.defineProperty(a,"AgentCreateFailedStatusPayloadSchema",{enumerable:!0,get:function(){return ga}}),Object.defineProperty(a,"AgentResumedStatusPayloadSchema",{enumerable:!0,get:function(){return ba}}),Object.defineProperty(a,"AgentRefreshedStatusPayloadSchema",{enumerable:!0,get:function(){return da}}),Object.defineProperty(a,"RestartRequestedStatusPayloadSchema",{enumerable:!0,get:function(){return ma}}),Object.defineProperty(a,"ShutdownRequestedStatusPayloadSchema",{enumerable:!0,get:function(){return fa}}),Object.defineProperty(a,"DaemonConfigChangedStatusPayloadSchema",{enumerable:!0,get:function(){return ya}}),Object.defineProperty(a,"KnownStatusPayloadSchema",{enumerable:!0,get:function(){return ha}}),Object.defineProperty(a,"ArtifactMessageSchema",{enumerable:!0,get:function(){return ja}}),Object.defineProperty(a,"ProjectCheckoutLiteNotGitPayloadSchema",{enumerable:!0,get:function(){return Sa}}),Object.defineProperty(a,"ProjectCheckoutLiteGitNonPaseoPayloadSchema",{enumerable:!0,get:function(){return Pa}}),Object.defineProperty(a,"ProjectCheckoutLiteGitPaseoPayloadSchema",{enumerable:!0,get:function(){return _a}}),Object.defineProperty(a,"ProjectCheckoutLitePayloadSchema",{enumerable:!0,get:function(){return qa}}),Object.defineProperty(a,"ProjectPlacementPayloadSchema",{enumerable:!0,get:function(){return Ia}}),Object.defineProperty(a,"WorkspaceScriptLifecycleSchema",{enumerable:!0,get:function(){return ka}}),Object.defineProperty(a,"WorkspaceScriptHealthSchema",{enumerable:!0,get:function(){return Oa}}),Object.defineProperty(a,"WorkspaceScriptPayloadSchema",{enumerable:!0,get:function(){return Ra}}),Object.defineProperty(a,"WorkspaceDescriptorPayloadSchema",{enumerable:!0,get:function(){return Aa}}),Object.defineProperty(a,"AgentUpdateMessageSchema",{enumerable:!0,get:function(){return Ma}}),Object.defineProperty(a,"OpenUrlMessageSchema",{enumerable:!0,get:function(){return Ca}}),Object.defineProperty(a,"AgentStreamMessageSchema",{enumerable:!0,get:function(){return Ta}}),Object.defineProperty(a,"AgentStatusMessageSchema",{enumerable:!0,get:function(){return xa}}),Object.defineProperty(a,"AgentListMessageSchema",{enumerable:!0,get:function(){return La}}),Object.defineProperty(a,"FetchAgentsResponseMessageSchema",{enumerable:!0,get:function(){return Ea}}),Object.defineProperty(a,"FetchAgentHistoryResponseMessageSchema",{enumerable:!0,get:function(){return Na}}),Object.defineProperty(a,"FetchRecentProviderSessionsResponseMessageSchema",{enumerable:!0,get:function(){return Ua}}),Object.defineProperty(a,"WorkspaceProjectDescriptorPayloadSchema",{enumerable:!0,get:function(){return Fa}}),Object.defineProperty(a,"FetchWorkspacesResponseMessageSchema",{enumerable:!0,get:function(){return Ba}}),Object.defineProperty(a,"WorkspaceUpdateMessageSchema",{enumerable:!0,get:function(){return Ga}}),Object.defineProperty(a,"ScriptStatusUpdateMessageSchema",{enumerable:!0,get:function(){return Ha}}),Object.defineProperty(a,"WorkspaceSetupProgressMessageSchema",{enumerable:!0,get:function(){return Ka}}),Object.defineProperty(a,"WorkspaceSetupSnapshotSchema",{enumerable:!0,get:function(){return Va}}),Object.defineProperty(a,"WorkspaceSetupStatusResponseMessageSchema",{enumerable:!0,get:function(){return Ya}}),Object.defineProperty(a,"OpenProjectResponseMessageSchema",{enumerable:!0,get:function(){return Qa}}),Object.defineProperty(a,"ProjectAddResponseSchema",{enumerable:!0,get:function(){return Xa}}),Object.defineProperty(a,"StartWorkspaceScriptResponseMessageSchema",{enumerable:!0,get:function(){return $a}}),Object.defineProperty(a,"LegacyListAvailableEditorsResponseMessageSchema",{enumerable:!0,get:function(){return Ja}}),Object.defineProperty(a,"LegacyOpenInEditorResponseMessageSchema",{enumerable:!0,get:function(){return Za}}),Object.defineProperty(a,"ArchiveWorkspaceResponseMessageSchema",{enumerable:!0,get:function(){return ei}}),Object.defineProperty(a,"FetchAgentResponseMessageSchema",{enumerable:!0,get:function(){return ti}}),Object.defineProperty(a,"AgentTimelineEntryPayloadSchema",{enumerable:!0,get:function(){return ri}}),Object.defineProperty(a,"FetchAgentTimelineResponseMessageSchema",{enumerable:!0,get:function(){return oi}}),Object.defineProperty(a,"AgentForkContextResponseMessageSchema",{enumerable:!0,get:function(){return ai}}),Object.defineProperty(a,"CancelAgentResponseMessageSchema",{enumerable:!0,get:function(){return ii}}),Object.defineProperty(a,"ClearAgentAttentionResponseMessageSchema",{enumerable:!0,get:function(){return si}}),Object.defineProperty(a,"WorkspaceCreateResponseSchema",{enumerable:!0,get:function(){return li}}),Object.defineProperty(a,"WorkspaceClearAttentionResponseSchema",{enumerable:!0,get:function(){return ci}}),Object.defineProperty(a,"SendAgentMessageResponseMessageSchema",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(a,"WaitForFinishResponseMessageSchema",{enumerable:!0,get:function(){return zi}}),Object.defineProperty(a,"GetDaemonConfigResponseMessageSchema",{enumerable:!0,get:function(){return pi}}),Object.defineProperty(a,"DaemonGetStatusResponseSchema",{enumerable:!0,get:function(){return gi}}),Object.defineProperty(a,"DaemonGetPairingOfferResponseSchema",{enumerable:!0,get:function(){return bi}}),Object.defineProperty(a,"DiagnosticsResponseSchema",{enumerable:!0,get:function(){return di}}),Object.defineProperty(a,"SetDaemonConfigResponseMessageSchema",{enumerable:!0,get:function(){return mi}}),Object.defineProperty(a,"ReadProjectConfigResponseMessageSchema",{enumerable:!0,get:function(){return fi}}),Object.defineProperty(a,"WriteProjectConfigResponseMessageSchema",{enumerable:!0,get:function(){return yi}}),Object.defineProperty(a,"AgentPermissionRequestMessageSchema",{enumerable:!0,get:function(){return hi}}),Object.defineProperty(a,"WatchActionSchema",{enumerable:!0,get:function(){return ji}}),Object.defineProperty(a,"WatchActionablePushMessageSchema",{enumerable:!0,get:function(){return Si}}),Object.defineProperty(a,"WatchActionableResolvedMessageSchema",{enumerable:!0,get:function(){return Pi}}),Object.defineProperty(a,"WatchSessionMatchSchema",{enumerable:!0,get:function(){return _i}}),Object.defineProperty(a,"WatchSessionSearchResultMessageSchema",{enumerable:!0,get:function(){return qi}}),Object.defineProperty(a,"AgentPermissionResolvedMessageSchema",{enumerable:!0,get:function(){return Ii}}),Object.defineProperty(a,"AgentDeletedMessageSchema",{enumerable:!0,get:function(){return ki}}),Object.defineProperty(a,"AgentArchivedMessageSchema",{enumerable:!0,get:function(){return Oi}}),Object.defineProperty(a,"CloseItemsResponseSchema",{enumerable:!0,get:function(){return vi}}),Object.defineProperty(a,"CheckoutStatusResponseSchema",{enumerable:!0,get:function(){return Li}}),Object.defineProperty(a,"CheckoutPrStatusSchema",{enumerable:!0,get:function(){return Ni}}),Object.defineProperty(a,"CheckoutStatusUpdateSchema",{enumerable:!0,get:function(){return Bi}}),Object.defineProperty(a,"SubscribeCheckoutDiffResponseSchema",{enumerable:!0,get:function(){return Hi}}),Object.defineProperty(a,"CheckoutDiffUpdateSchema",{enumerable:!0,get:function(){return Ki}}),Object.defineProperty(a,"CheckoutCommitResponseSchema",{enumerable:!0,get:function(){return Vi}}),Object.defineProperty(a,"CheckoutMergeResponseSchema",{enumerable:!0,get:function(){return Yi}}),Object.defineProperty(a,"CheckoutMergeFromBaseResponseSchema",{enumerable:!0,get:function(){return Qi}}),Object.defineProperty(a,"CheckoutPullResponseSchema",{enumerable:!0,get:function(){return Xi}}),Object.defineProperty(a,"CheckoutPushResponseSchema",{enumerable:!0,get:function(){return $i}}),Object.defineProperty(a,"CheckoutRefreshResponseSchema",{enumerable:!0,get:function(){return Ji}}),Object.defineProperty(a,"CheckoutPrCreateResponseSchema",{enumerable:!0,get:function(){return Zi}}),Object.defineProperty(a,"CheckoutPrMergeResponseSchema",{enumerable:!0,get:function(){return es}}),Object.defineProperty(a,"CheckoutGithubSetAutoMergeResponseSchema",{enumerable:!0,get:function(){return ts}}),Object.defineProperty(a,"FilesUploadBeginResponseSchema",{enumerable:!0,get:function(){return ns}}),Object.defineProperty(a,"FilesUploadChunkAckSchema",{enumerable:!0,get:function(){return rs}}),Object.defineProperty(a,"FilesUploadCompleteResponseSchema",{enumerable:!0,get:function(){return os}}),Object.defineProperty(a,"CheckoutGithubCheckDetailsSchema",{enumerable:!0,get:function(){return ss}}),Object.defineProperty(a,"CheckoutGithubGetCheckDetailsResponseSchema",{enumerable:!0,get:function(){return ls}}),Object.defineProperty(a,"CheckoutPrStatusResponseSchema",{enumerable:!0,get:function(){return cs}}),Object.defineProperty(a,"PullRequestTimelineItemSchema",{enumerable:!0,get:function(){return bs}}),Object.defineProperty(a,"PullRequestTimelineResponseSchema",{enumerable:!0,get:function(){return ds}}),Object.defineProperty(a,"CheckoutSwitchBranchResponseSchema",{enumerable:!0,get:function(){return ms}}),Object.defineProperty(a,"CheckoutRenameBranchResponseSchema",{enumerable:!0,get:function(){return fs}}),Object.defineProperty(a,"StashSaveResponseSchema",{enumerable:!0,get:function(){return hs}}),Object.defineProperty(a,"StashPopResponseSchema",{enumerable:!0,get:function(){return js}}),Object.defineProperty(a,"StashListResponseSchema",{enumerable:!0,get:function(){return Ss}}),Object.defineProperty(a,"ValidateBranchResponseSchema",{enumerable:!0,get:function(){return Ps}}),Object.defineProperty(a,"BranchSuggestionsResponseSchema",{enumerable:!0,get:function(){return _s}}),Object.defineProperty(a,"GitHubSearchResponseSchema",{enumerable:!0,get:function(){return qs}}),Object.defineProperty(a,"DirectorySuggestionsResponseSchema",{enumerable:!0,get:function(){return Is}}),Object.defineProperty(a,"PaseoWorktreeListResponseSchema",{enumerable:!0,get:function(){return Os}}),Object.defineProperty(a,"PaseoWorktreeArchiveResponseSchema",{enumerable:!0,get:function(){return Rs}}),Object.defineProperty(a,"CreatePaseoWorktreeResponseSchema",{enumerable:!0,get:function(){return ws}}),Object.defineProperty(a,"FileExplorerResponseSchema",{enumerable:!0,get:function(){return vs}}),Object.defineProperty(a,"ProjectIconResponseSchema",{enumerable:!0,get:function(){return Ms}}),Object.defineProperty(a,"FileDownloadTokenResponseSchema",{enumerable:!0,get:function(){return Cs}}),Object.defineProperty(a,"FileUploadResponseSchema",{enumerable:!0,get:function(){return Ts}}),Object.defineProperty(a,"ListProviderModelsResponseMessageSchema",{enumerable:!0,get:function(){return xs}}),Object.defineProperty(a,"ListProviderModesResponseMessageSchema",{enumerable:!0,get:function(){return Ls}}),Object.defineProperty(a,"ListProviderFeaturesResponseMessageSchema",{enumerable:!0,get:function(){return Ds}}),Object.defineProperty(a,"ListAvailableProvidersResponseSchema",{enumerable:!0,get:function(){return Es}}),Object.defineProperty(a,"GetProvidersSnapshotResponseMessageSchema",{enumerable:!0,get:function(){return Ns}}),Object.defineProperty(a,"ProvidersReloadConfigResponseMessageSchema",{enumerable:!0,get:function(){return Us}}),Object.defineProperty(a,"ProvidersSnapshotUpdateMessageSchema",{enumerable:!0,get:function(){return Fs}}),Object.defineProperty(a,"RefreshProvidersSnapshotResponseMessageSchema",{enumerable:!0,get:function(){return Bs}}),Object.defineProperty(a,"ProviderDiagnosticResponseMessageSchema",{enumerable:!0,get:function(){return Gs}}),Object.defineProperty(a,"ProviderUsageToneSchema",{enumerable:!0,get:function(){return Hs}}),Object.defineProperty(a,"ProviderUsageStatusSchema",{enumerable:!0,get:function(){return Ks}}),Object.defineProperty(a,"ProviderUsageWindowSchema",{enumerable:!0,get:function(){return Vs}}),Object.defineProperty(a,"ProviderUsageBalanceSchema",{enumerable:!0,get:function(){return Ys}}),Object.defineProperty(a,"ProviderUsageDetailSchema",{enumerable:!0,get:function(){return Qs}}),Object.defineProperty(a,"ProviderUsageSchema",{enumerable:!0,get:function(){return Xs}}),Object.defineProperty(a,"ProviderUsageListResponseMessageSchema",{enumerable:!0,get:function(){return $s}}),Object.defineProperty(a,"ListCommandsResponseSchema",{enumerable:!0,get:function(){return Zs}}),Object.defineProperty(a,"TerminalCellSchema",{enumerable:!0,get:function(){return tl}}),Object.defineProperty(a,"TerminalCursorStyleSchema",{enumerable:!0,get:function(){return nl}}),Object.defineProperty(a,"TerminalCursorSchema",{enumerable:!0,get:function(){return rl}}),Object.defineProperty(a,"TerminalStateSchema",{enumerable:!0,get:function(){return ol}}),Object.defineProperty(a,"ListTerminalsResponseSchema",{enumerable:!0,get:function(){return al}}),Object.defineProperty(a,"TerminalsChangedSchema",{enumerable:!0,get:function(){return il}}),Object.defineProperty(a,"CreateTerminalResponseSchema",{enumerable:!0,get:function(){return sl}}),Object.defineProperty(a,"RenameTerminalResponseSchema",{enumerable:!0,get:function(){return ll}}),Object.defineProperty(a,"SubscribeTerminalResponseSchema",{enumerable:!0,get:function(){return cl}}),Object.defineProperty(a,"KillTerminalResponseSchema",{enumerable:!0,get:function(){return ul}}),Object.defineProperty(a,"CaptureTerminalResponseSchema",{enumerable:!0,get:function(){return zl}}),Object.defineProperty(a,"TerminalStreamExitSchema",{enumerable:!0,get:function(){return pl}}),Object.defineProperty(a,"TerminalAttentionRequiredSchema",{enumerable:!0,get:function(){return gl}}),Object.defineProperty(a,"DaemonUpdateResponseSchema",{enumerable:!0,get:function(){return bl}}),Object.defineProperty(a,"DaemonUpdateProgressMessageSchema",{enumerable:!0,get:function(){return dl}}),Object.defineProperty(a,"SessionOutboundMessageSchema",{enumerable:!0,get:function(){return ml}}),Object.defineProperty(a,"WSPingMessageSchema",{enumerable:!0,get:function(){return fl}}),Object.defineProperty(a,"WSPongMessageSchema",{enumerable:!0,get:function(){return yl}}),Object.defineProperty(a,"WSHelloMessageSchema",{enumerable:!0,get:function(){return hl}}),Object.defineProperty(a,"WSRecordingStateMessageSchema",{enumerable:!0,get:function(){return jl}}),Object.defineProperty(a,"WSSessionInboundSchema",{enumerable:!0,get:function(){return Sl}}),Object.defineProperty(a,"WSSessionOutboundSchema",{enumerable:!0,get:function(){return Pl}}),Object.defineProperty(a,"WSInboundMessageSchema",{enumerable:!0,get:function(){return _l}}),Object.defineProperty(a,"WSOutboundMessageSchema",{enumerable:!0,get:function(){return ql}}),a.extractSessionMessage=function(e){if("session"===e.type)return e.message;return null},a.wrapSessionMessage=function(e){return{type:"session",message:e}},a.parseServerInfoStatusPayload=function(e){const t=ia.safeParse(e);if(!t.success)return null;return t.data},Object.defineProperty(a,"PermissionHookEventSchema",{enumerable:!0,get:function(){return Il}}),Object.defineProperty(a,"PreToolHookEventSchema",{enumerable:!0,get:function(){return kl}}),Object.defineProperty(a,"PostToolHookEventSchema",{enumerable:!0,get:function(){return Ol}}),Object.defineProperty(a,"StatusLineHookEventSchema",{enumerable:!0,get:function(){return Rl}}),Object.defineProperty(a,"SessionStartHookEventSchema",{enumerable:!0,get:function(){return wl}}),Object.defineProperty(a,"SessionEndHookEventSchema",{enumerable:!0,get:function(){return vl}}),Object.defineProperty(a,"AssistantMessageDeltaHookEventSchema",{enumerable:!0,get:function(){return Al}}),Object.defineProperty(a,"UsageUpdateHookEventSchema",{enumerable:!0,get:function(){return Ml}}),Object.defineProperty(a,"HookEventSchema",{enumerable:!0,get:function(){return Cl}});var l,c=t(i[0]),u=(l=c)&&l.__esModule?l:{default:l},z=t(i[1]),p=t(i[2]),g=t(i[3]),b=t(i[4]),d=t(i[5]),m=t(i[6]),f=t(i[7]),y=t(i[8]),h=t(i[9]),j=t(i[10]),S=t(i[11]),P=t(i[12]),_=t(i[13]),q=t(i[14]),I=t(i[15]);const k=z.z.object({id:z.z.string().min(1),label:z.z.string().min(1),description:z.z.string().optional(),isDefault:z.z.boolean().optional()}).passthrough(),O=z.z.object({enabled:z.z.boolean().optional(),additionalModels:z.z.array(k).optional()}).passthrough(),R=z.z.object({provider:z.z.string().min(1),model:z.z.string().min(1).optional(),thinkingOptionId:z.z.string().min(1).optional()}).passthrough(),w=z.z.object({providers:z.z.array(R).default([])}).passthrough(),v=z.z.object({id:z.z.string(),name:z.z.string(),command:z.z.string(),args:z.z.array(z.z.string()).optional(),icon:z.z.string().optional()}).passthrough(),A=z.z.object({id:z.z.string().min(1),label:z.z.string().min(1),limit:z.z.number().int().positive().optional()}).passthrough(),M=z.z.object({buckets:z.z.array(A).default([]),defaultBucketId:z.z.string().nullable().default(null)}).passthrough(),C=z.z.object({enabled:z.z.boolean().default(!1)}).passthrough(),T=z.z.object({mcp:z.z.object({injectIntoAgents:z.z.boolean()}).passthrough(),browserTools:C.default({enabled:!1}),providers:z.z.record(z.z.string(),O).default({}),metadataGeneration:w.default({providers:[]}),autoArchiveAfterMerge:z.z.boolean().default(!1),enableTerminalAgentHooks:z.z.boolean().default(!1),appendSystemPrompt:z.z.string().default(""),terminalProfiles:z.z.array(v).optional(),kanbanBoard:M.optional()}).passthrough(),x=z.z.object({mcp:T.shape.mcp.partial().optional(),browserTools:C.partial().optional(),providers:z.z.record(z.z.string(),O.partial().passthrough()).optional(),metadataGeneration:w.partial().optional(),autoArchiveAfterMerge:z.z.boolean().optional(),enableTerminalAgentHooks:z.z.boolean().optional(),appendSystemPrompt:z.z.string().optional(),terminalProfiles:z.z.array(v).optional(),kanbanBoard:M.optional()}).partial().passthrough(),L=z.z.enum(b.AGENT_LIFECYCLE_STATUSES),D=["pending","running","completed","failed","cancelled"],W=z.z.enum(D),E=z.z.object({id:z.z.string(),title:z.z.string(),status:W,storyCount:z.z.number().int().nonnegative().optional(),completedStoryCount:z.z.number().int().nonnegative().optional()}),N=z.z.object({id:z.z.string(),cwd:z.z.string(),status:W,title:z.z.string().nullable().optional(),labels:z.z.record(z.z.string(),z.z.string()).default({}),phases:z.z.array(E).default([]),childAgentIds:z.z.array(z.z.string()).default([]),totalStoryCount:z.z.number().int().nonnegative().optional(),completedStoryCount:z.z.number().int().nonnegative().default(0),createdAt:z.z.string(),updatedAt:z.z.string(),startedAt:z.z.string().nullable().optional(),completedAt:z.z.string().nullable().optional(),archivedAt:z.z.string().nullable().optional()}),U=N,F=["created","started","completed","failed","cancelled","archived"],B=z.z.enum(F),G=z.z.object({workflowId:z.z.string(),type:B,status:W,at:z.z.string()}),H=z.z.object({type:z.z.literal("workflow.list.request"),requestId:z.z.string()}),K=z.z.object({type:z.z.literal("workflow.list.response"),payload:z.z.object({requestId:z.z.string(),workflows:z.z.array(N)})}),V=z.z.object({type:z.z.literal("workflow.get.request"),requestId:z.z.string(),workflowId:z.z.string()}),Y=z.z.object({type:z.z.literal("workflow.get.response"),payload:z.z.object({requestId:z.z.string(),workflow:N.nullable()})}),Q=z.z.object({type:z.z.literal("workflow.cancel.request"),requestId:z.z.string(),workflowId:z.z.string()}),X=z.z.object({type:z.z.literal("workflow.cancel.response"),payload:z.z.object({requestId:z.z.string(),workflow:N})}),$=z.z.object({type:z.z.literal("workflow.events.request"),requestId:z.z.string(),workflowId:z.z.string()}),J=z.z.object({type:z.z.literal("workflow.events.response"),payload:z.z.object({requestId:z.z.string(),workflowId:z.z.string(),events:z.z.array(G)})}),Z=z.z.object({id:z.z.string(),dependencies:z.z.array(z.z.string()),description:z.z.string(),prompt:z.z.string(),title:z.z.string(),outputFile:z.z.string(),parallelizable:z.z.boolean(),estimatedMinutes:z.z.number(),agentType:z.z.string().optional(),targetFiles:z.z.array(z.z.string()).optional()}),ee=z.z.object({goal:z.z.string(),masterPrompt:z.z.string(),metadata:z.z.object({executionLayers:z.z.array(z.z.array(z.z.string())),maxParallelism:z.z.number(),totalTasks:z.z.number(),estimatedDuration:z.z.number(),perFileMode:z.z.boolean(),storyFormat:z.z.boolean().optional(),totalFiles:z.z.number().optional()}),session:z.z.object({id:z.z.string(),createdAt:z.z.string(),outputDirectory:z.z.string()}),tasks:z.z.array(Z)}),te=z.z.object({type:z.z.literal("workflow.start.request"),requestId:z.z.string(),graph:ee,provider:z.z.string(),cwd:z.z.string(),model:z.z.string().optional(),title:z.z.string().optional(),labels:z.z.record(z.z.string(),z.z.string()).optional()}),ne=z.z.object({type:z.z.literal("workflow.start.response"),payload:z.z.object({requestId:z.z.string(),workflowId:z.z.string(),childAgentIds:z.z.array(z.z.string()),status:W})}),re=z.z.object({id:z.z.string(),label:z.z.string(),description:z.z.string().optional(),icon:z.z.string().optional(),colorTier:z.z.string().optional()}),oe=z.z.enum(["ready","loading","error","unavailable"]),ae=z.z.object({id:z.z.string(),label:z.z.string(),description:z.z.string().optional(),isDefault:z.z.boolean().optional(),metadata:z.z.record(z.z.string(),z.z.unknown()).optional()}),ie=z.z.discriminatedUnion("type",[z.z.object({type:z.z.literal("info"),message:z.z.string()}),z.z.object({type:z.z.literal("warning"),message:z.z.string()}),z.z.object({type:z.z.literal("error"),message:z.z.string()})]),se=z.z.object({type:z.z.literal("toggle"),id:z.z.string(),label:z.z.string(),description:z.z.string().optional(),tooltip:z.z.string().optional(),icon:z.z.string().optional(),value:z.z.boolean()}),le=z.z.object({type:z.z.literal("select"),id:z.z.string(),label:z.z.string(),description:z.z.string().optional(),tooltip:z.z.string().optional(),icon:z.z.string().optional(),value:z.z.string().nullable(),options:z.z.array(ae)}),ce=z.z.discriminatedUnion("type",[se,le]),ue=z.z.object({provider:m.AgentProviderSchema,id:z.z.string(),label:z.z.string(),description:z.z.string().optional(),isDefault:z.z.boolean().optional(),metadata:z.z.record(z.z.string(),z.z.unknown()).optional(),contextWindowMaxTokens:z.z.number().optional(),thinkingOptions:z.z.array(ae).optional(),defaultThinkingOptionId:z.z.string().optional()}),ze=z.z.object({provider:m.AgentProviderSchema,status:oe,enabled:z.z.boolean().optional().default(!0),error:z.z.string().optional(),models:z.z.array(ue).optional(),modes:z.z.array(re).optional(),fetchedAt:z.z.string().optional(),label:z.z.string().optional(),description:z.z.string().optional(),defaultModeId:z.z.string().nullable().optional(),wireFamily:z.z.enum(["anthropic-messages","openai-compatible","generic-acp"]).optional(),compatibleProviders:z.z.array(z.z.string()).optional()}),pe=z.z.object({supportsStreaming:z.z.boolean(),supportsSessionPersistence:z.z.boolean(),supportsSessionListing:z.z.boolean().optional(),supportsDynamicModes:z.z.boolean(),supportsMcpServers:z.z.boolean(),supportsReasoningStream:z.z.boolean(),supportsToolInvocations:z.z.boolean(),supportsRewindConversation:z.z.boolean().optional().default(!1),supportsRewindFiles:z.z.boolean().optional().default(!1),supportsRewindBoth:z.z.boolean().optional().default(!1)}).catchall(z.z.boolean()),ge=z.z.object({inputTokens:z.z.number().optional(),cachedInputTokens:z.z.number().optional(),outputTokens:z.z.number().optional(),totalCostUsd:z.z.number().optional(),contextWindowMaxTokens:z.z.number().optional(),contextWindowUsedTokens:z.z.number().optional()}),be=z.z.object({type:z.z.literal("stdio"),command:z.z.string(),args:z.z.array(z.z.string()).optional(),env:z.z.record(z.z.string(),z.z.string()).optional(),alwaysLoad:z.z.boolean().optional()}),de=z.z.object({type:z.z.literal("http"),url:z.z.string(),headers:z.z.record(z.z.string(),z.z.string()).optional(),alwaysLoad:z.z.boolean().optional()}),me=z.z.object({type:z.z.literal("sse"),url:z.z.string(),headers:z.z.record(z.z.string(),z.z.string()).optional(),alwaysLoad:z.z.boolean().optional()}),fe=z.z.discriminatedUnion("type",[be,de,me]),ye=z.z.object({provider:m.AgentProviderSchema,cwd:z.z.string(),modeId:z.z.string().optional(),model:z.z.string().optional(),thinkingOptionId:z.z.string().optional(),featureValues:z.z.record(z.z.string(),z.z.unknown()).optional(),title:z.z.string().trim().min(1).max(d.MAX_EXPLICIT_AGENT_TITLE_CHARS).optional().nullable(),approvalPolicy:z.z.string().optional(),sandboxMode:z.z.string().optional(),networkAccess:z.z.boolean().optional(),webSearch:z.z.boolean().optional(),extra:z.z.object({codex:z.z.record(z.z.string(),z.z.unknown()).optional(),claude:z.z.record(z.z.string(),z.z.unknown()).optional()}).partial().optional(),systemPrompt:z.z.string().optional(),mcpServers:z.z.record(z.z.string(),fe).optional(),allowedTools:z.z.array(z.z.string()).optional()}),he=z.z.record(z.z.string(),z.z.unknown()),je=z.z.object({id:z.z.string(),label:z.z.string(),behavior:z.z.enum(["allow","deny"]),variant:z.z.enum(["primary","secondary","danger"]).optional(),intent:z.z.enum(["implement","implement_resume","dismiss"]).optional()}),Se=z.z.discriminatedUnion("behavior",[z.z.object({behavior:z.z.literal("allow"),selectedActionId:z.z.string().optional(),updatedInput:z.z.record(z.z.string(),z.z.unknown()).optional(),updatedPermissions:z.z.array(he).optional()}),z.z.object({behavior:z.z.literal("deny"),selectedActionId:z.z.string().optional(),message:z.z.string().optional(),interrupt:z.z.boolean().optional()})]),Pe=z.z.object({id:z.z.string(),provider:m.AgentProviderSchema,name:z.z.string(),kind:z.z.enum(["tool","plan","question","mode","other"]),title:z.z.string().optional(),description:z.z.string().optional(),input:z.z.record(z.z.string(),z.z.unknown()).optional(),detail:z.z.lazy(()=>Oe).optional(),suggestions:z.z.array(he).optional(),actions:z.z.array(je).optional(),metadata:z.z.record(z.z.string(),z.z.unknown()).optional()}),_e=z.z.union([z.z.null(),z.z.boolean(),z.z.number(),z.z.string(),z.z.array(z.z.unknown()),z.z.object({}).passthrough()]),qe=z.z.union([z.z.boolean(),z.z.number(),z.z.string(),z.z.array(z.z.unknown()),z.z.object({}).passthrough()]),Ie=z.z.object({index:z.z.number().int().positive(),command:z.z.string(),cwd:z.z.string(),log:z.z.string().optional().default(""),status:z.z.enum(["running","completed","failed"]),exitCode:z.z.number().nullable(),durationMs:z.z.number().nonnegative().optional()}),ke=z.z.object({type:z.z.literal("worktree_setup"),worktreePath:z.z.string(),branchName:z.z.string(),log:z.z.string(),commands:z.z.array(Ie),truncated:z.z.boolean().optional()}),Oe=z.z.discriminatedUnion("type",[ke,z.z.object({type:z.z.literal("shell"),command:z.z.string(),cwd:z.z.string().optional(),output:z.z.string().optional(),exitCode:z.z.number().nullable().optional()}),z.z.object({type:z.z.literal("read"),filePath:z.z.string(),content:z.z.string().optional(),offset:z.z.number().optional(),limit:z.z.number().optional()}),z.z.object({type:z.z.literal("edit"),filePath:z.z.string(),oldString:z.z.string().optional(),newString:z.z.string().optional(),unifiedDiff:z.z.string().optional()}),z.z.object({type:z.z.literal("write"),filePath:z.z.string(),content:z.z.string().optional()}),z.z.object({type:z.z.literal("search"),query:z.z.string(),toolName:z.z.enum(["search","grep","glob","web_search"]).optional(),content:z.z.string().optional(),filePaths:z.z.array(z.z.string()).optional(),webResults:z.z.array(z.z.object({title:z.z.string(),url:z.z.string()})).optional(),annotations:z.z.array(z.z.string()).optional(),numFiles:z.z.number().optional(),numMatches:z.z.number().optional(),durationMs:z.z.number().optional(),durationSeconds:z.z.number().optional(),truncated:z.z.boolean().optional(),mode:z.z.enum(["content","files_with_matches","count"]).optional()}),z.z.object({type:z.z.literal("fetch"),url:z.z.string(),prompt:z.z.string().optional(),result:z.z.string().optional(),code:z.z.number().optional(),codeText:z.z.string().optional(),bytes:z.z.number().optional(),durationMs:z.z.number().optional()}),z.z.object({type:z.z.literal("sub_agent"),subAgentType:z.z.string().optional(),description:z.z.string().optional(),childSessionId:z.z.string().optional(),log:z.z.string(),actions:z.z.array(z.z.object({index:z.z.number().int().positive(),toolName:z.z.string(),summary:z.z.string().optional()})).optional()}),z.z.object({type:z.z.literal("plain_text"),label:z.z.string().optional(),text:z.z.string().optional(),icon:z.z.enum(f.TOOL_CALL_ICON_NAMES).optional()}),z.z.object({type:z.z.literal("plan"),text:z.z.string()}),z.z.object({type:z.z.literal("unknown"),input:_e,output:_e})]),Re=z.z.object({type:z.z.literal("tool_call"),callId:z.z.string(),name:z.z.string(),detail:Oe,metadata:z.z.record(z.z.string(),z.z.unknown()).optional()}),we=Re.extend({status:z.z.literal("running"),error:z.z.null()}),ve=Re.extend({status:z.z.literal("completed"),error:z.z.null()}),Ae=Re.extend({status:z.z.literal("failed"),error:qe}),Me=Re.extend({status:z.z.literal("canceled"),error:z.z.null()}),Ce=z.z.discriminatedUnion("status",[we,ve,Ae,Me]),Te=z.z.union([z.z.object({type:z.z.literal("user_message"),text:z.z.string(),messageId:z.z.string().optional()}),z.z.object({type:z.z.literal("assistant_message"),text:z.z.string(),messageId:z.z.string().optional()}),z.z.object({type:z.z.literal("reasoning"),text:z.z.string()}),Ce,z.z.object({type:z.z.literal("todo"),items:z.z.array(z.z.object({text:z.z.string(),completed:z.z.boolean()}))}),z.z.object({type:z.z.literal("error"),message:z.z.string()}),z.z.object({type:z.z.literal("compaction"),status:z.z.enum(["loading","completed"]),trigger:z.z.enum(["auto","manual"]).optional(),preTokens:z.z.number().optional()})]),xe=z.z.discriminatedUnion("type",[z.z.object({type:z.z.literal("thread_started"),sessionId:z.z.string(),provider:m.AgentProviderSchema}),z.z.object({type:z.z.literal("turn_started"),provider:m.AgentProviderSchema}),z.z.object({type:z.z.literal("turn_completed"),provider:m.AgentProviderSchema,usage:ge.optional()}),z.z.object({type:z.z.literal("turn_failed"),provider:m.AgentProviderSchema,error:z.z.string(),code:z.z.string().optional(),diagnostic:z.z.string().optional()}),z.z.object({type:z.z.literal("turn_canceled"),provider:m.AgentProviderSchema,reason:z.z.string()}),z.z.object({type:z.z.literal("timeline"),provider:m.AgentProviderSchema,item:Te}),z.z.object({type:z.z.literal("permission_requested"),provider:m.AgentProviderSchema,request:Pe}),z.z.object({type:z.z.literal("permission_resolved"),provider:m.AgentProviderSchema,requestId:z.z.string(),resolution:Se}),z.z.object({type:z.z.literal("attention_required"),provider:m.AgentProviderSchema,reason:z.z.enum(["finished","error","permission"]),timestamp:z.z.string(),shouldNotify:z.z.boolean(),notification:z.z.object({title:z.z.string(),body:z.z.string(),data:z.z.object({serverId:z.z.string(),agentId:z.z.string(),reason:z.z.enum(["finished","error","permission"])})}).optional()})]),Le=z.z.object({provider:m.AgentProviderSchema,sessionId:z.z.string(),nativeHandle:z.z.string().optional(),metadata:z.z.record(z.z.string(),z.z.unknown()).optional()}).nullable(),De=z.z.object({provider:m.AgentProviderSchema,sessionId:z.z.string().nullable(),model:z.z.string().nullable().optional(),thinkingOptionId:z.z.string().nullable().optional(),modeId:z.z.string().nullable().optional(),extra:z.z.record(z.z.string(),z.z.unknown()).optional()}),We=z.z.object({kind:z.z.enum(["pr","mr","issue","deploy","preview","doc","other"]),url:z.z.string(),label:z.z.string().optional()}),Ee=z.z.object({goal:z.z.string().optional(),nextStep:z.z.string().optional(),blockers:z.z.array(z.z.string()).optional(),links:z.z.array(We).optional(),keyFiles:z.z.array(z.z.string()).optional(),summary:z.z.string().optional(),accomplishments:z.z.array(z.z.string()).optional(),selfReportedAt:z.z.string().optional(),generatedAt:z.z.string().optional(),derivedNextStep:z.z.string().optional(),derivedBlockers:z.z.array(z.z.string()).optional(),urgency:z.z.enum(["low","normal","high"]).optional(),deadline:z.z.string().optional(),derivedDeadline:z.z.string().optional()}),Ne=z.z.object({id:z.z.string(),provider:m.AgentProviderSchema,cwd:z.z.string(),workspaceId:z.z.string().optional(),model:z.z.string().nullable(),features:z.z.array(ce).optional(),thinkingOptionId:z.z.string().nullable().optional(),effectiveThinkingOptionId:z.z.string().nullable().optional(),createdAt:z.z.string(),updatedAt:z.z.string(),lastUserMessageAt:z.z.string().nullable(),status:L,capabilities:pe,currentModeId:z.z.string().nullable(),availableModes:z.z.array(re),pendingPermissions:z.z.array(Pe),persistence:Le.nullable(),runtimeInfo:De.optional(),lastUsage:ge.optional(),lastError:z.z.string().optional(),title:z.z.string().nullable(),labels:z.z.record(z.z.string(),z.z.string()).default({}),digest:Ee.optional(),requiresAttention:z.z.boolean().optional(),attentionReason:z.z.enum(["finished","error","permission"]).nullable().optional(),attentionTimestamp:z.z.string().nullable().optional(),archivedAt:z.z.string().nullable().optional(),activeBackgroundTaskCount:z.z.number().int().nonnegative().optional(),providerUnavailable:z.z.boolean().optional()}),Ue=z.z.object({id:z.z.string(),shortId:z.z.string(),title:z.z.string().nullable(),provider:m.AgentProviderSchema,model:z.z.string().nullable(),thinkingOptionId:z.z.string().nullable().optional(),effectiveThinkingOptionId:z.z.string().nullable().optional(),status:L,cwd:z.z.string(),createdAt:z.z.string(),updatedAt:z.z.string(),lastUserMessageAt:z.z.string().nullable(),archivedAt:z.z.string().nullable().optional(),requiresAttention:z.z.boolean().optional(),attentionReason:z.z.enum(["finished","error","permission"]).nullable().optional(),attentionTimestamp:z.z.string().nullable().optional(),labels:z.z.record(z.z.string(),z.z.string()).default({}),digest:Ee.optional(),activeBackgroundTaskCount:z.z.number().int().nonnegative().optional(),providerUnavailable:z.z.boolean().optional()}),Fe=z.z.object({providerId:z.z.string(),providerLabel:z.z.string(),providerHandleId:z.z.string(),cwd:z.z.string(),title:z.z.string().nullable(),firstPromptPreview:z.z.string().nullable(),lastPromptPreview:z.z.string().nullable(),lastActivityAt:z.z.string()}),Be=z.z.object({type:z.z.literal("voice_audio_chunk"),audio:z.z.string(),format:z.z.string(),isLast:z.z.boolean()}),Ge=z.z.object({type:z.z.literal("abort_request")}),He=z.z.object({type:z.z.literal("audio_played"),id:z.z.string()}),Ke=z.z.object({labels:z.z.record(z.z.string(),z.z.string()).optional(),projectKeys:z.z.array(z.z.string()).optional(),statuses:z.z.array(L).optional(),includeArchived:z.z.boolean().optional(),requiresAttention:z.z.boolean().optional(),thinkingOptionId:z.z.string().nullable().optional()}),Ve=z.z.object({type:z.z.literal("delete_agent_request"),agentId:z.z.string(),requestId:z.z.string()}),Ye=z.z.object({type:z.z.literal("archive_agent_request"),agentId:z.z.string(),requestId:z.z.string()}),Qe=z.z.enum(["running","completed","failed","canceled"]),Xe=z.z.object({agentId:z.z.string(),agentTitle:z.z.string().nullable().optional(),taskId:z.z.string(),command:z.z.string().nullable(),description:z.z.string().nullable(),status:Qe,startedAt:z.z.string(),endedAt:z.z.string().nullable(),summary:z.z.string().nullable(),hasOutput:z.z.boolean()}),$e=z.z.object({type:z.z.literal("list_background_tasks_request"),agentId:z.z.string().optional(),requestId:z.z.string()}),Je=z.z.object({type:z.z.literal("list_background_tasks_response"),payload:z.z.object({tasks:z.z.array(Xe),requestId:z.z.string()})}),Ze=z.z.object({type:z.z.literal("background_task_output_request"),agentId:z.z.string(),taskId:z.z.string(),maxBytes:z.z.number().int().positive().optional(),requestId:z.z.string()}),et=z.z.object({type:z.z.literal("background_task_output_response"),payload:z.z.object({agentId:z.z.string(),taskId:z.z.string(),text:z.z.string().nullable(),truncated:z.z.boolean(),byteSize:z.z.number().int().nonnegative(),requestId:z.z.string()})}),tt=z.z.object({type:z.z.literal("dismiss_background_task_request"),agentId:z.z.string(),taskId:z.z.string(),requestId:z.z.string()}),nt=z.z.object({type:z.z.literal("background_task_dismissed"),payload:z.z.object({agentId:z.z.string(),taskId:z.z.string(),dismissed:z.z.boolean(),requestId:z.z.string()})}),rt=z.z.object({type:z.z.literal("close_items_request"),agentIds:z.z.array(z.z.string()).default([]),terminalIds:z.z.array(z.z.string()).default([]),requestId:z.z.string()}),ot=z.z.object({type:z.z.literal("update_agent_request"),agentId:z.z.string(),name:z.z.string().optional(),labels:z.z.record(z.z.string(),z.z.string()).optional(),requestId:z.z.string()}),at=z.z.object({type:z.z.literal("project.rename.request"),projectId:z.z.string(),customName:z.z.string().nullable(),requestId:z.z.string()}),it=z.z.object({type:z.z.literal("project.remove.request"),projectId:z.z.string(),requestId:z.z.string()}),st=z.z.object({type:z.z.literal("workspace.title.set.request"),workspaceId:z.z.string(),title:z.z.string().nullable(),requestId:z.z.string()}),lt=z.z.object({type:z.z.literal("set_voice_mode"),enabled:z.z.boolean(),agentId:z.z.string().optional(),requestId:z.z.string().optional()}),ct=z.z.object({type:z.z.literal("github_pr"),mimeType:z.z.literal("application/github-pr"),number:z.z.number().int().positive(),title:z.z.string(),url:z.z.string(),body:z.z.string().nullable().optional(),baseRefName:z.z.string().nullable().optional(),headRefName:z.z.string().nullable().optional()}),ut=z.z.object({type:z.z.literal("github_issue"),mimeType:z.z.literal("application/github-issue"),number:z.z.number().int().positive(),title:z.z.string(),url:z.z.string(),body:z.z.string().nullable().optional()}),zt=z.z.object({type:z.z.literal("text"),mimeType:z.z.literal("text/plain"),contextKind:z.z.string().optional(),title:z.z.string().nullable().optional(),text:z.z.string()}).transform(e=>{let{contextKind:t}=e,n=(0,u.default)(e,s);return Object.assign({},n,"chat_history"===t?{contextKind:t}:{})}),pt=z.z.object({oldLineNumber:z.z.number().int().positive().nullable(),newLineNumber:z.z.number().int().positive().nullable(),type:z.z.enum(["add","remove","context"]),content:z.z.string()}),gt=z.z.object({filePath:z.z.string(),side:z.z.enum(["old","new"]),lineNumber:z.z.number().int().positive(),body:z.z.string(),context:z.z.object({hunkHeader:z.z.string(),targetLine:pt,lines:z.z.array(pt)})}),bt=z.z.object({type:z.z.literal("review"),mimeType:z.z.literal("application/paseo-review"),cwd:z.z.string(),mode:z.z.enum(["uncommitted","base"]),baseRef:z.z.string().nullable().optional(),comments:z.z.array(gt)}),dt=z.z.object({type:z.z.literal("file"),name:z.z.string(),mimeType:z.z.string(),size:z.z.number().int().nonnegative(),fileId:z.z.string(),path:z.z.string()}),mt=z.z.object({type:z.z.literal("uploaded_file"),id:z.z.string(),fileName:z.z.string(),mimeType:z.z.string(),size:z.z.number().int().nonnegative(),path:z.z.string()}),ft=z.z.discriminatedUnion("type",[ct,ut,zt,bt,dt,mt]);const yt=z.z.unknown().transform(function(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){const e=ft.safeParse(n);if(e.success){t.push(e.data);continue}const r="object"==typeof n&&null!==n&&"type"in n?String(n.type):"<missing>";console.warn(`[protocol] dropping unparseable agent attachment (type: ${r}):`,e.error.issues)}return t}).optional(),ht=z.z.object({data:z.z.string(),mimeType:z.z.string()}),jt=z.z.object({type:z.z.literal("send_agent_message"),agentId:z.z.string(),text:z.z.string(),messageId:z.z.string().optional(),images:z.z.array(ht).optional(),attachments:yt}),St=z.z.object({type:z.z.literal("fetch_agents_request"),requestId:z.z.string(),scope:z.z.enum(["active"]).optional(),filter:Ke.optional(),sort:z.z.array(z.z.object({key:z.z.enum(["status_priority","created_at","updated_at","title"]),direction:z.z.enum(["asc","desc"])})).optional(),page:z.z.object({limit:z.z.number().int().positive().max(200),cursor:z.z.string().min(1).optional()}).optional(),subscribe:z.z.object({subscriptionId:z.z.string().optional()}).optional()}),Pt=z.z.enum(["needs_input","failed","running","attention","done"]),_t=z.z.object({type:z.z.literal("fetch_workspaces_request"),requestId:z.z.string(),filter:z.z.object({query:z.z.string().optional(),projectId:z.z.string().optional(),idPrefix:z.z.string().optional()}).optional(),sort:z.z.array(z.z.object({key:z.z.enum(["status_priority","activity_at","name","project_id"]),direction:z.z.enum(["asc","desc"])})).optional(),page:z.z.object({limit:z.z.number().int().positive().max(200),cursor:z.z.string().min(1).optional()}).optional(),subscribe:z.z.object({subscriptionId:z.z.string().optional()}).optional()}),qt=z.z.object({type:z.z.literal("fetch_agent_history_request"),requestId:z.z.string(),filter:Ke.optional(),sort:z.z.array(z.z.object({key:z.z.enum(["status_priority","created_at","updated_at","title"]),direction:z.z.enum(["asc","desc"])})).optional(),page:z.z.object({limit:z.z.number().int().positive().max(200),cursor:z.z.string().min(1).optional()}).optional()}),It=z.z.object({type:z.z.literal("fetch_recent_provider_sessions_request"),requestId:z.z.string(),cwd:z.z.string().optional(),providers:z.z.array(z.z.string()).optional(),since:z.z.string().optional(),limit:z.z.number().int().positive().max(200).optional()}),kt=z.z.object({type:z.z.literal("fetch_agent_request"),requestId:z.z.string(),agentId:z.z.string()}),Ot=z.z.object({type:z.z.literal("send_agent_message_request"),requestId:z.z.string(),agentId:z.z.string(),text:z.z.string(),messageId:z.z.string().optional(),images:z.z.array(ht).optional(),attachments:yt}),Rt=z.z.object({type:z.z.literal("wait_for_finish_request"),requestId:z.z.string(),agentId:z.z.string(),timeoutMs:z.z.number().int().positive().optional()}),wt=z.z.object({type:z.z.literal("daemon.get_status.request"),requestId:z.z.string()}),vt=z.z.object({type:z.z.literal("daemon.get_pairing_offer.request"),requestId:z.z.string()}),At=z.z.object({type:z.z.literal("diagnostics.request"),requestId:z.z.string()}),Mt=z.z.object({type:z.z.literal("get_daemon_config_request"),requestId:z.z.string()}),Ct=z.z.object({type:z.z.literal("set_daemon_config_request"),requestId:z.z.string(),config:x}),Tt=z.z.object({type:z.z.literal("read_project_config_request"),requestId:z.z.string(),repoRoot:z.z.string()}),xt=z.z.object({type:z.z.literal("write_project_config_request"),requestId:z.z.string(),repoRoot:z.z.string(),config:I.PaseoConfigRawSchema,expectedRevision:I.PaseoConfigRevisionSchema.nullable()}),Lt=z.z.object({type:z.z.literal("dictation_stream_start"),dictationId:z.z.string(),format:z.z.string()}),Dt=z.z.object({type:z.z.literal("dictation_stream_chunk"),dictationId:z.z.string(),seq:z.z.number().int().nonnegative(),audio:z.z.string(),format:z.z.string()}),Wt=z.z.object({type:z.z.literal("dictation_stream_finish"),dictationId:z.z.string(),finalSeq:z.z.number().int().nonnegative()}),Et=z.z.object({type:z.z.literal("dictation_stream_cancel"),dictationId:z.z.string()}),Nt=z.z.object({baseBranch:z.z.string().optional(),createNewBranch:z.z.boolean().optional(),newBranchName:z.z.string().optional(),createWorktree:z.z.boolean().optional(),worktreeSlug:z.z.string().optional(),refName:z.z.string().min(1).optional(),action:z.z.enum(["branch-off","checkout"]).optional(),githubPrNumber:z.z.number().int().positive().optional()}),Ut=z.z.discriminatedUnion("mode",[z.z.object({mode:z.z.literal("branch-off"),newBranch:z.z.string().min(1),base:z.z.string().min(1).optional()}),z.z.object({mode:z.z.literal("checkout-branch"),branch:z.z.string().min(1)}),z.z.object({mode:z.z.literal("checkout-pr"),prNumber:z.z.number().int().positive()})]),Ft=z.z.object({type:z.z.literal("create_agent_request"),config:ye,env:z.z.record(z.z.string(),z.z.string()).optional(),workspaceId:z.z.string().optional(),worktreeName:z.z.string().optional(),initialPrompt:z.z.string().optional(),clientMessageId:z.z.string().optional(),outputSchema:z.z.record(z.z.string(),z.z.unknown()).optional(),images:z.z.array(ht).optional(),attachments:yt,git:Nt.optional(),worktree:Ut.optional(),autoArchive:z.z.boolean().optional(),labels:z.z.record(z.z.string(),z.z.string()).default({}),resumeSessionId:z.z.string().min(1).optional(),requestId:z.z.string()}),Bt=z.z.object({type:z.z.literal("list_provider_models_request"),provider:m.AgentProviderSchema,cwd:z.z.string().optional(),requestId:z.z.string()}),Gt=z.z.object({type:z.z.literal("list_provider_modes_request"),provider:m.AgentProviderSchema,cwd:z.z.string().optional(),requestId:z.z.string()}),Ht=z.z.object({type:z.z.literal("list_available_providers_request"),requestId:z.z.string()}),Kt=z.z.object({type:z.z.literal("get_providers_snapshot_request"),cwd:z.z.string().optional(),requestId:z.z.string()}),Vt=z.z.object({type:z.z.literal("providers.reload_config.request"),requestId:z.z.string()}),Yt=z.z.object({type:z.z.literal("refresh_providers_snapshot_request"),cwd:z.z.string().optional(),providers:z.z.array(m.AgentProviderSchema).optional(),requestId:z.z.string()}),Qt=z.z.object({type:z.z.literal("provider_diagnostic_request"),provider:m.AgentProviderSchema,requestId:z.z.string()}),Xt=z.z.object({type:z.z.literal("provider.usage.list.request"),requestId:z.z.string()}),$t=z.z.object({type:z.z.literal("resume_agent_request"),handle:Le,overrides:ye.partial().optional(),requestId:z.z.string()}),Jt=z.z.object({type:z.z.literal("import_agent_request"),provider:m.AgentProviderSchema.optional(),providerId:z.z.string().optional(),sessionId:z.z.string().optional(),providerHandleId:z.z.string().optional(),cwd:z.z.string().optional(),labels:z.z.record(z.z.string(),z.z.string()).optional(),requestId:z.z.string()}),Zt=z.z.object({type:z.z.literal("refresh_agent_request"),agentId:z.z.string(),requestId:z.z.string()}),en=z.z.object({type:z.z.literal("cancel_agent_request"),agentId:z.z.string(),requestId:z.z.string().optional()}),tn=z.z.object({type:z.z.literal("restart_server_request"),reason:z.z.string().optional(),requestId:z.z.string()}),nn=z.z.object({type:z.z.literal("shutdown_server_request"),requestId:z.z.string()}),rn=z.z.object({type:z.z.literal("daemon.update.request"),requestId:z.z.string()}),on=z.z.object({epoch:z.z.string(),seq:z.z.number().int().nonnegative()}),an=z.z.object({type:z.z.literal("fetch_agent_timeline_request"),agentId:z.z.string(),requestId:z.z.string(),direction:z.z.enum(["tail","before","after"]).optional(),cursor:on.optional(),limit:z.z.number().int().nonnegative().optional(),projection:z.z.enum(["projected","canonical"]).optional()}),sn=z.z.object({type:z.z.literal("agent.fork_context.request"),agentId:z.z.string(),boundaryMessageId:z.z.string().optional(),requestId:z.z.string()}),ln=z.z.object({type:z.z.literal("set_agent_mode_request"),agentId:z.z.string(),modeId:z.z.string(),requestId:z.z.string()}),cn=z.z.object({requestId:z.z.string(),agentId:z.z.string(),accepted:z.z.boolean(),error:z.z.string().nullable(),notice:ie.nullable().optional()}),un=z.z.object({type:z.z.literal("set_agent_mode_response"),payload:cn}),zn=z.z.object({type:z.z.literal("set_agent_model_request"),agentId:z.z.string(),modelId:z.z.string().nullable(),requestId:z.z.string()}),pn=z.z.object({type:z.z.literal("set_agent_model_response"),payload:cn}),gn=z.z.object({type:z.z.literal("swap_agent_provider_request"),requestId:z.z.string(),agentId:z.z.string(),newProviderId:z.z.string(),overrides:z.z.object({model:z.z.string().nullable().optional(),modeId:z.z.string().optional()}).optional()}),bn=z.z.object({type:z.z.literal("swap_agent_provider_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),accepted:z.z.boolean(),error:z.z.string().nullable(),oldProvider:z.z.string().optional(),newProvider:z.z.string().optional()})}),dn=z.z.object({type:z.z.literal("agent_provider_swapped"),payload:z.z.object({agentId:z.z.string(),oldProvider:z.z.string(),newProvider:z.z.string(),timestamp:z.z.string()})}),mn=z.z.object({type:z.z.literal("set_agent_thinking_request"),agentId:z.z.string(),thinkingOptionId:z.z.string().nullable(),requestId:z.z.string()}),fn=z.z.object({type:z.z.literal("set_agent_thinking_response"),payload:cn}),yn=z.z.object({type:z.z.literal("set_agent_feature_request"),agentId:z.z.string(),featureId:z.z.string(),value:z.z.unknown(),requestId:z.z.string()}),hn=z.z.object({type:z.z.literal("set_agent_feature_response"),payload:cn}),jn=z.z.object({type:z.z.literal("agent.detach.request"),agentId:z.z.string(),requestId:z.z.string()}),Sn=z.z.object({type:z.z.literal("agent.detach.response"),payload:cn}),Pn=z.z.enum(["conversation","files","both"]),_n=z.z.object({type:z.z.literal("agent.rewind.request"),agentId:z.z.string(),messageId:z.z.string(),mode:Pn,requestId:z.z.string()}),qn=z.z.object({type:z.z.literal("agent.rewind.response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),ok:z.z.boolean(),error:z.z.string().nullable()})}),In=z.z.object({type:z.z.literal("update_agent_response"),payload:cn}),kn=z.z.object({requestId:z.z.string(),projectId:z.z.string(),accepted:z.z.boolean(),customName:z.z.string().nullable(),error:z.z.string().nullable()}),On=z.z.object({type:z.z.literal("project.rename.response"),payload:kn}),Rn=z.z.object({requestId:z.z.string(),projectId:z.z.string(),accepted:z.z.boolean(),removedWorkspaceIds:z.z.array(z.z.string()).default([]),error:z.z.string().nullable()}),wn=z.z.object({type:z.z.literal("project.remove.response"),payload:Rn}),vn=z.z.object({requestId:z.z.string(),workspaceId:z.z.string(),accepted:z.z.boolean(),title:z.z.string().nullable(),error:z.z.string().nullable()}),An=z.z.object({type:z.z.literal("workspace.title.set.response"),payload:vn}),Mn=z.z.object({type:z.z.literal("set_voice_mode_response"),payload:z.z.object({requestId:z.z.string(),enabled:z.z.boolean(),agentId:z.z.string().nullable(),accepted:z.z.boolean(),error:z.z.string().nullable(),reasonCode:z.z.string().optional(),retryable:z.z.boolean().optional(),missingModelIds:z.z.array(z.z.string()).optional()})}),Cn=z.z.object({type:z.z.literal("agent_permission_response"),agentId:z.z.string(),requestId:z.z.string(),response:Se}),Tn=z.z.object({type:z.z.literal("watch.notificationAction"),notificationId:z.z.string(),action:z.z.enum(["approve","deny","reply"]),replyText:z.z.string().optional()}),xn=z.z.object({type:z.z.literal("watch.sessionSearch"),requestId:z.z.string(),query:z.z.string()}),Ln=z.z.object({type:z.z.literal("watch.composerDictate"),sessionId:z.z.string(),text:z.z.string()}),Dn=z.z.enum(["NOT_GIT_REPO","NOT_ALLOWED","MERGE_CONFLICT","UNKNOWN"]),Wn=z.z.object({code:Dn,message:z.z.string()}),En=z.z.object({mode:z.z.enum(["uncommitted","base"]),baseRef:z.z.string().optional(),ignoreWhitespace:z.z.boolean().optional()}),Nn=z.z.object({type:z.z.literal("checkout_status_request"),cwd:z.z.string(),requestId:z.z.string()}),Un=z.z.object({type:z.z.literal("subscribe_checkout_diff_request"),subscriptionId:z.z.string(),cwd:z.z.string(),compare:En,requestId:z.z.string()}),Fn=z.z.object({type:z.z.literal("unsubscribe_checkout_diff_request"),subscriptionId:z.z.string()}),Bn=z.z.object({type:z.z.literal("checkout_commit_request"),cwd:z.z.string(),message:z.z.string().optional(),addAll:z.z.boolean().optional(),requestId:z.z.string()}),Gn=z.z.object({type:z.z.literal("checkout_merge_request"),cwd:z.z.string(),baseRef:z.z.string().optional(),strategy:z.z.enum(["merge","squash"]).optional(),requireCleanTarget:z.z.boolean().optional(),requestId:z.z.string()}),Hn=z.z.object({type:z.z.literal("checkout_merge_from_base_request"),cwd:z.z.string(),baseRef:z.z.string().optional(),requireCleanTarget:z.z.boolean().optional(),requestId:z.z.string()}),Kn=z.z.object({type:z.z.literal("checkout_pull_request"),cwd:z.z.string(),requestId:z.z.string()}),Vn=z.z.object({type:z.z.literal("checkout_push_request"),cwd:z.z.string(),requestId:z.z.string()}),Yn=z.z.object({type:z.z.literal("checkout.refresh.request"),cwd:z.z.string(),requestId:z.z.string()}),Qn=z.z.object({type:z.z.literal("checkout_pr_create_request"),cwd:z.z.string(),title:z.z.string().optional(),body:z.z.string().optional(),baseRef:z.z.string().optional(),requestId:z.z.string()}),Xn=z.z.object({type:z.z.literal("checkout_pr_merge_request"),cwd:z.z.string(),mergeMethod:z.z.enum(["merge","squash","rebase"]),requestId:z.z.string()}),$n=z.z.object({type:z.z.literal("checkout.github.set_auto_merge.request"),cwd:z.z.string(),enabled:z.z.boolean(),mergeMethod:z.z.enum(["merge","squash","rebase"]).optional(),requestId:z.z.string()}),Jn=z.z.enum(["too_large","checksum_mismatch","aborted","write_failed","unsupported"]),Zn=z.z.object({type:z.z.literal("files.upload.begin.request"),requestId:z.z.string(),agentId:z.z.string(),uploadId:z.z.string(),metadata:z.z.lazy(()=>y.FileBeginMetadataSchema)}),er=z.z.object({type:z.z.literal("files.upload.complete.request"),requestId:z.z.string(),uploadId:z.z.string(),totalChunks:z.z.number().int().nonnegative()}),tr=z.z.object({type:z.z.literal("files.upload.chunk"),payload:z.z.object({requestId:z.z.string(),uploadId:z.z.string(),chunkIndex:z.z.number().int().nonnegative(),data:z.z.string()})}),nr=z.z.object({type:z.z.literal("files.upload.error"),payload:z.z.object({requestId:z.z.string(),uploadId:z.z.string(),code:Jn,message:z.z.string().optional()})}),rr=z.z.string().regex(/^[A-Za-z0-9._-]+$/),or=z.z.object({type:z.z.literal("checkout.github.get_check_details.request"),cwd:z.z.string(),repoOwner:rr,repoName:rr,checkRunId:z.z.number().int().positive(),workflowRunId:z.z.number().int().positive().optional(),requestId:z.z.string()}),ar=z.z.object({type:z.z.literal("checkout_pr_status_request"),cwd:z.z.string(),requestId:z.z.string()}),ir=z.z.object({type:z.z.literal("pull_request_timeline_request"),cwd:z.z.string(),prNumber:z.z.number(),repoOwner:z.z.string(),repoName:z.z.string(),requestId:z.z.string()}),sr=z.z.object({type:z.z.literal("validate_branch_request"),cwd:z.z.string(),branchName:z.z.string(),requestId:z.z.string()}),lr=z.z.object({type:z.z.literal("checkout_switch_branch_request"),cwd:z.z.string(),branch:z.z.string(),requestId:z.z.string()}),cr=z.z.object({type:z.z.literal("checkout.rename_branch.request"),cwd:z.z.string(),branch:z.z.string(),requestId:z.z.string()}),ur=z.z.object({type:z.z.literal("stash_save_request"),cwd:z.z.string(),branch:z.z.string().optional(),requestId:z.z.string()}),zr=z.z.object({type:z.z.literal("stash_pop_request"),cwd:z.z.string(),stashIndex:z.z.number().int().min(0),requestId:z.z.string()}),pr=z.z.object({type:z.z.literal("stash_list_request"),cwd:z.z.string(),paseoOnly:z.z.boolean().optional(),requestId:z.z.string()}),gr=z.z.object({type:z.z.literal("branch_suggestions_request"),cwd:z.z.string(),query:z.z.string().optional(),limit:z.z.number().int().min(1).max(200).optional(),requestId:z.z.string()}),br=z.z.object({kind:z.z.enum(["issue","pr"]),number:z.z.number(),title:z.z.string(),url:z.z.string(),state:z.z.string(),body:z.z.string().nullable(),labels:z.z.array(z.z.string()),baseRefName:z.z.string().nullable().optional(),headRefName:z.z.string().nullable().optional(),updatedAt:z.z.string().optional()}),dr=z.z.enum(["github-issue","github-pr"]),mr=z.z.object({type:z.z.literal("github_search_request"),cwd:z.z.string(),query:z.z.string(),limit:z.z.number().int().min(1).max(50).optional(),kinds:z.z.array(dr).optional(),requestId:z.z.string()}),fr=z.z.object({type:z.z.literal("directory_suggestions_request"),query:z.z.string(),cwd:z.z.string().optional(),includeFiles:z.z.boolean().optional(),includeDirectories:z.z.boolean().optional(),matchMode:z.z.enum(["fuzzy","suffix"]).optional(),limit:z.z.number().int().min(1).max(100).optional(),requestId:z.z.string()}),yr=z.z.object({type:z.z.literal("paseo_worktree_list_request"),cwd:z.z.string().optional(),repoRoot:z.z.string().optional(),requestId:z.z.string()}),hr=z.z.object({type:z.z.literal("paseo_worktree_archive_request"),worktreePath:z.z.string().optional(),repoRoot:z.z.string().optional(),branchName:z.z.string().optional(),workspaceId:z.z.string().optional(),scope:z.z.enum(["workspace","worktree"]).optional().default("workspace"),deleteWorktreeFromDisk:z.z.boolean().optional().default(!1),requestId:z.z.string()}),jr=z.z.object({prompt:z.z.string().optional(),attachments:yt}),Sr=z.z.object({type:z.z.literal("create_paseo_worktree_request"),cwd:z.z.string(),projectId:z.z.string().optional(),worktreeSlug:z.z.string().optional(),nameContext:z.z.string().optional(),attachments:yt.optional(),firstAgentContext:jr.optional(),refName:z.z.string().min(1).optional(),action:z.z.enum(["branch-off","checkout"]).optional(),githubPrNumber:z.z.number().int().positive().optional(),requestId:z.z.string()}),Pr=z.z.object({type:z.z.literal("workspace_setup_status_request"),workspaceId:z.z.string(),requestId:z.z.string()}),_r=["cursor","vscode","zed","finder","explorer","file-manager"],qr=[..._r,"webstorm"],Ir=z.z.enum(qr),kr=z.z.enum(_r),Or=z.z.string().trim().min(1),Rr=new Set(qr),wr=new Set(_r);const vr=z.z.object({id:Or,label:z.z.string()}),Ar=z.z.object({type:z.z.literal("list_available_editors_request"),requestId:z.z.string()}),Mr=z.z.object({type:z.z.literal("open_in_editor_request"),path:z.z.string(),editorId:z.z.string().trim().min(1),mode:z.z.enum(["open","reveal"]).optional(),cwd:z.z.string().optional(),requestId:z.z.string()}),Cr=z.z.object({type:z.z.literal("open_project_request"),cwd:z.z.string(),requestId:z.z.string()}),Tr=z.z.object({type:z.z.literal("project.add.request"),cwd:z.z.string(),requestId:z.z.string()}),xr=z.z.object({type:z.z.literal("archive_workspace_request"),workspaceId:z.z.string(),requestId:z.z.string()}),Lr=z.z.object({type:z.z.literal("workspace.create.request"),requestId:z.z.string(),title:z.z.string().optional(),firstAgentContext:jr.optional(),source:z.z.discriminatedUnion("kind",[z.z.object({kind:z.z.literal("directory"),path:z.z.string(),projectId:z.z.string().optional()}),z.z.object({kind:z.z.literal("worktree"),cwd:z.z.string().optional(),projectId:z.z.string().optional(),action:z.z.enum(["branch-off","checkout"]).optional(),refName:z.z.string().min(1).optional(),baseBranch:z.z.string().optional(),githubPrNumber:z.z.number().int().positive().optional(),worktreeSlug:z.z.string().optional()})])}),Dr=z.z.object({type:z.z.literal("workspace.clear_attention.request"),workspaceId:z.z.union([z.z.string(),z.z.array(z.z.string())]),requestId:z.z.string()}),Wr=z.z.object({text:z.z.string(),style:z.z.string().nullable()}),Er=z.z.object({type:z.z.enum(["add","remove","context","header"]),content:z.z.string(),tokens:z.z.array(Wr).optional()}),Nr=z.z.object({oldStart:z.z.number(),oldCount:z.z.number(),newStart:z.z.number(),newCount:z.z.number(),lines:z.z.array(Er)}),Ur=z.z.object({path:z.z.string(),isNew:z.z.boolean(),isDeleted:z.z.boolean(),additions:z.z.number(),deletions:z.z.number(),hunks:z.z.array(Nr),status:z.z.enum(["ok","too_large","binary"]).optional()}),Fr=z.z.object({name:z.z.string(),path:z.z.string(),kind:z.z.enum(["file","directory"]),size:z.z.number(),modifiedAt:z.z.string()}),Br=z.z.object({path:z.z.string(),kind:z.z.enum(["text","image","binary"]),encoding:z.z.enum(["utf-8","base64","none"]),content:z.z.string().optional(),mimeType:z.z.string().optional(),size:z.z.number(),modifiedAt:z.z.string()}),Gr=z.z.object({path:z.z.string(),entries:z.z.array(Fr)}),Hr=z.z.object({type:z.z.literal("file_explorer_request"),cwd:z.z.string(),path:z.z.string().optional(),mode:z.z.enum(["list","file"]),requestId:z.z.string(),acceptBinary:z.z.boolean().optional()}),Kr=z.z.object({type:z.z.literal("project_icon_request"),cwd:z.z.string(),requestId:z.z.string()}),Vr=z.z.object({type:z.z.literal("file_download_token_request"),cwd:z.z.string(),path:z.z.string(),requestId:z.z.string()}),Yr=z.z.object({type:z.z.literal("file.upload.request"),fileName:z.z.string().min(1),mimeType:z.z.string().min(1),size:z.z.number().int().nonnegative(),modifiedAt:z.z.string(),requestId:z.z.string()}),Qr=z.z.object({type:z.z.literal("clear_agent_attention"),agentId:z.z.union([z.z.string(),z.z.array(z.z.string())]),requestId:z.z.string().optional()}),Xr=z.z.object({type:z.z.literal("client_heartbeat"),deviceType:z.z.enum(["web","mobile"]),focusedAgentId:z.z.string().nullable(),focusedTerminalId:z.z.string().nullable().optional().default(null),lastActivityAt:z.z.string(),appVisible:z.z.boolean(),appVisibilityChangedAt:z.z.string().optional()}),$r=z.z.object({type:z.z.literal("ping"),requestId:z.z.string(),clientSentAt:z.z.number().int().optional()}),Jr=z.z.object({provider:m.AgentProviderSchema,cwd:z.z.string(),modeId:z.z.string().optional(),model:z.z.string().optional(),thinkingOptionId:z.z.string().optional(),featureValues:z.z.record(z.z.string(),z.z.unknown()).optional()}),Zr=z.z.object({type:z.z.literal("list_provider_features_request"),draftConfig:Jr,requestId:z.z.string()}),eo=z.z.object({type:z.z.literal("list_commands_request"),agentId:z.z.string(),draftConfig:Jr.optional(),requestId:z.z.string()}),to=z.z.object({type:z.z.literal("register_push_token"),token:z.z.string()}),no=z.z.object({type:z.z.literal("rewind_session_request"),requestId:z.z.string(),agentId:z.z.string(),turnId:z.z.string()}),ro=z.z.object({type:z.z.literal("rewind_session_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),newSessionId:z.z.string().optional(),linesCopied:z.z.number().int().nonnegative().optional(),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),oo=z.z.object({type:z.z.literal("edit_message_request"),requestId:z.z.string(),agentId:z.z.string(),turnId:z.z.string(),newContent:z.z.string().optional()}),ao=z.z.object({type:z.z.literal("edit_message_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),newSessionId:z.z.string().optional(),linesCopied:z.z.number().int().nonnegative().optional(),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),io=z.z.object({type:z.z.literal("list_workspace_sessions_request"),requestId:z.z.string(),workspaceId:z.z.string()}),so=z.z.object({sid:z.z.string(),title:z.z.string().nullable(),lastActivity:z.z.string(),cwd:z.z.string(),agentName:z.z.string().nullable()}),lo=z.z.object({type:z.z.literal("list_workspace_sessions_response"),payload:z.z.object({requestId:z.z.string(),workspaceId:z.z.string(),sessions:z.z.array(so),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),co=z.z.object({type:z.z.literal("list_all_sessions_request"),requestId:z.z.string()}),uo=z.z.object({sid:z.z.string(),title:z.z.string().nullable(),lastActivity:z.z.string(),cwd:z.z.string(),agentName:z.z.string().nullable()}),zo=z.z.object({type:z.z.literal("list_all_sessions_response"),payload:z.z.object({requestId:z.z.string(),sessions:z.z.array(uo),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),po=z.z.object({id:z.z.string(),title:z.z.string(),icon:z.z.string().optional()}),go=z.z.object({id:z.z.string(),title:z.z.string(),icon:z.z.string().optional(),command:z.z.string().optional(),view:z.z.string().optional(),order:z.z.number().optional()}),bo=z.z.object({id:z.z.string(),title:z.z.string(),location:z.z.enum(["sidebar","panel"]).optional(),ui:z.z.string(),uiUrl:z.z.string().optional()}),mo=z.z.object({id:z.z.string(),name:z.z.string(),version:z.z.string(),commands:z.z.array(po),sidebarItems:z.z.array(go),views:z.z.array(bo)}),fo=z.z.object({type:z.z.literal("extensions.list.request"),requestId:z.z.string()}),yo=z.z.object({type:z.z.literal("extensions.list.response"),payload:z.z.object({requestId:z.z.string(),extensions:z.z.array(mo),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),ho=z.z.object({type:z.z.literal("extensions.command.execute.request"),requestId:z.z.string(),commandId:z.z.string(),args:z.z.array(z.z.unknown()).optional()}),jo=z.z.object({type:z.z.literal("extensions.command.execute.response"),payload:z.z.object({requestId:z.z.string(),ok:z.z.boolean(),result:z.z.unknown().optional(),error:z.z.string().optional()})}),So=z.z.object({type:z.z.literal("search_sessions_request"),requestId:z.z.string(),query:z.z.string(),limit:z.z.number().int().positive().optional(),sources:z.z.array(z.z.string()).optional()}),Po=z.z.object({sid:z.z.string(),source:z.z.string(),cwd:z.z.string(),timestamp:z.z.string(),snippet:z.z.string(),resumeCommand:z.z.string()}),_o=z.z.object({type:z.z.literal("search_sessions_response"),payload:z.z.object({requestId:z.z.string(),query:z.z.string(),results:z.z.array(Po),error:z.z.string().optional(),errorCode:z.z.string().optional()})}),qo=z.z.object({endpoint:z.z.string(),keys:z.z.object({p256dh:z.z.string(),auth:z.z.string()}),expirationTime:z.z.union([z.z.number(),z.z.null()]).optional()}),Io=z.z.discriminatedUnion("type",[z.z.object({type:z.z.literal("expo"),token:z.z.string().min(1)}),z.z.object({type:z.z.literal("web"),subscription:qo})]),ko=z.z.object({type:z.z.literal("subscribe_push_request"),requestId:z.z.string(),subscription:Io}),Oo=z.z.object({type:z.z.literal("subscribe_push_response"),payload:z.z.object({requestId:z.z.string(),ok:z.z.boolean(),error:z.z.string().optional(),errorCode:z.z.string().optional(),vapidPublicKey:z.z.string().optional()})}),Ro=z.z.object({type:z.z.literal("get_vapid_public_key_request"),requestId:z.z.string()}),wo=z.z.object({type:z.z.literal("get_vapid_public_key_response"),payload:z.z.object({requestId:z.z.string(),publicKey:z.z.string().nullable(),error:z.z.string().optional()})}),vo=z.z.object({type:z.z.literal("list_terminals_request"),cwd:z.z.string().optional(),workspaceId:z.z.string().optional(),requestId:z.z.string()}),Ao=z.z.object({type:z.z.literal("subscribe_terminals_request"),cwd:z.z.string(),workspaceId:z.z.string().optional()}),Mo=z.z.object({type:z.z.literal("unsubscribe_terminals_request"),cwd:z.z.string(),workspaceId:z.z.string().optional()}),Co=z.z.object({type:z.z.literal("create_terminal_request"),cwd:z.z.string(),workspaceId:z.z.string().optional(),name:z.z.string().optional(),agentId:z.z.string().optional(),command:z.z.string().optional(),args:z.z.array(z.z.string()).optional(),requestId:z.z.string()}),To=z.z.object({type:z.z.literal("terminal.rename.request"),terminalId:z.z.string(),title:z.z.string(),requestId:z.z.string()}),xo=z.z.object({type:z.z.literal("start_workspace_script_request"),workspaceId:z.z.string(),scriptName:z.z.string(),requestId:z.z.string()}),Lo=z.z.object({type:z.z.literal("subscribe_terminal_request"),terminalId:z.z.string(),requestId:z.z.string(),restore:z.z.object({mode:z.z.enum(["live","visible-snapshot","full-snapshot"]),scrollbackLines:z.z.number().int().nonnegative().optional(),size:z.z.object({rows:z.z.number().int().positive(),cols:z.z.number().int().positive()}).optional()}).optional()}),Do=z.z.object({type:z.z.literal("unsubscribe_terminal_request"),terminalId:z.z.string()}),Wo=z.z.discriminatedUnion("type",[z.z.object({type:z.z.literal("input"),data:z.z.string()}),z.z.object({type:z.z.literal("resize"),rows:z.z.number(),cols:z.z.number()}),z.z.object({type:z.z.literal("mouse"),row:z.z.number(),col:z.z.number(),button:z.z.number(),action:z.z.enum(["down","up","move"])})]),Eo=z.z.object({type:z.z.literal("terminal_input"),terminalId:z.z.string(),message:Wo}),No=z.z.object({type:z.z.literal("kill_terminal_request"),terminalId:z.z.string(),requestId:z.z.string()}),Uo=z.z.object({type:z.z.literal("capture_terminal_request"),terminalId:z.z.string(),start:z.z.number().int().optional(),end:z.z.number().int().optional(),stripAnsi:z.z.boolean().default(!0),requestId:z.z.string()}),Fo=z.z.discriminatedUnion("type",[_.BrowserAutomationExecuteResponseSchema,Be,Ge,He,St,qt,It,_t,kt,Ve,Ye,tt,$e,Ze,rt,ot,at,it,st,lt,Ot,Rt,wt,vt,H,V,Q,$,te,At,Mt,Ct,Tt,xt,Lt,Dt,Wt,Et,Ft,Bt,Gt,Zr,Ht,Kt,Vt,Yt,Qt,Xt,$t,Jt,Zt,en,nn,tn,rn,an,sn,ln,zn,gn,mn,yn,jn,_n,Cn,Nn,Un,Fn,Bn,Gn,Hn,Kn,Vn,Yn,Qn,Xn,$n,Zn,er,tr,nr,or,ar,ir,lr,cr,ur,zr,pr,sr,gr,mr,fr,yr,hr,Sr,Pr,Ar,Mr,Cr,Tr,xr,Lr,Dr,Hr,Kr,Vr,Yr,Qr,Xr,$r,eo,to,no,oo,io,co,fo,ho,So,ko,Ro,vo,Ao,Mo,Co,To,xo,Lo,Do,Eo,No,Uo,h.ChatCreateRequestSchema,h.ChatListRequestSchema,h.ChatInspectRequestSchema,h.ChatDeleteRequestSchema,h.ChatPostRequestSchema,h.ChatReadRequestSchema,h.ChatWaitRequestSchema,j.ScheduleCreateRequestSchema,j.ScheduleListRequestSchema,j.ScheduleInspectRequestSchema,j.ScheduleLogsRequestSchema,j.SchedulePauseRequestSchema,j.ScheduleResumeRequestSchema,j.ScheduleDeleteRequestSchema,j.ScheduleRunOnceRequestSchema,j.ScheduleUpdateRequestSchema,S.LoopRunRequestSchema,S.LoopListRequestSchema,S.LoopInspectRequestSchema,S.LoopLogsRequestSchema,S.LoopStopRequestSchema,P.FleetListRequestSchema,P.FleetInspectRequestSchema,P.FleetRunNowRequestSchema,P.FleetPauseRequestSchema,P.FleetResumeRequestSchema,P.FleetSetModeRequestSchema,P.FleetAskRequestSchema,P.FleetDecisionsRequestSchema,P.FleetResolveDecisionRequestSchema,P.FleetSetParamsRequestSchema,P.FleetCreateRequestSchema,P.FleetExecutionsRequestSchema,Tn,xn,Ln]),Bo=z.z.object({id:z.z.string(),timestamp:z.z.coerce.date(),type:z.z.enum(["transcript","assistant","tool_call","tool_result","error","system"]),content:z.z.string(),metadata:z.z.record(z.z.string(),z.z.unknown()).optional()}),Go=z.z.object({type:z.z.literal("activity_log"),payload:Bo}),Ho=z.z.object({type:z.z.literal("assistant_chunk"),payload:z.z.object({chunk:z.z.string()})}),Ko=z.z.object({type:z.z.literal("audio_output"),payload:z.z.object({audio:z.z.string(),format:z.z.string(),id:z.z.string(),isVoiceMode:z.z.boolean(),groupId:z.z.string().optional(),chunkIndex:z.z.number().int().nonnegative().optional(),isLastChunk:z.z.boolean().optional()})}),Vo=z.z.object({type:z.z.literal("transcription_result"),payload:z.z.object({text:z.z.string(),language:z.z.string().optional(),duration:z.z.number().optional(),requestId:z.z.string(),avgLogprob:z.z.number().optional(),isLowConfidence:z.z.boolean().optional(),byteLength:z.z.number().optional(),format:z.z.string().optional(),debugRecordingPath:z.z.string().optional()})}),Yo=z.z.object({type:z.z.literal("voice_input_state"),payload:z.z.object({isSpeaking:z.z.boolean()})}),Qo=z.z.object({type:z.z.literal("dictation_stream_ack"),payload:z.z.object({dictationId:z.z.string(),ackSeq:z.z.number().int()})}),Xo=z.z.object({type:z.z.literal("dictation_stream_finish_accepted"),payload:z.z.object({dictationId:z.z.string(),timeoutMs:z.z.number().int().positive()})}),$o=z.z.object({type:z.z.literal("dictation_stream_partial"),payload:z.z.object({dictationId:z.z.string(),text:z.z.string()})}),Jo=z.z.object({type:z.z.literal("dictation_stream_final"),payload:z.z.object({dictationId:z.z.string(),text:z.z.string(),debugRecordingPath:z.z.string().optional()})}),Zo=z.z.object({type:z.z.literal("dictation_stream_error"),payload:z.z.object({dictationId:z.z.string(),error:z.z.string(),retryable:z.z.boolean(),reasonCode:z.z.string().optional(),missingModelIds:z.z.array(z.z.string()).optional(),debugRecordingPath:z.z.string().optional()})}),ea=z.z.object({enabled:z.z.boolean(),reason:z.z.string()}),ta=z.z.object({dictation:ea,voice:ea}),na=z.z.object({voice:ta.optional()}).passthrough(),ra=z.z.unknown().transform(e=>{if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null}),oa=z.z.unknown().transform(e=>{if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null}),aa=z.z.unknown().optional().transform(e=>{if(void 0===e)return;const t=na.safeParse(e);return t.success?t.data:void 0}),ia=z.z.object({status:z.z.literal("server_info"),serverId:z.z.string().trim().min(1),hostname:ra.optional(),version:oa.optional(),capabilities:aa.optional(),features:z.z.object({providersSnapshot:z.z.boolean().optional(),checkoutGithubSetAutoMerge:z.z.boolean().optional(),githubCheckDetails:z.z.boolean().optional(),daemonStatusRpc:z.z.boolean().optional(),"terminal-restore-modes":z.z.boolean().optional(),rewind:z.z.boolean().optional(),checkoutRefresh:z.z.boolean().optional(),recallSearch:z.z.boolean().optional(),fileUploads:z.z.boolean().optional(),sessionsListRpc:z.z.boolean().optional(),loopDecisions:z.z.boolean().optional(),workflows:z.z.boolean().optional(),extensions:z.z.boolean().optional(),sessionDigest:z.z.boolean().optional(),workspaceMultiplicity:z.z.boolean().optional(),projectRemove:z.z.boolean().optional(),projectAdd:z.z.boolean().optional(),worktreeRestore:z.z.boolean().optional(),providerUsageList:z.z.boolean().optional(),agentDetach:z.z.boolean().optional(),daemonDiagnostics:z.z.boolean().optional(),daemonSelfUpdate:z.z.boolean().optional(),agentForkContext:z.z.boolean().optional(),meetingsLiveCapture:z.z.boolean().optional(),kanbanBoardConfig:z.z.boolean().optional()}).optional()}).passthrough().transform(e=>Object.assign({},e,{hostname:e.hostname??null,version:e.version??null})),sa=z.z.object({type:z.z.literal("status"),payload:z.z.object({status:z.z.string()}).passthrough()}),la=z.z.object({type:z.z.literal("pong"),payload:z.z.object({requestId:z.z.string(),clientSentAt:z.z.number().int().optional(),serverReceivedAt:z.z.number().int(),serverSentAt:z.z.number().int()})}),ca=z.z.object({type:z.z.literal("rpc_error"),payload:z.z.object({requestId:z.z.string(),requestType:z.z.string().optional(),error:z.z.string(),code:z.z.string().optional()})}),ua=z.z.object({agentId:z.z.string(),requestId:z.z.string()}),za=ua.extend({timelineSize:z.z.number().optional()}),pa=z.z.object({status:z.z.literal("agent_created"),agent:Ne}).extend(ua.shape),ga=z.z.object({status:z.z.literal("agent_create_failed"),requestId:z.z.string(),error:z.z.string(),errorCode:z.z.string().optional()}),ba=z.z.object({status:z.z.literal("agent_resumed"),agent:Ne}).extend(za.shape),da=z.z.object({status:z.z.literal("agent_refreshed")}).extend(za.shape),ma=z.z.object({status:z.z.literal("restart_requested"),clientId:z.z.string(),reason:z.z.string().optional(),requestId:z.z.string()}),fa=z.z.object({status:z.z.literal("shutdown_requested"),clientId:z.z.string(),requestId:z.z.string()}),ya=z.z.object({status:z.z.literal("daemon_config_changed"),config:T}).passthrough(),ha=z.z.discriminatedUnion("status",[pa,ga,ba,da,fa,ma,ya]),ja=z.z.object({type:z.z.literal("artifact"),payload:z.z.object({type:z.z.enum(["markdown","diff","image","code"]),id:z.z.string(),title:z.z.string(),content:z.z.string(),isBase64:z.z.boolean()})}),Sa=z.z.object({cwd:z.z.string(),isGit:z.z.literal(!1),currentBranch:z.z.null(),remoteUrl:z.z.null(),worktreeRoot:z.z.null().optional(),isPaseoOwnedWorktree:z.z.literal(!1),mainRepoRoot:z.z.null()}).transform(e=>Object.assign({},e,{worktreeRoot:null})),Pa=z.z.object({cwd:z.z.string(),isGit:z.z.literal(!0),currentBranch:z.z.string().nullable(),remoteUrl:z.z.string().nullable(),worktreeRoot:z.z.string().optional(),isPaseoOwnedWorktree:z.z.literal(!1),mainRepoRoot:z.z.string().nullable().optional().default(null)}).transform(e=>Object.assign({},e,{worktreeRoot:e.worktreeRoot??e.cwd})),_a=z.z.object({cwd:z.z.string(),isGit:z.z.literal(!0),currentBranch:z.z.string().nullable(),remoteUrl:z.z.string().nullable(),worktreeRoot:z.z.string().optional(),isPaseoOwnedWorktree:z.z.literal(!0),mainRepoRoot:z.z.string()}).transform(e=>Object.assign({},e,{worktreeRoot:e.worktreeRoot??e.cwd})),qa=z.z.union([Sa,Pa,_a]),Ia=z.z.object({projectKey:z.z.string(),projectName:z.z.string(),workspaceName:z.z.string().nullable().optional(),checkout:qa}),ka=z.z.enum(["running","stopped"]),Oa=z.z.enum(["healthy","unhealthy"]),Ra=z.z.object({scriptName:z.z.string(),type:z.z.enum(["script","service"]).optional().default("service"),hostname:z.z.string(),port:z.z.number().int().positive().nullable(),localProxyUrl:z.z.string().nullable().optional(),publicProxyUrl:z.z.string().nullable().optional(),proxyUrl:z.z.string().nullable().optional().default(null),lifecycle:ka,health:Oa.nullable(),exitCode:z.z.number().nullable().optional().default(null),terminalId:z.z.string().nullable().optional().default(null)}),wa=z.z.object({currentBranch:z.z.string().nullable().optional(),remoteUrl:z.z.string().nullable().optional(),isPaseoOwnedWorktree:z.z.boolean().optional(),isDirty:z.z.boolean().nullable().optional(),aheadBehind:z.z.object({ahead:z.z.number(),behind:z.z.number()}).nullable().optional(),aheadOfOrigin:z.z.number().nullable().optional(),behindOfOrigin:z.z.number().nullable().optional()}).optional().nullable(),va=z.z.object({featuresEnabled:z.z.boolean().optional(),pullRequest:z.z.object({number:z.z.number().optional(),url:z.z.string(),title:z.z.string(),state:z.z.string(),baseRefName:z.z.string(),headRefName:z.z.string(),isMerged:z.z.boolean(),isDraft:z.z.boolean().optional(),mergeable:z.z.enum(["MERGEABLE","CONFLICTING","UNKNOWN"]).catch("UNKNOWN").optional(),checks:z.z.array(z.z.object({name:z.z.string(),status:z.z.enum(["success","failure","pending","skipped","cancelled"]),url:z.z.string().nullable(),workflow:z.z.string().optional(),duration:z.z.string().optional()})).optional(),checksStatus:z.z.enum(["none","pending","success","failure"]).optional(),reviewDecision:z.z.enum(["approved","changes_requested","pending"]).nullable().optional(),repoOwner:z.z.string().optional(),repoName:z.z.string().optional(),github:z.z.unknown().optional()}).nullable().optional(),error:z.z.object({message:z.z.string()}).nullable().optional(),refreshedAt:z.z.string().nullable().optional()}).optional().nullable(),Aa=z.z.object({id:z.z.string(),projectId:z.z.string(),projectDisplayName:z.z.string(),projectCustomName:z.z.string().nullable().optional(),projectRootPath:z.z.string(),workspaceDirectory:z.z.string().optional(),projectKind:z.z.enum(["git","non_git","directory"]),workspaceKind:z.z.enum(["directory","local_checkout","checkout","worktree"]),name:z.z.string(),title:z.z.string().nullable().optional(),archivingAt:z.z.string().nullable().optional().default(null),status:Pt,statusEnteredAt:z.z.string().nullish().transform(e=>e??null),activityAt:z.z.string().nullable(),diffStat:z.z.object({additions:z.z.number(),deletions:z.z.number()}).nullable().optional(),scripts:z.z.array(Ra).default([]),gitRuntime:wa,githubRuntime:va,project:Ia.optional()}).transform(e=>Object.assign({},e,{workspaceDirectory:e.workspaceDirectory??e.projectRootPath})),Ma=z.z.object({type:z.z.literal("agent_update"),payload:z.z.discriminatedUnion("kind",[z.z.object({kind:z.z.literal("upsert"),agent:Ne,project:Ia.nullable().optional()}),z.z.object({kind:z.z.literal("remove"),agentId:z.z.string()})])}),Ca=z.z.object({type:z.z.literal("open_url"),payload:z.z.object({url:z.z.string(),agentId:z.z.string().optional()})}),Ta=z.z.object({type:z.z.literal("agent_stream"),payload:z.z.object({agentId:z.z.string(),event:xe,timestamp:z.z.string(),seq:z.z.number().int().nonnegative().optional(),epoch:z.z.string().optional()})}),xa=z.z.object({type:z.z.literal("agent_status"),payload:z.z.object({agentId:z.z.string(),status:z.z.string(),info:Ne})}),La=z.z.object({type:z.z.literal("agent_list"),payload:z.z.object({agents:z.z.array(Ne)})}),Da=z.z.object({agent:Ne,project:Ia}),Wa=z.z.object({nextCursor:z.z.string().nullable(),prevCursor:z.z.string().nullable(),hasMore:z.z.boolean()}),Ea=z.z.object({type:z.z.literal("fetch_agents_response"),payload:z.z.object({requestId:z.z.string(),subscriptionId:z.z.string().nullable().optional(),entries:z.z.array(Da),pageInfo:Wa})}),Na=z.z.object({type:z.z.literal("fetch_agent_history_response"),payload:z.z.object({requestId:z.z.string(),entries:z.z.array(Da),pageInfo:Wa})}),Ua=z.z.object({type:z.z.literal("fetch_recent_provider_sessions_response"),payload:z.z.object({requestId:z.z.string(),entries:z.z.array(Fe),filteredAlreadyImportedCount:z.z.number().int().nonnegative().optional()})}),Fa=z.z.object({projectId:z.z.string(),projectDisplayName:z.z.string(),projectCustomName:z.z.string().nullable().optional(),projectRootPath:z.z.string(),projectKind:z.z.enum(["git","non_git","directory"])}),Ba=z.z.object({type:z.z.literal("fetch_workspaces_response"),payload:z.z.object({requestId:z.z.string(),subscriptionId:z.z.string().nullable().optional(),entries:z.z.array(Aa),emptyProjects:z.z.array(Fa).optional().default([]),pageInfo:z.z.object({nextCursor:z.z.string().nullable(),prevCursor:z.z.string().nullable(),hasMore:z.z.boolean()})})}),Ga=z.z.object({type:z.z.literal("workspace_update"),payload:z.z.discriminatedUnion("kind",[z.z.object({kind:z.z.literal("upsert"),workspace:Aa}),z.z.object({kind:z.z.literal("remove"),id:z.z.string(),emptyProject:Fa.optional(),removedProjectId:z.z.string().optional()})])}),Ha=z.z.object({type:z.z.literal("script_status_update"),payload:z.z.object({workspaceId:z.z.string(),scripts:z.z.array(Ra)})}),Ka=z.z.object({type:z.z.literal("workspace_setup_progress"),payload:z.z.object({workspaceId:z.z.string(),status:z.z.enum(["running","completed","failed"]),detail:ke,error:z.z.string().nullable()})}),Va=z.z.object({status:z.z.enum(["running","completed","failed"]),detail:ke,error:z.z.string().nullable()}),Ya=z.z.object({type:z.z.literal("workspace_setup_status_response"),payload:z.z.object({requestId:z.z.string(),workspaceId:z.z.string(),snapshot:Va.nullable()})}),Qa=z.z.object({type:z.z.literal("open_project_response"),payload:z.z.object({requestId:z.z.string(),workspace:Aa.nullable(),error:z.z.string().nullable(),errorCode:z.z.enum(["directory_not_found"]).nullish().catch(null)})}),Xa=z.z.object({type:z.z.literal("project.add.response"),payload:z.z.object({requestId:z.z.string(),project:Fa.nullable(),error:z.z.string().nullable(),errorCode:z.z.enum(["directory_not_found"]).nullish().catch(null)})}),$a=z.z.object({type:z.z.literal("start_workspace_script_response"),payload:z.z.object({requestId:z.z.string(),workspaceId:z.z.string(),scriptName:z.z.string(),terminalId:z.z.string().nullable(),error:z.z.string().nullable()})}),Ja=z.z.object({type:z.z.literal("list_available_editors_response"),payload:z.z.object({requestId:z.z.string(),editors:z.z.array(z.z.object({id:z.z.string().trim().min(1),label:z.z.string()})),error:z.z.string().nullable()})}),Za=z.z.object({type:z.z.literal("open_in_editor_response"),payload:z.z.object({requestId:z.z.string(),error:z.z.string().nullable()})}),ei=z.z.object({type:z.z.literal("archive_workspace_response"),payload:z.z.object({requestId:z.z.string(),workspaceId:z.z.string(),archivedAt:z.z.string().nullable(),error:z.z.string().nullable()})}),ti=z.z.object({type:z.z.literal("fetch_agent_response"),payload:z.z.object({requestId:z.z.string(),agent:Ne.nullable(),project:Ia.nullable().optional(),error:z.z.string().nullable()})}),ni=z.z.object({startSeq:z.z.number().int().nonnegative(),endSeq:z.z.number().int().nonnegative()}),ri=z.z.object({provider:m.AgentProviderSchema,item:Te,timestamp:z.z.string(),seqStart:z.z.number().int().nonnegative(),seqEnd:z.z.number().int().nonnegative(),sourceSeqRanges:z.z.array(ni),collapsed:z.z.array(z.z.enum(["assistant_merge","reasoning_merge","tool_lifecycle"]))}),oi=z.z.object({type:z.z.literal("fetch_agent_timeline_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),agent:Ne.nullable(),direction:z.z.enum(["tail","before","after"]),projection:z.z.enum(["projected","canonical"]),epoch:z.z.string(),reset:z.z.boolean(),staleCursor:z.z.boolean(),gap:z.z.boolean(),window:z.z.object({minSeq:z.z.number().int().nonnegative(),maxSeq:z.z.number().int().nonnegative(),nextSeq:z.z.number().int().nonnegative()}),startCursor:on.nullable(),endCursor:on.nullable(),hasOlder:z.z.boolean(),hasNewer:z.z.boolean(),entries:z.z.array(ri),error:z.z.string().nullable()})}),ai=z.z.object({type:z.z.literal("agent.fork_context.response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),attachment:zt.nullable(),itemCount:z.z.number().int().nonnegative(),boundaryMessageId:z.z.string().nullable(),error:z.z.string().nullable()})}),ii=z.z.object({type:z.z.literal("cancel_agent_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),agent:Ne.nullable()})}),si=z.z.object({type:z.z.literal("clear_agent_attention_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string().or(z.z.array(z.z.string())),agents:z.z.array(Ne)})}),li=z.z.object({type:z.z.literal("workspace.create.response"),payload:z.z.object({workspace:Aa.nullable(),setupTerminalId:z.z.string().nullable(),error:z.z.string().nullable(),errorCode:z.z.string().optional(),requestId:z.z.string()})}),ci=z.z.object({type:z.z.literal("workspace.clear_attention.response"),payload:z.z.object({requestId:z.z.string(),workspaceId:z.z.union([z.z.string(),z.z.array(z.z.string())]),clearedAgentIds:z.z.array(z.z.string()),results:z.z.array(z.z.object({workspaceId:z.z.string(),clearedAgentIds:z.z.array(z.z.string()),success:z.z.boolean(),error:z.z.string().nullable()})),success:z.z.boolean(),error:z.z.string().nullable()})}),ui=z.z.object({type:z.z.literal("send_agent_message_response"),payload:z.z.object({requestId:z.z.string(),agentId:z.z.string(),accepted:z.z.boolean(),error:z.z.string().nullable()})}),zi=z.z.object({type:z.z.literal("wait_for_finish_response"),payload:z.z.object({requestId:z.z.string(),status:z.z.enum(["idle","error","permission","timeout"]),final:Ne.nullable(),error:z.z.string().nullable(),lastMessage:z.z.string().nullable()})}),pi=z.z.object({type:z.z.literal("get_daemon_config_response"),payload:z.z.object({requestId:z.z.string(),config:T}).passthrough()}),gi=z.z.object({type:z.z.literal("daemon.get_status.response"),payload:z.z.object({requestId:z.z.string(),serverId:z.z.string(),version:z.z.string().nullable().optional(),pid:z.z.number(),nodePath:z.z.string(),startedAt:z.z.string().nullable().optional(),listen:z.z.string().nullable(),relay:z.z.object({enabled:z.z.boolean(),endpoint:z.z.string(),publicEndpoint:z.z.string(),useTls:z.z.boolean(),publicUseTls:z.z.boolean()}).nullable().optional(),providers:z.z.array(z.z.object({provider:z.z.string(),available:z.z.boolean(),error:z.z.string().nullable().optional()}))}).passthrough()}),bi=z.z.object({type:z.z.literal("daemon.get_pairing_offer.response"),payload:z.z.object({requestId:z.z.string(),url:z.z.string(),qr:z.z.string().nullable().optional(),relayEnabled:z.z.boolean()}).passthrough()}),di=z.z.object({type:z.z.literal("diagnostics.response"),payload:z.z.object({requestId:z.z.string(),diagnostic:z.z.string()}).passthrough()}),mi=z.z.object({type:z.z.literal("set_daemon_config_response"),payload:z.z.object({requestId:z.z.string(),config:T}).passthrough()}),fi=z.z.object({type:z.z.literal("read_project_config_response"),payload:z.z.union([z.z.object({requestId:z.z.string(),repoRoot:z.z.string(),ok:z.z.literal(!0),config:I.PaseoConfigRawSchema.nullable(),revision:I.PaseoConfigRevisionSchema.nullable()}),z.z.object({requestId:z.z.string(),repoRoot:z.z.string(),ok:z.z.literal(!1),error:I.ProjectConfigRpcErrorSchema})])}),yi=z.z.object({type:z.z.literal("write_project_config_response"),payload:z.z.union([z.z.object({requestId:z.z.string(),repoRoot:z.z.string(),ok:z.z.literal(!0),config:I.PaseoConfigRawSchema,revision:I.PaseoConfigRevisionSchema}),z.z.object({requestId:z.z.string(),repoRoot:z.z.string(),ok:z.z.literal(!1),error:I.ProjectConfigRpcErrorSchema})])}),hi=z.z.object({type:z.z.literal("agent_permission_request"),payload:z.z.object({agentId:z.z.string(),request:Pe})}),ji=z.z.object({id:z.z.string(),label:z.z.string(),action:z.z.enum(["approve","deny","reply"])}),Si=z.z.object({type:z.z.literal("watch.actionablePush"),notificationId:z.z.string(),sessionId:z.z.string(),kind:z.z.string(),summary:z.z.string(),actions:z.z.array(ji)}),Pi=z.z.object({type:z.z.literal("watch.actionableResolved"),notificationId:z.z.string()}),_i=z.z.object({id:z.z.string(),title:z.z.string(),lastActivity:z.z.string(),snippet:z.z.string()}),qi=z.z.object({type:z.z.literal("watch.sessionSearchResult"),requestId:z.z.string(),results:z.z.array(_i),error:z.z.string().optional()}),Ii=z.z.object({type:z.z.literal("agent_permission_resolved"),payload:z.z.object({agentId:z.z.string(),requestId:z.z.string(),resolution:Se})}),ki=z.z.object({type:z.z.literal("agent_deleted"),payload:z.z.object({agentId:z.z.string(),requestId:z.z.string()})}),Oi=z.z.object({type:z.z.literal("agent_archived"),payload:z.z.object({agentId:z.z.string(),archivedAt:z.z.string(),requestId:z.z.string()})}),Ri=z.z.object({agentId:z.z.string(),archivedAt:z.z.string()}),wi=z.z.object({terminalId:z.z.string(),success:z.z.boolean()}),vi=z.z.object({type:z.z.literal("close_items_response"),payload:z.z.object({agents:z.z.array(Ri),terminals:z.z.array(wi),requestId:z.z.string()})}),Ai=z.z.object({ahead:z.z.number(),behind:z.z.number()}),Mi=z.z.object({cwd:z.z.string(),error:Wn.nullable(),requestId:z.z.string()}),Ci=Mi.extend({isGit:z.z.literal(!1),isPaseoOwnedWorktree:z.z.literal(!1),repoRoot:z.z.null(),currentBranch:z.z.null(),isDirty:z.z.null(),baseRef:z.z.null(),aheadBehind:z.z.null(),aheadOfOrigin:z.z.null(),behindOfOrigin:z.z.null(),hasRemote:z.z.boolean(),remoteUrl:z.z.null()}),Ti=Mi.extend({isGit:z.z.literal(!0),isPaseoOwnedWorktree:z.z.literal(!1),repoRoot:z.z.string(),mainRepoRoot:z.z.string().nullable().optional().default(null),currentBranch:z.z.string().nullable(),isDirty:z.z.boolean(),baseRef:z.z.string().nullable(),aheadBehind:Ai.nullable(),aheadOfOrigin:z.z.number().nullable(),behindOfOrigin:z.z.number().nullable(),hasRemote:z.z.boolean(),remoteUrl:z.z.string().nullable()}),xi=Mi.extend({isGit:z.z.literal(!0),isPaseoOwnedWorktree:z.z.literal(!0),repoRoot:z.z.string(),mainRepoRoot:z.z.string(),currentBranch:z.z.string().nullable(),isDirty:z.z.boolean(),baseRef:z.z.string(),aheadBehind:Ai.nullable(),aheadOfOrigin:z.z.number().nullable(),behindOfOrigin:z.z.number().nullable(),hasRemote:z.z.boolean(),remoteUrl:z.z.string().nullable()}),Li=z.z.object({type:z.z.literal("checkout_status_response"),payload:z.z.union([Ci,Ti,xi])}),Di=z.z.object({enabledAt:z.z.string().nullable().optional().default(null),mergeMethod:z.z.string().nullable().optional().default(null),enabledBy:z.z.string().nullable().optional().default(null)}).nullable().optional().default(null),Wi=z.z.object({autoMergeAllowed:z.z.boolean().optional().default(!1),mergeCommitAllowed:z.z.boolean().optional().default(!1),squashMergeAllowed:z.z.boolean().optional().default(!1),rebaseMergeAllowed:z.z.boolean().optional().default(!1),viewerDefaultMergeMethod:z.z.string().nullable().optional().default(null)}).optional().default({autoMergeAllowed:!1,mergeCommitAllowed:!1,squashMergeAllowed:!1,rebaseMergeAllowed:!1,viewerDefaultMergeMethod:null}),Ei=z.z.object({mergeStateStatus:z.z.string().nullable().optional().default(null),autoMergeRequest:Di,viewerCanEnableAutoMerge:z.z.boolean().optional().default(!1),viewerCanDisableAutoMerge:z.z.boolean().optional().default(!1),viewerCanMergeAsAdmin:z.z.boolean().optional().default(!1),viewerCanUpdateBranch:z.z.boolean().optional().default(!1),repository:Wi,isMergeQueueEnabled:z.z.boolean().optional().default(!1),isInMergeQueue:z.z.boolean().optional().default(!1)}).optional(),Ni=z.z.object({number:z.z.number().optional(),url:z.z.string(),title:z.z.string(),state:z.z.string(),baseRefName:z.z.string(),headRefName:z.z.string(),isMerged:z.z.boolean(),isDraft:z.z.boolean().optional().default(!1),mergeable:z.z.enum(["MERGEABLE","CONFLICTING","UNKNOWN"]).catch("UNKNOWN").optional().default("UNKNOWN"),checks:z.z.array(z.z.object({name:z.z.string(),status:z.z.string(),url:z.z.string().nullable(),workflow:z.z.string().optional(),duration:z.z.string().optional(),checkRunId:z.z.number().optional(),workflowRunId:z.z.number().optional()})).optional().default([]),checksStatus:z.z.string().optional(),reviewDecision:z.z.string().nullable().optional(),repoOwner:z.z.string().optional(),repoName:z.z.string().optional(),github:Ei}),Ui=z.z.object({cwd:z.z.string(),status:Ni.nullable(),githubFeaturesEnabled:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()}),Fi=z.z.object({prStatus:Ui.optional()}),Bi=z.z.object({type:z.z.literal("checkout_status_update"),payload:z.z.union([Ci,Ti,xi]).and(Fi)}),Gi=z.z.object({subscriptionId:z.z.string(),cwd:z.z.string(),files:z.z.array(Ur),error:Wn.nullable()}),Hi=z.z.object({type:z.z.literal("subscribe_checkout_diff_response"),payload:Gi.extend({requestId:z.z.string()})}),Ki=z.z.object({type:z.z.literal("checkout_diff_update"),payload:Gi}),Vi=z.z.object({type:z.z.literal("checkout_commit_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Yi=z.z.object({type:z.z.literal("checkout_merge_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Qi=z.z.object({type:z.z.literal("checkout_merge_from_base_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Xi=z.z.object({type:z.z.literal("checkout_pull_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),$i=z.z.object({type:z.z.literal("checkout_push_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Ji=z.z.object({type:z.z.literal("checkout.refresh.response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Zi=z.z.object({type:z.z.literal("checkout_pr_create_response"),payload:z.z.object({cwd:z.z.string(),url:z.z.string().nullable(),number:z.z.number().nullable(),error:Wn.nullable(),requestId:z.z.string()})}),es=z.z.object({type:z.z.literal("checkout_pr_merge_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),ts=z.z.object({type:z.z.literal("checkout.github.set_auto_merge.response"),payload:z.z.object({cwd:z.z.string(),enabled:z.z.boolean(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),ns=z.z.object({type:z.z.literal("files.upload.begin.response"),payload:z.z.object({requestId:z.z.string(),uploadId:z.z.string(),accepted:z.z.boolean(),chunkSize:z.z.number().int().positive(),error:Jn.nullable()})}),rs=z.z.object({type:z.z.literal("files.upload.chunk.ack"),payload:z.z.object({requestId:z.z.string(),uploadId:z.z.string(),chunkIndex:z.z.number().int().nonnegative(),bytesReceived:z.z.number().int().nonnegative()})}),os=z.z.object({type:z.z.literal("files.upload.complete.response"),payload:z.z.object({requestId:z.z.string(),uploadId:z.z.string(),fileId:z.z.string(),path:z.z.string(),size:z.z.number().int().nonnegative(),mimeType:z.z.string(),error:Jn.nullable()})}),as=z.z.object({path:z.z.string().optional(),startLine:z.z.number().optional(),endLine:z.z.number().optional(),annotationLevel:z.z.string().optional(),message:z.z.string().optional(),title:z.z.string().optional(),rawDetails:z.z.string().optional()}),is=z.z.object({jobId:z.z.number(),name:z.z.string(),status:z.z.string().nullable().optional(),conclusion:z.z.string().nullable().optional(),url:z.z.string().nullable().optional(),logTail:z.z.string().optional(),logTruncated:z.z.boolean().optional()}),ss=z.z.object({checkRunId:z.z.number(),workflowRunId:z.z.number().nullable().optional(),name:z.z.string(),status:z.z.string().nullable().optional(),conclusion:z.z.string().nullable().optional(),url:z.z.string().nullable().optional(),detailsUrl:z.z.string().nullable().optional(),output:z.z.object({title:z.z.string().nullable().optional(),summary:z.z.string().nullable().optional(),text:z.z.string().nullable().optional()}).nullable().optional(),annotations:z.z.array(as).optional().default([]),failedJobs:z.z.array(is).optional().default([]),truncated:z.z.boolean().optional().default(!1)}),ls=z.z.object({type:z.z.literal("checkout.github.get_check_details.response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),details:ss.nullable().optional().default(null),error:Wn.nullable(),requestId:z.z.string()})}),cs=z.z.object({type:z.z.literal("checkout_pr_status_response"),payload:Ui}),us=z.z.discriminatedUnion("kind",[z.z.object({kind:z.z.literal("not_found"),message:z.z.string().optional().default("")}),z.z.object({kind:z.z.literal("forbidden"),message:z.z.string().optional().default("")}),z.z.object({kind:z.z.literal("unknown"),message:z.z.string().optional().default("")})]),zs=z.z.preprocess(e=>{if(!e||"object"!=typeof e||Array.isArray(e))return{kind:"unknown",message:""};const t=e;return"not_found"===t.kind||"forbidden"===t.kind||"unknown"===t.kind?t:Object.assign({},t,{kind:"unknown"})},us),ps=z.z.object({id:z.z.string().optional().default(""),kind:z.z.literal("review"),author:z.z.string().optional().default("unknown"),authorUrl:z.z.string().nullable().optional(),avatarUrl:z.z.string().nullable().optional(),body:z.z.string().optional().default(""),createdAt:z.z.number().optional().default(0),url:z.z.string().optional().default(""),reviewState:z.z.enum(["approved","changes_requested","commented"]).optional().default("commented")}),gs=z.z.object({id:z.z.string().optional().default(""),kind:z.z.literal("comment"),author:z.z.string().optional().default("unknown"),authorUrl:z.z.string().nullable().optional(),avatarUrl:z.z.string().nullable().optional(),body:z.z.string().optional().default(""),createdAt:z.z.number().optional().default(0),url:z.z.string().optional().default(""),reviewId:z.z.string().optional(),location:z.z.object({path:z.z.string(),line:z.z.number().optional(),startLine:z.z.number().optional(),threadId:z.z.string().optional(),isResolved:z.z.boolean().optional(),isOutdated:z.z.boolean().optional()}).optional()}),bs=z.z.preprocess(e=>{if(!e||"object"!=typeof e||Array.isArray(e))return e;const t=e;return"review"===t.kind||"comment"===t.kind?t:Object.assign({},t,{kind:"comment"})},z.z.discriminatedUnion("kind",[ps,gs])),ds=z.z.object({type:z.z.literal("pull_request_timeline_response"),payload:z.z.object({cwd:z.z.string().optional().default(""),prNumber:z.z.number().nullable().optional().default(null),items:z.z.array(bs).optional().default([]),truncated:z.z.boolean().optional().default(!1),error:zs.nullable().optional().default(null),requestId:z.z.string().optional().default(""),githubFeaturesEnabled:z.z.boolean().optional().default(!0)}).optional().prefault({})}),ms=z.z.object({type:z.z.literal("checkout_switch_branch_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),branch:z.z.string(),source:z.z.enum(["local","remote"]).optional(),error:Wn.nullable(),requestId:z.z.string()})}),fs=z.z.object({type:z.z.literal("checkout.rename_branch.response"),payload:z.z.object({requestId:z.z.string(),success:z.z.boolean(),cwd:z.z.string(),currentBranch:z.z.string().nullable(),error:Wn.nullable()})}),ys=z.z.object({index:z.z.number().int().min(0),message:z.z.string(),branch:z.z.string().nullable(),isPaseo:z.z.boolean()}),hs=z.z.object({type:z.z.literal("stash_save_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),js=z.z.object({type:z.z.literal("stash_pop_response"),payload:z.z.object({cwd:z.z.string(),success:z.z.boolean(),error:Wn.nullable(),requestId:z.z.string()})}),Ss=z.z.object({type:z.z.literal("stash_list_response"),payload:z.z.object({cwd:z.z.string(),entries:z.z.array(ys),error:Wn.nullable(),requestId:z.z.string()})}),Ps=z.z.object({type:z.z.literal("validate_branch_response"),payload:z.z.object({exists:z.z.boolean(),resolvedRef:z.z.string().nullable(),isRemote:z.z.boolean(),error:z.z.string().nullable(),requestId:z.z.string()})}),_s=z.z.object({type:z.z.literal("branch_suggestions_response"),payload:z.z.object({branches:z.z.array(z.z.string()),branchDetails:z.z.array(z.z.object({name:z.z.string(),committerDate:z.z.number(),hasLocal:z.z.boolean().optional(),hasRemote:z.z.boolean().optional()})).optional(),error:z.z.string().nullable(),requestId:z.z.string()})}),qs=z.z.object({type:z.z.literal("github_search_response"),payload:z.z.object({items:z.z.array(br),githubFeaturesEnabled:z.z.boolean(),error:z.z.string().nullable(),requestId:z.z.string()})}),Is=z.z.object({type:z.z.literal("directory_suggestions_response"),payload:z.z.object({directories:z.z.array(z.z.string()),entries:z.z.array(z.z.object({path:z.z.string(),kind:z.z.enum(["file","directory"])})).optional().default([]),error:z.z.string().nullable(),requestId:z.z.string()})}),ks=z.z.object({worktreePath:z.z.string(),createdAt:z.z.string(),branchName:z.z.string().nullable().optional(),head:z.z.string().nullable().optional()}),Os=z.z.object({type:z.z.literal("paseo_worktree_list_response"),payload:z.z.object({worktrees:z.z.array(ks),error:Wn.nullable(),requestId:z.z.string()})}),Rs=z.z.object({type:z.z.literal("paseo_worktree_archive_response"),payload:z.z.object({success:z.z.boolean(),removedAgents:z.z.array(z.z.string()).optional(),error:Wn.nullable(),requestId:z.z.string()})}),ws=z.z.object({type:z.z.literal("create_paseo_worktree_response"),payload:z.z.object({workspace:Aa.nullable(),error:z.z.string().nullable(),errorCode:z.z.string().optional(),setupTerminalId:z.z.string().nullable(),requestId:z.z.string()})}),vs=z.z.object({type:z.z.literal("file_explorer_response"),payload:z.z.object({cwd:z.z.string(),path:z.z.string(),mode:z.z.enum(["list","file"]),directory:Gr.nullable(),file:Br.nullable(),error:z.z.string().nullable(),requestId:z.z.string()})}),As=z.z.object({data:z.z.string(),mimeType:z.z.string()}),Ms=z.z.object({type:z.z.literal("project_icon_response"),payload:z.z.object({cwd:z.z.string(),icon:As.nullable(),error:z.z.string().nullable(),requestId:z.z.string()})}),Cs=z.z.object({type:z.z.literal("file_download_token_response"),payload:z.z.object({cwd:z.z.string(),path:z.z.string(),token:z.z.string().nullable(),fileName:z.z.string().nullable(),mimeType:z.z.string().nullable(),size:z.z.number().nullable(),error:z.z.string().nullable(),requestId:z.z.string()})}),Ts=z.z.object({type:z.z.literal("file.upload.response"),payload:z.z.object({requestId:z.z.string(),file:mt.nullable(),error:z.z.string().nullable()})}),xs=z.z.object({type:z.z.literal("list_provider_models_response"),payload:z.z.object({provider:m.AgentProviderSchema,models:z.z.array(ue).optional(),error:z.z.string().nullable().optional(),fetchedAt:z.z.string(),requestId:z.z.string()})}),Ls=z.z.object({type:z.z.literal("list_provider_modes_response"),payload:z.z.object({provider:m.AgentProviderSchema,modes:z.z.array(re).optional(),error:z.z.string().nullable().optional(),fetchedAt:z.z.string(),requestId:z.z.string()})}),Ds=z.z.object({type:z.z.literal("list_provider_features_response"),payload:z.z.object({provider:m.AgentProviderSchema,features:z.z.array(ce).optional(),error:z.z.string().nullable().optional(),fetchedAt:z.z.string(),requestId:z.z.string()})}),Ws=z.z.object({provider:m.AgentProviderSchema,available:z.z.boolean(),error:z.z.string().nullable().optional()}),Es=z.z.object({type:z.z.literal("list_available_providers_response"),payload:z.z.object({providers:z.z.array(Ws),error:z.z.string().nullable().optional(),fetchedAt:z.z.string(),requestId:z.z.string()})}),Ns=z.z.object({type:z.z.literal("get_providers_snapshot_response"),payload:z.z.object({entries:z.z.array(ze),generatedAt:z.z.string(),requestId:z.z.string()})}),Us=z.z.object({type:z.z.literal("providers.reload_config.response"),payload:z.z.object({added:z.z.array(z.z.string()),updated:z.z.array(z.z.string()),removed:z.z.array(z.z.string()),unchanged:z.z.array(z.z.string()),providers:z.z.array(z.z.object({provider:z.z.string(),label:z.z.string(),enabled:z.z.boolean()})),requestId:z.z.string()})}),Fs=z.z.object({type:z.z.literal("providers_snapshot_update"),payload:z.z.object({cwd:z.z.string().optional(),entries:z.z.array(ze),generatedAt:z.z.string()})}),Bs=z.z.object({type:z.z.literal("refresh_providers_snapshot_response"),payload:z.z.object({requestId:z.z.string(),acknowledged:z.z.boolean()})}),Gs=z.z.object({type:z.z.literal("provider_diagnostic_response"),payload:z.z.object({provider:m.AgentProviderSchema,diagnostic:z.z.string(),requestId:z.z.string()})}),Hs=z.z.enum(["default","ok","warning","danger"]),Ks=z.z.enum(["available","unavailable","error"]),Vs=z.z.object({id:z.z.string(),label:z.z.string(),usedPct:z.z.number().nullable().optional(),remainingPct:z.z.number().nullable().optional(),resetsAt:z.z.string().nullable().optional(),runsOutAt:z.z.string().nullable().optional(),shortfallPct:z.z.number().nullable().optional(),tone:Hs.optional()}),Ys=z.z.object({id:z.z.string(),label:z.z.string(),used:z.z.number().nullable().optional(),remaining:z.z.number().nullable().optional(),limit:z.z.number().nullable().optional(),unit:z.z.enum(["usd","credits","requests","tokens"]),resetsAt:z.z.string().nullable().optional(),tone:Hs.optional()}),Qs=z.z.object({id:z.z.string(),label:z.z.string(),value:z.z.string(),tone:Hs.optional()}),Xs=z.z.object({providerId:z.z.string(),displayName:z.z.string(),status:Ks,planLabel:z.z.string().nullable(),sourceLabel:z.z.string().nullable().optional(),fetchedAt:z.z.string().nullable().optional(),nextRefreshAt:z.z.string().nullable().optional(),windows:z.z.array(Vs),balances:z.z.array(Ys).optional(),details:z.z.array(Qs).optional(),error:z.z.string().nullable().optional()}),$s=z.z.object({type:z.z.literal("provider.usage.list.response"),payload:z.z.object({requestId:z.z.string(),fetchedAt:z.z.string(),providers:z.z.array(Xs)})}),Js=z.z.object({name:z.z.string(),description:z.z.string(),argumentHint:z.z.string(),kind:z.z.enum(["command","skill"]).optional().catch("command")}),Zs=z.z.object({type:z.z.literal("list_commands_response"),payload:z.z.object({agentId:z.z.string(),commands:z.z.array(Js),error:z.z.string().nullable(),requestId:z.z.string()})}),el=z.z.object({id:z.z.string(),name:z.z.string(),cwd:z.z.string(),workspaceId:z.z.string().optional(),title:z.z.string().optional(),activity:p.TerminalActivitySchema.nullable().optional()}),tl=z.z.object({char:z.z.string(),fg:z.z.number().optional(),bg:z.z.number().optional(),fgMode:z.z.number().optional(),bgMode:z.z.number().optional(),bold:z.z.boolean().optional(),italic:z.z.boolean().optional(),underline:z.z.boolean().optional(),dim:z.z.boolean().optional(),inverse:z.z.boolean().optional(),strikethrough:z.z.boolean().optional()}),nl=z.z.enum(["block","underline","bar"]),rl=z.z.object({row:z.z.number(),col:z.z.number(),hidden:z.z.boolean().optional(),style:nl.optional(),blink:z.z.boolean().optional()}),ol=z.z.object({rows:z.z.number(),cols:z.z.number(),grid:z.z.array(z.z.array(tl)),scrollback:z.z.array(z.z.array(tl)),cursor:rl,title:z.z.string().optional(),gridWrapped:z.z.array(z.z.boolean()).optional(),scrollbackWrapped:z.z.array(z.z.boolean()).optional()}),al=z.z.object({type:z.z.literal("list_terminals_response"),payload:z.z.object({cwd:z.z.string().optional(),terminals:z.z.array(el.omit({cwd:!0})),requestId:z.z.string()})}),il=z.z.object({type:z.z.literal("terminals_changed"),payload:z.z.object({cwd:z.z.string(),terminals:z.z.array(el.omit({cwd:!0}))})}),sl=z.z.object({type:z.z.literal("create_terminal_response"),payload:z.z.object({terminal:el.nullable(),error:z.z.string().nullable(),requestId:z.z.string()})}),ll=z.z.object({type:z.z.literal("terminal.rename.response"),payload:z.z.object({requestId:z.z.string(),success:z.z.boolean(),error:z.z.string().nullable()})}),cl=z.z.object({type:z.z.literal("subscribe_terminal_response"),payload:z.z.union([z.z.object({terminalId:z.z.string(),slot:z.z.number().int().min(0).max(255),error:z.z.null(),requestId:z.z.string()}),z.z.object({terminalId:z.z.string(),error:z.z.string(),requestId:z.z.string()})])}),ul=z.z.object({type:z.z.literal("kill_terminal_response"),payload:z.z.object({terminalId:z.z.string(),success:z.z.boolean(),requestId:z.z.string()})}),zl=z.z.object({type:z.z.literal("capture_terminal_response"),payload:z.z.object({terminalId:z.z.string(),lines:z.z.array(z.z.string()),totalLines:z.z.number().int().nonnegative(),requestId:z.z.string()})}),pl=z.z.object({type:z.z.literal("terminal_stream_exit"),payload:z.z.object({terminalId:z.z.string()})}),gl=z.z.object({type:z.z.literal("terminal_attention_required"),payload:z.z.object({serverId:z.z.string().optional(),terminalId:z.z.string(),cwd:z.z.string(),workspaceId:z.z.string().optional(),reason:z.z.enum(["finished","needs_input"]),title:z.z.string(),body:z.z.string(),shouldNotify:z.z.boolean()})}),bl=z.z.object({type:z.z.literal("daemon.update.response"),payload:z.z.object({requestId:z.z.string(),success:z.z.boolean(),error:z.z.string().nullable(),previousVersion:z.z.string().nullable(),newVersion:z.z.string().nullable()})}),dl=z.z.object({type:z.z.literal("daemon.update.progress"),payload:z.z.object({requestId:z.z.string(),phase:z.z.enum(["starting","downloading","installing","complete"])})}),ml=z.z.discriminatedUnion("type",[_.BrowserAutomationExecuteRequestSchema,Go,Ho,Ko,Vo,Yo,Qo,Xo,$o,Jo,Zo,sa,la,ca,ja,Ma,Ca,Ga,Ha,Ka,Ya,Ta,xa,Ea,Na,Ua,Ba,Xa,Qa,$a,Ja,Za,ei,ti,oi,ai,ii,si,li,ci,ui,Mn,gi,bi,K,Y,X,J,ne,di,pi,mi,fi,yi,un,pn,bn,dn,fn,hn,Sn,qn,In,On,wn,An,zi,hi,Ii,ki,Oi,nt,Je,et,vi,Li,Bi,Hi,Ki,Vi,Yi,Qi,Xi,$i,Ji,Zi,es,ts,ns,rs,os,nr,ls,cs,ds,ms,fs,hs,js,Ss,Ps,_s,qs,Is,Os,Rs,ws,vs,Ms,Cs,Ts,xs,Ls,Ds,Es,Ns,Us,Fs,Bs,Gs,$s,Zs,al,il,sl,ll,cl,ul,zl,pl,gl,h.ChatCreateResponseSchema,h.ChatListResponseSchema,h.ChatInspectResponseSchema,h.ChatDeleteResponseSchema,h.ChatPostResponseSchema,h.ChatReadResponseSchema,h.ChatWaitResponseSchema,j.ScheduleCreateResponseSchema,j.ScheduleListResponseSchema,j.ScheduleInspectResponseSchema,j.ScheduleLogsResponseSchema,j.SchedulePauseResponseSchema,j.ScheduleResumeResponseSchema,j.ScheduleDeleteResponseSchema,j.ScheduleRunOnceResponseSchema,j.ScheduleUpdateResponseSchema,S.LoopRunResponseSchema,S.LoopListResponseSchema,S.LoopInspectResponseSchema,S.LoopLogsResponseSchema,S.LoopStopResponseSchema,P.FleetListResponseSchema,P.FleetInspectResponseSchema,P.FleetRunNowResponseSchema,P.FleetPauseResponseSchema,P.FleetResumeResponseSchema,P.FleetSetModeResponseSchema,P.FleetAskResponseSchema,P.FleetDecisionsResponseSchema,P.FleetResolveDecisionResponseSchema,P.FleetSetParamsResponseSchema,P.FleetCreateResponseSchema,P.FleetExecutionsResponseSchema,ro,ao,lo,zo,yo,jo,_o,Oo,wo,Si,Pi,qi,dl,bl]),fl=z.z.object({type:z.z.literal("ping")}),yl=z.z.object({type:z.z.literal("pong")}),hl=z.z.object({type:z.z.literal("hello"),clientId:z.z.string().min(1),clientType:z.z.enum(["mobile","browser","cli","mcp"]),protocolVersion:z.z.number().int(),appVersion:z.z.string().optional(),capabilities:z.z.object({voice:z.z.boolean().optional(),pushNotifications:z.z.boolean().optional(),[g.CLIENT_CAPS.reasoningMergeEnum]:z.z.boolean().optional(),[g.CLIENT_CAPS.customModeIcons]:z.z.boolean().optional(),[g.CLIENT_CAPS.terminalReflowableSnapshot]:z.z.boolean().optional(),[g.CLIENT_CAPS.browserHost]:q.BrowserAutomationHostCapabilitySchema.optional()}).passthrough().optional()}),jl=z.z.object({type:z.z.literal("recording_state"),isRecording:z.z.boolean()}),Sl=z.z.object({type:z.z.literal("session"),message:Fo}),Pl=z.z.object({type:z.z.literal("session"),message:ml}),_l=z.z.discriminatedUnion("type",[fl,hl,jl,Sl]),ql=z.z.discriminatedUnion("type",[yl,Pl]);const Il=z.z.object({kind:z.z.literal("permission"),tool_name:z.z.string(),tool_input:z.z.unknown(),agent_id:z.z.string()}),kl=z.z.object({kind:z.z.literal("pre-tool"),tool_name:z.z.string(),tool_input:z.z.unknown(),agent_id:z.z.string()}),Ol=z.z.object({kind:z.z.literal("post-tool"),tool_name:z.z.string(),tool_input:z.z.unknown(),tool_response:z.z.unknown(),agent_id:z.z.string()}),Rl=z.z.object({kind:z.z.literal("status-line"),statusText:z.z.string(),agent_id:z.z.string()}),wl=z.z.object({kind:z.z.literal("session-start"),session_id:z.z.string(),transcript_path:z.z.string(),agent_id:z.z.string()}),vl=z.z.object({kind:z.z.literal("session-end"),session_id:z.z.string(),transcript_path:z.z.string(),agent_id:z.z.string()}),Al=z.z.object({kind:z.z.literal("assistant_message_delta"),delta:z.z.object({text:z.z.string()})}),Ml=z.z.object({kind:z.z.literal("usage_update"),usage:z.z.object({input_tokens:z.z.number().optional(),output_tokens:z.z.number().optional(),cache_creation_input_tokens:z.z.number().optional(),cache_read_input_tokens:z.z.number().optional(),total_cost_usd:z.z.number().optional()})}),Cl=z.z.discriminatedUnion("kind",[Il,kl,Ol,Rl,wl,vl,Al,Ml])},3281,[35,3282,3361,3280,3362,3363,3364,3365,3366,3368,3370,3372,3373,3377,3378,3379]);
|
|
14927
14927
|
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"z",{enumerable:!0,get:function(){return t}});var e=r(_d[0]);Object.keys(e).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(_e,t)||Object.defineProperty(_e,t,{enumerable:!0,get:function(){return e[t]}})});var t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(e),n=t},3282,[3283]);
|
|
14928
14928
|
__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"globalRegistry",{enumerable:!0,get:function(){return t.globalRegistry}}),Object.defineProperty(_e,"registry",{enumerable:!0,get:function(){return t.registry}}),Object.defineProperty(_e,"config",{enumerable:!0,get:function(){return t.config}}),Object.defineProperty(_e,"$output",{enumerable:!0,get:function(){return t.$output}}),Object.defineProperty(_e,"$input",{enumerable:!0,get:function(){return t.$input}}),Object.defineProperty(_e,"$brand",{enumerable:!0,get:function(){return t.$brand}}),Object.defineProperty(_e,"clone",{enumerable:!0,get:function(){return t.clone}}),Object.defineProperty(_e,"regexes",{enumerable:!0,get:function(){return t.regexes}}),Object.defineProperty(_e,"treeifyError",{enumerable:!0,get:function(){return t.treeifyError}}),Object.defineProperty(_e,"prettifyError",{enumerable:!0,get:function(){return t.prettifyError}}),Object.defineProperty(_e,"formatError",{enumerable:!0,get:function(){return t.formatError}}),Object.defineProperty(_e,"flattenError",{enumerable:!0,get:function(){return t.flattenError}}),Object.defineProperty(_e,"TimePrecision",{enumerable:!0,get:function(){return t.TimePrecision}}),Object.defineProperty(_e,"util",{enumerable:!0,get:function(){return t.util}}),Object.defineProperty(_e,"NEVER",{enumerable:!0,get:function(){return t.NEVER}}),Object.defineProperty(_e,"toJSONSchema",{enumerable:!0,get:function(){return p.toJSONSchema}}),Object.defineProperty(_e,"fromJSONSchema",{enumerable:!0,get:function(){return d.fromJSONSchema}}),Object.defineProperty(_e,"ZodISODateTime",{enumerable:!0,get:function(){return P.ZodISODateTime}}),Object.defineProperty(_e,"ZodISODate",{enumerable:!0,get:function(){return P.ZodISODate}}),Object.defineProperty(_e,"ZodISOTime",{enumerable:!0,get:function(){return P.ZodISOTime}}),Object.defineProperty(_e,"ZodISODuration",{enumerable:!0,get:function(){return P.ZodISODuration}}),Object.defineProperty(_e,"core",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"locales",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"iso",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"coerce",{enumerable:!0,get:function(){return E}});var t=r(_d[0]),n=e(t),o=r(_d[1]);Object.keys(o).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return o[e]}})});var u=r(_d[2]);Object.keys(u).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return u[e]}})});var c=r(_d[3]);Object.keys(c).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return c[e]}})});var f=r(_d[4]);Object.keys(f).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return f[e]}})});var b=r(_d[5]);Object.keys(b).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return b[e]}})});var l,O=r(_d[6]),y=(l=O)&&l.__esModule?l:{default:l},p=r(_d[7]),d=r(_d[8]),j=e(r(_d[9])),P=r(_d[10]),s=e(P),E=e(r(_d[11]));(0,t.config)((0,y.default)())},3283,[3284,3353,3354,3357,3356,3358,3304,3350,3359,3294,3355,3360]);
|
|
14929
14929
|
__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var c=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,c.get?c:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"toJSONSchema",{enumerable:!0,get:function(){return P.toJSONSchema}}),Object.defineProperty(_e,"JSONSchemaGenerator",{enumerable:!0,get:function(){return s.JSONSchemaGenerator}}),Object.defineProperty(_e,"util",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"regexes",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"locales",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"JSONSchema",{enumerable:!0,get:function(){return h}});var t=r(_d[0]);Object.keys(t).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return t[e]}})});var n=r(_d[1]);Object.keys(n).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return n[e]}})});var c=r(_d[2]);Object.keys(c).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return c[e]}})});var o=r(_d[3]);Object.keys(o).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return o[e]}})});var u=r(_d[4]);Object.keys(u).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return u[e]}})});var f=r(_d[5]);Object.keys(f).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return f[e]}})});var b=e(r(_d[6])),O=e(r(_d[7])),l=e(r(_d[8])),p=r(_d[9]);Object.keys(p).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return p[e]}})});var y=r(_d[10]);Object.keys(y).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return y[e]}})});var j=r(_d[11]);Object.keys(j).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return j[e]}})});var d=r(_d[12]);Object.keys(d).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return d[e]}})});var P=r(_d[13]),s=r(_d[14]),h=e(r(_d[15]))},3284,[3285,3286,3287,3289,3290,3293,3288,3291,3294,3347,3292,3348,3349,3350,3351,3352]);
|
|
@@ -15048,7 +15048,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
15048
15048
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"decodeOfferFragmentPayload",{enumerable:!0,get:function(){return n.decodeOfferFragmentPayload}}),Object.defineProperty(e,"buildDaemonWebSocketUrl",{enumerable:!0,get:function(){return t.buildDaemonWebSocketUrl}}),Object.defineProperty(e,"deriveLabelFromEndpoint",{enumerable:!0,get:function(){return t.deriveLabelFromEndpoint}}),Object.defineProperty(e,"extractHostPortFromWebSocketUrl",{enumerable:!0,get:function(){return t.extractHostPortFromWebSocketUrl}}),Object.defineProperty(e,"normalizeHostPort",{enumerable:!0,get:function(){return t.normalizeHostPort}}),Object.defineProperty(e,"parseConnectionUri",{enumerable:!0,get:function(){return t.parseConnectionUri}}),Object.defineProperty(e,"parseHostPort",{enumerable:!0,get:function(){return t.parseHostPort}}),Object.defineProperty(e,"serializeConnectionUri",{enumerable:!0,get:function(){return t.serializeConnectionUri}}),Object.defineProperty(e,"serializeConnectionUriForStorage",{enumerable:!0,get:function(){return t.serializeConnectionUriForStorage}}),Object.defineProperty(e,"shouldUseTlsForDefaultHostedRelay",{enumerable:!0,get:function(){return t.shouldUseTlsForDefaultHostedRelay}}),e.buildRelayWebSocketUrl=function(n){return(0,t.buildRelayWebSocketUrl)(Object.assign({},n,{role:"client"}))};var t=r(d[0]),n=r(d[1])},3403,[3383,3404]);
|
|
15049
15049
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ConnectionOfferV2Schema",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ConnectionOfferSchema",{enumerable:!0,get:function(){return o}}),e.decodeOfferFragmentPayload=l,e.parseConnectionOfferFromUrl=function(n){const t=f(n);if(!t)return null;const c=l(t);return o.parse(c)};var n=r(d[0]);const t=n.z.object({v:n.z.literal(2),serverId:n.z.string().min(1),daemonPublicKeyB64:n.z.string().min(1),relay:n.z.object({endpoint:n.z.string().min(1),useTls:n.z.boolean().optional()})}),o=t;function c(n){const t=n.replace(/-/g,"+").replace(/_/g,"/"),o=t.padEnd(t.length+(4-t.length%4)%4,"="),c=globalThis.atob(o),l=Uint8Array.from(c,n=>n.charCodeAt(0));return new TextDecoder("utf-8",{fatal:!0}).decode(l)}function l(n){const t=c(n);return JSON.parse(t)}const u="#offer=";function f(n){const t=n.trim();if(!t)return null;const o=t.indexOf(u);if(-1===o)return null;const c=t.slice(o+u.length).trim();return c.length>0?c:null}},3404,[3282]);
|
|
15050
15050
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.resolveAppVersion=function(){const e=u(t.default?.version);if(e)return e;const o=u(n.default.expoConfig?.version);if(o)return o;const f=u(n.default.manifest?.version);if(f)return f;return null};var n=e(r(d[0])),t=e(r(d[1]));function u(e){if("string"!=typeof e)return null;const n=e.trim();return 0===n.length?null:n}},3405,[1006,3406]);
|
|
15051
|
-
__d(function(e,t,r,a,o,i,n){o.exports={name:"@hyperdrive.bot/paseo-app",version:"0.3.
|
|
15051
|
+
__d(function(e,t,r,a,o,i,n){o.exports={name:"@hyperdrive.bot/paseo-app",version:"0.3.41",private:!0,main:"index.ts",scripts:{start:"npm run start:expo","start:expo":"cross-env APP_VARIANT=development expo start","reset-project":"node ./scripts/reset-project.js","build:terminal-webview":"node ./scripts/build-terminal-webview-html.mjs","eas-build-post-install":"npm --prefix ../.. run build:app-deps && npm run build:terminal-webview",android:"npm run android:development","android:development":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=development expo prebuild --platform android --non-interactive && cross-env APP_VARIANT=development expo run:android --variant=debug","android:production":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=production expo prebuild --platform android --non-interactive && cross-env APP_VARIANT=production expo run:android --variant=release","android:release":"npm run android:production","android:clear":"node -e \"require('node:fs').rmSync('android', { recursive: true, force: true })\"",ios:"npm --prefix ../.. run build:client && expo run:ios","ios:release":"npm --prefix ../.. run build:client && expo run:ios --configuration Release",web:"npm --prefix ../.. run build:client && concurrently --kill-others --names protocol,client,expo --prefix-colors yellow,blue,magenta \"npm --prefix ../.. run watch:protocol\" \"npm --prefix ../.. run watch:client\" \"npm run web:expo\"","web:expo":"expo start --web",lint:"expo lint",typecheck:"tsgo --noEmit",test:"vitest run","test:browser":"vitest run --project browser","test:e2e":"playwright test --project='Desktop Chrome'","test:e2e:real":"cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=real-provider","test:e2e:ui":"playwright test --ui","test:coverage":"vitest run --project unit --coverage",build:"npm run build:web","build:web":"npm --prefix ../.. run build:app-deps && expo export --platform web --source-maps","profile:workspace-tabs":"node ./scripts/profile-workspace-tabs.mjs","deploy:web":"npm run build:web && wrangler pages deploy dist --project-name paseo-app --branch main"},dependencies:{"@bacons/apple-targets":"4.0.6","@datadog/browser-rum":"^6.23.0","@datadog/browser-rum-react":"^6.23.0","@datadog/mobile-react-native":"^2.7.0","@datadog/mobile-react-native-session-replay":"^2.14.8","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@expo/image-utils":"0.8.8","@expo/plist":"0.4.9","@expo/prebuild-config":"54.0.8","@floating-ui/react-native":"^0.10.7","@gorhom/bottom-sheet":"^5.2.14","@gorhom/portal":"^1.0.14","@hyperdrive.bot/paseo-client":"*","@hyperdrive.bot/paseo-expo-two-way-audio":"*","@hyperdrive.bot/paseo-extension-sdk":"*","@hyperdrive.bot/paseo-highlight":"*","@react-native-async-storage/async-storage":"2.2.0","@react-native-masked-view/masked-view":"^0.3.2","@react-native/normalize-colors":"^0.81.5","@react-navigation/native":"^7.1.8","@sentry/electron":"^6.11.0","@sentry/react-native":"^6.20.0","@tanstack/react-query":"^5.90.11","@tanstack/react-virtual":"^3.13.21","@xterm/addon-clipboard":"^0.3.0-beta.213","@xterm/addon-fit":"^0.12.0-beta.213","@xterm/addon-image":"^0.10.0-beta.213","@xterm/addon-ligatures":"0.11.0-beta.213","@xterm/addon-search":"^0.17.0-beta.213","@xterm/addon-unicode11":"^0.10.0-beta.213","@xterm/addon-web-links":"^0.13.0-beta.213","@xterm/addon-webgl":"^0.20.0-beta.212","@xterm/xterm":"^6.1.0-beta.213",buffer:"^6.0.3",expo:"^54.0.18","expo-asset":"~12.0.12","expo-audio":"~1.0.13","expo-background-fetch":"~14.0.9","expo-build-properties":"^1.0.9","expo-camera":"~17.0.10","expo-clipboard":"~8.0.7","expo-constants":"~18.0.9","expo-crypto":"^15.0.8","expo-dev-client":"^6.0.15","expo-document-picker":"~14.0.8","expo-file-system":"~19.0.17","expo-haptics":"~15.0.7","expo-image":"~3.0.10","expo-image-manipulator":"~14.0.8","expo-image-picker":"^17.0.8","expo-keep-awake":"^15.0.7","expo-linking":"~8.0.8","expo-localization":"~17.0.9","expo-notifications":"^0.32.16","expo-router":"~6.0.13","expo-sharing":"^14.0.8","expo-speech":"~14.0.8","expo-speech-recognition":"^56.0.1","expo-splash-screen":"~31.0.10","expo-system-ui":"~6.0.7","expo-task-manager":"~14.0.9","fast-deep-equal":"^3.1.3",htmlparser2:"^12.0.0",i18next:"^26.3.0","lucide-react-native":"^0.546.0","markdown-it":"^10.0.0","mnemonic-id":"^3.2.7",qrcode:"^1.5.4",react:"19.1.0","react-dom":"19.1.0","react-i18next":"^17.0.8","react-native":"0.81.5","react-native-draggable-flatlist":"^4.0.3","react-native-edge-to-edge":"^1.7.0","react-native-gesture-handler":"~2.28.0","react-native-keyboard-controller":"^1.21.7","react-native-markdown-display":"^7.0.2","react-native-nitro-modules":"0.35.5","react-native-reanimated":"~4.3.1","react-native-safe-area-context":"~5.6.0","react-native-screens":"~4.16.0","react-native-svg":"^15.14.0","react-native-uitextview":"^2.2.0","react-native-unistyles":"^3.2.4","react-native-web":"~0.21.0","react-native-webview":"^13.16.0","react-native-worklets":"~0.8.3","tiny-invariant":"^1.3.3","use-sync-external-store":"^1.6.0",zod:"^4.4.3",zustand:"^5.0.9"},devDependencies:{"@playwright/test":"^1.56.1","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/chai":"^5.2.2","@types/markdown-it":"^14.1.2","@types/qrcode":"^1.5.6","@types/react":"~19.2.0","@types/ws":"^8.18.1","@vitest/browser":"^4.1.7","@vitest/browser-playwright":"^4.1.7","@vitest/coverage-v8":"^4.1.7","@xterm/headless":"^6.1.0-beta.213",dotenv:"^17.2.3",eslint:"^9.25.0","eslint-config-expo":"~10.0.0",jsdom:"^20.0.3","material-icon-theme":"^5.32.0",playwright:"^1.56.1","serve-sim":"^0.1.40",typescript:"~5.9.2",vitest:"^4.1.6",wrangler:"^4.105.0",ws:"^8.20.0"}}},3406,[]);
|
|
15052
15052
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shouldUseDesktopDaemon=function(){return(0,n.isElectronRuntime)()},e.getDesktopDaemonStatus=async function(){return c(await(0,t.invokeDesktopCommand)("desktop_daemon_status"))},e.startDesktopDaemon=async function(){return c(await(0,t.invokeDesktopCommand)("start_desktop_daemon"))},e.stopDesktopDaemon=async function(n="manual_ipc"){return c(await(0,t.invokeDesktopCommand)("stop_desktop_daemon",{reason:n}))},e.restartDesktopDaemon=async function(){return c(await(0,t.invokeDesktopCommand)("restart_desktop_daemon"))},e.getDesktopDaemonLogs=async function(){return p(await(0,t.invokeDesktopCommand)("desktop_daemon_logs"))},e.getDesktopDaemonPairing=async function(){return k(await(0,t.invokeDesktopCommand)("desktop_daemon_pairing"))},e.getCliDaemonStatus=async function(){const n=await(0,t.invokeDesktopCommand)("cli_daemon_status");if("string"!=typeof n)throw new Error("Unexpected CLI daemon status response.");return n},e.listenToLocalTransportEvents=async function(t){const u=(0,n.getDesktopHost)()?.events?.on;if("function"!=typeof u)throw new Error("Desktop events API is unavailable.");const c=await u("local-daemon-transport-event",n=>{o(n)&&t({sessionId:s(n.sessionId)??"",kind:s(n.kind)??"error",text:s(n.text),binaryBase64:s(n.binaryBase64),code:l(n.code),reason:s(n.reason),error:s(n.error)})});return"function"==typeof c?c:()=>{}},e.openLocalTransportSession=async function(n){const o=await(0,t.invokeDesktopCommand)("open_local_daemon_transport",n);if("string"!=typeof o||0===o.trim().length)throw new Error("Unexpected local transport session response.");return o},e.sendLocalTransportMessage=async function(n){await(0,t.invokeDesktopCommand)("send_local_daemon_transport_message",Object.assign({sessionId:n.sessionId},n.text?{text:n.text}:{},n.binaryBase64?{binaryBase64:n.binaryBase64}:{}))},e.closeLocalTransportSession=async function(n){await(0,t.invokeDesktopCommand)("close_local_daemon_transport",{sessionId:n})},e.getCliInstallStatus=async function(){return f(await(0,t.invokeDesktopCommand)("get_cli_install_status"))},e.installCli=async function(){return f(await(0,t.invokeDesktopCommand)("install_cli"))},e.getSkillsStatus=async function(){return y(await(0,t.invokeDesktopCommand)("get_skills_status"))},e.installSkills=async function(){return y(await(0,t.invokeDesktopCommand)("install_skills"))},e.updateSkills=async function(){return y(await(0,t.invokeDesktopCommand)("update_skills"))},e.uninstallSkills=async function(){return y(await(0,t.invokeDesktopCommand)("uninstall_skills"))};var n=r(d[0]),t=r(d[1]);function o(n){return"object"==typeof n&&null!==n}function s(n){return"string"==typeof n&&n.trim().length>0?n:null}function l(n){return"number"==typeof n&&Number.isFinite(n)?n:null}function u(n){const t=s(n)?.toLowerCase();switch(t){case"starting":return"starting";case"running":return"running";case"errored":case"error":return"errored";default:return"stopped"}}function c(n){if(!o(n))throw new Error("Unexpected desktop daemon status response.");return{serverId:s(n.serverId)??"",status:u(n.status),listen:s(n.listen),hostname:s(n.hostname),pid:l(n.pid),home:s(n.home)??"",version:s(n.version),desktopManaged:!0===n.desktopManaged,error:s(n.error)}}function p(n){if(!o(n))throw new Error("Unexpected desktop daemon logs response.");return{logPath:s(n.logPath)??"",contents:"string"==typeof n.contents?n.contents:""}}function k(n){if(!o(n))throw new Error("Unexpected desktop daemon pairing response.");return{relayEnabled:!0===n.relayEnabled,url:s(n.url),qr:s(n.qr)}}function f(n){if(!o(n))throw new Error("Unexpected install status response.");return{installed:!0===n.installed}}function w(n){switch(n){case"not-installed":case"up-to-date":case"drift":return n;default:throw new Error(`Unexpected skills status state: ${String(n)}`)}}function _(n){if(!o(n))throw new Error("Unexpected skill op response.");const t=s(n.name);if(!t)throw new Error("Skill op missing name.");switch(n.kind){case"add":return{kind:"add",name:t};case"update":return{kind:"update",name:t};case"delete":return{kind:"delete",name:t};default:throw new Error(`Unexpected skill op kind: ${String(n.kind)}`)}}function y(n){if(!o(n))throw new Error("Unexpected skills status response.");const t=Array.isArray(n.ops)?n.ops.map(_):[];return{state:w(n.state),ops:t}}},3407,[3408,3410]);
|
|
15053
15053
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getDesktopHost=n,e.isElectronRuntime=o,e.isElectronRuntimeMac=function(){if(!o())return!1;if("undefined"==typeof navigator)return!1;const t=n()?.platform?.toLowerCase();if("darwin"===t||"mac"===t||"macos"===t)return!0;const u=navigator.userAgent;return u.includes("Mac OS")||u.includes("Macintosh")},r(d[0]);var t=r(d[1]);function n(){return(0,t.getElectronHost)()}function o(){return null!==n()}},3408,[25,3409]);
|
|
15054
15054
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getElectronHost=function(){if("undefined"==typeof window)return null;const t=window.paseoDesktop;if(!t||"object"!=typeof t)return null;return t}},3409,[]);
|
|
@@ -16579,5 +16579,5 @@ __d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=r(d[0]),n=this&&this.__creat
|
|
|
16579
16579
|
__r(975);
|
|
16580
16580
|
__r(341);
|
|
16581
16581
|
__r(0);
|
|
16582
|
-
//# sourceMappingURL=/_expo/static/js/web/index-
|
|
16583
|
-
//# debugId=
|
|
16582
|
+
//# sourceMappingURL=/_expo/static/js/web/index-cb251ddad56c08c3021036af3a43fc0f.js.map
|
|
16583
|
+
//# debugId=0ed61e54-2b8c-4c9b-9cdd-36da4a1d0c9e
|