@mduan/paseo-cli 0.11.0-fork.10 → 0.11.0-fork.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@getpaseo/client/package.json +3 -3
- package/node_modules/@getpaseo/highlight/package.json +1 -1
- package/node_modules/@getpaseo/plugin/package.json +3 -3
- package/node_modules/@getpaseo/protocol/package.json +1 -1
- package/node_modules/@getpaseo/relay/package.json +1 -1
- package/node_modules/@getpaseo/server/dist/server/builtin-plugins/package.json +1 -1
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-f0ef9fff94f5e464f2386f1179e92af8.js → index-07333e1dc746e9125c3a2c9191992ac5.js} +2 -2
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-f0ef9fff94f5e464f2386f1179e92af8.js.br → index-07333e1dc746e9125c3a2c9191992ac5.js.br} +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-f0ef9fff94f5e464f2386f1179e92af8.js.gz → index-07333e1dc746e9125c3a2c9191992ac5.js.gz} +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/index.html +1 -1
- package/node_modules/@getpaseo/server/dist/server/web-ui/index.html.br +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/index.html.gz +0 -0
- package/node_modules/@getpaseo/server/package.json +6 -6
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpaseo/client",
|
|
3
|
-
"version": "0.11.0-fork.
|
|
3
|
+
"version": "0.11.0-fork.11",
|
|
4
4
|
"description": "Paseo client SDK package",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"vitest": "^4.1.6"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@getpaseo/protocol": "0.11.0-fork.
|
|
48
|
-
"@getpaseo/relay": "0.11.0-fork.
|
|
47
|
+
"@getpaseo/protocol": "0.11.0-fork.11",
|
|
48
|
+
"@getpaseo/relay": "0.11.0-fork.11"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpaseo/plugin",
|
|
3
|
-
"version": "0.11.0-fork.
|
|
3
|
+
"version": "0.11.0-fork.11",
|
|
4
4
|
"description": "Paseo plugin SDK package",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"test": "vitest run"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@getpaseo/client": "0.11.0-fork.
|
|
70
|
-
"@getpaseo/protocol": "0.11.0-fork.
|
|
69
|
+
"@getpaseo/client": "0.11.0-fork.11",
|
|
70
|
+
"@getpaseo/protocol": "0.11.0-fork.11",
|
|
71
71
|
"@types/node": "^20.9.0",
|
|
72
72
|
"@types/react": "~19.2.0",
|
|
73
73
|
"react": "19.1.0",
|
|
@@ -15164,7 +15164,7 @@ __d(function(g,r,i,_a,m,e,d){'use strict';const t=r(d[0]);m.exports=(s,c,n)=>t(s
|
|
|
15164
15164
|
__d(function(g,r,i,_a,m,e,d){'use strict';const t=r(d[0]);m.exports=(s,c,n)=>t(s,c,n)<=0},3519,[3514]);
|
|
15165
15165
|
__d(function(g,r,i,a,m,e,d){'use strict';const t=r(d[0]);m.exports=(n,c,s)=>{try{c=new t(c,s)}catch(t){return!1}return c.test(n)}},3520,[3509]);
|
|
15166
15166
|
__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}},3521,[701,3522]);
|
|
15167
|
-
__d(function(e,t,r,o,i,a,n){i.exports={name:"@getpaseo/app",version:"0.11.0-fork.
|
|
15167
|
+
__d(function(e,t,r,o,i,a,n){i.exports={name:"@getpaseo/app",version:"0.11.0-fork.11",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 --clean --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 --clean --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=browser","test:e2e:diff-performance":"cross-env PASEO_DIFF_PERF_E2E=1 playwright test --project=browser e2e/browser/diff-performance.spec.ts","test:e2e:stream-smoothness":"cross-env PASEO_AGENT_STREAM_PERF_E2E=1 playwright test --project=browser e2e/browser/agent-stream-smoothness.spec.ts","test:e2e:real":"cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=real-provider","test:e2e:relay-deployment":"npm --prefix ../.. run build:server && npm --prefix ../.. run build:daemon-web-ui && cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=relay-deployment e2e/browser/relay-deployment-reconnect.real.spec.ts","test:e2e:ui":"playwright test --ui",build:"npm run build:web","build:web":"npm --prefix ../.. run build:app-deps && expo export --platform web","profile:composer-typing":"node ./scripts/profile-composer-typing.mjs","profile:explorer-toggle":"node ./scripts/profile-explorer-toggle.mjs","profile:side-pane":"playwright test --config playwright.profile.config.ts side-pane-performance.spec.ts","profile:workspace-switching":"node ./scripts/profile-workspace-switching.mjs","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","build:mermaid-runtime":"node ./src/components/markdown/fence/mermaid/build-runtime.mjs"},dependencies:{"@codemirror/commands":"6.10.4","@codemirror/language":"6.12.4","@codemirror/search":"6.7.1","@codemirror/state":"6.7.1","@codemirror/view":"6.43.6","@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/plugin":"*","@getpaseo/protocol":"*","@gorhom/bottom-sheet":"^5.2.14","@gorhom/portal":"^1.0.14","@marijn/find-cluster-break":"^1.0.2","@mattermost/react-native-paste-input":"2.0.1","@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","@replit/codemirror-vim":"6.3.0","@shopify/react-native-skia":"2.2.12","@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-sqlite":"~16.0.10","expo-system-ui":"~6.0.7","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",mermaid:"^11.16.0","mnemonic-id":"^3.2.7",qrcode:"^1.5.4",react:"19.1.0","react-dom":"19.1.0","react-freeze":"1.0.4","react-i18next":"^17.0.8","react-native":"0.81.5","react-native-draggable-flatlist":"^4.0.3","react-native-edge-to-edge":"^1.7.0","react-native-gesture-handler":"~2.28.0","react-native-keyboard-controller":"1.21.12","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",turndown:"^7.2.4","turndown-plugin-gfm":"^1.0.2","use-sync-external-store":"^1.6.0",yaml:"^2.8.4",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/node":"~22.19.0","@types/qrcode":"^1.5.6","@types/react":"~19.2.0","@types/turndown":"^5.0.6","@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",esbuild:"0.28.1",eslint:"^9.25.0","eslint-config-expo":"~10.0.0","expo-gradle-jvmargs":"^1.1.2","fake-indexeddb":"^6.2.5",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"},reanimated:{staticFeatureFlags:{FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS:!1}}}},3522,[]);
|
|
15168
15168
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createPluginClientRuntime=function(p){const I=(0,l.createPluginClientStateSource)(p.serverId),P=(0,o.createPluginCapabilities)(p,(0,s.createPluginNavigation)({serverId:p.serverId,workspaceId:null}));return Object.assign({},P,{hosts:(0,n.createPluginHosts)((0,t.getHostRuntimeStore)(),p.lifetime.signal),addComposerPill:t=>u.pluginButtonStore.addComposerPill(p,t),addHeaderButton:t=>u.pluginButtonStore.addHeaderButton(p,t),openPanel(t,n){c({installation:p,state:I,panelId:t,options:n})}})};var t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),s=r(d[4]),u=r(d[5]);function c(t){const{installation:n,state:l,panelId:u,options:c}=t,p=c.workspaceId.trim(),I=c.agentId?.trim(),P=(0,s.createPluginNavigation)({serverId:n.serverId,workspaceId:p}),v=I?(0,o.createPluginAgentActionContext)({plugin:n,navigation:P,state:l,workspaceId:p,agentId:I}):(0,o.createPluginWorkspaceActionContext)({plugin:n,navigation:P,state:l,workspaceId:p});if(!v)throw new Error("Plugin panel context is unavailable");v.openPanel(u,{location:c.location})}},3523,[3524,3643,3644,3655,3660,3671]);
|
|
15169
15169
|
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["password"];function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.isHostRuntimeConnected=Z,_e.isHostRuntimeDirectoryLoading=ee,Object.defineProperty(_e,"HostRuntimeController",{enumerable:!0,get:function(){return pe}}),_e.readInitialDaemonConnectionHint=ve,_e.hasConfiguredLocalDaemonOverride=function(){return null!==me()},Object.defineProperty(_e,"HostRuntimeStore",{enumerable:!0,get:function(){return He}}),_e.getHostRuntimeStore=Ee,_e.getHostRuntimeConnectionStatusSince=function(e){return Ee().getConnectionStatusSince(e)},_e.useHostRuntimeSnapshot=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ee(),t[0]=n):n=t[0];const c=n;let l,h,u;t[1]!==e?(l=t=>c.subscribe(e,t),h=()=>c.getSnapshot(e),u=()=>c.getSnapshot(e),t[1]=e,t[2]=l,t[3]=h,t[4]=u):(l=t[2],h=t[3],u=t[4]);return(0,o.useSyncExternalStore)(l,h,u)},_e.useHostRuntimeClient=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ee(),t[0]=n):n=t[0];const c=n;let l,h,u;t[1]!==e?(l=t=>c.subscribe(e,t),h=()=>c.getSnapshot(e)?.client??null,u=()=>c.getSnapshot(e)?.client??null,t[1]=e,t[2]=l,t[3]=h,t[4]=u):(l=t[2],h=t[3],u=t[4]);return(0,o.useSyncExternalStore)(l,h,u)},_e.useHostRuntimeIsConnected=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ee(),t[0]=n):n=t[0];const c=n;let l,h,u;t[1]!==e?(l=t=>c.subscribe(e,t),h=()=>Z(c.getSnapshot(e)),u=()=>Z(c.getSnapshot(e)),t[1]=e,t[2]=l,t[3]=h,t[4]=u):(l=t[2],h=t[3],u=t[4]);return(0,o.useSyncExternalStore)(l,h,u)},_e.useHostRuntimeConnectionStatus=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ee(),t[0]=n):n=t[0];const c=n;let l,h,u;t[1]!==e?(l=t=>c.subscribe(e,t),h=()=>c.getSnapshot(e)?.connectionStatus??"connecting",u=()=>c.getSnapshot(e)?.connectionStatus??"connecting",t[1]=e,t[2]=l,t[3]=h,t[4]=u):(l=t[2],h=t[3],u=t[4]);return(0,o.useSyncExternalStore)(l,h,u)},_e.useHostRuntimeConnectionStatuses=function(e){const t=(0,s.c)(7);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ee(),t[0]=n):n=t[0];const c=n;let l;t[1]!==e?(l=()=>e.map(e=>c.getSnapshot(e)?.connectionStatus??"connecting").join("\n"),t[1]=e,t[2]=l):l=t[2];const h=l;let u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=e=>c.subscribeAll(e),t[3]=u):u=t[3];const p=(0,o.useSyncExternalStore)(u,h,h);let y;if(t[4]!==e||t[5]!==p){const n=p.split("\n");y=new Map(e.map((e,t)=>[e,n[t]])),t[4]=e,t[5]=p,t[6]=y}else y=t[6];return y},_e.useHostRuntimeLastError=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ee(),t[0]=n):n=t[0];const c=n;let l,h,u;t[1]!==e?(l=t=>c.subscribe(e,t),h=()=>c.getSnapshot(e)?.lastError??null,u=()=>c.getSnapshot(e)?.lastError??null,t[1]=e,t[2]=l,t[3]=h,t[4]=u):(l=t[2],h=t[3],u=t[4]);return(0,o.useSyncExternalStore)(l,h,u)},_e.useHostRuntimeAgentDirectoryStatus=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ee(),t[0]=n):n=t[0];const c=n;let l,h,u;t[1]!==e?(l=t=>c.subscribe(e,t),h=()=>c.getSnapshot(e)?.agentDirectoryStatus??"idle",u=()=>c.getSnapshot(e)?.agentDirectoryStatus??"idle",t[1]=e,t[2]=l,t[3]=h,t[4]=u):(l=t[2],h=t[3],u=t[4]);return(0,o.useSyncExternalStore)(l,h,u)},_e.useHostRuntimeIsDirectoryLoading=function(e){const t=(0,s.c)(5);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=Ee(),t[0]=n):n=t[0];const c=n;let l,h,u;t[1]!==e?(l=t=>c.subscribe(e,t),h=()=>ee(c.getSnapshot(e)),u=()=>ee(c.getSnapshot(e)),t[1]=e,t[2]=l,t[3]=h,t[4]=u):(l=t[2],h=t[3],u=t[4]);return(0,o.useSyncExternalStore)(l,h,u)},_e.useHosts=function(){const e=(0,s.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Ee(),e[0]=t):t=e[0];const n=t;let c,l,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=e=>n.subscribeHostList(e),l=()=>n.getHosts(),h=()=>n.getHosts(),e[1]=c,e[2]=l,e[3]=h):(c=e[1],l=e[2],h=e[3]);return(0,o.useSyncExternalStore)(c,l,h)},_e.useHostRegistryStatus=function(){const e=(0,s.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Ee(),e[0]=t):t=e[0];const n=t;let c,l,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=e=>n.subscribeHostList(e),l=()=>n.getHostRegistryStatus(),h=()=>n.getHostRegistryStatus(),e[1]=c,e[2]=l,e[3]=h):(c=e[1],l=e[2],h=e[3]);return(0,o.useSyncExternalStore)(c,l,h)},_e.useHostRegistryLoaded=function(){const e=(0,s.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Ee(),e[0]=t):t=e[0];const n=t;let c,l,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=e=>n.subscribeHostList(e),l=()=>n.isHostRegistryLoaded(),h=()=>n.isHostRegistryLoaded(),e[1]=c,e[2]=l,e[3]=h):(c=e[1],l=e[2],h=e[3]);return(0,o.useSyncExternalStore)(c,l,h)},_e.useHostConfirmation=function(){const e=(0,s.c)(9);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Ee(),e[0]=t):t=e[0];const n=t;let c,l,h;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=e=>n.subscribeHostConfirmation(e),l=()=>n.getPendingHostConfirmation(),h=()=>n.getPendingHostConfirmation(),e[1]=c,e[2]=l,e[3]=h):(c=e[1],l=e[2],h=e[3]);const u=(0,o.useSyncExternalStore)(c,l,h);let p,y;e[4]!==u?(p=e=>{u&&n.answerHostConfirmation(u.id,e)},e[4]=u,e[5]=p):p=e[5];e[6]!==u||e[7]!==p?(y={pending:u,answer:p},e[6]=u,e[7]=p,e[8]=y):y=e[8];return y},_e.useHostMutations=function(){const e=(0,s.c)(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=Ee(),e[0]=t):t=e[0];const n=t;let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={upsertDirectConnection:e=>n.upsertDirectConnection(e),probeAndUpsertDirectConnection:e=>n.probeAndUpsertDirectConnection(e),probeAndUpsertRemoteSshConnection:e=>n.probeAndUpsertRemoteSshConnection(e),beginLinkPairing:()=>n.beginLinkPairing(),renameHost:(e,t)=>n.renameHost(e,t),setHostColor:(e,t)=>n.setHostColor(e,t),setHostBadgeDisplay:(e,t)=>n.setHostBadgeDisplay(e,t),removeHost:e=>n.removeHost(e),removeConnection:(e,t)=>n.removeConnection(e,t)},e[1]=o):o=e[1];return o};var n=t(r(d[0])),s=r(d[1]),o=r(d[2]),c=t(r(d[3])),l=t(r(d[4])),h=r(d[5]),u=r(d[6]),p=r(d[7]),y=r(d[8]),S=r(d[9]),f=r(d[10]),C=r(d[11]),v=r(d[12]),b=r(d[13]),w=r(d[14]),I=r(d[15]),A=r(d[16]),H=r(d[17]),R=r(d[18]),D=r(d[19]),E=r(d[20]),P=r(d[21]),L=r(d[22]),O=r(d[23]),_=r(d[24]),M=r(d[25]),k=r(d[26]),T=r(d[27]),B=r(d[28]),F=r(d[29]),j=r(d[30]),q=r(d[31]),x=r(d[32]),U=r(d[33]),V=r(d[34]),W=r(d[35]),N=r(d[36]),$=r(d[37]),G=r(d[38]),z=r(d[39]),Q=r(d[40]),K=r(d[41]),J=r(d[42]),X=r(d[43]);function Y(e,t,n){e[t]=n}function Z(e){return"online"===e?.connectionStatus}function ee(e){return!e||("initial_loading"===e.agentDirectoryStatus||"revalidating"===e.agentDirectoryStatus||!e.hasEverLoadedAgentDirectory&&("connecting"===e.connectionStatus||"online"===e.connectionStatus))}function te(e){return e instanceof Error?e.message:String(e)}function ne(e){let t=0;for(let n=0;n<e.length;n+=1)t=31*t+e.charCodeAt(n)|0;return`h_${Math.abs(t).toString(16)}`}function se(e){return"directSocket"===e.type?{type:"directSocket",endpoint:e.path,display:"socket"}:"directPipe"===e.type?{type:"directPipe",endpoint:e.path,display:"pipe"}:"remoteSsh"===e.type?{type:"remoteSsh",endpoint:e.host,display:e.host}:"directTcp"===e.type?{type:"directTcp",endpoint:e.endpoint,display:e.endpoint}:{type:"relay",endpoint:e.relayEndpoint,display:"relay"}}function ie(e){return"connecting"===e.tag||"online"===e.tag||"offline"===e.tag||"error"===e.tag?{id:e.activeConnectionId,connection:e.activeConnection}:{id:null,connection:null}}function oe(e,t,n){const s=n.state.status;return"connected"===s?{tag:"online",activeConnectionId:e,activeConnection:t,lastOnlineAt:(new Date).toISOString()}:"connecting"===s||"idle"===s?{tag:"connecting",activeConnectionId:e,activeConnection:t}:"disposed"===s?{tag:"offline",activeConnectionId:e,activeConnection:t}:null}function re(e,t,n){const s=oe(e,t,n);if(s)return s;const o=("disconnected"===n.state.status?n.state.reason??null:null)??n.lastError??null;return o&&"client_closed"!==o?{tag:"error",activeConnectionId:e,activeConnection:t,message:o}:{tag:"offline",activeConnectionId:e,activeConnection:t}}function ce(e){const{state:t,event:n}=e;if("select_connection"===n.type)return{tag:"connecting",activeConnectionId:n.connectionId,activeConnection:n.connection};if("connect_failed"===n.type){const e=ie(t);return{tag:"error",activeConnectionId:e.id,activeConnection:e.connection,message:n.message}}if("no_connections"===n.type||"stopped"===n.type)return{tag:"offline",activeConnectionId:null,activeConnection:null};const s=ie(t);return s.id&&s.connection?re(s.id,s.connection,n):"booting"===t.tag?t:{tag:"offline",activeConnectionId:null,activeConnection:null}}function ae(e,t){return"booting"===e.tag?{activeConnectionId:null,activeConnection:null,connectionStatus:"connecting",lastError:null,lastOnlineAt:null,connectionEpoch:t}:"connecting"===e.tag?{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"connecting",lastError:null,lastOnlineAt:null,connectionEpoch:t}:"online"===e.tag?{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"online",lastError:null,lastOnlineAt:e.lastOnlineAt,connectionEpoch:t}:"offline"===e.tag?{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"offline",lastError:null,lastOnlineAt:null,connectionEpoch:t}:{activeConnectionId:e.activeConnectionId,activeConnection:e.activeConnection,connectionStatus:"error",lastError:e.message,lastOnlineAt:null,connectionEpoch:t}}function le(e){return e.connections.map(e=>({connectionId:e.id,connection:e}))}function he(e,t){return t?e.connections.find(e=>e.id===t)??null:null}function de(e,t,n,s){if(t)return 1e4;if(n)return 12e4;const o=s-e;return o<1e4?2e3:o<3e4?5e3:o<6e4?1e4:3e4}function ue(){const e="function"==typeof(0,E.getDesktopHost)()?.browser?.executeAutomationCommand?{[L.CLIENT_CAPS.browserHost]:{supportedCommands:[...O.BROWSER_AUTOMATION_COMMAND_NAMES],hostKind:"desktop app"}}:void 0,t=Object.assign({},e);return{createClient:({host:e,connection:n,clientId:s,runtimeGeneration:o})=>{const c=(0,D.createDesktopDaemonTransportFactory)(),l={webSocketFactory:(0,X.createAppWebSocketFactory)()},u=Object.assign({suppressSendErrors:!0,clientId:s,clientType:"mobile",appVersion:(0,S.resolveAppVersion)()??void 0,runtimeGeneration:o,capabilities:t,trace:K.nativePerformanceTrace,providerSnapshots:"wire"},e.password?{password:e.password}:{},{localCredential:()=>(0,P.readDesktopManagedLocalCredential)(n)});if("directSocket"===n.type||"directPipe"===n.type)return new h.DaemonClient(Object.assign({},u,c?{transportFactory:c}:{},{url:(0,D.buildDesktopDaemonTransportUrl)({transportType:"directSocket"===n.type?"socket":"pipe",transportPath:n.path})}));if("remoteSsh"===n.type){if(!c)throw new Error("Remote SSH is only available in the desktop app.");return new h.DaemonClient(Object.assign({},u,{transportFactory:c,url:(0,D.buildDesktopDaemonTransportUrl)(Object.assign({transportType:"ssh",host:n.host},void 0!==n.sshPort?{sshPort:n.sshPort}:{},void 0!==n.daemonPort?{daemonPort:n.daemonPort}:{}))}))}return"directTcp"===n.type?new h.DaemonClient(Object.assign({},u,l,{url:(0,y.buildDaemonWebSocketUrl)(n.endpoint,{useTls:n.useTls??!1})})):new h.DaemonClient(Object.assign({},u,l,{url:(0,y.buildRelayWebSocketUrl)({endpoint:n.relayEndpoint,useTls:n.useTls??(0,y.shouldUseTlsForDefaultHostedRelay)(n.relayEndpoint),serverId:e.serverId}),e2ee:{enabled:!0,daemonPublicKeyB64:n.daemonPublicKeyB64}}))},connectToDaemon:({host:e,connection:n,timeoutMs:s})=>(0,w.connectToDaemon)(n,Object.assign({},e.serverId?{serverId:e.serverId}:{},e.password?{password:e.password}:{},{localCredential:()=>(0,P.readDesktopManagedLocalCredential)(n)},void 0!==s?{timeoutMs:s}:{},{capabilities:t,trace:K.nativePerformanceTrace})),getClientId:()=>(0,I.getOrCreateClientId)(),mountClientHandlers:({client:t,host:n})=>{const s=(0,B.mountServerDataPushRouter)({client:t,queryClient:T.queryClient,serverId:n.serverId});if(!e)return s;const o=(0,F.mountBrowserAutomationDaemonClientHandler)(t,{serverId:n.serverId});return()=>{o(),s()}}}}class pe{connectionEpoch=0;listeners=new Set;activeClient=null;unsubscribeClientStatus=null;unsubscribeClientHandlers=null;probeIntervalHandle=null;started=!1;connectionFirstSeenAt=new Map;connectionLastProbedAt=new Map;switchCandidateConnectionId=null;switchCandidateHitCount=0;clientIdPromise=null;clientIdHash=null;switchRequestVersion=0;probeRequestVersion=0;probeCycleInFlight=null;authRejectedConnectionIds=new Set;constructor(e){this.host=e.host,this.deps=e.deps??ue(),this.onReconcileServerId=e.onReconcileServerId??null,this.connectionMachineState={tag:"booting"},this.snapshot=Object.assign({serverId:this.host.serverId},ae(this.connectionMachineState,this.connectionEpoch),{client:null,agentDirectoryStatus:"idle",agentDirectoryError:null,hasEverLoadedAgentDirectory:!1,probeByConnectionId:new Map,clientGeneration:0})}getSnapshot(){return this.snapshot}getClient(){return this.snapshot.client}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}async start(e){this.started||(this.started=!0,this.trackConnectionFirstSeen(),e?.initialConnection&&(await this.switchToConnection({connectionId:e.initialConnection.connectionId,existingClient:e.initialConnection.existingClient}),!this.started)||(await this.runProbeCycleNow(),this.started&&!1!==e?.autoProbe&&(this.probeIntervalHandle=setInterval(()=>{this.runProbeCycleNow()},2e3))))}async stop(){if(this.switchRequestVersion+=1,this.probeRequestVersion+=1,this.started=!1,this.probeIntervalHandle&&(clearInterval(this.probeIntervalHandle),this.probeIntervalHandle=null),this.unsubscribeClientStatus&&(this.unsubscribeClientStatus(),this.unsubscribeClientStatus=null),this.unsubscribeClientHandlers&&(this.unsubscribeClientHandlers(),this.unsubscribeClientHandlers=null),this.activeClient){const e=this.activeClient;this.activeClient=null,await e.close().catch(()=>{})}this.applyConnectionEvent({type:"stopped"}),this.updateSnapshot(Object.assign({},ae(this.connectionMachineState,this.connectionEpoch),{client:null}))}async updateHost(e){const t=this.host.password!==e.password;t&&(this.probeRequestVersion+=1,this.authRejectedConnectionIds.clear(),this.updateSnapshot({authFailureReason:null}));const n=this.snapshot.activeConnectionId,s=he(this.host,n);this.host=e,this.trackConnectionFirstSeen();const o=he(this.host,n);n&&s&&o&&(!(0,l.default)(s,o)||t)&&(this.connectionLastProbedAt.delete(n),await this.switchToConnection({connectionId:n})),t&&this.connectionLastProbedAt.clear(),t&&await this.probeCycleInFlight,await this.runProbeCycleNow()}ensureConnected(e){this.activeClient?.ensureConnected(e)}markAgentDirectorySyncLoading(){const e=this.snapshot.hasEverLoadedAgentDirectory?"revalidating":"initial_loading";this.updateSnapshot({agentDirectoryStatus:e,agentDirectoryError:null})}markAgentDirectorySyncReady(){this.updateSnapshot({agentDirectoryStatus:"ready",agentDirectoryError:null,hasEverLoadedAgentDirectory:!0})}markAgentDirectorySyncError(e){const t=this.snapshot.hasEverLoadedAgentDirectory;this.updateSnapshot({agentDirectoryStatus:t?"error_after_ready":"error_before_first_success",agentDirectoryError:e,hasEverLoadedAgentDirectory:t})}markAgentDirectorySyncIdle(){this.updateSnapshot({agentDirectoryStatus:this.snapshot.hasEverLoadedAgentDirectory?"ready":"idle",agentDirectoryError:null})}markStartupError(e){this.applyConnectionEvent({type:"connect_failed",message:e}),this.updateSnapshot(Object.assign({},ae(this.connectionMachineState,this.connectionEpoch)))}async activateConnection(e){await this.switchToConnection(e)}async runProbeCycleNow(){if(this.probeCycleInFlight)return this.probeCycleInFlight;const e=this.runProbeCycle().finally(()=>{this.probeCycleInFlight===e&&(this.probeCycleInFlight=null)});return this.probeCycleInFlight=e,e}async runProbeCycle(){const e=++this.probeRequestVersion;if(0===this.host.connections.length){if(!this.isCurrentProbeRequest(e))return;return this.applyConnectionEvent({type:"no_connections"}),void this.updateSnapshot(Object.assign({},ae(this.connectionMachineState,this.connectionEpoch),{probeByConnectionId:new Map}))}const t=performance.now(),n="online"===this.snapshot.connectionStatus,s=this.snapshot.activeConnectionId,o=n&&null!==s,c=this.host.connections.filter(e=>{if(this.authRejectedConnectionIds.has(e.id))return!1;const c=this.connectionLastProbedAt.get(e.id);if(null==c)return!0;const l=de(this.connectionFirstSeenAt.get(e.id)??t,n&&e.id===s,o,t);return t-c>=l});if(0===c.length)return;const l=new Map(this.snapshot.probeByConnectionId);for(const e of c){this.connectionLastProbedAt.set(e.id,performance.now());const t=l.get(e.id);n&&e.id===s&&"available"===t?.status||l.set(e.id,{status:"pending",latencyMs:null})}this.updateSnapshot({probeByConnectionId:new Map(l)});let u=c.length,p=null,y=null;const S=()=>{this.isCurrentProbeRequest(e)&&this.updateSnapshot({probeByConnectionId:new Map(l)})},f=async(t,n)=>{for(;!this.snapshot.activeConnectionId;){if(!y)return y=this.switchToConnection({connectionId:t,expectedProbeVersion:e,existingClient:n}).finally(()=>{y=null}),await y,this.snapshot.activeConnectionId===t;await y}return!1},C=async()=>{if(u>0||!this.isCurrentProbeRequest(e))return;const t=this.snapshot.activeConnectionId,n=t?l.get(t):null;if(!t||!he(this.host,t)){const t=(0,R.selectBestConnection)({candidates:le(this.host),probeByConnectionId:l});if(t)await this.switchToConnection({connectionId:t,expectedProbeVersion:e});else if(p){const e=new h.DaemonAuthenticationError(p).message;this.applyConnectionEvent({type:"connect_failed",message:e}),this.updateSnapshot(Object.assign({},ae(this.connectionMachineState,this.connectionEpoch),{authFailureReason:p}))}return}if(this.isConnectionUnavailable(t,n)){const n=(0,R.selectBestConnection)({candidates:le(this.host),probeByConnectionId:l});return n&&n!==t&&await this.switchToConnection({connectionId:n,expectedProbeVersion:e}),this.switchCandidateConnectionId=null,void(this.switchCandidateHitCount=0)}if(!n||"available"!==n.status)return;const s=Array.from(l.entries()).filter(e=>"available"===e[1].status).map(([e,t])=>({connectionId:e,latencyMs:t.latencyMs})).sort((e,t)=>e.latencyMs-t.latencyMs)[0]??null;if(!s||s.connectionId===t)return this.switchCandidateConnectionId=null,void(this.switchCandidateHitCount=0);if(n.latencyMs-s.latencyMs<40)return this.switchCandidateConnectionId=null,void(this.switchCandidateHitCount=0);this.switchCandidateConnectionId===s.connectionId?this.switchCandidateHitCount+=1:(this.switchCandidateConnectionId=s.connectionId,this.switchCandidateHitCount=1),this.switchCandidateHitCount>=3&&(this.switchCandidateConnectionId=null,this.switchCandidateHitCount=0,await this.switchToConnection({connectionId:s.connectionId,expectedProbeVersion:e}))};await new Promise(t=>{for(const n of c)(async()=>{let s=null,o=!1;try{const t=this.snapshot.activeConnectionId===n.id?this.snapshot.client:null;if(t)s=t;else{const{client:e,serverId:t}=await this.deps.connectToDaemon({host:this.host,connection:n});if(t!==this.host.serverId){if(!we(this.host.serverId)||!this.onReconcileServerId)throw await e.close().catch(()=>{}),new Error(`Connection resolved to ${t}, expected ${this.host.serverId}.`);this.onReconcileServerId(this.host.serverId,t)}s=e,o=!0}if(!this.isCurrentProbeRequest(e))return;const c=await f(n.id,s);if(o=o&&!c,t){const s=t.getLastLivenessRttMs();if(!this.isCurrentProbeRequest(e))return;return void(null!==s&&(l.set(n.id,{status:"available",latencyMs:s}),S()))}const h=await s.measureLatency({timeoutMs:5e3});if(!this.isCurrentProbeRequest(e))return;l.set(n.id,{status:"available",latencyMs:h}),S()}catch(t){if(this.isCurrentProbeRequest(e)){const e=(0,w.getConnectionAuthFailureReason)(t);e&&(this.authRejectedConnectionIds.add(n.id),p=e),l.set(n.id,{status:"unavailable",latencyMs:null}),S()}}finally{s&&o&&await s.close().catch(()=>{}),u-=1,C().finally(()=>{0===u&&t()})}})()})}isConnectionUnavailable(e,t){return"unavailable"===t?.status||this.authRejectedConnectionIds.has(e)}updateSnapshot(e){const t=Object.assign({},e);let n=this.host.serverId!==this.snapshot.serverId;for(const s of Object.keys(e)){const o=e[s];(0,l.default)(this.snapshot[s],o)?Y(t,s,this.snapshot[s]):n=!0}if(n){this.snapshot=Object.assign({},this.snapshot,t,{serverId:this.host.serverId});for(const e of this.listeners)e()}}applyConnectionEvent(e){const t=this.connectionMachineState,n=ce({state:t,event:e});"online"!==t.tag&&"online"===n.tag&&(this.connectionEpoch+=1),this.connectionMachineState=n,this.logConnectionTransition({from:t.tag,to:n.tag,event:e})}logConnectionTransition(e){}trackConnectionFirstSeen(){const e=performance.now(),t=new Set(this.host.connections.map(e=>e.id));for(const e of this.connectionFirstSeenAt.keys())t.has(e)||(this.connectionFirstSeenAt.delete(e),this.connectionLastProbedAt.delete(e));for(const t of this.host.connections)this.connectionFirstSeenAt.has(t.id)||this.connectionFirstSeenAt.set(t.id,e)}isCurrentSwitchRequest(e){return e===this.switchRequestVersion}isCurrentProbeRequest(e){return e===this.probeRequestVersion}canProceedForProbe(e){return void 0===e||this.isCurrentProbeRequest(e)}async abortSwitchWithClient(e){e&&await e.close().catch(()=>{})}isSwitchStillValid(e,t){return this.isCurrentSwitchRequest(e)&&this.canProceedForProbe(t)}async resolveClientIdForSwitch(e){try{return await this.resolveClientId()}catch(t){if(await this.abortSwitchWithClient(e.existingClient),!this.isCurrentSwitchRequest(e.requestVersion))return null;const n=te(t);return this.applyConnectionEvent({type:"connect_failed",message:`Failed to resolve client id: ${n}`}),this.updateSnapshot(Object.assign({},ae(this.connectionMachineState,this.connectionEpoch))),null}}async disposePreviousActiveClient(){if(this.unsubscribeClientStatus&&(this.unsubscribeClientStatus(),this.unsubscribeClientStatus=null),this.unsubscribeClientHandlers&&(this.unsubscribeClientHandlers(),this.unsubscribeClientHandlers=null),this.activeClient){const e=this.activeClient;this.activeClient=null,await e.close().catch(()=>{})}}buildAgentDirectoryStatusPatch(){if(this.snapshot.hasEverLoadedAgentDirectory)return{};const e=this.connectionMachineState.tag;return"connecting"===e||"online"===e?{agentDirectoryStatus:"initial_loading",agentDirectoryError:null}:"error"===e?{agentDirectoryStatus:"error_before_first_success",agentDirectoryError:this.connectionMachineState.message}:{agentDirectoryStatus:"idle",agentDirectoryError:null}}async switchToConnection(e){const{connectionId:t,expectedProbeVersion:n,existingClient:s}=e;if(!this.canProceedForProbe(n))return void await this.abortSwitchWithClient(s);const o=he(this.host,t);if(!o)return void await this.abortSwitchWithClient(s);const c=++this.switchRequestVersion,l=await this.resolveClientIdForSwitch({existingClient:s,requestVersion:c});if(null===l)return;if(!this.isSwitchStillValid(c,n))return void await this.abortSwitchWithClient(s);if(await this.disposePreviousActiveClient(),!this.isSwitchStillValid(c,n))return void await this.abortSwitchWithClient(s);const u=this.snapshot.clientGeneration+1,p=s??this.deps.createClient({host:this.host,connection:o,clientId:l,runtimeGeneration:u});if(p.setReconnectEnabled(!0),!this.isSwitchStillValid(c,n))return void await p.close().catch(()=>{});this.activeClient=p,this.applyConnectionEvent({type:"select_connection",connectionId:o.id,connection:se(o)}),this.snapshot=Object.assign({},this.snapshot,{clientGeneration:u}),this.updateSnapshot(Object.assign({},ae(this.connectionMachineState,this.connectionEpoch),{client:null}));const y=async e=>{if(!this.isCurrentSwitchRequest(c)||this.activeClient!==p)return;const t=(0,w.getConnectionAuthFailureReason)(e);if(t&&this.authRejectedConnectionIds.add(o.id),this.unsubscribeClientStatus?.(),this.unsubscribeClientStatus=null,this.unsubscribeClientHandlers?.(),this.unsubscribeClientHandlers=null,p.setReconnectEnabled(!1),this.applyConnectionEvent({type:"connect_failed",message:te(e)}),this.updateSnapshot(Object.assign({},ae(this.connectionMachineState,this.connectionEpoch),{client:null,authFailureReason:t})),t){const e=new Map(this.snapshot.probeByConnectionId);e.set(o.id,{status:"unavailable",latencyMs:null}),this.updateSnapshot({probeByConnectionId:e});for(const e of this.host.connections)this.authRejectedConnectionIds.has(e.id)||this.connectionLastProbedAt.delete(e.id)}try{await p.close()}catch{}t&&this.host.connections.some(e=>!this.authRejectedConnectionIds.has(e.id))&&this.runProbeCycleNow()};try{if(s||await p.connect(),!this.isCurrentSwitchRequest(c)||this.activeClient!==p)return;this.unsubscribeClientHandlers=this.deps.mountClientHandlers?.({client:p,host:this.host,connection:o})??null,this.unsubscribeClientStatus=p.subscribeConnectionStatus(e=>{this.isCurrentSwitchRequest(c)&&this.activeClient===p&&(p.authFailureReason?y(new h.DaemonAuthenticationError(p.authFailureReason)):(this.applyConnectionEvent({type:"client_state",state:e,lastError:p.lastError}),this.updateSnapshot(Object.assign({},ae(this.connectionMachineState,this.connectionEpoch),this.buildAgentDirectoryStatusPatch(),{client:p,authFailureReason:null}))))})}catch(e){await y(e)}}adoptReconciledServerId(e){this.host=Object.assign({},this.host,{serverId:e}),this.snapshot=Object.assign({},this.snapshot,{serverId:e});for(const e of this.listeners)e()}resolveClientId(){return this.clientIdPromise||(this.clientIdPromise=this.deps.getClientId().then(e=>(this.clientIdHash=ne(e),e))),this.clientIdPromise}}const ge="@paseo:daemon-registry",ye="localhost:6767",Se=2500,fe="__PASEO_INITIAL_DAEMON_CONNECTION__",Ce=A.z.object({listen:A.z.string().trim().min(1),useTls:A.z.boolean().optional().default(!1)});function ve(e){if(!(e?.isWebRuntime??b.isWeb)||"undefined"==typeof globalThis)return null;const t=Ce.safeParse(Reflect.get(globalThis,fe));return t.success?t.data:null}function me(){return null}function be(e){if(e.trim().startsWith("relay://")||e.includes("#connect="))return(0,y.parseRelayConnectionUri)(e);const t="#offer=",n=e.indexOf(t);if(-1===n)throw new Error("Missing #offer= fragment");const s=e.slice(n+7).trim();if(!s)throw new Error("Offer payload is empty");const o=(0,y.decodeOfferFragmentPayload)(s);return{offer:f.ConnectionOfferSchema.parse(o)}}function we(e){return e.startsWith("local:")}function Ie(e){return new Promise(t=>setTimeout(t,e))}function Ae(e,t,n){const s=e.get(t);void 0!==s&&(e.delete(t),e.set(n,s))}class He{controllers=new Map;serverListeners=new Map;globalListeners=new Set;hostListListeners=new Set;version=0;hostListVersion=0;hostRegistryLoaded=!1;hosts=[];hostAppearanceMutationTail=Promise.resolve();hostRegistryStatus="loading";lastConnectionStatusByServer=new Map;connectionStatusStartedAtByServer=new Map;queuedAgentDrainInFlight=new Set;directorySyncByServer=new Map;nextCancellationRequestId=0;timelineReplicaByServer=new Map;configuredOverrideBootstrapInFlight=null;bootPromise=null;registryLoad=null;hostConfirmations=new C.HostConfirmations;constructor(e){this.deps=e?.deps??ue(),this.storage=e?.storage??c.default,this.replicaCache=new $.ReplicaCache(e?.replicaRowStore??(0,G.createReplicaRowStore)()),this.revokePushNotifications=e?.revokePushNotifications??J.revokePushNotifications}getHosts(){return this.hosts}getHostRegistryStatus(){return this.hostRegistryStatus}subscribeHostList(e){return this.hostListListeners.add(e),()=>{this.hostListListeners.delete(e)}}getHostListVersion(){return this.hostListVersion}isHostRegistryLoaded(){return this.hostRegistryLoaded}boot(){return this.bootPromise||(this.bootPromise=this.runBoot()),this.bootPromise}async runBoot(){await this.loadRegistry();let e=null;try{e=await(0,H.readValidatedString)(this.storage,"@paseo:e2e",A.z.string().min(1))}catch{return}if(e)return;if((0,v.shouldUseDesktopDaemon)())return;const t=this.deps.readInitialConnectionHint?this.deps.readInitialConnectionHint():ve();if(t){if(await this.bootstrapInitialConnectionHint(t))return}await this.bootstrapDefaultLocalhost()}loadRegistry(){return this.registryLoad||(this.registryLoad=this.loadFromStorage().then(()=>this.markHostRegistryLoaded())),this.registryLoad}async loadFromStorage(){let e=!1,t=[];try{const n=await(0,H.readValidatedJson)(this.storage,ge,u.StoredHostRegistrySchema);if(n){const s=[];for(const t of n){const n=(0,u.normalizeStoredHostProfile)(t);if(!n){await this.storage.removeItem(ge),s.length=0;break}t.connections.some(e=>"directTcp"===e.type&&e.password)&&(e=!0),s.push(n)}t=s.filter(e=>!we(e.serverId)),t.length!==s.length&&(e=!0)}this.hosts=t,this.replicaCache.setHosts(t.map(e=>e.serverId)),Q.projectIconCache.setHosts(t.map(e=>e.serverId)),await Q.projectIconCache.restore(),this.syncHosts(t);for(const e of t)this.directorySyncByServer.get(e.serverId)?.restoreCachedDirectory().catch(()=>{})}catch(e){console.error("[HostRuntime] Failed to load host registry from storage",e)}finally{this.hostRegistryStatus="ready",this.emitHostList(),e&&this.persistHosts().catch(e=>console.error("[HostRuntime] Failed to persist host registry",e))}}markHostRegistryLoaded(){this.hostRegistryLoaded||(this.hostRegistryLoaded=!0,this.emitHostList())}async bootstrapDefaultLocalhost(){const e=(0,u.connectionFromListen)(ye);if(e&&!(0,u.registryHasConnection)(this.hosts,e))try{await this.probeAndUpsertConnection({connection:e,timeoutMs:Se})}catch(e){console.warn("[HostRuntime] bootstrap probe failed",{endpoint:ye,error:e})}}bootstrapConfiguredOverride(e){const t=(0,u.connectionFromListen)(e);if(!t)return;if((0,u.registryHasConnection)(this.hosts,t))return;if(this.configuredOverrideBootstrapInFlight)return;const n=this.runConfiguredOverrideBootstrap(e,t).finally(()=>{this.configuredOverrideBootstrapInFlight===n&&(this.configuredOverrideBootstrapInFlight=null)});this.configuredOverrideBootstrapInFlight=n}async runConfiguredOverrideBootstrap(e,t){let n=0;for(;!(0,u.registryHasConnection)(this.hosts,t);){n+=1;try{return void await this.probeAndUpsertConnection({connection:t,timeoutMs:Se})}catch(t){1!==n&&n%10!=0||console.warn("[HostRuntime] configured bootstrap probe failed",{endpoint:e,attempt:n,error:t}),await Ie(1e3)}}}async bootstrapInitialConnectionHint(e){const t=(0,u.connectionFromListen)(e.listen);if(!t)return!1;const n="directTcp"===t.type?Object.assign({},t,{useTls:e.useTls??t.useTls??!1}):t;if((0,u.registryHasConnection)(this.hosts,n))return!0;try{return await this.probeAndUpsertConnection({connection:n,timeoutMs:Se}),!0}catch(t){return console.warn("[HostRuntime] initial connection hint probe failed",{listen:e.listen,useTls:e.useTls,error:t}),!1}}reconcileServerId(e,t){if(e===t)return;const n=this.controllers.get(e);if(!n)return;if(this.controllers.has(t))return;Ae(this.controllers,e,t),Ae(this.lastConnectionStatusByServer,e,t),Ae(this.connectionStatusStartedAtByServer,e,t),this.replicaCache.reconcileServerId(e,t),Q.projectIconCache.reconcileServerId(e,t),this.directorySyncByServer.get(e)?.dispose(),this.directorySyncByServer.delete(e),this.timelineReplicaByServer.delete(e);const s=new N.DirectorySync(t,{onAgentStoppedRunning:e=>this.drainQueuedAgentMessage(t,e),markAgentLoading:()=>n.markAgentDirectorySyncLoading(),markAgentReady:()=>n.markAgentDirectorySyncReady(),markAgentError:e=>n.markAgentDirectorySyncError(e)},this.replicaCache);this.directorySyncByServer.set(t,s),this.timelineReplicaByServer.set(t,(0,z.createTimelineReplica)({serverId:t,storage:this.replicaCache,prepareAgent:e=>s.prepareAgentRoute(e)})),n.adoptReconciledServerId(t);const o=n.getSnapshot();this.clearHostReplica(e),this.syncSessionReplica(t,o),s.connectionChanged({client:o.client,status:"online"===o.connectionStatus?"online":"offline",source:{clientGeneration:o.clientGeneration,connectionEpoch:o.connectionEpoch}});const c=this.serverListeners.get(e);if(c){this.serverListeners.delete(e);const n=this.serverListeners.get(t)??new Set;for(const e of c)n.add(e);this.serverListeners.set(t,n)}this.hosts=this.hosts.map(n=>n.serverId===e?Object.assign({},n,{serverId:t,updatedAt:(new Date).toISOString()}):n),this.emitHostList(),this.emit(t),this.persistHosts().catch(e=>console.error("[HostRuntime] Failed to persist host registry",e))}async upsertDirectConnection(e){const t=(0,y.normalizeHostPort)(e.endpoint),n=e.password?.trim();return this.upsertHostConnection({serverId:e.serverId,label:e.label,password:n,connection:{id:`direct:${t}`,type:"directTcp",endpoint:t,useTls:e.useTls??!1},existingClient:e.existingClient})}async probeAndUpsertConnection(e){if("relay"===e.connection.type)throw new Error("Cannot probe a relay connection without a server id.");const t=Object.assign({serverId:""},e.password?{password:e.password}:{},{label:e.label??e.connection.id,appearance:(0,p.defaultHostAppearance)(),lifecycle:{},connections:[e.connection],preferredConnectionId:e.connection.id,createdAt:new Date(0).toISOString(),updatedAt:new Date(0).toISOString()}),{client:n,serverId:s,hostname:o}=await this.deps.connectToDaemon(Object.assign({host:t,connection:e.connection},void 0!==e.timeoutMs?{timeoutMs:e.timeoutMs}:{}));return{profile:await this.upsertHostConnection({serverId:s,label:e.label??o??void 0,password:e.password,connection:e.connection,existingClient:n}),serverId:s,hostname:o}}async probeAndUpsertDirectConnection(e){const t=(0,y.normalizeHostPort)(e.endpoint),n=e.password?.trim();return this.probeAndUpsertConnection({label:e.label,password:n,connection:{id:`direct:${t}`,type:"directTcp",endpoint:t,useTls:e.useTls??!1}})}async probeAndUpsertRemoteSshConnection(e){return this.probeAndUpsertConnection({label:e.label,connection:(0,u.createRemoteSshHostConnection)(e)})}async upsertRelayConnection(e){const t=(0,y.normalizeHostPort)(e.relayEndpoint),n=e.useTls??!1,s=e.daemonPublicKeyB64.trim();if(!s)throw new Error("daemonPublicKeyB64 is required");const o=void 0!==e.useTls,c=await this.upsertHostConnection({serverId:e.serverId,label:e.label,connection:Object.assign({id:n?`relay:wss:${t}`:`relay:${t}`,type:"relay",relayEndpoint:t},o?{useTls:n}:{},{daemonPublicKeyB64:s})});return e.password?(await this.setHostPassword(c.serverId,e.password),this.hosts.find(e=>e.serverId===c.serverId)??c):c}async confirmLink(e){return await this.loadRegistry(),this.hostConfirmations.confirmLink(e,this.hosts)}getPendingHostConfirmation(){return this.hostConfirmations.getPending()}subscribeHostConfirmation(e){return this.hostConfirmations.subscribe(e)}answerHostConfirmation(e,t){this.hostConfirmations.answer(e,t)}beginLinkPairing(){let e=null;return{submit:async(t,n)=>{const{offer:s,password:o}=be(t);if(!e||(h=s,(c=e).serverId!==h.serverId||!(0,l.default)((0,u.relayConnectionFromOffer)(c),(0,u.relayConnectionFromOffer)(h)))){if(!await this.confirmLink(s))return{status:"cancelled"};e=s}var c,h;const p=await this.probeAndUpsertOffer(s,n??o);return Object.assign({status:"connected"},p)}}}async importConnectionLink(e,t){if("openProject"===t){const{offer:t,password:n}=be(e);if(!await this.confirmLink(t))return{status:"cancelled"};return{status:"connected",serverId:(await this.upsertConnectionFromOffer(t,void 0,n)).serverId}}const n=this.beginLinkPairing();try{const t=await n.submit(e);return"cancelled"===t.status?t:{status:"connected",serverId:t.serverId}}catch(t){if(!(0,w.getConnectionAuthFailureReason)(t))throw t;return{status:"password_required",link:e,pairing:n}}}async upsertConnectionFromOffer(e,t,n){const s=(0,u.relayConnectionFromOffer)(e);return this.upsertRelayConnection({serverId:e.serverId,relayEndpoint:s.relayEndpoint,useTls:s.useTls,daemonPublicKeyB64:s.daemonPublicKeyB64,label:t,password:n})}async probeAndUpsertOffer(e,t){const n=(0,u.relayConnectionFromOffer)(e),s=Object.assign({serverId:e.serverId},t?{password:t}:{},{label:e.serverId,appearance:(0,p.defaultHostAppearance)(),lifecycle:{},connections:[n],preferredConnectionId:n.id,createdAt:new Date(0).toISOString(),updatedAt:new Date(0).toISOString()}),{client:o,hostname:c}=await this.deps.connectToDaemon({host:s,connection:n});await o.close().catch(()=>{});return{profile:await this.upsertConnectionFromOffer(e,c??void 0,t),serverId:e.serverId,hostname:c}}async upsertConnectionFromListen(e){const t=e.listenAddress.trim(),n=e.serverId.trim(),s=(0,u.connectionFromListen)(t);if(!s)throw new Error(`Unsupported listen address: ${e.listenAddress}`);if(!n)throw new Error("Desktop daemon did not return a server id.");return this.upsertHostConnection({serverId:n,label:e.hostname??void 0,connection:s})}async updateHost(e,t){const n=(new Date).toISOString(),s=this.hosts.map(s=>s.serverId===e?Object.assign({},t(s),{updatedAt:n}):s);this.setHostsAndSync(s),await this.persistHosts()}async renameHost(e,t){await this.updateHost(e,e=>Object.assign({},e,{label:t}))}async setHostPassword(t,s){await this.updateHost(t,t=>{const o=(0,n.default)(t,e);return s?Object.assign({},o,{password:s}):o})}async setHostColor(e,t){await this.updateHostAppearance(e,e=>Object.assign({},e,{appearance:Object.assign({},e.appearance,{color:t})}))}async setHostBadgeDisplay(e,t){await this.updateHostAppearance(e,e=>Object.assign({},e,{appearance:Object.assign({},e.appearance,{badgeDisplay:t})}))}updateHostAppearance(e,t){const n=this.hostAppearanceMutationTail.then(()=>this.applyHostAppearance(e,t));return this.hostAppearanceMutationTail=n.catch(()=>{}),n}async applyHostAppearance(e,t){const n=(new Date).toISOString(),s=this.hosts.map(s=>s.serverId===e?Object.assign({},t(s),{updatedAt:n}):s);await this.persistHosts(s),this.setHostsAndSync(s)}async removeHost(e){await this.revokePushNotifications({client:this.getClient(e),serverId:e});const t=this.hosts.filter(t=>t.serverId!==e);this.setHostsAndSync(t),await this.persistHosts()}async removeConnection(e,t){const n=this.hosts.find(t=>t.serverId===e);if(1===n?.connections.length&&n.connections[0]?.id===t)return void await this.removeHost(e);const s=(new Date).toISOString(),o=this.hosts.map(n=>{if(n.serverId!==e)return n;const o=n.connections.filter(e=>e.id!==t);if(0===o.length)return null;const c=n.preferredConnectionId===t?o[0]?.id??null:n.preferredConnectionId;return Object.assign({},n,{connections:o,preferredConnectionId:c,updatedAt:s})}).filter(e=>null!==e);this.setHostsAndSync(o),await this.persistHosts()}async upsertHostConnection(e){const t=(new Date).toISOString(),n=(0,u.upsertHostConnectionInProfiles)({profiles:this.hosts,serverId:e.serverId,label:e.label,connection:e.connection,password:e.password,now:t});this.setHostsAndSync(n,{initialConnectionByServerId:e.existingClient?new Map([[e.serverId,{connectionId:e.connection.id,existingClient:e.existingClient}]]):void 0}),this.persistHosts().catch(e=>console.error("[HostRuntime] Failed to persist host registry",e));const s=n.find(t=>t.serverId===e.serverId);if(!s)throw new Error(`Host ${e.serverId} was not inserted`);return s}setHostsAndSync(e,t){this.hosts=e,this.syncHosts(e,t),this.emitHostList()}async persistHosts(e=this.hosts){await this.storage.setItem(ge,JSON.stringify(e))}emitHostList(){this.hostListVersion+=1;for(const e of this.hostListListeners)e()}syncHosts(e,t){this.replicaCache.setHosts(e.map(e=>e.serverId)),Q.projectIconCache.setHosts(e.map(e=>e.serverId));const n=new Set(e.map(e=>e.serverId));for(const[e,t]of this.controllers)n.has(e)||(this.controllers.delete(e),this.lastConnectionStatusByServer.delete(e),this.connectionStatusStartedAtByServer.delete(e),this.directorySyncByServer.get(e)?.dispose(),this.directorySyncByServer.delete(e),this.timelineReplicaByServer.delete(e),this.clearHostReplica(e),t.stop(),this.emit(e));for(const n of e){const e=t?.initialConnectionByServerId?.get(n.serverId),s=this.controllers.get(n.serverId);if(s){s.updateHost(n),e&&s.activateConnection(e).catch(()=>{e.existingClient.close().catch(()=>{})});continue}const o=new pe({host:n,deps:this.deps,onReconcileServerId:(e,t)=>this.reconcileServerId(e,t)});this.controllers.set(n.serverId,o),_.useSessionStore.getState().initializeSession(n.serverId,null);const c=new N.DirectorySync(n.serverId,{onAgentStoppedRunning:e=>this.drainQueuedAgentMessage(n.serverId,e),markAgentLoading:()=>o.markAgentDirectorySyncLoading(),markAgentReady:()=>o.markAgentDirectorySyncReady(),markAgentError:e=>o.markAgentDirectorySyncError(e)},this.replicaCache);this.directorySyncByServer.set(n.serverId,c),this.timelineReplicaByServer.set(n.serverId,(0,z.createTimelineReplica)({serverId:n.serverId,storage:this.replicaCache,prepareAgent:e=>c.prepareAgentRoute(e)}));const l=o.getSnapshot();this.lastConnectionStatusByServer.set(n.serverId,l.connectionStatus),this.connectionStatusStartedAtByServer.set(n.serverId,Date.now()),o.subscribe(()=>{const e=o.getSnapshot();this.syncSessionReplica(e.serverId,e),this.syncDirectoryConnection(e.serverId),this.emit(e.serverId)}),o.start(e?{initialConnection:e}:{}).catch(e=>{const t=e instanceof Error?e.message:String(e);o.markStartupError(t)}),this.emit(n.serverId)}}syncSessionReplica(e,t){if(!t.client)return;const n=_.useSessionStore.getState();n.initializeSession(e,t.client,t.clientGeneration),n.updateSessionClient(e,t.client,t.clientGeneration);const s=t.client.getLastServerInfoMessage();s&&n.updateSessionServerInfo(e,(0,_.toDaemonServerInfo)(s))}clearHostReplica(e){_.useSessionStore.getState().clearSession(e),M.useWorkspaceSetupStore.getState().clearServer(e)}syncDirectoryConnection(e){const t=this.controllers.get(e);if(!t)return this.lastConnectionStatusByServer.delete(e),void this.connectionStatusStartedAtByServer.delete(e);const n=t.getSnapshot(),s=this.directorySyncByServer.get(e);s?.connectionChanged({client:n.client,status:"online"===n.connectionStatus?"online":"offline",source:{clientGeneration:n.clientGeneration,connectionEpoch:n.connectionEpoch}});const o=this.lastConnectionStatusByServer.get(e),c=o!==n.connectionStatus,l="online"!==n.connectionStatus&&"idle"!==n.connectionStatus;!c||void 0!==o&&"online"!==o&&"idle"!==o&&l||this.connectionStatusStartedAtByServer.set(e,Date.now()),this.lastConnectionStatusByServer.set(e,n.connectionStatus);"online"===n.connectionStatus&&"online"!==o&&(_.useSessionStore.getState().bumpHistorySyncGeneration(e),(0,k.invalidateCheckoutGitQueriesForServer)(T.queryClient,e),(0,B.invalidateServerDataQueriesAfterReconnect)({queryClient:T.queryClient,serverId:e}),T.queryClient.invalidateQueries({queryKey:j.schedulesQueryBaseKey}))}drainQueuedAgentMessage(e,t){const n=`${e}:${t}`;if(this.queuedAgentDrainInFlight.has(n))return;const s=_.useSessionStore.getState().sessions[e],o=s?.queuedMessages.get(t),c=s?.client;if(!c||!o?.length||!0===s.initializingAgents.get(t))return;if((0,U.getActiveMessageSubmissions)(s.messageSubmissions.get(t)).length>0)return;this.queuedAgentDrainInFlight.add(n);const l=o[0];(0,q.sendQueuedComposerMessageNow)({agentId:t,messageId:l.id,queue:{read:t=>_.useSessionStore.getState().sessions[e]?.queuedMessages.get(t)??[],write:t=>_.useSessionStore.getState().setQueuedMessages(e,t)},submitMessage:async({text:n,attachments:s})=>{const o=!0===_.useSessionStore.getState().sessions[e]?.serverInfo?.features?.forgeSearch;await(0,q.dispatchComposerAgentMessage)({client:c,agentId:t,text:n,attachments:s,attachmentSubmitFormat:(0,V.resolveComposerAttachmentSubmitFormat)({supportsForgeAttachments:o}),encodeImages:W.encodeImages,submission:(0,x.createMessageSubmissionWriter)(e)})}}).then(n=>("failed"===n.status&&console.error("[HostRuntime] failed to drain queued agent message",{serverId:e,agentId:t,error:n.errorMessage}),n)).finally(()=>{this.queuedAgentDrainInFlight.delete(n)})}applyAgentTurnLiveness(e,t,n){this.directorySyncByServer.get(e)?.applyAgentTurnLiveness(t,n)}beginAgentCancellation(e,t){const n=++this.nextCancellationRequestId;return this.applyAgentTurnLiveness(e,t,{type:"cancellation_started",requestId:n}),n}settleAgentCancellation(e,t,n){this.applyAgentTurnLiveness(e,t,{type:"cancellation_settled",requestId:n})}acceptAgentSnapshot(e,t){return this.requireDirectory(e).acceptAgent(t)}archiveAgentSnapshot(e,t,n){this.requireDirectory(e).archiveAgent(t,n)}restoreAgentSnapshot(e,t,n){const s=this.requireDirectory(e);n?s.acceptAgent(n):s.removeAgent(t)}acceptWorkspaceSnapshots(e,t){this.requireDirectory(e).acceptWorkspaces(t)}acceptProjectSnapshot(e,t){this.requireDirectory(e).acceptProject(t)}removeWorkspaceSnapshot(e,t){this.requireDirectory(e).removeWorkspace(t)}requireDirectory(e){const t=this.directorySyncByServer.get(e);if(!t)throw new Error(`Unknown host runtime for serverId ${e}`);return t}getSnapshot(e){return this.controllers.get(e)?.getSnapshot()??null}getConnectionStatusSince(e){return this.connectionStatusStartedAtByServer.get(e)??null}getVersion(){return this.version}getClient(e){return this.controllers.get(e)?.getClient()??null}subscribe(e,t){const n=this.serverListeners.get(e)??new Set;return n.add(t),this.serverListeners.set(e,n),()=>{const n=this.serverListeners.get(e);n&&(n.delete(t),0===n.size&&this.serverListeners.delete(e))}}subscribeAll(e){return this.globalListeners.add(e),()=>{this.globalListeners.delete(e)}}getEarliestOnlineHostServerId(){let e=null,t=null;for(const n of this.hosts){const s=this.getSnapshot(n.serverId);Z(s)&&s?.lastOnlineAt&&((!t||s.lastOnlineAt<t)&&(t=s.lastOnlineAt,e=n.serverId))}return e}ensureConnectedAll(e){for(const t of this.controllers.values())t.ensureConnected(e)}setAppVisible(e){e?this.ensureConnectedAll({verify:!0}):this.replicaCache.flush()}runProbeCycleNow(e){return e?this.controllers.get(e)?.runProbeCycleNow()??Promise.resolve():Promise.all(Array.from(this.controllers.values(),e=>e.runProbeCycleNow())).then(()=>{})}async refreshAgentDirectory(e){const t=this.directorySyncByServer.get(e.serverId);if(!t)throw new Error(`Unknown host runtime for serverId ${e.serverId}`);return t.refreshAgents(e)}async refreshWorkspaceDirectory(e){const t=this.directorySyncByServer.get(e.serverId);if(!t)throw new Error(`Unknown host runtime for serverId ${e.serverId}`);await t.refreshWorkspaces({subscribe:e.subscribe})}async refreshDirectories(e){const t=this.directorySyncByServer.get(e);if(!t)throw new Error(`Unknown host runtime for serverId ${e}`);await t.refreshDemand()}acquireDirectoryDemand(e){const t=this.directorySyncByServer.get(e);if(!t)return()=>{};const n={};return t.setDemand(n,!0),()=>t.setDemand(n,!1)}async prepareAgentRoute(e,t){const n=this.directorySyncByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);await n.prepareAgentRoute(t)}async prepareWorkspaceRoute(e,t){const n=this.directorySyncByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);await n.prepareWorkspaceRoute(t)}async prepareAgentTimeline(e,t){const n=this.timelineReplicaByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);await n.prepare(t)}async fetchAgentTimeline(e,t,n){const s=this.directorySyncByServer.get(e);if(!s)throw new Error(`Unknown host runtime for serverId ${e}`);const o=_.useSessionStore.getState().sessions[e]?.viewedTimelineSync,c=await s.fetchTimeline(t,n);return o&&_.useSessionStore.getState().sessions[e]?.viewedTimelineSync===o&&(o.flushStreamAgent(t),o.applyTimelineResponse(c)),c}createViewedTimelineOwner(e,t){const n=this.directorySyncByServer.get(e);if(!n)throw new Error(`Unknown host runtime for serverId ${e}`);const s=this.timelineReplicaByServer.get(e);if(!s)throw new Error(`Unknown host runtime for serverId ${e}`);return(0,z.createViewedTimelineOwner)({serverId:e,replica:s,replaceDemandedAgentIds:e=>n.setAgentRouteDemand(e),drainQueuedAgentMessage:t=>this.drainQueuedAgentMessage(e,t),ports:t})}emit(e){this.version+=1;const t=this.serverListeners.get(e);if(t){for(const e of t)e();for(const e of this.globalListeners)e()}else for(const e of this.globalListeners)e()}}let Re=null;const De="__paseoHostRuntimeStore";function Ee(){if(Re)return Re;const e=Reflect.get(globalThis,De);return e instanceof He?(Re=e,e):(Re=new He,Reflect.set(globalThis,De,Re),Re)}},3524,[35,453,36,884,3525,3447,3526,3529,3531,3521,3532,3533,3534,880,3536,3537,2897,2983,3540,3538,881,3541,3459,3472,3424,3542,3549,848,3551,3561,3579,3581,3592,3432,3583,3593,3599,3628,3632,3633,3637,3639,3641,3642]);
|
|
15170
15170
|
__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}},3525,[]);
|
|
@@ -15928,7 +15928,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
15928
15928
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useFileLink=p,e.useAssistantFileLinkActions=function(){const o=(0,t.c)(10),n=(0,c.useAssistantFileLinkResolverContext)(),u=p(x);let l;o[0]!==u?(l=(t,o)=>{u.open(t,o)},o[0]=u,o[1]=l):l=o[1];const k=(0,s.useStableEvent)(l);let f;o[2]!==n.configRef?(f=t=>y(t,n.configRef.current.workspaceRoot),o[2]=n.configRef,o[3]=f):f=o[3];const v=f;let w;o[4]!==n.configRef?(w=t=>R(t,n.configRef.current.workspaceRoot),o[4]=n.configRef,o[5]=w):w=o[5];const F=w;let b;o[6]!==v||o[7]!==F||o[8]!==k?(b={open:k,canOpen:v,canResolveFile:F},o[6]=v,o[7]=F,o[8]=k,o[9]=b):b=o[9];return b};var t=r(d[0]);r(d[1]);var o=r(d[2]),n=r(d[3]),s=r(d[4]),u=r(d[5]),c=r(d[6]),l=r(d[7]);const k=["assistantFileLink",null,null,""];function p(u){const p=(0,t.c)(44),{t:y}=(0,n.useTranslation)(),R=(0,c.useAssistantFileLinkResolverContext)(),F=(0,o.useQueryClient)(),b=v(u),I=R.configRef.current,S=I.workspaceRoot,x=I.serverId;let Q;p[0]!==b||p[1]!==S?(Q=(0,l.classifyForResolution)(b,{workspaceRoot:S}),p[0]=b,p[1]=S,p[2]=Q):Q=p[2];const h=Q;let D;p[3]!==h.ambiguousQuery||p[4]!==h.kind||p[5]!==x||p[6]!==S?(D="needsLookup"===h.kind?w({serverId:x,workspaceRoot:S,ambiguousQuery:h.ambiguousQuery}):k,p[3]=h.ambiguousQuery,p[4]=h.kind,p[5]=x,p[6]=S,p[7]=D):D=p[7];const L=D;let W,q;p[8]!==R.getDirectorySuggestions||p[9]!==h.ambiguousQuery||p[10]!==h.kind||p[11]!==h.target||p[12]!==h.token||p[13]!==S?(W=()=>{if("needsLookup"!==h.kind)throw new Error("Assistant file link lookup requested for a sync link.");return(0,l.fetchDaemonResolution)({ambiguousQuery:h.ambiguousQuery,token:h.token,target:h.target,workspaceRoot:S,getDirectorySuggestions:R.getDirectorySuggestions})},p[8]=R.getDirectorySuggestions,p[9]=h.ambiguousQuery,p[10]=h.kind,p[11]=h.target,p[12]=h.token,p[13]=S,p[14]=W):W=p[14],p[15]!==L||p[16]!==W?(q={queryKey:L,queryFn:W,enabled:!1,retry:0,staleTime:1/0},p[15]=L,p[16]=W,p[17]=q):q=p[17];const E=(0,o.useQuery)(q);let T;p[18]!==R||p[19]!==F||p[20]!==y?(T=(t,o)=>{f({source:t,disposition:o,context:R,queryClient:F,formatNoFileFoundMessage:t=>y("common.errors.noFileFound",{token:t})})},p[18]=R,p[19]=F,p[20]=y,p[21]=T):T=p[21];const A=(0,s.useStableEvent)(T);let C;p[22]!==R.getDirectorySuggestions||p[23]!==F||p[24]!==L||p[25]!==h.ambiguousQuery||p[26]!==h.kind||p[27]!==h.target||p[28]!==h.token||p[29]!==S?(C=()=>{"needsLookup"===h.kind&&F.prefetchQuery({queryKey:L,queryFn:()=>(0,l.fetchDaemonResolution)({ambiguousQuery:h.ambiguousQuery,token:h.token,target:h.target,workspaceRoot:S,getDirectorySuggestions:R.getDirectorySuggestions}),retry:0,staleTime:1/0})},p[22]=R.getDirectorySuggestions,p[23]=F,p[24]=L,p[25]=h.ambiguousQuery,p[26]=h.kind,p[27]=h.target,p[28]=h.token,p[29]=S,p[30]=C):C=p[30];const M=(0,s.useStableEvent)(C);let O;p[31]!==A||p[32]!==b?(O=()=>{A(b,"preferred")},p[31]=A,p[32]=b,p[33]=O):O=p[33];const _=(0,s.useStableEvent)(O);let j;e:{if("resolved"===h.kind){j="file"===h.value.kind?h.value.target:null;break e}let t;p[34]!==E.data||p[35]!==h.target?(t=E.data?Object.assign({},h.target,{path:E.data.path}):null,p[34]=E.data,p[35]=h.target,p[36]=t):t=p[36],j=t}const K=j,N="needsLookup"===h.kind||"file"===h.value.kind,P=E.isError;let H;return p[37]!==N||p[38]!==M||p[39]!==_||p[40]!==A||p[41]!==P||p[42]!==K?(H={target:K,isFileLink:N,resolutionFailed:P,onHoverIn:M,onPress:_,open:A},p[37]=N,p[38]=M,p[39]=_,p[40]=A,p[41]=P,p[42]=K,p[43]=H):H=p[43],H}function f(t){const o=t.context.configRef.current,n=(0,l.classifyForResolution)(t.source,{workspaceRoot:o.workspaceRoot});if("resolved"===n.kind)return void F({resolution:n,disposition:t.disposition,capturedServerId:o.serverId,capturedWorkspaceRoot:o.workspaceRoot,context:t.context});const s=w({serverId:o.serverId,workspaceRoot:o.workspaceRoot,ambiguousQuery:n.ambiguousQuery});(async()=>{try{const u=await t.queryClient.fetchQuery({queryKey:s,queryFn:()=>(0,l.fetchDaemonResolution)({ambiguousQuery:n.ambiguousQuery,token:n.token,target:n.target,workspaceRoot:o.workspaceRoot,getDirectorySuggestions:t.context.getDirectorySuggestions}),retry:0,staleTime:1/0});await b({target:Object.assign({},n.target,{path:u.path}),disposition:t.disposition,capturedServerId:o.serverId,capturedWorkspaceRoot:o.workspaceRoot,context:t.context})}catch(s){await S({error:s,noFileFoundMessage:t.formatNoFileFoundMessage(n.token),capturedServerId:o.serverId,capturedWorkspaceRoot:o.workspaceRoot,context:t.context})}})()}function y(t,o){const n=(0,l.classifyForResolution)(t,{workspaceRoot:o});return"needsLookup"===n.kind||"ignored"!==n.value.kind}function R(t,o){const n=(0,l.classifyForResolution)(t,{workspaceRoot:o});return"needsLookup"===n.kind||"file"===n.value.kind}function v(o){const n=(0,t.c)(7),{href:s,text:u,title:c,markup:l,sourceInfo:k,sourceType:p}=o;let f;return n[0]!==s||n[1]!==l||n[2]!==k||n[3]!==p||n[4]!==u||n[5]!==c?(f={href:s,text:u,title:c,markup:l,sourceInfo:k,sourceType:p},n[0]=s,n[1]=l,n[2]=k,n[3]=p,n[4]=u,n[5]=c,n[6]=f):f=n[6],f}function w(t){return["assistantFileLink",t.serverId??null,t.workspaceRoot??null,t.ambiguousQuery]}async function F(t){const{value:o}=t.resolution;"file"!==o.kind?"external"===o.kind&&await I({url:o.url,capturedServerId:t.capturedServerId,capturedWorkspaceRoot:t.capturedWorkspaceRoot,context:t.context}):await b({target:o.target,disposition:t.disposition,capturedServerId:t.capturedServerId,capturedWorkspaceRoot:t.capturedWorkspaceRoot,context:t.context})}async function b(t){const o=t.context.configRef.current;o.serverId===t.capturedServerId&&o.workspaceRoot===t.capturedWorkspaceRoot&&o.onOpenWorkspaceFile?.(t.target,t.disposition)}async function I(t){const o=t.context.configRef.current;o.serverId===t.capturedServerId&&o.workspaceRoot===t.capturedWorkspaceRoot&&await(0,u.openExternalUrl)(t.url)}async function S(t){const o=t.context.configRef.current;o.serverId===t.capturedServerId&&o.workspaceRoot===t.capturedWorkspaceRoot&&o.toast?.show(t.noFileFoundMessage,{variant:"error",testID:"assistant-file-link-not-found-toast"})}const x={href:""}},4273,[453,36,799,853,3901,3677,4271,4274]);
|
|
15929
15929
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"UnresolvedFileLinkError",{enumerable:!0,get:function(){return o}}),e.fetchDaemonResolution=async function({ambiguousQuery:t,token:n,target:s,workspaceRoot:c,getDirectorySuggestions:u}){const l=c?.trim();if(!l)throw new o(n);let k;try{k=await u({query:t,cwd:l,includeFiles:!0,includeDirectories:!1,matchMode:"suffix",limit:1})}catch{throw new o(n)}const p=k.entries.find(t=>"file"===t.kind);if(!p||k.error)throw new o(n);return Object.assign({},s,{path:f(l,p.path)})},e.classifyForResolution=function(n,o){const l=s(n).trim();if(!l)return{kind:"resolved",value:{kind:"ignored"}};const f=(0,t.classifyAssistantFileLink)(l,{workspaceRoot:o.workspaceRoot});if(!f)return{kind:"resolved",value:{kind:"ignored"}};if("external"===f.kind)return{kind:"resolved",value:{kind:"external",url:f.raw}};if("directFile"===f.kind&&!u({context:o,source:n,token:l,target:f.target}))return{kind:"resolved",value:{kind:"file",target:f.target}};const k=o.workspaceRoot?.trim();if(!k)return{kind:"resolved",value:{kind:"ignored"}};return{kind:"needsLookup",ambiguousQuery:c(f.target,k),token:l,target:f.target}},e.getAssistantFileLinkToken=s,e.getAmbiguousSuggestionQuery=c,e.shouldResolveDirectFileThroughSuggestions=u;var t=r(d[0]),n=r(d[1]);class o extends Error{constructor(t){super(n.i18n.t("common.errors.noFileFound",{token:t})),this.token=t,this.name="UnresolvedFileLinkError"}}function s(n){if(l(n)||"inline-code"===n.sourceType){const o=n.text?.trim();if(o&&(0,t.isFileLookingAssistantToken)(o))return o}return n.href}function c(t,n){const o=n.replace(/\\/g,"/").replace(/\/+$/,""),s=t.path.replace(/\\/g,"/"),c=`${o}/`;if(s.startsWith(c))return s.slice(c.length);const u=s.lastIndexOf("/");return u>=0?s.slice(u+1):s}function u(t){if("inline-code"!==t.source.sourceType)return!1;if((n=t.token).startsWith("/")||n.toLowerCase().startsWith("file://")||/^[A-Za-z]:[\\/]/.test(n))return!1;var n;const o=t.context.workspaceRoot?.trim();if(!o)return!1;const s=o.replace(/\\/g,"/").replace(/\/+$/,"");return t.target.path.replace(/\\/g,"/").startsWith(`${s}/`)}function l(t){return"linkify"===t.markup||"auto"===t.sourceInfo}function f(t,n){const o=t.replace(/\\/g,"/").replace(/\/+$/,""),s=n.replace(/\\/g,"/").replace(/^\/+/,"");return o?`${o}/${s}`:s}},4274,[4275,2883]);
|
|
15930
15930
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseInlinePathToken=b,e.parseFileProtocolUrl=A,e.classifyAssistantFileLink=function(t,n={}){const s=t??"",l=s.trim();if(!l)return null;if(P(l))return{kind:"external",raw:s};if(/\s/.test(l))return null;const u=w(l,n);if(!u)return null;if(x(l,u,n.workspaceRoot))return{kind:"ambiguousFileCandidate",target:u};return{kind:"directFile",target:u}},e.parseAssistantFileLink=w,e.isFileLookingAssistantToken=function(t){const n=h(t);if(!n||/\s/.test(n)||n.includes("?")||n.includes("://"))return!1;const s=W(n);if(!s)return!1;return y(s)},e.normalizeInlinePathTarget=function(t,n){if(!t)return null;const s=L(t);if(!s)return null;let l=s;const u=I(l,n);u&&(l=u);l.startsWith("./")&&(l=l.slice(2)||".");l.length||(l=".");if("."===l)return{directory:"."};if(l.endsWith("/")){const t=l.replace(/\/+$/,"");return{directory:t.length>0?t:"."}}const c=l.lastIndexOf("/"),o=c>=0?l.slice(0,c):".";return{directory:o.length>0?o:".",file:l}};var t=r(d[0]);function n(t){try{return decodeURIComponent(t)}catch{return t}}const s="file:",l=/^L([0-9]+)(?:C[0-9]+)?(?:-L?([0-9]+)(?:C[0-9]+)?)?$/i,u=/^(.+?):([0-9]+)(?::[0-9]+)?(?:-([0-9]+)(?::[0-9]+)?)?$/,c=/^(.+?)\(([0-9]+)(?:,[0-9]+)?(?:-([0-9]+)(?:,[0-9]+)?)?\)$/,o=/^(.+?)\s+lines?\s+([0-9]+)(?:-([0-9]+))?$/i,f=new Set(["astro","bash","c","cc","cjs","cpp","cs","css","cts","cxx","env","fish","go","gql","gradle","graphql","h","hpp","htm","html","ini","java","js","json","jsonc","jsx","kt","kts","less","lock","lua","md","mdx","mjs","mts","php","proto","py","rb","rs","sass","scss","sh","sql","svelte","swift","toml","ts","tsx","txt","vue","xml","yaml","yml","zsh"]);function h(t){const n=t.trim().replace(/^['"`]/,"").replace(/['"`]$/,"");return n?n.replace(/\\/g,"/"):null}function p(t){const n=t.startsWith("#")?t.slice(1):t;if(!n)return{lineStart:void 0,lineEnd:void 0};const s=n.match(l),u=s?.[1]?parseInt(s[1],10):void 0,c=s?.[2]?parseInt(s[2],10):void 0;return void 0!==u&&(!Number.isFinite(u)||u<=0)||void 0!==c&&(!Number.isFinite(c)||c<=0)||void 0!==u&&void 0!==c&&c<u?null:{lineStart:u,lineEnd:c}}function b(t){const n=t??"",s=n.trim();if(!s)return null;const l=s.match(u)??s.match(c)??s.match(o);if(!l)return null;const f=l[1]?.trim();if(!f)return null;if(f.includes("://"))return null;const p=h(f);if(!p)return null;const b=parseInt(l[2],10);if(!Number.isFinite(b)||b<=0)return null;const A=l[3]?parseInt(l[3],10):void 0;if(void 0!==A){if(!Number.isFinite(A)||A<=0)return null;if(A<b)return null}return{raw:n,path:p,lineStart:b,lineEnd:A}}function A(t){const n=t?.trim();if(!n)return null;let l;try{l=new URL(n)}catch{return null}if(l.protocol!==s)return null;const u=F(l.pathname);if(!u)return null;const c=p(l.hash);return c?Object.assign({raw:t,path:u},c):null}function v(n){const s=b(n);if(!s)return null;const l=h(s.path);return l&&(0,t.isAbsolutePath)(l)?Object.assign({},s,{path:l}):null}function w(s,l={}){const u=A(s);if(u)return u;const c=s?.trim();if(!c)return null;if(P(c))return null;const o=v(c);if(o)return o;const f=c.match(/^([A-Za-z]:[\\/][^?#]*)(#[^?]+)?$/);if(f){const t=h(f[1]??"");if(!t)return null;const n=p(f[2]??"");return n?Object.assign({raw:s,path:t},n):null}const b=$(c,{workspaceRoot:l.workspaceRoot});if(b)return b;if(!(0,t.isAbsolutePath)(c))return null;let w;try{w=new URL(c,"http://paseo.invalid")}catch{return null}const j=h(n(w.pathname));if(!j||!(0,t.isAbsolutePath)(j))return null;const k=p(w.hash);return k?Object.assign({raw:s,path:j},k):null}function $(n,s){const l=j(n);if(!l||(0,t.isAbsolutePath)(l.path))return null;if("~"===(u=l.path)||u.startsWith("~/")||u.startsWith("~\\"))return Object.assign({raw:n,path:l.path},l.lines);var u;const c=L(s.workspaceRoot);if(!c)return null;const o=z(l.path,c);return o?Object.assign({raw:n,path:o},l.lines):null}function j(t){const n=h(t);if(!n||n.includes("?"))return null;const s=n.indexOf("#"),l=s>=0?n.slice(0,s):n,u=p(s>=0?n.slice(s):"");if(!u)return null;const c=b(l);return c?y(c.path)?{path:c.path,lines:{lineStart:c.lineStart,lineEnd:c.lineEnd}}:null:!l||l.includes(":")?null:y(l)?{path:l,lines:u}:null}function k(t,n){const s=L(n);if(!s)return!0;const l=Z(t),u=Z(s.replace(/\/+$/,"")||"/"),c="/"===u?"/":`${u}/`;return l===u||l.startsWith(c)}function P(t){if(t.includes("://"))return!t.toLowerCase().startsWith(`${s}//`);return!b(t)&&(/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t)&&!/^[A-Za-z]:[\\/]/.test(t))}function x(n,s,l){const u=L(l);if(!u||!k(s.path,u))return!1;const c=j(n);return!(!c||(0,t.isAbsolutePath)(c.path))&&!c.path.includes("/")}function W(t){const n=t.indexOf("#"),s=n>=0?t.slice(0,n):t;if(!p(n>=0?t.slice(n):""))return null;const l=b(s);return l?l.path:!s||s.includes(":")?null:s}function y(n){const s=h(n);if(!s)return!1;if((0,t.isAbsolutePath)(s))return!0;if(s.startsWith("./")||s.startsWith("../")||s.startsWith("~/"))return!0;const l=s.split("/").filter(Boolean),u=l[0];if(!u)return!1;if(l.length>1){const t=l[l.length-1];return!/^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/.test(u)&&O(t)}return O(u)}function O(t){if(!t)return!1;if(t.startsWith(".")&&t.length>1)return!0;const n=t.lastIndexOf(".");if(n<0)return!1;const s=t.slice(n+1).toLowerCase();return f.has(s)}function z(n,s){const l=h(n);if(!l||(0,t.isAbsolutePath)(l))return null;const u=s.replace(/\/+$/,"")||"/",c=l.split("/"),o=[];for(const t of c)if(t&&"."!==t)if(".."!==t)o.push(t);else{if(0===o.length)return null;o.pop()}return 0===o.length?u:"/"===u?`/${o.join("/")}`:`${u}/${o.join("/")}`}function F(t){if(!t)return null;const s=n(t).replace(/\\/g,"/");return s?/^\/[A-Za-z]:\//.test(s)?s.slice(1):s:null}function L(t){if(!t)return null;const n=t.trim().replace(/^['"`]/,"").replace(/['"`]$/,"");return n?n.replace(/\\/g,"/").replace(/\/{2,}/g,"/"):null}function I(n,s){const l=L(s);if(!l||!(0,t.isAbsolutePath)(n)||!(0,t.isAbsolutePath)(l))return null;const u=l.replace(/\/+$/,"")||"/",c=Z(n),o=Z(u),f="/"===u?"/":`${u}/`,h=Z(f);return c===o?".":c.startsWith(h)?n.slice(f.length)||".":null}function Z(t){return/^[A-Za-z]:/.test(t)?t.toLowerCase():t}},4275,[3575]);
|
|
15931
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["children","onResolve"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.FileLinkContextMenu=function(
|
|
15931
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["children","onResolve"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.FileLinkContextMenu=function(t){const n=(0,o.c)(14);let c,u,p;if(n[0]!==t){var h=t;({children:c,onResolve:u}=h),p=(0,s.default)(h,e),n[0]=t,n[1]=c,n[2]=u,n[3]=p}else c=n[1],u=n[2],p=n[3];const[I,v]=(0,l.useState)(!1);let k,F,b;n[4]!==c||n[5]!==u?(k=(0,j.jsx)(x.ContextMenuTrigger,{contextOnly:!0,style:R,onContextMenu:u,children:c}),n[4]=c,n[5]=u,n[6]=k):k=n[6];n[7]!==I||n[8]!==p?(F=I?(0,j.jsx)(L,Object.assign({},p)):null,n[7]=I,n[8]=p,n[9]=F):F=n[9];n[10]!==I||n[11]!==k||n[12]!==F?(b=(0,j.jsxs)(x.ContextMenu,{open:I,onOpenChange:v,children:[k,F]}),n[10]=I,n[11]=k,n[12]=F,n[13]=b):b=n[13];return b};var t,n=r(d[0]),s=(t=n)&&t.__esModule?t:{default:t},o=r(d[1]),l=r(d[2]),c=r(d[3]),u=r(d[4]),p=r(d[5]),x=r(d[6]),h=r(d[7]),I=r(d[8]),v=r(d[9]),k=r(d[10]),F=r(d[11]),b=r(d[12]),f=r(d[13]),y=r(d[14]),P=r(d[15]),j=r(d[16]);const C=(0,c.withUnistyles)(u.File),M=(0,c.withUnistyles)(u.Columns2),S=(0,c.withUnistyles)(u.Rows2),w=(0,c.withUnistyles)(u.Copy),z=(0,c.withUnistyles)(u.FolderOpen),E=(0,c.withUnistyles)(u.FolderSearch),D=e=>({color:e.colors.foregroundMuted}),R={display:"contents"},A=(0,j.jsx)(C,{size:16,uniProps:D}),W=(0,j.jsx)(M,{size:16,uniProps:D}),O=(0,j.jsx)(S,{size:16,uniProps:D}),T=(0,j.jsx)(w,{size:16,uniProps:D}),U=(0,j.jsx)(z,{size:16,uniProps:D}),_=(0,j.jsx)(E,{size:16,uniProps:D});function L({target:e,source:t,resolutionFailed:n,onOpen:s}){const{t:o}=(0,p.useTranslation)(),l=(0,h.usePaneContext)(),c=(0,I.useIsCompactFormFactor)(),{configRef:u}=(0,f.useAssistantFileLinkResolverContext)(),C=u.current.workspaceRoot,M=(0,y.useRevealInFileManager)({serverId:l.serverId,workspaceRoot:C??""}),S=e?(0,b.normalizeInlinePathTarget)(e.path,C):void 0,w=S?.file,z=w??S?.directory,E=(0,k.buildWorkspaceTabPersistenceKey)({serverId:l.serverId,workspaceId:l.workspaceId}),D=(0,v.useWorkspaceLayoutStore)(e=>E?e.layoutByWorkspace[E]:void 0),R=(0,v.useWorkspaceLayoutStore)(e=>E?e.explorerSidebarPaneIdByWorkspace[E]:void 0),L=(0,F.resolveFilePanePlacement)({layout:D,sourceTabId:l.tabId,explorerPaneId:R,axis:F.FilePaneAxis.Horizontal}),B=(0,F.resolveFilePanePlacement)({layout:D,sourceTabId:l.tabId,explorerPaneId:R,axis:F.FilePaneAxis.Vertical});function H(t){e&&w&&l.openFileInWorkspace({location:{path:w,lineStart:e.lineStart,lineEnd:e.lineEnd},disposition:"main",paneAxis:t})}const V=(0,P.useStableEvent)(()=>H(F.FilePaneAxis.Horizontal)),$=(0,P.useStableEvent)(()=>H(F.FilePaneAxis.Vertical)),K=(0,P.useStableEvent)(()=>{z&&l.copyFilePath(z)}),N=(0,P.useStableEvent)(()=>{z&&l.revealFileInExplorer(z)}),q=(0,P.useStableEvent)(()=>{z&&M?.reveal(z)});return(0,j.jsxs)(x.ContextMenuContent,{minWidth:230,testID:"assistant-file-link-menu",children:[(0,j.jsx)(x.ContextMenuItem,{leading:A,onSelect:s,testID:"assistant-file-link-open",children:o("workspace.chatFileMenu.open")}),c?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(x.ContextMenuItem,{leading:W,disabled:!w||!L,onSelect:V,testID:"assistant-file-link-open-horizontal",children:o(`workspace.chatFileMenu.${L?.position??"right"}`)}),(0,j.jsx)(x.ContextMenuItem,{leading:O,disabled:!w||!B,onSelect:$,testID:"assistant-file-link-open-vertical",children:o(`workspace.chatFileMenu.${B?.position??"bottom"}`)})]}),(0,j.jsx)(x.ContextMenuSeparator,{testID:"assistant-file-link-open-separator"}),(0,j.jsx)(x.ContextMenuItem,{leading:T,disabled:!z,onSelect:K,testID:"assistant-file-link-copy-path",children:o("workspace.tabs.menu.copyFilePath")}),(0,j.jsx)(x.ContextMenuItem,{leading:_,disabled:!z,onSelect:N,testID:"assistant-file-link-reveal",children:o("workspace.tabs.menu.revealInExplorer")}),M?(0,j.jsx)(x.ContextMenuItem,{leading:U,disabled:!z,onSelect:q,testID:"assistant-file-link-reveal-in-file-manager",children:o("workspace.fileActions.revealIn",{target:M.targetName})}):null,e?null:(0,j.jsx)(x.ContextMenuLabel,{children:n?o("common.errors.noFileFound",{token:t.text??t.href}):o("common.states.loading")})]})}},4276,[35,453,36,56,1217,853,4195,4227,1216,3566,3548,4277,4275,4271,4279,3901,279]);
|
|
15932
15932
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"FilePaneAxis",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"FilePanePosition",{enumerable:!0,get:function(){return l}}),e.resolveFilePanePlacement=function({layout:u,sourceTabId:c,explorerPaneId:f,axis:s}){if(!u)return;const P=(0,t.collectAllPanes)(u.root).find(t=>t.tabIds.includes(c));if(!P)return;const p=f&&P.id!==f?(0,t.removePaneFromTree)(u.root,f):u.root,b=s===o.Horizontal,v=(0,n.findAdjacentPane)(p,P.id,b?"right":"down"),h=(0,n.findAdjacentPane)(p,P.id,b?"left":"up");let j=b?l.Right:l.Bottom;!v&&h&&(j=b?l.Left:l.Top);return{sourcePaneId:P.id,paneId:v??h??void 0,position:j}};var t=r(d[0]),n=r(d[1]);let o=(function(t){return t.Horizontal="horizontal",t.Vertical="vertical",t})({}),l=(function(t){return t.Right="right",t.Left="left",t.Bottom="bottom",t.Top="top",t})({})},4277,[3569,4278]);
|
|
15933
15933
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.findAdjacentPane=function(p,l,f,u){const h=s(p,{left:t,top:t,right:n,bottom:n}),D=h.find(t=>t.paneId===l)??null;if(!D)return null;const b=h.filter(t=>t.paneId!==l&&t.paneId!==u?.excludedPaneId).map(t=>c({pane:t,focusedPane:D,direction:f})).filter(t=>null!==t).sort(o);return b[0]?.paneId??null};const t=0,n=1;function o(t,n){return t.primaryDistance!==n.primaryDistance?t.primaryDistance-n.primaryDistance:t.secondaryDistance!==n.secondaryDistance?t.secondaryDistance-n.secondaryDistance:t.overlap!==n.overlap?n.overlap-t.overlap:t.centerDistance!==n.centerDistance?t.centerDistance-n.centerDistance:t.paneId.localeCompare(n.paneId)}function c(t){const{pane:n,focusedPane:o,direction:c}=t;if("left"===c){const t=o.left-n.right;if(t<-1e-6)return null;const c=l({startA:n.top,endA:n.bottom,startB:o.top,endB:o.bottom});return{paneId:n.paneId,primaryDistance:t,secondaryDistance:p({startA:n.top,endA:n.bottom,startB:o.top,endB:o.bottom}),centerDistance:Math.abs(n.centerY-o.centerY),overlap:c}}if("right"===c){const t=n.left-o.right;if(t<-1e-6)return null;const c=l({startA:n.top,endA:n.bottom,startB:o.top,endB:o.bottom});return{paneId:n.paneId,primaryDistance:t,secondaryDistance:p({startA:n.top,endA:n.bottom,startB:o.top,endB:o.bottom}),centerDistance:Math.abs(n.centerY-o.centerY),overlap:c}}if("up"===c){const t=o.top-n.bottom;if(t<-1e-6)return null;const c=l({startA:n.left,endA:n.right,startB:o.left,endB:o.right});return{paneId:n.paneId,primaryDistance:t,secondaryDistance:p({startA:n.left,endA:n.right,startB:o.left,endB:o.right}),centerDistance:Math.abs(n.centerX-o.centerX),overlap:c}}const s=n.top-o.bottom;if(s<-1e-6)return null;const f=l({startA:n.left,endA:n.right,startB:o.left,endB:o.right});return{paneId:n.paneId,primaryDistance:s,secondaryDistance:p({startA:n.left,endA:n.right,startB:o.left,endB:o.right}),centerDistance:Math.abs(n.centerX-o.centerX),overlap:f}}function s(t,n){if("pane"===t.kind)return!0===t.pane.hidden?[]:[{paneId:t.pane.id,left:n.left,top:n.top,right:n.right,bottom:n.bottom,centerX:(n.left+n.right)/2,centerY:(n.top+n.bottom)/2}];const o=[],c=n.right-n.left,p=n.bottom-n.top;let l=0;for(let f=0;f<t.group.children.length;f+=1){const u=t.group.children[f],h=t.group.sizes[f]??0;if("horizontal"===t.group.direction){const t=n.left+c*l;l+=h;const p=n.left+c*l;o.push(...s(u,{left:t,top:n.top,right:p,bottom:n.bottom}));continue}const D=n.top+p*l;l+=h;const b=n.top+p*l;o.push(...s(u,{left:n.left,top:D,right:n.right,bottom:b}))}return o}function p(t){const{startA:n,endA:o,startB:c,endB:s}=t;return o<c?c-o:s<n?n-s:0}function l(t){const{startA:n,endA:o,startB:c,endB:s}=t;return Math.max(0,Math.min(o,s)-Math.max(n,c))}},4278,[]);
|
|
15934
15934
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useRevealInFileManager=function(p){const f=(0,t.c)(13),{serverId:v,workspaceRoot:k}=p,{t:h}=(0,o.useTranslation)(),w=(0,s.useToast)(),P=(0,n.useIsLocalDaemon)(v);let b;f[0]!==P?(b={isLocalExecution:P},f[0]=P,f[1]=b):b=f[1];const{targets:y}=(0,c.useDesktopOpenTargets)(b);let E;f[2]!==y?(E=y.find(u),f[2]=y,f[3]=E):E=f[3];const I=E;let T;f[4]!==I||f[5]!==h||f[6]!==w||f[7]!==k?(T=async t=>{if(I)try{await(0,c.openDesktopTarget)({editorId:I.id,workspacePath:k,filePath:(0,l.buildAbsoluteExplorerPath)({workspaceRoot:k,entryPath:t})})}catch(t){const o=t;w.error(o instanceof Error?o.message:h("workspace.fileExplorer.errors.revealFailed"))}},f[4]=I,f[5]=h,f[6]=w,f[7]=k,f[8]=T):T=f[8];const _=T;let x;f[9]!==I||f[10]!==_||f[11]!==k?(x=I&&k?{targetName:I.label,reveal:_}:void 0,f[9]=I,f[10]=_,f[11]=k,f[12]=x):x=f[12];return x};var t=r(d[0]);r(d[1]);var o=r(d[2]),s=r(d[3]),n=r(d[4]),l=r(d[5]),c=r(d[6]);function u(t){return"file-manager"===t.kind}},4279,[453,36,853,893,3831,4280,4198]);
|
|
Binary file
|
|
Binary file
|
|
@@ -92,6 +92,6 @@
|
|
|
92
92
|
<body>
|
|
93
93
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
94
94
|
<div id="root"></div>
|
|
95
|
-
<script src="/_expo/static/js/web/index-
|
|
95
|
+
<script src="/_expo/static/js/web/index-07333e1dc746e9125c3a2c9191992ac5.js" defer></script>
|
|
96
96
|
</body>
|
|
97
97
|
</html>
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpaseo/server",
|
|
3
|
-
"version": "0.11.0-fork.
|
|
3
|
+
"version": "0.11.0-fork.11",
|
|
4
4
|
"description": "Paseo backend server",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/server",
|
|
@@ -120,10 +120,10 @@
|
|
|
120
120
|
"lightningcss": "1.30.1"
|
|
121
121
|
},
|
|
122
122
|
"dependencies": {
|
|
123
|
-
"@getpaseo/client": "0.11.0-fork.
|
|
124
|
-
"@getpaseo/highlight": "0.11.0-fork.
|
|
125
|
-
"@getpaseo/plugin": "0.11.0-fork.
|
|
126
|
-
"@getpaseo/protocol": "0.11.0-fork.
|
|
127
|
-
"@getpaseo/relay": "0.11.0-fork.
|
|
123
|
+
"@getpaseo/client": "0.11.0-fork.11",
|
|
124
|
+
"@getpaseo/highlight": "0.11.0-fork.11",
|
|
125
|
+
"@getpaseo/plugin": "0.11.0-fork.11",
|
|
126
|
+
"@getpaseo/protocol": "0.11.0-fork.11",
|
|
127
|
+
"@getpaseo/relay": "0.11.0-fork.11"
|
|
128
128
|
}
|
|
129
129
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mduan/paseo-cli",
|
|
3
|
-
"version": "0.11.0-fork.
|
|
3
|
+
"version": "0.11.0-fork.11",
|
|
4
4
|
"description": "Paseo CLI - control your AI coding agents from the command line (mduan fork)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"paseo": "bin/paseo"
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"@clack/prompts": "^1.0.0",
|
|
22
22
|
"@codemirror/language": "6.12.4",
|
|
23
23
|
"@codemirror/legacy-modes": "^6.5.3",
|
|
24
|
-
"@getpaseo/client": "0.11.0-fork.
|
|
25
|
-
"@getpaseo/highlight": "0.11.0-fork.
|
|
26
|
-
"@getpaseo/plugin": "0.11.0-fork.
|
|
27
|
-
"@getpaseo/protocol": "0.11.0-fork.
|
|
28
|
-
"@getpaseo/relay": "0.11.0-fork.
|
|
29
|
-
"@getpaseo/server": "0.11.0-fork.
|
|
24
|
+
"@getpaseo/client": "0.11.0-fork.11",
|
|
25
|
+
"@getpaseo/highlight": "0.11.0-fork.11",
|
|
26
|
+
"@getpaseo/plugin": "0.11.0-fork.11",
|
|
27
|
+
"@getpaseo/protocol": "0.11.0-fork.11",
|
|
28
|
+
"@getpaseo/relay": "0.11.0-fork.11",
|
|
29
|
+
"@getpaseo/server": "0.11.0-fork.11",
|
|
30
30
|
"@isaacs/ttlcache": "^2.1.4",
|
|
31
31
|
"@lezer/common": "^1.5.0",
|
|
32
32
|
"@lezer/cpp": "^1.1.5",
|