@getpaseo/server 0.1.102 → 0.1.103

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.
@@ -68,6 +68,7 @@ export interface AgentModelDefinition {
68
68
  label: string;
69
69
  description?: string;
70
70
  isDefault?: boolean;
71
+ contextWindowMaxTokens?: number;
71
72
  metadata?: AgentMetadata;
72
73
  thinkingOptions?: AgentSelectOption[];
73
74
  defaultThinkingOptionId?: string;
@@ -5,7 +5,7 @@ import os from "node:os";
5
5
  import path from "node:path";
6
6
  import { mapClaudeCanceledToolCall, mapClaudeCompletedToolCall, mapClaudeFailedToolCall, mapClaudeRunningToolCall, } from "./tool-call-mapper.js";
7
7
  import { mapTaskNotificationSystemRecordToToolCall, mapTaskNotificationUserContentToToolCall, } from "./task-notification-tool-call.js";
8
- import { getClaudeModelsWithSettings, normalizeClaudeRuntimeModelId } from "./models.js";
8
+ import { findClaudeModel, getClaudeModelsWithSettings, normalizeClaudeRuntimeModelId, } from "./models.js";
9
9
  import { parsePartialJsonObject } from "./partial-json.js";
10
10
  import { ClaudeSidechainTracker } from "./sidechain-tracker.js";
11
11
  import { buildClaudeFeatures, claudeModelSupportsFastMode } from "./feature-definitions.js";
@@ -1202,22 +1202,6 @@ function extractContextWindowSize(modelUsage) {
1202
1202
  }
1203
1203
  return maxContextWindow;
1204
1204
  }
