@mduan/paseo-cli 0.11.0-fork.16 → 0.11.0-fork.17
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-1e8b6557f72d5bf7fcc79b1e4a9801c0.js → index-58879894a5f055434504197e7a73cd52.js} +3 -3
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-1e8b6557f72d5bf7fcc79b1e4a9801c0.js.br → index-58879894a5f055434504197e7a73cd52.js.br} +0 -0
- package/node_modules/@getpaseo/server/dist/server/web-ui/_expo/static/js/web/{index-1e8b6557f72d5bf7fcc79b1e4a9801c0.js.gz → index-58879894a5f055434504197e7a73cd52.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.17",
|
|
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.17",
|
|
48
|
+
"@getpaseo/relay": "0.11.0-fork.17"
|
|
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.17",
|
|
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.17",
|
|
70
|
+
"@getpaseo/protocol": "0.11.0-fork.17",
|
|
71
71
|
"@types/node": "^20.9.0",
|
|
72
72
|
"@types/react": "~19.2.0",
|
|
73
73
|
"react": "19.1.0",
|
|
@@ -15165,7 +15165,7 @@ __d(function(g,r,i,_a,m,e,d){'use strict';const t=r(d[0]);m.exports=(s,c,n)=>t(s
|
|
|
15165
15165
|
__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},3520,[3515]);
|
|
15166
15166
|
__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)}},3521,[3510]);
|
|
15167
15167
|
__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}},3522,[701,3523]);
|
|
15168
|
-
__d(function(e,t,r,o,i,a,n){i.exports={name:"@getpaseo/app",version:"0.11.0-fork.
|
|
15168
|
+
__d(function(e,t,r,o,i,a,n){i.exports={name:"@getpaseo/app",version:"0.11.0-fork.17",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}}}},3523,[]);
|
|
15169
15169
|
__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})}},3524,[3525,3646,3647,3658,3663,3674]);
|
|
15170
15170
|
__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)}},3525,[35,453,36,884,3526,3469,3527,3530,3532,3522,3533,3534,3535,880,3537,3538,2897,3005,3541,3539,881,3542,2981,2994,3446,3543,3550,848,3552,3562,3580,3582,3595,3454,3586,3596,3602,3631,3635,3636,3640,3642,3644,3645]);
|
|
15171
15171
|
__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}},3526,[]);
|
|
@@ -16848,11 +16848,11 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
16848
16848
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.resolveSchedulesScreenBodyState=function(t){if(t.showLoadError)return{kind:"load-error"};if("connecting"===t.loadState.status||"loading"===t.loadState.status)return{kind:"loading"};if(0===t.loadState.data.length)return{kind:"empty"};return{kind:"content"}}},5089,[]);
|
|
16849
16849
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3]);function s(){const s=(0,t.c)(1);let u;return s[0]===Symbol.for("react.memo_cache_sentinel")?(u=(0,c.jsx)(n.HostRouteBootstrapBoundary,{children:(0,c.jsx)(o.SessionsScreen,{})}),s[0]=u):u=s[0],u}},5090,[453,4938,5091,279]);
|
|
16850
16850
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SessionsScreen=function(){const s=(0,n.c)(2),o=(0,l.useIsFocused)(),{isLoading:c}=(0,C.useAppSettings)();if(!o||c){let n;return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,M.jsx)(t.View,{style:E.container}),s[0]=n):n=s[0],n}let h;s[1]===Symbol.for("react.memo_cache_sentinel")?(h=(0,M.jsx)(z,{}),s[1]=h):h=s[1];return h};var s=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]);r(d[4]),r(d[5]);var l=r(d[6]),c=r(d[7]),h=r(d[8]),u=r(d[9]),p=r(d[10]),f=r(d[11]),y=r(d[12]),x=r(d[13]),j=r(d[14]),S=r(d[15]),_=r(d[16]),b=r(d[17]),v=r(d[18]),T=r(d[19]),w=r(d[20]),I=r(d[21]),V=r(d[22]),B=r(d[23]),C=r(d[24]),H=r(d[25]),M=r(d[26]);const F=200,R=(0,h.withUnistyles)(j.LoadingSpinner),A=s=>({color:s.colors.foregroundMuted});function L(o){const l=(0,n.c)(7),{errors:c,t:h}=o;let u,p;if(l[0]!==c||l[1]!==h){let t;l[3]!==h?(t=t=>(0,M.jsx)(s.Text,{style:E.errorsBannerText,children:h("sessions.hostLoadFailed",{host:t.serverName})},t.serverId),l[3]=h,l[4]=t):t=l[4],u=c.map(t),l[0]=c,l[1]=h,l[2]=u}else u=l[2];return l[5]!==u?(p=(0,M.jsx)(t.View,{style:E.errorsBannerWrap,children:(0,M.jsx)(t.View,{style:E.errorsBanner,testID:"sessions-host-errors",children:u})}),l[5]=u,l[6]=p):p=l[6],p}function P(o){const l=(0,n.c)(12),{visible:c,onRetry:h}=o,{t:u}=(0,p.useTranslation)();if(!c)return null;let f,y,j,S,_;return l[0]!==u?(f=u("sessions.display.saveFailed"),l[0]=u,l[1]=f):f=l[1],l[2]!==f?(y=(0,M.jsx)(s.Text,{style:E.errorsBannerText,children:f}),l[2]=f,l[3]=y):y=l[3],l[4]!==u?(j=u("common.actions.retry"),l[4]=u,l[5]=j):j=l[5],l[6]!==h||l[7]!==j?(S=(0,M.jsx)(x.Button,{variant:"ghost",size:"sm",onPress:h,children:j}),l[6]=h,l[7]=j,l[8]=S):S=l[8],l[9]!==y||l[10]!==S?(_=(0,M.jsx)(t.View,{style:E.errorsBannerWrap,children:(0,M.jsxs)(t.View,{style:E.errorsBanner,testID:"sessions-preferences-error",children:[y,S]})}),l[9]=y,l[10]=S,l[11]=_):_=l[11],_}function z(){const l=(0,n.c)(116),{t:c}=(0,p.useTranslation)(),h=(0,V.useImportSession)(),j=(0,B.useHosts)(),H=(0,B.useHostRegistryLoaded)(),{settings:z,updateSettings:W}=(0,C.useAppSettings)(),{filters:k,fields:U}=z.history;let Y,K;l[0]===Symbol.for("react.memo_cache_sentinel")?(Y={id:"history-preferences"},l[0]=Y):Y=l[0],l[1]!==W?(K={scope:Y,mutationFn:s=>W(t=>({history:s(t.history)}))},l[1]=W,l[2]=K):K=l[2];const N=(0,f.useMutation)(K),{mutate:q}=N;let G;l[3]!==q?(G=s=>q(t=>Object.assign({},t,{filters:s})),l[3]=q,l[4]=G):G=l[4];const J=G;let Q;l[5]!==q?(Q=s=>q(t=>Object.assign({},t,{fields:Object.assign({},t.fields,{[s]:!t.fields[s]})})),l[5]=q,l[6]=Q):Q=l[6];const X=Q;let Z;l[7]!==q?(Z=()=>q(D),l[7]=q,l[8]=Z):Z=l[8];const $=Z,[ee,se]=(0,o.useState)(""),te=(0,I.useDebouncedValue)(ee,F);let ne;l[9]!==te?(ne=te.trim(),l[9]=te,l[10]=ne):ne=l[10];const re=ne,oe=k.status!==T.HistoryStatus.Active;let ie,le;l[11]!==k.status?(ie=k.status===T.HistoryStatus.All?{}:{archived:k.status===T.HistoryStatus.Archived},l[11]=k.status,l[12]=ie):ie=l[12],l[13]!==k.models||l[14]!==k.projects||l[15]!==k.providers||l[16]!==oe||l[17]!==ie?(le=Object.assign({projectKeys:k.projects,providers:k.providers,models:k.models,includeArchived:oe},ie),l[13]=k.models,l[14]=k.projects,l[15]=k.providers,l[16]=oe,l[17]=ie,l[18]=le):le=l[18];const ae=le;let ce;l[19]!==ae||l[20]!==k.hosts||l[21]!==re?(ce={serverIds:k.hosts,filter:ae,search:re},l[19]=ae,l[20]=k.hosts,l[21]=re,l[22]=ce):ce=l[22];const{agents:de,hasMore:he,isInitialLoad:ue,isLoadingMore:pe,isError:ge,isSearchSupported:fe,isFilterSupported:ye,filterOptions:xe,isSearchTruncated:je,hostErrors:me,loadMore:Se,refreshAll:_e}=(0,w.useAgentHistory)(ce),be=fe&&re.length>0;let ve,Te;l[23]!==k||l[24]!==j||l[25]!==H||l[26]!==J?(ve=()=>{if(!H)return;const s=k.hosts.filter(s=>j.some(t=>t.serverId===s));s.length!==k.hosts.length&&J(Object.assign({},k,{hosts:s}))},Te=[j,H,k,J],l[23]=k,l[24]=j,l[25]=H,l[26]=J,l[27]=ve,l[28]=Te):(ve=l[27],Te=l[28]),(0,o.useEffect)(ve,Te);const[we,Ie]=(0,o.useState)(!1);let Ve;l[29]!==_e?(Ve=()=>{Ie(!0),_e().finally(()=>Ie(!1))},l[29]=_e,l[30]=Ve):Ve=l[30];const Be=Ve;let Ce;l[31]!==k||l[32]!==ye?(Ce=ye?(0,b.hasHistoryFilters)(k):k.hosts.length>0,l[31]=k,l[32]=ye,l[33]=Ce):Ce=l[33];const He=Ce;let Me;l[34]!==He||l[35]!==be||l[36]!==c?(Me=c(be||He?"sessions.noMatches":"sessions.empty"),l[34]=He,l[35]=be,l[36]=c,l[37]=Me):Me=l[37];const Fe=Me,Re=ge&&0===de.length,Ae=!ue&&!Re,Le=O;let Pe;l[38]!==J?(Pe=()=>{se(""),J(T.EMPTY_HISTORY_FILTERS)},l[38]=J,l[39]=Pe):Pe=l[39];const ze=Pe;let Oe;e:{if(je){let n,o;l[40]!==c?(n=c("sessions.tooManyMatches"),l[40]=c,l[41]=n):n=l[41],l[42]!==n?(o=(0,M.jsx)(t.View,{style:E.footer,children:(0,M.jsx)(s.Text,{style:E.footerHint,children:n})}),l[42]=n,l[43]=o):o=l[43],Oe=o;break e}if(!he){Oe=null;break e}let n,o;l[44]!==pe||l[45]!==c?(n=pe?"Loading...":c("sessions.actions.loadMore"),l[44]=pe,l[45]=c,l[46]=n):n=l[46],l[47]!==pe||l[48]!==Se||l[49]!==n?(o=(0,M.jsx)(t.View,{style:E.footer,children:(0,M.jsx)(x.Button,{variant:"ghost",onPress:Se,disabled:pe,children:n})}),l[47]=pe,l[48]=Se,l[49]=n,l[50]=o):o=l[50],Oe=o}const De=Oe;let Ee;l[51]!==xe||l[52]!==k||l[53]!==ye||l[54]!==J?(Ee=(0,M.jsx)(b.HistoryFilterBar,{filters:k,options:xe,supported:ye,onChange:J}),l[51]=xe,l[52]=k,l[53]=ye,l[54]=J,l[55]=Ee):Ee=l[55];const We=Ee;let ke;l[56]!==U||l[57]!==X?(ke=(0,M.jsx)(v.HistoryDisplayMenu,{fields:U,onToggle:X}),l[56]=U,l[57]=X,l[58]=ke):ke=l[58];const Ue=ke;let Ye,Ke,Ne,qe,Ge,Je,Qe,Xe,Ze,$e,es,ss,ts,ns;return l[59]!==c?(Ye=c("sessions.title"),l[59]=c,l[60]=Ye):Ye=l[60],l[61]!==Ye?(Ke=(0,M.jsx)(y.MenuHeader,{title:Ye}),l[61]=Ye,l[62]=Ke):Ke=l[62],l[63]!==fe||l[64]!==ee||l[65]!==c?(Ne=fe?(0,M.jsx)(t.View,{style:E.searchField,children:(0,M.jsx)(_.SearchField,{fullWidth:!0,value:ee,onChangeText:se,placeholder:c("sessions.searchPlaceholder"),clearAccessibilityLabel:c("sessions.actions.clearSearch"),testID:"sessions-search-input",clearTestID:"sessions-search-clear"})}):null,l[63]=fe,l[64]=ee,l[65]=c,l[66]=Ne):Ne=l[66],l[67]!==Ne?(qe=(0,M.jsx)(t.View,{style:E.searchRow,children:Ne}),l[67]=Ne,l[68]=qe):qe=l[68],l[69]!==We?(Ge=(0,M.jsx)(t.View,{style:E.searchField,children:We}),l[69]=We,l[70]=Ge):Ge=l[70],l[71]!==Ue||l[72]!==Ge?(Je=(0,M.jsxs)(t.View,{style:E.searchRow,children:[Ge,Ue]}),l[71]=Ue,l[72]=Ge,l[73]=Je):Je=l[73],l[74]!==qe||l[75]!==Je?(Qe=(0,M.jsxs)(t.View,{style:E.filterContainer,children:[qe,Je]}),l[74]=qe,l[75]=Je,l[76]=Qe):Qe=l[76],l[77]!==$||l[78]!==N.isError?(Xe=(0,M.jsx)(P,{visible:N.isError,onRetry:$}),l[77]=$,l[78]=N.isError,l[79]=Xe):Xe=l[79],l[80]!==me||l[81]!==c?(Ze=me.length>0?(0,M.jsx)(L,{errors:me,t:c}):null,l[80]=me,l[81]=c,l[82]=Ze):Ze=l[82],l[83]!==ue?($e=ue?(0,M.jsx)(t.View,{style:E.loadingContainer,children:(0,M.jsx)(R,{size:"large",uniProps:A})}):null,l[83]=ue,l[84]=$e):$e=l[84],l[85]!==Be||l[86]!==Re?(es=Re?(0,M.jsxs)(t.View,{style:E.emptyContainer,children:[(0,M.jsx)(s.Text,{style:E.emptyText,children:"Unable to load sessions"}),(0,M.jsx)(x.Button,{variant:"ghost",onPress:Be,children:"Try again"})]}):null,l[85]=Be,l[86]=Re,l[87]=es):es=l[87],l[88]!==de||l[89]!==Fe||l[90]!==ze||l[91]!==h.open||l[92]!==He||l[93]!==be||l[94]!==Ae||l[95]!==c?(ss=Ae&&0===de.length?(0,M.jsxs)(t.View,{style:E.emptyContainer,testID:"sessions-empty",children:[(0,M.jsx)(s.Text,{style:E.emptyText,children:Fe}),be||He?(0,M.jsx)(x.Button,{variant:"ghost",onPress:ze,children:c("sessions.filters.clear")}):(0,M.jsx)(x.Button,{variant:"ghost",leftIcon:u.ChevronLeft,onPress:Le,children:"Back"}),(0,M.jsx)(x.Button,{variant:"ghost",leftIcon:u.Import,onPress:h.open,children:c("importSession.title")})]}):null,l[88]=de,l[89]=Fe,l[90]=ze,l[91]=h.open,l[92]=He,l[93]=be,l[94]=Ae,l[95]=c,l[96]=ss):ss=l[96],l[97]!==de||l[98]!==U||l[99]!==Be||l[100]!==we||l[101]!==be||l[102]!==De||l[103]!==re||l[104]!==Ae?(ts=Ae&&de.length>0?(0,M.jsx)(S.AgentList,{agents:de,isRefreshing:we,onRefresh:Be,listFooterComponent:De,showAttentionIndicator:!1,fields:U,search:be?re:void 0}):null,l[97]=de,l[98]=U,l[99]=Be,l[100]=we,l[101]=be,l[102]=De,l[103]=re,l[104]=Ae,l[105]=ts):ts=l[105],l[106]!==h.sheet||l[107]!==Ke||l[108]!==Qe||l[109]!==Xe||l[110]!==Ze||l[111]!==$e||l[112]!==es||l[113]!==ss||l[114]!==ts?(ns=(0,M.jsxs)(t.View,{style:E.container,children:[Ke,Qe,Xe,Ze,$e,es,ss,ts,h.sheet]}),l[106]=h.sheet,l[107]=Ke,l[108]=Qe,l[109]=Xe,l[110]=Ze,l[111]=$e,l[112]=es,l[113]=ss,l[114]=ts,l[115]=ns):ns=l[115],ns}function O(){c.router.navigate((0,H.buildOpenProjectRoute)())}function D(s){return s}const E=h.StyleSheet.create(s=>({container:{flex:1,backgroundColor:s.colors.surface0,uni__dependencies:[0]},filterContainer:{gap:s.spacing[3],paddingHorizontal:{xs:s.spacing[3],md:s.spacing[6]},paddingTop:s.spacing[4],uni__dependencies:[0]},searchRow:{flexDirection:"row",alignItems:"center",gap:s.spacing[2],uni__dependencies:[0]},searchField:{flex:1},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",gap:s.spacing[6],padding:s.spacing[6],uni__dependencies:[0]},emptyText:{color:s.colors.foregroundMuted,fontSize:s.fontSize.base,uni__dependencies:[0]},loadingContainer:{flex:1,justifyContent:"center",alignItems:"center"},footer:{alignItems:"center",paddingVertical:s.spacing[4],uni__dependencies:[0]},footerHint:{color:s.colors.foregroundMuted,fontSize:s.fontSize.base,uni__dependencies:[0]},errorsBannerWrap:{paddingHorizontal:{xs:s.spacing[3],md:s.spacing[6]},paddingTop:s.spacing[3],uni__dependencies:[0]},errorsBanner:{borderWidth:s.borderWidth[1],borderColor:s.colors.border,borderRadius:s.borderRadius.lg,padding:s.spacing[3],gap:s.spacing[1],uni__dependencies:[0]},errorsBannerText:{color:s.colors.palette.red[300],fontSize:s.fontSize.sm,uni__dependencies:[0]}}))},5091,[896,895,453,36,146,234,460,455,56,1217,853,799,4104,3009,3010,5092,4737,5096,5097,2896,5098,3825,3802,3525,883,3669,279]);
|
|
16851
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AgentList=function(t){const c=(0,l.c)(70),{agents:u,isRefreshing:x,onRefresh:y,selectedAgentId:j,onAgentSelect:S,listFooterComponent:C,showAttentionIndicator:_,fields:I,search:A}=t,P=void 0!==x&&x,U=void 0===_||_,{t:B}=(0,b.useTranslation)(),L=(0,p.useSafeAreaInsets)(),[M,R]=(0,f.useState)(null),D=(0,v.useIsCompactFormFactor)(),{archiveAgent:W}=(0,k.useArchiveAgent)();let H;c[0]!==M?(H=e=>M?.serverId?e.sessions[M.serverId]?.client??null:null,c[0]=M,c[1]=H):H=c[1];const $=(0,w.useSessionStore)(H),F=null!==M,O=Boolean(M?.serverId&&!$);let N;c[2]!==F||c[3]!==S?(N=e=>{if(F)return;const t=e.serverId,n=e.id;S?.(),(0,T.navigateToAgent)({serverId:t,agentId:n,workspaceId:e.workspaceId,pin:!0})},c[2]=F,c[3]=S,c[4]=N):N=c[4];const J=N;let Q;c[5]!==W?(Q=e=>{if("running"===e.status)return void R(e);w.useSessionStore.getState().sessions[e.serverId]?.client??null?W({serverId:e.serverId,agentId:e.id}).catch(oe):R(e)},c[5]=W,c[6]=Q):Q=c[6];const X=Q;let Z;c[7]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{R(null)},c[7]=Z):Z=c[7];const ee=Z;let te;c[8]!==M||c[9]!==$||c[10]!==W?(te=()=>{M&&$&&(W({serverId:M.serverId,agentId:M.id}).catch(se),R(null))},c[8]=M,c[9]=$,c[10]=W,c[11]=te):te=c[11];const re=te;let ae;if(c[12]!==u){const e=new Map;for(const t of u){const n=K(t.lastActivityAt),s=e.get(n)??[];s.push(t),e.set(n,s)}ae=[];for(const t of q){const n=e.get(t);if(n&&0!==n.length){ae.push({type:"header",key:`header:${t}`,section:t});for(const e of n)ae.push({type:"agent",key:`${e.serverId}:${e.id}`,agent:e})}}c[12]=u,c[13]=ae}else ae=c[13];const le=ae;let ce;c[14]!==I||c[15]!==X||c[16]!==J||c[17]!==D||c[18]!==A||c[19]!==j||c[20]!==U||c[21]!==B?(ce=e=>{const{item:t}=e;return"header"===t.type?(0,z.jsx)(o.View,{style:ie.sectionHeading,children:(0,z.jsx)(s.Text,{style:ie.sectionTitle,children:G(B,t.section)})}):(0,z.jsx)(Y,{agent:t.agent,search:A,isMobile:D,selectedAgentId:j,showAttentionIndicator:U,fields:I,onPress:J,onLongPress:X})},c[14]=I,c[15]=X,c[16]=J,c[17]=D,c[18]=A,c[19]=j,c[20]=U,c[21]=B,c[22]=ce):ce=c[22];const de=ce,ue=ne,ge=Math.max(L.bottom,24);let he;c[23]!==ge?(he=[ie.sheetContainer,{paddingBottom:ge}],c[23]=ge,c[24]=he):he=c[24];const pe=he,fe=O&&ie.sheetArchiveTextDisabled;let me;c[25]!==fe?(me=[ie.sheetArchiveText,fe],c[25]=fe,c[26]=me):me=c[26];const xe=me;let be;c[27]!==P||c[28]!==y?(be=y?(0,z.jsx)(E,{refreshing:P,onRefresh:y,uniProps:V}):void 0,c[27]=P,c[28]=y,c[29]=be):be=c[29];const ve=be;let ye,we,je,Se,Ce,Ie,Te,ke,Ae,Pe,Ue,Be,Le,Me,Re,ze;c[30]!==le||c[31]!==C||c[32]!==ve||c[33]!==de?(ye=(0,z.jsx)(e.FlatList,{data:le,style:ie.list,contentContainerStyle:ie.listContent,keyExtractor:ue,renderItem:de,showsVerticalScrollIndicator:!1,keyboardShouldPersistTaps:"handled",ListFooterComponent:C,refreshControl:ve}),c[30]=le,c[31]=C,c[32]=ve,c[33]=de,c[34]=ye):ye=c[34];c[35]===Symbol.for("react.memo_cache_sentinel")?(we=(0,z.jsx)(n.Pressable,{style:ie.sheetBackdrop,onPress:ee}),c[35]=we):we=c[35];c[36]===Symbol.for("react.memo_cache_sentinel")?(je=(0,z.jsx)(o.View,{style:ie.sheetHandle}),c[36]=je):je=c[36];c[37]!==O||c[38]!==B?(Se=B(O?"agentList.archiveSheet.hostOffline":"agentList.archiveSheet.runningAgent"),c[37]=O,c[38]=B,c[39]=Se):Se=c[39];c[40]!==Se?(Ce=(0,z.jsx)(s.Text,{style:ie.sheetTitle,children:Se}),c[40]=Se,c[41]=Ce):Ce=c[41];c[42]===Symbol.for("react.memo_cache_sentinel")?(Ie=[ie.sheetButton,ie.sheetCancelButton],c[42]=Ie):Ie=c[42];c[43]!==B?(Te=B("common.actions.cancel"),c[43]=B,c[44]=Te):Te=c[44];c[45]!==Te?(ke=(0,z.jsx)(n.Pressable,{style:Ie,onPress:ee,testID:"agent-action-cancel",children:(0,z.jsx)(s.Text,{style:ie.sheetCancelText,children:Te})}),c[45]=Te,c[46]=ke):ke=c[46];c[47]===Symbol.for("react.memo_cache_sentinel")?(Ae=[ie.sheetButton,ie.sheetArchiveButton],c[47]=Ae):Ae=c[47];c[48]!==B?(Pe=B("agentList.archiveSheet.archive"),c[48]=B,c[49]=Pe):Pe=c[49];c[50]!==xe||c[51]!==Pe?(Ue=(0,z.jsx)(s.Text,{style:xe,children:Pe}),c[50]=xe,c[51]=Pe,c[52]=Ue):Ue=c[52];c[53]!==re||c[54]!==O||c[55]!==Ue?(Be=(0,z.jsx)(n.Pressable,{disabled:O,style:Ae,onPress:re,testID:"agent-action-archive",children:Ue}),c[53]=re,c[54]=O,c[55]=Ue,c[56]=Be):Be=c[56];c[57]!==ke||c[58]!==Be?(Le=(0,z.jsxs)(o.View,{style:ie.sheetButtonRow,children:[ke,Be]}),c[57]=ke,c[58]=Be,c[59]=Le):Le=c[59];c[60]!==pe||c[61]!==Ce||c[62]!==Le?(Me=(0,z.jsxs)(o.View,{style:ie.sheetOverlay,children:[we,(0,z.jsxs)(o.View,{style:pe,children:[je,Ce,Le]})]}),c[60]=pe,c[61]=Ce,c[62]=Le,c[63]=Me):Me=c[63];c[64]!==F||c[65]!==Me?(Re=(0,z.jsx)(h.default,{visible:F,animationType:"fade",transparent:!0,onRequestClose:ee,children:Me}),c[64]=F,c[65]=Me,c[66]=Re):Re=c[66];c[67]!==ye||c[68]!==Re?(ze=(0,z.jsxs)(z.Fragment,{children:[ye,Re]}),c[67]=ye,c[68]=Re,c[69]=ze):ze=c[69];return ze};var e=r(d[0]),t=r(d[1]),n=r(d[2]),s=r(d[3]),o=r(d[4]),l=r(d[5]);r(d[6]),r(d[7]),r(d[8]);var c,u=r(d[9]),h=(c=u)&&c.__esModule?c:{default:c};r(d[10]),r(d[11]);var p=r(d[12]),f=r(d[13]),x=r(d[14]),b=r(d[15]),v=r(d[16]),y=r(d[17]),w=r(d[18]),j=r(d[19]),S=r(d[20]),C=r(d[21]),_=r(d[22]),I=r(d[23]),T=r(d[24]),k=r(d[25]),A=r(d[26]),P=r(d[27]),U=r(d[28]),B=r(d[29]),L=r(d[30]),M=r(d[31]),R=r(d[32]),z=r(d[33]);const D=e=>({color:e.colors.foregroundMuted}),V=e=>({tintColor:e.colors.foregroundMuted,colors:[e.colors.foregroundMuted]}),W=(0,x.withUnistyles)(j.Archive),H=(0,x.withUnistyles)(j.Folder),$=(0,x.withUnistyles)(j.GitBranch),F=(0,x.withUnistyles)(j.Server),O=(0,x.withUnistyles)(j.ChevronRight),E=(0,x.withUnistyles)(t.RefreshControl),q=["today","yesterday","thisWeek","thisMonth","older"];function K(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),s=new Date(n.getTime()-864e5),o=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(o.getTime()>=n.getTime())return"today";if(o.getTime()>=s.getTime())return"yesterday";const l=n.getTime()-o.getTime(),c=Math.floor(l/864e5);return c<=7?"thisWeek":c<=30?"thisMonth":"older"}function G(e,t){switch(t){case"today":return e("agentList.dateSections.today");case"yesterday":return e("agentList.dateSections.yesterday");case"thisWeek":return e("agentList.dateSections.thisWeek");case"thisMonth":return e("agentList.dateSections.thisMonth");case"older":return e("agentList.dateSections.older")}}function N(e){const t=(0,l.c)(9),{pendingPermissionCount:n,showAttention:s}=e,{t:o}=(0,b.useTranslation)();let c,u,h;return t[0]!==n||t[1]!==o?(c=n>0?(0,z.jsx)(L.StatusBadge,{label:o("agentList.badges.pending",{count:n}),variant:"warning"}):null,t[0]=n,t[1]=o,t[2]=c):c=t[2],t[3]!==s||t[4]!==o?(u=s?(0,z.jsx)(L.StatusBadge,{label:o("agentList.badges.attention"),variant:"error"}):null,t[3]=s,t[4]=o,t[5]=u):u=t[5],t[6]!==c||t[7]!==u?(h=(0,z.jsxs)(z.Fragment,{children:[c,u]}),t[6]=c,t[7]=u,t[8]=h):h=t[8],h}function Y(e){const t=(0,l.c)(28),{agent:s,search:c,isMobile:u,selectedAgentId:h,showAttentionIndicator:p,fields:f,onPress:x,onLongPress:v}=e,{t:y}=(0,b.useTranslation)(),w=h===`${s.serverId}:${s.id}`,j=s.pendingPermissionCount??0,S=c??"",C=s.title??"";let _;t[0]!==S||t[1]!==C?(_=(0,M.findHighlightRanges)(S,C),t[0]=S,t[1]=C,t[2]=_):_=t[2];const I=_;let T;t[3]!==w?(T=e=>{const{pressed:t,hovered:n}=e,s=void 0!==n&&n;return[ie.row,w&&ie.rowSelected,Boolean(s)&&ie.rowHovered,t&&ie.rowPressed]},t[3]=w,t[4]=T):T=t[4];const k=T;let P;t[5]!==s||t[6]!==x?(P=()=>x(s),t[5]=s,t[6]=x,t[7]=P):P=t[7];const U=P;let B;t[8]!==s||t[9]!==v?(B=()=>v(s),t[8]=s,t[9]=v,t[10]=B):B=t[10];const R=B;let V;t[11]===Symbol.for("react.memo_cache_sentinel")?(V=(0,z.jsx)(W,{size:12,uniProps:D}),t[11]=V):V=t[11];const H=V,$=p&&Boolean(s.requiresAttention),F=`agent-row-${s.serverId}-${s.id}`;let O,E;return t[12]!==s||t[13]!==f||t[14]!==u||t[15]!==w||t[16]!==j||t[17]!==c||t[18]!==$||t[19]!==y||t[20]!==I?(O=e=>{const{hovered:t,pressed:n}=e,l=void 0!==t&&t;return(0,z.jsxs)(o.View,{style:ie.rowContent,children:[(0,z.jsxs)(o.View,{style:ie.rowTitleRow,children:[f.provider?(0,z.jsx)(Q,{agent:s,showStatus:f.status,backdrop:J({hovered:l,pressed:n,isSelected:w})}):null,(0,z.jsx)(A.HighlightedText,{text:s.title||y("agentList.fallbackTitle"),ranges:I,style:ie.sessionTitle,numberOfLines:u?2:1,testID:`agent-row-title-${s.serverId}-${s.id}`}),(0,z.jsxs)(o.View,{style:ie.rowEnd,children:[(0,z.jsx)(N,{pendingPermissionCount:j,showAttention:$}),f.lastActivity?(0,z.jsx)(te,{date:s.lastActivityAt}):null]})]}),(0,z.jsxs)(o.View,{style:ie.rowMetaRow,children:[(0,z.jsx)(X,{agent:s,fields:f,search:c}),(0,z.jsx)(Z,{agent:s,fields:f}),f.status&&s.archivedAt?(0,z.jsx)(L.StatusBadge,{label:y("agentList.badges.archived"),leading:H,size:"xs",style:ie.archivedBadge}):null]})]})},t[12]=s,t[13]=f,t[14]=u,t[15]=w,t[16]=j,t[17]=c,t[18]=$,t[19]=y,t[20]=I,t[21]=O):O=t[21],t[22]!==R||t[23]!==U||t[24]!==k||t[25]!==F||t[26]!==O?(E=(0,z.jsx)(n.Pressable,{style:k,onPress:U,onLongPress:R,accessibilityRole:"button",testID:F,children:O}),t[22]=R,t[23]=U,t[24]=k,t[25]=F,t[26]=O,t[27]=E):E=t[27],E}function J({hovered:e,pressed:t,isSelected:n}){return t?"surface2":e?"surface1":n?"surface2":"surface0"}function Q(e){const t=(0,l.c)(15),{agent:n,showStatus:s,backdrop:c}=e,u=(0,S.useProviderIcon)(n.provider,n.serverId),h="open"===n.turn.phase?"running":n.status;let p;t[0]!==n.attentionReason||t[1]!==n.pendingPermissionCount||t[2]!==n.requiresAttention||t[3]!==h?(p=(0,_.deriveSidebarStateBucket)({status:h,requiresAttention:n.requiresAttention,attentionReason:n.attentionReason,pendingPermissionCount:n.pendingPermissionCount}),t[0]=n.attentionReason,t[1]=n.pendingPermissionCount,t[2]=n.requiresAttention,t[3]=h,t[4]=p):p=t[4];const f=p,x=s?f:null;let b;t[5]!==u||t[6]!==x?(b={icon:u,statusBucket:x},t[5]=u,t[6]=x,t[7]=b):b=t[7];const v=b,y=s?I.STATUS_BUCKET_LABELS[f]:void 0,w=`agent-row-icon-${n.serverId}-${n.id}`;let j,T;return t[8]!==c||t[9]!==v?(j=(0,z.jsx)(C.WorkspaceTabIcon,{presentation:v,backdrop:c}),t[8]=c,t[9]=v,t[10]=j):j=t[10],t[11]!==y||t[12]!==w||t[13]!==j?(T=(0,z.jsx)(o.View,{role:"status",accessibilityLabel:y,testID:w,children:j}),t[11]=y,t[12]=w,t[13]=j,t[14]=T):T=t[14],T}function X(e){const t=(0,l.c)(38),{agent:n,fields:c,search:u}=e,h=n.projectPlacement?.projectName??"",p=n.projectPlacement?.checkout.currentBranch??"",f=n.projectPlacement?.workspaceName??"",x=c.project&&Boolean(h),b=c.workspace&&Boolean(f),v=c.branch&&Boolean(p),y=x||b,w=u??"";let j;t[0]!==w||t[1]!==f?(j=(0,M.findHighlightRanges)(w,f),t[0]=w,t[1]=f,t[2]=j):j=t[2];const S=u??"";let C;t[3]!==p||t[4]!==S?(C=(0,M.findHighlightRanges)(S,p),t[3]=p,t[4]=S,t[5]=C):C=t[5];const _=u??"";let I,T;t[6]!==h||t[7]!==_?(I=(0,M.findHighlightRanges)(_,h),t[6]=h,t[7]=_,t[8]=I):I=t[8],t[9]!==j||t[10]!==C||t[11]!==I?(T={workspace:j,branch:C,project:I},t[9]=j,t[10]=C,t[11]=I,t[12]=T):T=t[12];const k=T;let P,U,L,R;return t[13]!==n.cwd||t[14]!==n.id||t[15]!==n.projectPlacement?.projectKey||t[16]!==n.serverId||t[17]!==h||t[18]!==k||t[19]!==y||t[20]!==x||t[21]!==b||t[22]!==f?(P=y?(0,z.jsxs)(o.View,{style:ie.metaItem,children:[x?(0,z.jsxs)(o.View,{style:ie.metaItem,children:[(0,z.jsx)(B.ProjectIconView,{iconDataUri:null,initial:h.charAt(0).toUpperCase(),projectViewKey:n.projectPlacement?.projectKey??n.cwd,size:14,textStyle:ie.projectIconText}),(0,z.jsx)(A.HighlightedText,{text:h,ranges:k.project,style:ie.sessionMetaText,numberOfLines:1,testID:`agent-row-project-${n.serverId}-${n.id}`})]}):null,b?(0,z.jsxs)(o.View,{style:ie.metaItem,children:[x?(0,z.jsx)(O,{size:12,uniProps:D}):null,(0,z.jsx)(H,{size:14,uniProps:D}),(0,z.jsx)(A.HighlightedText,{text:f,ranges:k.workspace,style:ie.sessionMetaText,numberOfLines:1,testID:`agent-row-workspace-${n.serverId}-${n.id}`})]}):null]}):null,t[13]=n.cwd,t[14]=n.id,t[15]=n.projectPlacement?.projectKey,t[16]=n.serverId,t[17]=h,t[18]=k,t[19]=y,t[20]=x,t[21]=b,t[22]=f,t[23]=P):P=t[23],t[24]!==n.id||t[25]!==n.serverId||t[26]!==p||t[27]!==k||t[28]!==v||t[29]!==y?(U=v?(0,z.jsxs)(o.View,{style:ie.metaItem,children:[y?(0,z.jsx)(s.Text,{style:ie.sessionMetaSeparator,children:"\xb7"}):null,(0,z.jsx)($,{size:14,uniProps:D}),(0,z.jsx)(A.HighlightedText,{text:p,ranges:k.branch,style:ie.sessionMetaText,numberOfLines:1,testID:`agent-row-branch-${n.serverId}-${n.id}`})]}):null,t[24]=n.id,t[25]=n.serverId,t[26]=p,t[27]=k,t[28]=v,t[29]=y,t[30]=U):U=t[30],t[31]!==n.serverLabel||t[32]!==c.host?(L=c.host?(0,z.jsxs)(o.View,{style:ie.metaItem,children:[(0,z.jsx)(F,{size:14,uniProps:D}),(0,z.jsx)(s.Text,{style:ie.sessionMetaText,numberOfLines:1,children:n.serverLabel})]}):null,t[31]=n.serverLabel,t[32]=c.host,t[33]=L):L=t[33],t[34]!==L||t[35]!==P||t[36]!==U?(R=(0,z.jsxs)(z.Fragment,{children:[P,U,L]}),t[34]=L,t[35]=P,t[36]=U,t[37]=R):R=t[37],R}function Z(e){const t=(0,l.c)(21),{agent:n,fields:c}=e,{t:u}=(0,b.useTranslation)();let h;t[0]!==n||t[1]!==c.model||t[2]!==u?(h=c.model?n.model??u("sessions.filters.unknownModel"):void 0,t[0]=n,t[1]=c.model,t[2]=u,t[3]=h):h=t[3];const p=h;let f;t[4]!==n||t[5]!==c.effort?(f=c.effort&&n.thinkingOptionId?(0,U.formatThinkingOptionLabel)({id:n.thinkingOptionId}):void 0,t[4]=n,t[5]=c.effort,t[6]=f):f=t[6];const x=f;let v;t[7]!==n||t[8]!==c.turns?(v=c.turns?(0,R.formatTurnCount)(n.turnCount):void 0,t[7]=n,t[8]=c.turns,t[9]=v):v=t[9];const y=v;let w;t[10]!==x||t[11]!==p||t[12]!==y?(w=[p,x,y].filter(Boolean),t[10]=x,t[11]=p,t[12]=y,t[13]=w):w=t[13];const j=w.join(" \xb7 ");if(!j&&!c.cost)return null;let S,C;return t[14]!==n||t[15]!==c.cost||t[16]!==j?(S=c.cost?(0,z.jsx)(ee,{agent:n,prefix:Boolean(j)}):null,t[14]=n,t[15]=c.cost,t[16]=j,t[17]=S):S=t[17],t[18]!==j||t[19]!==S?(C=(0,z.jsx)(o.View,{style:ie.metaItem,children:(0,z.jsxs)(s.Text,{style:ie.sessionMetaText,children:[j,S]})}),t[18]=j,t[19]=S,t[20]=C):C=t[20],C}function ee(e){const t=(0,l.c)(25),{agent:n,prefix:o}=e,{t:c}=(0,b.useTranslation)(),u=n.lastUsage;let h,p,f,x,v,y,w,j;if(t[0]!==n.lastUsage?.totalCostUnavailable||t[1]!==o||t[2]!==c||t[3]!==u?.paseoSubagentCostEstimated||t[4]!==u?.paseoSubagentCostUsd||t[5]!==u?.subagentCostUsd||t[6]!==u?.totalCostEstimated||t[7]!==u?.totalCostUnavailable||t[8]!==u?.totalCostUsd){const e=(0,P.resolveAgentCostBreakdown)({totalCostUsd:u?.totalCostUsd,subagentCostUsd:u?.subagentCostUsd,paseoSubagentCostUsd:u?.paseoSubagentCostUsd,totalCostUnavailable:u?.totalCostUnavailable}),l=e?.totalCostUsd??u?.totalCostUsd;p=void 0===l||n.lastUsage?.totalCostUnavailable?null:(0,P.formatSessionCost)(l),f=u?.totalCostEstimated||u?.paseoSubagentCostEstimated,v=o?" \xb7 ":void 0,h=s.Text,x=f&&p?c("sessions.filters.estimatedCost",{cost:p}):void 0,t[0]=n.lastUsage?.totalCostUnavailable,t[1]=o,t[2]=c,t[3]=u?.paseoSubagentCostEstimated,t[4]=u?.paseoSubagentCostUsd,t[5]=u?.subagentCostUsd,t[6]=u?.totalCostEstimated,t[7]=u?.totalCostUnavailable,t[8]=u?.totalCostUsd,t[9]=h,t[10]=p,t[11]=f,t[12]=x,t[13]=v}else h=t[9],p=t[10],f=t[11],x=t[12],v=t[13];return t[14]!==p||t[15]!==f||t[16]!==c?(y=p?`${f?"~":""}${p}`:c("sessions.filters.costUnavailable"),t[14]=p,t[15]=f,t[16]=c,t[17]=y):y=t[17],t[18]!==h||t[19]!==x||t[20]!==y?(w=(0,z.jsx)(h,{accessibilityLabel:x,children:y}),t[18]=h,t[19]=x,t[20]=y,t[21]=w):w=t[21],t[22]!==v||t[23]!==w?(j=(0,z.jsxs)(z.Fragment,{children:[v,w]}),t[22]=v,t[23]=w,t[24]=j):j=t[24],j}function te(e){const t=(0,l.c)(2),{date:n}=e,o=(0,y.useTimeAgo)(n);let c;return t[0]!==o?(c=(0,z.jsx)(s.Text,{style:ie.activityTime,numberOfLines:1,children:o}),t[0]=o,t[1]=c):c=t[1],c}function ne(e){return e.key}function se(){}function oe(){}const ie=x.StyleSheet.create(e=>({list:{flex:1,minHeight:0},listContent:{paddingHorizontal:{xs:e.spacing[3],md:e.spacing[6]},paddingTop:e.spacing[4],paddingBottom:e.spacing[6],gap:e.spacing[1],uni__dependencies:[0]},sectionHeading:{marginTop:e.spacing[2],flexDirection:"row",alignItems:"center",gap:e.spacing[3],paddingHorizontal:e.spacing[3],marginBottom:e.spacing[2],uni__dependencies:[0]},sectionTitle:{fontSize:e.fontSize.base,fontWeight:e.fontWeight.medium,color:e.colors.foregroundMuted,uni__dependencies:[0]},row:{flexDirection:"row",alignItems:"center",paddingVertical:e.spacing[3],paddingHorizontal:e.spacing[3],borderRadius:{xs:e.borderRadius.lg,md:0},marginBottom:{xs:e.spacing[1],md:0},uni__dependencies:[0]},rowContent:{flex:1,minWidth:0},rowTitleRow:{flexDirection:"row",alignItems:"center",flexWrap:"nowrap",gap:e.spacing[2],uni__dependencies:[0]},rowMetaRow:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",columnGap:e.spacing[3],rowGap:e.spacing[1],marginTop:e.spacing[1.5],uni__dependencies:[0]},archivedBadge:{marginVertical:-e.spacing[.5],uni__dependencies:[0]},rowSelected:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},rowHovered:{backgroundColor:e.colors.surface1,uni__dependencies:[0]},rowPressed:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},sessionTitle:{flex:1,minWidth:0,fontSize:e.fontSize.base,fontWeight:e.fontWeight.normal,color:e.colors.foreground,uni__dependencies:[0]},sessionMetaText:{flexShrink:1,maxWidth:"100%",fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,uni__dependencies:[0]},sessionMetaSeparator:{fontSize:e.fontSize.base,color:e.colors.foregroundMuted,opacity:.7,uni__dependencies:[0]},metaItem:{flexDirection:"row",alignItems:"center",gap:e.spacing[1.5],maxWidth:"100%",flexShrink:1,uni__dependencies:[0]},rowEnd:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],flexShrink:0,uni__dependencies:[0]},activityTime:{fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,uni__dependencies:[0]},projectIconText:{fontSize:8},sheetOverlay:{flex:1,justifyContent:"flex-end"},sheetBackdrop:{position:"absolute",top:0,right:0,bottom:0,left:0,backgroundColor:"rgba(0,0,0,0.35)"},sheetContainer:{backgroundColor:e.colors.surface2,borderTopLeftRadius:e.borderRadius["2xl"],borderTopRightRadius:e.borderRadius["2xl"],paddingHorizontal:e.spacing[6],paddingTop:e.spacing[4],gap:e.spacing[4],uni__dependencies:[0]},sheetHandle:{alignSelf:"center",width:40,height:4,borderRadius:e.borderRadius.full,backgroundColor:e.colors.foregroundMuted,opacity:.3,uni__dependencies:[0]},sheetTitle:{fontSize:e.fontSize.base,fontWeight:e.fontWeight.semibold,color:e.colors.foreground,textAlign:"center",uni__dependencies:[0]},sheetButtonRow:{flexDirection:"row",gap:e.spacing[3],uni__dependencies:[0]},sheetButton:{flex:1,borderRadius:e.borderRadius.lg,paddingVertical:e.spacing[4],alignItems:"center",justifyContent:"center",uni__dependencies:[0]},sheetArchiveButton:{backgroundColor:e.colors.primary,uni__dependencies:[0]},sheetArchiveText:{color:e.colors.primaryForeground,fontWeight:e.fontWeight.semibold,fontSize:e.fontSize.base,uni__dependencies:[0]},sheetArchiveTextDisabled:{opacity:.5},sheetCancelButton:{backgroundColor:e.colors.surface1,uni__dependencies:[0]},sheetCancelText:{color:e.colors.foreground,fontWeight:e.fontWeight.semibold,fontSize:e.fontSize.base,uni__dependencies:[0]}}))},5092,[984,5093,897,896,895,453,146,234,425,418,181,144,626,36,56,853,1216,3823,3446,1217,3811,4225,3463,4121,3779,3605,5094,4220,4222,4126,4091,5095,4218,279]);
|
|
16851
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AgentList=function(t){const c=(0,l.c)(70),{agents:u,isRefreshing:x,onRefresh:v,selectedAgentId:j,onAgentSelect:S,listFooterComponent:C,showAttentionIndicator:_,fields:I,search:P}=t,A=void 0!==x&&x,B=void 0===_||_,{t:U}=(0,b.useTranslation)(),L=(0,p.useSafeAreaInsets)(),[R,M]=(0,f.useState)(null),z=(0,w.useIsCompactFormFactor)(),{archiveAgent:D}=(0,k.useArchiveAgent)();let W;c[0]!==R?(W=e=>R?.serverId?e.sessions[R.serverId]?.client??null:null,c[0]=R,c[1]=W):W=c[1];const $=(0,y.useSessionStore)(W),F=null!==R,O=Boolean(R?.serverId&&!$);let E;c[2]!==F||c[3]!==S?(E=e=>{if(F)return;const t=e.serverId,n=e.id;S?.(),(0,T.navigateToAgent)({serverId:t,agentId:n,workspaceId:e.workspaceId,pin:!0})},c[2]=F,c[3]=S,c[4]=E):E=c[4];const q=E;let J;c[5]!==D?(J=e=>{if("running"===e.status)return void M(e);y.useSessionStore.getState().sessions[e.serverId]?.client??null?D({serverId:e.serverId,agentId:e.id}).catch(re):M(e)},c[5]=D,c[6]=J):J=c[6];const X=J;let Z;c[7]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{M(null)},c[7]=Z):Z=c[7];const ee=Z;let te;c[8]!==R||c[9]!==$||c[10]!==D?(te=()=>{R&&$&&(D({serverId:R.serverId,agentId:R.id}).catch(ie),M(null))},c[8]=R,c[9]=$,c[10]=D,c[11]=te):te=c[11];const ne=te;let se;if(c[12]!==u){const e=new Map;for(const t of u){const n=N(t.lastActivityAt),s=e.get(n)??[];s.push(t),e.set(n,s)}se=[];for(const t of G){const n=e.get(t);if(n&&0!==n.length){se.push({type:"header",key:`header:${t}`,section:t});for(const e of n)se.push({type:"agent",key:`${e.serverId}:${e.id}`,agent:e})}}c[12]=u,c[13]=se}else se=c[13];const le=se;let ce;c[14]!==I||c[15]!==X||c[16]!==q||c[17]!==z||c[18]!==P||c[19]!==j||c[20]!==B||c[21]!==U?(ce=e=>{const{item:t}=e;return"header"===t.type?(0,V.jsx)(o.View,{style:ae.sectionHeading,children:(0,V.jsx)(s.Text,{style:ae.sectionTitle,children:Y(U,t.section)})}):(0,V.jsx)(Q,{agent:t.agent,search:P,isMobile:z,selectedAgentId:j,showAttentionIndicator:B,fields:I,onPress:q,onLongPress:X})},c[14]=I,c[15]=X,c[16]=q,c[17]=z,c[18]=P,c[19]=j,c[20]=B,c[21]=U,c[22]=ce):ce=c[22];const de=ce,ue=oe,ge=Math.max(L.bottom,24);let he;c[23]!==ge?(he=[ae.sheetContainer,{paddingBottom:ge}],c[23]=ge,c[24]=he):he=c[24];const pe=he,fe=O&&ae.sheetArchiveTextDisabled;let me;c[25]!==fe?(me=[ae.sheetArchiveText,fe],c[25]=fe,c[26]=me):me=c[26];const xe=me;let be;c[27]!==A||c[28]!==v?(be=v?(0,V.jsx)(K,{refreshing:A,onRefresh:v,uniProps:H}):void 0,c[27]=A,c[28]=v,c[29]=be):be=c[29];const we=be;let ve,ye,je,Se,Ce,Ie,Te,ke,Pe,Ae,Be,Ue,Le,Re,Me,ze;c[30]!==le||c[31]!==C||c[32]!==we||c[33]!==de?(ve=(0,V.jsx)(e.FlatList,{data:le,style:ae.list,contentContainerStyle:ae.listContent,keyExtractor:ue,renderItem:de,showsVerticalScrollIndicator:!1,keyboardShouldPersistTaps:"handled",ListFooterComponent:C,refreshControl:we}),c[30]=le,c[31]=C,c[32]=we,c[33]=de,c[34]=ve):ve=c[34];c[35]===Symbol.for("react.memo_cache_sentinel")?(ye=(0,V.jsx)(n.Pressable,{style:ae.sheetBackdrop,onPress:ee}),c[35]=ye):ye=c[35];c[36]===Symbol.for("react.memo_cache_sentinel")?(je=(0,V.jsx)(o.View,{style:ae.sheetHandle}),c[36]=je):je=c[36];c[37]!==O||c[38]!==U?(Se=U(O?"agentList.archiveSheet.hostOffline":"agentList.archiveSheet.runningAgent"),c[37]=O,c[38]=U,c[39]=Se):Se=c[39];c[40]!==Se?(Ce=(0,V.jsx)(s.Text,{style:ae.sheetTitle,children:Se}),c[40]=Se,c[41]=Ce):Ce=c[41];c[42]===Symbol.for("react.memo_cache_sentinel")?(Ie=[ae.sheetButton,ae.sheetCancelButton],c[42]=Ie):Ie=c[42];c[43]!==U?(Te=U("common.actions.cancel"),c[43]=U,c[44]=Te):Te=c[44];c[45]!==Te?(ke=(0,V.jsx)(n.Pressable,{style:Ie,onPress:ee,testID:"agent-action-cancel",children:(0,V.jsx)(s.Text,{style:ae.sheetCancelText,children:Te})}),c[45]=Te,c[46]=ke):ke=c[46];c[47]===Symbol.for("react.memo_cache_sentinel")?(Pe=[ae.sheetButton,ae.sheetArchiveButton],c[47]=Pe):Pe=c[47];c[48]!==U?(Ae=U("agentList.archiveSheet.archive"),c[48]=U,c[49]=Ae):Ae=c[49];c[50]!==xe||c[51]!==Ae?(Be=(0,V.jsx)(s.Text,{style:xe,children:Ae}),c[50]=xe,c[51]=Ae,c[52]=Be):Be=c[52];c[53]!==ne||c[54]!==O||c[55]!==Be?(Ue=(0,V.jsx)(n.Pressable,{disabled:O,style:Pe,onPress:ne,testID:"agent-action-archive",children:Be}),c[53]=ne,c[54]=O,c[55]=Be,c[56]=Ue):Ue=c[56];c[57]!==ke||c[58]!==Ue?(Le=(0,V.jsxs)(o.View,{style:ae.sheetButtonRow,children:[ke,Ue]}),c[57]=ke,c[58]=Ue,c[59]=Le):Le=c[59];c[60]!==pe||c[61]!==Ce||c[62]!==Le?(Re=(0,V.jsxs)(o.View,{style:ae.sheetOverlay,children:[ye,(0,V.jsxs)(o.View,{style:pe,children:[je,Ce,Le]})]}),c[60]=pe,c[61]=Ce,c[62]=Le,c[63]=Re):Re=c[63];c[64]!==F||c[65]!==Re?(Me=(0,V.jsx)(h.default,{visible:F,animationType:"fade",transparent:!0,onRequestClose:ee,children:Re}),c[64]=F,c[65]=Re,c[66]=Me):Me=c[66];c[67]!==ve||c[68]!==Me?(ze=(0,V.jsxs)(V.Fragment,{children:[ve,Me]}),c[67]=ve,c[68]=Me,c[69]=ze):ze=c[69];return ze};var e=r(d[0]),t=r(d[1]),n=r(d[2]),s=r(d[3]),o=r(d[4]),l=r(d[5]);r(d[6]),r(d[7]),r(d[8]);var c,u=r(d[9]),h=(c=u)&&c.__esModule?c:{default:c};r(d[10]),r(d[11]);var p=r(d[12]),f=r(d[13]),x=r(d[14]),b=r(d[15]),w=r(d[16]),v=r(d[17]),y=r(d[18]),j=r(d[19]),S=r(d[20]),C=r(d[21]),_=r(d[22]),I=r(d[23]),T=r(d[24]),k=r(d[25]),P=r(d[26]),A=r(d[27]),B=r(d[28]),U=r(d[29]),L=r(d[30]),R=r(d[31]),M=r(d[32]),z=r(d[33]),D=r(d[34]),V=r(d[35]);const W=e=>({color:e.colors.foregroundMuted}),H=e=>({tintColor:e.colors.foregroundMuted,colors:[e.colors.foregroundMuted]}),$=(0,x.withUnistyles)(j.Archive),F=(0,x.withUnistyles)(j.Folder),O=(0,x.withUnistyles)(j.GitBranch),E=(0,x.withUnistyles)(j.Server),q=(0,x.withUnistyles)(j.ChevronRight),K=(0,x.withUnistyles)(t.RefreshControl),G=["today","yesterday","thisWeek","thisMonth","older"];function N(e){const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),s=new Date(n.getTime()-864e5),o=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(o.getTime()>=n.getTime())return"today";if(o.getTime()>=s.getTime())return"yesterday";const l=n.getTime()-o.getTime(),c=Math.floor(l/864e5);return c<=7?"thisWeek":c<=30?"thisMonth":"older"}function Y(e,t){switch(t){case"today":return e("agentList.dateSections.today");case"yesterday":return e("agentList.dateSections.yesterday");case"thisWeek":return e("agentList.dateSections.thisWeek");case"thisMonth":return e("agentList.dateSections.thisMonth");case"older":return e("agentList.dateSections.older")}}function J(e){const t=(0,l.c)(9),{pendingPermissionCount:n,showAttention:s}=e,{t:o}=(0,b.useTranslation)();let c,u,h;return t[0]!==n||t[1]!==o?(c=n>0?(0,V.jsx)(L.StatusBadge,{label:o("agentList.badges.pending",{count:n}),variant:"warning"}):null,t[0]=n,t[1]=o,t[2]=c):c=t[2],t[3]!==s||t[4]!==o?(u=s?(0,V.jsx)(L.StatusBadge,{label:o("agentList.badges.attention"),variant:"error"}):null,t[3]=s,t[4]=o,t[5]=u):u=t[5],t[6]!==c||t[7]!==u?(h=(0,V.jsxs)(V.Fragment,{children:[c,u]}),t[6]=c,t[7]=u,t[8]=h):h=t[8],h}function Q(e){const t=(0,l.c)(28),{agent:s,search:c,isMobile:u,selectedAgentId:h,showAttentionIndicator:p,fields:f,onPress:x,onLongPress:w}=e,{t:v}=(0,b.useTranslation)(),y=h===`${s.serverId}:${s.id}`,j=s.pendingPermissionCount??0,S=c??"",C=s.title??"";let _;t[0]!==S||t[1]!==C?(_=(0,R.findHighlightRanges)(S,C),t[0]=S,t[1]=C,t[2]=_):_=t[2];const I=_;let T;t[3]!==y?(T=e=>{const{pressed:t,hovered:n}=e,s=void 0!==n&&n;return[ae.row,y&&ae.rowSelected,Boolean(s)&&ae.rowHovered,t&&ae.rowPressed]},t[3]=y,t[4]=T):T=t[4];const k=T;let A;t[5]!==s||t[6]!==x?(A=()=>x(s),t[5]=s,t[6]=x,t[7]=A):A=t[7];const B=A;let U;t[8]!==s||t[9]!==w?(U=()=>w(s),t[8]=s,t[9]=w,t[10]=U):U=t[10];const M=U;let z;t[11]===Symbol.for("react.memo_cache_sentinel")?(z=(0,V.jsx)($,{size:12,uniProps:W}),t[11]=z):z=t[11];const D=z,H=p&&Boolean(s.requiresAttention),F=`agent-row-${s.serverId}-${s.id}`;let O,E;return t[12]!==s||t[13]!==f||t[14]!==u||t[15]!==y||t[16]!==j||t[17]!==c||t[18]!==H||t[19]!==v||t[20]!==I?(O=e=>{const{hovered:t,pressed:n}=e,l=void 0!==t&&t;return(0,V.jsxs)(o.View,{style:ae.rowContent,children:[(0,V.jsxs)(o.View,{style:ae.rowTitleRow,children:[f.provider?(0,V.jsx)(Z,{agent:s,showStatus:f.status,backdrop:X({hovered:l,pressed:n,isSelected:y})}):null,(0,V.jsx)(P.HighlightedText,{text:s.title||v("agentList.fallbackTitle"),ranges:I,style:ae.sessionTitle,numberOfLines:u?2:1,testID:`agent-row-title-${s.serverId}-${s.id}`}),(0,V.jsxs)(o.View,{style:ae.rowEnd,children:[(0,V.jsx)(J,{pendingPermissionCount:j,showAttention:H}),f.lastActivity?(0,V.jsx)(se,{date:s.lastActivityAt}):null]})]}),(0,V.jsxs)(o.View,{style:ae.rowMetaRow,children:[(0,V.jsx)(ee,{agent:s,fields:f,search:c}),(0,V.jsx)(te,{agent:s,fields:f}),f.status&&s.archivedAt?(0,V.jsx)(L.StatusBadge,{label:v("agentList.badges.archived"),leading:D,size:"xs",style:ae.archivedBadge}):null]})]})},t[12]=s,t[13]=f,t[14]=u,t[15]=y,t[16]=j,t[17]=c,t[18]=H,t[19]=v,t[20]=I,t[21]=O):O=t[21],t[22]!==M||t[23]!==B||t[24]!==k||t[25]!==F||t[26]!==O?(E=(0,V.jsx)(n.Pressable,{style:k,onPress:B,onLongPress:M,accessibilityRole:"button",testID:F,children:O}),t[22]=M,t[23]=B,t[24]=k,t[25]=F,t[26]=O,t[27]=E):E=t[27],E}function X({hovered:e,pressed:t,isSelected:n}){return t?"surface2":e?"surface1":n?"surface2":"surface0"}function Z(e){const t=(0,l.c)(15),{agent:n,showStatus:s,backdrop:c}=e,u=(0,S.useProviderIcon)(n.provider,n.serverId),h="open"===n.turn.phase?"running":n.status;let p;t[0]!==n.attentionReason||t[1]!==n.pendingPermissionCount||t[2]!==n.requiresAttention||t[3]!==h?(p=(0,_.deriveSidebarStateBucket)({status:h,requiresAttention:n.requiresAttention,attentionReason:n.attentionReason,pendingPermissionCount:n.pendingPermissionCount}),t[0]=n.attentionReason,t[1]=n.pendingPermissionCount,t[2]=n.requiresAttention,t[3]=h,t[4]=p):p=t[4];const f=p,x=s?f:null;let b;t[5]!==u||t[6]!==x?(b={icon:u,statusBucket:x},t[5]=u,t[6]=x,t[7]=b):b=t[7];const w=b,v=s?I.STATUS_BUCKET_LABELS[f]:void 0,y=`agent-row-icon-${n.serverId}-${n.id}`;let j,T;return t[8]!==c||t[9]!==w?(j=(0,V.jsx)(C.WorkspaceTabIcon,{presentation:w,backdrop:c}),t[8]=c,t[9]=w,t[10]=j):j=t[10],t[11]!==v||t[12]!==y||t[13]!==j?(T=(0,V.jsx)(o.View,{role:"status",accessibilityLabel:v,testID:y,children:j}),t[11]=v,t[12]=y,t[13]=j,t[14]=T):T=t[14],T}function ee(e){const t=(0,l.c)(43),{agent:n,fields:c,search:u}=e;let h,p,f;if(t[0]!==n.cwd||t[1]!==n.projectPlacement){const e=(0,D.resolveProjectPlacement)({projectPlacement:n.projectPlacement,cwd:n.cwd});p=n.projectPlacement?.projectName??"",h=e.checkout.currentBranch??"",f=(0,z.pathBaseName)(e.checkout.worktreeRoot??e.checkout.cwd),t[0]=n.cwd,t[1]=n.projectPlacement,t[2]=h,t[3]=p,t[4]=f}else h=t[2],p=t[3],f=t[4];const x=f,b=c.project&&Boolean(p),w=c.workspace&&Boolean(x),v=c.branch&&Boolean(h),y=b||w,j=u??"";let S;t[5]!==x||t[6]!==j?(S=(0,R.findHighlightRanges)(j,x),t[5]=x,t[6]=j,t[7]=S):S=t[7];const C=u??"";let _;t[8]!==h||t[9]!==C?(_=(0,R.findHighlightRanges)(C,h),t[8]=h,t[9]=C,t[10]=_):_=t[10];const I=u??"";let T,k;t[11]!==p||t[12]!==I?(T=(0,R.findHighlightRanges)(I,p),t[11]=p,t[12]=I,t[13]=T):T=t[13],t[14]!==S||t[15]!==_||t[16]!==T?(k={workspace:S,branch:_,project:T},t[14]=S,t[15]=_,t[16]=T,t[17]=k):k=t[17];const A=k;let B,L,M,H;return t[18]!==n.cwd||t[19]!==n.id||t[20]!==n.projectPlacement?.projectKey||t[21]!==n.serverId||t[22]!==x||t[23]!==p||t[24]!==A||t[25]!==y||t[26]!==b||t[27]!==w?(B=y?(0,V.jsxs)(o.View,{style:ae.metaItem,children:[b?(0,V.jsxs)(o.View,{style:ae.metaItem,children:[(0,V.jsx)(U.ProjectIconView,{iconDataUri:null,initial:p.charAt(0).toUpperCase(),projectViewKey:n.projectPlacement?.projectKey??n.cwd,size:14,textStyle:ae.projectIconText}),(0,V.jsx)(P.HighlightedText,{text:p,ranges:A.project,style:ae.sessionMetaText,numberOfLines:1,testID:`agent-row-project-${n.serverId}-${n.id}`})]}):null,w?(0,V.jsxs)(o.View,{style:ae.metaItem,children:[b?(0,V.jsx)(q,{size:12,uniProps:W}):null,(0,V.jsx)(F,{size:14,uniProps:W}),(0,V.jsx)(P.HighlightedText,{text:x,ranges:A.workspace,style:ae.sessionMetaText,numberOfLines:1,testID:`agent-row-workspace-${n.serverId}-${n.id}`})]}):null]}):null,t[18]=n.cwd,t[19]=n.id,t[20]=n.projectPlacement?.projectKey,t[21]=n.serverId,t[22]=x,t[23]=p,t[24]=A,t[25]=y,t[26]=b,t[27]=w,t[28]=B):B=t[28],t[29]!==n.id||t[30]!==n.serverId||t[31]!==h||t[32]!==A||t[33]!==v||t[34]!==y?(L=v?(0,V.jsxs)(o.View,{style:ae.metaItem,children:[y?(0,V.jsx)(s.Text,{style:ae.sessionMetaSeparator,children:"\xb7"}):null,(0,V.jsx)(O,{size:14,uniProps:W}),(0,V.jsx)(P.HighlightedText,{text:h,ranges:A.branch,style:ae.sessionMetaText,numberOfLines:1,testID:`agent-row-branch-${n.serverId}-${n.id}`})]}):null,t[29]=n.id,t[30]=n.serverId,t[31]=h,t[32]=A,t[33]=v,t[34]=y,t[35]=L):L=t[35],t[36]!==n.serverLabel||t[37]!==c.host?(M=c.host?(0,V.jsxs)(o.View,{style:ae.metaItem,children:[(0,V.jsx)(E,{size:14,uniProps:W}),(0,V.jsx)(s.Text,{style:ae.sessionMetaText,numberOfLines:1,children:n.serverLabel})]}):null,t[36]=n.serverLabel,t[37]=c.host,t[38]=M):M=t[38],t[39]!==L||t[40]!==M||t[41]!==B?(H=(0,V.jsxs)(V.Fragment,{children:[B,L,M]}),t[39]=L,t[40]=M,t[41]=B,t[42]=H):H=t[42],H}function te(e){const t=(0,l.c)(21),{agent:n,fields:c}=e,{t:u}=(0,b.useTranslation)();let h;t[0]!==n||t[1]!==c.model||t[2]!==u?(h=c.model?n.model??u("sessions.filters.unknownModel"):void 0,t[0]=n,t[1]=c.model,t[2]=u,t[3]=h):h=t[3];const p=h;let f;t[4]!==n||t[5]!==c.effort?(f=c.effort&&n.thinkingOptionId?(0,B.formatThinkingOptionLabel)({id:n.thinkingOptionId}):void 0,t[4]=n,t[5]=c.effort,t[6]=f):f=t[6];const x=f;let w;t[7]!==n||t[8]!==c.turns?(w=c.turns?(0,M.formatTurnCount)(n.turnCount):void 0,t[7]=n,t[8]=c.turns,t[9]=w):w=t[9];const v=w;let y;t[10]!==x||t[11]!==p||t[12]!==v?(y=[p,x,v].filter(Boolean),t[10]=x,t[11]=p,t[12]=v,t[13]=y):y=t[13];const j=y.join(" \xb7 ");if(!j&&!c.cost)return null;let S,C;return t[14]!==n||t[15]!==c.cost||t[16]!==j?(S=c.cost?(0,V.jsx)(ne,{agent:n,prefix:Boolean(j)}):null,t[14]=n,t[15]=c.cost,t[16]=j,t[17]=S):S=t[17],t[18]!==j||t[19]!==S?(C=(0,V.jsx)(o.View,{style:ae.metaItem,children:(0,V.jsxs)(s.Text,{style:ae.sessionMetaText,children:[j,S]})}),t[18]=j,t[19]=S,t[20]=C):C=t[20],C}function ne(e){const t=(0,l.c)(25),{agent:n,prefix:o}=e,{t:c}=(0,b.useTranslation)(),u=n.lastUsage;let h,p,f,x,w,v,y,j;if(t[0]!==n.lastUsage?.totalCostUnavailable||t[1]!==o||t[2]!==c||t[3]!==u?.paseoSubagentCostEstimated||t[4]!==u?.paseoSubagentCostUsd||t[5]!==u?.subagentCostUsd||t[6]!==u?.totalCostEstimated||t[7]!==u?.totalCostUnavailable||t[8]!==u?.totalCostUsd){const e=(0,A.resolveAgentCostBreakdown)({totalCostUsd:u?.totalCostUsd,subagentCostUsd:u?.subagentCostUsd,paseoSubagentCostUsd:u?.paseoSubagentCostUsd,totalCostUnavailable:u?.totalCostUnavailable}),l=e?.totalCostUsd??u?.totalCostUsd;p=void 0===l||n.lastUsage?.totalCostUnavailable?null:(0,A.formatSessionCost)(l),f=u?.totalCostEstimated||u?.paseoSubagentCostEstimated,w=o?" \xb7 ":void 0,h=s.Text,x=f&&p?c("sessions.filters.estimatedCost",{cost:p}):void 0,t[0]=n.lastUsage?.totalCostUnavailable,t[1]=o,t[2]=c,t[3]=u?.paseoSubagentCostEstimated,t[4]=u?.paseoSubagentCostUsd,t[5]=u?.subagentCostUsd,t[6]=u?.totalCostEstimated,t[7]=u?.totalCostUnavailable,t[8]=u?.totalCostUsd,t[9]=h,t[10]=p,t[11]=f,t[12]=x,t[13]=w}else h=t[9],p=t[10],f=t[11],x=t[12],w=t[13];return t[14]!==p||t[15]!==f||t[16]!==c?(v=p?`${f?"~":""}${p}`:c("sessions.filters.costUnavailable"),t[14]=p,t[15]=f,t[16]=c,t[17]=v):v=t[17],t[18]!==h||t[19]!==x||t[20]!==v?(y=(0,V.jsx)(h,{accessibilityLabel:x,children:v}),t[18]=h,t[19]=x,t[20]=v,t[21]=y):y=t[21],t[22]!==w||t[23]!==y?(j=(0,V.jsxs)(V.Fragment,{children:[w,y]}),t[22]=w,t[23]=y,t[24]=j):j=t[24],j}function se(e){const t=(0,l.c)(2),{date:n}=e,o=(0,v.useTimeAgo)(n);let c;return t[0]!==o?(c=(0,V.jsx)(s.Text,{style:ae.activityTime,numberOfLines:1,children:o}),t[0]=o,t[1]=c):c=t[1],c}function oe(e){return e.key}function ie(){}function re(){}const ae=x.StyleSheet.create(e=>({list:{flex:1,minHeight:0},listContent:{paddingHorizontal:{xs:e.spacing[3],md:e.spacing[6]},paddingTop:e.spacing[4],paddingBottom:e.spacing[6],gap:e.spacing[1],uni__dependencies:[0]},sectionHeading:{marginTop:e.spacing[2],flexDirection:"row",alignItems:"center",gap:e.spacing[3],paddingHorizontal:e.spacing[3],marginBottom:e.spacing[2],uni__dependencies:[0]},sectionTitle:{fontSize:e.fontSize.base,fontWeight:e.fontWeight.medium,color:e.colors.foregroundMuted,uni__dependencies:[0]},row:{flexDirection:"row",alignItems:"center",paddingVertical:e.spacing[3],paddingHorizontal:e.spacing[3],borderRadius:{xs:e.borderRadius.lg,md:0},marginBottom:{xs:e.spacing[1],md:0},uni__dependencies:[0]},rowContent:{flex:1,minWidth:0},rowTitleRow:{flexDirection:"row",alignItems:"center",flexWrap:"nowrap",gap:e.spacing[2],uni__dependencies:[0]},rowMetaRow:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",columnGap:e.spacing[3],rowGap:e.spacing[1],marginTop:e.spacing[1.5],uni__dependencies:[0]},archivedBadge:{marginVertical:-e.spacing[.5],uni__dependencies:[0]},rowSelected:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},rowHovered:{backgroundColor:e.colors.surface1,uni__dependencies:[0]},rowPressed:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},sessionTitle:{flex:1,minWidth:0,fontSize:e.fontSize.base,fontWeight:e.fontWeight.normal,color:e.colors.foreground,uni__dependencies:[0]},sessionMetaText:{flexShrink:1,maxWidth:"100%",fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,uni__dependencies:[0]},sessionMetaSeparator:{fontSize:e.fontSize.base,color:e.colors.foregroundMuted,opacity:.7,uni__dependencies:[0]},metaItem:{flexDirection:"row",alignItems:"center",gap:e.spacing[1.5],maxWidth:"100%",flexShrink:1,uni__dependencies:[0]},rowEnd:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],flexShrink:0,uni__dependencies:[0]},activityTime:{fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,uni__dependencies:[0]},projectIconText:{fontSize:8},sheetOverlay:{flex:1,justifyContent:"flex-end"},sheetBackdrop:{position:"absolute",top:0,right:0,bottom:0,left:0,backgroundColor:"rgba(0,0,0,0.35)"},sheetContainer:{backgroundColor:e.colors.surface2,borderTopLeftRadius:e.borderRadius["2xl"],borderTopRightRadius:e.borderRadius["2xl"],paddingHorizontal:e.spacing[6],paddingTop:e.spacing[4],gap:e.spacing[4],uni__dependencies:[0]},sheetHandle:{alignSelf:"center",width:40,height:4,borderRadius:e.borderRadius.full,backgroundColor:e.colors.foregroundMuted,opacity:.3,uni__dependencies:[0]},sheetTitle:{fontSize:e.fontSize.base,fontWeight:e.fontWeight.semibold,color:e.colors.foreground,textAlign:"center",uni__dependencies:[0]},sheetButtonRow:{flexDirection:"row",gap:e.spacing[3],uni__dependencies:[0]},sheetButton:{flex:1,borderRadius:e.borderRadius.lg,paddingVertical:e.spacing[4],alignItems:"center",justifyContent:"center",uni__dependencies:[0]},sheetArchiveButton:{backgroundColor:e.colors.primary,uni__dependencies:[0]},sheetArchiveText:{color:e.colors.primaryForeground,fontWeight:e.fontWeight.semibold,fontSize:e.fontSize.base,uni__dependencies:[0]},sheetArchiveTextDisabled:{opacity:.5},sheetCancelButton:{backgroundColor:e.colors.surface1,uni__dependencies:[0]},sheetCancelText:{color:e.colors.foreground,fontWeight:e.fontWeight.semibold,fontSize:e.fontSize.base,uni__dependencies:[0]}}))},5092,[984,5093,897,896,895,453,146,234,425,418,181,144,626,36,56,853,1216,3823,3446,1217,3811,4225,3463,4121,3779,3605,5094,4220,4222,4126,4091,5095,4218,3576,3610,279]);
|
|
16852
16852
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"RefreshControl",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};const u=(0,r(d[1]).createUnistylesElement)(n.default)},5093,[181,274]);
|
|
16853
16853
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.HighlightedText=function(s){const u=(0,n.c)(15),{text:x,ranges:f,style:h,numberOfLines:y,testID:_}=s;let b;u[0]!==f||u[1]!==x?(b=f&&f.length>0?(0,l.toHighlightSegments)(x,f):null,u[0]=f,u[1]=x,u[2]=b):b=u[2];const j=b;if(!j){let n;return u[3]!==y||u[4]!==h||u[5]!==_||u[6]!==x?(n=(0,c.jsx)(t.Text,{style:h,numberOfLines:y,testID:_,children:x}),u[3]=y,u[4]=h,u[5]=_,u[6]=x,u[7]=n):n=u[7],n}let T,k;u[8]!==j?(T=j.map(o),u[8]=j,u[9]=T):T=u[9];u[10]!==y||u[11]!==h||u[12]!==T||u[13]!==_?(k=(0,c.jsx)(t.Text,{style:h,numberOfLines:y,testID:_,children:T}),u[10]=y,u[11]=h,u[12]=T,u[13]=_,u[14]=k):k=u[14];return k};var t=r(d[0]),n=r(d[1]);r(d[2]),r(d[3]);var s=r(d[4]),l=r(d[5]),c=r(d[6]);function o(n){return n.marked?(0,c.jsx)(t.Text,{style:u.mark,children:n.text},n.start):(0,c.jsx)(t.Text,{children:n.text},n.start)}const u=s.StyleSheet.create(t=>({mark:{backgroundColor:t.colors.surface3,color:t.colors.foreground,uni__dependencies:[0]}}))},5094,[896,453,36,234,56,5095,279]);
|
|
16854
16854
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.toHighlightSegments=function(t,s){const n=[];let o=0;for(const c of s){const s=Math.max(c.start,o),h=Math.min(s+c.length,t.length);h<=s||(s>o&&n.push({start:o,text:t.slice(o,s),marked:!1}),n.push({start:s,text:t.slice(s,h),marked:!0}),o=h)}o<t.length&&n.push({start:o,text:t.slice(o),marked:!1});return n},e.findHighlightRanges=function(s,n){const o=(0,t.tokenizeQuery)(s).flatMap(s=>{const o=(0,t.scoreMatch)(s,n,{fuzzy:(0,t.fuzzyPolicyForToken)(s)});return o?(0,t.matchRanges)(s,n,o):[]}).sort((t,s)=>t.start-s.start),c=[];for(const t of o){const s=c.at(-1);s&&t.start<=s.start+s.length?s.length=Math.max(s.length,t.start+t.length-s.start):c.push(Object.assign({},t))}return c};var t=r(d[0])},5095,[3786]);
|
|
16855
|
-
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.historyModelKey=I,e.hasHistoryFilters=function(s){return s.hosts.length>0||s.projects.length>0||s.providers.length>0||s.models.length>0||s.status!==v.HistoryStatus.All},e.HistoryFilterBar=function(n){const a=(0,l.c)(152),{filters:p,options:f,supported:j,onChange:x}=n,{t:M}=(0,c.useTranslation)(),G=(0,S.useHosts)(),W=(0,y.useIsCompactFormFactor)();let Y,J,X,q,Q,Z,ee,se,te,ie,le,oe,re,ne,ce;if(a[0]!==p.hosts||a[1]!==p.models||a[2]!==p.projects||a[3]!==p.providers||a[4]!==G||a[5]!==f.models||a[6]!==f.projects||a[7]!==j||a[8]!==M){const s=new Map(f.projects.map(K)),t=new Map(f.models.map(E)),l=[...new Set(f.models.map(V))].sort();let o,n;a[19]!==M?(o=M("sessions.filters.hosts"),a[19]=M,a[20]=o):o=a[20],a[21]!==M?(n=M("sidebar.display.hostFilter.all"),a[21]=M,a[22]=n):n=a[22];const c=p.hosts;let u,h,x,y;a[23]===Symbol.for("react.memo_cache_sentinel")?(u=(0,_.jsx)(O,{size:14,uniProps:w}),a[23]=u):u=a[23],a[24]!==G?(h=G.map(U),a[24]=G,a[25]=h):h=a[25],a[26]!==p.hosts||a[27]!==o||a[28]!==n||a[29]!==h?(te={id:"hosts",title:o,all:n,selected:c,icon:u,options:h},a[26]=p.hosts,a[27]=o,a[28]=n,a[29]=h,a[30]=te):te=a[30],a[31]!==M?(x=M("sessions.filters.projects"),a[31]=M,a[32]=x):x=a[32],a[33]!==M?(y=M("sidebar.display.projectFilter.all"),a[33]=M,a[34]=y):y=a[34];const S=p.projects;let v;a[35]===Symbol.for("react.memo_cache_sentinel")?(v=(0,_.jsx)(z,{size:14,uniProps:w}),a[35]=v):v=a[35];const H=!j,D=[...s.values()].sort(R).map(N);let A,C;a[36]!==p.projects||a[37]!==x||a[38]!==y||a[39]!==H||a[40]!==D?(ie={id:"projects",title:x,all:y,selected:S,icon:v,disabled:H,options:D},a[36]=p.projects,a[37]=x,a[38]=y,a[39]=H,a[40]=D,a[41]=ie):ie=a[41],a[42]!==M?(A=M("sessions.filters.provider"),a[42]=M,a[43]=A):A=a[43],a[44]!==M?(C=M("sessions.filters.allProviders"),a[44]=M,a[45]=C):C=a[45];const F=p.providers;let k;a[46]===Symbol.for("react.memo_cache_sentinel")?(k=(0,_.jsx)(T,{size:14,uniProps:w}),a[46]=k):k=a[46];const B=!j,W=l.map(L);let le;a[47]!==p.providers||a[48]!==A||a[49]!==C||a[50]!==B||a[51]!==W?(J={id:"providers",title:A,all:C,selected:F,icon:k,disabled:B,options:W},a[47]=p.providers,a[48]=A,a[49]=C,a[50]=B,a[51]=W,a[52]=J):J=a[52],Y="models",a[53]!==M?(X=M("sessions.filters.model"),a[53]=M,a[54]=X):X=a[54],a[55]!==M?(q=M("sessions.filters.allModels"),a[55]=M,a[56]=q):q=a[56],a[57]!==p.models?(Q=p.models.map(I),a[57]=p.models,a[58]=Q):Q=a[58],a[59]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,_.jsx)(P,{size:14,uniProps:w}),a[59]=Z):Z=a[59],ee=!j,a[60]!==M?(le=s=>{const[t,l]=s;return{id:t,label:l.model??M("sessions.filters.unknownModel"),leading:(0,_.jsx)(b.ProviderIcon,{provider:l.provider,size:14,uniProps:w})}},a[60]=M,a[61]=le):le=a[61],se=[...t.entries()].sort($).map(le),a[0]=p.hosts,a[1]=p.models,a[2]=p.projects,a[3]=p.providers,a[4]=G,a[5]=f.models,a[6]=f.projects,a[7]=j,a[8]=M,a[9]=Y,a[10]=J,a[11]=X,a[12]=q,a[13]=Q,a[14]=Z,a[15]=ee,a[16]=se,a[17]=te,a[18]=ie}else Y=a[9],J=a[10],X=a[11],q=a[12],Q=a[13],Z=a[14],ee=a[15],se=a[16],te=a[17],ie=a[18];a[62]!==Y||a[63]!==X||a[64]!==q||a[65]!==Q||a[66]!==Z||a[67]!==ee||a[68]!==se?(le={id:Y,title:X,all:q,selected:Q,icon:Z,disabled:ee,options:se},a[62]=Y,a[63]=X,a[64]=q,a[65]=Q,a[66]=Z,a[67]=ee,a[68]=se,a[69]=le):le=a[69];a[70]!==M?(oe=M("sessions.filters.status"),a[70]=M,a[71]=oe):oe=a[71];a[72]!==M?(re=M("sessions.filters.allSessions"),a[72]=M,a[73]=re):re=a[73];a[74]!==p.status?(ne=p.status===v.HistoryStatus.All?[]:[p.status],a[74]=p.status,a[75]=ne):ne=a[75];a[76]===Symbol.for("react.memo_cache_sentinel")?(ce=(0,_.jsx)(H,{size:14,uniProps:w}),a[76]=ce):ce=a[76];const de=!j;let ae,ue,pe,he,fe,me,ge;a[77]!==M?(ae=M("sessions.filters.active"),a[77]=M,a[78]=ae):ae=a[78];a[79]!==ae?(ue={id:v.HistoryStatus.Active,label:ae},a[79]=ae,a[80]=ue):ue=a[80];a[81]!==M?(pe=M("agentList.badges.archived"),a[81]=M,a[82]=pe):pe=a[82];a[83]!==pe?(he={id:v.HistoryStatus.Archived,label:pe},a[83]=pe,a[84]=he):he=a[84];a[85]!==ue||a[86]!==he?(fe=[ue,he],a[85]=ue,a[86]=he,a[87]=fe):fe=a[87];a[88]!==oe||a[89]!==re||a[90]!==ne||a[91]!==de||a[92]!==fe?(me={id:"status",title:oe,all:re,selected:ne,icon:ce,disabled:de,options:fe},a[88]=oe,a[89]=re,a[90]=ne,a[91]=de,a[92]=fe,a[93]=me):me=a[93];a[94]!==J||a[95]!==le||a[96]!==me||a[97]!==te||a[98]!==ie?(ge=[te,ie,J,le,me],a[94]=J,a[95]=le,a[96]=me,a[97]=te,a[98]=ie,a[99]=ge):ge=a[99];const je=ge;let be;a[100]!==je?(be=je.filter(F),a[100]=je,a[101]=be):be=a[101];const xe=be.length;let ye;a[102]!==x?(ye=()=>x(v.EMPTY_HISTORY_FILTERS),a[102]=x,a[103]=ye):ye=a[103];const Se=ye;if(W){let l,o,n;a[104]!==M?(l=M("sessions.filters.title"),a[104]=M,a[105]=l):l=a[105],a[106]===Symbol.for("react.memo_cache_sentinel")?(o=(0,_.jsx)(D,{size:14,uniProps:w}),a[106]=o):o=a[106],a[107]!==M?(n=M("sessions.filters.title"),a[107]=M,a[108]=n):n=a[108];const c=xe?` (${xe})`:"";let h,j,b,y,S,v,I,H;return a[109]!==n||a[110]!==c?(h=(0,_.jsxs)(t.Text,{style:B.triggerText,children:[n,c]}),a[109]=n,a[110]=c,a[111]=h):h=a[111],a[112]!==l||a[113]!==h?(j=(0,_.jsxs)(u.MenuTrigger,{accessibilityRole:"button",style:k,accessibilityLabel:l,testID:"sessions-filters-trigger",children:[o,h]}),a[112]=l,a[113]=h,a[114]=j):j=a[114],a[115]!==M?(b=M("sessions.filters.title"),a[115]=M,a[116]=b):b=a[116],a[117]!==p||a[118]!==je||a[119]!==x||a[120]!==f||a[121]!==M?(y=je.map(l=>(0,_.jsxs)(s.View,{children:[(0,_.jsx)(u.MenuLabel,{children:l.title}),l.disabled?(0,_.jsx)(t.Text,{style:B.hint,children:M("sessions.filters.updateHost")}):(0,_.jsx)(A,{group:l,filters:p,options:f,onChange:x}),(0,_.jsx)(u.MenuSeparator,{})]},l.id)),a[117]=p,a[118]=je,a[119]=x,a[120]=f,a[121]=M,a[122]=y):y=a[122],a[123]!==M?(S=M("sessions.filters.clear"),a[123]=M,a[124]=S):S=a[124],a[125]!==Se||a[126]!==S?(v=(0,_.jsx)(u.MenuItem,{closeOnSelect:!1,onSelect:Se,children:S}),a[125]=Se,a[126]=S,a[127]=v):v=a[127],a[128]!==b||a[129]!==y||a[130]!==v?(I=(0,_.jsxs)(u.MenuSurface,{sheetTitle:b,testID:"sessions-filters-sheet",scrollable:!0,children:[y,v]}),a[128]=b,a[129]=y,a[130]=v,a[131]=I):I=a[131],a[132]!==j||a[133]!==I?(H=(0,_.jsxs)(u.MenuRoot,{compactMode:"sheet",children:[j,I]}),a[132]=j,a[133]=I,a[134]=H):H=a[134],H}let ve,_e,Ie,Me;a[135]!==p||a[136]!==je||a[137]!==x||a[138]!==f||a[139]!==M?(ve=je.map(s=>(0,_.jsxs)(u.MenuRoot,{children:[(0,_.jsxs)(u.MenuTrigger,{accessibilityRole:"button",style:k,testID:`sessions-${s.id}-filter-trigger`,accessibilityLabel:`${s.title}: ${C(s)}`,children:[s.icon,(0,_.jsx)(t.Text,{style:B.triggerText,numberOfLines:1,children:C(s)})]}),(0,_.jsx)(u.MenuSurface,{width:280,maxHeight:400,scrollable:!0,children:s.disabled?(0,_.jsx)(t.Text,{style:B.hint,children:M("sessions.filters.updateHost")}):(0,_.jsx)(A,{group:s,filters:p,options:f,closeOnSelect:"status"===s.id,onChange:x})})]},s.id)),a[135]=p,a[136]=je,a[137]=x,a[138]=f,a[139]=M,a[140]=ve):ve=a[140];a[141]!==j||a[142]!==M?(_e=j?null:(0,_.jsx)(t.Text,{style:B.hint,children:M("sessions.filters.updateHost")}),a[141]=j,a[142]=M,a[143]=_e):_e=a[143];a[144]!==xe||a[145]!==Se||a[146]!==M?(Ie=xe?(0,_.jsxs)(s.View,{style:B.clearGroup,children:[(0,_.jsx)(s.View,{style:B.clearDivider}),(0,_.jsx)(h.Button,{size:"sm",variant:"ghost",leftIcon:o.X,onPress:Se,children:M("sessions.filters.clear")})]}):null,a[144]=xe,a[145]=Se,a[146]=M,a[147]=Ie):Ie=a[147];a[148]!==ve||a[149]!==_e||a[150]!==Ie?(Me=(0,_.jsxs)(s.View,{style:B.bar,children:[ve,_e,Ie]}),a[148]=ve,a[149]=_e,a[150]=Ie,a[151]=Me):Me=a[151];return Me};var s=r(d[0]),t=r(d[1]),l=r(d[2]);r(d[3]),r(d[4]),r(d[5]);var o=r(d[6]),n=r(d[7]),c=r(d[8]),a=r(d[9]),u=r(d[10]),p=r(d[11]),h=r(d[12]),f=r(d[13]),j=r(d[14]),b=r(d[15]),x=r(d[16]),y=r(d[17]),S=r(d[18]),v=r(d[19]),_=r(d[20]);function I(s){return JSON.stringify([s.provider,s.model])}const M=new Map(a.AGENT_PROVIDER_DEFINITIONS.map(s=>[s.id,s.label])),w=s=>({color:s.colors.foregroundMuted}),H=(0,n.withUnistyles)(o.Archive),T=(0,n.withUnistyles)(o.Bot),P=(0,n.withUnistyles)(o.Cpu),z=(0,n.withUnistyles)(o.PanelsTopLeft),O=(0,n.withUnistyles)(o.Server),D=(0,n.withUnistyles)(o.SlidersHorizontal);function A(s){const t=(0,l.c)(30),{group:o,filters:n,options:c,closeOnSelect:a,onChange:p}=s,h=void 0!==a&&a;let f;t[0]!==n||t[1]!==o.id||t[2]!==o.selected||t[3]!==p||t[4]!==c.models?(f=s=>{if("status"===o.id){let t=v.HistoryStatus.All;return s===v.HistoryStatus.Active&&(t=v.HistoryStatus.Active),s===v.HistoryStatus.Archived&&(t=v.HistoryStatus.Archived),void p(Object.assign({},n,{status:t}))}if("models"===o.id){const t=c.models.find(t=>I(t)===s),l=n.models.filter(t=>I(t)!==s),a=o.selected.includes(s)||!t?l:[...l,t];return void p(Object.assign({},n,{models:s?a:[]}))}const t=n[o.id],l=t.includes(s)?t.filter(t=>t!==s):[...t,s];p(Object.assign({},n,{[o.id]:s?l:[]}))},t[0]=n,t[1]=o.id,t[2]=o.selected,t[3]=p,t[4]=c.models,t[5]=f):f=t[5];const j=f;let b;t[6]!==j?(b=()=>j(""),t[6]=j,t[7]=b):b=t[7];const x=b;let y;if(t[8]!==o.options||t[9]!==j){let s;t[11]!==j?(s=s=>Object.assign({},s,{onSelect:()=>j(s.id)}),t[11]=j,t[12]=s):s=t[12],y=o.options.map(s),t[8]=o.options,t[9]=j,t[10]=y}else y=t[10];const S=y,M=!o.selected.length,w=`sessions-${o.id}-filter-all`;let H,T,P;if(t[13]!==o.all||t[14]!==x||t[15]!==M||t[16]!==w?(H=(0,_.jsx)(u.MenuItem,{selected:M,closeOnSelect:!0,onSelect:x,testID:w,children:o.all}),t[13]=o.all,t[14]=x,t[15]=M,t[16]=w,t[17]=H):H=t[17],t[18]!==h||t[19]!==o.id||t[20]!==o.selected||t[21]!==S){let s;t[23]!==h||t[24]!==o.id||t[25]!==o.selected?(s=s=>(0,_.jsx)(u.MenuItem,{leading:s.leading,selected:o.selected.includes(s.id),closeOnSelect:h,onSelect:s.onSelect,testID:`sessions-${o.id}-filter-item-${s.id}`,children:s.label},s.id),t[23]=h,t[24]=o.id,t[25]=o.selected,t[26]=s):s=t[26],T=S.map(s),t[18]=h,t[19]=o.id,t[20]=o.selected,t[21]=S,t[22]=T}else T=t[22];return t[27]!==H||t[28]!==T?(P=(0,_.jsxs)(_.Fragment,{children:[H,T]}),t[27]=H,t[28]=T,t[29]=P):P=t[29],P}function C(s){return s.disabled?s.title:s.selected.length?1===s.selected.length?s.options.find(t=>t.id===s.selected[0])?.label??s.title:`${s.title} (${s.selected.length})`:s.all}function F(s){return!s.disabled&&s.selected.length}function $(s,t){const[l]=s,[o]=t;return l.localeCompare(o)}function L(s){return{id:s,label:M.get(s)??s,leading:(0,_.jsx)(b.ProviderIcon,{provider:s,size:14,uniProps:w})}}function N(s){return{id:s.projectKey,label:s.projectName,leading:(0,_.jsx)(x.ProjectIconView,{iconDataUri:null,initial:s.projectName.charAt(0).toUpperCase(),projectViewKey:s.projectKey,size:14,textStyle:B.projectIconText})}}function R(s,t){return s.projectName.localeCompare(t.projectName)}function U(s){return{id:s.serverId,label:s.label||s.serverId,leading:(0,_.jsx)(j.HostStatusDot,{serverId:s.serverId})}}function V(s){return s.provider}function E(s){return[I(s),s]}function K(s){return[s.projectKey,s]}function k(s){return[(0,p.toolbarLabelTriggerStyle)(s),B.trigger]}const B=n.StyleSheet.create(s=>({bar:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:s.spacing[2],minHeight:f.buttonControlHeight.sm,uni__dependencies:[0]},clearGroup:{flexDirection:"row",alignItems:"center"},clearDivider:{width:s.borderWidth[1],height:s.spacing[4],backgroundColor:s.colors.border,uni__dependencies:[0]},trigger:{maxWidth:260},triggerText:{fontSize:s.fontSize.base,color:s.colors.foregroundMuted,flexShrink:1,uni__dependencies:[0]},hint:{color:s.colors.foregroundMuted,fontSize:s.fontSize.sm,padding:s.spacing[3],uni__dependencies:[0]},projectIconText:{fontSize:8}}))},5096,[895,896,453,36,234,146,1217,56,853,2984,3697,4626,3009,3012,3832,3811,4126,1216,3525,2896,279]);
|
|
16855
|
+
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.historyModelKey=I,e.hasHistoryFilters=function(s){return s.hosts.length>0||s.projects.length>0||s.providers.length>0||s.models.length>0||s.status!==v.HistoryStatus.All},e.HistoryFilterBar=function(n){const a=(0,l.c)(152),{filters:p,options:f,supported:j,onChange:x}=n,{t:H}=(0,c.useTranslation)(),G=(0,S.useHosts)(),W=(0,y.useIsCompactFormFactor)();let Y,J,X,q,Q,Z,ee,se,te,ie,le,oe,re,ne,ce;if(a[0]!==p.hosts||a[1]!==p.models||a[2]!==p.projects||a[3]!==p.providers||a[4]!==G||a[5]!==f.models||a[6]!==f.projects||a[7]!==j||a[8]!==H){const s=new Map(f.projects.map(K)),t=new Map(f.models.map(E)),l=[...new Set(f.models.map(V))].sort();let o,n;a[19]!==H?(o=H("sessions.filters.hosts"),a[19]=H,a[20]=o):o=a[20],a[21]!==H?(n=H("sidebar.display.hostFilter.all"),a[21]=H,a[22]=n):n=a[22];const c=p.hosts;let u,h,x,y;a[23]===Symbol.for("react.memo_cache_sentinel")?(u=(0,_.jsx)(O,{size:14,uniProps:M}),a[23]=u):u=a[23],a[24]!==G?(h=G.map(U),a[24]=G,a[25]=h):h=a[25],a[26]!==p.hosts||a[27]!==o||a[28]!==n||a[29]!==h?(te={id:"hosts",title:o,all:n,selected:c,icon:u,options:h},a[26]=p.hosts,a[27]=o,a[28]=n,a[29]=h,a[30]=te):te=a[30],a[31]!==H?(x=H("sessions.filters.projects"),a[31]=H,a[32]=x):x=a[32],a[33]!==H?(y=H("sidebar.display.projectFilter.all"),a[33]=H,a[34]=y):y=a[34];const S=p.projects;let v;a[35]===Symbol.for("react.memo_cache_sentinel")?(v=(0,_.jsx)(z,{size:14,uniProps:M}),a[35]=v):v=a[35];const w=!j,D=[...s.values()].sort(R).map(N);let A,C;a[36]!==p.projects||a[37]!==x||a[38]!==y||a[39]!==w||a[40]!==D?(ie={id:"projects",title:x,all:y,selected:S,icon:v,disabled:w,options:D},a[36]=p.projects,a[37]=x,a[38]=y,a[39]=w,a[40]=D,a[41]=ie):ie=a[41],a[42]!==H?(A=H("sessions.filters.provider"),a[42]=H,a[43]=A):A=a[43],a[44]!==H?(C=H("sessions.filters.allProviders"),a[44]=H,a[45]=C):C=a[45];const F=p.providers;let k;a[46]===Symbol.for("react.memo_cache_sentinel")?(k=(0,_.jsx)(T,{size:14,uniProps:M}),a[46]=k):k=a[46];const B=!j,W=l.map(L);let le;a[47]!==p.providers||a[48]!==A||a[49]!==C||a[50]!==B||a[51]!==W?(J={id:"providers",title:A,all:C,selected:F,icon:k,disabled:B,options:W},a[47]=p.providers,a[48]=A,a[49]=C,a[50]=B,a[51]=W,a[52]=J):J=a[52],Y="models",a[53]!==H?(X=H("sessions.filters.model"),a[53]=H,a[54]=X):X=a[54],a[55]!==H?(q=H("sessions.filters.allModels"),a[55]=H,a[56]=q):q=a[56],a[57]!==p.models?(Q=p.models.map(I),a[57]=p.models,a[58]=Q):Q=a[58],a[59]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,_.jsx)(P,{size:14,uniProps:M}),a[59]=Z):Z=a[59],ee=!j,a[60]!==H?(le=s=>{const[t,l]=s;return{id:t,label:l.model??H("sessions.filters.unknownModel"),leading:(0,_.jsx)(b.ProviderIcon,{provider:l.provider,size:14,uniProps:M})}},a[60]=H,a[61]=le):le=a[61],se=[...t.entries()].sort($).map(le),a[0]=p.hosts,a[1]=p.models,a[2]=p.projects,a[3]=p.providers,a[4]=G,a[5]=f.models,a[6]=f.projects,a[7]=j,a[8]=H,a[9]=Y,a[10]=J,a[11]=X,a[12]=q,a[13]=Q,a[14]=Z,a[15]=ee,a[16]=se,a[17]=te,a[18]=ie}else Y=a[9],J=a[10],X=a[11],q=a[12],Q=a[13],Z=a[14],ee=a[15],se=a[16],te=a[17],ie=a[18];a[62]!==Y||a[63]!==X||a[64]!==q||a[65]!==Q||a[66]!==Z||a[67]!==ee||a[68]!==se?(le={id:Y,title:X,all:q,selected:Q,icon:Z,disabled:ee,options:se},a[62]=Y,a[63]=X,a[64]=q,a[65]=Q,a[66]=Z,a[67]=ee,a[68]=se,a[69]=le):le=a[69];a[70]!==H?(oe=H("sessions.filters.status"),a[70]=H,a[71]=oe):oe=a[71];a[72]!==H?(re=H("sessions.filters.allSessions"),a[72]=H,a[73]=re):re=a[73];a[74]!==p.status?(ne=p.status===v.HistoryStatus.All?[]:[p.status],a[74]=p.status,a[75]=ne):ne=a[75];a[76]===Symbol.for("react.memo_cache_sentinel")?(ce=(0,_.jsx)(w,{size:14,uniProps:M}),a[76]=ce):ce=a[76];const de=!j;let ae,ue,pe,he,fe,me,ge;a[77]!==H?(ae=H("sessions.filters.active"),a[77]=H,a[78]=ae):ae=a[78];a[79]!==ae?(ue={id:v.HistoryStatus.Active,label:ae},a[79]=ae,a[80]=ue):ue=a[80];a[81]!==H?(pe=H("agentList.badges.archived"),a[81]=H,a[82]=pe):pe=a[82];a[83]!==pe?(he={id:v.HistoryStatus.Archived,label:pe},a[83]=pe,a[84]=he):he=a[84];a[85]!==ue||a[86]!==he?(fe=[ue,he],a[85]=ue,a[86]=he,a[87]=fe):fe=a[87];a[88]!==oe||a[89]!==re||a[90]!==ne||a[91]!==de||a[92]!==fe?(me={id:"status",title:oe,all:re,selected:ne,icon:ce,disabled:de,options:fe},a[88]=oe,a[89]=re,a[90]=ne,a[91]=de,a[92]=fe,a[93]=me):me=a[93];a[94]!==J||a[95]!==le||a[96]!==me||a[97]!==te||a[98]!==ie?(ge=[te,ie,J,le,me],a[94]=J,a[95]=le,a[96]=me,a[97]=te,a[98]=ie,a[99]=ge):ge=a[99];const je=ge;let be;a[100]!==je?(be=je.filter(F),a[100]=je,a[101]=be):be=a[101];const xe=be.length;let ye;a[102]!==x?(ye=()=>x(v.EMPTY_HISTORY_FILTERS),a[102]=x,a[103]=ye):ye=a[103];const Se=ye;if(W){let l,o,n;a[104]!==H?(l=H("sessions.filters.title"),a[104]=H,a[105]=l):l=a[105],a[106]===Symbol.for("react.memo_cache_sentinel")?(o=(0,_.jsx)(D,{size:14,uniProps:M}),a[106]=o):o=a[106],a[107]!==H?(n=H("sessions.filters.title"),a[107]=H,a[108]=n):n=a[108];const c=xe?` (${xe})`:"";let h,j,b,y,S,v,I,w;return a[109]!==n||a[110]!==c?(h=(0,_.jsxs)(t.Text,{style:B.triggerText,children:[n,c]}),a[109]=n,a[110]=c,a[111]=h):h=a[111],a[112]!==l||a[113]!==h?(j=(0,_.jsxs)(u.MenuTrigger,{accessibilityRole:"button",style:k,accessibilityLabel:l,testID:"sessions-filters-trigger",children:[o,h]}),a[112]=l,a[113]=h,a[114]=j):j=a[114],a[115]!==H?(b=H("sessions.filters.title"),a[115]=H,a[116]=b):b=a[116],a[117]!==p||a[118]!==je||a[119]!==x||a[120]!==f||a[121]!==H?(y=je.map(l=>(0,_.jsxs)(s.View,{children:[(0,_.jsx)(u.MenuLabel,{children:l.title}),l.disabled?(0,_.jsx)(t.Text,{style:B.hint,children:H("sessions.filters.updateHost")}):(0,_.jsx)(A,{group:l,filters:p,options:f,onChange:x}),(0,_.jsx)(u.MenuSeparator,{})]},l.id)),a[117]=p,a[118]=je,a[119]=x,a[120]=f,a[121]=H,a[122]=y):y=a[122],a[123]!==H?(S=H("sessions.filters.clear"),a[123]=H,a[124]=S):S=a[124],a[125]!==Se||a[126]!==S?(v=(0,_.jsx)(u.MenuItem,{closeOnSelect:!1,onSelect:Se,children:S}),a[125]=Se,a[126]=S,a[127]=v):v=a[127],a[128]!==b||a[129]!==y||a[130]!==v?(I=(0,_.jsxs)(u.MenuSurface,{sheetTitle:b,testID:"sessions-filters-sheet",scrollable:!0,children:[y,v]}),a[128]=b,a[129]=y,a[130]=v,a[131]=I):I=a[131],a[132]!==j||a[133]!==I?(w=(0,_.jsxs)(u.MenuRoot,{compactMode:"sheet",children:[j,I]}),a[132]=j,a[133]=I,a[134]=w):w=a[134],w}let ve,_e,Ie,He;a[135]!==p||a[136]!==je||a[137]!==x||a[138]!==f||a[139]!==H?(ve=je.map(s=>(0,_.jsxs)(u.MenuRoot,{children:[(0,_.jsxs)(u.MenuTrigger,{accessibilityRole:"button",style:k,testID:`sessions-${s.id}-filter-trigger`,accessibilityLabel:`${s.title}: ${C(s)}`,children:[s.icon,(0,_.jsx)(t.Text,{style:B.triggerText,numberOfLines:1,children:C(s)})]}),(0,_.jsx)(u.MenuSurface,{width:280,maxHeight:400,scrollable:!0,children:s.disabled?(0,_.jsx)(t.Text,{style:B.hint,children:H("sessions.filters.updateHost")}):(0,_.jsx)(A,{group:s,filters:p,options:f,closeOnSelect:"status"===s.id,onChange:x})})]},s.id)),a[135]=p,a[136]=je,a[137]=x,a[138]=f,a[139]=H,a[140]=ve):ve=a[140];a[141]!==j||a[142]!==H?(_e=j?null:(0,_.jsx)(t.Text,{style:B.hint,children:H("sessions.filters.updateHost")}),a[141]=j,a[142]=H,a[143]=_e):_e=a[143];a[144]!==xe||a[145]!==Se||a[146]!==H?(Ie=xe?(0,_.jsxs)(s.View,{style:B.clearGroup,children:[(0,_.jsx)(s.View,{style:B.clearDivider}),(0,_.jsx)(h.Button,{size:"sm",variant:"ghost",leftIcon:o.X,onPress:Se,children:H("sessions.filters.clear")})]}):null,a[144]=xe,a[145]=Se,a[146]=H,a[147]=Ie):Ie=a[147];a[148]!==ve||a[149]!==_e||a[150]!==Ie?(He=(0,_.jsxs)(s.View,{style:B.bar,children:[ve,_e,Ie]}),a[148]=ve,a[149]=_e,a[150]=Ie,a[151]=He):He=a[151];return He};var s=r(d[0]),t=r(d[1]),l=r(d[2]);r(d[3]),r(d[4]),r(d[5]);var o=r(d[6]),n=r(d[7]),c=r(d[8]),a=r(d[9]),u=r(d[10]),p=r(d[11]),h=r(d[12]),f=r(d[13]),j=r(d[14]),b=r(d[15]),x=r(d[16]),y=r(d[17]),S=r(d[18]),v=r(d[19]),_=r(d[20]);function I(s){return JSON.stringify([s.provider,s.model])}const H=new Map(a.AGENT_PROVIDER_DEFINITIONS.map(s=>[s.id,s.label])),M=s=>({color:s.colors.foregroundMuted}),w=(0,n.withUnistyles)(o.Archive),T=(0,n.withUnistyles)(o.Bot),P=(0,n.withUnistyles)(o.Cpu),z=(0,n.withUnistyles)(o.PanelsTopLeft),O=(0,n.withUnistyles)(o.Server),D=(0,n.withUnistyles)(o.SlidersHorizontal);function A(s){const t=(0,l.c)(30),{group:o,filters:n,options:c,closeOnSelect:a,onChange:p}=s,h=void 0!==a&&a;let f;t[0]!==n||t[1]!==o.id||t[2]!==o.selected||t[3]!==p||t[4]!==c.models?(f=s=>{if("status"===o.id){let t=v.HistoryStatus.All;return s===v.HistoryStatus.Active&&(t=v.HistoryStatus.Active),s===v.HistoryStatus.Archived&&(t=v.HistoryStatus.Archived),void p(Object.assign({},n,{status:t}))}if("models"===o.id){const t=c.models.find(t=>I(t)===s),l=n.models.filter(t=>I(t)!==s),a=o.selected.includes(s)||!t?l:[...l,t];return void p(Object.assign({},n,{models:s?a:[]}))}const t=n[o.id],l=t.includes(s)?t.filter(t=>t!==s):[...t,s];p(Object.assign({},n,{[o.id]:s?l:[]}))},t[0]=n,t[1]=o.id,t[2]=o.selected,t[3]=p,t[4]=c.models,t[5]=f):f=t[5];const j=f;let b;t[6]!==j?(b=()=>j(""),t[6]=j,t[7]=b):b=t[7];const x=b;let y;if(t[8]!==o.options||t[9]!==j){let s;t[11]!==j?(s=s=>Object.assign({},s,{onSelect:()=>j(s.id)}),t[11]=j,t[12]=s):s=t[12],y=o.options.map(s),t[8]=o.options,t[9]=j,t[10]=y}else y=t[10];const S=y,H=!o.selected.length,M=`sessions-${o.id}-filter-all`;let w,T,P;if(t[13]!==o.all||t[14]!==x||t[15]!==H||t[16]!==M?(w=(0,_.jsx)(u.MenuItem,{selected:H,closeOnSelect:!0,onSelect:x,testID:M,children:o.all}),t[13]=o.all,t[14]=x,t[15]=H,t[16]=M,t[17]=w):w=t[17],t[18]!==h||t[19]!==o.id||t[20]!==o.selected||t[21]!==S){let s;t[23]!==h||t[24]!==o.id||t[25]!==o.selected?(s=s=>(0,_.jsx)(u.MenuItem,{leading:s.leading,selected:o.selected.includes(s.id),closeOnSelect:h,onSelect:s.onSelect,testID:`sessions-${o.id}-filter-item-${s.id}`,children:s.label},s.id),t[23]=h,t[24]=o.id,t[25]=o.selected,t[26]=s):s=t[26],T=S.map(s),t[18]=h,t[19]=o.id,t[20]=o.selected,t[21]=S,t[22]=T}else T=t[22];return t[27]!==w||t[28]!==T?(P=(0,_.jsxs)(_.Fragment,{children:[w,T]}),t[27]=w,t[28]=T,t[29]=P):P=t[29],P}function C(s){return s.disabled?s.title:s.selected.length?1===s.selected.length?s.options.find(t=>t.id===s.selected[0])?.label??s.title:`${s.title} (${s.selected.length})`:s.all}function F(s){return!s.disabled&&s.selected.length}function $(s,t){const[l]=s,[o]=t;return l.localeCompare(o)}function L(s){return{id:s,label:H.get(s)??s,leading:(0,_.jsx)(b.ProviderIcon,{provider:s,size:14,uniProps:M})}}function N(s){return{id:s.projectKey,label:s.projectName,leading:(0,_.jsx)(x.ProjectIconView,{iconDataUri:null,initial:s.projectName.charAt(0).toUpperCase(),projectViewKey:s.projectKey,size:14,textStyle:B.projectIconText})}}function R(s,t){return s.projectName.localeCompare(t.projectName)}function U(s){return{id:s.serverId,label:s.label||s.serverId,leading:(0,_.jsx)(j.HostStatusDot,{serverId:s.serverId})}}function V(s){return s.provider}function E(s){return[I(s),s]}function K(s){return[s.projectKey,s]}function k(s){return[(0,p.toolbarLabelTriggerStyle)(s),B.trigger]}const B=n.StyleSheet.create(s=>({bar:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:s.spacing[2],minHeight:f.buttonControlHeight.sm,uni__dependencies:[0]},clearGroup:{flexDirection:"row",alignItems:"center"},clearDivider:{width:s.borderWidth[1],height:s.spacing[4],backgroundColor:s.colors.border,uni__dependencies:[0]},trigger:{minHeight:f.buttonControlHeight.sm,maxWidth:260},triggerText:{fontSize:s.fontSize.base,color:s.colors.foregroundMuted,flexShrink:1,uni__dependencies:[0]},hint:{color:s.colors.foregroundMuted,fontSize:s.fontSize.sm,padding:s.spacing[3],uni__dependencies:[0]},projectIconText:{fontSize:8}}))},5096,[895,896,453,36,234,146,1217,56,853,2984,3697,4626,3009,3012,3832,3811,4126,1216,3525,2896,279]);
|
|
16856
16856
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.HistoryDisplayMenu=function(l){const c=(0,t.c)(21),{fields:f,onToggle:T}=l,{t:j}=(0,n.useTranslation)();let M,b,_,v,D,I,P,z,L;c[0]!==j?(M=j("sessions.display.title"),c[0]=j,c[1]=M):M=c[1];c[2]===Symbol.for("react.memo_cache_sentinel")?(b=(0,p.jsx)(h,{size:14,uniProps:H}),c[2]=b):b=c[2];c[3]!==j?(_=j("sessions.display.title"),c[3]=j,c[4]=_):_=c[4];c[5]!==_?(v=(0,p.jsx)(s.Text,{style:S.triggerText,children:_}),c[5]=_,c[6]=v):v=c[6];c[7]!==M||c[8]!==v?(D=(0,p.jsxs)(u.MenuTrigger,{accessibilityRole:"button",accessibilityLabel:M,testID:"sessions-display-trigger",style:y.toolbarLabelTriggerStyle,children:[b,v]}),c[7]=M,c[8]=v,c[9]=D):D=c[9];c[10]!==j?(I=j("sessions.display.title"),c[10]=j,c[11]=I):I=c[11];c[12]!==f||c[13]!==T?(P=x.map((s,t)=>(0,p.jsxs)(o.Fragment,{children:[t>0?(0,p.jsx)(u.MenuSeparator,{}):null,s.map(s=>(0,p.jsx)(F,{field:s,selected:f[s],onToggle:T},s))]},s[0])),c[12]=f,c[13]=T,c[14]=P):P=c[14];c[15]!==I||c[16]!==P?(z=(0,p.jsx)(u.MenuSurface,{align:"end",width:220,sheetTitle:I,testID:"sessions-display-menu",children:P}),c[15]=I,c[16]=P,c[17]=z):z=c[17];c[18]!==D||c[19]!==z?(L=(0,p.jsxs)(u.MenuRoot,{compactMode:"sheet",children:[D,z]}),c[18]=D,c[19]=z,c[20]=L):L=c[20];return L};var s=r(d[0]),t=r(d[1]),o=r(d[2]);r(d[3]);var l=r(d[4]),n=r(d[5]),c=r(d[6]),y=r(d[7]),u=r(d[8]),f=r(d[9]),p=r(d[10]);const h=(0,c.withUnistyles)(l.Settings2),H=s=>({color:s.colors.foregroundMuted}),x=[[f.HistoryField.Project,f.HistoryField.Workspace,f.HistoryField.Branch,f.HistoryField.Host],[f.HistoryField.Provider,f.HistoryField.Model,f.HistoryField.Effort,f.HistoryField.Turns,f.HistoryField.Cost],[f.HistoryField.Status,f.HistoryField.LastActivity]];function F(s){const o=(0,t.c)(11),{field:l,selected:c,onToggle:y}=s,{t:f}=(0,n.useTranslation)();let h;o[0]!==l||o[1]!==y?(h=()=>y(l),o[0]=l,o[1]=y,o[2]=h):h=o[2];const H=h,x=`sessions-display-${l}`,F=`sessions.display.fields.${l}`;let S,T;return o[3]!==f||o[4]!==F?(S=f(F),o[3]=f,o[4]=F,o[5]=S):S=o[5],o[6]!==c||o[7]!==x||o[8]!==S||o[9]!==H?(T=(0,p.jsx)(u.MenuItem,{selected:c,closeOnSelect:!1,onSelect:H,testID:x,children:S}),o[6]=c,o[7]=x,o[8]=S,o[9]=H,o[10]=T):T=o[10],T}const S=c.StyleSheet.create(s=>({triggerText:{fontSize:s.fontSize.base,color:s.colors.foregroundMuted,uni__dependencies:[0]}}))},5097,[896,453,36,234,1217,853,56,4626,3697,2896,279]);
|
|
16857
16857
|
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fetchAgentHistoryPage=I,e.collectAgentHistoryHostErrors=b,e.fetchAgentHistoryBatch=S,e.useAgentHistory=function(u){const f=(0,t.c)(83),{t:h}=(0,a.useTranslation)(),v=(0,l.useHosts)();let I;f[0]===Symbol.for("react.memo_cache_sentinel")?(I=(0,l.getHostRuntimeStore)(),f[0]=I):I=f[0];const E=I;let L;f[1]!==v||f[2]!==u.serverIds?(L=u.serverIds?.length?u.serverIds:v.map(C),f[1]=v,f[2]=u.serverIds,f[3]=L):L=f[3];const F=L,B=(0,l.useHostRuntimeConnectionStatuses)(F),q=u.enabled??!0;let D,N,R;f[4]!==q||f[5]!==F?(D=()=>{if(!q)return;const t=F.map(t=>E.acquireDirectoryDemand(t));return()=>t.forEach(k)},N=[q,F,E],f[4]=q,f[5]=F,f[6]=D,f[7]=N):(D=f[6],N=f[7]);(0,n.useEffect)(D,N),f[8]!==F?(R=t=>{const s={};for(const n of F)s[n]=t.sessions[n]?.agents;return s},f[8]=F,f[9]=R):R=f[9];const _=(0,c.useSessionStore)((0,o.useShallow)(R));let x;f[10]!==v?(x=new Map(v.map(T)),f[10]=v,f[11]=x):x=f[11];const K=x;let Q;if(f[12]!==B||f[13]!==F||f[14]!==K){const t=[],s=[];for(const n of F){const o=E.getClient(n),a=K.get(n)??n;o&&"online"===B.get(n)?t.push({serverId:n,serverLabel:a,client:o}):s.push({serverId:n,serverName:a})}Q={targetHosts:t,unreachableHosts:s},f[12]=B,f[13]=F,f[14]=K,f[15]=Q}else Q=f[15];const{targetHosts:U,unreachableHosts:z}=Q;let G;f[16]!==U?(G=U.map(M),f[16]=U,f[17]=G):G=f[17];const J=G;let V;f[18]!==J?(V=t=>J.length>0&&J.every(s=>!0===t.sessions[s]?.serverInfo?.features?.agentHistorySearch),f[18]=J,f[19]=V):V=f[19];const W=(0,c.useSessionStore)(V);let X;f[20]!==J?(X=t=>J.length>0&&J.every(s=>!0===t.sessions[s]?.serverInfo?.features?.agentHistoryFilters),f[20]=J,f[21]=X):X=f[21];const Y=(0,c.useSessionStore)(X),Z=Y?u.filter:void 0;let $;f[22]!==u.search?($=u.search?.trim()??"",f[22]=u.search,f[23]=$):$=f[23];const ee=$,te=W?ee:"";let se;f[24]!==Z||f[25]!==Y||f[26]!==te||f[27]!==J?(se=[...1===J.length?(0,p.agentHistoryQueryKey)(J[0]):(0,p.allAgentHistoryQueryKey)(J),te,Z,Y],f[24]=Z,f[25]=Y,f[26]=te,f[27]=J,f[28]=se):se=f[28];const re=se;let ne;f[29]!==v?(ne=new Map(v.map(P)),f[29]=v,f[30]=ne):ne=f[30];const oe=ne,ae=Boolean(q&&U.length>0);let ie,le;f[31]!==Z||f[32]!==Y||f[33]!==te||f[34]!==h||f[35]!==U?(ie=async t=>{const{pageParam:s}=t;if(0===U.length)throw new Error(h("workspace.terminal.hostDisconnected"));return S(Object.assign({hosts:U,cursorByServerId:s,filter:Z,includeFilterOptions:Y},te?{search:te}:{}))},f[31]=Z,f[32]=Y,f[33]=te,f[34]=h,f[35]=U,f[36]=ie):ie=f[36];f[37]!==re||f[38]!==ae||f[39]!==ie?(le={queryKey:re,enabled:ae,staleTime:3e4,placeholderData:s.keepPreviousData,initialPageParam:null,getNextPageParam:O,queryFn:ie},f[37]=re,f[38]=ae,f[39]=ie,f[40]=le):le=f[40];const ce=(0,s.useInfiniteQuery)(le),{data:ue,fetchNextPage:ge,hasNextPage:de,isError:pe,isFetching:fe,isFetchingNextPage:he,isLoading:ve,isPlaceholderData:me,refetch:Ie}=ce;let ye;f[41]!==q||f[42]!==Ie||f[43]!==U.length?(ye=async()=>{q&&0!==U.length&&await Ie()},f[41]=q,f[42]=Ie,f[43]=U.length,f[44]=ye):ye=f[44];const be=ye;let Oe;f[45]!==q||f[46]!==ge||f[47]!==de||f[48]!==he||f[49]!==U.length?(Oe=()=>{q&&0!==U.length&&de&&!he&&ge()},f[45]=q,f[46]=ge,f[47]=de,f[48]=he,f[49]=U.length,f[50]=Oe):Oe=f[50];const Se=Oe;let Ae;if(f[51]!==ue?.pages||f[52]!==_||f[53]!==oe){const t=(ue?.pages??[]).flatMap(H);let s;f[55]!==_||f[56]!==oe?(s=t=>{const s=_[t.serverId]?.get(t.id),n=Object.assign({},t,{serverLabel:oe.get(t.serverId)??t.serverLabel});return s&&Object.assign(n,{status:s.status,turn:s.turn,turnCount:s.turnCount??t.turnCount,requiresAttention:s.requiresAttention,attentionReason:s.attentionReason,pendingPermissionCount:s.pendingPermissions.length}),n},f[55]=_,f[56]=oe,f[57]=s):s=f[57];Ae=y(t.map(s)),f[51]=ue?.pages,f[52]=_,f[53]=oe,f[54]=Ae}else Ae=f[54];const je=Ae;let we,He;f[58]!==ue?.pages?(we=()=>({projects:ue?.pages.flatMap(w)??[],models:ue?.pages.flatMap(j)??[]}),f[58]=ue?.pages,f[59]=we):we=f[59];f[60]!==we?(He=we(),f[60]=we,f[61]=He):He=f[61];const Pe=He,Me=me||ve&&0===je.length,Te=fe&&!he&&je.length>0;let ke;f[62]!==ue?.pages||f[63]!==te?(ke=te&&ue?.pages.some(A),f[62]=ue?.pages,f[63]=te,f[64]=ke):ke=f[64];const Ce=Boolean(ke);let Ee;f[65]!==ue?.pages||f[66]!==z?(Ee=b({pages:ue?.pages??[],unreachableHosts:z}),f[65]=ue?.pages,f[66]=z,f[67]=Ee):Ee=f[67];const Le=Ee;let Fe;f[68]!==je||f[69]!==Pe||f[70]!==de||f[71]!==Le||f[72]!==pe||f[73]!==he||f[74]!==Y||f[75]!==Me||f[76]!==ve||f[77]!==Te||f[78]!==W||f[79]!==Ce||f[80]!==Se||f[81]!==be?(Fe={agents:je,isLoading:ve,isInitialLoad:Me,isRevalidating:Te,isError:pe,hasMore:de,isLoadingMore:he,isSearchSupported:W,isFilterSupported:Y,filterOptions:Pe,isSearchTruncated:Ce,hostErrors:Le,refreshAll:be,loadMore:Se},f[68]=je,f[69]=Pe,f[70]=de,f[71]=Le,f[72]=pe,f[73]=he,f[74]=Y,f[75]=Me,f[76]=ve,f[77]=Te,f[78]=W,f[79]=Ce,f[80]=Se,f[81]=be,f[82]=Fe):Fe=f[82];return Fe};var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]),a=r(d[4]),l=r(d[5]),c=r(d[6]),u=r(d[7]),p=r(d[8]);const f=200,h=[{key:"updated_at",direction:"desc"}],v="No connected hosts could load agent history";async function I(t){const s=await t.client.fetchAgentHistory(Object.assign({},t.search?{search:t.search}:{},t.filter?{filter:t.filter}:{},t.includeFilterOptions?{includeFilterOptions:!0}:{},{sort:h,page:t.cursor?{limit:f,cursor:t.cursor}:{limit:f}})),{agents:n}=(0,u.buildAgentDirectoryState)({serverId:t.serverId,entries:s.entries}),o=new Map(s.entries.map(({agent:t})=>[t.id,t.effectiveThinkingOptionId??t.runtimeInfo?.thinkingOptionId??t.thinkingOptionId]));return{filterOptions:s.filterOptions,isSearchTruncated:!0===s.searchTruncated,agents:Array.from(n.values(),s=>({id:s.id,serverId:t.serverId,serverLabel:t.serverId,title:s.title??null,status:s.status,turn:s.turn,turnCount:s.turnCount,lastActivityAt:s.lastActivityAt,cwd:s.cwd,workspaceId:s.workspaceId,provider:s.provider,model:s.runtimeInfo?.model??s.model,thinkingOptionId:o.get(s.id),lastUsage:s.lastUsage,pendingPermissionCount:s.pendingPermissions.length,requiresAttention:s.requiresAttention,attentionReason:s.attentionReason,attentionTimestamp:s.attentionTimestamp??null,archivedAt:s.archivedAt??null,createdAt:s.createdAt,labels:s.labels,projectPlacement:s.projectPlacement})),pageInfo:s.pageInfo}}function y(t){return[...t].sort((t,s)=>s.lastActivityAt.getTime()-t.lastActivityAt.getTime())}function b(t){const s=new Map;for(const n of t.unreachableHosts)s.set(n.serverId,n);for(const n of t.pages)for(const t of n.hostErrors)s.set(t.serverId,t);return[...s.values()]}function O(t){const s={};for(const[n,o]of Object.entries(t.pageInfoByServerId))o.hasMore&&o.nextCursor&&(s[n]=o.nextCursor);return Object.keys(s).length>0?s:null}async function S(t){const s=t.cursorByServerId??{},n=Object.keys(s).length>0?t.hosts.filter(t=>Object.hasOwn(s,t.serverId)):t.hosts,o=await Promise.allSettled(n.map(async n=>({host:n,page:await I(Object.assign({client:n.client,serverId:n.serverId,cursor:s[n.serverId]??null,filter:t.filter,includeFilterOptions:t.includeFilterOptions&&!t.cursorByServerId},t.search?{search:t.search}:{}))}))),a=o.flatMap(t=>"fulfilled"===t.status?[t.value]:[]);if(0===a.length)throw new Error(v);const l=o.flatMap((t,s)=>"rejected"===t.status?[{serverId:n[s].serverId,serverName:n[s].serverLabel}]:[]),c=a.flatMap(({host:t,page:s})=>s.agents.map(s=>Object.assign({},s,{serverLabel:t.serverLabel}))),u=Object.fromEntries(a.map(({host:t,page:s})=>[t.serverId,s.pageInfo]));return Object.assign({filterOptions:{projects:a.flatMap(({page:t})=>t.filterOptions?.projects??[]),models:a.flatMap(({page:t})=>t.filterOptions?.models??[])},agents:y(c),pageInfoByServerId:u,hostErrors:l},t.search?{isSearchTruncated:a.some(({page:t})=>t.isSearchTruncated)}:{})}function A(t){return t.isSearchTruncated}function j(t){return t.filterOptions?.models??[]}function w(t){return t.filterOptions?.projects??[]}function H(t){return t.agents}function P(t){return[t.serverId,t.label]}function M(t){return t.serverId}function T(t){return[t.serverId,t.label]}function k(t){return t()}function C(t){return t.serverId}},5098,[453,799,36,3445,853,3525,3446,3614,3606]);
|
|
16858
16858
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var e=r(d[0]),t=r(d[1]);r(d[2]);var s,o=r(d[3]),n=r(d[4]),u=r(d[5]),c=r(d[6]),l=r(d[7]),f=(s=l)&&s.__esModule?s:{default:s},S=r(d[8]),v=r(d[9]),p=r(d[10]);function _(){const s=(0,e.c)(7),n=(0,c.useHosts)(),l=(0,u.useLocalDaemonServerIdState)(),f=(0,o.useHostRuntimeBootstrapState)();if("loading"===l.status){let e;return s[0]!==f?(e=(0,p.jsx)(S.StartupSplashScreen,{bootstrapState:f}),s[0]=f,s[1]=e):e=s[1],e}if("resolved"===l.status&&null!==l.serverId&&n.some(e=>e.serverId===l.serverId)){let e,o;return s[2]!==l.serverId?(e=(0,v.buildSettingsHostSectionRoute)(l.serverId,"host"),s[2]=l.serverId,s[3]=e):e=s[3],s[4]!==e?(o=(0,p.jsx)(t.Redirect,{href:e}),s[4]=e,s[5]=o):o=s[5],o}let _;return s[6]===Symbol.for("react.memo_cache_sentinel")?(_=(0,p.jsx)(t.Redirect,{href:(0,v.buildSettingsRoute)()}),s[6]=_):_=s[6],_}function b(){const s=(0,e.c)(8),o=(0,t.useLocalSearchParams)(),u="string"==typeof o.section?o.section:"";let c;s[0]!==u?(c=(0,v.isSettingsSectionSlug)(u)?u:"general",s[0]=u,s[1]=c):c=s[1];const l=c,S="string"==typeof o.addHost?o.addHost:null;let b;s[2]!==l?(b={kind:"section",section:l},s[2]=l,s[3]=b):b=s[3];const h=b;if("daemon"===u){let e;return s[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,p.jsx)(n.HostRouteBootstrapBoundary,{children:(0,p.jsx)(_,{})}),s[4]=e):e=s[4],e}let j;return s[5]!==S||s[6]!==h?(j=(0,p.jsx)(f.default,{view:h,openAddHostIntent:S}),s[5]=S,s[6]=h,s[7]=j):j=s[7],j}},5099,[453,455,36,3020,4938,3833,3525,5100,4939,3669,279]);
|
|
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-58879894a5f055434504197e7a73cd52.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.17",
|
|
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.17",
|
|
124
|
+
"@getpaseo/highlight": "0.11.0-fork.17",
|
|
125
|
+
"@getpaseo/plugin": "0.11.0-fork.17",
|
|
126
|
+
"@getpaseo/protocol": "0.11.0-fork.17",
|
|
127
|
+
"@getpaseo/relay": "0.11.0-fork.17"
|
|
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.17",
|
|
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.17",
|
|
25
|
+
"@getpaseo/highlight": "0.11.0-fork.17",
|
|
26
|
+
"@getpaseo/plugin": "0.11.0-fork.17",
|
|
27
|
+
"@getpaseo/protocol": "0.11.0-fork.17",
|
|
28
|
+
"@getpaseo/relay": "0.11.0-fork.17",
|
|
29
|
+
"@getpaseo/server": "0.11.0-fork.17",
|
|
30
30
|
"@isaacs/ttlcache": "^2.1.4",
|
|
31
31
|
"@lezer/common": "^1.5.0",
|
|
32
32
|
"@lezer/cpp": "^1.1.5",
|