@agentsky/desktop-ui 0.4.233 → 0.4.234

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.
Files changed (2) hide show
  1. package/dist/app.js +1 -1
  2. package/package.json +1 -1
package/dist/app.js CHANGED
@@ -78,7 +78,7 @@ Tycoon`,"AgentSky API key":"AgentSky API \u5BC6\u94A5","AgentSky API: Claude and
78
78
  </button>`}function H$({label:e,class:t,children:n,...a}){return l`<table class=${Na("ui-table",t)} aria-label=${e} ...${a}>${n}</table>`}function Ue({icon:e,title:t,children:n,tone:a="default",class:s,...r}){return l`<div class=${Na("ui-notice",s)} data-tone=${a} role=${a==="danger"?"alert":"status"} ...${r}>
79
79
  ${e||a==="danger"?l`<${K} name=${e??"lucide-circle-alert"} size=${16} />`:null}
80
80
  <div>${t?l`<div class="ui-notice-title">${t}</div>`:null}${n}</div>
81
- </div>`}var Zz="button:not(:disabled), a[href], input:not([type='hidden']):not([hidden]):not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex='-1'])";function Jz(e){return e?e.querySelector("[autofocus]")??e.querySelector(Zz)??e:null}function Mo({label:e,onClose:t,children:n,align:a="start"}){let s=U(null),r=U(t);r.current=t,R(()=>{let u=h=>{!(s.current?.querySelector("select.is-menu-open")&&h.target.closest?.(".menu-layer"))&&!s.current?.parentElement?.contains(h.target)&&r.current()},d=h=>{h.key==="Escape"&&(h.stopPropagation(),r.current())},p=document.activeElement;return s.current?.contains(document.activeElement)||Jz(s.current)?.focus({preventScroll:!0}),document.addEventListener("mousedown",u),document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",d,!0);let h=document.activeElement;(!h||h===document.body||s.current?.contains?.(h)||h.isConnected===!1)&&p?.isConnected&&typeof p.focus=="function"&&p.focus({preventScroll:!0})}},[]);let[i,c]=$(null);return ht(()=>{let u=()=>{let d=s.current;if(!d)return;let p={top:d.style.top,bottom:d.style.bottom,maxHeight:d.style.maxHeight};Object.assign(d.style,{top:"",bottom:"",maxHeight:""});let h=d.getBoundingClientRect(),m=d.parentElement?.getBoundingClientRect();if(Object.assign(d.style,p),m){let f=VS(h,m,window.innerHeight);c(g=>JSON.stringify(g)===JSON.stringify(f)?g:f)}};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[n]),l`<div ref=${s} class=${`popover is-${a}`} style=${i??void 0} role="dialog" aria-label=${e} tabindex="-1">${n}</div>`}var Xe={};gz(Xe,{BridgeError:()=>mm,agentBrowser:()=>Ul,agents:()=>zn,apiKeys:()=>qc,app:()=>ot,arena:()=>gs,artifacts:()=>it,auth:()=>rn,billing:()=>Hi,bootstrap:()=>qs,bots:()=>hd,browser:()=>ga,browserData:()=>Ko,browserLogins:()=>Ba,catalog:()=>pd,channels:()=>ys,chats:()=>Vo,composer:()=>Rn,computerHistory:()=>hn,connectors:()=>Ws,developer:()=>cF,devicePlugins:()=>gm,dictation:()=>xa,fees:()=>fm,imports:()=>Hl,library:()=>qe,listing:()=>$s,liveBrowser:()=>ja,local:()=>dt,localSync:()=>wr,market:()=>br,meetingAutoJoin:()=>Wc,meetingNotes:()=>Wt,members:()=>la,menu:()=>V$,on:()=>ve,onRefreshed:()=>ia,pathOf:()=>fd,people:()=>ql,permissions:()=>jn,plans:()=>ka,plugins:()=>vt,policies:()=>Gi,reminders:()=>vr,remoteControl:()=>gd,repos:()=>Gl,routines:()=>Sa,rules:()=>Xo,sessions:()=>Kt,settings:()=>un,setup:()=>Wl,share:()=>Io,sky:()=>md,thisMac:()=>It,threads:()=>$t,transcript:()=>xt,usage:()=>K$,vaults:()=>ri,vendors:()=>Yi,wechat:()=>ro,workspace:()=>Fn});var Uc="Try again",Qz="This took too long. Try again.",eF="Can't reach AgentSky. Check your connection and try again.",G$={general:"Something went wrong. Try again.",agents:"Couldn't load agents. Try again.",models:"Couldn't load models. Try again.",start:"Couldn't start the chat. Try again.",save:"Couldn't save the change. Try again.",attach:"Couldn't attach the file. Try again.",secret:"Couldn't save the credential to Secrets. Try again.",reach:"This chat couldn't use this Mac. Try again."},tF=new Set(["NO_CREDITS","account_already_connected","acp_new_session_required","arena_sealed","browser_asleep","browser_retry_running","browser_unavailable","calendar_not_connected","connection_not_pending","continued_on_mac","creation_pending","creation_unconfirmed","creation_unsettled","delivery_unconfirmed","github_not_connected","github_reconnect_required","harness_unsupported","hook_rules_unavailable","insufficient_credits","invalid_credential","mcp_server_name_collision","mcp_token_rejected","mirror_empty","name_taken","needs_reconnect","not_owner","not_shareable","oauth_server","owner_only","payment_setup_required","plugin_blocked","plugin_disabled","question_changed","question_closed","run_not_retryable","runs_on_mac","session_running","sign_in_cleanup_unavailable","sign_in_required","stop_forbidden","withdraw_forbidden","workspace_payer_required","workspace_wallet_empty"]),ZS={draft_not_saved:"The draft could not be saved. Try again.",forbidden:"You don't have access to do this.",rate_limited:"Too many tries. Wait a moment and try again.",session_archived:"This chat has ended.",session_busy:"This chat is busy. Wait for it to finish, then try again.",session_terminated:"This chat has ended."},nF=new Set(["TimeoutError","AbortError"]),aF=new Set(["ETIMEDOUT","ESOCKETTIMEDOUT","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","ABORT_ERR"]),sF=new Set(["ECONNREFUSED","ECONNRESET","ENOTFOUND","EAI_AGAIN","ENETUNREACH","EHOSTUNREACH","ENETDOWN","EPIPE","UND_ERR_SOCKET"]),oF=/\btime[ds]?[ -]?out\b|\btimeout\b|\baborted\b|\babort(?:ed)?Error\b/i,rF=/failed to fetch|fetch failed|network ?error|networkerror|network request failed|load failed|internet connection|\boffline\b|ECONNREFUSED|ECONNRESET|ENOTFOUND|EAI_AGAIN|ENETUNREACH|EHOSTUNREACH|socket hang up/i,iF=/[{}<>`=\\|\n]|:\/\/|\/Users\/|\/usr\/|\bE[A-Z]{3,}\b|\bHTTP\b|\b[1-5]\d\d\b|\b(?:undefined|null|NaN)\b|unexpected token|is not a function|is not defined|cannot read prop|\(reading\b|at position|\bJSON\b|\bstack\b|\bspawn\b|command failed|exit code|status code|\bsocket\b|\bSQL\b|\bconstraint\b|\b[a-z]+_[a-z_]+\b|\b[a-z]+[A-Z][A-Za-z]*\b|\w+Error\b|^Error\b|Error:|\bSIG[A-Z]{2,}\b|\bexited with\b|\bwith signal\b/,Y$=e=>e!==null&&typeof e=="object"?e:{};function JS(e){let t=new Set;for(let n=e;n!=null&&!t.has(n);n=Y$(n).cause){t.add(n);let{name:a,code:s,message:r}=typeof n=="object"?Y$(n):{name:void 0,code:void 0,message:n},i=typeof r=="string"?r:"";if(typeof a=="string"&&nF.has(a)||typeof s=="string"&&aF.has(s)||oF.test(i))return"timeout";if(typeof s=="string"&&sF.has(s)||rF.test(i))return"network";if(typeof n!="object")break}return"other"}function hm(e){if(typeof e!="string")return!1;let t=e.trim();return t.length>=8&&t.length<=300&&/^[A-Z]/.test(t)&&/[.?!…]$/.test(t)&&!iF.test(t)&&JS(t)==="other"}function j$(e){if(typeof e=="string")return hm(e)?e:null;let{name:t,code:n,message:a,worded:s}=Y$(e);return typeof n=="string"&&Object.hasOwn(ZS,n)?ZS[n]:typeof a!="string"||!a.trim()?null:typeof n=="string"&&tF.has(n)||s===!0||(t===void 0||t==="Error")&&(n===void 0||n==="failed")&&hm(a)?a:null}function yr(e,t="general"){let n=j$(e);if(n)return n;let a=JS(e);return a==="timeout"?Qz:a==="network"?eF:Object.hasOwn(G$,t)?G$[t]:t||G$.general}var ft=window.agentsky,qs=ft.bootstrap?.()??null,mm=class extends Error{constructor({code:t,message:n,playgroundId:a,sessionId:s}={}){let r={code:t,message:n},i=j$(r)??(hm(n)?n:null);super(i??yr(r),{cause:r}),this.name="BridgeError",this.code=t,i&&(this.worded=!0),typeof a=="string"&&a.length<=100&&(this.playgroundId=a),typeof s=="string"&&s.length<=100&&(this.sessionId=s)}},lF=e=>async t=>{let n=await e(t);if(!n.ok)throw new mm(n.error);return n.value},bt=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,lF(n)])),ve=ft.on,ia=(e,t)=>ve("data:refreshed",({family:n}={})=>{e.includes(n)&&t(n)}),V$=bt(ft.menu),ot=bt(ft.app),rn=bt(ft.auth),pd=bt(ft.catalog),hd=bt(ft.bots),ka=bt(ft.plans),Vo=bt(ft.chats),$t=bt(ft.threads),zn=bt(ft.agents),md=bt(ft.sky),br=bt(ft.market),gs=bt(ft.arena),cF=bt(ft.developer),Rn=bt(ft.composer),it=bt(ft.artifacts),Kt=bt(ft.sessions),ga=bt(ft.browser),Ul=bt(ft.agentBrowser),Io=bt(ft.share),ql=bt(ft.people),Fn=bt(ft.workspace),ri=bt(ft.vaults),Ko=ft.browserData?bt(ft.browserData):null,Ba=bt(ft.browserLogins),ja=bt(ft.liveBrowser),K$=bt(ft.usage),$s=bt(ft.listing),qe=bt(ft.library),fd=ft.paths.of,Ws=bt(ft.connectors),jn=bt(ft.permissions),vr=bt(ft.reminders),Wl=bt(ft.setup),Hi=bt(ft.billing),Hl=bt(ft.imports),Gi=bt(ft.policies),fm=bt(ft.fees),Yi=bt(ft.vendors),qc=bt(ft.apiKeys),un=bt(ft.settings),Sa=bt(ft.routines),Xo=bt(ft.rules),la=bt(ft.members),xt=bt(ft.transcript),Gl=bt(ft.repos),xa=ft.dictation,dt=bt(ft.local),It=bt(ft.thisMac),gm=bt(ft.devicePlugins??{}),gd=bt(ft.remoteControl??{}),Wt=bt(ft.meetingNotes),hn=bt(ft.computerHistory??{}),vt=bt(ft.plugins),Wc=bt(ft.meetingAutoJoin),wr=bt(ft.localSync),ro=bt(ft.wechat),ys=bt(ft.channels);function Hc(e){return[e.title,e.url].find(t=>t&&t!=="about:blank")??""}function $d({reach:e,children:t}){return l`<div class=${`browser-reach-controls${t?" browser-reach-context":""}`}>
81
+ </div>`}var Zz="button:not(:disabled), a[href], input:not([type='hidden']):not([hidden]):not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex='-1'])";function Jz(e){return e?e.querySelector("[autofocus]")??e.querySelector(Zz)??e:null}function Mo({label:e,onClose:t,children:n,align:a="start"}){let s=U(null),r=U(t);r.current=t,R(()=>{let u=h=>{!(s.current?.querySelector("select.is-menu-open")&&h.target.closest?.(".menu-layer"))&&!s.current?.parentElement?.contains(h.target)&&r.current()},d=h=>{h.key==="Escape"&&(h.stopPropagation(),r.current())},p=document.activeElement;return s.current?.contains(document.activeElement)||Jz(s.current)?.focus({preventScroll:!0}),document.addEventListener("mousedown",u),document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",d,!0);let h=document.activeElement;(!h||h===document.body||s.current?.contains?.(h)||h.isConnected===!1)&&p?.isConnected&&typeof p.focus=="function"&&p.focus({preventScroll:!0})}},[]);let[i,c]=$(null);return ht(()=>{let u=()=>{let d=s.current;if(!d)return;let p={top:d.style.top,bottom:d.style.bottom,maxHeight:d.style.maxHeight};Object.assign(d.style,{top:"",bottom:"",maxHeight:""});let h=d.getBoundingClientRect(),m=d.parentElement?.getBoundingClientRect();if(Object.assign(d.style,p),m){let f=VS(h,m,window.innerHeight);c(g=>JSON.stringify(g)===JSON.stringify(f)?g:f)}};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[n]),l`<div ref=${s} class=${`popover is-${a}`} style=${i??void 0} role="dialog" aria-label=${e} tabindex="-1">${n}</div>`}var Xe={};gz(Xe,{BridgeError:()=>mm,agentBrowser:()=>Ul,agents:()=>zn,apiKeys:()=>qc,app:()=>ot,arena:()=>gs,artifacts:()=>it,auth:()=>rn,billing:()=>Hi,bootstrap:()=>qs,bots:()=>hd,browser:()=>ga,browserData:()=>Ko,browserLogins:()=>Ba,catalog:()=>pd,channels:()=>ys,chats:()=>Vo,composer:()=>Rn,computerHistory:()=>hn,connectors:()=>Ws,developer:()=>cF,devicePlugins:()=>gm,dictation:()=>xa,fees:()=>fm,imports:()=>Hl,library:()=>qe,listing:()=>$s,liveBrowser:()=>ja,local:()=>dt,localSync:()=>wr,market:()=>br,meetingAutoJoin:()=>Wc,meetingNotes:()=>Wt,members:()=>la,menu:()=>V$,on:()=>ve,onRefreshed:()=>ia,pathOf:()=>fd,people:()=>ql,permissions:()=>jn,plans:()=>ka,plugins:()=>vt,policies:()=>Gi,reminders:()=>vr,remoteControl:()=>gd,repos:()=>Gl,routines:()=>Sa,rules:()=>Xo,sessions:()=>Kt,settings:()=>un,setup:()=>Wl,share:()=>Io,sky:()=>md,thisMac:()=>It,threads:()=>$t,transcript:()=>xt,usage:()=>K$,vaults:()=>ri,vendors:()=>Yi,wechat:()=>ro,workspace:()=>Fn});var Uc="Try again",Qz="This took too long. Try again.",eF="Can't reach AgentSky. Check your connection and try again.",G$={general:"Something went wrong. Try again.",agents:"Couldn't load agents. Try again.",models:"Couldn't load models. Try again.",start:"Couldn't start the chat. Try again.",save:"Couldn't save the change. Try again.",attach:"Couldn't attach the file. Try again.",secret:"Couldn't save the credential to Secrets. Try again.",reach:"This chat couldn't use this Mac. Try again."},tF=new Set(["NO_CREDITS","account_already_connected","acp_new_session_required","arena_sealed","browser_asleep","browser_retry_running","browser_unavailable","calendar_not_connected","connection_not_pending","continued_on_mac","creation_pending","creation_unconfirmed","creation_unsettled","delivery_unconfirmed","github_not_connected","github_reconnect_required","harness_unsupported","hook_rules_unavailable","insufficient_credits","invalid_credential","mcp_server_name_collision","mcp_token_rejected","mirror_empty","model_not_on_plan","name_taken","needs_reconnect","not_owner","not_shareable","oauth_server","owner_only","payment_setup_required","plugin_blocked","plugin_disabled","question_changed","question_closed","run_not_retryable","runs_on_mac","session_running","sign_in_cleanup_unavailable","sign_in_required","stop_forbidden","withdraw_forbidden","workspace_payer_required","workspace_wallet_empty"]),ZS={draft_not_saved:"The draft could not be saved. Try again.",forbidden:"You don't have access to do this.",rate_limited:"Too many tries. Wait a moment and try again.",session_archived:"This chat has ended.",session_busy:"This chat is busy. Wait for it to finish, then try again.",session_terminated:"This chat has ended."},nF=new Set(["TimeoutError","AbortError"]),aF=new Set(["ETIMEDOUT","ESOCKETTIMEDOUT","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","ABORT_ERR"]),sF=new Set(["ECONNREFUSED","ECONNRESET","ENOTFOUND","EAI_AGAIN","ENETUNREACH","EHOSTUNREACH","ENETDOWN","EPIPE","UND_ERR_SOCKET"]),oF=/\btime[ds]?[ -]?out\b|\btimeout\b|\baborted\b|\babort(?:ed)?Error\b/i,rF=/failed to fetch|fetch failed|network ?error|networkerror|network request failed|load failed|internet connection|\boffline\b|ECONNREFUSED|ECONNRESET|ENOTFOUND|EAI_AGAIN|ENETUNREACH|EHOSTUNREACH|socket hang up/i,iF=/[{}<>`=\\|\n]|:\/\/|\/Users\/|\/usr\/|\bE[A-Z]{3,}\b|\bHTTP\b|\b[1-5]\d\d\b|\b(?:undefined|null|NaN)\b|unexpected token|is not a function|is not defined|cannot read prop|\(reading\b|at position|\bJSON\b|\bstack\b|\bspawn\b|command failed|exit code|status code|\bsocket\b|\bSQL\b|\bconstraint\b|\b[a-z]+_[a-z_]+\b|\b[a-z]+[A-Z][A-Za-z]*\b|\w+Error\b|^Error\b|Error:|\bSIG[A-Z]{2,}\b|\bexited with\b|\bwith signal\b/,Y$=e=>e!==null&&typeof e=="object"?e:{};function JS(e){let t=new Set;for(let n=e;n!=null&&!t.has(n);n=Y$(n).cause){t.add(n);let{name:a,code:s,message:r}=typeof n=="object"?Y$(n):{name:void 0,code:void 0,message:n},i=typeof r=="string"?r:"";if(typeof a=="string"&&nF.has(a)||typeof s=="string"&&aF.has(s)||oF.test(i))return"timeout";if(typeof s=="string"&&sF.has(s)||rF.test(i))return"network";if(typeof n!="object")break}return"other"}function hm(e){if(typeof e!="string")return!1;let t=e.trim();return t.length>=8&&t.length<=300&&/^[A-Z]/.test(t)&&/[.?!…]$/.test(t)&&!iF.test(t)&&JS(t)==="other"}function j$(e){if(typeof e=="string")return hm(e)?e:null;let{name:t,code:n,message:a,worded:s}=Y$(e);return typeof n=="string"&&Object.hasOwn(ZS,n)?ZS[n]:typeof a!="string"||!a.trim()?null:typeof n=="string"&&tF.has(n)||s===!0||(t===void 0||t==="Error")&&(n===void 0||n==="failed")&&hm(a)?a:null}function yr(e,t="general"){let n=j$(e);if(n)return n;let a=JS(e);return a==="timeout"?Qz:a==="network"?eF:Object.hasOwn(G$,t)?G$[t]:t||G$.general}var ft=window.agentsky,qs=ft.bootstrap?.()??null,mm=class extends Error{constructor({code:t,message:n,playgroundId:a,sessionId:s}={}){let r={code:t,message:n},i=j$(r)??(hm(n)?n:null);super(i??yr(r),{cause:r}),this.name="BridgeError",this.code=t,i&&(this.worded=!0),typeof a=="string"&&a.length<=100&&(this.playgroundId=a),typeof s=="string"&&s.length<=100&&(this.sessionId=s)}},lF=e=>async t=>{let n=await e(t);if(!n.ok)throw new mm(n.error);return n.value},bt=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,lF(n)])),ve=ft.on,ia=(e,t)=>ve("data:refreshed",({family:n}={})=>{e.includes(n)&&t(n)}),V$=bt(ft.menu),ot=bt(ft.app),rn=bt(ft.auth),pd=bt(ft.catalog),hd=bt(ft.bots),ka=bt(ft.plans),Vo=bt(ft.chats),$t=bt(ft.threads),zn=bt(ft.agents),md=bt(ft.sky),br=bt(ft.market),gs=bt(ft.arena),cF=bt(ft.developer),Rn=bt(ft.composer),it=bt(ft.artifacts),Kt=bt(ft.sessions),ga=bt(ft.browser),Ul=bt(ft.agentBrowser),Io=bt(ft.share),ql=bt(ft.people),Fn=bt(ft.workspace),ri=bt(ft.vaults),Ko=ft.browserData?bt(ft.browserData):null,Ba=bt(ft.browserLogins),ja=bt(ft.liveBrowser),K$=bt(ft.usage),$s=bt(ft.listing),qe=bt(ft.library),fd=ft.paths.of,Ws=bt(ft.connectors),jn=bt(ft.permissions),vr=bt(ft.reminders),Wl=bt(ft.setup),Hi=bt(ft.billing),Hl=bt(ft.imports),Gi=bt(ft.policies),fm=bt(ft.fees),Yi=bt(ft.vendors),qc=bt(ft.apiKeys),un=bt(ft.settings),Sa=bt(ft.routines),Xo=bt(ft.rules),la=bt(ft.members),xt=bt(ft.transcript),Gl=bt(ft.repos),xa=ft.dictation,dt=bt(ft.local),It=bt(ft.thisMac),gm=bt(ft.devicePlugins??{}),gd=bt(ft.remoteControl??{}),Wt=bt(ft.meetingNotes),hn=bt(ft.computerHistory??{}),vt=bt(ft.plugins),Wc=bt(ft.meetingAutoJoin),wr=bt(ft.localSync),ro=bt(ft.wechat),ys=bt(ft.channels);function Hc(e){return[e.title,e.url].find(t=>t&&t!=="about:blank")??""}function $d({reach:e,children:t}){return l`<div class=${`browser-reach-controls${t?" browser-reach-context":""}`}>
82
82
  <${P} variant="ghost" size="sm" class="browser-reach-show" aria-label=${o("Show browser")} data-tooltip=${[o("Show browser"),Hc({url:e.url})].filter(Boolean).join(" \xB7 ")} onClick=${()=>It.showBrowser({id:e.id}).catch(()=>{})}>
83
83
  ${t??o("Show")}
84
84
  <${K} name="lucide-arrow-up-right" size=${12} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentsky/desktop-ui",
3
- "version": "0.4.233",
3
+ "version": "0.4.234",
4
4
  "description": "The AgentSky for Mac interface, prebuilt: the pages the app's windows show, served by the app's shell from this package's dist/.",
5
5
  "license": "Apache-2.0",
6
6
  "private": false,