1205
- function resolveInitialContextWindowSize(modelId) {
1206
- const normalized = typeof modelId === "string" ? modelId.trim().toLowerCase() : "";
1207
- if (!normalized) {
1208
- return undefined;
1209
- }
1210
- if (normalized.includes("[1m]") || normalized.includes("context-1m")) {
1211
- return 1000000;
1212
- }
1213
- if (normalized.includes("claude-fable-5")) {
1214
- return 1000000;
1215
- }
1216
- if (/(?:^|[~/_-])(?:claude[-_ ]*)?(opus|sonnet|haiku)(?:$|[-_ ./])/.test(normalized)) {
1217
- return 200000;
1218
- }
1219
- return undefined;
1220
- }
1221
1205
  function readStreamRequestInputTokens(event) {
1222
1206
  const messageUsage = toObjectRecord(toObjectRecord(event.message)?.usage);
1223
1207
  if (!messageUsage) {
@@ -1537,7 +1521,7 @@ class ClaudeAgentSession {
1537
1521
  this.logger = options.logger.child({ agentId: this.agentId });
1538
1522
  this.queryFactory = options.queryFactory;
1539
1523
  this.resolveBinary = options.resolveBinary;
1540
- this.contextUsage = new ClaudeContextUsageState(resolveInitialContextWindowSize(this.config.model));
1524
+ this.contextUsage = new ClaudeContextUsageState(findClaudeModel(this.config.model)?.contextWindowMaxTokens);
1541
1525
  const handle = options.handle;
1542
1526
  if (handle) {
1543
1527
  if (!handle.sessionId) {
@@ -1745,7 +1729,7 @@ class ClaudeAgentSession {
1745
1729
  if (!claudeModelSupportsFastMode(this.config.model) && this.config.featureValues?.fast_mode) {
1746
1730
  await this.applyFastModeFeature(false, activeQuery);
1747
1731
  }
1748
- this.contextUsage.setInitialContextWindowMaxTokens(resolveInitialContextWindowSize(this.config.model));
1732
+ this.contextUsage.setInitialContextWindowMaxTokens(findClaudeModel(this.config.model)?.contextWindowMaxTokens);
1749
1733
  this.lastOptionsModel = normalizedModelId ?? this.lastOptionsModel;
1750
1734
  this.lastRuntimeModel = null;
1751
1735
  this.cachedRuntimeInfo = null;
@@ -1,6 +1,7 @@
1
1
  import type { Logger } from "pino";
2
2
  import type { AgentModelDefinition } from "../../agent-sdk-types.js";
3
3
  export declare function getClaudeModels(): AgentModelDefinition[];
4
+ export declare function findClaudeModel(modelId: string | null | undefined): AgentModelDefinition | null;
4
5
  export declare function getClaudeModelsWithSettings(logger: Logger, configDir?: string): Promise<AgentModelDefinition[]>;
5
6
  /**
6
7
  * Normalize a runtime model string (from SDK init message) to a known model ID.
@@ -7,7 +7,7 @@ const CLAUDE_THINKING_OPTIONS = [
7
7
  { id: "high", label: "High" },
8
8
  { id: "max", label: "Max" },
9
9
  ];
10
- const CLAUDE_OPUS_EXTENDED_THINKING_OPTIONS = [
10
+ const CLAUDE_EXTENDED_THINKING_OPTIONS = [
11
11
  { id: "low", label: "Low" },
12
12
  { id: "medium", label: "Medium" },
13
13
  { id: "high", label: "High" },
@@ -15,7 +15,7 @@ const CLAUDE_OPUS_EXTENDED_THINKING_OPTIONS = [
15
15
  { id: "max", label: "Max" },
16
16
  ];
17
17
  const CLAUDE_ULTRACODE_THINKING_OPTIONS = [
18
- ...CLAUDE_OPUS_EXTENDED_THINKING_OPTIONS,
18
+ ...CLAUDE_EXTENDED_THINKING_OPTIONS,
19
19
  { id: "ultracode", label: "Ultracode" },
20
20
  ];
21
21
  const CLAUDE_MODELS = [
@@ -24,6 +24,7 @@ const CLAUDE_MODELS = [
24
24
  id: "claude-fable-5",
25
25
  label: "Fable 5",
26
26
  description: "Fable 5 · Most powerful model",
27
+ contextWindowMaxTokens: 1000000,
27
28
  thinkingOptions: [...CLAUDE_ULTRACODE_THINKING_OPTIONS],
28
29
  },
29
30
  {
@@ -31,6 +32,7 @@ const CLAUDE_MODELS = [
31
32
  id: "claude-opus-4-8[1m]",
32
33
  label: "Opus 4.8 1M",
33
34
  description: "Opus 4.8 with 1M context window",
35
+ contextWindowMaxTokens: 1000000,
34
36
  thinkingOptions: [...CLAUDE_ULTRACODE_THINKING_OPTIONS],
35
37
  },
36
38
  {
@@ -39,27 +41,39 @@ const CLAUDE_MODELS = [
39
41
  label: "Opus 4.8",
40
42
  description: "Opus 4.8 · Latest release",
41
43
  isDefault: true,
44
+ contextWindowMaxTokens: 200000,
42
45
  thinkingOptions: [...CLAUDE_ULTRACODE_THINKING_OPTIONS],
43
46
  },
47
+ {
48
+ provider: "claude",
49
+ id: "claude-sonnet-5",
50
+ label: "Sonnet 5",
51
+ description: "Sonnet 5 · Efficient for routine tasks",
52
+ contextWindowMaxTokens: 1000000,
53
+ thinkingOptions: [...CLAUDE_EXTENDED_THINKING_OPTIONS],
54
+ },
44
55
  {
45
56
  provider: "claude",
46
57
  id: "claude-opus-4-7[1m]",
47
58
  label: "Opus 4.7 1M",
48
59
  description: "Opus 4.7 with 1M context window",
49
- thinkingOptions: [...CLAUDE_OPUS_EXTENDED_THINKING_OPTIONS],
60
+ contextWindowMaxTokens: 1000000,
61
+ thinkingOptions: [...CLAUDE_EXTENDED_THINKING_OPTIONS],
50
62
  },
51
63
  {
52
64
  provider: "claude",
53
65
  id: "claude-opus-4-7",
54
66
  label: "Opus 4.7",
55
67
  description: "Opus 4.7 · Previous release",
56
- thinkingOptions: [...CLAUDE_OPUS_EXTENDED_THINKING_OPTIONS],
68
+ contextWindowMaxTokens: 200000,
69
+ thinkingOptions: [...CLAUDE_EXTENDED_THINKING_OPTIONS],
57
70
  },
58
71
  {
59
72
  provider: "claude",
60
73
  id: "claude-opus-4-6[1m]",
61
74
  label: "Opus 4.6 1M",
62
75
  description: "Opus 4.6 with 1M context window",
76
+ contextWindowMaxTokens: 1000000,
63
77
  thinkingOptions: [...CLAUDE_THINKING_OPTIONS],
64
78
  },
65
79
  {
@@ -67,6 +81,7 @@ const CLAUDE_MODELS = [
67
81
  id: "claude-opus-4-6",
68
82
  label: "Opus 4.6",
69
83
  description: "Opus 4.6 · Most capable for complex work",
84
+ contextWindowMaxTokens: 200000,
70
85
  thinkingOptions: [...CLAUDE_THINKING_OPTIONS],
71
86
  },
72
87
  {
@@ -74,6 +89,7 @@ const CLAUDE_MODELS = [
74
89
  id: "claude-sonnet-4-6[1m]",
75
90
  label: "Sonnet 4.6 1M",
76
91
  description: "Sonnet 4.6 with 1M context window",
92
+ contextWindowMaxTokens: 1000000,
77
93
  thinkingOptions: [...CLAUDE_THINKING_OPTIONS],
78
94
  },
79
95
  {
@@ -81,6 +97,7 @@ const CLAUDE_MODELS = [
81
97
  id: "claude-sonnet-4-6",
82
98
  label: "Sonnet 4.6",
83
99
  description: "Sonnet 4.6 · Best for everyday tasks",
100
+ contextWindowMaxTokens: 200000,
84
101
  thinkingOptions: [...CLAUDE_THINKING_OPTIONS],
85
102
  },
86
103
  {
@@ -88,6 +105,7 @@ const CLAUDE_MODELS = [
88
105
  id: "claude-haiku-4-5",
89
106
  label: "Haiku 4.5",
90
107
  description: "Haiku 4.5 · Fastest for quick answers",
108
+ contextWindowMaxTokens: 200000,
91
109
  },
92
110
  ];
93
111
  const CLAUDE_SETTINGS_MODEL_ENV_KEYS = [
@@ -100,6 +118,13 @@ const CLAUDE_SETTINGS_MODEL_ENV_KEYS = [
100
118
  export function getClaudeModels() {
101
119
  return CLAUDE_MODELS.map((model) => ({ ...model }));
102
120
  }
121
+ export function findClaudeModel(modelId) {
122
+ const normalizedModelId = normalizeClaudeRuntimeModelId(modelId);
123
+ if (!normalizedModelId) {
124
+ return null;
125
+ }
126
+ return CLAUDE_MODELS.find((model) => model.id === normalizedModelId) ?? null;
127
+ }
103
128
  export async function getClaudeModelsWithSettings(logger, configDir) {
104
129
  const hardcodedModels = getClaudeModels();
105
130
  const settingsModels = await readClaudeSettingsModels(logger, configDir);
@@ -181,13 +206,17 @@ export function normalizeClaudeRuntimeModelId(value) {
181
206
  if (CLAUDE_MODELS.some((model) => model.id === trimmed)) {
182
207
  return trimmed;
183
208
  }
184
- // Fable uses a single-segment version (claude-fable-5), not the {major}-{minor}
185
- // scheme of opus/sonnet/haiku, so match it separately. This maps dated runtime
186
- // strings (e.g. claude-fable-5-20260301) back to the catalog ID. No [1m] variant:
187
- // Fable 5 is natively 1M, so there is no 200K-default model to opt into 1M.
188
- const fableMatch = trimmed.match(/(?:claude-)?fable[-_ ]+(\d+)/i);
189
- if (fableMatch) {
190
- return `claude-fable-${fableMatch[1]}`;
209
+ // Some new Claude model families use single-segment versions, not the
210
+ // {major}-{minor} scheme of older opus/sonnet/haiku models. Map dated or
211
+ // suffixed runtime strings back to the matching catalog ID.
212
+ const singleSegmentMatch = trimmed.match(/(?:claude-)?(fable|sonnet)[-_ ]+(\d+)/i);
213
+ if (singleSegmentMatch) {
214
+ const family = singleSegmentMatch[1].toLowerCase();
215
+ const major = singleSegmentMatch[2];
216
+ const modelId = `claude-${family}-${major}`;
217
+ if (CLAUDE_MODELS.some((model) => model.id === modelId)) {
218
+ return modelId;
219
+ }
191
220
  }
192
221
  // Match: claude-{family}-{major}-{minor}[1m]? possibly followed by a date suffix
193
222
  const runtimeMatch = trimmed.match(/(?:claude-)?(opus|sonnet|haiku)[-_ ]+(\d+)[-.](\d+)(\[1m\])?/i);
@@ -15003,7 +15003,7 @@ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',
15003
15003
  __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}},3358,[]);
15004
15004
  __d(function(g,r,i,a,m,_e,d){"use strict";const e=["config","provider","cwd","env","workspaceId","initialPrompt","images","git","worktreeName","requestId","labels"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DaemonClient",{enumerable:!0,get:function(){return j}});var t,s=r(d[0]),n=(t=s)&&t.__esModule?t:{default:t},o=r(d[1]),c=r(d[2]),u=r(d[3]),p=r(d[4]),l=r(d[5]),h=r(d[6]),y=r(d[7]),I=r(d[8]);const q={debug:()=>{},info:(e,t)=>console.log(t,e),warn:(e,t)=>console.warn(t,e),error:(e,t)=>console.error(t,e)},f="undefined"!=typeof performance&&"function"==typeof performance.now?()=>performance.now():()=>Date.now();function _(e,t){return"string"!=typeof e?e:"string"==typeof t?{agentId:e,requestId:t}:Object.assign({agentId:e},t)}function w(e,t){return"string"!=typeof e?e:"string"==typeof t?{agentId:e,requestId:t}:Object.assign({agentId:e},t)}class S extends Error{constructor(e){const t=[e.error];e.requestType&&t.push(`requestType=${e.requestType}`),e.code&&t.push(`code=${e.code}`),super(t.join(" ")),this.name="DaemonRpcError",this.requestId=e.requestId,this.requestType=e.requestType,this.code=e.code}}class b extends Error{constructor(e){super(`Ping timed out (${e}ms)`),this.timeoutMs=e,this.name="PingTimeoutError"}}function v(e,t,s){return e instanceof b?new Error(`${t} timed out (${s}ms)`):e instanceof Error?e:new Error(String(e))}const T=6e4;function R(e){return e instanceof Error&&e.message.startsWith("Timeout waiting for message")}function k(e){if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null}function C(e){const t=globalThis.atob(e),s=new Uint8Array(t.length);for(let e=0;e<t.length;e+=1)s[e]=t.charCodeAt(e);return s}function M(e){let t;return t="base64"===e.encoding&&e.content?C(e.content):"utf-8"===e.encoding&&e.content?(new TextEncoder).encode(e.content):new Uint8Array,{bytes:t,mime:e.mimeType??"application/octet-stream",size:e.size,path:e.path,kind:e.kind,modifiedAt:e.modifiedAt}}function E(e,t){const s=new Uint8Array(t);let n=0;for(const t of e)s.set(t,n),n+=t.byteLength;return s}function P(e){let t=0;for(let s=0;s<e.length;s+=1)t=31*t+e.charCodeAt(s)|0;return`h_${Math.abs(t).toString(16)}`}function A(e){if(!e)return null;const t=e.toLowerCase();return t.includes("timed out")?"connect_timeout":t.includes("disposed")?"disposed":t.includes("client closed")?"client_closed":t.includes("transport")?"transport_error":t.includes("failed to connect")?"connect_failed":"unknown"}class j{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 I.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??q,this.logConnectionPath=(0,u.isRelayClientWebSocketUrl)(this.config.url)?"relay":"direct";let t=null;try{t=new URL(this.config.url)}catch{t=null}const s=k(t?.searchParams.get("serverId"));this.logServerId=s??t?.host??null;const n=k(this.config.clientId);if(!n)throw new Error("Daemon client requires a non-empty clientId");this.config.clientId=n,this.logClientIdHash=P(n),this.logGeneration="number"==typeof this.config.runtimeGeneration&&Number.isFinite(this.config.runtimeGeneration)?this.config.runtimeGeneration:null;const o="number"==typeof e.runtimeMetricsIntervalMs&&e.runtimeMetricsIntervalMs>0?e.runtimeMetricsIntervalMs:0;if(o>0){const t="number"==typeof e.runtimeMetricsWindowMs&&e.runtimeMetricsWindowMs>0?Math.max(e.runtimeMetricsWindowMs,o):void 0;this.runtimeMetrics=new y.DaemonClientRuntimeMetrics(this.logger,{connectionPath:this.logConnectionPath,serverId:this.logServerId,getConnectionStatus:()=>this.connectionState.status},t?{windowMs:t}:void 0),this.runtimeMetricsInterval=setInterval(()=>{this.runtimeMetrics?.flush()},o)}}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,t)=>{this.connectResolve=e,this.connectReject=t,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={},t="string"!=typeof(s=this.config.password)?null:s.length>0?s:null;var s;t?e.Authorization=`Bearer ${t}`:this.config.authHeader&&(e.Authorization=this.config.authHeader);const n=t?[`paseo.bearer.${t}`]:void 0;try{this.disposeTransport();const t=this.config.transportFactory??(0,h.createWebSocketTransportFactory)(this.config.webSocketFactory??h.defaultWebSocketFactory),s=!0===this.config.e2ee?.enabled&&(0,u.isRelayClientWebSocketUrl)(this.config.url);let o=t;if(s){const e=this.config.e2ee?.daemonPublicKeyB64;if(!e)throw new Error("daemonPublicKeyB64 is required for relay E2EE");o=(0,h.createRelayE2eeTransportFactory)({baseFactory:t,daemonPublicKeyB64:e,logger:this.logger})}const c=this.resolveTransportUrlForAttempt(),p=o(Object.assign({url:c,headers:e},n?{protocols:n}:{}));this.transport=p,this.lastServerInfoMessage=null,this.updateConnectionState({status:"connecting",attempt:this.reconnectAttempt},{event:"CONNECT_REQUEST"}),this.resetConnectTimeout();const l=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"}))},l),this.transportCleanup=[p.onOpen(()=>{this.pendingGenericTransportErrorTimeout&&(clearTimeout(this.pendingGenericTransportErrorTimeout),this.pendingGenericTransportErrorTimeout=null),this.lastErrorValue=null,this.sendHelloMessage()}),p.onClose(e=>{this.resetConnectTimeout(),this.pendingGenericTransportErrorTimeout&&(clearTimeout(this.pendingGenericTransportErrorTimeout),this.pendingGenericTransportErrorTimeout=null);const t=(0,h.describeTransportClose)(e);t&&(this.lastErrorValue=t),this.scheduleReconnect({reason:t,event:"TRANSPORT_CLOSE",reasonCode:"transport_closed"})}),p.onError(e=>{this.resetConnectTimeout();const t=(0,h.describeTransportError)(e);if("Transport error"===t)return this.lastErrorValue??(this.lastErrorValue=t),void(this.pendingGenericTransportErrorTimeout||(this.pendingGenericTransportErrorTimeout=setTimeout(()=>{this.pendingGenericTransportErrorTimeout=null,"connected"!==this.connectionState.status&&"connecting"!==this.connectionState.status||(this.lastErrorValue=t,this.scheduleReconnect({reason:t,event:"TRANSPORT_ERROR",reasonCode:"transport_error"}))},250)));this.pendingGenericTransportErrorTimeout&&(clearTimeout(this.pendingGenericTransportErrorTimeout),this.pendingGenericTransportErrorTimeout=null),this.lastErrorValue=t,this.scheduleReconnect({reason:t,event:"TRANSPORT_ERROR",reasonCode:"transport_error"})}),p.onMessage(e=>this.handleTransportMessage(e))]}catch(e){this.resetConnectTimeout();const t=e instanceof Error?e.message:"Failed to connect";this.lastErrorValue=t,this.scheduleReconnect({reason:t,event:"CONNECT_FAILED",reasonCode:"connect_failed"}),this.rejectConnect(e instanceof Error?e:new Error(t))}}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,t){if("function"==typeof e)return this.subscribe(e);const s=e,n=t;return this.messageHandlers.has(s)||this.messageHandlers.set(s,new Set),this.messageHandlers.get(s).add(n),()=>{const e=this.messageHandlers.get(s);e&&(e.delete(n),0===e.size&&this.messageHandlers.delete(s))}}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 t=c.SessionInboundMessageSchema.parse(e);try{this.transport.send(JSON.stringify({type:"session",message:t}))}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 t=this.connectionState.status;if(this.transport&&"connected"===t){const t=c.SessionInboundMessageSchema.parse(e);return this.transport.send(JSON.stringify({type:"session",message:t})),Promise.resolve()}return"connecting"===t?new Promise((t,s)=>{const n=setTimeout(()=>{const e=this.pendingSendQueue.findIndex(e=>e.resolve===t);-1!==e&&this.pendingSendQueue.splice(e,1),s(new Error("Timed out waiting for connection to send message"))},6e4);this.pendingSendQueue.push({message:e,resolve:t,reject:s,timeoutHandle:n})}):Promise.reject(new Error(`Transport not connected (status: ${t})`))}flushPendingSendQueue(){const e=this.pendingSendQueue;this.pendingSendQueue=[];for(const t of e){clearTimeout(t.timeoutHandle);try{if(this.transport&&"connected"===this.connectionState.status){const e=c.SessionInboundMessageSchema.parse(t.message);this.transport.send(JSON.stringify({type:"session",message:e})),t.resolve()}else t.reject(new Error("Connection lost before message could be sent"))}catch(e){t.reject(e instanceof Error?e:new Error(String(e)))}}}rejectPendingSendQueue(e){const t=this.pendingSendQueue;this.pendingSendQueue=[];for(const s of t)clearTimeout(s.timeoutHandle),s.reject(e)}async sendRequest(e){const t=e.timeout??T,{promise:s,cancel:n}=this.waitForWithCancel(t=>{if("rpc_error"===t.type&&t.payload.requestId===e.requestId)return{kind:"error",error:new S({requestId:t.payload.requestId,error:t.payload.error,requestType:t.payload.requestType,code:t.payload.code})};const s=e.select(t);return null===s?null:{kind:"ok",value:s}},t,e.options);try{await this.sendSessionMessageOrThrow(e.message)}catch(e){const t=e instanceof Error?e:new Error(String(e));throw n(t),s.catch(()=>{}),t}const o=await s;if("error"===o.kind)throw o.error;return o.value}async sendCorrelatedRequest(e){return this.sendRequest({requestId:e.requestId,message:e.message,timeout:e.timeout,options:e.options,select:t=>{const s=t;if(s.type!==e.responseType)return null;const n=s.payload;return n.requestId!==e.requestId?null:e.selectPayload?e.selectPayload(n):n}})}sendCorrelatedSessionRequest(e){const t=this.createRequestId(e.requestId),s=c.SessionInboundMessageSchema.parse(Object.assign({},e.message,{requestId:t}));return this.sendCorrelatedRequest(Object.assign({requestId:t,message:s,responseType:e.responseType,timeout:e.timeout,options:{skipQueue:!0}},e.selectPayload?{selectPayload:e.selectPayload}:{}))}sendNamespacedCorrelatedSessionRequest(e){const t=e.message.type.replace(/\.request$/,".response");return this.sendCorrelatedSessionRequest(Object.assign({},e,{responseType:t}))}sendSessionMessageStrict(e){if(!this.transport||"connected"!==this.connectionState.status)throw new Error("Transport not connected");const t=c.SessionInboundMessageSchema.parse(e);try{this.transport.send(JSON.stringify({type:"session",message:t}))}catch(e){throw e instanceof Error?e:new Error(String(e))}}async clearAgentAttention(e){const t=this.createRequestId(),s=c.SessionInboundMessageSchema.parse({type:"clear_agent_attention",agentId:e,requestId:t});await this.sendRequest({requestId:t,message:s,options:{skipQueue:!0},select:e=>"clear_agent_attention_response"!==e.type||e.payload.requestId!==t?null:e.payload})}async clearWorkspaceAttention(e){const t=this.createRequestId(),s=c.SessionInboundMessageSchema.parse({type:"workspace.clear_attention.request",workspaceId:e,requestId:t}),n=await this.sendRequest({requestId:t,message:s,options:{skipQueue:!0},select:e=>"workspace.clear_attention.response"!==e.type||e.payload.requestId!==t?null:e.payload});if(!n.success)throw new Error(n.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})}async ping(e){const t=e?.requestId??`ping-${Date.now()}-${Math.random().toString(36).slice(2)}`,s=Date.now(),n=await this.sendRequest({requestId:t,message:{type:"ping",requestId:t,clientSentAt:s},timeout:e?.timeoutMs??5e3,select:e=>"pong"!==e.type||e.payload.requestId!==t||"number"!=typeof e.payload.serverReceivedAt||"number"!=typeof e.payload.serverSentAt?null:e.payload});return{requestId:t,clientSentAt:s,serverReceivedAt:n.serverReceivedAt,serverSentAt:n.serverSentAt,rttMs:Date.now()-s}}measureLatency(e){const t=Math.max(1,e?.timeoutMs??5e3);return this.sendPingAwaitRtt({timeoutMs:t,drivesLivenessFailure:!1}).catch(e=>{throw v(e,"Latency measurement",t)})}async livenessPing(e){const t=Math.max(1,e?.timeoutMs??5e3);try{const e=await this.sendPingAwaitRtt({timeoutMs:t,drivesLivenessFailure:!0});return this.lastLivenessRttMs=e,e}catch(e){throw v(e,"Liveness check",t)}}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 t=f(),s=e.timeoutMs;let n=null,o=null;const c=new Promise((e,t)=>{n=e,o=t}),u={promise:c,resolve:e=>n?.(e),reject:e=>o?.(e),timeoutHandle:setTimeout(()=>{if(this.pingProbe!==u)return;this.pingProbe=null;const e=new b(s);u.reject(e),u.drivesLivenessFailure&&this.recordLivenessFailure(v(e,"Liveness check",s))},s),startedAt:t,drivesLivenessFailure:e.drivesLivenessFailure};this.pingProbe=u;try{this.transport.send(JSON.stringify({type:"ping"}))}catch(e){this.clearPingProbe();const t=e instanceof Error?e:new Error(String(e));return u.drivesLivenessFailure&&this.recordLivenessFailure(t),Promise.reject(t)}return c}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 t=this.createRequestId(e?.requestId),s=c.SessionInboundMessageSchema.parse(Object.assign({type:"fetch_agents_request",requestId:t},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:t,message:s,timeout:e?.timeout,options:{skipQueue:!0},select:e=>"fetch_agents_response"!==e.type||e.payload.requestId!==t?null:e.payload})}async fetchAgentHistory(e){const t=this.createRequestId(e?.requestId),s=c.SessionInboundMessageSchema.parse(Object.assign({type:"fetch_agent_history_request",requestId:t},e?.filter?{filter:e.filter}:{},e?.sort?{sort:e.sort}:{},e?.page?{page:e.page}:{}));return this.sendRequest({requestId:t,message:s,options:{skipQueue:!0},select:e=>"fetch_agent_history_response"!==e.type||e.payload.requestId!==t?null:e.payload})}async fetchRecentProviderSessions(e){const t=this.createRequestId(e?.requestId),s=c.SessionInboundMessageSchema.parse(Object.assign({type:"fetch_recent_provider_sessions_request",requestId:t},e?.cwd?{cwd:e.cwd}:{},e?.providers?{providers:e.providers}:{},e?.since?{since:e.since}:{},e?.limit?{limit:e.limit}:{}));return this.sendRequest({requestId:t,message:s,options:{skipQueue:!0},select:e=>"fetch_recent_provider_sessions_response"!==e.type||e.payload.requestId!==t?null:e.payload})}async fetchWorkspaces(e){const t=this.createRequestId(e?.requestId),s=c.SessionInboundMessageSchema.parse(Object.assign({type:"fetch_workspaces_request",requestId:t},e?.filter?{filter:e.filter}:{},e?.sort?{sort:e.sort}:{},e?.page?{page:e.page}:{},e?.subscribe?{subscribe:e.subscribe}:{}));return this.sendRequest({requestId:t,message:s,options:{skipQueue:!0},select:e=>"fetch_workspaces_response"!==e.type||e.payload.requestId!==t?null:e.payload})}async openProject(e,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"open_project_request",cwd:e},responseType:"open_project_response"})}async addProject(e,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"project.add.request",cwd:e},responseType:"project.add.response"})}async startWorkspaceScript(e,t,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"start_workspace_script_request",workspaceId:e,scriptName:t},responseType:"start_workspace_script_response"})}async archiveWorkspace(e,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"archive_workspace_request",workspaceId:e},responseType:"archive_workspace_response"})}async fetchWorkspaceSetupStatus(e,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"workspace_setup_status_request",workspaceId:e},responseType:"workspace_setup_status_response"})}async fetchAgent(e,t){const s=_(e,t),n=this.createRequestId(s.requestId),o=c.SessionInboundMessageSchema.parse({type:"fetch_agent_request",requestId:n,agentId:s.agentId}),u=await this.sendRequest({requestId:n,message:o,timeout:s.timeout,options:{skipQueue:!0},select:e=>"fetch_agent_response"!==e.type||e.payload.requestId!==n?null:e.payload});if(u.error)throw new Error(u.error);return u.agent?{agent:u.agent,project:u.project??null}:null}resubscribeCheckoutDiffSubscriptions(){if(0!==this.checkoutDiffSubscriptions.size)for(const[e,t]of this.checkoutDiffSubscriptions){const s=c.SessionInboundMessageSchema.parse({type:"subscribe_checkout_diff_request",subscriptionId:e,cwd:t.cwd,compare:t.compare,requestId:this.createRequestId()});this.sendSessionMessage(s)}}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 t=this.createRequestId(e.requestId),s=F(e),n=c.SessionInboundMessageSchema.parse(Object.assign({type:"create_agent_request",requestId:t,config:s},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}:{})),o=await this.sendRequest({requestId:t,message:n,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const s=c.AgentCreatedStatusPayloadSchema.safeParse(e.payload);if(s.success&&s.data.requestId===t)return s.data;const n=c.AgentCreateFailedStatusPayloadSchema.safeParse(e.payload);return n.success&&n.data.requestId===t?n.data:null}});if("agent_create_failed"===o.status)throw new Error(o.error);return o.agent}async deleteAgent(e){const t=this.createRequestId(),s=c.SessionInboundMessageSchema.parse({type:"delete_agent_request",agentId:e,requestId:t});await this.sendRequest({requestId:t,message:s,options:{skipQueue:!0},select:e=>"agent_deleted"!==e.type||e.payload.requestId!==t?null:e.payload})}async archiveAgent(e){const t=this.createRequestId(),s=c.SessionInboundMessageSchema.parse({type:"archive_agent_request",agentId:e,requestId:t});return{archivedAt:(await this.sendRequest({requestId:t,message:s,options:{skipQueue:!0},select:e=>"agent_archived"!==e.type||e.payload.requestId!==t?null:e.payload})).archivedAt}}async detachAgent(e){const t=await this.sendNamespacedCorrelatedSessionRequest({message:{type:"agent.detach.request",agentId:e}});if(!t.accepted)throw new Error(t.error??"detachAgent rejected")}async updateAgent(e,t){const s=this.createRequestId(),n=c.SessionInboundMessageSchema.parse(Object.assign({type:"update_agent_request",agentId:e},void 0!==t.name?{name:t.name}:{},t.labels&&Object.keys(t.labels).length>0?{labels:t.labels}:{},{requestId:s})),o=await this.sendRequest({requestId:s,message:n,options:{skipQueue:!0},select:e=>"update_agent_response"!==e.type||e.payload.requestId!==s?null:e.payload});if(!o.accepted)throw new Error(o.error??"updateAgent rejected")}async renameProject(e,t,s){const n=await this.sendCorrelatedSessionRequest({requestId:s,message:{type:"project.rename.request",projectId:e,customName:t},responseType:"project.rename.response"});if(!n.accepted)throw new Error(n.error??"renameProject rejected");return{customName:n.customName}}async removeProject(e,t){const s=await this.sendNamespacedCorrelatedSessionRequest({requestId:t,message:{type:"project.remove.request",projectId:e}});if(!s.accepted)throw new Error(s.error??"removeProject rejected");return{removedWorkspaceIds:s.removedWorkspaceIds}}async setWorkspaceTitle(e,t,s){const n=await this.sendCorrelatedSessionRequest({requestId:s,message:{type:"workspace.title.set.request",workspaceId:e,title:t},responseType:"workspace.title.set.response"});if(!n.accepted)throw new Error(n.error??"setWorkspaceTitle rejected");return{title:n.title}}async resumeAgent(e,t){const s=this.createRequestId(),n=c.SessionInboundMessageSchema.parse(Object.assign({type:"resume_agent_request",requestId:s,handle:e},t?{overrides:t}:{}));return(await this.sendRequest({requestId:s,message:n,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const t=c.AgentResumedStatusPayloadSchema.safeParse(e.payload);return t.success&&t.data.requestId===s?t.data:null}})).agent}async importAgent(e){const t=this.createRequestId(),s=c.SessionInboundMessageSchema.parse(Object.assign({type:"import_agent_request",requestId:t},"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}:{})),n=await this.sendRequest({requestId:t,message:s,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const s=c.AgentResumedStatusPayloadSchema.safeParse(e.payload);if(s.success&&s.data.requestId===t)return s.data;const n=c.AgentCreateFailedStatusPayloadSchema.safeParse(e.payload);return n.success&&n.data.requestId===t?n.data:null}});if("agent_create_failed"===n.status)throw new Error(n.error);return n.agent}async refreshAgent(e,t){const s=this.createRequestId(t),n=c.SessionInboundMessageSchema.parse({type:"refresh_agent_request",agentId:e,requestId:s});return this.sendRequest({requestId:s,message:n,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const t=c.AgentRefreshedStatusPayloadSchema.safeParse(e.payload);return t.success&&t.data.requestId===s?t.data:null}})}async fetchAgentTimeline(e,t={}){const s=this.createRequestId(t.requestId),n=c.SessionInboundMessageSchema.parse(Object.assign({type:"fetch_agent_timeline_request",agentId:e,requestId:s},t.direction?{direction:t.direction}:{},t.cursor?{cursor:t.cursor}:{},"number"==typeof t.limit?{limit:t.limit}:{},t.projection?{projection:t.projection}:{})),o=await this.sendRequest({requestId:s,message:n,timeout:t.timeout,options:{skipQueue:!0},select:e=>"fetch_agent_timeline_response"!==e.type||e.payload.requestId!==s?null:e.payload});if(o.error)throw new Error(o.error);return o}async buildAgentForkContext(e,t={}){const s=this.createRequestId(t.requestId),n=c.SessionInboundMessageSchema.parse(Object.assign({type:"agent.fork_context.request",agentId:e,requestId:s},t.boundaryMessageId?{boundaryMessageId:t.boundaryMessageId}:{})),o=await this.sendRequest({requestId:s,message:n,timeout:15e3,options:{skipQueue:!0},select:e=>"agent.fork_context.response"!==e.type||e.payload.requestId!==s?null:e.payload});if(o.error)throw new Error(o.error);return o}async sendAgentMessage(e,t,s){const n=this.createRequestId(),o=s?.messageId??crypto.randomUUID(),u=c.SessionInboundMessageSchema.parse(Object.assign({type:"send_agent_message_request",requestId:n,agentId:e,text:t},o?{messageId:o}:{},s?.images?{images:s.images}:{},s?.attachments?{attachments:s.attachments}:{})),p=await this.sendRequest({requestId:n,message:u,options:{skipQueue:!0},select:e=>"send_agent_message_response"!==e.type||e.payload.requestId!==n?null:e.payload});if(!p.accepted)throw new Error(p.error??"sendAgentMessage rejected")}async sendMessage(e,t,s){await this.sendAgentMessage(e,t,s)}async rewindAgent(e,t,s){const n=this.createRequestId(),o=c.SessionInboundMessageSchema.parse({type:"agent.rewind.request",requestId:n,agentId:e,messageId:t,mode:s}),u=await this.sendRequest({requestId:n,message:o,options:{skipQueue:!0},select:e=>"agent.rewind.response"!==e.type||e.payload.requestId!==n?null:e.payload});if(!u.ok)throw new Error(u.error??"Agent rewind failed");return u}async cancelAgent(e){const t=this.createRequestId(),s=c.SessionInboundMessageSchema.parse({type:"cancel_agent_request",agentId:e,requestId:t});await this.sendRequest({requestId:t,message:s,options:{skipQueue:!0},select:e=>"cancel_agent_response"!==e.type||e.payload.requestId!==t?null:e.payload})}async setAgentMode(e,t){const s=this.createRequestId(),n=c.SessionInboundMessageSchema.parse({type:"set_agent_mode_request",agentId:e,modeId:t,requestId:s}),o=await this.sendRequest({requestId:s,message:n,options:{skipQueue:!0},select:e=>"set_agent_mode_response"!==e.type||e.payload.requestId!==s?null:e.payload});if(!o.accepted)throw new Error(o.error??"setAgentMode rejected");return o.notice??null}async setAgentModel(e,t){const s=this.createRequestId(),n=c.SessionInboundMessageSchema.parse({type:"set_agent_model_request",agentId:e,modelId:t,requestId:s}),o=await this.sendRequest({requestId:s,message:n,options:{skipQueue:!0},select:e=>"set_agent_model_response"!==e.type||e.payload.requestId!==s?null:e.payload});if(!o.accepted)throw new Error(o.error??"setAgentModel rejected")}async setAgentFeature(e,t,s){const n=this.createRequestId(),o=c.SessionInboundMessageSchema.parse({type:"set_agent_feature_request",agentId:e,featureId:t,value:s,requestId:n}),u=await this.sendRequest({requestId:n,message:o,options:{skipQueue:!0},select:e=>"set_agent_feature_response"!==e.type||e.payload.requestId!==n?null:e.payload});if(!u.accepted)throw new Error(u.error??"setAgentFeature rejected")}async setAgentThinkingOption(e,t){const s=this.createRequestId(),n=c.SessionInboundMessageSchema.parse({type:"set_agent_thinking_request",agentId:e,thinkingOptionId:t,requestId:s}),o=await this.sendRequest({requestId:s,message:n,options:{skipQueue:!0},select:e=>"set_agent_thinking_response"!==e.type||e.payload.requestId!==s?null:e.payload});if(!o.accepted)throw new Error(o.error??"setAgentThinkingOption rejected");return o.notice??null}async restartServer(e,t){const s=this.createRequestId(t),n=c.SessionInboundMessageSchema.parse(Object.assign({type:"restart_server_request"},e&&e.trim().length>0?{reason:e}:{},{requestId:s}));return this.sendRequest({requestId:s,message:n,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const t=c.RestartRequestedStatusPayloadSchema.safeParse(e.payload);return t.success?t.data.requestId!==s?null:t.data:null}})}async shutdownServer(e){const t=this.createRequestId(e?.requestId),s=c.SessionInboundMessageSchema.parse({type:"shutdown_server_request",requestId:t});return this.sendRequest({requestId:t,message:s,timeout:e?.timeout,options:{skipQueue:!0},select:e=>{if("status"!==e.type)return null;const s=c.ShutdownRequestedStatusPayloadSchema.safeParse(e.payload);return s.success?s.data.requestId!==t?null:s.data:null}})}async updateDaemon(e){const t=this.createRequestId(e),s=c.SessionInboundMessageSchema.parse({type:"daemon.update.request",requestId:t});return this.sendRequest({requestId:t,message:s,timeout:3e5,options:{skipQueue:!0},select:e=>{const s=c.DaemonUpdateResponseSchema.safeParse(e);return s.success?s.data.payload.requestId!==t?null:s.data.payload:null}})}async setVoiceMode(e,t){const s=this.createRequestId(),n=c.SessionInboundMessageSchema.parse(Object.assign({type:"set_voice_mode",enabled:e},t?{agentId:t}:{},{requestId:s})),o=await this.sendRequest({requestId:s,message:n,select:e=>"set_voice_mode_response"!==e.type||e.payload.requestId!==s?null:e.payload});if(!o.accepted){const e="string"==typeof o.reasonCode&&o.reasonCode.trim().length>0?` (${o.reasonCode})`:"";throw new Error((o.error??"Failed to set voice mode")+e)}return o}async sendVoiceAudioChunk(e,t,s=!1){this.sendSessionMessage({type:"voice_audio_chunk",audio:e,format:t,isLast:s})}async startDictationStream(e,t){const s=this.waitForWithCancel(t=>"dictation_stream_ack"!==t.type||t.payload.dictationId!==e||-1!==t.payload.ackSeq?null:t.payload,3e4,{skipQueue:!0}),n=s.promise.then(()=>{}),o=this.waitForWithCancel(t=>"dictation_stream_error"!==t.type||t.payload.dictationId!==e?null:t.payload,3e4,{skipQueue:!0}),c=o.promise.then(e=>{throw new Error(e.error)}),u=new Error("Cancelled dictation start waiter");try{this.sendSessionMessageStrict({type:"dictation_stream_start",dictationId:e,format:t}),await Promise.race([n,c])}finally{s.cancel(u),o.cancel(u),n.catch(()=>{}),c.catch(()=>{})}}sendDictationStreamChunk(e,t,s,n){this.sendSessionMessageStrict({type:"dictation_stream_chunk",dictationId:e,seq:t,audio:s,format:n})}async finishDictationStream(e,t){const s=this.waitForWithCancel(t=>"dictation_stream_final"!==t.type||t.payload.dictationId!==e?null:t.payload,0,{skipQueue:!0}),n=this.waitForWithCancel(t=>"dictation_stream_error"!==t.type||t.payload.dictationId!==e?null:t.payload,0,{skipQueue:!0}),o=this.waitForWithCancel(t=>"dictation_stream_finish_accepted"!==t.type||t.payload.dictationId!==e?null:t.payload,6e4,{skipQueue:!0}),c=s.promise,u=n.promise.then(e=>{throw new Error(e.error)}),p=o.promise,l=c.then(e=>({kind:"final",payload:e})),h=u.then(()=>({kind:"error",error:new Error("Unexpected dictation stream error state")}),e=>({kind:"error",error:e instanceof Error?e:new Error(String(e))})),y=p.then(e=>({kind:"accepted",payload:e}),e=>R(e)?{kind:"accepted_timeout"}:{kind:"accepted_error",error:e instanceof Error?e:new Error(String(e))}),I=async e=>{if(!Number.isFinite(e)||e<=0){const e=await Promise.race([l,h]);if("error"===e.kind)throw e.error;return e.payload}let t=null;const s=new Promise(s=>{t=setTimeout(()=>s({kind:"timeout"}),e)}),n=await Promise.race([l,h,s]);if(t&&clearTimeout(t),"timeout"===n.kind)throw new Error(`Timeout waiting for dictation finalization (${e}ms)`);if("error"===n.kind)throw n.error;return n.payload},q=new Error("Cancelled dictation finish waiter");try{this.sendSessionMessageStrict({type:"dictation_stream_finish",dictationId:e,finalSeq:t});const s=await Promise.race([l,h,y]);if("final"===s.kind)return s.payload;if("error"===s.kind)throw s.error;return"accepted"===s.kind?await I(s.payload.timeoutMs+5e3):await I(3e5)}finally{s.cancel(q),n.cancel(q),o.cancel(q),c.catch(()=>{}),u.catch(()=>{}),p.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,t){const s=t?.requestId;if(!s){const t=this.checkoutStatusInFlight.get(e);if(t)return t}const n=this.createRequestId(s),o=c.SessionInboundMessageSchema.parse({type:"checkout_status_request",cwd:e,requestId:n}),u=this.sendRequest({requestId:n,message:o,options:{skipQueue:!0},select:e=>"checkout_status_response"!==e.type||e.payload.requestId!==n?null:e.payload});return s||(this.checkoutStatusInFlight.set(e,u),u.finally(()=>{this.checkoutStatusInFlight.get(e)===u&&this.checkoutStatusInFlight.delete(e)}).catch(()=>{})),u}normalizeCheckoutDiffCompare(e){if("uncommitted"===e.mode)return!0===e.ignoreWhitespace?{mode:"uncommitted",ignoreWhitespace:!0}:{mode:"uncommitted"};const t=e.baseRef?.trim();return t?!0===e.ignoreWhitespace?{mode:"base",baseRef:t,ignoreWhitespace:!0}:{mode:"base",baseRef:t}:!0===e.ignoreWhitespace?{mode:"base",ignoreWhitespace:!0}:{mode:"base"}}async getCheckoutDiff(e,t,s){const n=`oneshot-checkout-diff:${crypto.randomUUID()}`;try{const o=await this.subscribeCheckoutDiff(e,t,{subscriptionId:n,requestId:s});return{cwd:o.cwd,files:o.files,error:o.error,requestId:o.requestId}}finally{try{this.unsubscribeCheckoutDiff(n)}catch{}}}async subscribeCheckoutDiff(e,t,s){const n=s?.subscriptionId??crypto.randomUUID(),o=this.normalizeCheckoutDiffCompare(t),u=this.checkoutDiffSubscriptions.get(n)??null;this.checkoutDiffSubscriptions.set(n,{cwd:e,compare:o});const p=this.createRequestId(s?.requestId),l=c.SessionInboundMessageSchema.parse({type:"subscribe_checkout_diff_request",subscriptionId:n,cwd:e,compare:o,requestId:p});try{return await this.sendCorrelatedRequest({requestId:p,message:l,responseType:"subscribe_checkout_diff_response",options:{skipQueue:!0},selectPayload:e=>e.subscriptionId!==n?null:e})}catch(e){throw u?this.checkoutDiffSubscriptions.set(n,u):this.checkoutDiffSubscriptions.delete(n),e}}unsubscribeCheckoutDiff(e){this.checkoutDiffSubscriptions.delete(e),this.sendSessionMessage({type:"unsubscribe_checkout_diff_request",subscriptionId:e})}async checkoutCommit(e,t,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"checkout_commit_request",cwd:e,message:t.message,addAll:t.addAll},responseType:"checkout_commit_response"})}async checkoutMerge(e,t,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"checkout_merge_request",cwd:e,baseRef:t.baseRef,strategy:t.strategy,requireCleanTarget:t.requireCleanTarget},responseType:"checkout_merge_response"})}async checkoutMergeFromBase(e,t,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"checkout_merge_from_base_request",cwd:e,baseRef:t.baseRef,requireCleanTarget:t.requireCleanTarget},responseType:"checkout_merge_from_base_response"})}async checkoutPull(e,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"checkout_pull_request",cwd:e},responseType:"checkout_pull_response"})}async checkoutPush(e,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"checkout_push_request",cwd:e},responseType:"checkout_push_response"})}async checkoutRefresh(e,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"checkout.refresh.request",cwd:e},responseType:"checkout.refresh.response"})}async checkoutPrCreate(e,t,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"checkout_pr_create_request",cwd:e,title:t.title,body:t.body,baseRef:t.baseRef},responseType:"checkout_pr_create_response"})}async checkoutPrMerge(e,t,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"checkout_pr_merge_request",cwd:e,mergeMethod:t.method},responseType:"checkout_pr_merge_response"})}async checkoutGithubSetAutoMerge(e,t,s){return this.sendNamespacedCorrelatedSessionRequest({requestId:s,message:Object.assign({type:"checkout.github.set_auto_merge.request",cwd:e,enabled:t.enabled},t.enabled?{mergeMethod:t.method}:{})})}async checkoutGithubGetCheckDetails(e,t){return this.sendNamespacedCorrelatedSessionRequest({requestId:t,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,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"checkout_pr_status_request",cwd:e},responseType:"checkout_pr_status_response"})}async pullRequestTimeline(e,t){return this.sendCorrelatedSessionRequest({requestId:t,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,t,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"checkout_switch_branch_request",cwd:e,branch:t},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,t,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"stash_save_request",cwd:e,branch:t?.branch},responseType:"stash_save_response"})}async stashPop(e,t,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"stash_pop_request",cwd:e,stashIndex:t},responseType:"stash_pop_response"})}async stashList(e,t,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"stash_list_request",cwd:e,paseoOnly:t?.paseoOnly},responseType:"stash_list_response"})}async getPaseoWorktreeList(e,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"paseo_worktree_list_request",cwd:e.cwd,repoRoot:e.repoRoot},responseType:"paseo_worktree_list_response"})}async archivePaseoWorktree(e,t){return this.sendCorrelatedSessionRequest({requestId:t,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,t){return this.sendCorrelatedSessionRequest({requestId:t,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,t){return this.sendCorrelatedSessionRequest({requestId:t,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,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"validate_branch_request",cwd:e.cwd,branchName:e.branchName},responseType:"validate_branch_response"})}async getBranchSuggestions(e,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"branch_suggestions_request",cwd:e.cwd,query:e.query,limit:e.limit},responseType:"branch_suggestions_response"})}async searchGitHub(e,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"github_search_request",cwd:e.cwd,query:e.query,limit:e.limit,kinds:e.kinds},responseType:"github_search_response"})}async getDirectorySuggestions(e,t){return this.sendCorrelatedSessionRequest({requestId:t,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,t,s,n,o=!1){return this.sendCorrelatedSessionRequest({requestId:n,message:Object.assign({type:"file_explorer_request",cwd:e,path:t,mode:s},o?{acceptBinary:!0}:{}),responseType:"file_explorer_response"})}async listDirectory(e,t,s){const n=await this.requestFileExplorer(e,t,"list",s);if(n.error)throw new Error(n.error);if(!n.directory)throw new Error("Directory listing unavailable.");return n.directory}async readFile(e,t,s){const n=this.createRequestId(s);this.pendingBinaryFileReads.set(n,{cwd:e,path:t});try{const s=await this.requestFileExplorer(e,t,"file",n,!0);if(s.error)throw new Error(s.error);const o=this.completedBinaryFileReads.get(n);if(o)return this.completedBinaryFileReads.delete(n),o;if(!s.file)throw new Error("File unavailable.");return M(s.file)}finally{this.pendingBinaryFileReads.delete(n),this.activeBinaryFileTransfers.delete(n)}}async uploadFile(e){const t=(0,l.asUint8Array)(e.bytes);if(!t)throw new Error("File bytes are required.");const s=this.createRequestId(e.requestId),n=e.modifiedAt??(new Date).toISOString(),o=this.sendCorrelatedRequest({requestId:s,message:{type:"file.upload.request",fileName:e.fileName,mimeType:e.mimeType,size:t.byteLength,modifiedAt:n,requestId:s},responseType:"file.upload.response",options:{skipQueue:!0}});this.sendBinaryFrame((0,l.encodeFileTransferFrame)({opcode:l.FileTransferOpcode.FileBegin,requestId:s,metadata:{mime:e.mimeType,size:t.byteLength,encoding:"binary",modifiedAt:n,fileName:e.fileName}}));const c=e.chunkSize??1048576;for(let e=0;e<t.byteLength;e+=c)this.sendBinaryFrame((0,l.encodeFileTransferFrame)({opcode:l.FileTransferOpcode.FileChunk,requestId:s,payload:t.subarray(e,Math.min(e+c,t.byteLength))}));return this.sendBinaryFrame((0,l.encodeFileTransferFrame)({opcode:l.FileTransferOpcode.FileEnd,requestId:s})),o}async requestDownloadToken(e,t,s){return this.sendCorrelatedSessionRequest({requestId:s,message:{type:"file_download_token_request",cwd:e,path:t},responseType:"file_download_token_response"})}async requestProjectIcon(e,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"project_icon_request",cwd:e},responseType:"project_icon_response"})}async listProviderModels(e,t){return this.sendCorrelatedSessionRequest({requestId:t?.requestId,message:{type:"list_provider_models_request",provider:e,cwd:t?.cwd},responseType:"list_provider_models_response",timeout:9e4})}async listProviderModes(e,t){return this.sendCorrelatedSessionRequest({requestId:t?.requestId,message:{type:"list_provider_modes_request",provider:e,cwd:t?.cwd},responseType:"list_provider_modes_response",timeout:9e4})}async listProviderFeatures(e,t){return this.sendCorrelatedSessionRequest({requestId:t?.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){return this.sendCorrelatedSessionRequest({requestId:e?.requestId,message:{type:"get_providers_snapshot_request",cwd:e?.cwd},responseType:"get_providers_snapshot_response"})}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,t){return this.sendCorrelatedSessionRequest({requestId:t,message:{type:"set_daemon_config_request",config:e},responseType:"set_daemon_config_response"})}async readProjectConfig(e,t){return this.sendCorrelatedSessionRequest({requestId:t,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,t){return this.sendCorrelatedSessionRequest({requestId:t?.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,t){const s=w(e,t);return this.sendCorrelatedSessionRequest({requestId:s.requestId,message:Object.assign({type:"list_commands_request",agentId:s.agentId},s.draftConfig?{draftConfig:s.draftConfig}:{}),responseType:"list_commands_response"})}async respondToPermission(e,t,s){this.sendSessionMessage({type:"agent_permission_response",agentId:e,requestId:t,response:s})}async respondToPermissionAndWait(e,t,s,n=15e3){const o=c.SessionInboundMessageSchema.parse({type:"agent_permission_response",agentId:e,requestId:t,response:s});return this.sendRequest({requestId:t,message:o,timeout:n,options:{skipQueue:!0},select:s=>"agent_permission_resolved"!==s.type||s.payload.requestId!==t||s.payload.agentId!==e?null:s.payload})}async waitForAgentUpsert(e,t,s=6e4){const n=Date.now()+s,o=()=>new Error(`Timed out waiting for agent ${e}`),c=()=>this.fetchAgent({agentId:e,timeout:Math.max(1,n-Date.now())}).catch(()=>null),u=await c();if(u&&t(u.agent))return u.agent;if(Date.now()>=n)throw o();return await new Promise((s,u)=>{let p=!1,l=!1,h=null,y=null,I=null;const q=e=>{p||(p=!0,y&&(clearTimeout(y),y=null),h&&(clearInterval(h),h=null),I&&(I(),I=null),"ok"!==e.kind?u(e.error):s(e.snapshot))},f=e=>!!e&&(!!t(e)&&(q({kind:"ok",snapshot:e}),!0)),_=async()=>{if(!p&&!l){l=!0;try{const e=await c();f(e?.agent??null)}finally{l=!1}}};I=this.on("agent_update",t=>{if(p)return;if("upsert"!==t.payload.kind)return;const s=t.payload.agent;s.id===e&&f(s)});const w=Math.max(1,n-Date.now());y=setTimeout(()=>{q({kind:"error",error:o()})},w),h=setInterval(()=>{_()},250),_()})}async waitForFinish(e,t=6e4){const s=this.createRequestId(),n=Number.isFinite(t)&&t>0,o=c.SessionInboundMessageSchema.parse(Object.assign({type:"wait_for_finish_request",requestId:s,agentId:e},n?{timeoutMs:t}:{})),u=await this.sendCorrelatedRequest({requestId:s,message:o,responseType:"wait_for_finish_response",timeout:n?t+5e3:0,options:{skipQueue:!0}});return{status:u.status,final:u.final,error:u.error,lastMessage:u.lastMessage}}subscribeTerminals(e){this.terminalDirectorySubscriptions.set((0,p.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,p.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,t,s){const n=this.createRequestId(t),o=c.SessionInboundMessageSchema.parse(Object.assign({type:"list_terminals_request"},void 0===e?{}:{cwd:e},void 0!==s?.workspaceId?{workspaceId:s.workspaceId}:{},{requestId:n}));return this.sendCorrelatedRequest({requestId:n,message:o,responseType:"list_terminals_response",options:{skipQueue:!0}})}async createTerminal(e,t,s,n){const o=this.createRequestId(s),u=c.SessionInboundMessageSchema.parse(Object.assign({type:"create_terminal_request",cwd:e,name:t,agentId:n?.agentId,command:n?.command,args:n?.args},void 0!==n?.workspaceId?{workspaceId:n.workspaceId}:{},{requestId:o}));return this.sendCorrelatedRequest({requestId:o,message:u,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,t){const s="object"==typeof t?t.restore:void 0,n="object"==typeof t?t.requestId:t,o=this.createRequestId(n),u=c.SessionInboundMessageSchema.parse(Object.assign({type:"subscribe_terminal_request",terminalId:e,requestId:o},s?{restore:s}:{})),p=await this.sendCorrelatedRequest({requestId:o,message:u,responseType:"subscribe_terminal_response",options:{skipQueue:!0}});return null===p.error&&this.terminalStreams.setSlot(e,p.slot),p}unsubscribeTerminal(e){this.terminalStreams.removeTerminal(e),this.sendSessionMessage({type:"unsubscribe_terminal_request",terminalId:e})}sendTerminalInput(e,t){const s=this.terminalStreams.encodeInput(e,t);s?this.sendBinaryFrame(s):this.sendSessionMessage({type:"terminal_input",terminalId:e,message:t})}async killTerminal(e,t){const s=this.createRequestId(t),n=c.SessionInboundMessageSchema.parse({type:"kill_terminal_request",terminalId:e,requestId:s});return this.sendCorrelatedRequest({requestId:s,message:n,responseType:"kill_terminal_response",options:{skipQueue:!0}})}async closeItems(e,t){const s=this.createRequestId(t),n=c.SessionInboundMessageSchema.parse({type:"close_items_request",agentIds:e.agentIds??[],terminalIds:e.terminalIds??[],requestId:s});return this.sendCorrelatedRequest({requestId:s,message:n,responseType:"close_items_response",options:{skipQueue:!0}})}async captureTerminal(e,t,s){const n=this.createRequestId(s),o=c.SessionInboundMessageSchema.parse(Object.assign({type:"capture_terminal_request",terminalId:e},void 0===t?.start?{}:{start:t.start},void 0===t?.end?{}:{end:t.end},void 0===t?.stripAnsi?{}:{stripAnsi:t.stripAnsi},{requestId:n}));return this.sendCorrelatedRequest({requestId:n,message:o,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 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 t="string"==typeof e?{id:e}:e;return this.sendCorrelatedSessionRequest({requestId:t.requestId,message:{type:"loop/inspect",id:t.id},responseType:"loop/inspect/response"})}async loopLogs(e,t){const s="string"==typeof e?{id:e,afterSeq:t}:e;return this.sendCorrelatedSessionRequest({requestId:s.requestId,message:Object.assign({type:"loop/logs",id:s.id},"number"==typeof s.afterSeq?{afterSeq:s.afterSeq}:{}),responseType:"loop/logs/response"})}async loopStop(e){const t="string"==typeof e?{id:e}:e;return this.sendCorrelatedSessionRequest({requestId:t.requestId,message:{type:"loop/stop",id:t.id},responseType:"loop/stop/response"})}onTerminalStreamEvent(e){return this.terminalStreams.onEvent(e)}async waitForTerminalStreamEvent(e,t=5e3){return new Promise((s,n)=>{const o=setTimeout(()=>{c(),n(new Error(`Timeout waiting for terminal stream event (${t}ms)`))},t),c=this.onTerminalStreamEvent(t=>{e(t)&&(clearTimeout(o),c(),s(t))})})}createRequestId(e){return e??crypto.randomUUID()}getLastServerInfoMessage(){return this.lastServerInfoMessage}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:{[o.CLIENT_CAPS.customModeIcons]:!0,[o.CLIENT_CAPS.reasoningMergeEnum]:!0,[o.CLIENT_CAPS.terminalReflowableSnapshot]:!0}},this.config.appVersion?{appVersion:this.config.appVersion}:{})))}catch(e){const t=e instanceof Error?e.message:"Failed to send hello message";this.lastErrorValue=t,this.scheduleReconnect({reason:t,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,t="Reconnecting"){if(this.stopLivenessHeartbeat(),this.cleanupTransport(),this.transport){try{this.transport.close(e,t)}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 t=e&&"object"==typeof e&&"data"in e?e.data:e;if("undefined"!=typeof Blob&&t instanceof Blob&&"function"==typeof t.arrayBuffer)return void t.arrayBuffer().then(e=>{this.handleTransportMessage(e)}).catch(()=>{});const s=(0,l.asUint8Array)(t);if(s&&this.tryHandleBinaryFrame(s))return;const n=(0,h.decodeMessageData)(t);n&&this.handleJsonPayload(n,s?.byteLength)}handleJsonPayload(e,t){const s=t??e.length,n=f();let o;try{o=JSON.parse(e)}catch{return}const u=c.WSOutboundMessageSchema.safeParse(o);if(!u.success){const e=null!=o&&"object"==typeof o&&"type"in o&&"string"==typeof o.type?o.type:"unknown";return void this.logger.warn({msgType:e,error:u.error.message},"Message validation failed")}if(this.consecutiveLivenessFailures=0,"pong"===u.data.type)return this.resolvePingProbe(),void this.runtimeMetrics?.recordMessage("pong",s,f()-n);this.handleSessionMessage(u.data.message);const p=u.data.message.type;this.runtimeMetrics?.recordMessage(p,s,f()-n),"agent_stream"===u.data.message.type&&this.runtimeMetrics?.recordAgentStream(u.data.message.payload)}tryHandleBinaryFrame(e){const t=(0,l.decodeFileTransferFrame)(e);if(t)return this.consecutiveLivenessFailures=0,this.handleFileTransferFrame(t),this.runtimeMetrics?.recordBinaryFrame("other",e.byteLength,0),!0;const s=(0,l.decodeTerminalStreamFrame)(e);if(!s)return!1;this.consecutiveLivenessFailures=0;const n=f();this.terminalStreams.handleFrame(s);let o="other";return s.opcode===l.TerminalStreamOpcode.Output?o="output":s.opcode===l.TerminalStreamOpcode.Snapshot?o="snapshot":s.opcode===l.TerminalStreamOpcode.Restore&&(o="output"),this.runtimeMetrics?.recordBinaryFrame(o,e.byteLength,f()-n),!0}handleFileTransferFrame(e){if(e.opcode===l.FileTransferOpcode.FileBegin){const t=this.pendingBinaryFileReads.get(e.requestId);if(!t)return;return void this.activeBinaryFileTransfers.set(e.requestId,Object.assign({},t,{mime:e.metadata.mime,size:e.metadata.size,encoding:e.metadata.encoding,modifiedAt:e.metadata.modifiedAt,chunks:[]}))}const t=this.activeBinaryFileTransfers.get(e.requestId);if(!t)return;if(e.opcode===l.FileTransferOpcode.FileChunk)return void t.chunks.push(e.payload);const s=E(t.chunks,t.size);var n,o;this.activeBinaryFileTransfers.delete(e.requestId),this.completedBinaryFileReads.set(e.requestId,{bytes:s,mime:t.mime,size:t.size,path:t.path,kind:(n=t.mime,o=t.encoding,n.startsWith("image/")?"image":"utf-8"===o||n.startsWith("text/")||"application/json"===n?"text":"binary"),modifiedAt:t.modifiedAt}),this.handleSessionMessage({type:"file_explorer_response",payload:{cwd:t.cwd,path:t.path,mode:"file",directory:null,file:null,error:null,requestId:e.requestId}})}updateConnectionState(e,t){const s=this.connectionState;this.connectionState=e;const n="disconnected"===e.status&&"string"==typeof e.reason?e.reason:null,o=t?.reason??n,c=t?.reasonCode??A(o);this.logger.debug({serverId:this.logServerId,clientIdHash:this.logClientIdHash,from:s.status,to:e.status,event:t?.event??"STATE_UPDATE",connectionPath:this.logConnectionPath,generation:this.logGeneration,reasonCode:c,reason:o},"DaemonClientTransition");for(const t of this.connectionListeners)try{t(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 t="disposed"===this.connectionState.status,s=e?.reason;"string"==typeof s&&s.trim().length>0&&(this.lastErrorValue=s.trim()),this.clearWaiters(new Error(s??"Connection lost")),this.rejectPendingSendQueue(new Error(s??"Connection lost")),this.rejectPingProbe(new Error(s??"Connection lost")),this.terminalStreams.clearSlots(),this.lastServerInfoMessage=null,t?this.rejectConnect(new Error(s??"Daemon client is disposed")):(this.emitDisconnectedStateForReconnect(s,e),this.shouldReconnect&&!1!==this.config.reconnect?.enabled?this.armReconnectTimer():this.rejectConnect(new Error(s??"Transport disconnected before connect")))}emitDisconnectedStateForReconnect(e,t){this.updateConnectionState(Object.assign({status:"disconnected"},e?{reason:e}:{}),Object.assign({event:t?.event??"TRANSPORT_CLOSE"},e?{reason:e}:{},t?.reasonCode?{reasonCode:t.reasonCode}:{}))}armReconnectTimer(){const e=this.reconnectAttempt,t=this.config.reconnect?.baseDelayMs??1500,s=this.config.reconnect?.maxDelayMs??3e4,n=Math.min(t*2**e,s);this.reconnectAttempt=e+1,this.reconnectTimeout=setTimeout(()=>{this.reconnectTimeout=null,this.shouldReconnect&&this.attemptConnect()},n)}resolvePingProbe(){const e=this.pingProbe;e&&(this.pingProbe=null,clearTimeout(e.timeoutHandle),e.resolve(f()-e.startedAt))}clearPingProbe(){const e=this.pingProbe;e&&(this.pingProbe=null,clearTimeout(e.timeoutHandle))}rejectPingProbe(e){const t=this.pingProbe;t&&(this.pingProbe=null,clearTimeout(t.timeoutHandle),t.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){if("status"===e.type){const t=(0,c.parseServerInfoStatusPayload)(e.payload);t&&(this.lastServerInfoMessage=t,"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"===e.type&&this.terminalStreams.removeTerminal(e.payload.terminalId),this.rawMessageListeners.size>0)for(const t of this.rawMessageListeners)try{t(e)}catch{}const t=this.messageHandlers.get(e.type);if(t)for(const s of t)try{s(e)}catch{}const s=this.toEvent(e);if(s)for(const e of this.eventListeners)e(s);this.resolveWaiters(e)}resolveWaiters(e){for(const t of Array.from(this.waiters)){const s=t.predicate(e);null!==s&&(this.waiters.delete(t),t.timeoutHandle&&clearTimeout(t.timeoutHandle),t.resolve(s))}}clearWaiters(e){for(const t of Array.from(this.waiters))t.timeoutHandle&&clearTimeout(t.timeoutHandle),t.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,t=3e4,s){const n=new Error(`Timeout waiting for message (${t}ms)`);let o=null,c=!1,u=null;return{promise:new Promise((s,p)=>{const l=e=>{c||(c=!0,p(e))};u=l;const h=t>0?setTimeout(()=>{o&&this.waiters.delete(o),l(n)},t):null;o={predicate:e,resolve:e=>{c||(c=!0,s(e))},reject:l,timeoutHandle:h},this.waiters.add(o)}),cancel:e=>{c||(o&&(this.waiters.delete(o),o.timeoutHandle&&clearTimeout(o.timeoutHandle)),u?u(e):queueMicrotask(()=>{!c&&u&&u(e)}))}}}}function F(t){const{config:s,provider:o,cwd:c}=t,u=(0,n.default)(t,e),p=Object.assign({},o?{provider:o}:{},c?{cwd:c}:{},u),l=s?Object.assign({},p,s):p;if(!l.provider||!l.cwd)throw new Error("createAgent requires provider and cwd");return Object.assign({},l,{provider:l.provider,cwd:l.cwd})}},3359,[35,3360,3361,3373,3374,3375,3379,3389,3390]);
15005
15005
  __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 n}});const n={reasoningMergeEnum:"reasoning_merge_enum",customModeIcons:"custom_mode_icons",terminalReflowableSnapshot:"terminal_reflowable_snapshot"}},3360,[]);
15006
- __d(function(g,r,i,a,m,_e,d){"use strict";const e=["contextKind"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PaseoConfigRawSchema",{enumerable:!0,get:function(){return j.PaseoConfigRawSchema}}),Object.defineProperty(_e,"PaseoLifecycleCommandRawSchema",{enumerable:!0,get:function(){return j.PaseoLifecycleCommandRawSchema}}),Object.defineProperty(_e,"PaseoMetadataGenerationEntrySchema",{enumerable:!0,get:function(){return j.PaseoMetadataGenerationEntrySchema}}),Object.defineProperty(_e,"PaseoMetadataGenerationSchema",{enumerable:!0,get:function(){return j.PaseoMetadataGenerationSchema}}),Object.defineProperty(_e,"PaseoScriptEntryRawSchema",{enumerable:!0,get:function(){return j.PaseoScriptEntryRawSchema}}),Object.defineProperty(_e,"PaseoWorktreeConfigRawSchema",{enumerable:!0,get:function(){return j.PaseoWorktreeConfigRawSchema}}),Object.defineProperty(_e,"TerminalProfileSchema",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"MutableDaemonConfigSchema",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"MutableDaemonConfigPatchSchema",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"AgentStatusSchema",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"AgentFeatureToggleSchema",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"AgentFeatureSelectSchema",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"AgentFeatureSchema",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"ProviderSnapshotEntrySchema",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"AgentPermissionResponseSchema",{enumerable:!0,get:function(){return V}}),Object.defineProperty(_e,"AgentPermissionRequestPayloadSchema",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(_e,"AgentTimelineItemPayloadSchema",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(_e,"AgentStreamEventPayloadSchema",{enumerable:!0,get:function(){return se}}),Object.defineProperty(_e,"AgentSnapshotPayloadSchema",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(_e,"AgentListItemPayloadSchema",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(_e,"RecentProviderSessionDescriptorPayloadSchema",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(_e,"VoiceAudioChunkMessageSchema",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(_e,"AbortRequestMessageSchema",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_e,"AudioPlayedMessageSchema",{enumerable:!0,get:function(){return de}}),Object.defineProperty(_e,"DeleteAgentRequestMessageSchema",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(_e,"ArchiveAgentRequestMessageSchema",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(_e,"CloseItemsRequestMessageSchema",{enumerable:!0,get:function(){return he}}),Object.defineProperty(_e,"UpdateAgentRequestMessageSchema",{enumerable:!0,get:function(){return je}}),Object.defineProperty(_e,"ProjectRenameRequestSchema",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(_e,"ProjectRemoveRequestSchema",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(_e,"WorkspaceTitleSetRequestSchema",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(_e,"SetVoiceModeMessageSchema",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(_e,"GitHubPrAttachmentSchema",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(_e,"GitHubIssueAttachmentSchema",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(_e,"TextAttachmentSchema",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(_e,"ReviewAttachmentContextLineSchema",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(_e,"ReviewAttachmentCommentSchema",{enumerable:!0,get:function(){return we}}),Object.defineProperty(_e,"ReviewAttachmentSchema",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(_e,"UploadedFileAttachmentSchema",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(_e,"AgentAttachmentSchema",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(_e,"SendAgentMessageSchema",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(_e,"FetchAgentsRequestMessageSchema",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(_e,"FetchWorkspacesRequestMessageSchema",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(_e,"FetchAgentHistoryRequestMessageSchema",{enumerable:!0,get:function(){return We}}),Object.defineProperty(_e,"FetchRecentProviderSessionsRequestMessageSchema",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(_e,"FetchAgentRequestMessageSchema",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(_e,"SendAgentMessageRequestSchema",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(_e,"WaitForFinishRequestSchema",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(_e,"DaemonGetStatusRequestSchema",{enumerable:!0,get:function(){return He}}),Object.defineProperty(_e,"DaemonGetPairingOfferRequestSchema",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(_e,"DiagnosticsRequestSchema",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(_e,"GetDaemonConfigRequestMessageSchema",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(_e,"SetDaemonConfigRequestMessageSchema",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(_e,"ReadProjectConfigRequestMessageSchema",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(_e,"WriteProjectConfigRequestMessageSchema",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(_e,"DictationStreamStartMessageSchema",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(_e,"DictationStreamChunkMessageSchema",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(_e,"DictationStreamFinishMessageSchema",{enumerable:!0,get:function(){return et}}),Object.defineProperty(_e,"DictationStreamCancelMessageSchema",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(_e,"CreateAgentWorktreeTargetSchema",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(_e,"CreateAgentRequestMessageSchema",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(_e,"ListProviderModelsRequestMessageSchema",{enumerable:!0,get:function(){return at}}),Object.defineProperty(_e,"ListProviderModesRequestMessageSchema",{enumerable:!0,get:function(){return it}}),Object.defineProperty(_e,"ListAvailableProvidersRequestMessageSchema",{enumerable:!0,get:function(){return st}}),Object.defineProperty(_e,"GetProvidersSnapshotRequestMessageSchema",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(_e,"RefreshProvidersSnapshotRequestMessageSchema",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(_e,"ProviderDiagnosticRequestMessageSchema",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(_e,"ProviderUsageListRequestMessageSchema",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(_e,"ResumeAgentRequestMessageSchema",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(_e,"ImportAgentRequestMessageSchema",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(_e,"RefreshAgentRequestMessageSchema",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(_e,"CancelAgentRequestMessageSchema",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(_e,"RestartServerRequestMessageSchema",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(_e,"ShutdownServerRequestMessageSchema",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(_e,"DaemonUpdateRequestMessageSchema",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(_e,"AgentTimelineCursorSchema",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(_e,"FetchAgentTimelineRequestMessageSchema",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(_e,"AgentForkContextRequestMessageSchema",{enumerable:!0,get:function(){return St}}),Object.defineProperty(_e,"SetAgentModeRequestMessageSchema",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(_e,"SetAgentModeResponseMessageSchema",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(_e,"SetAgentModelRequestMessageSchema",{enumerable:!0,get:function(){return It}}),Object.defineProperty(_e,"SetAgentModelResponseMessageSchema",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(_e,"SetAgentThinkingRequestMessageSchema",{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(_e,"SetAgentThinkingResponseMessageSchema",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(_e,"SetAgentFeatureRequestMessageSchema",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(_e,"SetAgentFeatureResponseMessageSchema",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(_e,"AgentDetachRequestMessageSchema",{enumerable:!0,get:function(){return At}}),Object.defineProperty(_e,"AgentDetachResponseMessageSchema",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(_e,"AgentRewindModeSchema",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(_e,"AgentRewindRequestMessageSchema",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(_e,"AgentRewindResponseMessageSchema",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(_e,"UpdateAgentResponseMessageSchema",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(_e,"ProjectRenameResponsePayloadSchema",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(_e,"ProjectRenameResponseSchema",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(_e,"ProjectRemoveResponsePayloadSchema",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(_e,"ProjectRemoveResponseSchema",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(_e,"WorkspaceTitleSetResponsePayloadSchema",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(_e,"WorkspaceTitleSetResponseSchema",{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(_e,"SetVoiceModeResponseMessageSchema",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(_e,"AgentPermissionResponseMessageSchema",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(_e,"CheckoutStatusRequestSchema",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(_e,"SubscribeCheckoutDiffRequestSchema",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(_e,"UnsubscribeCheckoutDiffRequestSchema",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(_e,"CheckoutCommitRequestSchema",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(_e,"CheckoutMergeRequestSchema",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(_e,"CheckoutMergeFromBaseRequestSchema",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(_e,"CheckoutPullRequestSchema",{enumerable:!0,get:function(){return en}}),Object.defineProperty(_e,"CheckoutPushRequestSchema",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(_e,"CheckoutRefreshRequestSchema",{enumerable:!0,get:function(){return nn}}),Object.defineProperty(_e,"CheckoutPrCreateRequestSchema",{enumerable:!0,get:function(){return rn}}),Object.defineProperty(_e,"CheckoutPrMergeRequestSchema",{enumerable:!0,get:function(){return on}}),Object.defineProperty(_e,"CheckoutGithubSetAutoMergeRequestSchema",{enumerable:!0,get:function(){return an}}),Object.defineProperty(_e,"CheckoutGithubGetCheckDetailsRequestSchema",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(_e,"CheckoutPrStatusRequestSchema",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(_e,"PullRequestTimelineRequestSchema",{enumerable:!0,get:function(){return un}}),Object.defineProperty(_e,"ValidateBranchRequestSchema",{enumerable:!0,get:function(){return zn}}),Object.defineProperty(_e,"CheckoutSwitchBranchRequestSchema",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(_e,"CheckoutRenameBranchRequestSchema",{enumerable:!0,get:function(){return gn}}),Object.defineProperty(_e,"StashSaveRequestSchema",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(_e,"StashPopRequestSchema",{enumerable:!0,get:function(){return dn}}),Object.defineProperty(_e,"StashListRequestSchema",{enumerable:!0,get:function(){return mn}}),Object.defineProperty(_e,"BranchSuggestionsRequestSchema",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(_e,"GitHubSearchItemSchema",{enumerable:!0,get:function(){return yn}}),Object.defineProperty(_e,"GitHubSearchKindSchema",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(_e,"GitHubSearchRequestSchema",{enumerable:!0,get:function(){return jn}}),Object.defineProperty(_e,"DirectorySuggestionsRequestSchema",{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(_e,"PaseoWorktreeListRequestSchema",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(_e,"PaseoWorktreeArchiveRequestSchema",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(_e,"FirstAgentContextSchema",{enumerable:!0,get:function(){return qn}}),Object.defineProperty(_e,"CreatePaseoWorktreeRequestSchema",{enumerable:!0,get:function(){return In}}),Object.defineProperty(_e,"WorkspaceSetupStatusRequestSchema",{enumerable:!0,get:function(){return On}}),Object.defineProperty(_e,"LegacyListAvailableEditorsRequestSchema",{enumerable:!0,get:function(){return Rn}}),Object.defineProperty(_e,"LegacyOpenInEditorRequestSchema",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(_e,"OpenProjectRequestSchema",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(_e,"ProjectAddRequestSchema",{enumerable:!0,get:function(){return wn}}),Object.defineProperty(_e,"ArchiveWorkspaceRequestSchema",{enumerable:!0,get:function(){return An}}),Object.defineProperty(_e,"WorkspaceCreateRequestSchema",{enumerable:!0,get:function(){return Mn}}),Object.defineProperty(_e,"WorkspaceClearAttentionRequestSchema",{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(_e,"FileExplorerRequestSchema",{enumerable:!0,get:function(){return En}}),Object.defineProperty(_e,"ProjectIconRequestSchema",{enumerable:!0,get:function(){return Fn}}),Object.defineProperty(_e,"FileDownloadTokenRequestSchema",{enumerable:!0,get:function(){return Gn}}),Object.defineProperty(_e,"FileUploadRequestSchema",{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(_e,"ClearAgentAttentionMessageSchema",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(_e,"ClientHeartbeatMessageSchema",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(_e,"PingMessageSchema",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(_e,"ListProviderFeaturesRequestMessageSchema",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(_e,"ListCommandsRequestSchema",{enumerable:!0,get:function(){return Jn}}),Object.defineProperty(_e,"RegisterPushTokenMessageSchema",{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(_e,"ListTerminalsRequestSchema",{enumerable:!0,get:function(){return Zn}}),Object.defineProperty(_e,"SubscribeTerminalsRequestSchema",{enumerable:!0,get:function(){return $n}}),Object.defineProperty(_e,"UnsubscribeTerminalsRequestSchema",{enumerable:!0,get:function(){return er}}),Object.defineProperty(_e,"CreateTerminalRequestSchema",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(_e,"RenameTerminalRequestSchema",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(_e,"StartWorkspaceScriptRequestSchema",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(_e,"SubscribeTerminalRequestSchema",{enumerable:!0,get:function(){return or}}),Object.defineProperty(_e,"UnsubscribeTerminalRequestSchema",{enumerable:!0,get:function(){return ar}}),Object.defineProperty(_e,"TerminalInputSchema",{enumerable:!0,get:function(){return sr}}),Object.defineProperty(_e,"KillTerminalRequestSchema",{enumerable:!0,get:function(){return lr}}),Object.defineProperty(_e,"CaptureTerminalRequestSchema",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(_e,"SessionInboundMessageSchema",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(_e,"ActivityLogPayloadSchema",{enumerable:!0,get:function(){return zr}}),Object.defineProperty(_e,"ActivityLogMessageSchema",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(_e,"AssistantChunkMessageSchema",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(_e,"AudioOutputMessageSchema",{enumerable:!0,get:function(){return br}}),Object.defineProperty(_e,"TranscriptionResultMessageSchema",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(_e,"VoiceInputStateMessageSchema",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(_e,"DictationStreamAckMessageSchema",{enumerable:!0,get:function(){return fr}}),Object.defineProperty(_e,"DictationStreamFinishAcceptedMessageSchema",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(_e,"DictationStreamPartialMessageSchema",{enumerable:!0,get:function(){return hr}}),Object.defineProperty(_e,"DictationStreamFinalMessageSchema",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(_e,"DictationStreamErrorMessageSchema",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(_e,"ServerCapabilityStateSchema",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(_e,"ServerVoiceCapabilitiesSchema",{enumerable:!0,get:function(){return _r}}),Object.defineProperty(_e,"ServerCapabilitiesSchema",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(_e,"ServerInfoStatusPayloadSchema",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(_e,"StatusMessageSchema",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(_e,"PongMessageSchema",{enumerable:!0,get:function(){return wr}}),Object.defineProperty(_e,"RpcErrorMessageSchema",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(_e,"AgentCreatedStatusPayloadSchema",{enumerable:!0,get:function(){return Tr}}),Object.defineProperty(_e,"AgentCreateFailedStatusPayloadSchema",{enumerable:!0,get:function(){return Lr}}),Object.defineProperty(_e,"AgentResumedStatusPayloadSchema",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(_e,"AgentRefreshedStatusPayloadSchema",{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(_e,"RestartRequestedStatusPayloadSchema",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(_e,"ShutdownRequestedStatusPayloadSchema",{enumerable:!0,get:function(){return Ur}}),Object.defineProperty(_e,"DaemonConfigChangedStatusPayloadSchema",{enumerable:!0,get:function(){return Wr}}),Object.defineProperty(_e,"KnownStatusPayloadSchema",{enumerable:!0,get:function(){return Er}}),Object.defineProperty(_e,"ArtifactMessageSchema",{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(_e,"ProjectCheckoutLiteNotGitPayloadSchema",{enumerable:!0,get:function(){return Gr}}),Object.defineProperty(_e,"ProjectCheckoutLiteGitNonPaseoPayloadSchema",{enumerable:!0,get:function(){return Br}}),Object.defineProperty(_e,"ProjectCheckoutLiteGitPaseoPayloadSchema",{enumerable:!0,get:function(){return Hr}}),Object.defineProperty(_e,"ProjectCheckoutLitePayloadSchema",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(_e,"ProjectPlacementPayloadSchema",{enumerable:!0,get:function(){return Vr}}),Object.defineProperty(_e,"WorkspaceScriptLifecycleSchema",{enumerable:!0,get:function(){return Qr}}),Object.defineProperty(_e,"WorkspaceScriptHealthSchema",{enumerable:!0,get:function(){return Xr}}),Object.defineProperty(_e,"WorkspaceScriptPayloadSchema",{enumerable:!0,get:function(){return Jr}}),Object.defineProperty(_e,"WorkspaceDescriptorPayloadSchema",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(_e,"AgentUpdateMessageSchema",{enumerable:!0,get:function(){return eo}}),Object.defineProperty(_e,"AgentStreamMessageSchema",{enumerable:!0,get:function(){return to}}),Object.defineProperty(_e,"AgentStatusMessageSchema",{enumerable:!0,get:function(){return no}}),Object.defineProperty(_e,"AgentListMessageSchema",{enumerable:!0,get:function(){return ro}}),Object.defineProperty(_e,"FetchAgentsResponseMessageSchema",{enumerable:!0,get:function(){return io}}),Object.defineProperty(_e,"FetchAgentHistoryResponseMessageSchema",{enumerable:!0,get:function(){return so}}),Object.defineProperty(_e,"FetchRecentProviderSessionsResponseMessageSchema",{enumerable:!0,get:function(){return lo}}),Object.defineProperty(_e,"WorkspaceProjectDescriptorPayloadSchema",{enumerable:!0,get:function(){return co}}),Object.defineProperty(_e,"FetchWorkspacesResponseMessageSchema",{enumerable:!0,get:function(){return uo}}),Object.defineProperty(_e,"WorkspaceUpdateMessageSchema",{enumerable:!0,get:function(){return zo}}),Object.defineProperty(_e,"ScriptStatusUpdateMessageSchema",{enumerable:!0,get:function(){return po}}),Object.defineProperty(_e,"WorkspaceSetupProgressMessageSchema",{enumerable:!0,get:function(){return go}}),Object.defineProperty(_e,"WorkspaceSetupSnapshotSchema",{enumerable:!0,get:function(){return bo}}),Object.defineProperty(_e,"WorkspaceSetupStatusResponseMessageSchema",{enumerable:!0,get:function(){return mo}}),Object.defineProperty(_e,"OpenProjectResponseMessageSchema",{enumerable:!0,get:function(){return fo}}),Object.defineProperty(_e,"ProjectAddResponseSchema",{enumerable:!0,get:function(){return yo}}),Object.defineProperty(_e,"StartWorkspaceScriptResponseMessageSchema",{enumerable:!0,get:function(){return ho}}),Object.defineProperty(_e,"LegacyListAvailableEditorsResponseMessageSchema",{enumerable:!0,get:function(){return jo}}),Object.defineProperty(_e,"LegacyOpenInEditorResponseMessageSchema",{enumerable:!0,get:function(){return So}}),Object.defineProperty(_e,"ArchiveWorkspaceResponseMessageSchema",{enumerable:!0,get:function(){return Po}}),Object.defineProperty(_e,"FetchAgentResponseMessageSchema",{enumerable:!0,get:function(){return _o}}),Object.defineProperty(_e,"AgentTimelineEntryPayloadSchema",{enumerable:!0,get:function(){return Io}}),Object.defineProperty(_e,"FetchAgentTimelineResponseMessageSchema",{enumerable:!0,get:function(){return Oo}}),Object.defineProperty(_e,"AgentForkContextResponseMessageSchema",{enumerable:!0,get:function(){return Ro}}),Object.defineProperty(_e,"CancelAgentResponseMessageSchema",{enumerable:!0,get:function(){return ko}}),Object.defineProperty(_e,"ClearAgentAttentionResponseMessageSchema",{enumerable:!0,get:function(){return vo}}),Object.defineProperty(_e,"WorkspaceCreateResponseSchema",{enumerable:!0,get:function(){return wo}}),Object.defineProperty(_e,"WorkspaceClearAttentionResponseSchema",{enumerable:!0,get:function(){return Ao}}),Object.defineProperty(_e,"SendAgentMessageResponseMessageSchema",{enumerable:!0,get:function(){return Mo}}),Object.defineProperty(_e,"WaitForFinishResponseMessageSchema",{enumerable:!0,get:function(){return Co}}),Object.defineProperty(_e,"GetDaemonConfigResponseMessageSchema",{enumerable:!0,get:function(){return To}}),Object.defineProperty(_e,"DaemonGetStatusResponseSchema",{enumerable:!0,get:function(){return Lo}}),Object.defineProperty(_e,"DaemonGetPairingOfferResponseSchema",{enumerable:!0,get:function(){return xo}}),Object.defineProperty(_e,"DiagnosticsResponseSchema",{enumerable:!0,get:function(){return No}}),Object.defineProperty(_e,"SetDaemonConfigResponseMessageSchema",{enumerable:!0,get:function(){return Do}}),Object.defineProperty(_e,"ReadProjectConfigResponseMessageSchema",{enumerable:!0,get:function(){return Uo}}),Object.defineProperty(_e,"WriteProjectConfigResponseMessageSchema",{enumerable:!0,get:function(){return Wo}}),Object.defineProperty(_e,"AgentPermissionRequestMessageSchema",{enumerable:!0,get:function(){return Eo}}),Object.defineProperty(_e,"AgentPermissionResolvedMessageSchema",{enumerable:!0,get:function(){return Fo}}),Object.defineProperty(_e,"AgentDeletedMessageSchema",{enumerable:!0,get:function(){return Go}}),Object.defineProperty(_e,"AgentArchivedMessageSchema",{enumerable:!0,get:function(){return Bo}}),Object.defineProperty(_e,"CloseItemsResponseSchema",{enumerable:!0,get:function(){return Vo}}),Object.defineProperty(_e,"CheckoutStatusResponseSchema",{enumerable:!0,get:function(){return $o}}),Object.defineProperty(_e,"CheckoutPrStatusSchema",{enumerable:!0,get:function(){return ra}}),Object.defineProperty(_e,"CheckoutStatusUpdateSchema",{enumerable:!0,get:function(){return ia}}),Object.defineProperty(_e,"SubscribeCheckoutDiffResponseSchema",{enumerable:!0,get:function(){return la}}),Object.defineProperty(_e,"CheckoutDiffUpdateSchema",{enumerable:!0,get:function(){return ca}}),Object.defineProperty(_e,"CheckoutCommitResponseSchema",{enumerable:!0,get:function(){return ua}}),Object.defineProperty(_e,"CheckoutMergeResponseSchema",{enumerable:!0,get:function(){return za}}),Object.defineProperty(_e,"CheckoutMergeFromBaseResponseSchema",{enumerable:!0,get:function(){return pa}}),Object.defineProperty(_e,"CheckoutPullResponseSchema",{enumerable:!0,get:function(){return ga}}),Object.defineProperty(_e,"CheckoutPushResponseSchema",{enumerable:!0,get:function(){return ba}}),Object.defineProperty(_e,"CheckoutRefreshResponseSchema",{enumerable:!0,get:function(){return da}}),Object.defineProperty(_e,"CheckoutPrCreateResponseSchema",{enumerable:!0,get:function(){return ma}}),Object.defineProperty(_e,"CheckoutPrMergeResponseSchema",{enumerable:!0,get:function(){return fa}}),Object.defineProperty(_e,"CheckoutGithubSetAutoMergeResponseSchema",{enumerable:!0,get:function(){return ya}}),Object.defineProperty(_e,"CheckoutGithubCheckDetailsSchema",{enumerable:!0,get:function(){return Sa}}),Object.defineProperty(_e,"CheckoutGithubGetCheckDetailsResponseSchema",{enumerable:!0,get:function(){return Pa}}),Object.defineProperty(_e,"CheckoutPrStatusResponseSchema",{enumerable:!0,get:function(){return _a}}),Object.defineProperty(_e,"PullRequestTimelineItemSchema",{enumerable:!0,get:function(){return ka}}),Object.defineProperty(_e,"PullRequestTimelineResponseSchema",{enumerable:!0,get:function(){return va}}),Object.defineProperty(_e,"CheckoutSwitchBranchResponseSchema",{enumerable:!0,get:function(){return wa}}),Object.defineProperty(_e,"CheckoutRenameBranchResponseSchema",{enumerable:!0,get:function(){return Aa}}),Object.defineProperty(_e,"StashSaveResponseSchema",{enumerable:!0,get:function(){return Ca}}),Object.defineProperty(_e,"StashPopResponseSchema",{enumerable:!0,get:function(){return Ta}}),Object.defineProperty(_e,"StashListResponseSchema",{enumerable:!0,get:function(){return La}}),Object.defineProperty(_e,"ValidateBranchResponseSchema",{enumerable:!0,get:function(){return xa}}),Object.defineProperty(_e,"BranchSuggestionsResponseSchema",{enumerable:!0,get:function(){return Na}}),Object.defineProperty(_e,"GitHubSearchResponseSchema",{enumerable:!0,get:function(){return Da}}),Object.defineProperty(_e,"DirectorySuggestionsResponseSchema",{enumerable:!0,get:function(){return Ua}}),Object.defineProperty(_e,"PaseoWorktreeListResponseSchema",{enumerable:!0,get:function(){return Ea}}),Object.defineProperty(_e,"PaseoWorktreeArchiveResponseSchema",{enumerable:!0,get:function(){return Fa}}),Object.defineProperty(_e,"CreatePaseoWorktreeResponseSchema",{enumerable:!0,get:function(){return Ga}}),Object.defineProperty(_e,"FileExplorerResponseSchema",{enumerable:!0,get:function(){return Ba}}),Object.defineProperty(_e,"ProjectIconResponseSchema",{enumerable:!0,get:function(){return Ka}}),Object.defineProperty(_e,"FileDownloadTokenResponseSchema",{enumerable:!0,get:function(){return Va}}),Object.defineProperty(_e,"FileUploadResponseSchema",{enumerable:!0,get:function(){return Qa}}),Object.defineProperty(_e,"ListProviderModelsResponseMessageSchema",{enumerable:!0,get:function(){return Xa}}),Object.defineProperty(_e,"ListProviderModesResponseMessageSchema",{enumerable:!0,get:function(){return Ja}}),Object.defineProperty(_e,"ListProviderFeaturesResponseMessageSchema",{enumerable:!0,get:function(){return Ya}}),Object.defineProperty(_e,"ListAvailableProvidersResponseSchema",{enumerable:!0,get:function(){return $a}}),Object.defineProperty(_e,"GetProvidersSnapshotResponseMessageSchema",{enumerable:!0,get:function(){return ei}}),Object.defineProperty(_e,"ProvidersSnapshotUpdateMessageSchema",{enumerable:!0,get:function(){return ti}}),Object.defineProperty(_e,"RefreshProvidersSnapshotResponseMessageSchema",{enumerable:!0,get:function(){return ni}}),Object.defineProperty(_e,"ProviderDiagnosticResponseMessageSchema",{enumerable:!0,get:function(){return ri}}),Object.defineProperty(_e,"ProviderUsageToneSchema",{enumerable:!0,get:function(){return oi}}),Object.defineProperty(_e,"ProviderUsageStatusSchema",{enumerable:!0,get:function(){return ai}}),Object.defineProperty(_e,"ProviderUsageWindowSchema",{enumerable:!0,get:function(){return ii}}),Object.defineProperty(_e,"ProviderUsageBalanceSchema",{enumerable:!0,get:function(){return si}}),Object.defineProperty(_e,"ProviderUsageDetailSchema",{enumerable:!0,get:function(){return li}}),Object.defineProperty(_e,"ProviderUsageSchema",{enumerable:!0,get:function(){return ci}}),Object.defineProperty(_e,"ProviderUsageListResponseMessageSchema",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(_e,"ListCommandsResponseSchema",{enumerable:!0,get:function(){return pi}}),Object.defineProperty(_e,"TerminalCellSchema",{enumerable:!0,get:function(){return bi}}),Object.defineProperty(_e,"TerminalCursorStyleSchema",{enumerable:!0,get:function(){return di}}),Object.defineProperty(_e,"TerminalCursorSchema",{enumerable:!0,get:function(){return mi}}),Object.defineProperty(_e,"TerminalStateSchema",{enumerable:!0,get:function(){return fi}}),Object.defineProperty(_e,"ListTerminalsResponseSchema",{enumerable:!0,get:function(){return yi}}),Object.defineProperty(_e,"TerminalsChangedSchema",{enumerable:!0,get:function(){return hi}}),Object.defineProperty(_e,"CreateTerminalResponseSchema",{enumerable:!0,get:function(){return ji}}),Object.defineProperty(_e,"RenameTerminalResponseSchema",{enumerable:!0,get:function(){return Si}}),Object.defineProperty(_e,"SubscribeTerminalResponseSchema",{enumerable:!0,get:function(){return Pi}}),Object.defineProperty(_e,"KillTerminalResponseSchema",{enumerable:!0,get:function(){return _i}}),Object.defineProperty(_e,"CaptureTerminalResponseSchema",{enumerable:!0,get:function(){return qi}}),Object.defineProperty(_e,"TerminalStreamExitSchema",{enumerable:!0,get:function(){return Ii}}),Object.defineProperty(_e,"TerminalAttentionRequiredSchema",{enumerable:!0,get:function(){return Oi}}),Object.defineProperty(_e,"DaemonUpdateResponseSchema",{enumerable:!0,get:function(){return Ri}}),Object.defineProperty(_e,"DaemonUpdateProgressMessageSchema",{enumerable:!0,get:function(){return ki}}),Object.defineProperty(_e,"SessionOutboundMessageSchema",{enumerable:!0,get:function(){return vi}}),Object.defineProperty(_e,"WSPingMessageSchema",{enumerable:!0,get:function(){return wi}}),Object.defineProperty(_e,"WSPongMessageSchema",{enumerable:!0,get:function(){return Ai}}),Object.defineProperty(_e,"WSHelloMessageSchema",{enumerable:!0,get:function(){return Mi}}),Object.defineProperty(_e,"WSRecordingStateMessageSchema",{enumerable:!0,get:function(){return Ci}}),Object.defineProperty(_e,"WSSessionInboundSchema",{enumerable:!0,get:function(){return Ti}}),Object.defineProperty(_e,"WSSessionOutboundSchema",{enumerable:!0,get:function(){return Li}}),Object.defineProperty(_e,"WSInboundMessageSchema",{enumerable:!0,get:function(){return xi}}),Object.defineProperty(_e,"WSOutboundMessageSchema",{enumerable:!0,get:function(){return Ni}}),_e.extractSessionMessage=function(e){if("session"===e.type)return e.message;return null},_e.wrapSessionMessage=function(e){return{type:"session",message:e}},_e.parseServerInfoStatusPayload=function(e){const t=kr.safeParse(e);if(!t.success)return null;return t.data};var t,n=r(d[0]),o=(t=n)&&t.__esModule?t:{default:t},s=r(d[1]),l=r(d[2]),c=r(d[3]),u=r(d[4]),z=r(d[5]),p=r(d[6]),b=r(d[7]),f=r(d[8]),y=r(d[9]),h=r(d[10]),j=r(d[11]);const S=s.z.object({id:s.z.string().min(1),label:s.z.string().min(1),description:s.z.string().optional(),isDefault:s.z.boolean().optional()}).passthrough(),P=s.z.object({enabled:s.z.boolean().optional(),additionalModels:s.z.array(S).optional()}).passthrough(),_=s.z.object({provider:s.z.string().min(1),model:s.z.string().min(1).optional(),thinkingOptionId:s.z.string().min(1).optional()}).passthrough(),q=s.z.object({providers:s.z.array(_).default([])}).passthrough(),I=s.z.object({id:s.z.string(),name:s.z.string(),command:s.z.string(),args:s.z.array(s.z.string()).optional(),icon:s.z.string().optional()}).passthrough(),O=s.z.object({mcp:s.z.object({injectIntoAgents:s.z.boolean()}).passthrough(),providers:s.z.record(s.z.string(),P).default({}),metadataGeneration:q.default({providers:[]}),autoArchiveAfterMerge:s.z.boolean().default(!1),enableTerminalAgentHooks:s.z.boolean().default(!1),appendSystemPrompt:s.z.string().default(""),terminalProfiles:s.z.array(I).optional()}).passthrough(),R=s.z.object({mcp:O.shape.mcp.partial().optional(),providers:s.z.record(s.z.string(),P.partial().passthrough()).optional(),metadataGeneration:q.partial().optional(),autoArchiveAfterMerge:s.z.boolean().optional(),enableTerminalAgentHooks:s.z.boolean().optional(),appendSystemPrompt:s.z.string().optional(),terminalProfiles:s.z.array(I).optional()}).partial().passthrough(),k=s.z.enum(u.AGENT_LIFECYCLE_STATUSES),v=s.z.object({id:s.z.string(),label:s.z.string(),description:s.z.string().optional(),icon:s.z.string().optional(),colorTier:s.z.string().optional()}),w=s.z.enum(["ready","loading","error","unavailable"]),A=s.z.object({id:s.z.string(),label:s.z.string(),description:s.z.string().optional(),isDefault:s.z.boolean().optional(),metadata:s.z.record(s.z.string(),s.z.unknown()).optional()}),M=s.z.discriminatedUnion("type",[s.z.object({type:s.z.literal("info"),message:s.z.string()}),s.z.object({type:s.z.literal("warning"),message:s.z.string()}),s.z.object({type:s.z.literal("error"),message:s.z.string()})]),C=s.z.object({type:s.z.literal("toggle"),id:s.z.string(),label:s.z.string(),description:s.z.string().optional(),tooltip:s.z.string().optional(),icon:s.z.string().optional(),value:s.z.boolean()}),T=s.z.object({type:s.z.literal("select"),id:s.z.string(),label:s.z.string(),description:s.z.string().optional(),tooltip:s.z.string().optional(),icon:s.z.string().optional(),value:s.z.string().nullable(),options:s.z.array(A)}),L=s.z.discriminatedUnion("type",[C,T]),x=s.z.object({provider:p.AgentProviderSchema,id:s.z.string(),label:s.z.string(),description:s.z.string().optional(),isDefault:s.z.boolean().optional(),metadata:s.z.record(s.z.string(),s.z.unknown()).optional(),thinkingOptions:s.z.array(A).optional(),defaultThinkingOptionId:s.z.string().optional()}).transform(b.normalizeAgentModelDefinition),N=s.z.object({provider:p.AgentProviderSchema,status:w,enabled:s.z.boolean().optional().default(!0),error:s.z.string().optional(),models:s.z.array(x).optional(),modes:s.z.array(v).optional(),fetchedAt:s.z.string().optional(),label:s.z.string().optional(),description:s.z.string().optional(),defaultModeId:s.z.string().nullable().optional()}),D=s.z.object({supportsStreaming:s.z.boolean(),supportsSessionPersistence:s.z.boolean(),supportsSessionListing:s.z.boolean().optional(),supportsDynamicModes:s.z.boolean(),supportsMcpServers:s.z.boolean(),supportsReasoningStream:s.z.boolean(),supportsToolInvocations:s.z.boolean(),supportsRewindConversation:s.z.boolean().optional().default(!1),supportsRewindFiles:s.z.boolean().optional().default(!1),supportsRewindBoth:s.z.boolean().optional().default(!1)}).catchall(s.z.boolean()),U=s.z.object({inputTokens:s.z.number().optional(),cachedInputTokens:s.z.number().optional(),outputTokens:s.z.number().optional(),totalCostUsd:s.z.number().optional(),contextWindowMaxTokens:s.z.number().optional(),contextWindowUsedTokens:s.z.number().optional()}),W=s.z.object({type:s.z.literal("stdio"),command:s.z.string(),args:s.z.array(s.z.string()).optional(),env:s.z.record(s.z.string(),s.z.string()).optional(),alwaysLoad:s.z.boolean().optional()}),E=s.z.object({type:s.z.literal("http"),url:s.z.string(),headers:s.z.record(s.z.string(),s.z.string()).optional(),alwaysLoad:s.z.boolean().optional()}),F=s.z.object({type:s.z.literal("sse"),url:s.z.string(),headers:s.z.record(s.z.string(),s.z.string()).optional(),alwaysLoad:s.z.boolean().optional()}),G=s.z.discriminatedUnion("type",[W,E,F]),B=s.z.object({provider:p.AgentProviderSchema,cwd:s.z.string(),modeId:s.z.string().optional(),model:s.z.string().optional(),thinkingOptionId:s.z.string().optional(),featureValues:s.z.record(s.z.string(),s.z.unknown()).optional(),title:s.z.string().trim().min(1).max(z.MAX_EXPLICIT_AGENT_TITLE_CHARS).optional().nullable(),approvalPolicy:s.z.string().optional(),sandboxMode:s.z.string().optional(),networkAccess:s.z.boolean().optional(),webSearch:s.z.boolean().optional(),extra:s.z.object({codex:s.z.record(s.z.string(),s.z.unknown()).optional(),claude:s.z.record(s.z.string(),s.z.unknown()).optional()}).partial().optional(),systemPrompt:s.z.string().optional(),mcpServers:s.z.record(s.z.string(),G).optional()}),H=s.z.record(s.z.string(),s.z.unknown()),K=s.z.object({id:s.z.string(),label:s.z.string(),behavior:s.z.enum(["allow","deny"]),variant:s.z.enum(["primary","secondary","danger"]).optional(),intent:s.z.enum(["implement","implement_resume","dismiss"]).optional()}),V=s.z.union([s.z.object({behavior:s.z.literal("allow"),selectedActionId:s.z.string().optional(),updatedInput:s.z.record(s.z.string(),s.z.unknown()).optional(),updatedPermissions:s.z.array(H).optional()}),s.z.object({behavior:s.z.literal("deny"),selectedActionId:s.z.string().optional(),message:s.z.string().optional(),interrupt:s.z.boolean().optional()})]),Q=s.z.object({id:s.z.string(),provider:p.AgentProviderSchema,name:s.z.string(),kind:s.z.enum(["tool","plan","question","mode","other"]),title:s.z.string().optional(),description:s.z.string().optional(),input:s.z.record(s.z.string(),s.z.unknown()).optional(),detail:s.z.lazy(()=>$).optional(),suggestions:s.z.array(H).optional(),actions:s.z.array(K).optional(),metadata:s.z.record(s.z.string(),s.z.unknown()).optional()}),X=s.z.union([s.z.null(),s.z.boolean(),s.z.number(),s.z.string(),s.z.array(s.z.unknown()),s.z.object({}).passthrough()]),J=s.z.union([s.z.boolean(),s.z.number(),s.z.string(),s.z.array(s.z.unknown()),s.z.object({}).passthrough()]),Y=s.z.object({index:s.z.number().int().positive(),command:s.z.string(),cwd:s.z.string(),log:s.z.string().optional().default(""),status:s.z.enum(["running","completed","failed"]),exitCode:s.z.number().nullable(),durationMs:s.z.number().nonnegative().optional()}),Z=s.z.object({type:s.z.literal("worktree_setup"),worktreePath:s.z.string(),branchName:s.z.string(),log:s.z.string(),commands:s.z.array(Y),truncated:s.z.boolean().optional()}),$=s.z.discriminatedUnion("type",[Z,s.z.object({type:s.z.literal("shell"),command:s.z.string(),cwd:s.z.string().optional(),output:s.z.string().optional(),exitCode:s.z.number().nullable().optional()}),s.z.object({type:s.z.literal("read"),filePath:s.z.string(),content:s.z.string().optional(),offset:s.z.number().optional(),limit:s.z.number().optional()}),s.z.object({type:s.z.literal("edit"),filePath:s.z.string(),oldString:s.z.string().optional(),newString:s.z.string().optional(),unifiedDiff:s.z.string().optional()}),s.z.object({type:s.z.literal("write"),filePath:s.z.string(),content:s.z.string().optional()}),s.z.object({type:s.z.literal("search"),query:s.z.string(),toolName:s.z.enum(["search","grep","glob","web_search"]).optional(),content:s.z.string().optional(),filePaths:s.z.array(s.z.string()).optional(),webResults:s.z.array(s.z.object({title:s.z.string(),url:s.z.string()})).optional(),annotations:s.z.array(s.z.string()).optional(),numFiles:s.z.number().optional(),numMatches:s.z.number().optional(),durationMs:s.z.number().optional(),durationSeconds:s.z.number().optional(),truncated:s.z.boolean().optional(),mode:s.z.enum(["content","files_with_matches","count"]).optional()}),s.z.object({type:s.z.literal("fetch"),url:s.z.string(),prompt:s.z.string().optional(),result:s.z.string().optional(),code:s.z.number().optional(),codeText:s.z.string().optional(),bytes:s.z.number().optional(),durationMs:s.z.number().optional()}),s.z.object({type:s.z.literal("sub_agent"),subAgentType:s.z.string().optional(),description:s.z.string().optional(),childSessionId:s.z.string().optional(),log:s.z.string(),actions:s.z.array(s.z.object({index:s.z.number().int().positive(),toolName:s.z.string(),summary:s.z.string().optional()})).optional()}),s.z.object({type:s.z.literal("plain_text"),label:s.z.string().optional(),text:s.z.string().optional(),icon:s.z.enum(b.TOOL_CALL_ICON_NAMES).optional()}),s.z.object({type:s.z.literal("plan"),text:s.z.string()}),s.z.object({type:s.z.literal("unknown"),input:X,output:X})]),ee=s.z.object({type:s.z.literal("tool_call"),callId:s.z.string(),name:s.z.string(),detail:$,metadata:s.z.record(s.z.string(),s.z.unknown()).optional()}),te=ee.extend({status:s.z.literal("running"),error:s.z.null()}),ne=ee.extend({status:s.z.literal("completed"),error:s.z.null()}),re=ee.extend({status:s.z.literal("failed"),error:J}),oe=ee.extend({status:s.z.literal("canceled"),error:s.z.null()}),ae=s.z.union([te,ne,re,oe]),ie=s.z.union([s.z.object({type:s.z.literal("user_message"),text:s.z.string(),messageId:s.z.string().optional()}),s.z.object({type:s.z.literal("assistant_message"),text:s.z.string(),messageId:s.z.string().optional()}),s.z.object({type:s.z.literal("reasoning"),text:s.z.string()}),ae,s.z.object({type:s.z.literal("todo"),items:s.z.array(s.z.object({text:s.z.string(),completed:s.z.boolean()}))}),s.z.object({type:s.z.literal("error"),message:s.z.string()}),s.z.object({type:s.z.literal("compaction"),status:s.z.enum(["loading","completed"]),trigger:s.z.enum(["auto","manual"]).optional(),preTokens:s.z.number().optional()})]),se=s.z.discriminatedUnion("type",[s.z.object({type:s.z.literal("thread_started"),sessionId:s.z.string(),provider:p.AgentProviderSchema}),s.z.object({type:s.z.literal("turn_started"),provider:p.AgentProviderSchema}),s.z.object({type:s.z.literal("turn_completed"),provider:p.AgentProviderSchema,usage:U.optional()}),s.z.object({type:s.z.literal("turn_failed"),provider:p.AgentProviderSchema,error:s.z.string(),code:s.z.string().optional(),diagnostic:s.z.string().optional()}),s.z.object({type:s.z.literal("turn_canceled"),provider:p.AgentProviderSchema,reason:s.z.string()}),s.z.object({type:s.z.literal("timeline"),provider:p.AgentProviderSchema,item:ie}),s.z.object({type:s.z.literal("permission_requested"),provider:p.AgentProviderSchema,request:Q}),s.z.object({type:s.z.literal("permission_resolved"),provider:p.AgentProviderSchema,requestId:s.z.string(),resolution:V}),s.z.object({type:s.z.literal("attention_required"),provider:p.AgentProviderSchema,reason:s.z.enum(["finished","error","permission"]),timestamp:s.z.string(),shouldNotify:s.z.boolean(),notification:s.z.object({title:s.z.string(),body:s.z.string(),data:s.z.object({serverId:s.z.string(),agentId:s.z.string(),reason:s.z.enum(["finished","error","permission"])})}).optional()})]),le=s.z.object({provider:p.AgentProviderSchema,sessionId:s.z.string(),nativeHandle:s.z.string().optional(),metadata:s.z.record(s.z.string(),s.z.unknown()).optional()}).nullable(),ce=s.z.object({provider:p.AgentProviderSchema,sessionId:s.z.string().nullable(),model:s.z.string().nullable().optional(),thinkingOptionId:s.z.string().nullable().optional(),modeId:s.z.string().nullable().optional(),extra:s.z.record(s.z.string(),s.z.unknown()).optional()}),ue=s.z.object({id:s.z.string(),provider:p.AgentProviderSchema,cwd:s.z.string(),workspaceId:s.z.string().optional(),model:s.z.string().nullable(),features:s.z.array(L).optional(),thinkingOptionId:s.z.string().nullable().optional(),effectiveThinkingOptionId:s.z.string().nullable().optional(),createdAt:s.z.string(),updatedAt:s.z.string(),lastUserMessageAt:s.z.string().nullable(),status:k,capabilities:D,currentModeId:s.z.string().nullable(),availableModes:s.z.array(v),pendingPermissions:s.z.array(Q),persistence:le.nullable(),runtimeInfo:ce.optional(),lastUsage:U.optional(),lastError:s.z.string().optional(),title:s.z.string().nullable(),labels:s.z.record(s.z.string(),s.z.string()).default({}),requiresAttention:s.z.boolean().optional(),attentionReason:s.z.enum(["finished","error","permission"]).nullable().optional(),attentionTimestamp:s.z.string().nullable().optional(),archivedAt:s.z.string().nullable().optional(),providerUnavailable:s.z.boolean().optional()}),ze=s.z.object({id:s.z.string(),shortId:s.z.string(),title:s.z.string().nullable(),provider:p.AgentProviderSchema,model:s.z.string().nullable(),thinkingOptionId:s.z.string().nullable().optional(),effectiveThinkingOptionId:s.z.string().nullable().optional(),status:k,cwd:s.z.string(),createdAt:s.z.string(),updatedAt:s.z.string(),lastUserMessageAt:s.z.string().nullable(),archivedAt:s.z.string().nullable().optional(),requiresAttention:s.z.boolean().optional(),attentionReason:s.z.enum(["finished","error","permission"]).nullable().optional(),attentionTimestamp:s.z.string().nullable().optional(),labels:s.z.record(s.z.string(),s.z.string()).default({}),providerUnavailable:s.z.boolean().optional()}),pe=s.z.object({providerId:s.z.string(),providerLabel:s.z.string(),providerHandleId:s.z.string(),cwd:s.z.string(),title:s.z.string().nullable(),firstPromptPreview:s.z.string().nullable(),lastPromptPreview:s.z.string().nullable(),lastActivityAt:s.z.string()}),ge=s.z.object({type:s.z.literal("voice_audio_chunk"),audio:s.z.string(),format:s.z.string(),isLast:s.z.boolean()}),be=s.z.object({type:s.z.literal("abort_request")}),de=s.z.object({type:s.z.literal("audio_played"),id:s.z.string()}),me=s.z.object({labels:s.z.record(s.z.string(),s.z.string()).optional(),projectKeys:s.z.array(s.z.string()).optional(),statuses:s.z.array(k).optional(),includeArchived:s.z.boolean().optional(),requiresAttention:s.z.boolean().optional(),thinkingOptionId:s.z.string().nullable().optional()}),fe=s.z.object({type:s.z.literal("delete_agent_request"),agentId:s.z.string(),requestId:s.z.string()}),ye=s.z.object({type:s.z.literal("archive_agent_request"),agentId:s.z.string(),requestId:s.z.string()}),he=s.z.object({type:s.z.literal("close_items_request"),agentIds:s.z.array(s.z.string()).default([]),terminalIds:s.z.array(s.z.string()).default([]),requestId:s.z.string()}),je=s.z.object({type:s.z.literal("update_agent_request"),agentId:s.z.string(),name:s.z.string().optional(),labels:s.z.record(s.z.string(),s.z.string()).optional(),requestId:s.z.string()}),Se=s.z.object({type:s.z.literal("project.rename.request"),projectId:s.z.string(),customName:s.z.string().nullable(),requestId:s.z.string()}),Pe=s.z.object({type:s.z.literal("project.remove.request"),projectId:s.z.string(),requestId:s.z.string()}),qe=s.z.object({type:s.z.literal("workspace.title.set.request"),workspaceId:s.z.string(),title:s.z.string().nullable(),requestId:s.z.string()}),Ie=s.z.object({type:s.z.literal("set_voice_mode"),enabled:s.z.boolean(),agentId:s.z.string().optional(),requestId:s.z.string().optional()}),Oe=s.z.object({type:s.z.literal("github_pr"),mimeType:s.z.literal("application/github-pr"),number:s.z.number().int().positive(),title:s.z.string(),url:s.z.string(),body:s.z.string().nullable().optional(),baseRefName:s.z.string().nullable().optional(),headRefName:s.z.string().nullable().optional()}),Re=s.z.object({type:s.z.literal("github_issue"),mimeType:s.z.literal("application/github-issue"),number:s.z.number().int().positive(),title:s.z.string(),url:s.z.string(),body:s.z.string().nullable().optional()}),ke=s.z.object({type:s.z.literal("text"),mimeType:s.z.literal("text/plain"),contextKind:s.z.string().optional(),title:s.z.string().nullable().optional(),text:s.z.string()}).transform(t=>{let{contextKind:n}=t,s=(0,o.default)(t,e);return Object.assign({},s,"chat_history"===n?{contextKind:n}:{})}),ve=s.z.object({oldLineNumber:s.z.number().int().positive().nullable(),newLineNumber:s.z.number().int().positive().nullable(),type:s.z.enum(["add","remove","context"]),content:s.z.string()}),we=s.z.object({filePath:s.z.string(),side:s.z.enum(["old","new"]),lineNumber:s.z.number().int().positive(),body:s.z.string(),context:s.z.object({hunkHeader:s.z.string(),targetLine:ve,lines:s.z.array(ve)})}),Ae=s.z.object({type:s.z.literal("review"),mimeType:s.z.literal("application/paseo-review"),cwd:s.z.string(),mode:s.z.enum(["uncommitted","base"]),baseRef:s.z.string().nullable().optional(),comments:s.z.array(we)}),Me=s.z.object({type:s.z.literal("uploaded_file"),id:s.z.string(),fileName:s.z.string(),mimeType:s.z.string(),size:s.z.number().int().nonnegative(),path:s.z.string()}),Ce=s.z.discriminatedUnion("type",[Oe,Re,ke,Ae,Me]);const Te=s.z.unknown().transform(function(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){const e=Ce.safeParse(n);e.success&&t.push(e.data)}return t}).optional(),Le=s.z.object({data:s.z.string(),mimeType:s.z.string()}),xe=s.z.object({type:s.z.literal("send_agent_message"),agentId:s.z.string(),text:s.z.string(),messageId:s.z.string().optional(),images:s.z.array(Le).optional(),attachments:Te}),Ne=s.z.object({type:s.z.literal("fetch_agents_request"),requestId:s.z.string(),scope:s.z.enum(["active"]).optional(),filter:me.optional(),sort:s.z.array(s.z.object({key:s.z.enum(["status_priority","created_at","updated_at","title"]),direction:s.z.enum(["asc","desc"])})).optional(),page:s.z.object({limit:s.z.number().int().positive().max(200),cursor:s.z.string().min(1).optional()}).optional(),subscribe:s.z.object({subscriptionId:s.z.string().optional()}).optional()}),De=s.z.enum(["needs_input","failed","running","attention","done"]),Ue=s.z.object({type:s.z.literal("fetch_workspaces_request"),requestId:s.z.string(),filter:s.z.object({query:s.z.string().optional(),projectId:s.z.string().optional(),idPrefix:s.z.string().optional()}).optional(),sort:s.z.array(s.z.object({key:s.z.enum(["status_priority","activity_at","name","project_id"]),direction:s.z.enum(["asc","desc"])})).optional(),page:s.z.object({limit:s.z.number().int().positive().max(200),cursor:s.z.string().min(1).optional()}).optional(),subscribe:s.z.object({subscriptionId:s.z.string().optional()}).optional()}),We=s.z.object({type:s.z.literal("fetch_agent_history_request"),requestId:s.z.string(),filter:me.optional(),sort:s.z.array(s.z.object({key:s.z.enum(["status_priority","created_at","updated_at","title"]),direction:s.z.enum(["asc","desc"])})).optional(),page:s.z.object({limit:s.z.number().int().positive().max(200),cursor:s.z.string().min(1).optional()}).optional()}),Ee=s.z.object({type:s.z.literal("fetch_recent_provider_sessions_request"),requestId:s.z.string(),cwd:s.z.string().optional(),providers:s.z.array(s.z.string()).optional(),since:s.z.string().optional(),limit:s.z.number().int().positive().max(200).optional()}),Fe=s.z.object({type:s.z.literal("fetch_agent_request"),requestId:s.z.string(),agentId:s.z.string()}),Ge=s.z.object({type:s.z.literal("send_agent_message_request"),requestId:s.z.string(),agentId:s.z.string(),text:s.z.string(),messageId:s.z.string().optional(),images:s.z.array(Le).optional(),attachments:Te}),Be=s.z.object({type:s.z.literal("wait_for_finish_request"),requestId:s.z.string(),agentId:s.z.string(),timeoutMs:s.z.number().int().positive().optional()}),He=s.z.object({type:s.z.literal("daemon.get_status.request"),requestId:s.z.string()}),Ke=s.z.object({type:s.z.literal("daemon.get_pairing_offer.request"),requestId:s.z.string()}),Ve=s.z.object({type:s.z.literal("diagnostics.request"),requestId:s.z.string()}),Qe=s.z.object({type:s.z.literal("get_daemon_config_request"),requestId:s.z.string()}),Xe=s.z.object({type:s.z.literal("set_daemon_config_request"),requestId:s.z.string(),config:R}),Je=s.z.object({type:s.z.literal("read_project_config_request"),requestId:s.z.string(),repoRoot:s.z.string()}),Ye=s.z.object({type:s.z.literal("write_project_config_request"),requestId:s.z.string(),repoRoot:s.z.string(),config:j.PaseoConfigRawSchema,expectedRevision:j.PaseoConfigRevisionSchema.nullable()}),Ze=s.z.object({type:s.z.literal("dictation_stream_start"),dictationId:s.z.string(),format:s.z.string()}),$e=s.z.object({type:s.z.literal("dictation_stream_chunk"),dictationId:s.z.string(),seq:s.z.number().int().nonnegative(),audio:s.z.string(),format:s.z.string()}),et=s.z.object({type:s.z.literal("dictation_stream_finish"),dictationId:s.z.string(),finalSeq:s.z.number().int().nonnegative()}),tt=s.z.object({type:s.z.literal("dictation_stream_cancel"),dictationId:s.z.string()}),nt=s.z.object({baseBranch:s.z.string().optional(),createNewBranch:s.z.boolean().optional(),newBranchName:s.z.string().optional(),createWorktree:s.z.boolean().optional(),worktreeSlug:s.z.string().optional(),refName:s.z.string().min(1).optional(),action:s.z.enum(["branch-off","checkout"]).optional(),githubPrNumber:s.z.number().int().positive().optional()}),rt=s.z.discriminatedUnion("mode",[s.z.object({mode:s.z.literal("branch-off"),newBranch:s.z.string().min(1),base:s.z.string().min(1).optional()}),s.z.object({mode:s.z.literal("checkout-branch"),branch:s.z.string().min(1)}),s.z.object({mode:s.z.literal("checkout-pr"),prNumber:s.z.number().int().positive()})]),ot=s.z.object({type:s.z.literal("create_agent_request"),config:B,env:s.z.record(s.z.string(),s.z.string()).optional(),workspaceId:s.z.string().optional(),worktreeName:s.z.string().optional(),initialPrompt:s.z.string().optional(),clientMessageId:s.z.string().optional(),outputSchema:s.z.record(s.z.string(),s.z.unknown()).optional(),images:s.z.array(Le).optional(),attachments:Te,git:nt.optional(),worktree:rt.optional(),autoArchive:s.z.boolean().optional(),labels:s.z.record(s.z.string(),s.z.string()).default({}),requestId:s.z.string()}),at=s.z.object({type:s.z.literal("list_provider_models_request"),provider:p.AgentProviderSchema,cwd:s.z.string().optional(),requestId:s.z.string()}),it=s.z.object({type:s.z.literal("list_provider_modes_request"),provider:p.AgentProviderSchema,cwd:s.z.string().optional(),requestId:s.z.string()}),st=s.z.object({type:s.z.literal("list_available_providers_request"),requestId:s.z.string()}),lt=s.z.object({type:s.z.literal("get_providers_snapshot_request"),cwd:s.z.string().optional(),requestId:s.z.string()}),ct=s.z.object({type:s.z.literal("refresh_providers_snapshot_request"),cwd:s.z.string().optional(),providers:s.z.array(p.AgentProviderSchema).optional(),requestId:s.z.string()}),ut=s.z.object({type:s.z.literal("provider_diagnostic_request"),provider:p.AgentProviderSchema,requestId:s.z.string()}),zt=s.z.object({type:s.z.literal("provider.usage.list.request"),requestId:s.z.string()}),pt=s.z.object({type:s.z.literal("resume_agent_request"),handle:le,overrides:B.partial().optional(),requestId:s.z.string()}),gt=s.z.object({type:s.z.literal("import_agent_request"),provider:p.AgentProviderSchema.optional(),providerId:s.z.string().optional(),sessionId:s.z.string().optional(),providerHandleId:s.z.string().optional(),cwd:s.z.string().optional(),labels:s.z.record(s.z.string(),s.z.string()).optional(),requestId:s.z.string()}),bt=s.z.object({type:s.z.literal("refresh_agent_request"),agentId:s.z.string(),requestId:s.z.string()}),dt=s.z.object({type:s.z.literal("cancel_agent_request"),agentId:s.z.string(),requestId:s.z.string().optional()}),mt=s.z.object({type:s.z.literal("restart_server_request"),reason:s.z.string().optional(),requestId:s.z.string()}),ft=s.z.object({type:s.z.literal("shutdown_server_request"),requestId:s.z.string()}),yt=s.z.object({type:s.z.literal("daemon.update.request"),requestId:s.z.string()}),ht=s.z.object({epoch:s.z.string(),seq:s.z.number().int().nonnegative()}),jt=s.z.object({type:s.z.literal("fetch_agent_timeline_request"),agentId:s.z.string(),requestId:s.z.string(),direction:s.z.enum(["tail","before","after"]).optional(),cursor:ht.optional(),limit:s.z.number().int().nonnegative().optional(),projection:s.z.enum(["projected","canonical"]).optional()}),St=s.z.object({type:s.z.literal("agent.fork_context.request"),agentId:s.z.string(),boundaryMessageId:s.z.string().optional(),requestId:s.z.string()}),Pt=s.z.object({type:s.z.literal("set_agent_mode_request"),agentId:s.z.string(),modeId:s.z.string(),requestId:s.z.string()}),_t=s.z.object({requestId:s.z.string(),agentId:s.z.string(),accepted:s.z.boolean(),error:s.z.string().nullable(),notice:M.nullable().optional()}),qt=s.z.object({type:s.z.literal("set_agent_mode_response"),payload:_t}),It=s.z.object({type:s.z.literal("set_agent_model_request"),agentId:s.z.string(),modelId:s.z.string().nullable(),requestId:s.z.string()}),Ot=s.z.object({type:s.z.literal("set_agent_model_response"),payload:_t}),Rt=s.z.object({type:s.z.literal("set_agent_thinking_request"),agentId:s.z.string(),thinkingOptionId:s.z.string().nullable(),requestId:s.z.string()}),kt=s.z.object({type:s.z.literal("set_agent_thinking_response"),payload:_t}),vt=s.z.object({type:s.z.literal("set_agent_feature_request"),agentId:s.z.string(),featureId:s.z.string(),value:s.z.unknown(),requestId:s.z.string()}),wt=s.z.object({type:s.z.literal("set_agent_feature_response"),payload:_t}),At=s.z.object({type:s.z.literal("agent.detach.request"),agentId:s.z.string(),requestId:s.z.string()}),Mt=s.z.object({type:s.z.literal("agent.detach.response"),payload:_t}),Ct=s.z.enum(["conversation","files","both"]),Tt=s.z.object({type:s.z.literal("agent.rewind.request"),agentId:s.z.string(),messageId:s.z.string(),mode:Ct,requestId:s.z.string()}),Lt=s.z.object({type:s.z.literal("agent.rewind.response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string(),ok:s.z.boolean(),error:s.z.string().nullable()})}),xt=s.z.object({type:s.z.literal("update_agent_response"),payload:_t}),Nt=s.z.object({requestId:s.z.string(),projectId:s.z.string(),accepted:s.z.boolean(),customName:s.z.string().nullable(),error:s.z.string().nullable()}),Dt=s.z.object({type:s.z.literal("project.rename.response"),payload:Nt}),Ut=s.z.object({requestId:s.z.string(),projectId:s.z.string(),accepted:s.z.boolean(),removedWorkspaceIds:s.z.array(s.z.string()).default([]),error:s.z.string().nullable()}),Wt=s.z.object({type:s.z.literal("project.remove.response"),payload:Ut}),Et=s.z.object({requestId:s.z.string(),workspaceId:s.z.string(),accepted:s.z.boolean(),title:s.z.string().nullable(),error:s.z.string().nullable()}),Ft=s.z.object({type:s.z.literal("workspace.title.set.response"),payload:Et}),Gt=s.z.object({type:s.z.literal("set_voice_mode_response"),payload:s.z.object({requestId:s.z.string(),enabled:s.z.boolean(),agentId:s.z.string().nullable(),accepted:s.z.boolean(),error:s.z.string().nullable(),reasonCode:s.z.string().optional(),retryable:s.z.boolean().optional(),missingModelIds:s.z.array(s.z.string()).optional()})}),Bt=s.z.object({type:s.z.literal("agent_permission_response"),agentId:s.z.string(),requestId:s.z.string(),response:V}),Ht=s.z.enum(["NOT_GIT_REPO","NOT_ALLOWED","MERGE_CONFLICT","UNKNOWN"]),Kt=s.z.object({code:Ht,message:s.z.string()}),Vt=s.z.object({mode:s.z.enum(["uncommitted","base"]),baseRef:s.z.string().optional(),ignoreWhitespace:s.z.boolean().optional()}),Qt=s.z.object({type:s.z.literal("checkout_status_request"),cwd:s.z.string(),requestId:s.z.string()}),Xt=s.z.object({type:s.z.literal("subscribe_checkout_diff_request"),subscriptionId:s.z.string(),cwd:s.z.string(),compare:Vt,requestId:s.z.string()}),Jt=s.z.object({type:s.z.literal("unsubscribe_checkout_diff_request"),subscriptionId:s.z.string()}),Yt=s.z.object({type:s.z.literal("checkout_commit_request"),cwd:s.z.string(),message:s.z.string().optional(),addAll:s.z.boolean().optional(),requestId:s.z.string()}),Zt=s.z.object({type:s.z.literal("checkout_merge_request"),cwd:s.z.string(),baseRef:s.z.string().optional(),strategy:s.z.enum(["merge","squash"]).optional(),requireCleanTarget:s.z.boolean().optional(),requestId:s.z.string()}),$t=s.z.object({type:s.z.literal("checkout_merge_from_base_request"),cwd:s.z.string(),baseRef:s.z.string().optional(),requireCleanTarget:s.z.boolean().optional(),requestId:s.z.string()}),en=s.z.object({type:s.z.literal("checkout_pull_request"),cwd:s.z.string(),requestId:s.z.string()}),tn=s.z.object({type:s.z.literal("checkout_push_request"),cwd:s.z.string(),requestId:s.z.string()}),nn=s.z.object({type:s.z.literal("checkout.refresh.request"),cwd:s.z.string(),requestId:s.z.string()}),rn=s.z.object({type:s.z.literal("checkout_pr_create_request"),cwd:s.z.string(),title:s.z.string().optional(),body:s.z.string().optional(),baseRef:s.z.string().optional(),requestId:s.z.string()}),on=s.z.object({type:s.z.literal("checkout_pr_merge_request"),cwd:s.z.string(),mergeMethod:s.z.enum(["merge","squash","rebase"]),requestId:s.z.string()}),an=s.z.object({type:s.z.literal("checkout.github.set_auto_merge.request"),cwd:s.z.string(),enabled:s.z.boolean(),mergeMethod:s.z.enum(["merge","squash","rebase"]).optional(),requestId:s.z.string()}),sn=s.z.string().regex(/^[A-Za-z0-9._-]+$/),ln=s.z.object({type:s.z.literal("checkout.github.get_check_details.request"),cwd:s.z.string(),repoOwner:sn,repoName:sn,checkRunId:s.z.number().int().positive(),workflowRunId:s.z.number().int().positive().optional(),requestId:s.z.string()}),cn=s.z.object({type:s.z.literal("checkout_pr_status_request"),cwd:s.z.string(),requestId:s.z.string()}),un=s.z.object({type:s.z.literal("pull_request_timeline_request"),cwd:s.z.string(),prNumber:s.z.number(),repoOwner:s.z.string(),repoName:s.z.string(),requestId:s.z.string()}),zn=s.z.object({type:s.z.literal("validate_branch_request"),cwd:s.z.string(),branchName:s.z.string(),requestId:s.z.string()}),pn=s.z.object({type:s.z.literal("checkout_switch_branch_request"),cwd:s.z.string(),branch:s.z.string(),requestId:s.z.string()}),gn=s.z.object({type:s.z.literal("checkout.rename_branch.request"),cwd:s.z.string(),branch:s.z.string(),requestId:s.z.string()}),bn=s.z.object({type:s.z.literal("stash_save_request"),cwd:s.z.string(),branch:s.z.string().optional(),requestId:s.z.string()}),dn=s.z.object({type:s.z.literal("stash_pop_request"),cwd:s.z.string(),stashIndex:s.z.number().int().min(0),requestId:s.z.string()}),mn=s.z.object({type:s.z.literal("stash_list_request"),cwd:s.z.string(),paseoOnly:s.z.boolean().optional(),requestId:s.z.string()}),fn=s.z.object({type:s.z.literal("branch_suggestions_request"),cwd:s.z.string(),query:s.z.string().optional(),limit:s.z.number().int().min(1).max(200).optional(),requestId:s.z.string()}),yn=s.z.object({kind:s.z.enum(["issue","pr"]),number:s.z.number(),title:s.z.string(),url:s.z.string(),state:s.z.string(),body:s.z.string().nullable(),labels:s.z.array(s.z.string()),baseRefName:s.z.string().nullable().optional(),headRefName:s.z.string().nullable().optional(),updatedAt:s.z.string().optional()}),hn=s.z.enum(["github-issue","github-pr"]),jn=s.z.object({type:s.z.literal("github_search_request"),cwd:s.z.string(),query:s.z.string(),limit:s.z.number().int().min(1).max(50).optional(),kinds:s.z.array(hn).optional(),requestId:s.z.string()}),Sn=s.z.object({type:s.z.literal("directory_suggestions_request"),query:s.z.string(),cwd:s.z.string().optional(),includeFiles:s.z.boolean().optional(),includeDirectories:s.z.boolean().optional(),matchMode:s.z.enum(["fuzzy","suffix"]).optional(),limit:s.z.number().int().min(1).max(100).optional(),requestId:s.z.string()}),Pn=s.z.object({type:s.z.literal("paseo_worktree_list_request"),cwd:s.z.string().optional(),repoRoot:s.z.string().optional(),requestId:s.z.string()}),_n=s.z.object({type:s.z.literal("paseo_worktree_archive_request"),worktreePath:s.z.string().optional(),repoRoot:s.z.string().optional(),branchName:s.z.string().optional(),workspaceId:s.z.string().optional(),scope:s.z.enum(["workspace","worktree"]).optional().default("workspace"),deleteWorktreeFromDisk:s.z.boolean().optional().default(!1),requestId:s.z.string()}),qn=s.z.object({prompt:s.z.string().optional(),attachments:Te}),In=s.z.object({type:s.z.literal("create_paseo_worktree_request"),cwd:s.z.string(),projectId:s.z.string().optional(),worktreeSlug:s.z.string().optional(),nameContext:s.z.string().optional(),attachments:Te.optional(),firstAgentContext:qn.optional(),refName:s.z.string().min(1).optional(),action:s.z.enum(["branch-off","checkout"]).optional(),githubPrNumber:s.z.number().int().positive().optional(),requestId:s.z.string()}),On=s.z.object({type:s.z.literal("workspace_setup_status_request"),workspaceId:s.z.string(),requestId:s.z.string()}),Rn=s.z.object({type:s.z.literal("list_available_editors_request"),requestId:s.z.string()}),kn=s.z.object({type:s.z.literal("open_in_editor_request"),path:s.z.string(),editorId:s.z.string().trim().min(1),mode:s.z.enum(["open","reveal"]).optional(),cwd:s.z.string().optional(),requestId:s.z.string()}),vn=s.z.object({type:s.z.literal("open_project_request"),cwd:s.z.string(),requestId:s.z.string()}),wn=s.z.object({type:s.z.literal("project.add.request"),cwd:s.z.string(),requestId:s.z.string()}),An=s.z.object({type:s.z.literal("archive_workspace_request"),workspaceId:s.z.string(),requestId:s.z.string()}),Mn=s.z.object({type:s.z.literal("workspace.create.request"),requestId:s.z.string(),title:s.z.string().optional(),firstAgentContext:qn.optional(),source:s.z.discriminatedUnion("kind",[s.z.object({kind:s.z.literal("directory"),path:s.z.string(),projectId:s.z.string().optional()}),s.z.object({kind:s.z.literal("worktree"),cwd:s.z.string().optional(),projectId:s.z.string().optional(),action:s.z.enum(["branch-off","checkout"]).optional(),refName:s.z.string().min(1).optional(),baseBranch:s.z.string().optional(),githubPrNumber:s.z.number().int().positive().optional(),worktreeSlug:s.z.string().optional()})])}),Cn=s.z.object({type:s.z.literal("workspace.clear_attention.request"),workspaceId:s.z.union([s.z.string(),s.z.array(s.z.string())]),requestId:s.z.string()}),Tn=s.z.object({text:s.z.string(),style:s.z.string().nullable()}),Ln=s.z.object({type:s.z.enum(["add","remove","context","header"]),content:s.z.string(),tokens:s.z.array(Tn).optional()}),xn=s.z.object({oldStart:s.z.number(),oldCount:s.z.number(),newStart:s.z.number(),newCount:s.z.number(),lines:s.z.array(Ln)}),Nn=s.z.object({path:s.z.string(),isNew:s.z.boolean(),isDeleted:s.z.boolean(),additions:s.z.number(),deletions:s.z.number(),hunks:s.z.array(xn),status:s.z.enum(["ok","too_large","binary"]).optional()}),Dn=s.z.object({name:s.z.string(),path:s.z.string(),kind:s.z.enum(["file","directory"]),size:s.z.number(),modifiedAt:s.z.string()}),Un=s.z.object({path:s.z.string(),kind:s.z.enum(["text","image","binary"]),encoding:s.z.enum(["utf-8","base64","none"]),content:s.z.string().optional(),mimeType:s.z.string().optional(),size:s.z.number(),modifiedAt:s.z.string()}),Wn=s.z.object({path:s.z.string(),entries:s.z.array(Dn)}),En=s.z.object({type:s.z.literal("file_explorer_request"),cwd:s.z.string(),path:s.z.string().optional(),mode:s.z.enum(["list","file"]),requestId:s.z.string(),acceptBinary:s.z.boolean().optional()}),Fn=s.z.object({type:s.z.literal("project_icon_request"),cwd:s.z.string(),requestId:s.z.string()}),Gn=s.z.object({type:s.z.literal("file_download_token_request"),cwd:s.z.string(),path:s.z.string(),requestId:s.z.string()}),Bn=s.z.object({type:s.z.literal("file.upload.request"),fileName:s.z.string().min(1),mimeType:s.z.string().min(1),size:s.z.number().int().nonnegative(),modifiedAt:s.z.string(),requestId:s.z.string()}),Hn=s.z.object({type:s.z.literal("clear_agent_attention"),agentId:s.z.union([s.z.string(),s.z.array(s.z.string())]),requestId:s.z.string().optional()}),Kn=s.z.object({type:s.z.literal("client_heartbeat"),deviceType:s.z.enum(["web","mobile"]),focusedAgentId:s.z.string().nullable(),focusedTerminalId:s.z.string().nullable().optional().default(null),lastActivityAt:s.z.string(),appVisible:s.z.boolean(),appVisibilityChangedAt:s.z.string().optional()}),Vn=s.z.object({type:s.z.literal("ping"),requestId:s.z.string(),clientSentAt:s.z.number().int().optional()}),Qn=s.z.object({provider:p.AgentProviderSchema,cwd:s.z.string(),modeId:s.z.string().optional(),model:s.z.string().optional(),thinkingOptionId:s.z.string().optional(),featureValues:s.z.record(s.z.string(),s.z.unknown()).optional()}),Xn=s.z.object({type:s.z.literal("list_provider_features_request"),draftConfig:Qn,requestId:s.z.string()}),Jn=s.z.object({type:s.z.literal("list_commands_request"),agentId:s.z.string(),draftConfig:Qn.optional(),requestId:s.z.string()}),Yn=s.z.object({type:s.z.literal("register_push_token"),token:s.z.string()}),Zn=s.z.object({type:s.z.literal("list_terminals_request"),cwd:s.z.string().optional(),workspaceId:s.z.string().optional(),requestId:s.z.string()}),$n=s.z.object({type:s.z.literal("subscribe_terminals_request"),cwd:s.z.string(),workspaceId:s.z.string().optional()}),er=s.z.object({type:s.z.literal("unsubscribe_terminals_request"),cwd:s.z.string(),workspaceId:s.z.string().optional()}),tr=s.z.object({type:s.z.literal("create_terminal_request"),cwd:s.z.string(),workspaceId:s.z.string().optional(),name:s.z.string().optional(),agentId:s.z.string().optional(),command:s.z.string().optional(),args:s.z.array(s.z.string()).optional(),requestId:s.z.string()}),nr=s.z.object({type:s.z.literal("terminal.rename.request"),terminalId:s.z.string(),title:s.z.string(),requestId:s.z.string()}),rr=s.z.object({type:s.z.literal("start_workspace_script_request"),workspaceId:s.z.string(),scriptName:s.z.string(),requestId:s.z.string()}),or=s.z.object({type:s.z.literal("subscribe_terminal_request"),terminalId:s.z.string(),requestId:s.z.string(),restore:s.z.object({mode:s.z.enum(["live","visible-snapshot","full-snapshot"]),scrollbackLines:s.z.number().int().nonnegative().optional(),size:s.z.object({rows:s.z.number().int().positive(),cols:s.z.number().int().positive()}).optional()}).optional()}),ar=s.z.object({type:s.z.literal("unsubscribe_terminal_request"),terminalId:s.z.string()}),ir=s.z.discriminatedUnion("type",[s.z.object({type:s.z.literal("input"),data:s.z.string()}),s.z.object({type:s.z.literal("resize"),rows:s.z.number(),cols:s.z.number()}),s.z.object({type:s.z.literal("mouse"),row:s.z.number(),col:s.z.number(),button:s.z.number(),action:s.z.enum(["down","up","move"])})]),sr=s.z.object({type:s.z.literal("terminal_input"),terminalId:s.z.string(),message:ir}),lr=s.z.object({type:s.z.literal("kill_terminal_request"),terminalId:s.z.string(),requestId:s.z.string()}),cr=s.z.object({type:s.z.literal("capture_terminal_request"),terminalId:s.z.string(),start:s.z.number().int().optional(),end:s.z.number().int().optional(),stripAnsi:s.z.boolean().default(!0),requestId:s.z.string()}),ur=s.z.discriminatedUnion("type",[ge,be,de,Ne,We,Ee,Ue,Fe,fe,ye,he,je,Se,Pe,qe,Ie,Ge,Be,He,Ke,Ve,Qe,Xe,Je,Ye,Ze,$e,et,tt,ot,at,it,Xn,st,lt,ct,ut,zt,pt,gt,bt,dt,ft,mt,yt,jt,St,Pt,It,Rt,vt,At,Tt,Bt,Qt,Xt,Jt,Yt,Zt,$t,en,tn,nn,rn,on,an,ln,cn,un,pn,gn,bn,dn,mn,zn,fn,jn,Sn,Pn,_n,In,On,Rn,kn,vn,wn,An,Mn,Cn,En,Fn,Gn,Bn,Hn,Kn,Vn,Jn,Yn,Zn,$n,er,tr,nr,rr,or,ar,sr,lr,cr,f.ChatCreateRequestSchema,f.ChatListRequestSchema,f.ChatInspectRequestSchema,f.ChatDeleteRequestSchema,f.ChatPostRequestSchema,f.ChatReadRequestSchema,f.ChatWaitRequestSchema,y.ScheduleCreateRequestSchema,y.ScheduleListRequestSchema,y.ScheduleInspectRequestSchema,y.ScheduleLogsRequestSchema,y.SchedulePauseRequestSchema,y.ScheduleResumeRequestSchema,y.ScheduleDeleteRequestSchema,y.ScheduleRunOnceRequestSchema,y.ScheduleUpdateRequestSchema,h.LoopRunRequestSchema,h.LoopListRequestSchema,h.LoopInspectRequestSchema,h.LoopLogsRequestSchema,h.LoopStopRequestSchema]),zr=s.z.object({id:s.z.string(),timestamp:s.z.coerce.date(),type:s.z.enum(["transcript","assistant","tool_call","tool_result","error","system"]),content:s.z.string(),metadata:s.z.record(s.z.string(),s.z.unknown()).optional()}),pr=s.z.object({type:s.z.literal("activity_log"),payload:zr}),gr=s.z.object({type:s.z.literal("assistant_chunk"),payload:s.z.object({chunk:s.z.string()})}),br=s.z.object({type:s.z.literal("audio_output"),payload:s.z.object({audio:s.z.string(),format:s.z.string(),id:s.z.string(),isVoiceMode:s.z.boolean(),groupId:s.z.string().optional(),chunkIndex:s.z.number().int().nonnegative().optional(),isLastChunk:s.z.boolean().optional()})}),dr=s.z.object({type:s.z.literal("transcription_result"),payload:s.z.object({text:s.z.string(),language:s.z.string().optional(),duration:s.z.number().optional(),requestId:s.z.string(),avgLogprob:s.z.number().optional(),isLowConfidence:s.z.boolean().optional(),byteLength:s.z.number().optional(),format:s.z.string().optional(),debugRecordingPath:s.z.string().optional()})}),mr=s.z.object({type:s.z.literal("voice_input_state"),payload:s.z.object({isSpeaking:s.z.boolean()})}),fr=s.z.object({type:s.z.literal("dictation_stream_ack"),payload:s.z.object({dictationId:s.z.string(),ackSeq:s.z.number().int()})}),yr=s.z.object({type:s.z.literal("dictation_stream_finish_accepted"),payload:s.z.object({dictationId:s.z.string(),timeoutMs:s.z.number().int().positive()})}),hr=s.z.object({type:s.z.literal("dictation_stream_partial"),payload:s.z.object({dictationId:s.z.string(),text:s.z.string()})}),jr=s.z.object({type:s.z.literal("dictation_stream_final"),payload:s.z.object({dictationId:s.z.string(),text:s.z.string(),debugRecordingPath:s.z.string().optional()})}),Sr=s.z.object({type:s.z.literal("dictation_stream_error"),payload:s.z.object({dictationId:s.z.string(),error:s.z.string(),retryable:s.z.boolean(),reasonCode:s.z.string().optional(),missingModelIds:s.z.array(s.z.string()).optional(),debugRecordingPath:s.z.string().optional()})}),Pr=s.z.object({enabled:s.z.boolean(),reason:s.z.string()}),_r=s.z.object({dictation:Pr,voice:Pr}),qr=s.z.object({voice:_r.optional()}).passthrough(),Ir=s.z.unknown().transform(e=>{if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null}),Or=s.z.unknown().transform(e=>{if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null}),Rr=s.z.unknown().optional().transform(e=>{if(void 0===e)return;const t=qr.safeParse(e);return t.success?t.data:void 0}),kr=s.z.object({status:s.z.literal("server_info"),serverId:s.z.string().trim().min(1),hostname:Ir.optional(),version:Or.optional(),capabilities:Rr.optional(),features:s.z.object({providersSnapshot:s.z.boolean().optional(),checkoutGithubSetAutoMerge:s.z.boolean().optional(),githubCheckDetails:s.z.boolean().optional(),daemonStatusRpc:s.z.boolean().optional(),"terminal-restore-modes":s.z.boolean().optional(),rewind:s.z.boolean().optional(),checkoutRefresh:s.z.boolean().optional(),workspaceMultiplicity:s.z.boolean().optional(),projectRemove:s.z.boolean().optional(),projectAdd:s.z.boolean().optional(),worktreeRestore:s.z.boolean().optional(),providerUsageList:s.z.boolean().optional(),agentDetach:s.z.boolean().optional(),daemonDiagnostics:s.z.boolean().optional(),daemonSelfUpdate:s.z.boolean().optional(),agentForkContext:s.z.boolean().optional()}).optional()}).passthrough().transform(e=>Object.assign({},e,{hostname:e.hostname??null,version:e.version??null})),vr=s.z.object({type:s.z.literal("status"),payload:s.z.object({status:s.z.string()}).passthrough()}),wr=s.z.object({type:s.z.literal("pong"),payload:s.z.object({requestId:s.z.string(),clientSentAt:s.z.number().int().optional(),serverReceivedAt:s.z.number().int(),serverSentAt:s.z.number().int()})}),Ar=s.z.object({type:s.z.literal("rpc_error"),payload:s.z.object({requestId:s.z.string(),requestType:s.z.string().optional(),error:s.z.string(),code:s.z.string().optional()})}),Mr=s.z.object({agentId:s.z.string(),requestId:s.z.string()}),Cr=Mr.extend({timelineSize:s.z.number().optional()}),Tr=s.z.object({status:s.z.literal("agent_created"),agent:ue}).extend(Mr.shape),Lr=s.z.object({status:s.z.literal("agent_create_failed"),requestId:s.z.string(),error:s.z.string(),errorCode:s.z.string().optional()}),xr=s.z.object({status:s.z.literal("agent_resumed"),agent:ue}).extend(Cr.shape),Nr=s.z.object({status:s.z.literal("agent_refreshed")}).extend(Cr.shape),Dr=s.z.object({status:s.z.literal("restart_requested"),clientId:s.z.string(),reason:s.z.string().optional(),requestId:s.z.string()}),Ur=s.z.object({status:s.z.literal("shutdown_requested"),clientId:s.z.string(),requestId:s.z.string()}),Wr=s.z.object({status:s.z.literal("daemon_config_changed"),config:O}).passthrough(),Er=s.z.discriminatedUnion("status",[Tr,Lr,xr,Nr,Ur,Dr,Wr]),Fr=s.z.object({type:s.z.literal("artifact"),payload:s.z.object({type:s.z.enum(["markdown","diff","image","code"]),id:s.z.string(),title:s.z.string(),content:s.z.string(),isBase64:s.z.boolean()})}),Gr=s.z.object({cwd:s.z.string(),isGit:s.z.literal(!1),currentBranch:s.z.null(),remoteUrl:s.z.null(),worktreeRoot:s.z.null().optional(),isPaseoOwnedWorktree:s.z.literal(!1),mainRepoRoot:s.z.null()}).transform(e=>Object.assign({},e,{worktreeRoot:null})),Br=s.z.object({cwd:s.z.string(),isGit:s.z.literal(!0),currentBranch:s.z.string().nullable(),remoteUrl:s.z.string().nullable(),worktreeRoot:s.z.string().optional(),isPaseoOwnedWorktree:s.z.literal(!1),mainRepoRoot:s.z.string().nullable().optional().default(null)}).transform(e=>Object.assign({},e,{worktreeRoot:e.worktreeRoot??e.cwd})),Hr=s.z.object({cwd:s.z.string(),isGit:s.z.literal(!0),currentBranch:s.z.string().nullable(),remoteUrl:s.z.string().nullable(),worktreeRoot:s.z.string().optional(),isPaseoOwnedWorktree:s.z.literal(!0),mainRepoRoot:s.z.string()}).transform(e=>Object.assign({},e,{worktreeRoot:e.worktreeRoot??e.cwd})),Kr=s.z.union([Gr,Br,Hr]),Vr=s.z.object({projectKey:s.z.string(),projectName:s.z.string(),workspaceName:s.z.string().nullable().optional(),checkout:Kr}),Qr=s.z.enum(["running","stopped"]),Xr=s.z.enum(["healthy","unhealthy"]),Jr=s.z.object({scriptName:s.z.string(),type:s.z.enum(["script","service"]).optional().default("service"),hostname:s.z.string(),port:s.z.number().int().positive().nullable(),localProxyUrl:s.z.string().nullable().optional(),publicProxyUrl:s.z.string().nullable().optional(),proxyUrl:s.z.string().nullable().optional().default(null),lifecycle:Qr,health:Xr.nullable(),exitCode:s.z.number().nullable().optional().default(null),terminalId:s.z.string().nullable().optional().default(null)}),Yr=s.z.object({currentBranch:s.z.string().nullable().optional(),remoteUrl:s.z.string().nullable().optional(),isPaseoOwnedWorktree:s.z.boolean().optional(),isDirty:s.z.boolean().nullable().optional(),aheadBehind:s.z.object({ahead:s.z.number(),behind:s.z.number()}).nullable().optional(),aheadOfOrigin:s.z.number().nullable().optional(),behindOfOrigin:s.z.number().nullable().optional()}).optional().nullable(),Zr=s.z.object({featuresEnabled:s.z.boolean().optional(),pullRequest:s.z.object({number:s.z.number().optional(),url:s.z.string(),title:s.z.string(),state:s.z.string(),baseRefName:s.z.string(),headRefName:s.z.string(),isMerged:s.z.boolean(),isDraft:s.z.boolean().optional(),mergeable:s.z.enum(["MERGEABLE","CONFLICTING","UNKNOWN"]).catch("UNKNOWN").optional(),checks:s.z.array(s.z.object({name:s.z.string(),status:s.z.enum(["success","failure","pending","skipped","cancelled"]),url:s.z.string().nullable(),workflow:s.z.string().optional(),duration:s.z.string().optional()})).optional(),checksStatus:s.z.enum(["none","pending","success","failure"]).optional(),reviewDecision:s.z.enum(["approved","changes_requested","pending"]).nullable().optional(),repoOwner:s.z.string().optional(),repoName:s.z.string().optional(),github:s.z.unknown().optional()}).nullable().optional(),error:s.z.object({message:s.z.string()}).nullable().optional(),refreshedAt:s.z.string().nullable().optional()}).optional().nullable(),$r=s.z.object({id:s.z.string(),projectId:s.z.string(),projectDisplayName:s.z.string(),projectCustomName:s.z.string().nullable().optional(),projectRootPath:s.z.string(),workspaceDirectory:s.z.string().optional(),projectKind:s.z.enum(["git","non_git","directory"]),workspaceKind:s.z.enum(["directory","local_checkout","checkout","worktree"]),name:s.z.string(),title:s.z.string().nullable().optional(),archivingAt:s.z.string().nullable().optional().default(null),status:De,statusEnteredAt:s.z.string().nullish().transform(e=>e??null),activityAt:s.z.string().nullable(),diffStat:s.z.object({additions:s.z.number(),deletions:s.z.number()}).nullable().optional(),scripts:s.z.array(Jr).default([]),gitRuntime:Yr,githubRuntime:Zr,project:Vr.optional()}).transform(e=>Object.assign({},e,{workspaceDirectory:e.workspaceDirectory??e.projectRootPath})),eo=s.z.object({type:s.z.literal("agent_update"),payload:s.z.discriminatedUnion("kind",[s.z.object({kind:s.z.literal("upsert"),agent:ue,project:Vr.nullable().optional()}),s.z.object({kind:s.z.literal("remove"),agentId:s.z.string()})])}),to=s.z.object({type:s.z.literal("agent_stream"),payload:s.z.object({agentId:s.z.string(),event:se,timestamp:s.z.string(),seq:s.z.number().int().nonnegative().optional(),epoch:s.z.string().optional()})}),no=s.z.object({type:s.z.literal("agent_status"),payload:s.z.object({agentId:s.z.string(),status:s.z.string(),info:ue})}),ro=s.z.object({type:s.z.literal("agent_list"),payload:s.z.object({agents:s.z.array(ue)})}),oo=s.z.object({agent:ue,project:Vr}),ao=s.z.object({nextCursor:s.z.string().nullable(),prevCursor:s.z.string().nullable(),hasMore:s.z.boolean()}),io=s.z.object({type:s.z.literal("fetch_agents_response"),payload:s.z.object({requestId:s.z.string(),subscriptionId:s.z.string().nullable().optional(),entries:s.z.array(oo),pageInfo:ao})}),so=s.z.object({type:s.z.literal("fetch_agent_history_response"),payload:s.z.object({requestId:s.z.string(),entries:s.z.array(oo),pageInfo:ao})}),lo=s.z.object({type:s.z.literal("fetch_recent_provider_sessions_response"),payload:s.z.object({requestId:s.z.string(),entries:s.z.array(pe),filteredAlreadyImportedCount:s.z.number().int().nonnegative().optional()})}),co=s.z.object({projectId:s.z.string(),projectDisplayName:s.z.string(),projectCustomName:s.z.string().nullable().optional(),projectRootPath:s.z.string(),projectKind:s.z.enum(["git","non_git","directory"])}),uo=s.z.object({type:s.z.literal("fetch_workspaces_response"),payload:s.z.object({requestId:s.z.string(),subscriptionId:s.z.string().nullable().optional(),entries:s.z.array($r),emptyProjects:s.z.array(co).optional().default([]),pageInfo:s.z.object({nextCursor:s.z.string().nullable(),prevCursor:s.z.string().nullable(),hasMore:s.z.boolean()})})}),zo=s.z.object({type:s.z.literal("workspace_update"),payload:s.z.discriminatedUnion("kind",[s.z.object({kind:s.z.literal("upsert"),workspace:$r}),s.z.object({kind:s.z.literal("remove"),id:s.z.string(),emptyProject:co.optional(),removedProjectId:s.z.string().optional()})])}),po=s.z.object({type:s.z.literal("script_status_update"),payload:s.z.object({workspaceId:s.z.string(),scripts:s.z.array(Jr)})}),go=s.z.object({type:s.z.literal("workspace_setup_progress"),payload:s.z.object({workspaceId:s.z.string(),status:s.z.enum(["running","completed","failed"]),detail:Z,error:s.z.string().nullable()})}),bo=s.z.object({status:s.z.enum(["running","completed","failed"]),detail:Z,error:s.z.string().nullable()}),mo=s.z.object({type:s.z.literal("workspace_setup_status_response"),payload:s.z.object({requestId:s.z.string(),workspaceId:s.z.string(),snapshot:bo.nullable()})}),fo=s.z.object({type:s.z.literal("open_project_response"),payload:s.z.object({requestId:s.z.string(),workspace:$r.nullable(),error:s.z.string().nullable(),errorCode:s.z.enum(["directory_not_found"]).nullish().catch(null)})}),yo=s.z.object({type:s.z.literal("project.add.response"),payload:s.z.object({requestId:s.z.string(),project:co.nullable(),error:s.z.string().nullable(),errorCode:s.z.enum(["directory_not_found"]).nullish().catch(null)})}),ho=s.z.object({type:s.z.literal("start_workspace_script_response"),payload:s.z.object({requestId:s.z.string(),workspaceId:s.z.string(),scriptName:s.z.string(),terminalId:s.z.string().nullable(),error:s.z.string().nullable()})}),jo=s.z.object({type:s.z.literal("list_available_editors_response"),payload:s.z.object({requestId:s.z.string(),editors:s.z.array(s.z.object({id:s.z.string().trim().min(1),label:s.z.string()})),error:s.z.string().nullable()})}),So=s.z.object({type:s.z.literal("open_in_editor_response"),payload:s.z.object({requestId:s.z.string(),error:s.z.string().nullable()})}),Po=s.z.object({type:s.z.literal("archive_workspace_response"),payload:s.z.object({requestId:s.z.string(),workspaceId:s.z.string(),archivedAt:s.z.string().nullable(),error:s.z.string().nullable()})}),_o=s.z.object({type:s.z.literal("fetch_agent_response"),payload:s.z.object({requestId:s.z.string(),agent:ue.nullable(),project:Vr.nullable().optional(),error:s.z.string().nullable()})}),qo=s.z.object({startSeq:s.z.number().int().nonnegative(),endSeq:s.z.number().int().nonnegative()}),Io=s.z.object({provider:p.AgentProviderSchema,item:ie,timestamp:s.z.string(),seqStart:s.z.number().int().nonnegative(),seqEnd:s.z.number().int().nonnegative(),sourceSeqRanges:s.z.array(qo),collapsed:s.z.array(s.z.enum(["assistant_merge","reasoning_merge","tool_lifecycle"]))}),Oo=s.z.object({type:s.z.literal("fetch_agent_timeline_response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string(),agent:ue.nullable(),direction:s.z.enum(["tail","before","after"]),projection:s.z.enum(["projected","canonical"]),epoch:s.z.string(),reset:s.z.boolean(),staleCursor:s.z.boolean(),gap:s.z.boolean(),window:s.z.object({minSeq:s.z.number().int().nonnegative(),maxSeq:s.z.number().int().nonnegative(),nextSeq:s.z.number().int().nonnegative()}),startCursor:ht.nullable(),endCursor:ht.nullable(),hasOlder:s.z.boolean(),hasNewer:s.z.boolean(),entries:s.z.array(Io),error:s.z.string().nullable()})}),Ro=s.z.object({type:s.z.literal("agent.fork_context.response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string(),attachment:ke.nullable(),itemCount:s.z.number().int().nonnegative(),boundaryMessageId:s.z.string().nullable(),error:s.z.string().nullable()})}),ko=s.z.object({type:s.z.literal("cancel_agent_response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string(),agent:ue.nullable()})}),vo=s.z.object({type:s.z.literal("clear_agent_attention_response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string().or(s.z.array(s.z.string())),agents:s.z.array(ue)})}),wo=s.z.object({type:s.z.literal("workspace.create.response"),payload:s.z.object({workspace:$r.nullable(),setupTerminalId:s.z.string().nullable(),error:s.z.string().nullable(),errorCode:s.z.string().optional(),requestId:s.z.string()})}),Ao=s.z.object({type:s.z.literal("workspace.clear_attention.response"),payload:s.z.object({requestId:s.z.string(),workspaceId:s.z.union([s.z.string(),s.z.array(s.z.string())]),clearedAgentIds:s.z.array(s.z.string()),results:s.z.array(s.z.object({workspaceId:s.z.string(),clearedAgentIds:s.z.array(s.z.string()),success:s.z.boolean(),error:s.z.string().nullable()})),success:s.z.boolean(),error:s.z.string().nullable()})}),Mo=s.z.object({type:s.z.literal("send_agent_message_response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string(),accepted:s.z.boolean(),error:s.z.string().nullable()})}),Co=s.z.object({type:s.z.literal("wait_for_finish_response"),payload:s.z.object({requestId:s.z.string(),status:s.z.enum(["idle","error","permission","timeout"]),final:ue.nullable(),error:s.z.string().nullable(),lastMessage:s.z.string().nullable()})}),To=s.z.object({type:s.z.literal("get_daemon_config_response"),payload:s.z.object({requestId:s.z.string(),config:O}).passthrough()}),Lo=s.z.object({type:s.z.literal("daemon.get_status.response"),payload:s.z.object({requestId:s.z.string(),serverId:s.z.string(),version:s.z.string().nullable().optional(),pid:s.z.number(),nodePath:s.z.string(),startedAt:s.z.string().nullable().optional(),listen:s.z.string().nullable(),relay:s.z.object({enabled:s.z.boolean(),endpoint:s.z.string(),publicEndpoint:s.z.string(),useTls:s.z.boolean(),publicUseTls:s.z.boolean()}).nullable().optional(),providers:s.z.array(s.z.object({provider:s.z.string(),available:s.z.boolean(),error:s.z.string().nullable().optional()}))}).passthrough()}),xo=s.z.object({type:s.z.literal("daemon.get_pairing_offer.response"),payload:s.z.object({requestId:s.z.string(),url:s.z.string(),qr:s.z.string().nullable().optional(),relayEnabled:s.z.boolean()}).passthrough()}),No=s.z.object({type:s.z.literal("diagnostics.response"),payload:s.z.object({requestId:s.z.string(),diagnostic:s.z.string()}).passthrough()}),Do=s.z.object({type:s.z.literal("set_daemon_config_response"),payload:s.z.object({requestId:s.z.string(),config:O}).passthrough()}),Uo=s.z.object({type:s.z.literal("read_project_config_response"),payload:s.z.discriminatedUnion("ok",[s.z.object({requestId:s.z.string(),repoRoot:s.z.string(),ok:s.z.literal(!0),config:j.PaseoConfigRawSchema.nullable(),revision:j.PaseoConfigRevisionSchema.nullable()}),s.z.object({requestId:s.z.string(),repoRoot:s.z.string(),ok:s.z.literal(!1),error:j.ProjectConfigRpcErrorSchema})])}),Wo=s.z.object({type:s.z.literal("write_project_config_response"),payload:s.z.discriminatedUnion("ok",[s.z.object({requestId:s.z.string(),repoRoot:s.z.string(),ok:s.z.literal(!0),config:j.PaseoConfigRawSchema,revision:j.PaseoConfigRevisionSchema}),s.z.object({requestId:s.z.string(),repoRoot:s.z.string(),ok:s.z.literal(!1),error:j.ProjectConfigRpcErrorSchema})])}),Eo=s.z.object({type:s.z.literal("agent_permission_request"),payload:s.z.object({agentId:s.z.string(),request:Q})}),Fo=s.z.object({type:s.z.literal("agent_permission_resolved"),payload:s.z.object({agentId:s.z.string(),requestId:s.z.string(),resolution:V})}),Go=s.z.object({type:s.z.literal("agent_deleted"),payload:s.z.object({agentId:s.z.string(),requestId:s.z.string()})}),Bo=s.z.object({type:s.z.literal("agent_archived"),payload:s.z.object({agentId:s.z.string(),archivedAt:s.z.string(),requestId:s.z.string()})}),Ho=s.z.object({agentId:s.z.string(),archivedAt:s.z.string()}),Ko=s.z.object({terminalId:s.z.string(),success:s.z.boolean()}),Vo=s.z.object({type:s.z.literal("close_items_response"),payload:s.z.object({agents:s.z.array(Ho),terminals:s.z.array(Ko),requestId:s.z.string()})}),Qo=s.z.object({ahead:s.z.number(),behind:s.z.number()}),Xo=s.z.object({cwd:s.z.string(),error:Kt.nullable(),requestId:s.z.string()}),Jo=Xo.extend({isGit:s.z.literal(!1),isPaseoOwnedWorktree:s.z.literal(!1),repoRoot:s.z.null(),currentBranch:s.z.null(),isDirty:s.z.null(),baseRef:s.z.null(),aheadBehind:s.z.null(),aheadOfOrigin:s.z.null(),behindOfOrigin:s.z.null(),hasRemote:s.z.boolean(),remoteUrl:s.z.null()}),Yo=Xo.extend({isGit:s.z.literal(!0),isPaseoOwnedWorktree:s.z.literal(!1),repoRoot:s.z.string(),mainRepoRoot:s.z.string().nullable().optional().default(null),currentBranch:s.z.string().nullable(),isDirty:s.z.boolean(),baseRef:s.z.string().nullable(),aheadBehind:Qo.nullable(),aheadOfOrigin:s.z.number().nullable(),behindOfOrigin:s.z.number().nullable(),hasRemote:s.z.boolean(),remoteUrl:s.z.string().nullable()}),Zo=Xo.extend({isGit:s.z.literal(!0),isPaseoOwnedWorktree:s.z.literal(!0),repoRoot:s.z.string(),mainRepoRoot:s.z.string(),currentBranch:s.z.string().nullable(),isDirty:s.z.boolean(),baseRef:s.z.string(),aheadBehind:Qo.nullable(),aheadOfOrigin:s.z.number().nullable(),behindOfOrigin:s.z.number().nullable(),hasRemote:s.z.boolean(),remoteUrl:s.z.string().nullable()}),$o=s.z.object({type:s.z.literal("checkout_status_response"),payload:s.z.union([Jo,Yo,Zo])}),ea=s.z.object({enabledAt:s.z.string().nullable().optional().default(null),mergeMethod:s.z.string().nullable().optional().default(null),enabledBy:s.z.string().nullable().optional().default(null)}).nullable().optional().default(null),ta=s.z.object({autoMergeAllowed:s.z.boolean().optional().default(!1),mergeCommitAllowed:s.z.boolean().optional().default(!1),squashMergeAllowed:s.z.boolean().optional().default(!1),rebaseMergeAllowed:s.z.boolean().optional().default(!1),viewerDefaultMergeMethod:s.z.string().nullable().optional().default(null)}).optional().default({autoMergeAllowed:!1,mergeCommitAllowed:!1,squashMergeAllowed:!1,rebaseMergeAllowed:!1,viewerDefaultMergeMethod:null}),na=s.z.object({mergeStateStatus:s.z.string().nullable().optional().default(null),autoMergeRequest:ea,viewerCanEnableAutoMerge:s.z.boolean().optional().default(!1),viewerCanDisableAutoMerge:s.z.boolean().optional().default(!1),viewerCanMergeAsAdmin:s.z.boolean().optional().default(!1),viewerCanUpdateBranch:s.z.boolean().optional().default(!1),repository:ta,isMergeQueueEnabled:s.z.boolean().optional().default(!1),isInMergeQueue:s.z.boolean().optional().default(!1)}).optional(),ra=s.z.object({number:s.z.number().optional(),url:s.z.string(),title:s.z.string(),state:s.z.string(),baseRefName:s.z.string(),headRefName:s.z.string(),isMerged:s.z.boolean(),isDraft:s.z.boolean().optional().default(!1),mergeable:s.z.enum(["MERGEABLE","CONFLICTING","UNKNOWN"]).catch("UNKNOWN").optional().default("UNKNOWN"),checks:s.z.array(s.z.object({name:s.z.string(),status:s.z.string(),url:s.z.string().nullable(),workflow:s.z.string().optional(),duration:s.z.string().optional(),checkRunId:s.z.number().optional(),workflowRunId:s.z.number().optional()})).optional().default([]),checksStatus:s.z.string().optional(),reviewDecision:s.z.string().nullable().optional(),repoOwner:s.z.string().optional(),repoName:s.z.string().optional(),github:na}),oa=s.z.object({cwd:s.z.string(),status:ra.nullable(),githubFeaturesEnabled:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()}),aa=s.z.object({prStatus:oa.optional()}),ia=s.z.object({type:s.z.literal("checkout_status_update"),payload:s.z.union([Jo,Yo,Zo]).and(aa)}),sa=s.z.object({subscriptionId:s.z.string(),cwd:s.z.string(),files:s.z.array(Nn),error:Kt.nullable()}),la=s.z.object({type:s.z.literal("subscribe_checkout_diff_response"),payload:sa.extend({requestId:s.z.string()})}),ca=s.z.object({type:s.z.literal("checkout_diff_update"),payload:sa}),ua=s.z.object({type:s.z.literal("checkout_commit_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),za=s.z.object({type:s.z.literal("checkout_merge_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),pa=s.z.object({type:s.z.literal("checkout_merge_from_base_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),ga=s.z.object({type:s.z.literal("checkout_pull_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),ba=s.z.object({type:s.z.literal("checkout_push_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),da=s.z.object({type:s.z.literal("checkout.refresh.response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),ma=s.z.object({type:s.z.literal("checkout_pr_create_response"),payload:s.z.object({cwd:s.z.string(),url:s.z.string().nullable(),number:s.z.number().nullable(),error:Kt.nullable(),requestId:s.z.string()})}),fa=s.z.object({type:s.z.literal("checkout_pr_merge_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),ya=s.z.object({type:s.z.literal("checkout.github.set_auto_merge.response"),payload:s.z.object({cwd:s.z.string(),enabled:s.z.boolean(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),ha=s.z.object({path:s.z.string().optional(),startLine:s.z.number().optional(),endLine:s.z.number().optional(),annotationLevel:s.z.string().optional(),message:s.z.string().optional(),title:s.z.string().optional(),rawDetails:s.z.string().optional()}),ja=s.z.object({jobId:s.z.number(),name:s.z.string(),status:s.z.string().nullable().optional(),conclusion:s.z.string().nullable().optional(),url:s.z.string().nullable().optional(),logTail:s.z.string().optional(),logTruncated:s.z.boolean().optional()}),Sa=s.z.object({checkRunId:s.z.number(),workflowRunId:s.z.number().nullable().optional(),name:s.z.string(),status:s.z.string().nullable().optional(),conclusion:s.z.string().nullable().optional(),url:s.z.string().nullable().optional(),detailsUrl:s.z.string().nullable().optional(),output:s.z.object({title:s.z.string().nullable().optional(),summary:s.z.string().nullable().optional(),text:s.z.string().nullable().optional()}).nullable().optional(),annotations:s.z.array(ha).optional().default([]),failedJobs:s.z.array(ja).optional().default([]),truncated:s.z.boolean().optional().default(!1)}),Pa=s.z.object({type:s.z.literal("checkout.github.get_check_details.response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),details:Sa.nullable().optional().default(null),error:Kt.nullable(),requestId:s.z.string()})}),_a=s.z.object({type:s.z.literal("checkout_pr_status_response"),payload:oa}),qa=s.z.discriminatedUnion("kind",[s.z.object({kind:s.z.literal("not_found"),message:s.z.string().optional().default("")}),s.z.object({kind:s.z.literal("forbidden"),message:s.z.string().optional().default("")}),s.z.object({kind:s.z.literal("unknown"),message:s.z.string().optional().default("")})]),Ia=s.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"})},qa),Oa=s.z.object({id:s.z.string().optional().default(""),kind:s.z.literal("review"),author:s.z.string().optional().default("unknown"),authorUrl:s.z.string().nullable().optional(),avatarUrl:s.z.string().nullable().optional(),body:s.z.string().optional().default(""),createdAt:s.z.number().optional().default(0),url:s.z.string().optional().default(""),reviewState:s.z.enum(["approved","changes_requested","commented"]).optional().default("commented")}),Ra=s.z.object({id:s.z.string().optional().default(""),kind:s.z.literal("comment"),author:s.z.string().optional().default("unknown"),authorUrl:s.z.string().nullable().optional(),avatarUrl:s.z.string().nullable().optional(),body:s.z.string().optional().default(""),createdAt:s.z.number().optional().default(0),url:s.z.string().optional().default(""),reviewId:s.z.string().optional(),location:s.z.object({path:s.z.string(),line:s.z.number().optional(),startLine:s.z.number().optional(),threadId:s.z.string().optional(),isResolved:s.z.boolean().optional(),isOutdated:s.z.boolean().optional()}).optional()}),ka=s.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"})},s.z.discriminatedUnion("kind",[Oa,Ra])),va=s.z.object({type:s.z.literal("pull_request_timeline_response"),payload:s.z.object({cwd:s.z.string().optional().default(""),prNumber:s.z.number().nullable().optional().default(null),items:s.z.array(ka).optional().default([]),truncated:s.z.boolean().optional().default(!1),error:Ia.nullable().optional().default(null),requestId:s.z.string().optional().default(""),githubFeaturesEnabled:s.z.boolean().optional().default(!0)}).optional().prefault({})}),wa=s.z.object({type:s.z.literal("checkout_switch_branch_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),branch:s.z.string(),source:s.z.enum(["local","remote"]).optional(),error:Kt.nullable(),requestId:s.z.string()})}),Aa=s.z.object({type:s.z.literal("checkout.rename_branch.response"),payload:s.z.object({requestId:s.z.string(),success:s.z.boolean(),cwd:s.z.string(),currentBranch:s.z.string().nullable(),error:Kt.nullable()})}),Ma=s.z.object({index:s.z.number().int().min(0),message:s.z.string(),branch:s.z.string().nullable(),isPaseo:s.z.boolean()}),Ca=s.z.object({type:s.z.literal("stash_save_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),Ta=s.z.object({type:s.z.literal("stash_pop_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),La=s.z.object({type:s.z.literal("stash_list_response"),payload:s.z.object({cwd:s.z.string(),entries:s.z.array(Ma),error:Kt.nullable(),requestId:s.z.string()})}),xa=s.z.object({type:s.z.literal("validate_branch_response"),payload:s.z.object({exists:s.z.boolean(),resolvedRef:s.z.string().nullable(),isRemote:s.z.boolean(),error:s.z.string().nullable(),requestId:s.z.string()})}),Na=s.z.object({type:s.z.literal("branch_suggestions_response"),payload:s.z.object({branches:s.z.array(s.z.string()),branchDetails:s.z.array(s.z.object({name:s.z.string(),committerDate:s.z.number(),hasLocal:s.z.boolean().optional(),hasRemote:s.z.boolean().optional()})).optional(),error:s.z.string().nullable(),requestId:s.z.string()})}),Da=s.z.object({type:s.z.literal("github_search_response"),payload:s.z.object({items:s.z.array(yn),githubFeaturesEnabled:s.z.boolean(),error:s.z.string().nullable(),requestId:s.z.string()})}),Ua=s.z.object({type:s.z.literal("directory_suggestions_response"),payload:s.z.object({directories:s.z.array(s.z.string()),entries:s.z.array(s.z.object({path:s.z.string(),kind:s.z.enum(["file","directory"])})).optional().default([]),error:s.z.string().nullable(),requestId:s.z.string()})}),Wa=s.z.object({worktreePath:s.z.string(),createdAt:s.z.string(),branchName:s.z.string().nullable().optional(),head:s.z.string().nullable().optional()}),Ea=s.z.object({type:s.z.literal("paseo_worktree_list_response"),payload:s.z.object({worktrees:s.z.array(Wa),error:Kt.nullable(),requestId:s.z.string()})}),Fa=s.z.object({type:s.z.literal("paseo_worktree_archive_response"),payload:s.z.object({success:s.z.boolean(),removedAgents:s.z.array(s.z.string()).optional(),error:Kt.nullable(),requestId:s.z.string()})}),Ga=s.z.object({type:s.z.literal("create_paseo_worktree_response"),payload:s.z.object({workspace:$r.nullable(),error:s.z.string().nullable(),errorCode:s.z.string().optional(),setupTerminalId:s.z.string().nullable(),requestId:s.z.string()})}),Ba=s.z.object({type:s.z.literal("file_explorer_response"),payload:s.z.object({cwd:s.z.string(),path:s.z.string(),mode:s.z.enum(["list","file"]),directory:Wn.nullable(),file:Un.nullable(),error:s.z.string().nullable(),requestId:s.z.string()})}),Ha=s.z.object({data:s.z.string(),mimeType:s.z.string()}),Ka=s.z.object({type:s.z.literal("project_icon_response"),payload:s.z.object({cwd:s.z.string(),icon:Ha.nullable(),error:s.z.string().nullable(),requestId:s.z.string()})}),Va=s.z.object({type:s.z.literal("file_download_token_response"),payload:s.z.object({cwd:s.z.string(),path:s.z.string(),token:s.z.string().nullable(),fileName:s.z.string().nullable(),mimeType:s.z.string().nullable(),size:s.z.number().nullable(),error:s.z.string().nullable(),requestId:s.z.string()})}),Qa=s.z.object({type:s.z.literal("file.upload.response"),payload:s.z.object({requestId:s.z.string(),file:Me.nullable(),error:s.z.string().nullable()})}),Xa=s.z.object({type:s.z.literal("list_provider_models_response"),payload:s.z.object({provider:p.AgentProviderSchema,models:s.z.array(x).optional(),error:s.z.string().nullable().optional(),fetchedAt:s.z.string(),requestId:s.z.string()})}),Ja=s.z.object({type:s.z.literal("list_provider_modes_response"),payload:s.z.object({provider:p.AgentProviderSchema,modes:s.z.array(v).optional(),error:s.z.string().nullable().optional(),fetchedAt:s.z.string(),requestId:s.z.string()})}),Ya=s.z.object({type:s.z.literal("list_provider_features_response"),payload:s.z.object({provider:p.AgentProviderSchema,features:s.z.array(L).optional(),error:s.z.string().nullable().optional(),fetchedAt:s.z.string(),requestId:s.z.string()})}),Za=s.z.object({provider:p.AgentProviderSchema,available:s.z.boolean(),error:s.z.string().nullable().optional()}),$a=s.z.object({type:s.z.literal("list_available_providers_response"),payload:s.z.object({providers:s.z.array(Za),error:s.z.string().nullable().optional(),fetchedAt:s.z.string(),requestId:s.z.string()})}),ei=s.z.object({type:s.z.literal("get_providers_snapshot_response"),payload:s.z.object({entries:s.z.array(N),generatedAt:s.z.string(),requestId:s.z.string()})}),ti=s.z.object({type:s.z.literal("providers_snapshot_update"),payload:s.z.object({cwd:s.z.string().optional(),entries:s.z.array(N),generatedAt:s.z.string()})}),ni=s.z.object({type:s.z.literal("refresh_providers_snapshot_response"),payload:s.z.object({requestId:s.z.string(),acknowledged:s.z.boolean()})}),ri=s.z.object({type:s.z.literal("provider_diagnostic_response"),payload:s.z.object({provider:p.AgentProviderSchema,diagnostic:s.z.string(),requestId:s.z.string()})}),oi=s.z.enum(["default","ok","warning","danger"]),ai=s.z.enum(["available","unavailable","error"]),ii=s.z.object({id:s.z.string(),label:s.z.string(),usedPct:s.z.number().nullable().optional(),remainingPct:s.z.number().nullable().optional(),resetsAt:s.z.string().nullable().optional(),runsOutAt:s.z.string().nullable().optional(),shortfallPct:s.z.number().nullable().optional(),tone:oi.optional()}),si=s.z.object({id:s.z.string(),label:s.z.string(),used:s.z.number().nullable().optional(),remaining:s.z.number().nullable().optional(),limit:s.z.number().nullable().optional(),unit:s.z.enum(["usd","credits","requests","tokens"]),resetsAt:s.z.string().nullable().optional(),tone:oi.optional()}),li=s.z.object({id:s.z.string(),label:s.z.string(),value:s.z.string(),tone:oi.optional()}),ci=s.z.object({providerId:s.z.string(),displayName:s.z.string(),status:ai,planLabel:s.z.string().nullable(),sourceLabel:s.z.string().nullable().optional(),fetchedAt:s.z.string().nullable().optional(),nextRefreshAt:s.z.string().nullable().optional(),windows:s.z.array(ii),balances:s.z.array(si).optional(),details:s.z.array(li).optional(),error:s.z.string().nullable().optional()}),ui=s.z.object({type:s.z.literal("provider.usage.list.response"),payload:s.z.object({requestId:s.z.string(),fetchedAt:s.z.string(),providers:s.z.array(ci)})}),zi=s.z.object({name:s.z.string(),description:s.z.string(),argumentHint:s.z.string(),kind:s.z.enum(["command","skill"]).optional().catch("command")}),pi=s.z.object({type:s.z.literal("list_commands_response"),payload:s.z.object({agentId:s.z.string(),commands:s.z.array(zi),error:s.z.string().nullable(),requestId:s.z.string()})}),gi=s.z.object({id:s.z.string(),name:s.z.string(),cwd:s.z.string(),workspaceId:s.z.string().optional(),title:s.z.string().optional(),activity:l.TerminalActivitySchema.nullable().optional()}),bi=s.z.object({char:s.z.string(),fg:s.z.number().optional(),bg:s.z.number().optional(),fgMode:s.z.number().optional(),bgMode:s.z.number().optional(),bold:s.z.boolean().optional(),italic:s.z.boolean().optional(),underline:s.z.boolean().optional(),dim:s.z.boolean().optional(),inverse:s.z.boolean().optional(),strikethrough:s.z.boolean().optional()}),di=s.z.enum(["block","underline","bar"]),mi=s.z.object({row:s.z.number(),col:s.z.number(),hidden:s.z.boolean().optional(),style:di.optional(),blink:s.z.boolean().optional()}),fi=s.z.object({rows:s.z.number(),cols:s.z.number(),grid:s.z.array(s.z.array(bi)),scrollback:s.z.array(s.z.array(bi)),cursor:mi,title:s.z.string().optional(),gridWrapped:s.z.array(s.z.boolean()).optional(),scrollbackWrapped:s.z.array(s.z.boolean()).optional()}),yi=s.z.object({type:s.z.literal("list_terminals_response"),payload:s.z.object({cwd:s.z.string().optional(),terminals:s.z.array(gi.omit({cwd:!0})),requestId:s.z.string()})}),hi=s.z.object({type:s.z.literal("terminals_changed"),payload:s.z.object({cwd:s.z.string(),terminals:s.z.array(gi.omit({cwd:!0}))})}),ji=s.z.object({type:s.z.literal("create_terminal_response"),payload:s.z.object({terminal:gi.nullable(),error:s.z.string().nullable(),requestId:s.z.string()})}),Si=s.z.object({type:s.z.literal("terminal.rename.response"),payload:s.z.object({requestId:s.z.string(),success:s.z.boolean(),error:s.z.string().nullable()})}),Pi=s.z.object({type:s.z.literal("subscribe_terminal_response"),payload:s.z.union([s.z.object({terminalId:s.z.string(),slot:s.z.number().int().min(0).max(255),error:s.z.null(),requestId:s.z.string()}),s.z.object({terminalId:s.z.string(),error:s.z.string(),requestId:s.z.string()})])}),_i=s.z.object({type:s.z.literal("kill_terminal_response"),payload:s.z.object({terminalId:s.z.string(),success:s.z.boolean(),requestId:s.z.string()})}),qi=s.z.object({type:s.z.literal("capture_terminal_response"),payload:s.z.object({terminalId:s.z.string(),lines:s.z.array(s.z.string()),totalLines:s.z.number().int().nonnegative(),requestId:s.z.string()})}),Ii=s.z.object({type:s.z.literal("terminal_stream_exit"),payload:s.z.object({terminalId:s.z.string()})}),Oi=s.z.object({type:s.z.literal("terminal_attention_required"),payload:s.z.object({serverId:s.z.string().optional(),terminalId:s.z.string(),cwd:s.z.string(),workspaceId:s.z.string().optional(),reason:s.z.enum(["finished","needs_input"]),title:s.z.string(),body:s.z.string(),shouldNotify:s.z.boolean()})}),Ri=s.z.object({type:s.z.literal("daemon.update.response"),payload:s.z.object({requestId:s.z.string(),success:s.z.boolean(),error:s.z.string().nullable(),previousVersion:s.z.string().nullable(),newVersion:s.z.string().nullable()})}),ki=s.z.object({type:s.z.literal("daemon.update.progress"),payload:s.z.object({requestId:s.z.string(),phase:s.z.enum(["starting","downloading","installing","complete"])})}),vi=s.z.discriminatedUnion("type",[pr,gr,br,dr,mr,fr,yr,hr,jr,Sr,vr,wr,Ar,Fr,eo,zo,po,go,mo,to,no,io,so,lo,uo,yo,fo,ho,jo,So,Po,_o,Oo,Ro,ko,vo,wo,Ao,Mo,Gt,Lo,xo,No,To,Do,Uo,Wo,qt,Ot,kt,wt,Mt,Lt,xt,Dt,Wt,Ft,Co,Eo,Fo,Go,Bo,Vo,$o,ia,la,ca,ua,za,pa,ga,ba,da,ma,fa,ya,Pa,_a,va,wa,Aa,Ca,Ta,La,xa,Na,Da,Ua,Ea,Fa,Ga,Ba,Ka,Va,Qa,Xa,Ja,Ya,$a,ei,ti,ni,ri,ui,pi,yi,hi,ji,Si,Pi,_i,qi,Ii,Oi,f.ChatCreateResponseSchema,f.ChatListResponseSchema,f.ChatInspectResponseSchema,f.ChatDeleteResponseSchema,f.ChatPostResponseSchema,f.ChatReadResponseSchema,f.ChatWaitResponseSchema,y.ScheduleCreateResponseSchema,y.ScheduleListResponseSchema,y.ScheduleInspectResponseSchema,y.ScheduleLogsResponseSchema,y.SchedulePauseResponseSchema,y.ScheduleResumeResponseSchema,y.ScheduleDeleteResponseSchema,y.ScheduleRunOnceResponseSchema,y.ScheduleUpdateResponseSchema,h.LoopRunResponseSchema,h.LoopListResponseSchema,h.LoopInspectResponseSchema,h.LoopLogsResponseSchema,h.LoopStopResponseSchema,ki,Ri]),wi=s.z.object({type:s.z.literal("ping")}),Ai=s.z.object({type:s.z.literal("pong")}),Mi=s.z.object({type:s.z.literal("hello"),clientId:s.z.string().min(1),clientType:s.z.enum(["mobile","browser","cli","mcp"]),protocolVersion:s.z.number().int(),appVersion:s.z.string().optional(),capabilities:s.z.object({voice:s.z.boolean().optional(),pushNotifications:s.z.boolean().optional(),[c.CLIENT_CAPS.reasoningMergeEnum]:s.z.boolean().optional(),[c.CLIENT_CAPS.customModeIcons]:s.z.boolean().optional(),[c.CLIENT_CAPS.terminalReflowableSnapshot]:s.z.boolean().optional()}).passthrough().optional()}),Ci=s.z.object({type:s.z.literal("recording_state"),isRecording:s.z.boolean()}),Ti=s.z.object({type:s.z.literal("session"),message:ur}),Li=s.z.object({type:s.z.literal("session"),message:vi}),xi=s.z.discriminatedUnion("type",[wi,Mi,Ci,Ti]),Ni=s.z.discriminatedUnion("type",[Ai,Li])},3361,[35,3267,3362,3360,3363,3364,3365,3366,3367,3369,3371,3372]);
15006
+ __d(function(g,r,i,a,m,_e,d){"use strict";const e=["contextKind"];Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PaseoConfigRawSchema",{enumerable:!0,get:function(){return j.PaseoConfigRawSchema}}),Object.defineProperty(_e,"PaseoLifecycleCommandRawSchema",{enumerable:!0,get:function(){return j.PaseoLifecycleCommandRawSchema}}),Object.defineProperty(_e,"PaseoMetadataGenerationEntrySchema",{enumerable:!0,get:function(){return j.PaseoMetadataGenerationEntrySchema}}),Object.defineProperty(_e,"PaseoMetadataGenerationSchema",{enumerable:!0,get:function(){return j.PaseoMetadataGenerationSchema}}),Object.defineProperty(_e,"PaseoScriptEntryRawSchema",{enumerable:!0,get:function(){return j.PaseoScriptEntryRawSchema}}),Object.defineProperty(_e,"PaseoWorktreeConfigRawSchema",{enumerable:!0,get:function(){return j.PaseoWorktreeConfigRawSchema}}),Object.defineProperty(_e,"TerminalProfileSchema",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"MutableDaemonConfigSchema",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"MutableDaemonConfigPatchSchema",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"AgentStatusSchema",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"AgentFeatureToggleSchema",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"AgentFeatureSelectSchema",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"AgentFeatureSchema",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"ProviderSnapshotEntrySchema",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"AgentPermissionResponseSchema",{enumerable:!0,get:function(){return V}}),Object.defineProperty(_e,"AgentPermissionRequestPayloadSchema",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(_e,"AgentTimelineItemPayloadSchema",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(_e,"AgentStreamEventPayloadSchema",{enumerable:!0,get:function(){return se}}),Object.defineProperty(_e,"AgentSnapshotPayloadSchema",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(_e,"AgentListItemPayloadSchema",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(_e,"RecentProviderSessionDescriptorPayloadSchema",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(_e,"VoiceAudioChunkMessageSchema",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(_e,"AbortRequestMessageSchema",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_e,"AudioPlayedMessageSchema",{enumerable:!0,get:function(){return de}}),Object.defineProperty(_e,"DeleteAgentRequestMessageSchema",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(_e,"ArchiveAgentRequestMessageSchema",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(_e,"CloseItemsRequestMessageSchema",{enumerable:!0,get:function(){return he}}),Object.defineProperty(_e,"UpdateAgentRequestMessageSchema",{enumerable:!0,get:function(){return je}}),Object.defineProperty(_e,"ProjectRenameRequestSchema",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(_e,"ProjectRemoveRequestSchema",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(_e,"WorkspaceTitleSetRequestSchema",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(_e,"SetVoiceModeMessageSchema",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(_e,"GitHubPrAttachmentSchema",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(_e,"GitHubIssueAttachmentSchema",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(_e,"TextAttachmentSchema",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(_e,"ReviewAttachmentContextLineSchema",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(_e,"ReviewAttachmentCommentSchema",{enumerable:!0,get:function(){return we}}),Object.defineProperty(_e,"ReviewAttachmentSchema",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(_e,"UploadedFileAttachmentSchema",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(_e,"AgentAttachmentSchema",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(_e,"SendAgentMessageSchema",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(_e,"FetchAgentsRequestMessageSchema",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(_e,"FetchWorkspacesRequestMessageSchema",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(_e,"FetchAgentHistoryRequestMessageSchema",{enumerable:!0,get:function(){return We}}),Object.defineProperty(_e,"FetchRecentProviderSessionsRequestMessageSchema",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(_e,"FetchAgentRequestMessageSchema",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(_e,"SendAgentMessageRequestSchema",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(_e,"WaitForFinishRequestSchema",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(_e,"DaemonGetStatusRequestSchema",{enumerable:!0,get:function(){return He}}),Object.defineProperty(_e,"DaemonGetPairingOfferRequestSchema",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(_e,"DiagnosticsRequestSchema",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(_e,"GetDaemonConfigRequestMessageSchema",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(_e,"SetDaemonConfigRequestMessageSchema",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(_e,"ReadProjectConfigRequestMessageSchema",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(_e,"WriteProjectConfigRequestMessageSchema",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(_e,"DictationStreamStartMessageSchema",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(_e,"DictationStreamChunkMessageSchema",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(_e,"DictationStreamFinishMessageSchema",{enumerable:!0,get:function(){return et}}),Object.defineProperty(_e,"DictationStreamCancelMessageSchema",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(_e,"CreateAgentWorktreeTargetSchema",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(_e,"CreateAgentRequestMessageSchema",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(_e,"ListProviderModelsRequestMessageSchema",{enumerable:!0,get:function(){return at}}),Object.defineProperty(_e,"ListProviderModesRequestMessageSchema",{enumerable:!0,get:function(){return it}}),Object.defineProperty(_e,"ListAvailableProvidersRequestMessageSchema",{enumerable:!0,get:function(){return st}}),Object.defineProperty(_e,"GetProvidersSnapshotRequestMessageSchema",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(_e,"RefreshProvidersSnapshotRequestMessageSchema",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(_e,"ProviderDiagnosticRequestMessageSchema",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(_e,"ProviderUsageListRequestMessageSchema",{enumerable:!0,get:function(){return zt}}),Object.defineProperty(_e,"ResumeAgentRequestMessageSchema",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(_e,"ImportAgentRequestMessageSchema",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(_e,"RefreshAgentRequestMessageSchema",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(_e,"CancelAgentRequestMessageSchema",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(_e,"RestartServerRequestMessageSchema",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(_e,"ShutdownServerRequestMessageSchema",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(_e,"DaemonUpdateRequestMessageSchema",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(_e,"AgentTimelineCursorSchema",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(_e,"FetchAgentTimelineRequestMessageSchema",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(_e,"AgentForkContextRequestMessageSchema",{enumerable:!0,get:function(){return St}}),Object.defineProperty(_e,"SetAgentModeRequestMessageSchema",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(_e,"SetAgentModeResponseMessageSchema",{enumerable:!0,get:function(){return qt}}),Object.defineProperty(_e,"SetAgentModelRequestMessageSchema",{enumerable:!0,get:function(){return It}}),Object.defineProperty(_e,"SetAgentModelResponseMessageSchema",{enumerable:!0,get:function(){return Ot}}),Object.defineProperty(_e,"SetAgentThinkingRequestMessageSchema",{enumerable:!0,get:function(){return Rt}}),Object.defineProperty(_e,"SetAgentThinkingResponseMessageSchema",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(_e,"SetAgentFeatureRequestMessageSchema",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(_e,"SetAgentFeatureResponseMessageSchema",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(_e,"AgentDetachRequestMessageSchema",{enumerable:!0,get:function(){return At}}),Object.defineProperty(_e,"AgentDetachResponseMessageSchema",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(_e,"AgentRewindModeSchema",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(_e,"AgentRewindRequestMessageSchema",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(_e,"AgentRewindResponseMessageSchema",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(_e,"UpdateAgentResponseMessageSchema",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(_e,"ProjectRenameResponsePayloadSchema",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(_e,"ProjectRenameResponseSchema",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(_e,"ProjectRemoveResponsePayloadSchema",{enumerable:!0,get:function(){return Ut}}),Object.defineProperty(_e,"ProjectRemoveResponseSchema",{enumerable:!0,get:function(){return Wt}}),Object.defineProperty(_e,"WorkspaceTitleSetResponsePayloadSchema",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(_e,"WorkspaceTitleSetResponseSchema",{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(_e,"SetVoiceModeResponseMessageSchema",{enumerable:!0,get:function(){return Gt}}),Object.defineProperty(_e,"AgentPermissionResponseMessageSchema",{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(_e,"CheckoutStatusRequestSchema",{enumerable:!0,get:function(){return Qt}}),Object.defineProperty(_e,"SubscribeCheckoutDiffRequestSchema",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(_e,"UnsubscribeCheckoutDiffRequestSchema",{enumerable:!0,get:function(){return Jt}}),Object.defineProperty(_e,"CheckoutCommitRequestSchema",{enumerable:!0,get:function(){return Yt}}),Object.defineProperty(_e,"CheckoutMergeRequestSchema",{enumerable:!0,get:function(){return Zt}}),Object.defineProperty(_e,"CheckoutMergeFromBaseRequestSchema",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(_e,"CheckoutPullRequestSchema",{enumerable:!0,get:function(){return en}}),Object.defineProperty(_e,"CheckoutPushRequestSchema",{enumerable:!0,get:function(){return tn}}),Object.defineProperty(_e,"CheckoutRefreshRequestSchema",{enumerable:!0,get:function(){return nn}}),Object.defineProperty(_e,"CheckoutPrCreateRequestSchema",{enumerable:!0,get:function(){return rn}}),Object.defineProperty(_e,"CheckoutPrMergeRequestSchema",{enumerable:!0,get:function(){return on}}),Object.defineProperty(_e,"CheckoutGithubSetAutoMergeRequestSchema",{enumerable:!0,get:function(){return an}}),Object.defineProperty(_e,"CheckoutGithubGetCheckDetailsRequestSchema",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(_e,"CheckoutPrStatusRequestSchema",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(_e,"PullRequestTimelineRequestSchema",{enumerable:!0,get:function(){return un}}),Object.defineProperty(_e,"ValidateBranchRequestSchema",{enumerable:!0,get:function(){return zn}}),Object.defineProperty(_e,"CheckoutSwitchBranchRequestSchema",{enumerable:!0,get:function(){return pn}}),Object.defineProperty(_e,"CheckoutRenameBranchRequestSchema",{enumerable:!0,get:function(){return gn}}),Object.defineProperty(_e,"StashSaveRequestSchema",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(_e,"StashPopRequestSchema",{enumerable:!0,get:function(){return dn}}),Object.defineProperty(_e,"StashListRequestSchema",{enumerable:!0,get:function(){return mn}}),Object.defineProperty(_e,"BranchSuggestionsRequestSchema",{enumerable:!0,get:function(){return fn}}),Object.defineProperty(_e,"GitHubSearchItemSchema",{enumerable:!0,get:function(){return yn}}),Object.defineProperty(_e,"GitHubSearchKindSchema",{enumerable:!0,get:function(){return hn}}),Object.defineProperty(_e,"GitHubSearchRequestSchema",{enumerable:!0,get:function(){return jn}}),Object.defineProperty(_e,"DirectorySuggestionsRequestSchema",{enumerable:!0,get:function(){return Sn}}),Object.defineProperty(_e,"PaseoWorktreeListRequestSchema",{enumerable:!0,get:function(){return Pn}}),Object.defineProperty(_e,"PaseoWorktreeArchiveRequestSchema",{enumerable:!0,get:function(){return _n}}),Object.defineProperty(_e,"FirstAgentContextSchema",{enumerable:!0,get:function(){return qn}}),Object.defineProperty(_e,"CreatePaseoWorktreeRequestSchema",{enumerable:!0,get:function(){return In}}),Object.defineProperty(_e,"WorkspaceSetupStatusRequestSchema",{enumerable:!0,get:function(){return On}}),Object.defineProperty(_e,"LegacyListAvailableEditorsRequestSchema",{enumerable:!0,get:function(){return Rn}}),Object.defineProperty(_e,"LegacyOpenInEditorRequestSchema",{enumerable:!0,get:function(){return kn}}),Object.defineProperty(_e,"OpenProjectRequestSchema",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(_e,"ProjectAddRequestSchema",{enumerable:!0,get:function(){return wn}}),Object.defineProperty(_e,"ArchiveWorkspaceRequestSchema",{enumerable:!0,get:function(){return An}}),Object.defineProperty(_e,"WorkspaceCreateRequestSchema",{enumerable:!0,get:function(){return Mn}}),Object.defineProperty(_e,"WorkspaceClearAttentionRequestSchema",{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(_e,"FileExplorerRequestSchema",{enumerable:!0,get:function(){return En}}),Object.defineProperty(_e,"ProjectIconRequestSchema",{enumerable:!0,get:function(){return Fn}}),Object.defineProperty(_e,"FileDownloadTokenRequestSchema",{enumerable:!0,get:function(){return Gn}}),Object.defineProperty(_e,"FileUploadRequestSchema",{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(_e,"ClearAgentAttentionMessageSchema",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(_e,"ClientHeartbeatMessageSchema",{enumerable:!0,get:function(){return Kn}}),Object.defineProperty(_e,"PingMessageSchema",{enumerable:!0,get:function(){return Vn}}),Object.defineProperty(_e,"ListProviderFeaturesRequestMessageSchema",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(_e,"ListCommandsRequestSchema",{enumerable:!0,get:function(){return Jn}}),Object.defineProperty(_e,"RegisterPushTokenMessageSchema",{enumerable:!0,get:function(){return Yn}}),Object.defineProperty(_e,"ListTerminalsRequestSchema",{enumerable:!0,get:function(){return Zn}}),Object.defineProperty(_e,"SubscribeTerminalsRequestSchema",{enumerable:!0,get:function(){return $n}}),Object.defineProperty(_e,"UnsubscribeTerminalsRequestSchema",{enumerable:!0,get:function(){return er}}),Object.defineProperty(_e,"CreateTerminalRequestSchema",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(_e,"RenameTerminalRequestSchema",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(_e,"StartWorkspaceScriptRequestSchema",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(_e,"SubscribeTerminalRequestSchema",{enumerable:!0,get:function(){return or}}),Object.defineProperty(_e,"UnsubscribeTerminalRequestSchema",{enumerable:!0,get:function(){return ar}}),Object.defineProperty(_e,"TerminalInputSchema",{enumerable:!0,get:function(){return sr}}),Object.defineProperty(_e,"KillTerminalRequestSchema",{enumerable:!0,get:function(){return lr}}),Object.defineProperty(_e,"CaptureTerminalRequestSchema",{enumerable:!0,get:function(){return cr}}),Object.defineProperty(_e,"SessionInboundMessageSchema",{enumerable:!0,get:function(){return ur}}),Object.defineProperty(_e,"ActivityLogPayloadSchema",{enumerable:!0,get:function(){return zr}}),Object.defineProperty(_e,"ActivityLogMessageSchema",{enumerable:!0,get:function(){return pr}}),Object.defineProperty(_e,"AssistantChunkMessageSchema",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(_e,"AudioOutputMessageSchema",{enumerable:!0,get:function(){return br}}),Object.defineProperty(_e,"TranscriptionResultMessageSchema",{enumerable:!0,get:function(){return dr}}),Object.defineProperty(_e,"VoiceInputStateMessageSchema",{enumerable:!0,get:function(){return mr}}),Object.defineProperty(_e,"DictationStreamAckMessageSchema",{enumerable:!0,get:function(){return fr}}),Object.defineProperty(_e,"DictationStreamFinishAcceptedMessageSchema",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(_e,"DictationStreamPartialMessageSchema",{enumerable:!0,get:function(){return hr}}),Object.defineProperty(_e,"DictationStreamFinalMessageSchema",{enumerable:!0,get:function(){return jr}}),Object.defineProperty(_e,"DictationStreamErrorMessageSchema",{enumerable:!0,get:function(){return Sr}}),Object.defineProperty(_e,"ServerCapabilityStateSchema",{enumerable:!0,get:function(){return Pr}}),Object.defineProperty(_e,"ServerVoiceCapabilitiesSchema",{enumerable:!0,get:function(){return _r}}),Object.defineProperty(_e,"ServerCapabilitiesSchema",{enumerable:!0,get:function(){return qr}}),Object.defineProperty(_e,"ServerInfoStatusPayloadSchema",{enumerable:!0,get:function(){return kr}}),Object.defineProperty(_e,"StatusMessageSchema",{enumerable:!0,get:function(){return vr}}),Object.defineProperty(_e,"PongMessageSchema",{enumerable:!0,get:function(){return wr}}),Object.defineProperty(_e,"RpcErrorMessageSchema",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(_e,"AgentCreatedStatusPayloadSchema",{enumerable:!0,get:function(){return Tr}}),Object.defineProperty(_e,"AgentCreateFailedStatusPayloadSchema",{enumerable:!0,get:function(){return Lr}}),Object.defineProperty(_e,"AgentResumedStatusPayloadSchema",{enumerable:!0,get:function(){return xr}}),Object.defineProperty(_e,"AgentRefreshedStatusPayloadSchema",{enumerable:!0,get:function(){return Nr}}),Object.defineProperty(_e,"RestartRequestedStatusPayloadSchema",{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(_e,"ShutdownRequestedStatusPayloadSchema",{enumerable:!0,get:function(){return Ur}}),Object.defineProperty(_e,"DaemonConfigChangedStatusPayloadSchema",{enumerable:!0,get:function(){return Wr}}),Object.defineProperty(_e,"KnownStatusPayloadSchema",{enumerable:!0,get:function(){return Er}}),Object.defineProperty(_e,"ArtifactMessageSchema",{enumerable:!0,get:function(){return Fr}}),Object.defineProperty(_e,"ProjectCheckoutLiteNotGitPayloadSchema",{enumerable:!0,get:function(){return Gr}}),Object.defineProperty(_e,"ProjectCheckoutLiteGitNonPaseoPayloadSchema",{enumerable:!0,get:function(){return Br}}),Object.defineProperty(_e,"ProjectCheckoutLiteGitPaseoPayloadSchema",{enumerable:!0,get:function(){return Hr}}),Object.defineProperty(_e,"ProjectCheckoutLitePayloadSchema",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(_e,"ProjectPlacementPayloadSchema",{enumerable:!0,get:function(){return Vr}}),Object.defineProperty(_e,"WorkspaceScriptLifecycleSchema",{enumerable:!0,get:function(){return Qr}}),Object.defineProperty(_e,"WorkspaceScriptHealthSchema",{enumerable:!0,get:function(){return Xr}}),Object.defineProperty(_e,"WorkspaceScriptPayloadSchema",{enumerable:!0,get:function(){return Jr}}),Object.defineProperty(_e,"WorkspaceDescriptorPayloadSchema",{enumerable:!0,get:function(){return $r}}),Object.defineProperty(_e,"AgentUpdateMessageSchema",{enumerable:!0,get:function(){return eo}}),Object.defineProperty(_e,"AgentStreamMessageSchema",{enumerable:!0,get:function(){return to}}),Object.defineProperty(_e,"AgentStatusMessageSchema",{enumerable:!0,get:function(){return no}}),Object.defineProperty(_e,"AgentListMessageSchema",{enumerable:!0,get:function(){return ro}}),Object.defineProperty(_e,"FetchAgentsResponseMessageSchema",{enumerable:!0,get:function(){return io}}),Object.defineProperty(_e,"FetchAgentHistoryResponseMessageSchema",{enumerable:!0,get:function(){return so}}),Object.defineProperty(_e,"FetchRecentProviderSessionsResponseMessageSchema",{enumerable:!0,get:function(){return lo}}),Object.defineProperty(_e,"WorkspaceProjectDescriptorPayloadSchema",{enumerable:!0,get:function(){return co}}),Object.defineProperty(_e,"FetchWorkspacesResponseMessageSchema",{enumerable:!0,get:function(){return uo}}),Object.defineProperty(_e,"WorkspaceUpdateMessageSchema",{enumerable:!0,get:function(){return zo}}),Object.defineProperty(_e,"ScriptStatusUpdateMessageSchema",{enumerable:!0,get:function(){return po}}),Object.defineProperty(_e,"WorkspaceSetupProgressMessageSchema",{enumerable:!0,get:function(){return go}}),Object.defineProperty(_e,"WorkspaceSetupSnapshotSchema",{enumerable:!0,get:function(){return bo}}),Object.defineProperty(_e,"WorkspaceSetupStatusResponseMessageSchema",{enumerable:!0,get:function(){return mo}}),Object.defineProperty(_e,"OpenProjectResponseMessageSchema",{enumerable:!0,get:function(){return fo}}),Object.defineProperty(_e,"ProjectAddResponseSchema",{enumerable:!0,get:function(){return yo}}),Object.defineProperty(_e,"StartWorkspaceScriptResponseMessageSchema",{enumerable:!0,get:function(){return ho}}),Object.defineProperty(_e,"LegacyListAvailableEditorsResponseMessageSchema",{enumerable:!0,get:function(){return jo}}),Object.defineProperty(_e,"LegacyOpenInEditorResponseMessageSchema",{enumerable:!0,get:function(){return So}}),Object.defineProperty(_e,"ArchiveWorkspaceResponseMessageSchema",{enumerable:!0,get:function(){return Po}}),Object.defineProperty(_e,"FetchAgentResponseMessageSchema",{enumerable:!0,get:function(){return _o}}),Object.defineProperty(_e,"AgentTimelineEntryPayloadSchema",{enumerable:!0,get:function(){return Io}}),Object.defineProperty(_e,"FetchAgentTimelineResponseMessageSchema",{enumerable:!0,get:function(){return Oo}}),Object.defineProperty(_e,"AgentForkContextResponseMessageSchema",{enumerable:!0,get:function(){return Ro}}),Object.defineProperty(_e,"CancelAgentResponseMessageSchema",{enumerable:!0,get:function(){return ko}}),Object.defineProperty(_e,"ClearAgentAttentionResponseMessageSchema",{enumerable:!0,get:function(){return vo}}),Object.defineProperty(_e,"WorkspaceCreateResponseSchema",{enumerable:!0,get:function(){return wo}}),Object.defineProperty(_e,"WorkspaceClearAttentionResponseSchema",{enumerable:!0,get:function(){return Ao}}),Object.defineProperty(_e,"SendAgentMessageResponseMessageSchema",{enumerable:!0,get:function(){return Mo}}),Object.defineProperty(_e,"WaitForFinishResponseMessageSchema",{enumerable:!0,get:function(){return Co}}),Object.defineProperty(_e,"GetDaemonConfigResponseMessageSchema",{enumerable:!0,get:function(){return To}}),Object.defineProperty(_e,"DaemonGetStatusResponseSchema",{enumerable:!0,get:function(){return Lo}}),Object.defineProperty(_e,"DaemonGetPairingOfferResponseSchema",{enumerable:!0,get:function(){return xo}}),Object.defineProperty(_e,"DiagnosticsResponseSchema",{enumerable:!0,get:function(){return No}}),Object.defineProperty(_e,"SetDaemonConfigResponseMessageSchema",{enumerable:!0,get:function(){return Do}}),Object.defineProperty(_e,"ReadProjectConfigResponseMessageSchema",{enumerable:!0,get:function(){return Uo}}),Object.defineProperty(_e,"WriteProjectConfigResponseMessageSchema",{enumerable:!0,get:function(){return Wo}}),Object.defineProperty(_e,"AgentPermissionRequestMessageSchema",{enumerable:!0,get:function(){return Eo}}),Object.defineProperty(_e,"AgentPermissionResolvedMessageSchema",{enumerable:!0,get:function(){return Fo}}),Object.defineProperty(_e,"AgentDeletedMessageSchema",{enumerable:!0,get:function(){return Go}}),Object.defineProperty(_e,"AgentArchivedMessageSchema",{enumerable:!0,get:function(){return Bo}}),Object.defineProperty(_e,"CloseItemsResponseSchema",{enumerable:!0,get:function(){return Vo}}),Object.defineProperty(_e,"CheckoutStatusResponseSchema",{enumerable:!0,get:function(){return $o}}),Object.defineProperty(_e,"CheckoutPrStatusSchema",{enumerable:!0,get:function(){return ra}}),Object.defineProperty(_e,"CheckoutStatusUpdateSchema",{enumerable:!0,get:function(){return ia}}),Object.defineProperty(_e,"SubscribeCheckoutDiffResponseSchema",{enumerable:!0,get:function(){return la}}),Object.defineProperty(_e,"CheckoutDiffUpdateSchema",{enumerable:!0,get:function(){return ca}}),Object.defineProperty(_e,"CheckoutCommitResponseSchema",{enumerable:!0,get:function(){return ua}}),Object.defineProperty(_e,"CheckoutMergeResponseSchema",{enumerable:!0,get:function(){return za}}),Object.defineProperty(_e,"CheckoutMergeFromBaseResponseSchema",{enumerable:!0,get:function(){return pa}}),Object.defineProperty(_e,"CheckoutPullResponseSchema",{enumerable:!0,get:function(){return ga}}),Object.defineProperty(_e,"CheckoutPushResponseSchema",{enumerable:!0,get:function(){return ba}}),Object.defineProperty(_e,"CheckoutRefreshResponseSchema",{enumerable:!0,get:function(){return da}}),Object.defineProperty(_e,"CheckoutPrCreateResponseSchema",{enumerable:!0,get:function(){return ma}}),Object.defineProperty(_e,"CheckoutPrMergeResponseSchema",{enumerable:!0,get:function(){return fa}}),Object.defineProperty(_e,"CheckoutGithubSetAutoMergeResponseSchema",{enumerable:!0,get:function(){return ya}}),Object.defineProperty(_e,"CheckoutGithubCheckDetailsSchema",{enumerable:!0,get:function(){return Sa}}),Object.defineProperty(_e,"CheckoutGithubGetCheckDetailsResponseSchema",{enumerable:!0,get:function(){return Pa}}),Object.defineProperty(_e,"CheckoutPrStatusResponseSchema",{enumerable:!0,get:function(){return _a}}),Object.defineProperty(_e,"PullRequestTimelineItemSchema",{enumerable:!0,get:function(){return ka}}),Object.defineProperty(_e,"PullRequestTimelineResponseSchema",{enumerable:!0,get:function(){return va}}),Object.defineProperty(_e,"CheckoutSwitchBranchResponseSchema",{enumerable:!0,get:function(){return wa}}),Object.defineProperty(_e,"CheckoutRenameBranchResponseSchema",{enumerable:!0,get:function(){return Aa}}),Object.defineProperty(_e,"StashSaveResponseSchema",{enumerable:!0,get:function(){return Ca}}),Object.defineProperty(_e,"StashPopResponseSchema",{enumerable:!0,get:function(){return Ta}}),Object.defineProperty(_e,"StashListResponseSchema",{enumerable:!0,get:function(){return La}}),Object.defineProperty(_e,"ValidateBranchResponseSchema",{enumerable:!0,get:function(){return xa}}),Object.defineProperty(_e,"BranchSuggestionsResponseSchema",{enumerable:!0,get:function(){return Na}}),Object.defineProperty(_e,"GitHubSearchResponseSchema",{enumerable:!0,get:function(){return Da}}),Object.defineProperty(_e,"DirectorySuggestionsResponseSchema",{enumerable:!0,get:function(){return Ua}}),Object.defineProperty(_e,"PaseoWorktreeListResponseSchema",{enumerable:!0,get:function(){return Ea}}),Object.defineProperty(_e,"PaseoWorktreeArchiveResponseSchema",{enumerable:!0,get:function(){return Fa}}),Object.defineProperty(_e,"CreatePaseoWorktreeResponseSchema",{enumerable:!0,get:function(){return Ga}}),Object.defineProperty(_e,"FileExplorerResponseSchema",{enumerable:!0,get:function(){return Ba}}),Object.defineProperty(_e,"ProjectIconResponseSchema",{enumerable:!0,get:function(){return Ka}}),Object.defineProperty(_e,"FileDownloadTokenResponseSchema",{enumerable:!0,get:function(){return Va}}),Object.defineProperty(_e,"FileUploadResponseSchema",{enumerable:!0,get:function(){return Qa}}),Object.defineProperty(_e,"ListProviderModelsResponseMessageSchema",{enumerable:!0,get:function(){return Xa}}),Object.defineProperty(_e,"ListProviderModesResponseMessageSchema",{enumerable:!0,get:function(){return Ja}}),Object.defineProperty(_e,"ListProviderFeaturesResponseMessageSchema",{enumerable:!0,get:function(){return Ya}}),Object.defineProperty(_e,"ListAvailableProvidersResponseSchema",{enumerable:!0,get:function(){return $a}}),Object.defineProperty(_e,"GetProvidersSnapshotResponseMessageSchema",{enumerable:!0,get:function(){return ei}}),Object.defineProperty(_e,"ProvidersSnapshotUpdateMessageSchema",{enumerable:!0,get:function(){return ti}}),Object.defineProperty(_e,"RefreshProvidersSnapshotResponseMessageSchema",{enumerable:!0,get:function(){return ni}}),Object.defineProperty(_e,"ProviderDiagnosticResponseMessageSchema",{enumerable:!0,get:function(){return ri}}),Object.defineProperty(_e,"ProviderUsageToneSchema",{enumerable:!0,get:function(){return oi}}),Object.defineProperty(_e,"ProviderUsageStatusSchema",{enumerable:!0,get:function(){return ai}}),Object.defineProperty(_e,"ProviderUsageWindowSchema",{enumerable:!0,get:function(){return ii}}),Object.defineProperty(_e,"ProviderUsageBalanceSchema",{enumerable:!0,get:function(){return si}}),Object.defineProperty(_e,"ProviderUsageDetailSchema",{enumerable:!0,get:function(){return li}}),Object.defineProperty(_e,"ProviderUsageSchema",{enumerable:!0,get:function(){return ci}}),Object.defineProperty(_e,"ProviderUsageListResponseMessageSchema",{enumerable:!0,get:function(){return ui}}),Object.defineProperty(_e,"ListCommandsResponseSchema",{enumerable:!0,get:function(){return pi}}),Object.defineProperty(_e,"TerminalCellSchema",{enumerable:!0,get:function(){return bi}}),Object.defineProperty(_e,"TerminalCursorStyleSchema",{enumerable:!0,get:function(){return di}}),Object.defineProperty(_e,"TerminalCursorSchema",{enumerable:!0,get:function(){return mi}}),Object.defineProperty(_e,"TerminalStateSchema",{enumerable:!0,get:function(){return fi}}),Object.defineProperty(_e,"ListTerminalsResponseSchema",{enumerable:!0,get:function(){return yi}}),Object.defineProperty(_e,"TerminalsChangedSchema",{enumerable:!0,get:function(){return hi}}),Object.defineProperty(_e,"CreateTerminalResponseSchema",{enumerable:!0,get:function(){return ji}}),Object.defineProperty(_e,"RenameTerminalResponseSchema",{enumerable:!0,get:function(){return Si}}),Object.defineProperty(_e,"SubscribeTerminalResponseSchema",{enumerable:!0,get:function(){return Pi}}),Object.defineProperty(_e,"KillTerminalResponseSchema",{enumerable:!0,get:function(){return _i}}),Object.defineProperty(_e,"CaptureTerminalResponseSchema",{enumerable:!0,get:function(){return qi}}),Object.defineProperty(_e,"TerminalStreamExitSchema",{enumerable:!0,get:function(){return Ii}}),Object.defineProperty(_e,"TerminalAttentionRequiredSchema",{enumerable:!0,get:function(){return Oi}}),Object.defineProperty(_e,"DaemonUpdateResponseSchema",{enumerable:!0,get:function(){return Ri}}),Object.defineProperty(_e,"DaemonUpdateProgressMessageSchema",{enumerable:!0,get:function(){return ki}}),Object.defineProperty(_e,"SessionOutboundMessageSchema",{enumerable:!0,get:function(){return vi}}),Object.defineProperty(_e,"WSPingMessageSchema",{enumerable:!0,get:function(){return wi}}),Object.defineProperty(_e,"WSPongMessageSchema",{enumerable:!0,get:function(){return Ai}}),Object.defineProperty(_e,"WSHelloMessageSchema",{enumerable:!0,get:function(){return Mi}}),Object.defineProperty(_e,"WSRecordingStateMessageSchema",{enumerable:!0,get:function(){return Ci}}),Object.defineProperty(_e,"WSSessionInboundSchema",{enumerable:!0,get:function(){return Ti}}),Object.defineProperty(_e,"WSSessionOutboundSchema",{enumerable:!0,get:function(){return Li}}),Object.defineProperty(_e,"WSInboundMessageSchema",{enumerable:!0,get:function(){return xi}}),Object.defineProperty(_e,"WSOutboundMessageSchema",{enumerable:!0,get:function(){return Ni}}),_e.extractSessionMessage=function(e){if("session"===e.type)return e.message;return null},_e.wrapSessionMessage=function(e){return{type:"session",message:e}},_e.parseServerInfoStatusPayload=function(e){const t=kr.safeParse(e);if(!t.success)return null;return t.data};var t,n=r(d[0]),o=(t=n)&&t.__esModule?t:{default:t},s=r(d[1]),l=r(d[2]),c=r(d[3]),u=r(d[4]),z=r(d[5]),p=r(d[6]),b=r(d[7]),f=r(d[8]),y=r(d[9]),h=r(d[10]),j=r(d[11]);const S=s.z.object({id:s.z.string().min(1),label:s.z.string().min(1),description:s.z.string().optional(),isDefault:s.z.boolean().optional()}).passthrough(),P=s.z.object({enabled:s.z.boolean().optional(),additionalModels:s.z.array(S).optional()}).passthrough(),_=s.z.object({provider:s.z.string().min(1),model:s.z.string().min(1).optional(),thinkingOptionId:s.z.string().min(1).optional()}).passthrough(),q=s.z.object({providers:s.z.array(_).default([])}).passthrough(),I=s.z.object({id:s.z.string(),name:s.z.string(),command:s.z.string(),args:s.z.array(s.z.string()).optional(),icon:s.z.string().optional()}).passthrough(),O=s.z.object({mcp:s.z.object({injectIntoAgents:s.z.boolean()}).passthrough(),providers:s.z.record(s.z.string(),P).default({}),metadataGeneration:q.default({providers:[]}),autoArchiveAfterMerge:s.z.boolean().default(!1),enableTerminalAgentHooks:s.z.boolean().default(!1),appendSystemPrompt:s.z.string().default(""),terminalProfiles:s.z.array(I).optional()}).passthrough(),R=s.z.object({mcp:O.shape.mcp.partial().optional(),providers:s.z.record(s.z.string(),P.partial().passthrough()).optional(),metadataGeneration:q.partial().optional(),autoArchiveAfterMerge:s.z.boolean().optional(),enableTerminalAgentHooks:s.z.boolean().optional(),appendSystemPrompt:s.z.string().optional(),terminalProfiles:s.z.array(I).optional()}).partial().passthrough(),k=s.z.enum(u.AGENT_LIFECYCLE_STATUSES),v=s.z.object({id:s.z.string(),label:s.z.string(),description:s.z.string().optional(),icon:s.z.string().optional(),colorTier:s.z.string().optional()}),w=s.z.enum(["ready","loading","error","unavailable"]),A=s.z.object({id:s.z.string(),label:s.z.string(),description:s.z.string().optional(),isDefault:s.z.boolean().optional(),metadata:s.z.record(s.z.string(),s.z.unknown()).optional()}),M=s.z.discriminatedUnion("type",[s.z.object({type:s.z.literal("info"),message:s.z.string()}),s.z.object({type:s.z.literal("warning"),message:s.z.string()}),s.z.object({type:s.z.literal("error"),message:s.z.string()})]),C=s.z.object({type:s.z.literal("toggle"),id:s.z.string(),label:s.z.string(),description:s.z.string().optional(),tooltip:s.z.string().optional(),icon:s.z.string().optional(),value:s.z.boolean()}),T=s.z.object({type:s.z.literal("select"),id:s.z.string(),label:s.z.string(),description:s.z.string().optional(),tooltip:s.z.string().optional(),icon:s.z.string().optional(),value:s.z.string().nullable(),options:s.z.array(A)}),L=s.z.discriminatedUnion("type",[C,T]),x=s.z.object({provider:p.AgentProviderSchema,id:s.z.string(),label:s.z.string(),description:s.z.string().optional(),isDefault:s.z.boolean().optional(),contextWindowMaxTokens:s.z.number().optional(),metadata:s.z.record(s.z.string(),s.z.unknown()).optional(),thinkingOptions:s.z.array(A).optional(),defaultThinkingOptionId:s.z.string().optional()}).transform(b.normalizeAgentModelDefinition),N=s.z.object({provider:p.AgentProviderSchema,status:w,enabled:s.z.boolean().optional().default(!0),error:s.z.string().optional(),models:s.z.array(x).optional(),modes:s.z.array(v).optional(),fetchedAt:s.z.string().optional(),label:s.z.string().optional(),description:s.z.string().optional(),defaultModeId:s.z.string().nullable().optional()}),D=s.z.object({supportsStreaming:s.z.boolean(),supportsSessionPersistence:s.z.boolean(),supportsSessionListing:s.z.boolean().optional(),supportsDynamicModes:s.z.boolean(),supportsMcpServers:s.z.boolean(),supportsReasoningStream:s.z.boolean(),supportsToolInvocations:s.z.boolean(),supportsRewindConversation:s.z.boolean().optional().default(!1),supportsRewindFiles:s.z.boolean().optional().default(!1),supportsRewindBoth:s.z.boolean().optional().default(!1)}).catchall(s.z.boolean()),U=s.z.object({inputTokens:s.z.number().optional(),cachedInputTokens:s.z.number().optional(),outputTokens:s.z.number().optional(),totalCostUsd:s.z.number().optional(),contextWindowMaxTokens:s.z.number().optional(),contextWindowUsedTokens:s.z.number().optional()}),W=s.z.object({type:s.z.literal("stdio"),command:s.z.string(),args:s.z.array(s.z.string()).optional(),env:s.z.record(s.z.string(),s.z.string()).optional(),alwaysLoad:s.z.boolean().optional()}),E=s.z.object({type:s.z.literal("http"),url:s.z.string(),headers:s.z.record(s.z.string(),s.z.string()).optional(),alwaysLoad:s.z.boolean().optional()}),F=s.z.object({type:s.z.literal("sse"),url:s.z.string(),headers:s.z.record(s.z.string(),s.z.string()).optional(),alwaysLoad:s.z.boolean().optional()}),G=s.z.discriminatedUnion("type",[W,E,F]),B=s.z.object({provider:p.AgentProviderSchema,cwd:s.z.string(),modeId:s.z.string().optional(),model:s.z.string().optional(),thinkingOptionId:s.z.string().optional(),featureValues:s.z.record(s.z.string(),s.z.unknown()).optional(),title:s.z.string().trim().min(1).max(z.MAX_EXPLICIT_AGENT_TITLE_CHARS).optional().nullable(),approvalPolicy:s.z.string().optional(),sandboxMode:s.z.string().optional(),networkAccess:s.z.boolean().optional(),webSearch:s.z.boolean().optional(),extra:s.z.object({codex:s.z.record(s.z.string(),s.z.unknown()).optional(),claude:s.z.record(s.z.string(),s.z.unknown()).optional()}).partial().optional(),systemPrompt:s.z.string().optional(),mcpServers:s.z.record(s.z.string(),G).optional()}),H=s.z.record(s.z.string(),s.z.unknown()),K=s.z.object({id:s.z.string(),label:s.z.string(),behavior:s.z.enum(["allow","deny"]),variant:s.z.enum(["primary","secondary","danger"]).optional(),intent:s.z.enum(["implement","implement_resume","dismiss"]).optional()}),V=s.z.union([s.z.object({behavior:s.z.literal("allow"),selectedActionId:s.z.string().optional(),updatedInput:s.z.record(s.z.string(),s.z.unknown()).optional(),updatedPermissions:s.z.array(H).optional()}),s.z.object({behavior:s.z.literal("deny"),selectedActionId:s.z.string().optional(),message:s.z.string().optional(),interrupt:s.z.boolean().optional()})]),Q=s.z.object({id:s.z.string(),provider:p.AgentProviderSchema,name:s.z.string(),kind:s.z.enum(["tool","plan","question","mode","other"]),title:s.z.string().optional(),description:s.z.string().optional(),input:s.z.record(s.z.string(),s.z.unknown()).optional(),detail:s.z.lazy(()=>$).optional(),suggestions:s.z.array(H).optional(),actions:s.z.array(K).optional(),metadata:s.z.record(s.z.string(),s.z.unknown()).optional()}),X=s.z.union([s.z.null(),s.z.boolean(),s.z.number(),s.z.string(),s.z.array(s.z.unknown()),s.z.object({}).passthrough()]),J=s.z.union([s.z.boolean(),s.z.number(),s.z.string(),s.z.array(s.z.unknown()),s.z.object({}).passthrough()]),Y=s.z.object({index:s.z.number().int().positive(),command:s.z.string(),cwd:s.z.string(),log:s.z.string().optional().default(""),status:s.z.enum(["running","completed","failed"]),exitCode:s.z.number().nullable(),durationMs:s.z.number().nonnegative().optional()}),Z=s.z.object({type:s.z.literal("worktree_setup"),worktreePath:s.z.string(),branchName:s.z.string(),log:s.z.string(),commands:s.z.array(Y),truncated:s.z.boolean().optional()}),$=s.z.discriminatedUnion("type",[Z,s.z.object({type:s.z.literal("shell"),command:s.z.string(),cwd:s.z.string().optional(),output:s.z.string().optional(),exitCode:s.z.number().nullable().optional()}),s.z.object({type:s.z.literal("read"),filePath:s.z.string(),content:s.z.string().optional(),offset:s.z.number().optional(),limit:s.z.number().optional()}),s.z.object({type:s.z.literal("edit"),filePath:s.z.string(),oldString:s.z.string().optional(),newString:s.z.string().optional(),unifiedDiff:s.z.string().optional()}),s.z.object({type:s.z.literal("write"),filePath:s.z.string(),content:s.z.string().optional()}),s.z.object({type:s.z.literal("search"),query:s.z.string(),toolName:s.z.enum(["search","grep","glob","web_search"]).optional(),content:s.z.string().optional(),filePaths:s.z.array(s.z.string()).optional(),webResults:s.z.array(s.z.object({title:s.z.string(),url:s.z.string()})).optional(),annotations:s.z.array(s.z.string()).optional(),numFiles:s.z.number().optional(),numMatches:s.z.number().optional(),durationMs:s.z.number().optional(),durationSeconds:s.z.number().optional(),truncated:s.z.boolean().optional(),mode:s.z.enum(["content","files_with_matches","count"]).optional()}),s.z.object({type:s.z.literal("fetch"),url:s.z.string(),prompt:s.z.string().optional(),result:s.z.string().optional(),code:s.z.number().optional(),codeText:s.z.string().optional(),bytes:s.z.number().optional(),durationMs:s.z.number().optional()}),s.z.object({type:s.z.literal("sub_agent"),subAgentType:s.z.string().optional(),description:s.z.string().optional(),childSessionId:s.z.string().optional(),log:s.z.string(),actions:s.z.array(s.z.object({index:s.z.number().int().positive(),toolName:s.z.string(),summary:s.z.string().optional()})).optional()}),s.z.object({type:s.z.literal("plain_text"),label:s.z.string().optional(),text:s.z.string().optional(),icon:s.z.enum(b.TOOL_CALL_ICON_NAMES).optional()}),s.z.object({type:s.z.literal("plan"),text:s.z.string()}),s.z.object({type:s.z.literal("unknown"),input:X,output:X})]),ee=s.z.object({type:s.z.literal("tool_call"),callId:s.z.string(),name:s.z.string(),detail:$,metadata:s.z.record(s.z.string(),s.z.unknown()).optional()}),te=ee.extend({status:s.z.literal("running"),error:s.z.null()}),ne=ee.extend({status:s.z.literal("completed"),error:s.z.null()}),re=ee.extend({status:s.z.literal("failed"),error:J}),oe=ee.extend({status:s.z.literal("canceled"),error:s.z.null()}),ae=s.z.union([te,ne,re,oe]),ie=s.z.union([s.z.object({type:s.z.literal("user_message"),text:s.z.string(),messageId:s.z.string().optional()}),s.z.object({type:s.z.literal("assistant_message"),text:s.z.string(),messageId:s.z.string().optional()}),s.z.object({type:s.z.literal("reasoning"),text:s.z.string()}),ae,s.z.object({type:s.z.literal("todo"),items:s.z.array(s.z.object({text:s.z.string(),completed:s.z.boolean()}))}),s.z.object({type:s.z.literal("error"),message:s.z.string()}),s.z.object({type:s.z.literal("compaction"),status:s.z.enum(["loading","completed"]),trigger:s.z.enum(["auto","manual"]).optional(),preTokens:s.z.number().optional()})]),se=s.z.discriminatedUnion("type",[s.z.object({type:s.z.literal("thread_started"),sessionId:s.z.string(),provider:p.AgentProviderSchema}),s.z.object({type:s.z.literal("turn_started"),provider:p.AgentProviderSchema}),s.z.object({type:s.z.literal("turn_completed"),provider:p.AgentProviderSchema,usage:U.optional()}),s.z.object({type:s.z.literal("turn_failed"),provider:p.AgentProviderSchema,error:s.z.string(),code:s.z.string().optional(),diagnostic:s.z.string().optional()}),s.z.object({type:s.z.literal("turn_canceled"),provider:p.AgentProviderSchema,reason:s.z.string()}),s.z.object({type:s.z.literal("timeline"),provider:p.AgentProviderSchema,item:ie}),s.z.object({type:s.z.literal("permission_requested"),provider:p.AgentProviderSchema,request:Q}),s.z.object({type:s.z.literal("permission_resolved"),provider:p.AgentProviderSchema,requestId:s.z.string(),resolution:V}),s.z.object({type:s.z.literal("attention_required"),provider:p.AgentProviderSchema,reason:s.z.enum(["finished","error","permission"]),timestamp:s.z.string(),shouldNotify:s.z.boolean(),notification:s.z.object({title:s.z.string(),body:s.z.string(),data:s.z.object({serverId:s.z.string(),agentId:s.z.string(),reason:s.z.enum(["finished","error","permission"])})}).optional()})]),le=s.z.object({provider:p.AgentProviderSchema,sessionId:s.z.string(),nativeHandle:s.z.string().optional(),metadata:s.z.record(s.z.string(),s.z.unknown()).optional()}).nullable(),ce=s.z.object({provider:p.AgentProviderSchema,sessionId:s.z.string().nullable(),model:s.z.string().nullable().optional(),thinkingOptionId:s.z.string().nullable().optional(),modeId:s.z.string().nullable().optional(),extra:s.z.record(s.z.string(),s.z.unknown()).optional()}),ue=s.z.object({id:s.z.string(),provider:p.AgentProviderSchema,cwd:s.z.string(),workspaceId:s.z.string().optional(),model:s.z.string().nullable(),features:s.z.array(L).optional(),thinkingOptionId:s.z.string().nullable().optional(),effectiveThinkingOptionId:s.z.string().nullable().optional(),createdAt:s.z.string(),updatedAt:s.z.string(),lastUserMessageAt:s.z.string().nullable(),status:k,capabilities:D,currentModeId:s.z.string().nullable(),availableModes:s.z.array(v),pendingPermissions:s.z.array(Q),persistence:le.nullable(),runtimeInfo:ce.optional(),lastUsage:U.optional(),lastError:s.z.string().optional(),title:s.z.string().nullable(),labels:s.z.record(s.z.string(),s.z.string()).default({}),requiresAttention:s.z.boolean().optional(),attentionReason:s.z.enum(["finished","error","permission"]).nullable().optional(),attentionTimestamp:s.z.string().nullable().optional(),archivedAt:s.z.string().nullable().optional(),providerUnavailable:s.z.boolean().optional()}),ze=s.z.object({id:s.z.string(),shortId:s.z.string(),title:s.z.string().nullable(),provider:p.AgentProviderSchema,model:s.z.string().nullable(),thinkingOptionId:s.z.string().nullable().optional(),effectiveThinkingOptionId:s.z.string().nullable().optional(),status:k,cwd:s.z.string(),createdAt:s.z.string(),updatedAt:s.z.string(),lastUserMessageAt:s.z.string().nullable(),archivedAt:s.z.string().nullable().optional(),requiresAttention:s.z.boolean().optional(),attentionReason:s.z.enum(["finished","error","permission"]).nullable().optional(),attentionTimestamp:s.z.string().nullable().optional(),labels:s.z.record(s.z.string(),s.z.string()).default({}),providerUnavailable:s.z.boolean().optional()}),pe=s.z.object({providerId:s.z.string(),providerLabel:s.z.string(),providerHandleId:s.z.string(),cwd:s.z.string(),title:s.z.string().nullable(),firstPromptPreview:s.z.string().nullable(),lastPromptPreview:s.z.string().nullable(),lastActivityAt:s.z.string()}),ge=s.z.object({type:s.z.literal("voice_audio_chunk"),audio:s.z.string(),format:s.z.string(),isLast:s.z.boolean()}),be=s.z.object({type:s.z.literal("abort_request")}),de=s.z.object({type:s.z.literal("audio_played"),id:s.z.string()}),me=s.z.object({labels:s.z.record(s.z.string(),s.z.string()).optional(),projectKeys:s.z.array(s.z.string()).optional(),statuses:s.z.array(k).optional(),includeArchived:s.z.boolean().optional(),requiresAttention:s.z.boolean().optional(),thinkingOptionId:s.z.string().nullable().optional()}),fe=s.z.object({type:s.z.literal("delete_agent_request"),agentId:s.z.string(),requestId:s.z.string()}),ye=s.z.object({type:s.z.literal("archive_agent_request"),agentId:s.z.string(),requestId:s.z.string()}),he=s.z.object({type:s.z.literal("close_items_request"),agentIds:s.z.array(s.z.string()).default([]),terminalIds:s.z.array(s.z.string()).default([]),requestId:s.z.string()}),je=s.z.object({type:s.z.literal("update_agent_request"),agentId:s.z.string(),name:s.z.string().optional(),labels:s.z.record(s.z.string(),s.z.string()).optional(),requestId:s.z.string()}),Se=s.z.object({type:s.z.literal("project.rename.request"),projectId:s.z.string(),customName:s.z.string().nullable(),requestId:s.z.string()}),Pe=s.z.object({type:s.z.literal("project.remove.request"),projectId:s.z.string(),requestId:s.z.string()}),qe=s.z.object({type:s.z.literal("workspace.title.set.request"),workspaceId:s.z.string(),title:s.z.string().nullable(),requestId:s.z.string()}),Ie=s.z.object({type:s.z.literal("set_voice_mode"),enabled:s.z.boolean(),agentId:s.z.string().optional(),requestId:s.z.string().optional()}),Oe=s.z.object({type:s.z.literal("github_pr"),mimeType:s.z.literal("application/github-pr"),number:s.z.number().int().positive(),title:s.z.string(),url:s.z.string(),body:s.z.string().nullable().optional(),baseRefName:s.z.string().nullable().optional(),headRefName:s.z.string().nullable().optional()}),Re=s.z.object({type:s.z.literal("github_issue"),mimeType:s.z.literal("application/github-issue"),number:s.z.number().int().positive(),title:s.z.string(),url:s.z.string(),body:s.z.string().nullable().optional()}),ke=s.z.object({type:s.z.literal("text"),mimeType:s.z.literal("text/plain"),contextKind:s.z.string().optional(),title:s.z.string().nullable().optional(),text:s.z.string()}).transform(t=>{let{contextKind:n}=t,s=(0,o.default)(t,e);return Object.assign({},s,"chat_history"===n?{contextKind:n}:{})}),ve=s.z.object({oldLineNumber:s.z.number().int().positive().nullable(),newLineNumber:s.z.number().int().positive().nullable(),type:s.z.enum(["add","remove","context"]),content:s.z.string()}),we=s.z.object({filePath:s.z.string(),side:s.z.enum(["old","new"]),lineNumber:s.z.number().int().positive(),body:s.z.string(),context:s.z.object({hunkHeader:s.z.string(),targetLine:ve,lines:s.z.array(ve)})}),Ae=s.z.object({type:s.z.literal("review"),mimeType:s.z.literal("application/paseo-review"),cwd:s.z.string(),mode:s.z.enum(["uncommitted","base"]),baseRef:s.z.string().nullable().optional(),comments:s.z.array(we)}),Me=s.z.object({type:s.z.literal("uploaded_file"),id:s.z.string(),fileName:s.z.string(),mimeType:s.z.string(),size:s.z.number().int().nonnegative(),path:s.z.string()}),Ce=s.z.discriminatedUnion("type",[Oe,Re,ke,Ae,Me]);const Te=s.z.unknown().transform(function(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){const e=Ce.safeParse(n);e.success&&t.push(e.data)}return t}).optional(),Le=s.z.object({data:s.z.string(),mimeType:s.z.string()}),xe=s.z.object({type:s.z.literal("send_agent_message"),agentId:s.z.string(),text:s.z.string(),messageId:s.z.string().optional(),images:s.z.array(Le).optional(),attachments:Te}),Ne=s.z.object({type:s.z.literal("fetch_agents_request"),requestId:s.z.string(),scope:s.z.enum(["active"]).optional(),filter:me.optional(),sort:s.z.array(s.z.object({key:s.z.enum(["status_priority","created_at","updated_at","title"]),direction:s.z.enum(["asc","desc"])})).optional(),page:s.z.object({limit:s.z.number().int().positive().max(200),cursor:s.z.string().min(1).optional()}).optional(),subscribe:s.z.object({subscriptionId:s.z.string().optional()}).optional()}),De=s.z.enum(["needs_input","failed","running","attention","done"]),Ue=s.z.object({type:s.z.literal("fetch_workspaces_request"),requestId:s.z.string(),filter:s.z.object({query:s.z.string().optional(),projectId:s.z.string().optional(),idPrefix:s.z.string().optional()}).optional(),sort:s.z.array(s.z.object({key:s.z.enum(["status_priority","activity_at","name","project_id"]),direction:s.z.enum(["asc","desc"])})).optional(),page:s.z.object({limit:s.z.number().int().positive().max(200),cursor:s.z.string().min(1).optional()}).optional(),subscribe:s.z.object({subscriptionId:s.z.string().optional()}).optional()}),We=s.z.object({type:s.z.literal("fetch_agent_history_request"),requestId:s.z.string(),filter:me.optional(),sort:s.z.array(s.z.object({key:s.z.enum(["status_priority","created_at","updated_at","title"]),direction:s.z.enum(["asc","desc"])})).optional(),page:s.z.object({limit:s.z.number().int().positive().max(200),cursor:s.z.string().min(1).optional()}).optional()}),Ee=s.z.object({type:s.z.literal("fetch_recent_provider_sessions_request"),requestId:s.z.string(),cwd:s.z.string().optional(),providers:s.z.array(s.z.string()).optional(),since:s.z.string().optional(),limit:s.z.number().int().positive().max(200).optional()}),Fe=s.z.object({type:s.z.literal("fetch_agent_request"),requestId:s.z.string(),agentId:s.z.string()}),Ge=s.z.object({type:s.z.literal("send_agent_message_request"),requestId:s.z.string(),agentId:s.z.string(),text:s.z.string(),messageId:s.z.string().optional(),images:s.z.array(Le).optional(),attachments:Te}),Be=s.z.object({type:s.z.literal("wait_for_finish_request"),requestId:s.z.string(),agentId:s.z.string(),timeoutMs:s.z.number().int().positive().optional()}),He=s.z.object({type:s.z.literal("daemon.get_status.request"),requestId:s.z.string()}),Ke=s.z.object({type:s.z.literal("daemon.get_pairing_offer.request"),requestId:s.z.string()}),Ve=s.z.object({type:s.z.literal("diagnostics.request"),requestId:s.z.string()}),Qe=s.z.object({type:s.z.literal("get_daemon_config_request"),requestId:s.z.string()}),Xe=s.z.object({type:s.z.literal("set_daemon_config_request"),requestId:s.z.string(),config:R}),Je=s.z.object({type:s.z.literal("read_project_config_request"),requestId:s.z.string(),repoRoot:s.z.string()}),Ye=s.z.object({type:s.z.literal("write_project_config_request"),requestId:s.z.string(),repoRoot:s.z.string(),config:j.PaseoConfigRawSchema,expectedRevision:j.PaseoConfigRevisionSchema.nullable()}),Ze=s.z.object({type:s.z.literal("dictation_stream_start"),dictationId:s.z.string(),format:s.z.string()}),$e=s.z.object({type:s.z.literal("dictation_stream_chunk"),dictationId:s.z.string(),seq:s.z.number().int().nonnegative(),audio:s.z.string(),format:s.z.string()}),et=s.z.object({type:s.z.literal("dictation_stream_finish"),dictationId:s.z.string(),finalSeq:s.z.number().int().nonnegative()}),tt=s.z.object({type:s.z.literal("dictation_stream_cancel"),dictationId:s.z.string()}),nt=s.z.object({baseBranch:s.z.string().optional(),createNewBranch:s.z.boolean().optional(),newBranchName:s.z.string().optional(),createWorktree:s.z.boolean().optional(),worktreeSlug:s.z.string().optional(),refName:s.z.string().min(1).optional(),action:s.z.enum(["branch-off","checkout"]).optional(),githubPrNumber:s.z.number().int().positive().optional()}),rt=s.z.discriminatedUnion("mode",[s.z.object({mode:s.z.literal("branch-off"),newBranch:s.z.string().min(1),base:s.z.string().min(1).optional()}),s.z.object({mode:s.z.literal("checkout-branch"),branch:s.z.string().min(1)}),s.z.object({mode:s.z.literal("checkout-pr"),prNumber:s.z.number().int().positive()})]),ot=s.z.object({type:s.z.literal("create_agent_request"),config:B,env:s.z.record(s.z.string(),s.z.string()).optional(),workspaceId:s.z.string().optional(),worktreeName:s.z.string().optional(),initialPrompt:s.z.string().optional(),clientMessageId:s.z.string().optional(),outputSchema:s.z.record(s.z.string(),s.z.unknown()).optional(),images:s.z.array(Le).optional(),attachments:Te,git:nt.optional(),worktree:rt.optional(),autoArchive:s.z.boolean().optional(),labels:s.z.record(s.z.string(),s.z.string()).default({}),requestId:s.z.string()}),at=s.z.object({type:s.z.literal("list_provider_models_request"),provider:p.AgentProviderSchema,cwd:s.z.string().optional(),requestId:s.z.string()}),it=s.z.object({type:s.z.literal("list_provider_modes_request"),provider:p.AgentProviderSchema,cwd:s.z.string().optional(),requestId:s.z.string()}),st=s.z.object({type:s.z.literal("list_available_providers_request"),requestId:s.z.string()}),lt=s.z.object({type:s.z.literal("get_providers_snapshot_request"),cwd:s.z.string().optional(),requestId:s.z.string()}),ct=s.z.object({type:s.z.literal("refresh_providers_snapshot_request"),cwd:s.z.string().optional(),providers:s.z.array(p.AgentProviderSchema).optional(),requestId:s.z.string()}),ut=s.z.object({type:s.z.literal("provider_diagnostic_request"),provider:p.AgentProviderSchema,requestId:s.z.string()}),zt=s.z.object({type:s.z.literal("provider.usage.list.request"),requestId:s.z.string()}),pt=s.z.object({type:s.z.literal("resume_agent_request"),handle:le,overrides:B.partial().optional(),requestId:s.z.string()}),gt=s.z.object({type:s.z.literal("import_agent_request"),provider:p.AgentProviderSchema.optional(),providerId:s.z.string().optional(),sessionId:s.z.string().optional(),providerHandleId:s.z.string().optional(),cwd:s.z.string().optional(),labels:s.z.record(s.z.string(),s.z.string()).optional(),requestId:s.z.string()}),bt=s.z.object({type:s.z.literal("refresh_agent_request"),agentId:s.z.string(),requestId:s.z.string()}),dt=s.z.object({type:s.z.literal("cancel_agent_request"),agentId:s.z.string(),requestId:s.z.string().optional()}),mt=s.z.object({type:s.z.literal("restart_server_request"),reason:s.z.string().optional(),requestId:s.z.string()}),ft=s.z.object({type:s.z.literal("shutdown_server_request"),requestId:s.z.string()}),yt=s.z.object({type:s.z.literal("daemon.update.request"),requestId:s.z.string()}),ht=s.z.object({epoch:s.z.string(),seq:s.z.number().int().nonnegative()}),jt=s.z.object({type:s.z.literal("fetch_agent_timeline_request"),agentId:s.z.string(),requestId:s.z.string(),direction:s.z.enum(["tail","before","after"]).optional(),cursor:ht.optional(),limit:s.z.number().int().nonnegative().optional(),projection:s.z.enum(["projected","canonical"]).optional()}),St=s.z.object({type:s.z.literal("agent.fork_context.request"),agentId:s.z.string(),boundaryMessageId:s.z.string().optional(),requestId:s.z.string()}),Pt=s.z.object({type:s.z.literal("set_agent_mode_request"),agentId:s.z.string(),modeId:s.z.string(),requestId:s.z.string()}),_t=s.z.object({requestId:s.z.string(),agentId:s.z.string(),accepted:s.z.boolean(),error:s.z.string().nullable(),notice:M.nullable().optional()}),qt=s.z.object({type:s.z.literal("set_agent_mode_response"),payload:_t}),It=s.z.object({type:s.z.literal("set_agent_model_request"),agentId:s.z.string(),modelId:s.z.string().nullable(),requestId:s.z.string()}),Ot=s.z.object({type:s.z.literal("set_agent_model_response"),payload:_t}),Rt=s.z.object({type:s.z.literal("set_agent_thinking_request"),agentId:s.z.string(),thinkingOptionId:s.z.string().nullable(),requestId:s.z.string()}),kt=s.z.object({type:s.z.literal("set_agent_thinking_response"),payload:_t}),vt=s.z.object({type:s.z.literal("set_agent_feature_request"),agentId:s.z.string(),featureId:s.z.string(),value:s.z.unknown(),requestId:s.z.string()}),wt=s.z.object({type:s.z.literal("set_agent_feature_response"),payload:_t}),At=s.z.object({type:s.z.literal("agent.detach.request"),agentId:s.z.string(),requestId:s.z.string()}),Mt=s.z.object({type:s.z.literal("agent.detach.response"),payload:_t}),Ct=s.z.enum(["conversation","files","both"]),Tt=s.z.object({type:s.z.literal("agent.rewind.request"),agentId:s.z.string(),messageId:s.z.string(),mode:Ct,requestId:s.z.string()}),Lt=s.z.object({type:s.z.literal("agent.rewind.response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string(),ok:s.z.boolean(),error:s.z.string().nullable()})}),xt=s.z.object({type:s.z.literal("update_agent_response"),payload:_t}),Nt=s.z.object({requestId:s.z.string(),projectId:s.z.string(),accepted:s.z.boolean(),customName:s.z.string().nullable(),error:s.z.string().nullable()}),Dt=s.z.object({type:s.z.literal("project.rename.response"),payload:Nt}),Ut=s.z.object({requestId:s.z.string(),projectId:s.z.string(),accepted:s.z.boolean(),removedWorkspaceIds:s.z.array(s.z.string()).default([]),error:s.z.string().nullable()}),Wt=s.z.object({type:s.z.literal("project.remove.response"),payload:Ut}),Et=s.z.object({requestId:s.z.string(),workspaceId:s.z.string(),accepted:s.z.boolean(),title:s.z.string().nullable(),error:s.z.string().nullable()}),Ft=s.z.object({type:s.z.literal("workspace.title.set.response"),payload:Et}),Gt=s.z.object({type:s.z.literal("set_voice_mode_response"),payload:s.z.object({requestId:s.z.string(),enabled:s.z.boolean(),agentId:s.z.string().nullable(),accepted:s.z.boolean(),error:s.z.string().nullable(),reasonCode:s.z.string().optional(),retryable:s.z.boolean().optional(),missingModelIds:s.z.array(s.z.string()).optional()})}),Bt=s.z.object({type:s.z.literal("agent_permission_response"),agentId:s.z.string(),requestId:s.z.string(),response:V}),Ht=s.z.enum(["NOT_GIT_REPO","NOT_ALLOWED","MERGE_CONFLICT","UNKNOWN"]),Kt=s.z.object({code:Ht,message:s.z.string()}),Vt=s.z.object({mode:s.z.enum(["uncommitted","base"]),baseRef:s.z.string().optional(),ignoreWhitespace:s.z.boolean().optional()}),Qt=s.z.object({type:s.z.literal("checkout_status_request"),cwd:s.z.string(),requestId:s.z.string()}),Xt=s.z.object({type:s.z.literal("subscribe_checkout_diff_request"),subscriptionId:s.z.string(),cwd:s.z.string(),compare:Vt,requestId:s.z.string()}),Jt=s.z.object({type:s.z.literal("unsubscribe_checkout_diff_request"),subscriptionId:s.z.string()}),Yt=s.z.object({type:s.z.literal("checkout_commit_request"),cwd:s.z.string(),message:s.z.string().optional(),addAll:s.z.boolean().optional(),requestId:s.z.string()}),Zt=s.z.object({type:s.z.literal("checkout_merge_request"),cwd:s.z.string(),baseRef:s.z.string().optional(),strategy:s.z.enum(["merge","squash"]).optional(),requireCleanTarget:s.z.boolean().optional(),requestId:s.z.string()}),$t=s.z.object({type:s.z.literal("checkout_merge_from_base_request"),cwd:s.z.string(),baseRef:s.z.string().optional(),requireCleanTarget:s.z.boolean().optional(),requestId:s.z.string()}),en=s.z.object({type:s.z.literal("checkout_pull_request"),cwd:s.z.string(),requestId:s.z.string()}),tn=s.z.object({type:s.z.literal("checkout_push_request"),cwd:s.z.string(),requestId:s.z.string()}),nn=s.z.object({type:s.z.literal("checkout.refresh.request"),cwd:s.z.string(),requestId:s.z.string()}),rn=s.z.object({type:s.z.literal("checkout_pr_create_request"),cwd:s.z.string(),title:s.z.string().optional(),body:s.z.string().optional(),baseRef:s.z.string().optional(),requestId:s.z.string()}),on=s.z.object({type:s.z.literal("checkout_pr_merge_request"),cwd:s.z.string(),mergeMethod:s.z.enum(["merge","squash","rebase"]),requestId:s.z.string()}),an=s.z.object({type:s.z.literal("checkout.github.set_auto_merge.request"),cwd:s.z.string(),enabled:s.z.boolean(),mergeMethod:s.z.enum(["merge","squash","rebase"]).optional(),requestId:s.z.string()}),sn=s.z.string().regex(/^[A-Za-z0-9._-]+$/),ln=s.z.object({type:s.z.literal("checkout.github.get_check_details.request"),cwd:s.z.string(),repoOwner:sn,repoName:sn,checkRunId:s.z.number().int().positive(),workflowRunId:s.z.number().int().positive().optional(),requestId:s.z.string()}),cn=s.z.object({type:s.z.literal("checkout_pr_status_request"),cwd:s.z.string(),requestId:s.z.string()}),un=s.z.object({type:s.z.literal("pull_request_timeline_request"),cwd:s.z.string(),prNumber:s.z.number(),repoOwner:s.z.string(),repoName:s.z.string(),requestId:s.z.string()}),zn=s.z.object({type:s.z.literal("validate_branch_request"),cwd:s.z.string(),branchName:s.z.string(),requestId:s.z.string()}),pn=s.z.object({type:s.z.literal("checkout_switch_branch_request"),cwd:s.z.string(),branch:s.z.string(),requestId:s.z.string()}),gn=s.z.object({type:s.z.literal("checkout.rename_branch.request"),cwd:s.z.string(),branch:s.z.string(),requestId:s.z.string()}),bn=s.z.object({type:s.z.literal("stash_save_request"),cwd:s.z.string(),branch:s.z.string().optional(),requestId:s.z.string()}),dn=s.z.object({type:s.z.literal("stash_pop_request"),cwd:s.z.string(),stashIndex:s.z.number().int().min(0),requestId:s.z.string()}),mn=s.z.object({type:s.z.literal("stash_list_request"),cwd:s.z.string(),paseoOnly:s.z.boolean().optional(),requestId:s.z.string()}),fn=s.z.object({type:s.z.literal("branch_suggestions_request"),cwd:s.z.string(),query:s.z.string().optional(),limit:s.z.number().int().min(1).max(200).optional(),requestId:s.z.string()}),yn=s.z.object({kind:s.z.enum(["issue","pr"]),number:s.z.number(),title:s.z.string(),url:s.z.string(),state:s.z.string(),body:s.z.string().nullable(),labels:s.z.array(s.z.string()),baseRefName:s.z.string().nullable().optional(),headRefName:s.z.string().nullable().optional(),updatedAt:s.z.string().optional()}),hn=s.z.enum(["github-issue","github-pr"]),jn=s.z.object({type:s.z.literal("github_search_request"),cwd:s.z.string(),query:s.z.string(),limit:s.z.number().int().min(1).max(50).optional(),kinds:s.z.array(hn).optional(),requestId:s.z.string()}),Sn=s.z.object({type:s.z.literal("directory_suggestions_request"),query:s.z.string(),cwd:s.z.string().optional(),includeFiles:s.z.boolean().optional(),includeDirectories:s.z.boolean().optional(),matchMode:s.z.enum(["fuzzy","suffix"]).optional(),limit:s.z.number().int().min(1).max(100).optional(),requestId:s.z.string()}),Pn=s.z.object({type:s.z.literal("paseo_worktree_list_request"),cwd:s.z.string().optional(),repoRoot:s.z.string().optional(),requestId:s.z.string()}),_n=s.z.object({type:s.z.literal("paseo_worktree_archive_request"),worktreePath:s.z.string().optional(),repoRoot:s.z.string().optional(),branchName:s.z.string().optional(),workspaceId:s.z.string().optional(),scope:s.z.enum(["workspace","worktree"]).optional().default("workspace"),deleteWorktreeFromDisk:s.z.boolean().optional().default(!1),requestId:s.z.string()}),qn=s.z.object({prompt:s.z.string().optional(),attachments:Te}),In=s.z.object({type:s.z.literal("create_paseo_worktree_request"),cwd:s.z.string(),projectId:s.z.string().optional(),worktreeSlug:s.z.string().optional(),nameContext:s.z.string().optional(),attachments:Te.optional(),firstAgentContext:qn.optional(),refName:s.z.string().min(1).optional(),action:s.z.enum(["branch-off","checkout"]).optional(),githubPrNumber:s.z.number().int().positive().optional(),requestId:s.z.string()}),On=s.z.object({type:s.z.literal("workspace_setup_status_request"),workspaceId:s.z.string(),requestId:s.z.string()}),Rn=s.z.object({type:s.z.literal("list_available_editors_request"),requestId:s.z.string()}),kn=s.z.object({type:s.z.literal("open_in_editor_request"),path:s.z.string(),editorId:s.z.string().trim().min(1),mode:s.z.enum(["open","reveal"]).optional(),cwd:s.z.string().optional(),requestId:s.z.string()}),vn=s.z.object({type:s.z.literal("open_project_request"),cwd:s.z.string(),requestId:s.z.string()}),wn=s.z.object({type:s.z.literal("project.add.request"),cwd:s.z.string(),requestId:s.z.string()}),An=s.z.object({type:s.z.literal("archive_workspace_request"),workspaceId:s.z.string(),requestId:s.z.string()}),Mn=s.z.object({type:s.z.literal("workspace.create.request"),requestId:s.z.string(),title:s.z.string().optional(),firstAgentContext:qn.optional(),source:s.z.discriminatedUnion("kind",[s.z.object({kind:s.z.literal("directory"),path:s.z.string(),projectId:s.z.string().optional()}),s.z.object({kind:s.z.literal("worktree"),cwd:s.z.string().optional(),projectId:s.z.string().optional(),action:s.z.enum(["branch-off","checkout"]).optional(),refName:s.z.string().min(1).optional(),baseBranch:s.z.string().optional(),githubPrNumber:s.z.number().int().positive().optional(),worktreeSlug:s.z.string().optional()})])}),Cn=s.z.object({type:s.z.literal("workspace.clear_attention.request"),workspaceId:s.z.union([s.z.string(),s.z.array(s.z.string())]),requestId:s.z.string()}),Tn=s.z.object({text:s.z.string(),style:s.z.string().nullable()}),Ln=s.z.object({type:s.z.enum(["add","remove","context","header"]),content:s.z.string(),tokens:s.z.array(Tn).optional()}),xn=s.z.object({oldStart:s.z.number(),oldCount:s.z.number(),newStart:s.z.number(),newCount:s.z.number(),lines:s.z.array(Ln)}),Nn=s.z.object({path:s.z.string(),isNew:s.z.boolean(),isDeleted:s.z.boolean(),additions:s.z.number(),deletions:s.z.number(),hunks:s.z.array(xn),status:s.z.enum(["ok","too_large","binary"]).optional()}),Dn=s.z.object({name:s.z.string(),path:s.z.string(),kind:s.z.enum(["file","directory"]),size:s.z.number(),modifiedAt:s.z.string()}),Un=s.z.object({path:s.z.string(),kind:s.z.enum(["text","image","binary"]),encoding:s.z.enum(["utf-8","base64","none"]),content:s.z.string().optional(),mimeType:s.z.string().optional(),size:s.z.number(),modifiedAt:s.z.string()}),Wn=s.z.object({path:s.z.string(),entries:s.z.array(Dn)}),En=s.z.object({type:s.z.literal("file_explorer_request"),cwd:s.z.string(),path:s.z.string().optional(),mode:s.z.enum(["list","file"]),requestId:s.z.string(),acceptBinary:s.z.boolean().optional()}),Fn=s.z.object({type:s.z.literal("project_icon_request"),cwd:s.z.string(),requestId:s.z.string()}),Gn=s.z.object({type:s.z.literal("file_download_token_request"),cwd:s.z.string(),path:s.z.string(),requestId:s.z.string()}),Bn=s.z.object({type:s.z.literal("file.upload.request"),fileName:s.z.string().min(1),mimeType:s.z.string().min(1),size:s.z.number().int().nonnegative(),modifiedAt:s.z.string(),requestId:s.z.string()}),Hn=s.z.object({type:s.z.literal("clear_agent_attention"),agentId:s.z.union([s.z.string(),s.z.array(s.z.string())]),requestId:s.z.string().optional()}),Kn=s.z.object({type:s.z.literal("client_heartbeat"),deviceType:s.z.enum(["web","mobile"]),focusedAgentId:s.z.string().nullable(),focusedTerminalId:s.z.string().nullable().optional().default(null),lastActivityAt:s.z.string(),appVisible:s.z.boolean(),appVisibilityChangedAt:s.z.string().optional()}),Vn=s.z.object({type:s.z.literal("ping"),requestId:s.z.string(),clientSentAt:s.z.number().int().optional()}),Qn=s.z.object({provider:p.AgentProviderSchema,cwd:s.z.string(),modeId:s.z.string().optional(),model:s.z.string().optional(),thinkingOptionId:s.z.string().optional(),featureValues:s.z.record(s.z.string(),s.z.unknown()).optional()}),Xn=s.z.object({type:s.z.literal("list_provider_features_request"),draftConfig:Qn,requestId:s.z.string()}),Jn=s.z.object({type:s.z.literal("list_commands_request"),agentId:s.z.string(),draftConfig:Qn.optional(),requestId:s.z.string()}),Yn=s.z.object({type:s.z.literal("register_push_token"),token:s.z.string()}),Zn=s.z.object({type:s.z.literal("list_terminals_request"),cwd:s.z.string().optional(),workspaceId:s.z.string().optional(),requestId:s.z.string()}),$n=s.z.object({type:s.z.literal("subscribe_terminals_request"),cwd:s.z.string(),workspaceId:s.z.string().optional()}),er=s.z.object({type:s.z.literal("unsubscribe_terminals_request"),cwd:s.z.string(),workspaceId:s.z.string().optional()}),tr=s.z.object({type:s.z.literal("create_terminal_request"),cwd:s.z.string(),workspaceId:s.z.string().optional(),name:s.z.string().optional(),agentId:s.z.string().optional(),command:s.z.string().optional(),args:s.z.array(s.z.string()).optional(),requestId:s.z.string()}),nr=s.z.object({type:s.z.literal("terminal.rename.request"),terminalId:s.z.string(),title:s.z.string(),requestId:s.z.string()}),rr=s.z.object({type:s.z.literal("start_workspace_script_request"),workspaceId:s.z.string(),scriptName:s.z.string(),requestId:s.z.string()}),or=s.z.object({type:s.z.literal("subscribe_terminal_request"),terminalId:s.z.string(),requestId:s.z.string(),restore:s.z.object({mode:s.z.enum(["live","visible-snapshot","full-snapshot"]),scrollbackLines:s.z.number().int().nonnegative().optional(),size:s.z.object({rows:s.z.number().int().positive(),cols:s.z.number().int().positive()}).optional()}).optional()}),ar=s.z.object({type:s.z.literal("unsubscribe_terminal_request"),terminalId:s.z.string()}),ir=s.z.discriminatedUnion("type",[s.z.object({type:s.z.literal("input"),data:s.z.string()}),s.z.object({type:s.z.literal("resize"),rows:s.z.number(),cols:s.z.number()}),s.z.object({type:s.z.literal("mouse"),row:s.z.number(),col:s.z.number(),button:s.z.number(),action:s.z.enum(["down","up","move"])})]),sr=s.z.object({type:s.z.literal("terminal_input"),terminalId:s.z.string(),message:ir}),lr=s.z.object({type:s.z.literal("kill_terminal_request"),terminalId:s.z.string(),requestId:s.z.string()}),cr=s.z.object({type:s.z.literal("capture_terminal_request"),terminalId:s.z.string(),start:s.z.number().int().optional(),end:s.z.number().int().optional(),stripAnsi:s.z.boolean().default(!0),requestId:s.z.string()}),ur=s.z.discriminatedUnion("type",[ge,be,de,Ne,We,Ee,Ue,Fe,fe,ye,he,je,Se,Pe,qe,Ie,Ge,Be,He,Ke,Ve,Qe,Xe,Je,Ye,Ze,$e,et,tt,ot,at,it,Xn,st,lt,ct,ut,zt,pt,gt,bt,dt,ft,mt,yt,jt,St,Pt,It,Rt,vt,At,Tt,Bt,Qt,Xt,Jt,Yt,Zt,$t,en,tn,nn,rn,on,an,ln,cn,un,pn,gn,bn,dn,mn,zn,fn,jn,Sn,Pn,_n,In,On,Rn,kn,vn,wn,An,Mn,Cn,En,Fn,Gn,Bn,Hn,Kn,Vn,Jn,Yn,Zn,$n,er,tr,nr,rr,or,ar,sr,lr,cr,f.ChatCreateRequestSchema,f.ChatListRequestSchema,f.ChatInspectRequestSchema,f.ChatDeleteRequestSchema,f.ChatPostRequestSchema,f.ChatReadRequestSchema,f.ChatWaitRequestSchema,y.ScheduleCreateRequestSchema,y.ScheduleListRequestSchema,y.ScheduleInspectRequestSchema,y.ScheduleLogsRequestSchema,y.SchedulePauseRequestSchema,y.ScheduleResumeRequestSchema,y.ScheduleDeleteRequestSchema,y.ScheduleRunOnceRequestSchema,y.ScheduleUpdateRequestSchema,h.LoopRunRequestSchema,h.LoopListRequestSchema,h.LoopInspectRequestSchema,h.LoopLogsRequestSchema,h.LoopStopRequestSchema]),zr=s.z.object({id:s.z.string(),timestamp:s.z.coerce.date(),type:s.z.enum(["transcript","assistant","tool_call","tool_result","error","system"]),content:s.z.string(),metadata:s.z.record(s.z.string(),s.z.unknown()).optional()}),pr=s.z.object({type:s.z.literal("activity_log"),payload:zr}),gr=s.z.object({type:s.z.literal("assistant_chunk"),payload:s.z.object({chunk:s.z.string()})}),br=s.z.object({type:s.z.literal("audio_output"),payload:s.z.object({audio:s.z.string(),format:s.z.string(),id:s.z.string(),isVoiceMode:s.z.boolean(),groupId:s.z.string().optional(),chunkIndex:s.z.number().int().nonnegative().optional(),isLastChunk:s.z.boolean().optional()})}),dr=s.z.object({type:s.z.literal("transcription_result"),payload:s.z.object({text:s.z.string(),language:s.z.string().optional(),duration:s.z.number().optional(),requestId:s.z.string(),avgLogprob:s.z.number().optional(),isLowConfidence:s.z.boolean().optional(),byteLength:s.z.number().optional(),format:s.z.string().optional(),debugRecordingPath:s.z.string().optional()})}),mr=s.z.object({type:s.z.literal("voice_input_state"),payload:s.z.object({isSpeaking:s.z.boolean()})}),fr=s.z.object({type:s.z.literal("dictation_stream_ack"),payload:s.z.object({dictationId:s.z.string(),ackSeq:s.z.number().int()})}),yr=s.z.object({type:s.z.literal("dictation_stream_finish_accepted"),payload:s.z.object({dictationId:s.z.string(),timeoutMs:s.z.number().int().positive()})}),hr=s.z.object({type:s.z.literal("dictation_stream_partial"),payload:s.z.object({dictationId:s.z.string(),text:s.z.string()})}),jr=s.z.object({type:s.z.literal("dictation_stream_final"),payload:s.z.object({dictationId:s.z.string(),text:s.z.string(),debugRecordingPath:s.z.string().optional()})}),Sr=s.z.object({type:s.z.literal("dictation_stream_error"),payload:s.z.object({dictationId:s.z.string(),error:s.z.string(),retryable:s.z.boolean(),reasonCode:s.z.string().optional(),missingModelIds:s.z.array(s.z.string()).optional(),debugRecordingPath:s.z.string().optional()})}),Pr=s.z.object({enabled:s.z.boolean(),reason:s.z.string()}),_r=s.z.object({dictation:Pr,voice:Pr}),qr=s.z.object({voice:_r.optional()}).passthrough(),Ir=s.z.unknown().transform(e=>{if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null}),Or=s.z.unknown().transform(e=>{if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null}),Rr=s.z.unknown().optional().transform(e=>{if(void 0===e)return;const t=qr.safeParse(e);return t.success?t.data:void 0}),kr=s.z.object({status:s.z.literal("server_info"),serverId:s.z.string().trim().min(1),hostname:Ir.optional(),version:Or.optional(),capabilities:Rr.optional(),features:s.z.object({providersSnapshot:s.z.boolean().optional(),checkoutGithubSetAutoMerge:s.z.boolean().optional(),githubCheckDetails:s.z.boolean().optional(),daemonStatusRpc:s.z.boolean().optional(),"terminal-restore-modes":s.z.boolean().optional(),rewind:s.z.boolean().optional(),checkoutRefresh:s.z.boolean().optional(),workspaceMultiplicity:s.z.boolean().optional(),projectRemove:s.z.boolean().optional(),projectAdd:s.z.boolean().optional(),worktreeRestore:s.z.boolean().optional(),providerUsageList:s.z.boolean().optional(),agentDetach:s.z.boolean().optional(),daemonDiagnostics:s.z.boolean().optional(),daemonSelfUpdate:s.z.boolean().optional(),agentForkContext:s.z.boolean().optional()}).optional()}).passthrough().transform(e=>Object.assign({},e,{hostname:e.hostname??null,version:e.version??null})),vr=s.z.object({type:s.z.literal("status"),payload:s.z.object({status:s.z.string()}).passthrough()}),wr=s.z.object({type:s.z.literal("pong"),payload:s.z.object({requestId:s.z.string(),clientSentAt:s.z.number().int().optional(),serverReceivedAt:s.z.number().int(),serverSentAt:s.z.number().int()})}),Ar=s.z.object({type:s.z.literal("rpc_error"),payload:s.z.object({requestId:s.z.string(),requestType:s.z.string().optional(),error:s.z.string(),code:s.z.string().optional()})}),Mr=s.z.object({agentId:s.z.string(),requestId:s.z.string()}),Cr=Mr.extend({timelineSize:s.z.number().optional()}),Tr=s.z.object({status:s.z.literal("agent_created"),agent:ue}).extend(Mr.shape),Lr=s.z.object({status:s.z.literal("agent_create_failed"),requestId:s.z.string(),error:s.z.string(),errorCode:s.z.string().optional()}),xr=s.z.object({status:s.z.literal("agent_resumed"),agent:ue}).extend(Cr.shape),Nr=s.z.object({status:s.z.literal("agent_refreshed")}).extend(Cr.shape),Dr=s.z.object({status:s.z.literal("restart_requested"),clientId:s.z.string(),reason:s.z.string().optional(),requestId:s.z.string()}),Ur=s.z.object({status:s.z.literal("shutdown_requested"),clientId:s.z.string(),requestId:s.z.string()}),Wr=s.z.object({status:s.z.literal("daemon_config_changed"),config:O}).passthrough(),Er=s.z.discriminatedUnion("status",[Tr,Lr,xr,Nr,Ur,Dr,Wr]),Fr=s.z.object({type:s.z.literal("artifact"),payload:s.z.object({type:s.z.enum(["markdown","diff","image","code"]),id:s.z.string(),title:s.z.string(),content:s.z.string(),isBase64:s.z.boolean()})}),Gr=s.z.object({cwd:s.z.string(),isGit:s.z.literal(!1),currentBranch:s.z.null(),remoteUrl:s.z.null(),worktreeRoot:s.z.null().optional(),isPaseoOwnedWorktree:s.z.literal(!1),mainRepoRoot:s.z.null()}).transform(e=>Object.assign({},e,{worktreeRoot:null})),Br=s.z.object({cwd:s.z.string(),isGit:s.z.literal(!0),currentBranch:s.z.string().nullable(),remoteUrl:s.z.string().nullable(),worktreeRoot:s.z.string().optional(),isPaseoOwnedWorktree:s.z.literal(!1),mainRepoRoot:s.z.string().nullable().optional().default(null)}).transform(e=>Object.assign({},e,{worktreeRoot:e.worktreeRoot??e.cwd})),Hr=s.z.object({cwd:s.z.string(),isGit:s.z.literal(!0),currentBranch:s.z.string().nullable(),remoteUrl:s.z.string().nullable(),worktreeRoot:s.z.string().optional(),isPaseoOwnedWorktree:s.z.literal(!0),mainRepoRoot:s.z.string()}).transform(e=>Object.assign({},e,{worktreeRoot:e.worktreeRoot??e.cwd})),Kr=s.z.union([Gr,Br,Hr]),Vr=s.z.object({projectKey:s.z.string(),projectName:s.z.string(),workspaceName:s.z.string().nullable().optional(),checkout:Kr}),Qr=s.z.enum(["running","stopped"]),Xr=s.z.enum(["healthy","unhealthy"]),Jr=s.z.object({scriptName:s.z.string(),type:s.z.enum(["script","service"]).optional().default("service"),hostname:s.z.string(),port:s.z.number().int().positive().nullable(),localProxyUrl:s.z.string().nullable().optional(),publicProxyUrl:s.z.string().nullable().optional(),proxyUrl:s.z.string().nullable().optional().default(null),lifecycle:Qr,health:Xr.nullable(),exitCode:s.z.number().nullable().optional().default(null),terminalId:s.z.string().nullable().optional().default(null)}),Yr=s.z.object({currentBranch:s.z.string().nullable().optional(),remoteUrl:s.z.string().nullable().optional(),isPaseoOwnedWorktree:s.z.boolean().optional(),isDirty:s.z.boolean().nullable().optional(),aheadBehind:s.z.object({ahead:s.z.number(),behind:s.z.number()}).nullable().optional(),aheadOfOrigin:s.z.number().nullable().optional(),behindOfOrigin:s.z.number().nullable().optional()}).optional().nullable(),Zr=s.z.object({featuresEnabled:s.z.boolean().optional(),pullRequest:s.z.object({number:s.z.number().optional(),url:s.z.string(),title:s.z.string(),state:s.z.string(),baseRefName:s.z.string(),headRefName:s.z.string(),isMerged:s.z.boolean(),isDraft:s.z.boolean().optional(),mergeable:s.z.enum(["MERGEABLE","CONFLICTING","UNKNOWN"]).catch("UNKNOWN").optional(),checks:s.z.array(s.z.object({name:s.z.string(),status:s.z.enum(["success","failure","pending","skipped","cancelled"]),url:s.z.string().nullable(),workflow:s.z.string().optional(),duration:s.z.string().optional()})).optional(),checksStatus:s.z.enum(["none","pending","success","failure"]).optional(),reviewDecision:s.z.enum(["approved","changes_requested","pending"]).nullable().optional(),repoOwner:s.z.string().optional(),repoName:s.z.string().optional(),github:s.z.unknown().optional()}).nullable().optional(),error:s.z.object({message:s.z.string()}).nullable().optional(),refreshedAt:s.z.string().nullable().optional()}).optional().nullable(),$r=s.z.object({id:s.z.string(),projectId:s.z.string(),projectDisplayName:s.z.string(),projectCustomName:s.z.string().nullable().optional(),projectRootPath:s.z.string(),workspaceDirectory:s.z.string().optional(),projectKind:s.z.enum(["git","non_git","directory"]),workspaceKind:s.z.enum(["directory","local_checkout","checkout","worktree"]),name:s.z.string(),title:s.z.string().nullable().optional(),archivingAt:s.z.string().nullable().optional().default(null),status:De,statusEnteredAt:s.z.string().nullish().transform(e=>e??null),activityAt:s.z.string().nullable(),diffStat:s.z.object({additions:s.z.number(),deletions:s.z.number()}).nullable().optional(),scripts:s.z.array(Jr).default([]),gitRuntime:Yr,githubRuntime:Zr,project:Vr.optional()}).transform(e=>Object.assign({},e,{workspaceDirectory:e.workspaceDirectory??e.projectRootPath})),eo=s.z.object({type:s.z.literal("agent_update"),payload:s.z.discriminatedUnion("kind",[s.z.object({kind:s.z.literal("upsert"),agent:ue,project:Vr.nullable().optional()}),s.z.object({kind:s.z.literal("remove"),agentId:s.z.string()})])}),to=s.z.object({type:s.z.literal("agent_stream"),payload:s.z.object({agentId:s.z.string(),event:se,timestamp:s.z.string(),seq:s.z.number().int().nonnegative().optional(),epoch:s.z.string().optional()})}),no=s.z.object({type:s.z.literal("agent_status"),payload:s.z.object({agentId:s.z.string(),status:s.z.string(),info:ue})}),ro=s.z.object({type:s.z.literal("agent_list"),payload:s.z.object({agents:s.z.array(ue)})}),oo=s.z.object({agent:ue,project:Vr}),ao=s.z.object({nextCursor:s.z.string().nullable(),prevCursor:s.z.string().nullable(),hasMore:s.z.boolean()}),io=s.z.object({type:s.z.literal("fetch_agents_response"),payload:s.z.object({requestId:s.z.string(),subscriptionId:s.z.string().nullable().optional(),entries:s.z.array(oo),pageInfo:ao})}),so=s.z.object({type:s.z.literal("fetch_agent_history_response"),payload:s.z.object({requestId:s.z.string(),entries:s.z.array(oo),pageInfo:ao})}),lo=s.z.object({type:s.z.literal("fetch_recent_provider_sessions_response"),payload:s.z.object({requestId:s.z.string(),entries:s.z.array(pe),filteredAlreadyImportedCount:s.z.number().int().nonnegative().optional()})}),co=s.z.object({projectId:s.z.string(),projectDisplayName:s.z.string(),projectCustomName:s.z.string().nullable().optional(),projectRootPath:s.z.string(),projectKind:s.z.enum(["git","non_git","directory"])}),uo=s.z.object({type:s.z.literal("fetch_workspaces_response"),payload:s.z.object({requestId:s.z.string(),subscriptionId:s.z.string().nullable().optional(),entries:s.z.array($r),emptyProjects:s.z.array(co).optional().default([]),pageInfo:s.z.object({nextCursor:s.z.string().nullable(),prevCursor:s.z.string().nullable(),hasMore:s.z.boolean()})})}),zo=s.z.object({type:s.z.literal("workspace_update"),payload:s.z.discriminatedUnion("kind",[s.z.object({kind:s.z.literal("upsert"),workspace:$r}),s.z.object({kind:s.z.literal("remove"),id:s.z.string(),emptyProject:co.optional(),removedProjectId:s.z.string().optional()})])}),po=s.z.object({type:s.z.literal("script_status_update"),payload:s.z.object({workspaceId:s.z.string(),scripts:s.z.array(Jr)})}),go=s.z.object({type:s.z.literal("workspace_setup_progress"),payload:s.z.object({workspaceId:s.z.string(),status:s.z.enum(["running","completed","failed"]),detail:Z,error:s.z.string().nullable()})}),bo=s.z.object({status:s.z.enum(["running","completed","failed"]),detail:Z,error:s.z.string().nullable()}),mo=s.z.object({type:s.z.literal("workspace_setup_status_response"),payload:s.z.object({requestId:s.z.string(),workspaceId:s.z.string(),snapshot:bo.nullable()})}),fo=s.z.object({type:s.z.literal("open_project_response"),payload:s.z.object({requestId:s.z.string(),workspace:$r.nullable(),error:s.z.string().nullable(),errorCode:s.z.enum(["directory_not_found"]).nullish().catch(null)})}),yo=s.z.object({type:s.z.literal("project.add.response"),payload:s.z.object({requestId:s.z.string(),project:co.nullable(),error:s.z.string().nullable(),errorCode:s.z.enum(["directory_not_found"]).nullish().catch(null)})}),ho=s.z.object({type:s.z.literal("start_workspace_script_response"),payload:s.z.object({requestId:s.z.string(),workspaceId:s.z.string(),scriptName:s.z.string(),terminalId:s.z.string().nullable(),error:s.z.string().nullable()})}),jo=s.z.object({type:s.z.literal("list_available_editors_response"),payload:s.z.object({requestId:s.z.string(),editors:s.z.array(s.z.object({id:s.z.string().trim().min(1),label:s.z.string()})),error:s.z.string().nullable()})}),So=s.z.object({type:s.z.literal("open_in_editor_response"),payload:s.z.object({requestId:s.z.string(),error:s.z.string().nullable()})}),Po=s.z.object({type:s.z.literal("archive_workspace_response"),payload:s.z.object({requestId:s.z.string(),workspaceId:s.z.string(),archivedAt:s.z.string().nullable(),error:s.z.string().nullable()})}),_o=s.z.object({type:s.z.literal("fetch_agent_response"),payload:s.z.object({requestId:s.z.string(),agent:ue.nullable(),project:Vr.nullable().optional(),error:s.z.string().nullable()})}),qo=s.z.object({startSeq:s.z.number().int().nonnegative(),endSeq:s.z.number().int().nonnegative()}),Io=s.z.object({provider:p.AgentProviderSchema,item:ie,timestamp:s.z.string(),seqStart:s.z.number().int().nonnegative(),seqEnd:s.z.number().int().nonnegative(),sourceSeqRanges:s.z.array(qo),collapsed:s.z.array(s.z.enum(["assistant_merge","reasoning_merge","tool_lifecycle"]))}),Oo=s.z.object({type:s.z.literal("fetch_agent_timeline_response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string(),agent:ue.nullable(),direction:s.z.enum(["tail","before","after"]),projection:s.z.enum(["projected","canonical"]),epoch:s.z.string(),reset:s.z.boolean(),staleCursor:s.z.boolean(),gap:s.z.boolean(),window:s.z.object({minSeq:s.z.number().int().nonnegative(),maxSeq:s.z.number().int().nonnegative(),nextSeq:s.z.number().int().nonnegative()}),startCursor:ht.nullable(),endCursor:ht.nullable(),hasOlder:s.z.boolean(),hasNewer:s.z.boolean(),entries:s.z.array(Io),error:s.z.string().nullable()})}),Ro=s.z.object({type:s.z.literal("agent.fork_context.response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string(),attachment:ke.nullable(),itemCount:s.z.number().int().nonnegative(),boundaryMessageId:s.z.string().nullable(),error:s.z.string().nullable()})}),ko=s.z.object({type:s.z.literal("cancel_agent_response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string(),agent:ue.nullable()})}),vo=s.z.object({type:s.z.literal("clear_agent_attention_response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string().or(s.z.array(s.z.string())),agents:s.z.array(ue)})}),wo=s.z.object({type:s.z.literal("workspace.create.response"),payload:s.z.object({workspace:$r.nullable(),setupTerminalId:s.z.string().nullable(),error:s.z.string().nullable(),errorCode:s.z.string().optional(),requestId:s.z.string()})}),Ao=s.z.object({type:s.z.literal("workspace.clear_attention.response"),payload:s.z.object({requestId:s.z.string(),workspaceId:s.z.union([s.z.string(),s.z.array(s.z.string())]),clearedAgentIds:s.z.array(s.z.string()),results:s.z.array(s.z.object({workspaceId:s.z.string(),clearedAgentIds:s.z.array(s.z.string()),success:s.z.boolean(),error:s.z.string().nullable()})),success:s.z.boolean(),error:s.z.string().nullable()})}),Mo=s.z.object({type:s.z.literal("send_agent_message_response"),payload:s.z.object({requestId:s.z.string(),agentId:s.z.string(),accepted:s.z.boolean(),error:s.z.string().nullable()})}),Co=s.z.object({type:s.z.literal("wait_for_finish_response"),payload:s.z.object({requestId:s.z.string(),status:s.z.enum(["idle","error","permission","timeout"]),final:ue.nullable(),error:s.z.string().nullable(),lastMessage:s.z.string().nullable()})}),To=s.z.object({type:s.z.literal("get_daemon_config_response"),payload:s.z.object({requestId:s.z.string(),config:O}).passthrough()}),Lo=s.z.object({type:s.z.literal("daemon.get_status.response"),payload:s.z.object({requestId:s.z.string(),serverId:s.z.string(),version:s.z.string().nullable().optional(),pid:s.z.number(),nodePath:s.z.string(),startedAt:s.z.string().nullable().optional(),listen:s.z.string().nullable(),relay:s.z.object({enabled:s.z.boolean(),endpoint:s.z.string(),publicEndpoint:s.z.string(),useTls:s.z.boolean(),publicUseTls:s.z.boolean()}).nullable().optional(),providers:s.z.array(s.z.object({provider:s.z.string(),available:s.z.boolean(),error:s.z.string().nullable().optional()}))}).passthrough()}),xo=s.z.object({type:s.z.literal("daemon.get_pairing_offer.response"),payload:s.z.object({requestId:s.z.string(),url:s.z.string(),qr:s.z.string().nullable().optional(),relayEnabled:s.z.boolean()}).passthrough()}),No=s.z.object({type:s.z.literal("diagnostics.response"),payload:s.z.object({requestId:s.z.string(),diagnostic:s.z.string()}).passthrough()}),Do=s.z.object({type:s.z.literal("set_daemon_config_response"),payload:s.z.object({requestId:s.z.string(),config:O}).passthrough()}),Uo=s.z.object({type:s.z.literal("read_project_config_response"),payload:s.z.discriminatedUnion("ok",[s.z.object({requestId:s.z.string(),repoRoot:s.z.string(),ok:s.z.literal(!0),config:j.PaseoConfigRawSchema.nullable(),revision:j.PaseoConfigRevisionSchema.nullable()}),s.z.object({requestId:s.z.string(),repoRoot:s.z.string(),ok:s.z.literal(!1),error:j.ProjectConfigRpcErrorSchema})])}),Wo=s.z.object({type:s.z.literal("write_project_config_response"),payload:s.z.discriminatedUnion("ok",[s.z.object({requestId:s.z.string(),repoRoot:s.z.string(),ok:s.z.literal(!0),config:j.PaseoConfigRawSchema,revision:j.PaseoConfigRevisionSchema}),s.z.object({requestId:s.z.string(),repoRoot:s.z.string(),ok:s.z.literal(!1),error:j.ProjectConfigRpcErrorSchema})])}),Eo=s.z.object({type:s.z.literal("agent_permission_request"),payload:s.z.object({agentId:s.z.string(),request:Q})}),Fo=s.z.object({type:s.z.literal("agent_permission_resolved"),payload:s.z.object({agentId:s.z.string(),requestId:s.z.string(),resolution:V})}),Go=s.z.object({type:s.z.literal("agent_deleted"),payload:s.z.object({agentId:s.z.string(),requestId:s.z.string()})}),Bo=s.z.object({type:s.z.literal("agent_archived"),payload:s.z.object({agentId:s.z.string(),archivedAt:s.z.string(),requestId:s.z.string()})}),Ho=s.z.object({agentId:s.z.string(),archivedAt:s.z.string()}),Ko=s.z.object({terminalId:s.z.string(),success:s.z.boolean()}),Vo=s.z.object({type:s.z.literal("close_items_response"),payload:s.z.object({agents:s.z.array(Ho),terminals:s.z.array(Ko),requestId:s.z.string()})}),Qo=s.z.object({ahead:s.z.number(),behind:s.z.number()}),Xo=s.z.object({cwd:s.z.string(),error:Kt.nullable(),requestId:s.z.string()}),Jo=Xo.extend({isGit:s.z.literal(!1),isPaseoOwnedWorktree:s.z.literal(!1),repoRoot:s.z.null(),currentBranch:s.z.null(),isDirty:s.z.null(),baseRef:s.z.null(),aheadBehind:s.z.null(),aheadOfOrigin:s.z.null(),behindOfOrigin:s.z.null(),hasRemote:s.z.boolean(),remoteUrl:s.z.null()}),Yo=Xo.extend({isGit:s.z.literal(!0),isPaseoOwnedWorktree:s.z.literal(!1),repoRoot:s.z.string(),mainRepoRoot:s.z.string().nullable().optional().default(null),currentBranch:s.z.string().nullable(),isDirty:s.z.boolean(),baseRef:s.z.string().nullable(),aheadBehind:Qo.nullable(),aheadOfOrigin:s.z.number().nullable(),behindOfOrigin:s.z.number().nullable(),hasRemote:s.z.boolean(),remoteUrl:s.z.string().nullable()}),Zo=Xo.extend({isGit:s.z.literal(!0),isPaseoOwnedWorktree:s.z.literal(!0),repoRoot:s.z.string(),mainRepoRoot:s.z.string(),currentBranch:s.z.string().nullable(),isDirty:s.z.boolean(),baseRef:s.z.string(),aheadBehind:Qo.nullable(),aheadOfOrigin:s.z.number().nullable(),behindOfOrigin:s.z.number().nullable(),hasRemote:s.z.boolean(),remoteUrl:s.z.string().nullable()}),$o=s.z.object({type:s.z.literal("checkout_status_response"),payload:s.z.union([Jo,Yo,Zo])}),ea=s.z.object({enabledAt:s.z.string().nullable().optional().default(null),mergeMethod:s.z.string().nullable().optional().default(null),enabledBy:s.z.string().nullable().optional().default(null)}).nullable().optional().default(null),ta=s.z.object({autoMergeAllowed:s.z.boolean().optional().default(!1),mergeCommitAllowed:s.z.boolean().optional().default(!1),squashMergeAllowed:s.z.boolean().optional().default(!1),rebaseMergeAllowed:s.z.boolean().optional().default(!1),viewerDefaultMergeMethod:s.z.string().nullable().optional().default(null)}).optional().default({autoMergeAllowed:!1,mergeCommitAllowed:!1,squashMergeAllowed:!1,rebaseMergeAllowed:!1,viewerDefaultMergeMethod:null}),na=s.z.object({mergeStateStatus:s.z.string().nullable().optional().default(null),autoMergeRequest:ea,viewerCanEnableAutoMerge:s.z.boolean().optional().default(!1),viewerCanDisableAutoMerge:s.z.boolean().optional().default(!1),viewerCanMergeAsAdmin:s.z.boolean().optional().default(!1),viewerCanUpdateBranch:s.z.boolean().optional().default(!1),repository:ta,isMergeQueueEnabled:s.z.boolean().optional().default(!1),isInMergeQueue:s.z.boolean().optional().default(!1)}).optional(),ra=s.z.object({number:s.z.number().optional(),url:s.z.string(),title:s.z.string(),state:s.z.string(),baseRefName:s.z.string(),headRefName:s.z.string(),isMerged:s.z.boolean(),isDraft:s.z.boolean().optional().default(!1),mergeable:s.z.enum(["MERGEABLE","CONFLICTING","UNKNOWN"]).catch("UNKNOWN").optional().default("UNKNOWN"),checks:s.z.array(s.z.object({name:s.z.string(),status:s.z.string(),url:s.z.string().nullable(),workflow:s.z.string().optional(),duration:s.z.string().optional(),checkRunId:s.z.number().optional(),workflowRunId:s.z.number().optional()})).optional().default([]),checksStatus:s.z.string().optional(),reviewDecision:s.z.string().nullable().optional(),repoOwner:s.z.string().optional(),repoName:s.z.string().optional(),github:na}),oa=s.z.object({cwd:s.z.string(),status:ra.nullable(),githubFeaturesEnabled:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()}),aa=s.z.object({prStatus:oa.optional()}),ia=s.z.object({type:s.z.literal("checkout_status_update"),payload:s.z.union([Jo,Yo,Zo]).and(aa)}),sa=s.z.object({subscriptionId:s.z.string(),cwd:s.z.string(),files:s.z.array(Nn),error:Kt.nullable()}),la=s.z.object({type:s.z.literal("subscribe_checkout_diff_response"),payload:sa.extend({requestId:s.z.string()})}),ca=s.z.object({type:s.z.literal("checkout_diff_update"),payload:sa}),ua=s.z.object({type:s.z.literal("checkout_commit_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),za=s.z.object({type:s.z.literal("checkout_merge_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),pa=s.z.object({type:s.z.literal("checkout_merge_from_base_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),ga=s.z.object({type:s.z.literal("checkout_pull_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),ba=s.z.object({type:s.z.literal("checkout_push_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),da=s.z.object({type:s.z.literal("checkout.refresh.response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),ma=s.z.object({type:s.z.literal("checkout_pr_create_response"),payload:s.z.object({cwd:s.z.string(),url:s.z.string().nullable(),number:s.z.number().nullable(),error:Kt.nullable(),requestId:s.z.string()})}),fa=s.z.object({type:s.z.literal("checkout_pr_merge_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),ya=s.z.object({type:s.z.literal("checkout.github.set_auto_merge.response"),payload:s.z.object({cwd:s.z.string(),enabled:s.z.boolean(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),ha=s.z.object({path:s.z.string().optional(),startLine:s.z.number().optional(),endLine:s.z.number().optional(),annotationLevel:s.z.string().optional(),message:s.z.string().optional(),title:s.z.string().optional(),rawDetails:s.z.string().optional()}),ja=s.z.object({jobId:s.z.number(),name:s.z.string(),status:s.z.string().nullable().optional(),conclusion:s.z.string().nullable().optional(),url:s.z.string().nullable().optional(),logTail:s.z.string().optional(),logTruncated:s.z.boolean().optional()}),Sa=s.z.object({checkRunId:s.z.number(),workflowRunId:s.z.number().nullable().optional(),name:s.z.string(),status:s.z.string().nullable().optional(),conclusion:s.z.string().nullable().optional(),url:s.z.string().nullable().optional(),detailsUrl:s.z.string().nullable().optional(),output:s.z.object({title:s.z.string().nullable().optional(),summary:s.z.string().nullable().optional(),text:s.z.string().nullable().optional()}).nullable().optional(),annotations:s.z.array(ha).optional().default([]),failedJobs:s.z.array(ja).optional().default([]),truncated:s.z.boolean().optional().default(!1)}),Pa=s.z.object({type:s.z.literal("checkout.github.get_check_details.response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),details:Sa.nullable().optional().default(null),error:Kt.nullable(),requestId:s.z.string()})}),_a=s.z.object({type:s.z.literal("checkout_pr_status_response"),payload:oa}),qa=s.z.discriminatedUnion("kind",[s.z.object({kind:s.z.literal("not_found"),message:s.z.string().optional().default("")}),s.z.object({kind:s.z.literal("forbidden"),message:s.z.string().optional().default("")}),s.z.object({kind:s.z.literal("unknown"),message:s.z.string().optional().default("")})]),Ia=s.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"})},qa),Oa=s.z.object({id:s.z.string().optional().default(""),kind:s.z.literal("review"),author:s.z.string().optional().default("unknown"),authorUrl:s.z.string().nullable().optional(),avatarUrl:s.z.string().nullable().optional(),body:s.z.string().optional().default(""),createdAt:s.z.number().optional().default(0),url:s.z.string().optional().default(""),reviewState:s.z.enum(["approved","changes_requested","commented"]).optional().default("commented")}),Ra=s.z.object({id:s.z.string().optional().default(""),kind:s.z.literal("comment"),author:s.z.string().optional().default("unknown"),authorUrl:s.z.string().nullable().optional(),avatarUrl:s.z.string().nullable().optional(),body:s.z.string().optional().default(""),createdAt:s.z.number().optional().default(0),url:s.z.string().optional().default(""),reviewId:s.z.string().optional(),location:s.z.object({path:s.z.string(),line:s.z.number().optional(),startLine:s.z.number().optional(),threadId:s.z.string().optional(),isResolved:s.z.boolean().optional(),isOutdated:s.z.boolean().optional()}).optional()}),ka=s.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"})},s.z.discriminatedUnion("kind",[Oa,Ra])),va=s.z.object({type:s.z.literal("pull_request_timeline_response"),payload:s.z.object({cwd:s.z.string().optional().default(""),prNumber:s.z.number().nullable().optional().default(null),items:s.z.array(ka).optional().default([]),truncated:s.z.boolean().optional().default(!1),error:Ia.nullable().optional().default(null),requestId:s.z.string().optional().default(""),githubFeaturesEnabled:s.z.boolean().optional().default(!0)}).optional().prefault({})}),wa=s.z.object({type:s.z.literal("checkout_switch_branch_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),branch:s.z.string(),source:s.z.enum(["local","remote"]).optional(),error:Kt.nullable(),requestId:s.z.string()})}),Aa=s.z.object({type:s.z.literal("checkout.rename_branch.response"),payload:s.z.object({requestId:s.z.string(),success:s.z.boolean(),cwd:s.z.string(),currentBranch:s.z.string().nullable(),error:Kt.nullable()})}),Ma=s.z.object({index:s.z.number().int().min(0),message:s.z.string(),branch:s.z.string().nullable(),isPaseo:s.z.boolean()}),Ca=s.z.object({type:s.z.literal("stash_save_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),Ta=s.z.object({type:s.z.literal("stash_pop_response"),payload:s.z.object({cwd:s.z.string(),success:s.z.boolean(),error:Kt.nullable(),requestId:s.z.string()})}),La=s.z.object({type:s.z.literal("stash_list_response"),payload:s.z.object({cwd:s.z.string(),entries:s.z.array(Ma),error:Kt.nullable(),requestId:s.z.string()})}),xa=s.z.object({type:s.z.literal("validate_branch_response"),payload:s.z.object({exists:s.z.boolean(),resolvedRef:s.z.string().nullable(),isRemote:s.z.boolean(),error:s.z.string().nullable(),requestId:s.z.string()})}),Na=s.z.object({type:s.z.literal("branch_suggestions_response"),payload:s.z.object({branches:s.z.array(s.z.string()),branchDetails:s.z.array(s.z.object({name:s.z.string(),committerDate:s.z.number(),hasLocal:s.z.boolean().optional(),hasRemote:s.z.boolean().optional()})).optional(),error:s.z.string().nullable(),requestId:s.z.string()})}),Da=s.z.object({type:s.z.literal("github_search_response"),payload:s.z.object({items:s.z.array(yn),githubFeaturesEnabled:s.z.boolean(),error:s.z.string().nullable(),requestId:s.z.string()})}),Ua=s.z.object({type:s.z.literal("directory_suggestions_response"),payload:s.z.object({directories:s.z.array(s.z.string()),entries:s.z.array(s.z.object({path:s.z.string(),kind:s.z.enum(["file","directory"])})).optional().default([]),error:s.z.string().nullable(),requestId:s.z.string()})}),Wa=s.z.object({worktreePath:s.z.string(),createdAt:s.z.string(),branchName:s.z.string().nullable().optional(),head:s.z.string().nullable().optional()}),Ea=s.z.object({type:s.z.literal("paseo_worktree_list_response"),payload:s.z.object({worktrees:s.z.array(Wa),error:Kt.nullable(),requestId:s.z.string()})}),Fa=s.z.object({type:s.z.literal("paseo_worktree_archive_response"),payload:s.z.object({success:s.z.boolean(),removedAgents:s.z.array(s.z.string()).optional(),error:Kt.nullable(),requestId:s.z.string()})}),Ga=s.z.object({type:s.z.literal("create_paseo_worktree_response"),payload:s.z.object({workspace:$r.nullable(),error:s.z.string().nullable(),errorCode:s.z.string().optional(),setupTerminalId:s.z.string().nullable(),requestId:s.z.string()})}),Ba=s.z.object({type:s.z.literal("file_explorer_response"),payload:s.z.object({cwd:s.z.string(),path:s.z.string(),mode:s.z.enum(["list","file"]),directory:Wn.nullable(),file:Un.nullable(),error:s.z.string().nullable(),requestId:s.z.string()})}),Ha=s.z.object({data:s.z.string(),mimeType:s.z.string()}),Ka=s.z.object({type:s.z.literal("project_icon_response"),payload:s.z.object({cwd:s.z.string(),icon:Ha.nullable(),error:s.z.string().nullable(),requestId:s.z.string()})}),Va=s.z.object({type:s.z.literal("file_download_token_response"),payload:s.z.object({cwd:s.z.string(),path:s.z.string(),token:s.z.string().nullable(),fileName:s.z.string().nullable(),mimeType:s.z.string().nullable(),size:s.z.number().nullable(),error:s.z.string().nullable(),requestId:s.z.string()})}),Qa=s.z.object({type:s.z.literal("file.upload.response"),payload:s.z.object({requestId:s.z.string(),file:Me.nullable(),error:s.z.string().nullable()})}),Xa=s.z.object({type:s.z.literal("list_provider_models_response"),payload:s.z.object({provider:p.AgentProviderSchema,models:s.z.array(x).optional(),error:s.z.string().nullable().optional(),fetchedAt:s.z.string(),requestId:s.z.string()})}),Ja=s.z.object({type:s.z.literal("list_provider_modes_response"),payload:s.z.object({provider:p.AgentProviderSchema,modes:s.z.array(v).optional(),error:s.z.string().nullable().optional(),fetchedAt:s.z.string(),requestId:s.z.string()})}),Ya=s.z.object({type:s.z.literal("list_provider_features_response"),payload:s.z.object({provider:p.AgentProviderSchema,features:s.z.array(L).optional(),error:s.z.string().nullable().optional(),fetchedAt:s.z.string(),requestId:s.z.string()})}),Za=s.z.object({provider:p.AgentProviderSchema,available:s.z.boolean(),error:s.z.string().nullable().optional()}),$a=s.z.object({type:s.z.literal("list_available_providers_response"),payload:s.z.object({providers:s.z.array(Za),error:s.z.string().nullable().optional(),fetchedAt:s.z.string(),requestId:s.z.string()})}),ei=s.z.object({type:s.z.literal("get_providers_snapshot_response"),payload:s.z.object({entries:s.z.array(N),generatedAt:s.z.string(),requestId:s.z.string()})}),ti=s.z.object({type:s.z.literal("providers_snapshot_update"),payload:s.z.object({cwd:s.z.string().optional(),entries:s.z.array(N),generatedAt:s.z.string()})}),ni=s.z.object({type:s.z.literal("refresh_providers_snapshot_response"),payload:s.z.object({requestId:s.z.string(),acknowledged:s.z.boolean()})}),ri=s.z.object({type:s.z.literal("provider_diagnostic_response"),payload:s.z.object({provider:p.AgentProviderSchema,diagnostic:s.z.string(),requestId:s.z.string()})}),oi=s.z.enum(["default","ok","warning","danger"]),ai=s.z.enum(["available","unavailable","error"]),ii=s.z.object({id:s.z.string(),label:s.z.string(),usedPct:s.z.number().nullable().optional(),remainingPct:s.z.number().nullable().optional(),resetsAt:s.z.string().nullable().optional(),runsOutAt:s.z.string().nullable().optional(),shortfallPct:s.z.number().nullable().optional(),tone:oi.optional()}),si=s.z.object({id:s.z.string(),label:s.z.string(),used:s.z.number().nullable().optional(),remaining:s.z.number().nullable().optional(),limit:s.z.number().nullable().optional(),unit:s.z.enum(["usd","credits","requests","tokens"]),resetsAt:s.z.string().nullable().optional(),tone:oi.optional()}),li=s.z.object({id:s.z.string(),label:s.z.string(),value:s.z.string(),tone:oi.optional()}),ci=s.z.object({providerId:s.z.string(),displayName:s.z.string(),status:ai,planLabel:s.z.string().nullable(),sourceLabel:s.z.string().nullable().optional(),fetchedAt:s.z.string().nullable().optional(),nextRefreshAt:s.z.string().nullable().optional(),windows:s.z.array(ii),balances:s.z.array(si).optional(),details:s.z.array(li).optional(),error:s.z.string().nullable().optional()}),ui=s.z.object({type:s.z.literal("provider.usage.list.response"),payload:s.z.object({requestId:s.z.string(),fetchedAt:s.z.string(),providers:s.z.array(ci)})}),zi=s.z.object({name:s.z.string(),description:s.z.string(),argumentHint:s.z.string(),kind:s.z.enum(["command","skill"]).optional().catch("command")}),pi=s.z.object({type:s.z.literal("list_commands_response"),payload:s.z.object({agentId:s.z.string(),commands:s.z.array(zi),error:s.z.string().nullable(),requestId:s.z.string()})}),gi=s.z.object({id:s.z.string(),name:s.z.string(),cwd:s.z.string(),workspaceId:s.z.string().optional(),title:s.z.string().optional(),activity:l.TerminalActivitySchema.nullable().optional()}),bi=s.z.object({char:s.z.string(),fg:s.z.number().optional(),bg:s.z.number().optional(),fgMode:s.z.number().optional(),bgMode:s.z.number().optional(),bold:s.z.boolean().optional(),italic:s.z.boolean().optional(),underline:s.z.boolean().optional(),dim:s.z.boolean().optional(),inverse:s.z.boolean().optional(),strikethrough:s.z.boolean().optional()}),di=s.z.enum(["block","underline","bar"]),mi=s.z.object({row:s.z.number(),col:s.z.number(),hidden:s.z.boolean().optional(),style:di.optional(),blink:s.z.boolean().optional()}),fi=s.z.object({rows:s.z.number(),cols:s.z.number(),grid:s.z.array(s.z.array(bi)),scrollback:s.z.array(s.z.array(bi)),cursor:mi,title:s.z.string().optional(),gridWrapped:s.z.array(s.z.boolean()).optional(),scrollbackWrapped:s.z.array(s.z.boolean()).optional()}),yi=s.z.object({type:s.z.literal("list_terminals_response"),payload:s.z.object({cwd:s.z.string().optional(),terminals:s.z.array(gi.omit({cwd:!0})),requestId:s.z.string()})}),hi=s.z.object({type:s.z.literal("terminals_changed"),payload:s.z.object({cwd:s.z.string(),terminals:s.z.array(gi.omit({cwd:!0}))})}),ji=s.z.object({type:s.z.literal("create_terminal_response"),payload:s.z.object({terminal:gi.nullable(),error:s.z.string().nullable(),requestId:s.z.string()})}),Si=s.z.object({type:s.z.literal("terminal.rename.response"),payload:s.z.object({requestId:s.z.string(),success:s.z.boolean(),error:s.z.string().nullable()})}),Pi=s.z.object({type:s.z.literal("subscribe_terminal_response"),payload:s.z.union([s.z.object({terminalId:s.z.string(),slot:s.z.number().int().min(0).max(255),error:s.z.null(),requestId:s.z.string()}),s.z.object({terminalId:s.z.string(),error:s.z.string(),requestId:s.z.string()})])}),_i=s.z.object({type:s.z.literal("kill_terminal_response"),payload:s.z.object({terminalId:s.z.string(),success:s.z.boolean(),requestId:s.z.string()})}),qi=s.z.object({type:s.z.literal("capture_terminal_response"),payload:s.z.object({terminalId:s.z.string(),lines:s.z.array(s.z.string()),totalLines:s.z.number().int().nonnegative(),requestId:s.z.string()})}),Ii=s.z.object({type:s.z.literal("terminal_stream_exit"),payload:s.z.object({terminalId:s.z.string()})}),Oi=s.z.object({type:s.z.literal("terminal_attention_required"),payload:s.z.object({serverId:s.z.string().optional(),terminalId:s.z.string(),cwd:s.z.string(),workspaceId:s.z.string().optional(),reason:s.z.enum(["finished","needs_input"]),title:s.z.string(),body:s.z.string(),shouldNotify:s.z.boolean()})}),Ri=s.z.object({type:s.z.literal("daemon.update.response"),payload:s.z.object({requestId:s.z.string(),success:s.z.boolean(),error:s.z.string().nullable(),previousVersion:s.z.string().nullable(),newVersion:s.z.string().nullable()})}),ki=s.z.object({type:s.z.literal("daemon.update.progress"),payload:s.z.object({requestId:s.z.string(),phase:s.z.enum(["starting","downloading","installing","complete"])})}),vi=s.z.discriminatedUnion("type",[pr,gr,br,dr,mr,fr,yr,hr,jr,Sr,vr,wr,Ar,Fr,eo,zo,po,go,mo,to,no,io,so,lo,uo,yo,fo,ho,jo,So,Po,_o,Oo,Ro,ko,vo,wo,Ao,Mo,Gt,Lo,xo,No,To,Do,Uo,Wo,qt,Ot,kt,wt,Mt,Lt,xt,Dt,Wt,Ft,Co,Eo,Fo,Go,Bo,Vo,$o,ia,la,ca,ua,za,pa,ga,ba,da,ma,fa,ya,Pa,_a,va,wa,Aa,Ca,Ta,La,xa,Na,Da,Ua,Ea,Fa,Ga,Ba,Ka,Va,Qa,Xa,Ja,Ya,$a,ei,ti,ni,ri,ui,pi,yi,hi,ji,Si,Pi,_i,qi,Ii,Oi,f.ChatCreateResponseSchema,f.ChatListResponseSchema,f.ChatInspectResponseSchema,f.ChatDeleteResponseSchema,f.ChatPostResponseSchema,f.ChatReadResponseSchema,f.ChatWaitResponseSchema,y.ScheduleCreateResponseSchema,y.ScheduleListResponseSchema,y.ScheduleInspectResponseSchema,y.ScheduleLogsResponseSchema,y.SchedulePauseResponseSchema,y.ScheduleResumeResponseSchema,y.ScheduleDeleteResponseSchema,y.ScheduleRunOnceResponseSchema,y.ScheduleUpdateResponseSchema,h.LoopRunResponseSchema,h.LoopListResponseSchema,h.LoopInspectResponseSchema,h.LoopLogsResponseSchema,h.LoopStopResponseSchema,ki,Ri]),wi=s.z.object({type:s.z.literal("ping")}),Ai=s.z.object({type:s.z.literal("pong")}),Mi=s.z.object({type:s.z.literal("hello"),clientId:s.z.string().min(1),clientType:s.z.enum(["mobile","browser","cli","mcp"]),protocolVersion:s.z.number().int(),appVersion:s.z.string().optional(),capabilities:s.z.object({voice:s.z.boolean().optional(),pushNotifications:s.z.boolean().optional(),[c.CLIENT_CAPS.reasoningMergeEnum]:s.z.boolean().optional(),[c.CLIENT_CAPS.customModeIcons]:s.z.boolean().optional(),[c.CLIENT_CAPS.terminalReflowableSnapshot]:s.z.boolean().optional()}).passthrough().optional()}),Ci=s.z.object({type:s.z.literal("recording_state"),isRecording:s.z.boolean()}),Ti=s.z.object({type:s.z.literal("session"),message:ur}),Li=s.z.object({type:s.z.literal("session"),message:vi}),xi=s.z.discriminatedUnion("type",[wi,Mi,Ci,Ti]),Ni=s.z.discriminatedUnion("type",[Ai,Li])},3361,[35,3267,3362,3360,3363,3364,3365,3366,3367,3369,3371,3372]);
15007
15007
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TERMINAL_ACTIVITY_STATES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"TERMINAL_ACTIVITY_ATTENTION_REASONS",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"TerminalActivitySchema",{enumerable:!0,get:function(){return o}}),e.deriveTerminalActivityStatusBucket=function(n){return n?"needs_input"===n.attentionReason?"needs_input":"finished"===n.attentionReason?"attention":"working"===n.state?"running":"attention"===n.state?"needs_input":null:null};var n=r(d[0]);const t=["idle","working","attention"],u=["finished","needs_input"],o=n.z.object({state:n.z.enum(t).catch("idle"),attentionReason:n.z.enum(u).nullable().optional().catch(null),changedAt:n.z.number()})},3362,[3267]);
15008
15008
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AGENT_LIFECYCLE_STATUSES",{enumerable:!0,get:function(){return n}});const n=["initializing","idle","running","error","closed"]},3363,[]);
15009
15009
  __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_EXPLICIT_AGENT_TITLE_CHARS",{enumerable:!0,get:function(){return t}});const t=200},3364,[]);
@@ -15038,7 +15038,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
15038
15038
  __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])},3393,[3373,3394]);
15039
15039
  __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}},3394,[3267]);
15040
15040
  __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}},3395,[1005,3396]);
15041
- __d(function(e,t,r,a,i,o,n){i.exports={name:"@getpaseo/app",version:"0.1.102",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","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",build:"npm run build:web","build:web":"npm --prefix ../.. run build:app-deps && expo export --platform web","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","build:terminal-webview":"node ./scripts/build-terminal-webview-html.mjs"},dependencies:{"@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@floating-ui/react-native":"^0.10.7","@getpaseo/client":"*","@getpaseo/expo-two-way-audio":"*","@getpaseo/highlight":"*","@getpaseo/protocol":"*","@gorhom/bottom-sheet":"^5.2.14","@gorhom/portal":"^1.0.14","@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","@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-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-splash-screen":"~31.0.10","expo-system-ui":"~6.0.7","expo-updates":"~29.0.12","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.19.2","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/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","@xterm/headless":"^6.1.0-beta.213",dotenv:"^17.2.3","eas-cli":"^16.24.1",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"}}},3396,[]);
15041
+ __d(function(e,t,r,a,i,o,n){i.exports={name:"@getpaseo/app",version:"0.1.103",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","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",build:"npm run build:web","build:web":"npm --prefix ../.. run build:app-deps && expo export --platform web","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","build:terminal-webview":"node ./scripts/build-terminal-webview-html.mjs"},dependencies:{"@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@floating-ui/react-native":"^0.10.7","@getpaseo/client":"*","@getpaseo/expo-two-way-audio":"*","@getpaseo/highlight":"*","@getpaseo/protocol":"*","@gorhom/bottom-sheet":"^5.2.14","@gorhom/portal":"^1.0.14","@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","@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-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-splash-screen":"~31.0.10","expo-system-ui":"~6.0.7","expo-updates":"~29.0.12","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.19.2","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/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","@xterm/headless":"^6.1.0-beta.213",dotenv:"^17.2.3","eas-cli":"^16.24.1",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"}}},3396,[]);
15042
15042
  __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}}},3397,[3398,3400]);
15043
15043
  __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()}},3398,[25,3399]);
15044
15044
  __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}},3399,[]);
@@ -85,6 +85,6 @@
85
85
  <body>
86
86
  <noscript>You need to enable JavaScript to run this app.</noscript>
87
87
  <div id="root"></div>
88
- <script src="/_expo/static/js/web/index-cf63ba3f4de4164d2d9c3738e1b791b2.js" defer></script>
88
+ <script src="/_expo/static/js/web/index-38f776f96c0218d2e5b053fc3a30e84a.js" defer></script>
89
89
  </body>
90
90
  </html>
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpaseo/server",
3
- "version": "0.1.102",
3
+ "version": "0.1.103",
4
4
  "description": "Paseo backend server",
5
5
  "files": [
6
6
  "dist/server",
@@ -65,10 +65,10 @@
65
65
  "@agentclientprotocol/sdk": "^0.17.1",
66
66
  "@anthropic-ai/claude-agent-sdk": "^0.3.195",
67
67
  "@anthropic-ai/sdk": "^0.104.2",
68
- "@getpaseo/client": "0.1.102",
69
- "@getpaseo/highlight": "0.1.102",
70
- "@getpaseo/protocol": "0.1.102",
71
- "@getpaseo/relay": "0.1.102",
68
+ "@getpaseo/client": "0.1.103",
69
+ "@getpaseo/highlight": "0.1.103",
70
+ "@getpaseo/protocol": "0.1.103",
71
+ "@getpaseo/relay": "0.1.103",
72
72
  "@isaacs/ttlcache": "^2.1.4",
73
73
  "@modelcontextprotocol/sdk": "^1.20.1",
74
74
  "@opencode-ai/sdk": "1.14.46",