@fased/fased 0.1.60 → 0.1.61
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/CHANGELOG.md +11 -0
- package/dist/brand.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/control-ui/assets/{app-CqF4Tc9n.js → app-BXA4gPvN.js} +3 -3
- package/dist/control-ui/assets/{index-DYggPSfy.js → index-D2QbJhVg.js} +3 -3
- package/dist/control-ui/index.html +1 -1
- package/dist/control-ui/version.json +1 -1
- package/dist/plugin-sdk/{audio-preflight-C2QXh5Ml.js → audio-preflight-Bv0hUOWL.js} +2 -2
- package/dist/plugin-sdk/channel-plugin-common.d.ts +2 -2
- package/dist/plugin-sdk/{chunk-items-3ZyiGiff.js → chunk-items-Bk--NU3E.js} +1 -1
- package/dist/plugin-sdk/command-status.js +2 -2
- package/dist/plugin-sdk/{config-schema-C9tx1Lyz.js → config-schema-CGW6J3Pv.js} +16 -16
- package/dist/plugin-sdk/device-pair.d.ts +1 -1
- package/dist/plugin-sdk/discord.d.ts +4 -4
- package/dist/plugin-sdk/index.d.ts +15 -15
- package/dist/plugin-sdk/index.js +2 -2
- package/dist/plugin-sdk/{monitor-XbunF2-r.js → monitor-B71iwAgC.js} +6 -6
- package/dist/plugin-sdk/{monitor-Xgx6vGcg.js → monitor-B9Cmt_Je.js} +4 -4
- package/dist/plugin-sdk/{openresponses-http-BRUr0JLE.js → openresponses-http-Du4GMmwo.js} +2 -2
- package/dist/plugin-sdk/{pairing-message-C403mq4K.d.ts → pairing-message-BMkkS038.d.ts} +1 -1
- package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +1 -1
- package/dist/plugin-sdk/{pw-ai-BzV0f18N.js → pw-ai-AFUqn-tQ.js} +1 -1
- package/dist/plugin-sdk/{runtime-dependency-Ch7J9a0d.js → runtime-dependency-DLDmB94f.js} +9 -9
- package/dist/plugin-sdk/sat-runtime.d.ts +2 -2
- package/dist/plugin-sdk/sat-runtime.js +2 -2
- package/dist/plugin-sdk/{slack-BzJfCWjq.js → slack-D_bbE6Yd.js} +4 -4
- package/dist/plugin-sdk/slack.d.ts +4 -4
- package/dist/plugin-sdk/{sticker-cache-Dex-XpRj.js → sticker-cache-Dqo9nRhi.js} +2 -2
- package/dist/plugin-sdk/{telegram-actions-DoFTGX4z.js → telegram-actions-Cnag7JTH.js} +3 -3
- package/dist/plugin-sdk/telegram.d.ts +4 -4
- package/dist/plugin-sdk/{tmp-fased-dir-Ouj58axY.d.ts → tmp-fased-dir-BdFQvrvw.d.ts} +1 -1
- package/dist/plugin-sdk/{types-B4hj6HgR.d.ts → types-BYDL6dQj.d.ts} +1 -1
- package/dist/plugin-sdk/{types-dWZFX1fk.d.ts → types-CLIvQaVg.d.ts} +2 -2
- package/dist/plugin-sdk/{web--wC3ZfVl.js → web-BInKQkc4.js} +2 -2
- package/dist/plugin-sdk/whatsapp.d.ts +9 -9
- package/dist/plugin-sdk/{zod-schema.providers-core-FaYR6KdD.d.ts → zod-schema.providers-core-CIzCjXH9.d.ts} +61 -61
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/fased-federation/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +6 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +2 -2
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +6 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +6 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/sat-mining/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +6 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ This changelog starts with the public Fased Agent release line. Required
|
|
|
4
4
|
third-party and copied-code notices are kept in [LICENSE](./LICENSE) and
|
|
5
5
|
[THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md).
|
|
6
6
|
|
|
7
|
+
## 0.1.61
|
|
8
|
+
|
|
9
|
+
- Harden local Docker deployments with loopback-only published ports, dropped
|
|
10
|
+
Linux capabilities, `no-new-privileges`, protected environment files, and
|
|
11
|
+
explicit rejection of container-engine socket mounts.
|
|
12
|
+
- Validate release images as a non-root user and block images containing
|
|
13
|
+
embedded secrets or fixable critical vulnerabilities.
|
|
14
|
+
- Publish immutable multi-architecture GHCR images only from version tags with
|
|
15
|
+
SBOM and provenance metadata; keep full Docker Gateway support local-only and
|
|
16
|
+
use the maintained non-Docker installer for VPS hosting.
|
|
17
|
+
|
|
7
18
|
## 0.1.36
|
|
8
19
|
|
|
9
20
|
- Ship verified hosted release artifacts for fast VPS installs and updates
|
package/dist/brand.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const FASED_BRAND_NAME = "Fased";
|
|
3
3
|
const FASED_AGENT_NAME = "Fased Agent";
|
|
4
4
|
const FASED_CONTROL_NAME = "Fased Control";
|
|
5
|
-
const FASED_PRODUCT_VERSION = "0.1.
|
|
5
|
+
const FASED_PRODUCT_VERSION = "0.1.61";
|
|
6
6
|
const FASED_DISPLAY_VERSION = `v${FASED_PRODUCT_VERSION}`;
|
|
7
7
|
function formatFasedDisplayLine() {
|
|
8
8
|
return `${FASED_AGENT_NAME} ${FASED_DISPLAY_VERSION}`;
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
60714e546d2da1a49c9fa0b5056cd78ea12d11c87762da4ecef155ffb7ac8735
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./config-CU5Zi8Dh.js","./icons-D3-vEvih.js","./open-external-url-DwSiwMPl.js","./providers-QMn4w2_f.js","./chat-model-ref-Djkv93yn.js","./federation-D10Q4eP_.js","./marketplace-order-evidence-DkR0ZRHa.js","./task-ledger-source-route-C-yTp0QU.js","./wallet-C2g294QT.js","./wallet-policy-C3ZS66Rl.js","./mining-BdhMn18r.js","./mining-commit-R-6nu87p.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,t}from"./index-DYggPSfy.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./icons-D3-vEvih.js";import{_ as f,b as p,c as m,d as h,f as g,g as _,h as v,i as y,l as b,m as x,n as S,p as C,r as ee,s as w,t as T,u as E}from"./open-external-url-DwSiwMPl.js";import{a as D,d as te,i as O,l as ne,o as k,u as re}from"./marketplace-order-evidence-DkR0ZRHa.js";import{C as A,D as ie,E as j,S as ae,T as oe,_ as se,a as ce,b as M,c as le,d as ue,f as de,g as fe,h as pe,i as me,l as N,m as he,n as ge,o as _e,p as ve,r as ye,s as be,t as xe,u as Se,v as Ce,w as we,x as Te,y as Ee}from"./mining-commit-R-6nu87p.js";import{B as De,F as Oe,I as ke,R as Ae,a as je,i as Me,n as Ne,o as Pe,r as Fe,t as Ie,z as Le}from"./chat-model-ref-Djkv93yn.js";import{n as Re,t as ze}from"./task-ledger-source-route-C-yTp0QU.js";import{d as Be,f as Ve,h as He,i as Ue,l as We,m as Ge,n as Ke,o as qe,p as Je,r as Ye,s as Xe,u as Ze}from"./wallet-policy-C3ZS66Rl.js";var Qe=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},$e={attribute:!0,type:String,converter:a,reflect:!1,hasChanged:r},et=(e=$e,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function tt(e){return(t,n)=>typeof n==`object`?et(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function P(e){return tt({...e,state:!0,attribute:!1})}function nt(e,t){return`${e}:${t??``}`}function rt(e){return`install:${e}`}function it(e,t){return`qr:${e}:${t??``}`}function at(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}var ot={whatsapp:`WhatsApp`,zalouser:`Zalo Personal`};function st(e,t){return e?.channelLabels?.[t]??ot[t]??t}function ct(e,t){let n=e?.channels?.[t];if(!at(n)||!at(n.install))return`fased plugins install ${t}`;let r=n.install.localPath;if(typeof r==`string`&&r.trim())return`fased plugins install ${r.trim()}`;let i=n.install.npmSpec;return`fased plugins install ${typeof i==`string`&&i.trim()?i.trim():t}`}function lt(e,t,n){let r=String(e);if(r.includes(`web login provider is not available`)){let e=t?st(n??null,t):`Channel`;return`${e} QR login is unavailable because the ${e} channel plugin is not loaded. Enable or install it, restart the gateway, then open Show QR again.`}return r}function ut(e,t,n){let r=e.channelQrLogin[t]??{message:null,qrDataUrl:null,connected:null},i={message:`message`in n?n.message??null:r.message,qrDataUrl:`qrDataUrl`in n?n.qrDataUrl??null:r.qrDataUrl,connected:`connected`in n?n.connected??null:r.connected};e.channelQrLogin={...e.channelQrLogin,[t]:i},t===`whatsapp`&&(e.whatsappLoginMessage=i.message,e.whatsappLoginQrDataUrl=i.qrDataUrl,e.whatsappLoginConnected=i.connected)}async function dt(e,t){if(!(!e.client||!e.connected)&&!e.channelsLoading){e.channelsLoading=!0,e.channelsError=null;try{e.channelsSnapshot=await e.client.request(`channels.status`,{probe:t,timeoutMs:8e3}),e.channelsLastSuccess=Date.now()}catch(t){e.channelsError=lt(t)}finally{e.channelsLoading=!1}}}async function ft(e,t,n,r){if(!e.client||!e.connected)return;let i=nt(n,r);if(!e.channelRuntimeBusy[i]){e.channelRuntimeBusy={...e.channelRuntimeBusy,[i]:!0},e.channelsError=null,e.channelsNotice=null;try{await e.client.request(t,{channel:n,...r?{accountId:r}:{}}),await dt(e,!1)}catch(t){e.channelsError=lt(t)}finally{let t={...e.channelRuntimeBusy};delete t[i],e.channelRuntimeBusy=t}}}async function pt(e,t,n){await ft(e,`channels.start`,t,n)}async function mt(e,t,n){await ft(e,`channels.stop`,t,n)}async function ht(e,t,n){if(!e.client||!e.connected)return;let r=nt(t,n);if(!e.channelRuntimeBusy[r]){e.channelRuntimeBusy={...e.channelRuntimeBusy,[r]:!0},e.channelsError=null,e.channelsNotice=null;try{let r=await e.client.request(`channels.logout`,{channel:t,...n?{accountId:n}:{}});await dt(e,!0);let i=r.accountId||n,a=`${t}${i?`/${i}`:``}`;e.channelsNotice=r.cleared||r.loggedOut?`Cleared ${a}.`:`No stored credentials were cleared for ${a}.`}catch(t){e.channelsError=lt(t)}finally{let t={...e.channelRuntimeBusy};delete t[r],e.channelRuntimeBusy=t}}}async function gt(e,t){if(!e.client||!e.connected)return;let n=rt(t);if(!e.channelRuntimeBusy[n]){e.channelRuntimeBusy={...e.channelRuntimeBusy,[n]:!0},e.channelsError=null,e.channelsNotice=null;try{let n=await e.client.request(`plugins.marketplace.install`,{id:t});await dt(e,!1),e.channelsNotice=n.requiresRestart?`${n.message} Restart the gateway to load this channel plugin. Until restart, this channel will stay in restart-required state.`:n.message}catch(n){e.channelsError=`${lt(n)}. Manual install: ${ct(e.channelsSnapshot,t)}. Restart the gateway after install.`}finally{let t={...e.channelRuntimeBusy};delete t[n],e.channelRuntimeBusy=t}}}async function _t(e,t,n=!1,r){let i=it(t,r);if(!(!e.client||!e.connected||e.channelRuntimeBusy[i])&&!(t===`whatsapp`&&e.whatsappBusy)){e.channelRuntimeBusy={...e.channelRuntimeBusy,[i]:!0},t===`whatsapp`&&(e.whatsappBusy=!0);try{let i=await e.client.request(`web.login.start`,{channel:t,force:n,timeoutMs:3e4,...r?{accountId:r}:{}});ut(e,t,{message:i.message??null,qrDataUrl:i.qrDataUrl??null,connected:null})}catch(n){ut(e,t,{message:lt(n,t,e.channelsSnapshot),qrDataUrl:null,connected:null})}finally{let n={...e.channelRuntimeBusy};delete n[i],e.channelRuntimeBusy=n,t===`whatsapp`&&(e.whatsappBusy=!1)}}}async function vt(e,t,n){let r=it(t,n);if(!(!e.client||!e.connected||e.channelRuntimeBusy[r])&&!(t===`whatsapp`&&e.whatsappBusy)){e.channelRuntimeBusy={...e.channelRuntimeBusy,[r]:!0},t===`whatsapp`&&(e.whatsappBusy=!0);try{let r=await e.client.request(`web.login.wait`,{channel:t,timeoutMs:12e4,...n?{accountId:n}:{}});ut(e,t,{message:r.message??null,connected:r.connected??null}),r.connected&&(ut(e,t,{qrDataUrl:null}),await dt(e,!0))}catch(n){ut(e,t,{message:lt(n,t,e.channelsSnapshot),connected:null})}finally{let n={...e.channelRuntimeBusy};delete n[r],e.channelRuntimeBusy=n,t===`whatsapp`&&(e.whatsappBusy=!1)}}}async function yt(e,t){await _t(e,`whatsapp`,t)}async function bt(e){await vt(e,`whatsapp`)}async function xt(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{await e.client.request(`channels.logout`,{channel:`whatsapp`}),e.whatsappLoginMessage=`Logged out.`,e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}catch(t){e.whatsappLoginMessage=lt(t,`whatsapp`,e.channelsSnapshot)}finally{e.whatsappBusy=!1}}}function St(e,t){let n=e.trim();if(n===``)return;let r=Number(n);return!Number.isFinite(r)||t&&!Number.isInteger(r)?e:r}function Ct(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:e}function wt(e,t){if(e==null)return e;if(t.allOf&&t.allOf.length>0){let n=e;for(let e of t.allOf)n=wt(n,e);return n}let n=p(t);if(t.anyOf||t.oneOf){let n=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(n.length===1)return wt(e,n[0]);if(typeof e==`string`)for(let t of n){let n=p(t);if(n===`number`||n===`integer`){let t=St(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}if(n===`boolean`){let t=Ct(e);if(typeof t==`boolean`)return t}}for(let t of n){let n=p(t);if(n===`object`&&typeof e==`object`&&!Array.isArray(e)||n===`array`&&Array.isArray(e))return wt(e,t)}return e}if(n===`number`||n===`integer`){if(typeof e==`string`){let t=St(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}return e}if(n===`boolean`){if(typeof e==`string`){let t=Ct(e);if(typeof t==`boolean`)return t}return e}if(n===`object`){if(typeof e!=`object`||Array.isArray(e))return e;let n=e,r=t.properties??{},i=t.additionalProperties&&typeof t.additionalProperties==`object`?t.additionalProperties:null,a={};for(let[e,t]of Object.entries(n)){let n=r[e]??i,o=n?wt(t,n):t;o!==void 0&&(a[e]=o)}return a}if(n===`array`){if(!Array.isArray(e))return e;if(Array.isArray(t.items)){let n=t.items;return e.map((e,t)=>{let r=t<n.length?n[t]:void 0;return r?wt(e,r):e})}let n=t.items;return n?e.map(e=>wt(e,n)).filter(e=>e!==void 0):e}return e}function Tt(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function Et(e){return`${JSON.stringify(e,null,2).trimEnd()}\n`}var Dt=new Set([`__proto__`,`prototype`,`constructor`]);function Ot(e){return typeof e==`string`&&Dt.has(e)}function kt(e,t,n){if(t.length===0||t.some(Ot))return null;let r=e;for(let e=0;e<t.length-1;e+=1){let i=t[e],a=t[e+1];if(typeof i==`number`){if(!Array.isArray(r))return null;if(r[i]==null){if(!n)return null;r[i]=typeof a==`number`?[]:{}}r=r[i];continue}if(typeof r!=`object`||!r)return null;let o=r;if(o[i]==null){if(!n)return null;o[i]=typeof a==`number`?[]:{}}r=o[i]}return{current:r,lastKey:t[t.length-1]}}function At(e,t,n){let r=kt(e,t,!0);if(r){if(typeof r.lastKey==`number`){Array.isArray(r.current)&&(r.current[r.lastKey]=n);return}typeof r.current==`object`&&r.current!=null&&(r.current[r.lastKey]=n)}}function jt(e,t){let n=kt(e,t,!1);if(n){if(typeof n.lastKey==`number`){Array.isArray(n.current)&&n.current.splice(n.lastKey,1);return}typeof n.current==`object`&&n.current!=null&&delete n.current[n.lastKey]}}function Mt(e,t){e.configAuthAction=t}function Nt(e){let t=String(e).trim();return t.startsWith(`Error: `)?t.slice(7):t}function Pt(e,t){let n=Nt(e);return n.includes(`models.auth.interactive.start`)&&n.includes(t)&&n.includes(`unexpected property`)}function Ft(e){return Pt(e,`replaceRunning`)}function It(e){return Pt(e,`browserLocal`)}function Lt(e){return{profileId:e.profileId,provider:e.provider??null,actionKind:e.actionKind,tone:e.tone,title:e.title,message:e.message,detail:e.detail,stepType:e.stepType??null,active:e.active??!1,hasUrl:e.hasUrl??!1,url:e.url??null,retryable:e.retryable??!1,prompt:e.prompt??null}}function Rt(e,t){let n=e.configAuthPromptResolver;e.configAuthPromptResolver=null,n?.({cancelled:!1,value:t})}function zt(e){let t=e.configAuthPromptResolver;e.configAuthPromptResolver=null,t?.({cancelled:!0})}function Bt(e){let t=e.configAuthPromptResolver;e.configAuthPromptResolver=null,e.configAuthActionRunId=(e.configAuthActionRunId??0)+1,Mt(e,null),t?.({cancelled:!0})}function Vt(e,t,n){let r=Kt(t),i=!!r,a=t.title?.trim()||`Continue sign-in`,o=t.message?.trim()||`Follow the next prompt to continue.`,s=i&&o.includes(r??``)?`Open the sign-in link below, then return here.`:o;switch(t.type){case`note`:case`action`:return Lt({profileId:e,provider:n,actionKind:`interactive`,tone:`info`,title:a,message:s,stepType:t.type,active:!0,hasUrl:i,url:r});case`confirm`:return Lt({profileId:e,provider:n,actionKind:`interactive`,tone:`info`,title:a,message:s,detail:`Confirm the browser prompt to keep the sign-in flow moving.`,stepType:t.type,active:!0,hasUrl:i,url:r});case`text`:return Lt({profileId:e,provider:n,actionKind:`interactive`,tone:`info`,title:a,message:s,stepType:t.type,active:!0,hasUrl:i,url:r});case`select`:case`multiselect`:return Lt({profileId:e,provider:n,actionKind:`interactive`,tone:`info`,title:a,message:s,detail:`Choose from the prompt dialog, then return here for the next step.`,stepType:t.type,active:!0,hasUrl:i,url:r});default:return Lt({profileId:e,provider:n,actionKind:`interactive`,tone:`info`,title:a,message:s,stepType:t.type,active:!0,hasUrl:i,url:r})}}async function Ht(e){if(!(!e.client||!e.connected)){e.configLoading=!0,e.lastError=null;try{let[t,n,r]=await Promise.allSettled([e.client.request(`config.get`,{}),e.client.request(`models.auth.status`,{}),e.client.request(`models.catalog.status`,{})]);if(t.status!==`fulfilled`)throw t.reason;en(e,t.value),e.configAuthStatus=n.status===`fulfilled`?n.value:null,e.configModelCatalogStatus=r.status===`fulfilled`?r.value:null}catch(t){e.configAuthStatus=null,e.configModelCatalogStatus=null,e.lastError=String(t)}finally{e.configLoading=!1}}}async function Ut(e,t){if(!e.client||!e.connected)return!1;e.configAuthActionBusyProfileId=t.profileId,Mt(e,Lt({profileId:t.profileId,provider:t.provider,actionKind:`store`,tone:`info`,title:`Saving credential for ${t.profileId}`,message:`Updating stored ${t.mode} credential…`,detail:`The provider-auth card will refresh after the credential is stored.`,active:!0})),e.lastError=null;try{let n=await e.client.request(`models.auth.store`,t);return Mt(e,Lt({profileId:n.profileId,provider:t.provider,actionKind:`store`,tone:`success`,title:`Credential updated for ${n.profileId}`,message:`Stored ${n.mode} credential successfully.`,detail:`Live runtime status will refresh below after the reload completes.`})),await Ht(e),!0}catch(n){return Mt(e,Lt({profileId:t.profileId,provider:t.provider,actionKind:`store`,tone:`danger`,title:`Failed to save credential for ${t.profileId}`,message:`The credential was not updated.`,detail:Nt(n),retryable:!0})),e.lastError=String(n),!1}finally{e.configAuthActionBusyProfileId=null}}async function Wt(e,t){if(!e.client||!e.connected)return!1;let n=t.provider.trim(),r=t.profileId?.trim()||`${n}:default`;e.configAuthActionBusyProfileId=r,Mt(e,Lt({profileId:r,provider:n,actionKind:`store`,tone:`info`,title:`Configuring ${n}`,message:`Saving the API key and syncing provider model config…`,detail:`This uses the same provider-specific setup path as CLI/onboarding, then refreshes Providers.`,active:!0})),e.lastError=null;try{let i=await e.client.request(`models.auth.configure`,{provider:n,...t.secret?{secret:t.secret}:{},...t.profileId?{profileId:t.profileId}:{},...t.baseUrl?{baseUrl:t.baseUrl}:{},...t.modelId?{modelId:t.modelId}:{},...t.compatibility?{compatibility:t.compatibility}:{},...t.customProviderId?{customProviderId:t.customProviderId}:{},...t.alias?{alias:t.alias}:{},...t.allowPrivateNetwork===void 0?{}:{allowPrivateNetwork:t.allowPrivateNetwork},...t.accountId?{accountId:t.accountId}:{},...t.gatewayId?{gatewayId:t.gatewayId}:{},...t.setDefaultModel===void 0?{}:{setDefaultModel:t.setDefaultModel}});return Mt(e,Lt({profileId:i.profileId??r,provider:i.provider,actionKind:`store`,tone:`success`,title:`${i.provider} configured`,message:i.defaultModel?`Provider auth is ready. Suggested model: ${i.defaultModel}.`:`Provider auth is ready. Choose a default model below.`,detail:i.detail??`Chat and Agents can use this provider after you choose or attach a model.`})),await Ht(e),!0}catch(t){return Mt(e,Lt({profileId:r,provider:n,actionKind:`store`,tone:`danger`,title:`Failed to configure ${n}`,message:`The provider-specific setup path did not complete.`,detail:Nt(t),retryable:!0})),e.lastError=String(t),!1}finally{e.configAuthActionBusyProfileId=null}}async function Gt(e,t){if(!e.client||!e.connected)return!1;e.configAuthActionBusyProfileId=t,Mt(e,Lt({profileId:t,actionKind:`clear`,tone:`info`,title:`Clearing stored credential for ${t}`,message:`Removing the currently stored credential…`,detail:`The provider-auth card will refresh after the credential is cleared.`,active:!0})),e.lastError=null;try{let n=await e.client.request(`models.auth.clear`,{profileId:t});return Mt(e,Lt({profileId:n.profileId,actionKind:`clear`,tone:n.cleared?`success`:`warn`,title:n.cleared?`Credential cleared for ${n.profileId}`:`No stored credential for ${n.profileId}`,message:n.cleared?`Stored credential removed successfully.`:`There was nothing stored to clear for this profile.`})),await Ht(e),!0}catch(n){return Mt(e,Lt({profileId:t,actionKind:`clear`,tone:`danger`,title:`Failed to clear credential for ${t}`,message:`The stored credential could not be removed.`,detail:Nt(n),retryable:!0})),e.lastError=String(n),!1}finally{e.configAuthActionBusyProfileId=null}}function Kt(e){return`${e.title??``}\n${e.message??``}`.match(/https?:\/\/\S+/u)?.[0]??null}function qt(e){let t=e.title?.trim(),n=e.message?.trim();return t&&n?`${t}\n\n${n}`:t||n||`Continue provider sign-in.`}function Jt(e,t){let n=t.trim();if(!n)return e.initialValue;let r=e.options??[],i=Number.parseInt(n,10);return Number.isFinite(i)&&i>=1&&i<=r.length?r[i-1]?.value:r.find(e=>e.label.toLowerCase()===n.toLowerCase()||String(e.value).toLowerCase()===n.toLowerCase())?.value}function Yt(e,t){let n=t.trim();if(!n)return Array.isArray(e.initialValue)?e.initialValue:[];let r=n.split(`,`).map(e=>e.trim()).filter(Boolean),i=[];for(let t of r){let n=Jt(e,t);if(n===void 0)return;i.push(n)}return i}async function Xt(e,t,n){if(t.type===`note`||t.type===`action`)return{cancelled:!1,value:null};if(n===`modal`)return await new Promise(n=>{e.configAuthPromptResolver=n;let r=e.configAuthAction;Mt(e,Lt({profileId:r?.profileId??null,provider:r?.provider,actionKind:r?.actionKind,tone:r?.tone??`info`,title:r?.title??t.title??`Continue sign-in`,message:r?.message??t.message??`Continue provider sign-in.`,detail:r?.detail,stepType:t.type,active:!0,hasUrl:r?.hasUrl,url:r?.url,retryable:r?.retryable,prompt:{stepId:t.id,type:t.type,message:qt(t),...t.placeholder?{placeholder:t.placeholder}:{},...t.initialValue===void 0?{}:{initialValue:t.initialValue},...t.options?{options:t.options}:{}}}))});if(typeof window>`u`)throw Error(`Interactive provider auth requires a browser environment.`);if(t.type===`confirm`)return{cancelled:!1,value:window.confirm(qt(t))};if(t.type===`text`){let e=window.prompt(qt(t),typeof t.initialValue==`string`?t.initialValue:``);return e===null?{cancelled:!0}:{cancelled:!1,value:e}}if(t.type===`select`){let e=(t.options??[]).map((e,t)=>`${t+1}. ${e.label}${e.hint?` — ${e.hint}`:``}`).join(`
|
|
2
|
+
import{n as e,t}from"./index-D2QbJhVg.js";import{a as n,c as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./icons-D3-vEvih.js";import{_ as f,b as p,c as m,d as h,f as g,g as _,h as v,i as y,l as b,m as x,n as S,p as C,r as ee,s as w,t as T,u as E}from"./open-external-url-DwSiwMPl.js";import{a as D,d as te,i as O,l as ne,o as k,u as re}from"./marketplace-order-evidence-DkR0ZRHa.js";import{C as A,D as ie,E as j,S as ae,T as oe,_ as se,a as ce,b as M,c as le,d as ue,f as de,g as fe,h as pe,i as me,l as N,m as he,n as ge,o as _e,p as ve,r as ye,s as be,t as xe,u as Se,v as Ce,w as we,x as Te,y as Ee}from"./mining-commit-R-6nu87p.js";import{B as De,F as Oe,I as ke,R as Ae,a as je,i as Me,n as Ne,o as Pe,r as Fe,t as Ie,z as Le}from"./chat-model-ref-Djkv93yn.js";import{n as Re,t as ze}from"./task-ledger-source-route-C-yTp0QU.js";import{d as Be,f as Ve,h as He,i as Ue,l as We,m as Ge,n as Ke,o as qe,p as Je,r as Ye,s as Xe,u as Ze}from"./wallet-policy-C3ZS66Rl.js";var Qe=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},$e={attribute:!0,type:String,converter:a,reflect:!1,hasChanged:r},et=(e=$e,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function tt(e){return(t,n)=>typeof n==`object`?et(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function P(e){return tt({...e,state:!0,attribute:!1})}function nt(e,t){return`${e}:${t??``}`}function rt(e){return`install:${e}`}function it(e,t){return`qr:${e}:${t??``}`}function at(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}var ot={whatsapp:`WhatsApp`,zalouser:`Zalo Personal`};function st(e,t){return e?.channelLabels?.[t]??ot[t]??t}function ct(e,t){let n=e?.channels?.[t];if(!at(n)||!at(n.install))return`fased plugins install ${t}`;let r=n.install.localPath;if(typeof r==`string`&&r.trim())return`fased plugins install ${r.trim()}`;let i=n.install.npmSpec;return`fased plugins install ${typeof i==`string`&&i.trim()?i.trim():t}`}function lt(e,t,n){let r=String(e);if(r.includes(`web login provider is not available`)){let e=t?st(n??null,t):`Channel`;return`${e} QR login is unavailable because the ${e} channel plugin is not loaded. Enable or install it, restart the gateway, then open Show QR again.`}return r}function ut(e,t,n){let r=e.channelQrLogin[t]??{message:null,qrDataUrl:null,connected:null},i={message:`message`in n?n.message??null:r.message,qrDataUrl:`qrDataUrl`in n?n.qrDataUrl??null:r.qrDataUrl,connected:`connected`in n?n.connected??null:r.connected};e.channelQrLogin={...e.channelQrLogin,[t]:i},t===`whatsapp`&&(e.whatsappLoginMessage=i.message,e.whatsappLoginQrDataUrl=i.qrDataUrl,e.whatsappLoginConnected=i.connected)}async function dt(e,t){if(!(!e.client||!e.connected)&&!e.channelsLoading){e.channelsLoading=!0,e.channelsError=null;try{e.channelsSnapshot=await e.client.request(`channels.status`,{probe:t,timeoutMs:8e3}),e.channelsLastSuccess=Date.now()}catch(t){e.channelsError=lt(t)}finally{e.channelsLoading=!1}}}async function ft(e,t,n,r){if(!e.client||!e.connected)return;let i=nt(n,r);if(!e.channelRuntimeBusy[i]){e.channelRuntimeBusy={...e.channelRuntimeBusy,[i]:!0},e.channelsError=null,e.channelsNotice=null;try{await e.client.request(t,{channel:n,...r?{accountId:r}:{}}),await dt(e,!1)}catch(t){e.channelsError=lt(t)}finally{let t={...e.channelRuntimeBusy};delete t[i],e.channelRuntimeBusy=t}}}async function pt(e,t,n){await ft(e,`channels.start`,t,n)}async function mt(e,t,n){await ft(e,`channels.stop`,t,n)}async function ht(e,t,n){if(!e.client||!e.connected)return;let r=nt(t,n);if(!e.channelRuntimeBusy[r]){e.channelRuntimeBusy={...e.channelRuntimeBusy,[r]:!0},e.channelsError=null,e.channelsNotice=null;try{let r=await e.client.request(`channels.logout`,{channel:t,...n?{accountId:n}:{}});await dt(e,!0);let i=r.accountId||n,a=`${t}${i?`/${i}`:``}`;e.channelsNotice=r.cleared||r.loggedOut?`Cleared ${a}.`:`No stored credentials were cleared for ${a}.`}catch(t){e.channelsError=lt(t)}finally{let t={...e.channelRuntimeBusy};delete t[r],e.channelRuntimeBusy=t}}}async function gt(e,t){if(!e.client||!e.connected)return;let n=rt(t);if(!e.channelRuntimeBusy[n]){e.channelRuntimeBusy={...e.channelRuntimeBusy,[n]:!0},e.channelsError=null,e.channelsNotice=null;try{let n=await e.client.request(`plugins.marketplace.install`,{id:t});await dt(e,!1),e.channelsNotice=n.requiresRestart?`${n.message} Restart the gateway to load this channel plugin. Until restart, this channel will stay in restart-required state.`:n.message}catch(n){e.channelsError=`${lt(n)}. Manual install: ${ct(e.channelsSnapshot,t)}. Restart the gateway after install.`}finally{let t={...e.channelRuntimeBusy};delete t[n],e.channelRuntimeBusy=t}}}async function _t(e,t,n=!1,r){let i=it(t,r);if(!(!e.client||!e.connected||e.channelRuntimeBusy[i])&&!(t===`whatsapp`&&e.whatsappBusy)){e.channelRuntimeBusy={...e.channelRuntimeBusy,[i]:!0},t===`whatsapp`&&(e.whatsappBusy=!0);try{let i=await e.client.request(`web.login.start`,{channel:t,force:n,timeoutMs:3e4,...r?{accountId:r}:{}});ut(e,t,{message:i.message??null,qrDataUrl:i.qrDataUrl??null,connected:null})}catch(n){ut(e,t,{message:lt(n,t,e.channelsSnapshot),qrDataUrl:null,connected:null})}finally{let n={...e.channelRuntimeBusy};delete n[i],e.channelRuntimeBusy=n,t===`whatsapp`&&(e.whatsappBusy=!1)}}}async function vt(e,t,n){let r=it(t,n);if(!(!e.client||!e.connected||e.channelRuntimeBusy[r])&&!(t===`whatsapp`&&e.whatsappBusy)){e.channelRuntimeBusy={...e.channelRuntimeBusy,[r]:!0},t===`whatsapp`&&(e.whatsappBusy=!0);try{let r=await e.client.request(`web.login.wait`,{channel:t,timeoutMs:12e4,...n?{accountId:n}:{}});ut(e,t,{message:r.message??null,connected:r.connected??null}),r.connected&&(ut(e,t,{qrDataUrl:null}),await dt(e,!0))}catch(n){ut(e,t,{message:lt(n,t,e.channelsSnapshot),connected:null})}finally{let n={...e.channelRuntimeBusy};delete n[r],e.channelRuntimeBusy=n,t===`whatsapp`&&(e.whatsappBusy=!1)}}}async function yt(e,t){await _t(e,`whatsapp`,t)}async function bt(e){await vt(e,`whatsapp`)}async function xt(e){if(!(!e.client||!e.connected||e.whatsappBusy)){e.whatsappBusy=!0;try{await e.client.request(`channels.logout`,{channel:`whatsapp`}),e.whatsappLoginMessage=`Logged out.`,e.whatsappLoginQrDataUrl=null,e.whatsappLoginConnected=null}catch(t){e.whatsappLoginMessage=lt(t,`whatsapp`,e.channelsSnapshot)}finally{e.whatsappBusy=!1}}}function St(e,t){let n=e.trim();if(n===``)return;let r=Number(n);return!Number.isFinite(r)||t&&!Number.isInteger(r)?e:r}function Ct(e){let t=e.trim();return t===`true`?!0:t===`false`?!1:e}function wt(e,t){if(e==null)return e;if(t.allOf&&t.allOf.length>0){let n=e;for(let e of t.allOf)n=wt(n,e);return n}let n=p(t);if(t.anyOf||t.oneOf){let n=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(n.length===1)return wt(e,n[0]);if(typeof e==`string`)for(let t of n){let n=p(t);if(n===`number`||n===`integer`){let t=St(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}if(n===`boolean`){let t=Ct(e);if(typeof t==`boolean`)return t}}for(let t of n){let n=p(t);if(n===`object`&&typeof e==`object`&&!Array.isArray(e)||n===`array`&&Array.isArray(e))return wt(e,t)}return e}if(n===`number`||n===`integer`){if(typeof e==`string`){let t=St(e,n===`integer`);if(t===void 0||typeof t==`number`)return t}return e}if(n===`boolean`){if(typeof e==`string`){let t=Ct(e);if(typeof t==`boolean`)return t}return e}if(n===`object`){if(typeof e!=`object`||Array.isArray(e))return e;let n=e,r=t.properties??{},i=t.additionalProperties&&typeof t.additionalProperties==`object`?t.additionalProperties:null,a={};for(let[e,t]of Object.entries(n)){let n=r[e]??i,o=n?wt(t,n):t;o!==void 0&&(a[e]=o)}return a}if(n===`array`){if(!Array.isArray(e))return e;if(Array.isArray(t.items)){let n=t.items;return e.map((e,t)=>{let r=t<n.length?n[t]:void 0;return r?wt(e,r):e})}let n=t.items;return n?e.map(e=>wt(e,n)).filter(e=>e!==void 0):e}return e}function Tt(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function Et(e){return`${JSON.stringify(e,null,2).trimEnd()}\n`}var Dt=new Set([`__proto__`,`prototype`,`constructor`]);function Ot(e){return typeof e==`string`&&Dt.has(e)}function kt(e,t,n){if(t.length===0||t.some(Ot))return null;let r=e;for(let e=0;e<t.length-1;e+=1){let i=t[e],a=t[e+1];if(typeof i==`number`){if(!Array.isArray(r))return null;if(r[i]==null){if(!n)return null;r[i]=typeof a==`number`?[]:{}}r=r[i];continue}if(typeof r!=`object`||!r)return null;let o=r;if(o[i]==null){if(!n)return null;o[i]=typeof a==`number`?[]:{}}r=o[i]}return{current:r,lastKey:t[t.length-1]}}function At(e,t,n){let r=kt(e,t,!0);if(r){if(typeof r.lastKey==`number`){Array.isArray(r.current)&&(r.current[r.lastKey]=n);return}typeof r.current==`object`&&r.current!=null&&(r.current[r.lastKey]=n)}}function jt(e,t){let n=kt(e,t,!1);if(n){if(typeof n.lastKey==`number`){Array.isArray(n.current)&&n.current.splice(n.lastKey,1);return}typeof n.current==`object`&&n.current!=null&&delete n.current[n.lastKey]}}function Mt(e,t){e.configAuthAction=t}function Nt(e){let t=String(e).trim();return t.startsWith(`Error: `)?t.slice(7):t}function Pt(e,t){let n=Nt(e);return n.includes(`models.auth.interactive.start`)&&n.includes(t)&&n.includes(`unexpected property`)}function Ft(e){return Pt(e,`replaceRunning`)}function It(e){return Pt(e,`browserLocal`)}function Lt(e){return{profileId:e.profileId,provider:e.provider??null,actionKind:e.actionKind,tone:e.tone,title:e.title,message:e.message,detail:e.detail,stepType:e.stepType??null,active:e.active??!1,hasUrl:e.hasUrl??!1,url:e.url??null,retryable:e.retryable??!1,prompt:e.prompt??null}}function Rt(e,t){let n=e.configAuthPromptResolver;e.configAuthPromptResolver=null,n?.({cancelled:!1,value:t})}function zt(e){let t=e.configAuthPromptResolver;e.configAuthPromptResolver=null,t?.({cancelled:!0})}function Bt(e){let t=e.configAuthPromptResolver;e.configAuthPromptResolver=null,e.configAuthActionRunId=(e.configAuthActionRunId??0)+1,Mt(e,null),t?.({cancelled:!0})}function Vt(e,t,n){let r=Kt(t),i=!!r,a=t.title?.trim()||`Continue sign-in`,o=t.message?.trim()||`Follow the next prompt to continue.`,s=i&&o.includes(r??``)?`Open the sign-in link below, then return here.`:o;switch(t.type){case`note`:case`action`:return Lt({profileId:e,provider:n,actionKind:`interactive`,tone:`info`,title:a,message:s,stepType:t.type,active:!0,hasUrl:i,url:r});case`confirm`:return Lt({profileId:e,provider:n,actionKind:`interactive`,tone:`info`,title:a,message:s,detail:`Confirm the browser prompt to keep the sign-in flow moving.`,stepType:t.type,active:!0,hasUrl:i,url:r});case`text`:return Lt({profileId:e,provider:n,actionKind:`interactive`,tone:`info`,title:a,message:s,stepType:t.type,active:!0,hasUrl:i,url:r});case`select`:case`multiselect`:return Lt({profileId:e,provider:n,actionKind:`interactive`,tone:`info`,title:a,message:s,detail:`Choose from the prompt dialog, then return here for the next step.`,stepType:t.type,active:!0,hasUrl:i,url:r});default:return Lt({profileId:e,provider:n,actionKind:`interactive`,tone:`info`,title:a,message:s,stepType:t.type,active:!0,hasUrl:i,url:r})}}async function Ht(e){if(!(!e.client||!e.connected)){e.configLoading=!0,e.lastError=null;try{let[t,n,r]=await Promise.allSettled([e.client.request(`config.get`,{}),e.client.request(`models.auth.status`,{}),e.client.request(`models.catalog.status`,{})]);if(t.status!==`fulfilled`)throw t.reason;en(e,t.value),e.configAuthStatus=n.status===`fulfilled`?n.value:null,e.configModelCatalogStatus=r.status===`fulfilled`?r.value:null}catch(t){e.configAuthStatus=null,e.configModelCatalogStatus=null,e.lastError=String(t)}finally{e.configLoading=!1}}}async function Ut(e,t){if(!e.client||!e.connected)return!1;e.configAuthActionBusyProfileId=t.profileId,Mt(e,Lt({profileId:t.profileId,provider:t.provider,actionKind:`store`,tone:`info`,title:`Saving credential for ${t.profileId}`,message:`Updating stored ${t.mode} credential…`,detail:`The provider-auth card will refresh after the credential is stored.`,active:!0})),e.lastError=null;try{let n=await e.client.request(`models.auth.store`,t);return Mt(e,Lt({profileId:n.profileId,provider:t.provider,actionKind:`store`,tone:`success`,title:`Credential updated for ${n.profileId}`,message:`Stored ${n.mode} credential successfully.`,detail:`Live runtime status will refresh below after the reload completes.`})),await Ht(e),!0}catch(n){return Mt(e,Lt({profileId:t.profileId,provider:t.provider,actionKind:`store`,tone:`danger`,title:`Failed to save credential for ${t.profileId}`,message:`The credential was not updated.`,detail:Nt(n),retryable:!0})),e.lastError=String(n),!1}finally{e.configAuthActionBusyProfileId=null}}async function Wt(e,t){if(!e.client||!e.connected)return!1;let n=t.provider.trim(),r=t.profileId?.trim()||`${n}:default`;e.configAuthActionBusyProfileId=r,Mt(e,Lt({profileId:r,provider:n,actionKind:`store`,tone:`info`,title:`Configuring ${n}`,message:`Saving the API key and syncing provider model config…`,detail:`This uses the same provider-specific setup path as CLI/onboarding, then refreshes Providers.`,active:!0})),e.lastError=null;try{let i=await e.client.request(`models.auth.configure`,{provider:n,...t.secret?{secret:t.secret}:{},...t.profileId?{profileId:t.profileId}:{},...t.baseUrl?{baseUrl:t.baseUrl}:{},...t.modelId?{modelId:t.modelId}:{},...t.compatibility?{compatibility:t.compatibility}:{},...t.customProviderId?{customProviderId:t.customProviderId}:{},...t.alias?{alias:t.alias}:{},...t.allowPrivateNetwork===void 0?{}:{allowPrivateNetwork:t.allowPrivateNetwork},...t.accountId?{accountId:t.accountId}:{},...t.gatewayId?{gatewayId:t.gatewayId}:{},...t.setDefaultModel===void 0?{}:{setDefaultModel:t.setDefaultModel}});return Mt(e,Lt({profileId:i.profileId??r,provider:i.provider,actionKind:`store`,tone:`success`,title:`${i.provider} configured`,message:i.defaultModel?`Provider auth is ready. Suggested model: ${i.defaultModel}.`:`Provider auth is ready. Choose a default model below.`,detail:i.detail??`Chat and Agents can use this provider after you choose or attach a model.`})),await Ht(e),!0}catch(t){return Mt(e,Lt({profileId:r,provider:n,actionKind:`store`,tone:`danger`,title:`Failed to configure ${n}`,message:`The provider-specific setup path did not complete.`,detail:Nt(t),retryable:!0})),e.lastError=String(t),!1}finally{e.configAuthActionBusyProfileId=null}}async function Gt(e,t){if(!e.client||!e.connected)return!1;e.configAuthActionBusyProfileId=t,Mt(e,Lt({profileId:t,actionKind:`clear`,tone:`info`,title:`Clearing stored credential for ${t}`,message:`Removing the currently stored credential…`,detail:`The provider-auth card will refresh after the credential is cleared.`,active:!0})),e.lastError=null;try{let n=await e.client.request(`models.auth.clear`,{profileId:t});return Mt(e,Lt({profileId:n.profileId,actionKind:`clear`,tone:n.cleared?`success`:`warn`,title:n.cleared?`Credential cleared for ${n.profileId}`:`No stored credential for ${n.profileId}`,message:n.cleared?`Stored credential removed successfully.`:`There was nothing stored to clear for this profile.`})),await Ht(e),!0}catch(n){return Mt(e,Lt({profileId:t,actionKind:`clear`,tone:`danger`,title:`Failed to clear credential for ${t}`,message:`The stored credential could not be removed.`,detail:Nt(n),retryable:!0})),e.lastError=String(n),!1}finally{e.configAuthActionBusyProfileId=null}}function Kt(e){return`${e.title??``}\n${e.message??``}`.match(/https?:\/\/\S+/u)?.[0]??null}function qt(e){let t=e.title?.trim(),n=e.message?.trim();return t&&n?`${t}\n\n${n}`:t||n||`Continue provider sign-in.`}function Jt(e,t){let n=t.trim();if(!n)return e.initialValue;let r=e.options??[],i=Number.parseInt(n,10);return Number.isFinite(i)&&i>=1&&i<=r.length?r[i-1]?.value:r.find(e=>e.label.toLowerCase()===n.toLowerCase()||String(e.value).toLowerCase()===n.toLowerCase())?.value}function Yt(e,t){let n=t.trim();if(!n)return Array.isArray(e.initialValue)?e.initialValue:[];let r=n.split(`,`).map(e=>e.trim()).filter(Boolean),i=[];for(let t of r){let n=Jt(e,t);if(n===void 0)return;i.push(n)}return i}async function Xt(e,t,n){if(t.type===`note`||t.type===`action`)return{cancelled:!1,value:null};if(n===`modal`)return await new Promise(n=>{e.configAuthPromptResolver=n;let r=e.configAuthAction;Mt(e,Lt({profileId:r?.profileId??null,provider:r?.provider,actionKind:r?.actionKind,tone:r?.tone??`info`,title:r?.title??t.title??`Continue sign-in`,message:r?.message??t.message??`Continue provider sign-in.`,detail:r?.detail,stepType:t.type,active:!0,hasUrl:r?.hasUrl,url:r?.url,retryable:r?.retryable,prompt:{stepId:t.id,type:t.type,message:qt(t),...t.placeholder?{placeholder:t.placeholder}:{},...t.initialValue===void 0?{}:{initialValue:t.initialValue},...t.options?{options:t.options}:{}}}))});if(typeof window>`u`)throw Error(`Interactive provider auth requires a browser environment.`);if(t.type===`confirm`)return{cancelled:!1,value:window.confirm(qt(t))};if(t.type===`text`){let e=window.prompt(qt(t),typeof t.initialValue==`string`?t.initialValue:``);return e===null?{cancelled:!0}:{cancelled:!1,value:e}}if(t.type===`select`){let e=(t.options??[]).map((e,t)=>`${t+1}. ${e.label}${e.hint?` — ${e.hint}`:``}`).join(`
|
|
3
3
|
`);for(;;){let n=window.prompt(`${qt(t)}\n\n${e}\n\nChoose a number or exact value.`,typeof t.initialValue==`string`?t.initialValue:``);if(n===null)return{cancelled:!0};let r=Jt(t,n);if(r!==void 0)return{cancelled:!1,value:r};window.alert(`Invalid selection. Enter a listed number or exact value.`)}}if(t.type===`multiselect`){let e=(t.options??[]).map((e,t)=>`${t+1}. ${e.label}${e.hint?` — ${e.hint}`:``}`).join(`
|
|
4
4
|
`);for(;;){let n=window.prompt(`${qt(t)}\n\n${e}\n\nChoose one or more values separated by commas.`,Array.isArray(t.initialValue)?t.initialValue.join(`, `):``);if(n===null)return{cancelled:!0};let r=Yt(t,n);if(r!==void 0)return{cancelled:!1,value:r};window.alert(`Invalid selection. Use comma-separated numbers or exact values.`)}}return{cancelled:!1,value:null}}async function Zt(e,t){if(!e.client||!e.connected)return!1;let n=(e.configAuthActionRunId??0)+1;e.configAuthActionRunId=n;let r=()=>e.configAuthActionRunId===n;if(e.configAuthPromptResolver){let t=e.configAuthPromptResolver;e.configAuthPromptResolver=null,t({cancelled:!0})}e.configAuthActionBusyProfileId=t.profileId;let i=null,a=null;Mt(e,Lt({profileId:t.profileId,provider:t.provider,actionKind:`interactive`,tone:`info`,title:`Starting sign-in for ${t.profileId}`,message:`Preparing the interactive provider flow…`,detail:`A browser prompt may open depending on the provider method.`,active:!0})),e.lastError=null;try{let n;try{n=await e.client.request(`models.auth.interactive.start`,{provider:t.provider,...t.methodId?{methodId:t.methodId}:{},replaceRunning:!0,...t.browserLocal===!0?{browserLocal:!0}:{}})}catch(r){if(It(r))try{n=await e.client.request(`models.auth.interactive.start`,{provider:t.provider,...t.methodId?{methodId:t.methodId}:{},replaceRunning:!0})}catch(r){if(!Ft(r))throw r;n=await e.client.request(`models.auth.interactive.start`,{provider:t.provider,...t.methodId?{methodId:t.methodId}:{}})}else if(Ft(r))try{n=await e.client.request(`models.auth.interactive.start`,{provider:t.provider,...t.methodId?{methodId:t.methodId}:{},...t.browserLocal===!0?{browserLocal:!0}:{}})}catch(r){if(!It(r))throw r;n=await e.client.request(`models.auth.interactive.start`,{provider:t.provider,...t.methodId?{methodId:t.methodId}:{}})}else throw r}if(a=n.sessionId,!a)throw Error(`interactive provider auth did not return a session id`);for(;!n.done;){let o=n.step;if(!o)throw Error(`interactive provider auth did not return a prompt step`);let s=Vt(t.profileId,o,t.provider);s.url&&(i=s.url),Mt(e,s.url||!i?s:{...s,hasUrl:!0,url:i});let c=await Xt(e,o,t.promptMode??`browserPrompt`);if(c.cancelled){let n=r()&&e.configAuthAction!==null;return await e.client.request(`wizard.cancel`,{sessionId:a}),a=null,n&&Mt(e,Lt({profileId:t.profileId,provider:t.provider,actionKind:`interactive`,tone:`warn`,title:`Cancelled sign-in for ${t.profileId}`,message:`Interactive sign-in was cancelled before completion.`,detail:`You can retry from this profile card or reopen the last sign-in page.`,url:i,hasUrl:!!i,retryable:!0})),!1}n={...await e.client.request(`wizard.next`,{sessionId:a,answer:{stepId:o.id,value:c.value}}),sessionId:a}}if(n.status!==`done`)throw Error(n.error??`interactive provider auth ended with status ${n.status}`);return a=null,Mt(e,r()?Lt({profileId:t.profileId,provider:t.provider,actionKind:`interactive`,tone:`success`,title:`Completed sign-in for ${t.profileId}`,message:`Interactive sign-in finished successfully.`,detail:`Live runtime status will refresh below after the reload completes.`,url:i,hasUrl:!!i}):e.configAuthAction),await Ht(e),!0}catch(n){if(a&&e.client&&e.connected)try{await e.client.request(`wizard.cancel`,{sessionId:a})}catch{}return r()&&Mt(e,Lt({profileId:t.profileId,provider:t.provider,actionKind:`interactive`,tone:`danger`,title:`Sign-in failed for ${t.profileId}`,message:`Interactive provider sign-in did not complete.`,detail:Nt(n),url:i,hasUrl:!!i,retryable:!0})),e.lastError=String(n),!1}finally{r()&&(e.configAuthActionBusyProfileId=null)}}async function Qt(e){if(!(!e.client||!e.connected)&&!e.configSchemaLoading){e.configSchemaLoading=!0;try{$t(e,await e.client.request(`config.schema`,{}))}catch(t){e.lastError=String(t)}finally{e.configSchemaLoading=!1}}}function $t(e,t){e.configSchema=t.schema??null,e.configUiHints=t.uiHints??{},e.configSchemaVersion=t.version??null}function en(e,t){e.configSnapshot=t;let n=typeof t.raw==`string`,r=n?String(t.raw):t.config&&typeof t.config==`object`?Et(t.config):e.configRaw??``;n||(e.configFormMode=`form`),!e.configFormDirty||e.configFormMode===`raw`?e.configRaw=r:e.configForm?e.configRaw=Et(e.configForm):e.configRaw=r,e.configValid=typeof t.valid==`boolean`?t.valid:null,e.configIssues=Array.isArray(t.issues)?t.issues:[],e.configFormDirty||(e.configForm=Tt(t.config??{}),e.configFormOriginal=Tt(t.config??{}),e.configRawOriginal=r)}function tn(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function nn(e){if(e.configFormMode!==`form`||!e.configForm)return e.configRaw;let t=tn(e.configSchema);return Et(t?wt(e.configForm,t):e.configForm)}function rn(e){let t=Nt(e).toLowerCase();return t.includes(`config changed since last load`)||t.includes(`config base hash required`)||t.includes(`config base hash unavailable`)}async function an(e){if(!e.client||!e.connected)return null;let t=await e.client.request(`config.get`,{});return en(e,t),typeof t.hash==`string`&&t.hash.trim()?t.hash:null}async function on(e){if(!(!e.client||!e.connected)){e.configSaving=!0,e.lastError=null;try{let t=nn(e),n=e.configSnapshot?.hash;if(!n){e.lastError=`Config hash missing; reload and retry.`;return}try{await e.client.request(`config.set`,{raw:t,baseHash:n})}catch(n){if(!rn(n))throw n;let r=await an(e);if(!r)throw n;await e.client.request(`config.set`,{raw:t,baseHash:r})}e.configFormDirty=!1,await Ht(e)}catch(t){e.lastError=String(t)}finally{e.configSaving=!1}}}async function sn(e){if(!(!e.client||!e.connected)){e.configApplying=!0,e.lastError=null;try{let t=nn(e),n=e.configSnapshot?.hash;if(!n){e.lastError=`Config hash missing; reload and retry.`;return}try{await e.client.request(`config.apply`,{raw:t,baseHash:n,sessionKey:e.applySessionKey})}catch(n){if(!rn(n))throw n;let r=await an(e);if(!r)throw n;await e.client.request(`config.apply`,{raw:t,baseHash:r,sessionKey:e.applySessionKey})}e.configFormDirty=!1,await Ht(e)}catch(t){e.lastError=String(t)}finally{e.configApplying=!1}}}function F(e,t,n){let r=Tt(e.configForm??e.configSnapshot?.config??{});At(r,t,n),e.configForm=r,e.configFormDirty=!0,e.configFormMode===`form`&&(e.configRaw=Et(r))}function cn(e,t){let n=Tt(e.configForm??e.configSnapshot?.config??{});jt(n,t),e.configForm=n,e.configFormDirty=!0,e.configFormMode===`form`&&(e.configRaw=Et(n))}function ln(e){let{values:t,original:n}=e;return t.name!==n.name||t.displayName!==n.displayName||t.about!==n.about||t.picture!==n.picture||t.banner!==n.banner||t.website!==n.website||t.nip05!==n.nip05||t.lud16!==n.lud16}function un(e){let{state:t,callbacks:r,accountId:i}=e,a=ln(t),o=(e,i,a={})=>{let{type:o=`text`,placeholder:s,maxLength:l,help:u}=a,d=t.values[e]??``,f=t.fieldErrors[e],p=`nostr-profile-${e}`;return o===`textarea`?n`
|
|
5
5
|
<div class="form-field" style="margin-bottom: 12px;">
|
|
@@ -140,7 +140,7 @@ import{n as e,t}from"./index-DYggPSfy.js";import{a as n,c as r,i,l as a,n as o,o
|
|
|
140
140
|
`);let r=M_(e);if(!r)return null;let i=[...r.matchAll(/<\s*think(?:ing)?\s*>([\s\S]*?)<\s*\/\s*think(?:ing)?\s*>/gi)].map(e=>(e[1]??``).trim()).filter(Boolean);return i.length>0?i.join(`
|
|
141
141
|
`):null}function j_(e){if(!e||typeof e!=`object`)return A_(e);let t=e;if(D_.has(t))return D_.get(t)??null;let n=A_(e);return D_.set(t,n),n}function M_(e){let t=e,n=t.content;if(typeof n==`string`)return n;if(Array.isArray(n)){let e=n.map(e=>{let t=e;return t.type===`text`&&typeof t.text==`string`?t.text:null}).filter(e=>typeof e==`string`);if(e.length>0)return e.join(`
|
|
142
142
|
`)}return typeof t.text==`string`?t.text:null}function N_(e){let t=e.trim();if(!t)return``;let n=t.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(e=>`_${e}_`);return n.length?[`_Reasoning:_`,...n].join(`
|
|
143
|
-
`):``}function P_(e){return typeof e==`string`?e:e instanceof Error&&typeof e.message==`string`?e.message:`unknown error`}function F_(e){let t=P_(e.message);switch(Oc(e)){case Ko.AUTH_TOKEN_MISMATCH:return`gateway token mismatch`;case Ko.AUTH_UNAUTHORIZED:return`gateway auth failed`;case Ko.AUTH_RATE_LIMITED:return`too many failed authentication attempts`;case Ko.PAIRING_REQUIRED:return`gateway pairing required`;case Ko.CONTROL_UI_DEVICE_IDENTITY_REQUIRED:return`device identity required (use HTTPS/localhost or allow insecure auth explicitly)`;case Ko.CONTROL_UI_ORIGIN_NOT_ALLOWED:return`origin not allowed (open the Control UI from the gateway host or allow it in gateway.controlUi.allowedOrigins)`;case Ko.AUTH_TOKEN_MISSING:return`gateway token missing`;default:break}let n=t.trim().toLowerCase();return n===`fetch failed`||n===`failed to fetch`||n===`connect failed`?`gateway connect failed`:t}function I_(e){return e&&typeof e==`object`?F_(e):P_(e)}var L_=/^\s*(?:NO_REPLY|ANNOUNCE_SKIP|REPLY_SKIP)\s*$/,R_=new WeakMap;function z_(e){let t=e,n=(R_.get(t)??0)+1;return R_.set(t,n),n}function B_(e,t){return R_.get(e)===t}function V_(e,t,n){return B_(e,t)&&e.sessionKey===n}function H_(e){return L_.test(e)}function U_(e){return H_(e)?e:e.replace(/(?:^|\r?\n)[\t ]*(?:NO_REPLY|ANNOUNCE_SKIP|REPLY_SKIP)[\t ]*$/i,``).trimEnd()}function W_(e){if(!e||typeof e!=`object`)return e;let t=e;if(typeof t.role==`string`&&t.role.toLowerCase()!==`assistant`)return e;let n=!1,r={...t};if(typeof r.text==`string`){let e=U_(r.text);n||=e!==r.text,r.text=e}if(typeof r.content==`string`){let e=U_(r.content);n||=e!==r.content,r.content=e}else if(Array.isArray(r.content)){let e=[...r.content];for(let t=e.length-1;t>=0;--t){let r=e[t];if(!r||typeof r!=`object`||typeof r.text!=`string`)continue;let i={...r},a=i.text,o=e.slice(0,t).some(e=>e&&typeof e==`object`&&typeof e.text==`string`&&!!(e.text??``).trim())&&H_(a)?``:U_(a);n||=o!==i.text,i.text=o,e[t]=i;break}r.content=e}return n?r:e}function G_(e){if(!e||typeof e!=`object`)return!1;let t=e;if((typeof t.role==`string`?t.role.toLowerCase():``)!==`assistant`)return!1;if(typeof t.text==`string`)return H_(t.text);let n=O_(e);return typeof n==`string`&&H_(n)}function K_(e){let t=e;t.toolStreamById instanceof Map&&Array.isArray(t.toolStreamOrder)&&Array.isArray(t.chatToolMessages)&&Array.isArray(t.chatStreamSegments)&&o_(t)}async function q_(e){if(!e.client||!e.connected)return;let t=e.sessionKey,n=z_(e);e.chatLoading=!0,e.lastError=null;try{let r=await e.client.request(`chat.history`,{sessionKey:t,limit:200});if(!V_(e,n,t))return;e.chatMessages=(Array.isArray(r.messages)?r.messages:[]).filter(e=>!G_(e)).map(e=>W_(e)),e.chatThinkingLevel=r.thinkingLevel??null,K_(e),e.chatStream=null,e.chatStreamStartedAt=null}catch(r){if(!V_(e,n,t))return;Fc(r)?(e.chatMessages=[],e.chatThinkingLevel=null,e.lastError=Ic(`existing chat history`)):e.lastError=String(r)}finally{B_(e,n)&&(e.chatLoading=!1)}}async function J_(e){if(!e.client||!e.connected||!e.sessionKey.trim()){e.chatSessionUsage=null,e.chatSessionUsageLoading=!1;return}let t=e.sessionKey;e.chatSessionUsageLoading=!0,e.chatSessionUsageError=null;try{let n=await e.client.request(`sessions.usage`,{key:t,limit:1});if(e.sessionKey!==t)return;let r=Array.isArray(n?.sessions)?n.sessions:[];e.chatSessionUsage=r.find(e=>e.key===t)??r[0]??null}catch(n){if(e.sessionKey!==t)return;e.chatSessionUsage=null,e.chatSessionUsageError=String(n)}finally{e.sessionKey===t&&(e.chatSessionUsageLoading=!1)}}function Y_(e){let t=/^data:([^;]+);base64,(.+)$/.exec(e);return t?{mimeType:t[1],content:t[2]}:null}function X_(e,t){if(!e||typeof e!=`object`)return null;let n=e,r=n.role;if(typeof r==`string`){if((t.roleCaseSensitive?r:r.toLowerCase())!==`assistant`)return null}else if(t.roleRequirement===`required`)return null;return t.requireContentArray?Array.isArray(n.content)?n:null:!(`content`in n)&&!(t.allowTextField&&`text`in n)?null:n}function Z_(e){return X_(e,{roleRequirement:`required`,roleCaseSensitive:!0,requireContentArray:!0})}function Q_(e){let t=X_(e,{roleRequirement:`optional`,allowTextField:!0});return t?W_(t):null}function $_(e){let t=e?.trim()||`chat error`;return/^Unhandled stop reason:\s*error$/i.test(t)?`Chat failed. Check gateway logs for details.`:`Chat failed: ${t}`}function ev(e,t){let n=$_(t),r=e.chatMessages.at(-1);(r?O_(r):null)!==n&&(e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:n}],timestamp:Date.now()}])}async function tv(e,t,n){if(!e.client||!e.connected)return null;let r=t.trim(),i=Array.isArray(n)?n:n?.attachments,a=Array.isArray(n)?`operator`:n?.deliveryMode??`operator`,o=i&&i.length>0;if(!r&&!o)return null;let s=Date.now(),c=[];if(r&&c.push({type:`text`,text:r}),o)for(let e of i)c.push({type:`image`,source:{type:`base64`,media_type:e.mimeType,data:e.dataUrl}});e.chatMessages=[...e.chatMessages,{role:`user`,content:c,timestamp:s}],e.chatSending=!0,e.lastError=null;let l=Ec();e.chatRunId=l,e.chatStream=``,e.chatStreamStartedAt=s;let u=o?i.map(e=>{let t=Y_(e.dataUrl);return t?{type:`image`,mimeType:t.mimeType,content:t.content}:null}).filter(e=>e!==null):void 0;try{return a===`channel`?await e.client.request(`agent`,{sessionKey:e.sessionKey,message:r,deliver:!0,idempotencyKey:l,thinking:e.chatThinkingLevel??void 0,attachments:u}):await e.client.request(`chat.send`,{sessionKey:e.sessionKey,message:r,deliver:!1,idempotencyKey:l,attachments:u}),l}catch(t){let n=I_(t);return e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,e.lastError=n,e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:`Error: `+n}],timestamp:Date.now()}],null}finally{e.chatSending=!1}}async function nv(e){if(!e.client||!e.connected)return!1;let t=e.chatRunId;try{return await e.client.request(`chat.abort`,t?{sessionKey:e.sessionKey,runId:t}:{sessionKey:e.sessionKey}),!0}catch(t){return e.lastError=I_(t),!1}}function rv(e,t){if(!t||t.sessionKey!==e.sessionKey)return null;if(t.runId&&e.chatRunId&&t.runId!==e.chatRunId){if(t.state===`final`){let n=Q_(t.message);return n&&!G_(n)?(e.chatMessages=[...e.chatMessages,n],null):`final`}return null}if(t.state===`delta`){let n=O_(t.message);typeof n==`string`&&!H_(n)&&(e.chatStream=n)}else if(t.state===`final`){let n=Q_(t.message);n&&!G_(n)?e.chatMessages=[...e.chatMessages,n]:e.chatStream?.trim()&&!H_(e.chatStream)&&(e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:e.chatStream}],timestamp:Date.now()}]),e.chatStream=null,e.chatRunId=null,e.chatStreamStartedAt=null}else if(t.state===`aborted`){let n=Z_(t.message);if(n&&!G_(n))e.chatMessages=[...e.chatMessages,n];else{let t=e.chatStream??``;t.trim()&&!H_(t)&&(e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:t}],timestamp:Date.now()}])}e.chatStream=null,e.chatRunId=null,e.chatStreamStartedAt=null}else t.state===`error`&&(e.chatStream=null,e.chatRunId=null,e.chatStreamStartedAt=null,e.lastError=$_(t.errorMessage),ev(e,t.errorMessage));return t.state}function iv(e){let t=e.message;if(!t||typeof t!=`object`||Array.isArray(t))return t;let n=t;return typeof n.id==`string`||typeof e.messageId!=`string`?t:{...n,id:e.messageId}}function av(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=t.id??t.messageId;return typeof n==`string`&&n.trim()?n.trim():null}function ov(e){if(!e||typeof e!=`object`||Array.isArray(e))return``;let t=e.role;return typeof t==`string`?t:``}function sv(e,t){if(!e||!t)return!1;let n=ov(e),r=ov(t);if(n&&r&&n!==r)return!1;let i=O_(e),a=O_(t);return typeof i==`string`&&i.length>0&&i===a}function cv(e){let t=(e??``).trim().toLowerCase();return id(t)?.rest??t}function lv(e,t){if(!t||cv(t.sessionKey)!==cv(e.sessionKey)||e.chatRunId)return!1;let n=iv(t);if(!n||G_(n))return!1;let r=av(n);return r&&e.chatMessages.some(e=>av(e)===r)||sv(e.chatMessages.at(-1),n)?!1:(e.chatMessages=[...e.chatMessages,n],!0)}var uv=new WeakMap;function dv(e){return e.chatSending||!!e.chatRunId}function fv(e){let t=e.trim();if(!t)return!1;let n=t.toLowerCase();return n===`/stop`?!0:n===`stop`||n===`esc`||n===`abort`||n===`wait`||n===`exit`}function pv(e){let t=e.trim();if(!t)return!1;let n=t.toLowerCase();return n===`/new`||n===`/reset`?!0:n.startsWith(`/new `)||n.startsWith(`/reset `)}function mv(e){let t=e.sessionsResult?.sessions?.find(t=>t.key===e.sessionKey),n=(t?.deliveryContext?.channel??t?.lastChannel??``).trim(),r=(t?.deliveryContext?.to??t?.lastTo??``).trim();return!!(n&&n!==`webchat`&&r)}async function hv(e){e.connected&&(e.chatMessage=``,await nv(e))}function gv(e,t,n,r){let i=t.trim(),a=!!(n&&n.length>0);!i&&!a||(e.chatQueue=[...e.chatQueue,{id:Ec(),text:i,createdAt:Date.now(),attachments:a?n?.map(e=>({...e})):void 0,refreshSessions:r}])}async function _v(e,t,n){o_(e);let r=e.settings?.chatDeliveryMode===`channel`&&mv(e)?`channel`:`operator`,i=await tv(e,t,{attachments:n?.attachments,deliveryMode:r}),a=!!i;return!a&&n?.previousDraft!=null&&(e.chatMessage=n.previousDraft),!a&&n?.previousAttachments&&(e.chatAttachments=n.previousAttachments),a&&Tg(e,e.sessionKey),a&&n?.restoreDraft&&n.previousDraft?.trim()&&(e.chatMessage=n.previousDraft),a&&n?.restoreAttachments&&n.previousAttachments?.length&&(e.chatAttachments=n.previousAttachments),Rn(e),a&&!e.chatRunId&&vv(e),a&&n?.refreshSessions&&i&&e.refreshSessionsAfterChat.add(i),a}async function vv(e){if(!e.connected||dv(e))return;let[t,...n]=e.chatQueue;t&&(e.chatQueue=n,await _v(e,t.text,{attachments:t.attachments,refreshSessions:t.refreshSessions})||(e.chatQueue=[t,...e.chatQueue]))}async function yv(e){let t=e.chatModelPatchPending;t&&await t.catch(()=>void 0)}function bv(e){let t=e.replace(/\s+/g,` `).trim();return!t||t.startsWith(`/`)?null:(t.length>64?`${t.slice(0,61).trimEnd()}...`:t)||null}function xv(e){let t=e?.trim()??``;return!t||/^(?:local\s+)?chat\s+\d+$/i.test(t)}function Sv(e){if(!Fn(e.sessionKey)?.rest.toLowerCase().startsWith(`webchat:direct:`)||Array.isArray(e.chatMessages)&&e.chatMessages.length>0)return!1;let t=e.sessionsResult?.sessions?.find(t=>t.key===e.sessionKey);return xv(t?.label?.trim()||t?.displayName?.trim()||``)}async function Cv(e,t){if(!(!t||!e.client||!e.connected))try{await e.client.request(`sessions.patch`,{key:e.sessionKey,label:t}),e.sessionsResult?.sessions&&(e.sessionsResult={...e.sessionsResult,sessions:e.sessionsResult.sessions.map(n=>n.key===e.sessionKey?{...n,label:t}:n)})}catch{}}function wv(e,t){e.chatQueue=e.chatQueue.filter(e=>e.id!==t)}function Tv(e,t){t&&(e.chatQueue=e.chatQueue.filter(e=>e.pendingRunId!==t))}async function Ev(e,t,n){if(!e.connected)return;let r=e.chatMessage,i=(t??e.chatMessage).trim(),a=e.chatAttachments??[],o=t==null?a:[],s=o.length>0;if(!i&&!s)return;if(fv(i)){await hv(e);return}if(await yv(e),!e.connected)return;let c=pv(i),l=Sv(e)?bv(i):null;if(t??(e.chatMessage=``,e.chatAttachments=[]),dv(e)){gv(e,i,o,c);return}await _v(e,i,{previousDraft:t==null?r:void 0,restoreDraft:!!(t&&n?.restoreDraft),attachments:s?o:void 0,previousAttachments:t==null?a:void 0,restoreAttachments:!!(t&&n?.restoreDraft),refreshSessions:c})&&l&&await Cv(e,l)}async function Dv(e,t){await Promise.all([q_(e),J_(e),U(e,{activeMinutes:120}),Nv(e)]),t?.scheduleScroll!==!1&&Rn(e)}var Ov=vv;function kv(e){let t=e,n=(uv.get(t)??0)+1;return uv.set(t,n),n}function Av(e,t,n){return uv.get(e)===t&&e.sessionKey===n}function jv(e){let t=Fn(e.sessionKey);return t?.agentId?t.agentId:(e.hello?.snapshot)?.sessionDefaults?.defaultAgentId?.trim()||`main`}function Mv(e,t){let n=g(e),r=encodeURIComponent(t);return n?`${n}/avatar/${r}?meta=1`:`/avatar/${r}?meta=1`}async function Nv(e){if(!e.connected){e.chatAvatarUrl=null;return}let t=e.sessionKey,n=kv(e),r=jv(e);if(!r){Av(e,n,t)&&(e.chatAvatarUrl=null);return}e.chatAvatarUrl=null;let i=Mv(e.basePath,r);try{let r=await fetch(i,{method:`GET`});if(!Av(e,n,t))return;if(!r.ok){e.chatAvatarUrl=null;return}let a=await r.json();if(!Av(e,n,t))return;e.chatAvatarUrl=(typeof a.avatarUrl==`string`?a.avatarUrl.trim():``)||null}catch{Av(e,n,t)&&(e.chatAvatarUrl=null)}}var Pv=`0.1.60`;function Fv(e,t=Pv){let n=e?.trim(),r=t.trim();return!!(n&&r&&r!==`dev`&&n!==r)}function Iv(e){if(!e||e.state!==`final`)return!1;if(!e.message||typeof e.message!=`object`)return!0;let t=e.message,n=typeof t.role==`string`?t.role.toLowerCase():``;return!!(n&&n!==`assistant`)}var Lv=50,Rv=200;function zv(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n)return n.length<=t?n:n.slice(0,t)}function Bv(e){let t=zv(e?.name,Lv)??`Assistant`,n=zv(e?.avatar??void 0,Rv)??null;return{agentId:typeof e?.agentId==`string`&&e.agentId.trim()?e.agentId.trim():null,name:t,avatar:n}}function Vv(){let e=window.__FASED_INJECTED_IDENTITY__;return Bv(e)}async function Hv(e,t){if(!e.client||!e.connected)return;let n=t?.sessionKey?.trim()||e.sessionKey.trim(),r=n?{sessionKey:n}:{};try{let t=await e.client.request(`agent.identity.get`,r);if(!t)return;let n=Bv(t);e.assistantName=n.name,e.assistantAvatar=n.avatar,e.assistantAgentId=n.agentId??null}catch{}}function Uv(e){return typeof e==`object`&&!!e}function Wv(e){if(!Uv(e))return null;let t=typeof e.id==`string`?e.id.trim():``,n=e.request;if(!t||!Uv(n))return null;let r=typeof n.command==`string`?n.command.trim():``;if(!r)return null;let i=typeof e.createdAtMs==`number`?e.createdAtMs:0,a=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;return!i||!a?null:{id:t,kind:`exec`,request:{command:r,cwd:typeof n.cwd==`string`?n.cwd:null,host:typeof n.host==`string`?n.host:null,security:typeof n.security==`string`?n.security:null,ask:typeof n.ask==`string`?n.ask:null,agentId:typeof n.agentId==`string`?n.agentId:null,resolvedPath:typeof n.resolvedPath==`string`?n.resolvedPath:null,sessionKey:typeof n.sessionKey==`string`?n.sessionKey:null},createdAtMs:i,expiresAtMs:a}}function Gv(e){if(!Uv(e))return null;let t=typeof e.id==`string`?e.id.trim():``;return t?{id:t,decision:typeof e.decision==`string`?e.decision:null,resolvedBy:typeof e.resolvedBy==`string`?e.resolvedBy:null,ts:typeof e.ts==`number`?e.ts:null}:null}function Kv(e){if(!Uv(e))return null;let t=typeof e.id==`string`?e.id.trim():``;if(!t)return null;let n=typeof e.createdAtMs==`number`?e.createdAtMs:0,r=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;if(!n||!r)return null;let i=Uv(e.request)?e.request:{},a=typeof i.title==`string`?i.title.trim():``;if(!a)return null;let o=typeof i.description==`string`?i.description:null,s=typeof i.severity==`string`?i.severity:null,c=typeof i.pluginId==`string`?i.pluginId:null;return{id:t,kind:`plugin`,request:{command:a,agentId:typeof i.agentId==`string`?i.agentId:null,sessionKey:typeof i.sessionKey==`string`?i.sessionKey:null},pluginTitle:a,pluginDescription:o,pluginSeverity:s,pluginId:c,createdAtMs:n,expiresAtMs:r}}function qv(e){let t=Date.now();return e.filter(e=>e.expiresAtMs>t)}function Jv(e,t){let n=qv(e).filter(e=>e.id!==t.id);return n.unshift(t),n}function Yv(e,t){return qv(e).filter(e=>e.id!==t)}function Xv(e){return/^(?:typeerror:\s*)?(?:fetch failed|failed to fetch)$/i.test(e.trim())}function Zv(e){if(e&&typeof e==`object`){let t=e.ts;if(typeof t==`number`&&Number.isFinite(t))return t}return Date.now()}function Qv(e){e.restartReconnectTimer!=null&&(globalThis.clearTimeout(e.restartReconnectTimer),e.restartReconnectTimer=null)}function $v(e,t,n=e.client){Qv(e),e.restartReconnectTimer=globalThis.setTimeout(()=>{e.restartReconnectTimer=null,!e.connected&&(!n||e.client!==n||ry(e))},Math.max(250,Math.floor(t)))}function ey(e){let t=e.uiVersion?.trim();if(!t)return;let n=e.pageUrl??(typeof window>`u`?void 0:window.location.href);if(n)try{let r=new URL(n),i=new URL(e.gatewayUrl,r);return!new Set([`ws:`,`wss:`,`http:`,`https:`]).has(i.protocol)||i.host!==r.host?void 0:t}catch{return}}function ty(e,t){let n=(e??``).trim(),r=t.mainSessionKey?.trim();if(!r)return n;if(!n)return r;let i=t.mainKey?.trim()||`main`,a=t.defaultAgentId?.trim();return n===`main`||n===i||a&&(n===`agent:${a}:main`||n===`agent:${a}:${i}`)?r:n}function ny(e,t){if(!t?.mainSessionKey)return;let n=ty(e.sessionKey,t),r=ty(e.settings.sessionKey,t),i=ty(e.settings.lastActiveSessionKey,t),a=n||r||e.sessionKey,o={...e.settings,sessionKey:r||a,lastActiveSessionKey:i||a},s=o.sessionKey!==e.settings.sessionKey||o.lastActiveSessionKey!==e.settings.lastActiveSessionKey;a!==e.sessionKey&&(e.sessionKey=a),s&&wg(e,o)}function ry(e,t){let n=e,r=t?.reason??`initial`;n.pendingShutdownMessage=null,n.resumeChatQueueAfterReconnect=!1,Qv(n),e.lastError=null,e.lastErrorCode=null,e.hello=null,e.connected=!1,e.sessionsSubscriptionActive=!1,e.sessionMessagesSubscriptionActive=!1,e.subscribedSessionMessageKey=null,r===`seq-gap`?(e.execApprovalQueue=qv(e.execApprovalQueue),Tv(e,e.chatRunId??void 0),n.resumeChatQueueAfterReconnect=!0):e.execApprovalQueue=qv(e.execApprovalQueue),e.execApprovalError=null;let i=e.client,a=ey({gatewayUrl:e.settings.gatewayUrl,uiVersion:Pv}),o=new Pc({url:e.settings.gatewayUrl,token:e.settings.token.trim()?e.settings.token:void 0,password:e.password.trim()?e.password:void 0,clientName:`fased-control-ui`,clientVersion:a,mode:Zo.UI,instanceId:e.clientInstanceId,onHello:t=>{if(e.client===o){if(Qv(n),n.pendingShutdownMessage=null,e.connected=!0,e.lastError=null,e.lastErrorCode=null,e.hello=t,e.serverVersion=t.server?.version?.trim()||null,e.serverVersion&&Fv(e.serverVersion)){e.uiRuntimeError=`Dashboard build ${Pv} does not match gateway ${e.serverVersion}. Run fased update, restart the gateway, and reload this page.`,o.stop();return}cy(e,t),e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,o_(e),n.resumeChatQueueAfterReconnect&&(n.resumeChatQueueAfterReconnect=!1,Ov(e)),fm(e),pm(e),Hv(e),ld(e),Eu(e,{quiet:!0}),op(e,{quiet:!0}),Ag(e)}},onClose:({code:t,reason:r,error:i})=>{if(e.client===o){if(e.connected=!1,e.sessionsSubscriptionActive=!1,e.sessionMessagesSubscriptionActive=!1,e.subscribedSessionMessageKey=null,e.lastErrorCode=Oc(i)??(i?.details&&typeof i.details==`object`&&typeof i.details.code==`string`?i.details.code??null:null)??(typeof i?.code==`string`?i.code:null),t!==1012){if(i?.message){e.lastError=e.lastErrorCode&&Xv(i.message)?I_({message:i.message,details:i.details,code:i.code}):i.message;return}e.lastError=n.pendingShutdownMessage??`disconnected (${t}): ${r||`no reason`}`}else e.lastError=n.pendingShutdownMessage??null,e.lastErrorCode=null;n.pendingShutdownMessage&&$v(n,1750,o)}},onEvent:t=>{e.client===o&&iy(e,t)},onGap:({expected:t,received:n})=>{e.client===o&&(e.lastError=`event gap detected (expected seq ${t}, got ${n}); reconnecting`,e.lastErrorCode=null,ry(e,{reason:`seq-gap`}))}});e.client=o,i?.stop(),o.start()}function iy(e,t){try{sy(e,t)}catch(e){console.error(`[gateway] handleGatewayEvent error:`,t.event,e)}}function ay(e,t,n){if(n!==`final`&&n!==`error`&&n!==`aborted`)return!1;let r=e.toolStreamOrder.length>0;o_(e),Tv(e,t?.runId),Ov(e);let i=t?.runId;return i&&e.refreshSessionsAfterChat.has(i)&&(e.refreshSessionsAfterChat.delete(i),n===`final`&&U(e,{activeMinutes:120})),r&&n===`final`?(q_(e),!0):!1}function oy(e,t){t?.sessionKey&&Tg(e,t.sessionKey);let n=rv(e,t),r=ay(e,t,n);n===`final`&&!r&&Iv(t)&&q_(e)}function sy(e,t){if(e.eventLogBuffer=[{ts:Date.now(),event:t.event,payload:t.payload},...e.eventLogBuffer].slice(0,250),e.tab===`debug`&&(e.eventLog=e.eventLogBuffer),t.event===`agent`){if(e.onboarding)return;g_(e,t.payload);return}if(t.event===`chat`){oy(e,t.payload);return}if(t.event===`presence`){let n=t.payload;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence,e.presenceError=null,e.presenceStatus=null);return}if(t.event===`update.available`){let n=t.payload?.updateAvailable;n?.currentVersion&&n.latestVersion&&(e.updateAvailable={currentVersion:n.currentVersion,latestVersion:n.latestVersion,channel:n.channel});return}if(t.event===`mining.changed`){let n=t.payload,r=!!n?.method;!(r&&su(e,n))&&r&&e.tab===`mining`&&tu(e,{quiet:!0});return}if(t.event===`cron`&&e.tab===`cron`){Gg(e);return}if(t.event===`sessions.changed`){e.sessionsLastEventAt=Zv(t.payload),_m(e,t.payload)||U(e);return}if(t.event===`session.message`){e.sessionMessageLastEventAt=Zv(t.payload),lv(e,t.payload)&&Rn(e);return}if(t.event===`device.pair.requested`||t.event===`device.pair.resolved`){op(e,{quiet:!0});return}if(t.event===`shutdown`){let n=t.payload;if(n?.reason){let t=`Restarting: ${n.reason}`;e.pendingShutdownMessage=t,e.lastError=t,e.lastErrorCode=null,$v(e,typeof n.restartExpectedMs==`number`&&Number.isFinite(n.restartExpectedMs)?Math.max(250,n.restartExpectedMs+250):1750)}return}if(t.event===`exec.approval.requested`){let n=Wv(t.payload);if(n){e.execApprovalQueue=Jv(e.execApprovalQueue,n),e.execApprovalError=null;let t=Math.max(0,n.expiresAtMs-Date.now()+500);globalThis.setTimeout(()=>{e.execApprovalQueue=Yv(e.execApprovalQueue,n.id)},t)}return}if(t.event===`exec.approval.resolved`){let n=Gv(t.payload);n&&(e.execApprovalQueue=Yv(e.execApprovalQueue,n.id));return}if(t.event===`plugin.approval.requested`){let n=Kv(t.payload);if(n){e.execApprovalQueue=Jv(e.execApprovalQueue,n),e.execApprovalError=null;let t=Math.max(0,n.expiresAtMs-Date.now()+500);globalThis.setTimeout(()=>{e.execApprovalQueue=Yv(e.execApprovalQueue,n.id)},t)}return}if(t.event===`plugin.approval.resolved`){let n=Gv(t.payload);n&&(e.execApprovalQueue=Yv(e.execApprovalQueue,n.id))}}function cy(e,t){let n=t.snapshot;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence),n?.health&&(e.debugHealth=n.health),n?.sessionDefaults&&ny(e,n.sessionDefaults),e.federationManagedMode=n?.gatewayMode===`managed`}var ly=`/__fased/control-ui-config.json`;async function uy(e){if(typeof window>`u`||typeof fetch!=`function`)return;let t=g(e.basePath??``),n=t?`${t}${ly}`:ly;try{let t=await fetch(n,{method:`GET`,headers:{Accept:`application/json`},credentials:`same-origin`});if(!t.ok)return;let r=await t.json();e.serverVersion=r.serverVersion?.trim()||null,e.serverVersion&&Fv(e.serverVersion)&&(e.uiRuntimeError=`Dashboard build ${Pv} does not match gateway ${e.serverVersion}. Run fased update, restart the gateway, and reload this page.`);let i=Bv({name:r.assistantName,avatar:r.assistantAvatar??null});e.assistantName=i.name,e.assistantAvatar=i.avatar}catch{}}function dy(e){e.basePath=Mg(),e.authBootstrapPending=!0;let t=uy(e);Lg(e,!0),Ng(e),Fg(e),window.addEventListener(`popstate`,e.popStateHandler),Promise.all([t,Eg(e)]).then(()=>{e.authBootstrapPending=!1,e.settings.token.trim()&&!e.client&&ry(e)},()=>{e.authBootstrapPending=!1}),Nu(e),e.tab===`logs`&&Fu(e),e.tab===`debug`&&Lu(e),(e.tab===`federation`||e.tab===`marketplace`)&&zu(e),e.tab===`mining`&&Vu(e)}function fy(e){Wn(e)}function py(e){window.removeEventListener(`popstate`,e.popStateHandler),Pu(e),Iu(e),Ru(e),Bu(e),Hu(e),e.client?.stop(),e.client=null,e.connected=!1,Ig(e),e.topbarObserver?.disconnect(),e.topbarObserver=null}function my(e,t){if(!(e.tab===`chat`&&e.chatManualRefreshInFlight)){if(e.tab===`chat`&&(t.has(`chatMessages`)||t.has(`chatToolMessages`)||t.has(`chatStream`)||t.has(`chatLoading`)||t.has(`tab`))){let n=t.has(`tab`),r=t.has(`chatLoading`)&&t.get(`chatLoading`)===!0&&!e.chatLoading;Rn(e,n||r||!e.chatHasAutoScrolled)}e.tab===`logs`&&(t.has(`logsEntries`)||t.has(`logsAutoFollow`)||t.has(`tab`))&&e.logsAutoFollow&&e.logsAtBottom&&zn(e,t.has(`tab`)||t.has(`logsAutoFollow`))}}var hy=`Fased`,gy=`Fased Agent`;function _y(e){if(Array.isArray(e))return e.map(e=>typeof e==`string`?e.trim():``).filter(Boolean).slice(0,1)}function vy(e,t){let n=t.trim();if(!n)return null;let r=e?.agents?.list,i=Array.isArray(r)?r.map(e=>e&&typeof e==`object`?{...e}:{}):r&&typeof r==`object`?Object.entries(r).map(([e,t])=>({...t&&typeof t==`object`?t:{},id:t&&typeof t==`object`&&`id`in t&&typeof t.id==`string`&&t.id.trim()?t.id:e})):[],a=i.findIndex(e=>e.id===n);return a>=0?{changed:!1,index:a,list:i}:(i.push({id:n}),{changed:!0,index:i.length-1,list:i})}var yy=`Assistant`;function by(e){return e.split(/[-_]+/).filter(Boolean).map(e=>`${e.slice(0,1).toUpperCase()}${e.slice(1)}`).join(` `)}function xy(e){return(e??``).trim().toLowerCase()===`main`}function Sy(e){let t=e.id.trim(),n=t.toLowerCase(),r=e.identity?.name?.trim()||e.name?.trim()||``;return r&&r.toLowerCase()!==n?r:xy(t)?yy:by(t)||t}function Cy(e){let t=e.id.trim(),n=Sy(e);return xy(t)?n:n&&n!==t?`${n} (${t})`:t}var wy=new Set([`agent`,`channel`,`chat`,`provider`,`model`,`source`,`tool`,`label`,`key`,`session`,`id`,`has`,`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`]),Ty=e=>e.trim().toLowerCase(),Ey=e=>{let t=e.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`).replace(/\?/g,`.`);return RegExp(`^${t}$`,`i`)},Dy=e=>{let t=e.trim().toLowerCase();if(!t)return null;t.startsWith(`$`)&&(t=t.slice(1));let n=1;t.endsWith(`k`)?(n=1e3,t=t.slice(0,-1)):t.endsWith(`m`)&&(n=1e6,t=t.slice(0,-1));let r=Number(t);return Number.isFinite(r)?r*n:null},Oy=e=>(e.match(/"[^"]+"|\S+/g)??[]).map(e=>{let t=e.replace(/^"|"$/g,``),n=t.indexOf(`:`);return n>0?{key:t.slice(0,n),value:t.slice(n+1),raw:t}:{value:t,raw:t}}),ky=e=>[e.label,e.key,e.sessionId].filter(e=>!!e).map(e=>e.toLowerCase()),Ay=e=>{let t=new Set;e.modelProvider&&t.add(e.modelProvider.toLowerCase()),e.providerOverride&&t.add(e.providerOverride.toLowerCase()),e.origin?.provider&&t.add(e.origin.provider.toLowerCase());for(let n of e.usage?.modelUsage??[])n.provider&&t.add(n.provider.toLowerCase());return Array.from(t)},jy=e=>{let t=new Set;e.model&&t.add(e.model.toLowerCase());for(let n of e.usage?.modelUsage??[])n.model&&t.add(n.model.toLowerCase());return Array.from(t)},My=e=>(e.usage?.toolUsage?.tools??[]).map(e=>e.name.toLowerCase()),Ny=(e,t)=>{let n=Ty(t.value??``);if(!n)return!0;if(!t.key)return ky(e).some(e=>e.includes(n));switch(Ty(t.key)){case`agent`:return e.agentId?.toLowerCase().includes(n)??!1;case`channel`:return e.channel?.toLowerCase().includes(n)??!1;case`chat`:return e.chatType?.toLowerCase().includes(n)??!1;case`provider`:return Ay(e).some(e=>e.includes(n));case`model`:return jy(e).some(e=>e.includes(n));case`source`:return e.source?.toLowerCase().includes(n)??!1;case`tool`:return My(e).some(e=>e.includes(n));case`label`:return e.label?.toLowerCase().includes(n)??!1;case`key`:case`session`:case`id`:if(n.includes(`*`)||n.includes(`?`)){let t=Ey(n);return t.test(e.key)||(e.sessionId?t.test(e.sessionId):!1)}return e.key.toLowerCase().includes(n)||(e.sessionId?.toLowerCase().includes(n)??!1);case`has`:switch(n){case`tools`:return(e.usage?.toolUsage?.totalCalls??0)>0;case`errors`:return(e.usage?.messageCounts?.errors??0)>0;case`context`:return!!e.contextWeight;case`usage`:return!!e.usage;case`model`:return jy(e).length>0;case`provider`:return Ay(e).length>0;default:return!0}case`mintokens`:{let t=Dy(n);return t===null?!0:(e.usage?.totalTokens??0)>=t}case`maxtokens`:{let t=Dy(n);return t===null?!0:(e.usage?.totalTokens??0)<=t}case`mincost`:{let t=Dy(n);return t===null?!0:(e.usage?.totalCost??0)>=t}case`maxcost`:{let t=Dy(n);return t===null?!0:(e.usage?.totalCost??0)<=t}case`minmessages`:{let t=Dy(n);return t===null?!0:(e.usage?.messageCounts?.total??0)>=t}case`maxmessages`:{let t=Dy(n);return t===null?!0:(e.usage?.messageCounts?.total??0)<=t}default:return!0}},Py=(e,t)=>{let n=Oy(t);if(n.length===0)return{sessions:e,warnings:[]};let r=[];for(let e of n){if(!e.key)continue;let t=Ty(e.key);if(!wy.has(t)){r.push(`Unknown filter: ${e.key}`);continue}if(e.value===``&&r.push(`Missing value for ${e.key}`),t===`has`){let t=new Set([`tools`,`errors`,`context`,`usage`,`model`,`provider`]);e.value&&!t.has(Ty(e.value))&&r.push(`Unknown has:${e.value}`)}[`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`].includes(t)&&e.value&&Dy(e.value)===null&&r.push(`Invalid number for ${e.key}`)}return{sessions:e.filter(e=>n.every(t=>Ny(e,t))),warnings:r}};function Fy(e){let t=e.split(`
|
|
143
|
+
`):``}function P_(e){return typeof e==`string`?e:e instanceof Error&&typeof e.message==`string`?e.message:`unknown error`}function F_(e){let t=P_(e.message);switch(Oc(e)){case Ko.AUTH_TOKEN_MISMATCH:return`gateway token mismatch`;case Ko.AUTH_UNAUTHORIZED:return`gateway auth failed`;case Ko.AUTH_RATE_LIMITED:return`too many failed authentication attempts`;case Ko.PAIRING_REQUIRED:return`gateway pairing required`;case Ko.CONTROL_UI_DEVICE_IDENTITY_REQUIRED:return`device identity required (use HTTPS/localhost or allow insecure auth explicitly)`;case Ko.CONTROL_UI_ORIGIN_NOT_ALLOWED:return`origin not allowed (open the Control UI from the gateway host or allow it in gateway.controlUi.allowedOrigins)`;case Ko.AUTH_TOKEN_MISSING:return`gateway token missing`;default:break}let n=t.trim().toLowerCase();return n===`fetch failed`||n===`failed to fetch`||n===`connect failed`?`gateway connect failed`:t}function I_(e){return e&&typeof e==`object`?F_(e):P_(e)}var L_=/^\s*(?:NO_REPLY|ANNOUNCE_SKIP|REPLY_SKIP)\s*$/,R_=new WeakMap;function z_(e){let t=e,n=(R_.get(t)??0)+1;return R_.set(t,n),n}function B_(e,t){return R_.get(e)===t}function V_(e,t,n){return B_(e,t)&&e.sessionKey===n}function H_(e){return L_.test(e)}function U_(e){return H_(e)?e:e.replace(/(?:^|\r?\n)[\t ]*(?:NO_REPLY|ANNOUNCE_SKIP|REPLY_SKIP)[\t ]*$/i,``).trimEnd()}function W_(e){if(!e||typeof e!=`object`)return e;let t=e;if(typeof t.role==`string`&&t.role.toLowerCase()!==`assistant`)return e;let n=!1,r={...t};if(typeof r.text==`string`){let e=U_(r.text);n||=e!==r.text,r.text=e}if(typeof r.content==`string`){let e=U_(r.content);n||=e!==r.content,r.content=e}else if(Array.isArray(r.content)){let e=[...r.content];for(let t=e.length-1;t>=0;--t){let r=e[t];if(!r||typeof r!=`object`||typeof r.text!=`string`)continue;let i={...r},a=i.text,o=e.slice(0,t).some(e=>e&&typeof e==`object`&&typeof e.text==`string`&&!!(e.text??``).trim())&&H_(a)?``:U_(a);n||=o!==i.text,i.text=o,e[t]=i;break}r.content=e}return n?r:e}function G_(e){if(!e||typeof e!=`object`)return!1;let t=e;if((typeof t.role==`string`?t.role.toLowerCase():``)!==`assistant`)return!1;if(typeof t.text==`string`)return H_(t.text);let n=O_(e);return typeof n==`string`&&H_(n)}function K_(e){let t=e;t.toolStreamById instanceof Map&&Array.isArray(t.toolStreamOrder)&&Array.isArray(t.chatToolMessages)&&Array.isArray(t.chatStreamSegments)&&o_(t)}async function q_(e){if(!e.client||!e.connected)return;let t=e.sessionKey,n=z_(e);e.chatLoading=!0,e.lastError=null;try{let r=await e.client.request(`chat.history`,{sessionKey:t,limit:200});if(!V_(e,n,t))return;e.chatMessages=(Array.isArray(r.messages)?r.messages:[]).filter(e=>!G_(e)).map(e=>W_(e)),e.chatThinkingLevel=r.thinkingLevel??null,K_(e),e.chatStream=null,e.chatStreamStartedAt=null}catch(r){if(!V_(e,n,t))return;Fc(r)?(e.chatMessages=[],e.chatThinkingLevel=null,e.lastError=Ic(`existing chat history`)):e.lastError=String(r)}finally{B_(e,n)&&(e.chatLoading=!1)}}async function J_(e){if(!e.client||!e.connected||!e.sessionKey.trim()){e.chatSessionUsage=null,e.chatSessionUsageLoading=!1;return}let t=e.sessionKey;e.chatSessionUsageLoading=!0,e.chatSessionUsageError=null;try{let n=await e.client.request(`sessions.usage`,{key:t,limit:1});if(e.sessionKey!==t)return;let r=Array.isArray(n?.sessions)?n.sessions:[];e.chatSessionUsage=r.find(e=>e.key===t)??r[0]??null}catch(n){if(e.sessionKey!==t)return;e.chatSessionUsage=null,e.chatSessionUsageError=String(n)}finally{e.sessionKey===t&&(e.chatSessionUsageLoading=!1)}}function Y_(e){let t=/^data:([^;]+);base64,(.+)$/.exec(e);return t?{mimeType:t[1],content:t[2]}:null}function X_(e,t){if(!e||typeof e!=`object`)return null;let n=e,r=n.role;if(typeof r==`string`){if((t.roleCaseSensitive?r:r.toLowerCase())!==`assistant`)return null}else if(t.roleRequirement===`required`)return null;return t.requireContentArray?Array.isArray(n.content)?n:null:!(`content`in n)&&!(t.allowTextField&&`text`in n)?null:n}function Z_(e){return X_(e,{roleRequirement:`required`,roleCaseSensitive:!0,requireContentArray:!0})}function Q_(e){let t=X_(e,{roleRequirement:`optional`,allowTextField:!0});return t?W_(t):null}function $_(e){let t=e?.trim()||`chat error`;return/^Unhandled stop reason:\s*error$/i.test(t)?`Chat failed. Check gateway logs for details.`:`Chat failed: ${t}`}function ev(e,t){let n=$_(t),r=e.chatMessages.at(-1);(r?O_(r):null)!==n&&(e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:n}],timestamp:Date.now()}])}async function tv(e,t,n){if(!e.client||!e.connected)return null;let r=t.trim(),i=Array.isArray(n)?n:n?.attachments,a=Array.isArray(n)?`operator`:n?.deliveryMode??`operator`,o=i&&i.length>0;if(!r&&!o)return null;let s=Date.now(),c=[];if(r&&c.push({type:`text`,text:r}),o)for(let e of i)c.push({type:`image`,source:{type:`base64`,media_type:e.mimeType,data:e.dataUrl}});e.chatMessages=[...e.chatMessages,{role:`user`,content:c,timestamp:s}],e.chatSending=!0,e.lastError=null;let l=Ec();e.chatRunId=l,e.chatStream=``,e.chatStreamStartedAt=s;let u=o?i.map(e=>{let t=Y_(e.dataUrl);return t?{type:`image`,mimeType:t.mimeType,content:t.content}:null}).filter(e=>e!==null):void 0;try{return a===`channel`?await e.client.request(`agent`,{sessionKey:e.sessionKey,message:r,deliver:!0,idempotencyKey:l,thinking:e.chatThinkingLevel??void 0,attachments:u}):await e.client.request(`chat.send`,{sessionKey:e.sessionKey,message:r,deliver:!1,idempotencyKey:l,attachments:u}),l}catch(t){let n=I_(t);return e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,e.lastError=n,e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:`Error: `+n}],timestamp:Date.now()}],null}finally{e.chatSending=!1}}async function nv(e){if(!e.client||!e.connected)return!1;let t=e.chatRunId;try{return await e.client.request(`chat.abort`,t?{sessionKey:e.sessionKey,runId:t}:{sessionKey:e.sessionKey}),!0}catch(t){return e.lastError=I_(t),!1}}function rv(e,t){if(!t||t.sessionKey!==e.sessionKey)return null;if(t.runId&&e.chatRunId&&t.runId!==e.chatRunId){if(t.state===`final`){let n=Q_(t.message);return n&&!G_(n)?(e.chatMessages=[...e.chatMessages,n],null):`final`}return null}if(t.state===`delta`){let n=O_(t.message);typeof n==`string`&&!H_(n)&&(e.chatStream=n)}else if(t.state===`final`){let n=Q_(t.message);n&&!G_(n)?e.chatMessages=[...e.chatMessages,n]:e.chatStream?.trim()&&!H_(e.chatStream)&&(e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:e.chatStream}],timestamp:Date.now()}]),e.chatStream=null,e.chatRunId=null,e.chatStreamStartedAt=null}else if(t.state===`aborted`){let n=Z_(t.message);if(n&&!G_(n))e.chatMessages=[...e.chatMessages,n];else{let t=e.chatStream??``;t.trim()&&!H_(t)&&(e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:t}],timestamp:Date.now()}])}e.chatStream=null,e.chatRunId=null,e.chatStreamStartedAt=null}else t.state===`error`&&(e.chatStream=null,e.chatRunId=null,e.chatStreamStartedAt=null,e.lastError=$_(t.errorMessage),ev(e,t.errorMessage));return t.state}function iv(e){let t=e.message;if(!t||typeof t!=`object`||Array.isArray(t))return t;let n=t;return typeof n.id==`string`||typeof e.messageId!=`string`?t:{...n,id:e.messageId}}function av(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=t.id??t.messageId;return typeof n==`string`&&n.trim()?n.trim():null}function ov(e){if(!e||typeof e!=`object`||Array.isArray(e))return``;let t=e.role;return typeof t==`string`?t:``}function sv(e,t){if(!e||!t)return!1;let n=ov(e),r=ov(t);if(n&&r&&n!==r)return!1;let i=O_(e),a=O_(t);return typeof i==`string`&&i.length>0&&i===a}function cv(e){let t=(e??``).trim().toLowerCase();return id(t)?.rest??t}function lv(e,t){if(!t||cv(t.sessionKey)!==cv(e.sessionKey)||e.chatRunId)return!1;let n=iv(t);if(!n||G_(n))return!1;let r=av(n);return r&&e.chatMessages.some(e=>av(e)===r)||sv(e.chatMessages.at(-1),n)?!1:(e.chatMessages=[...e.chatMessages,n],!0)}var uv=new WeakMap;function dv(e){return e.chatSending||!!e.chatRunId}function fv(e){let t=e.trim();if(!t)return!1;let n=t.toLowerCase();return n===`/stop`?!0:n===`stop`||n===`esc`||n===`abort`||n===`wait`||n===`exit`}function pv(e){let t=e.trim();if(!t)return!1;let n=t.toLowerCase();return n===`/new`||n===`/reset`?!0:n.startsWith(`/new `)||n.startsWith(`/reset `)}function mv(e){let t=e.sessionsResult?.sessions?.find(t=>t.key===e.sessionKey),n=(t?.deliveryContext?.channel??t?.lastChannel??``).trim(),r=(t?.deliveryContext?.to??t?.lastTo??``).trim();return!!(n&&n!==`webchat`&&r)}async function hv(e){e.connected&&(e.chatMessage=``,await nv(e))}function gv(e,t,n,r){let i=t.trim(),a=!!(n&&n.length>0);!i&&!a||(e.chatQueue=[...e.chatQueue,{id:Ec(),text:i,createdAt:Date.now(),attachments:a?n?.map(e=>({...e})):void 0,refreshSessions:r}])}async function _v(e,t,n){o_(e);let r=e.settings?.chatDeliveryMode===`channel`&&mv(e)?`channel`:`operator`,i=await tv(e,t,{attachments:n?.attachments,deliveryMode:r}),a=!!i;return!a&&n?.previousDraft!=null&&(e.chatMessage=n.previousDraft),!a&&n?.previousAttachments&&(e.chatAttachments=n.previousAttachments),a&&Tg(e,e.sessionKey),a&&n?.restoreDraft&&n.previousDraft?.trim()&&(e.chatMessage=n.previousDraft),a&&n?.restoreAttachments&&n.previousAttachments?.length&&(e.chatAttachments=n.previousAttachments),Rn(e),a&&!e.chatRunId&&vv(e),a&&n?.refreshSessions&&i&&e.refreshSessionsAfterChat.add(i),a}async function vv(e){if(!e.connected||dv(e))return;let[t,...n]=e.chatQueue;t&&(e.chatQueue=n,await _v(e,t.text,{attachments:t.attachments,refreshSessions:t.refreshSessions})||(e.chatQueue=[t,...e.chatQueue]))}async function yv(e){let t=e.chatModelPatchPending;t&&await t.catch(()=>void 0)}function bv(e){let t=e.replace(/\s+/g,` `).trim();return!t||t.startsWith(`/`)?null:(t.length>64?`${t.slice(0,61).trimEnd()}...`:t)||null}function xv(e){let t=e?.trim()??``;return!t||/^(?:local\s+)?chat\s+\d+$/i.test(t)}function Sv(e){if(!Fn(e.sessionKey)?.rest.toLowerCase().startsWith(`webchat:direct:`)||Array.isArray(e.chatMessages)&&e.chatMessages.length>0)return!1;let t=e.sessionsResult?.sessions?.find(t=>t.key===e.sessionKey);return xv(t?.label?.trim()||t?.displayName?.trim()||``)}async function Cv(e,t){if(!(!t||!e.client||!e.connected))try{await e.client.request(`sessions.patch`,{key:e.sessionKey,label:t}),e.sessionsResult?.sessions&&(e.sessionsResult={...e.sessionsResult,sessions:e.sessionsResult.sessions.map(n=>n.key===e.sessionKey?{...n,label:t}:n)})}catch{}}function wv(e,t){e.chatQueue=e.chatQueue.filter(e=>e.id!==t)}function Tv(e,t){t&&(e.chatQueue=e.chatQueue.filter(e=>e.pendingRunId!==t))}async function Ev(e,t,n){if(!e.connected)return;let r=e.chatMessage,i=(t??e.chatMessage).trim(),a=e.chatAttachments??[],o=t==null?a:[],s=o.length>0;if(!i&&!s)return;if(fv(i)){await hv(e);return}if(await yv(e),!e.connected)return;let c=pv(i),l=Sv(e)?bv(i):null;if(t??(e.chatMessage=``,e.chatAttachments=[]),dv(e)){gv(e,i,o,c);return}await _v(e,i,{previousDraft:t==null?r:void 0,restoreDraft:!!(t&&n?.restoreDraft),attachments:s?o:void 0,previousAttachments:t==null?a:void 0,restoreAttachments:!!(t&&n?.restoreDraft),refreshSessions:c})&&l&&await Cv(e,l)}async function Dv(e,t){await Promise.all([q_(e),J_(e),U(e,{activeMinutes:120}),Nv(e)]),t?.scheduleScroll!==!1&&Rn(e)}var Ov=vv;function kv(e){let t=e,n=(uv.get(t)??0)+1;return uv.set(t,n),n}function Av(e,t,n){return uv.get(e)===t&&e.sessionKey===n}function jv(e){let t=Fn(e.sessionKey);return t?.agentId?t.agentId:(e.hello?.snapshot)?.sessionDefaults?.defaultAgentId?.trim()||`main`}function Mv(e,t){let n=g(e),r=encodeURIComponent(t);return n?`${n}/avatar/${r}?meta=1`:`/avatar/${r}?meta=1`}async function Nv(e){if(!e.connected){e.chatAvatarUrl=null;return}let t=e.sessionKey,n=kv(e),r=jv(e);if(!r){Av(e,n,t)&&(e.chatAvatarUrl=null);return}e.chatAvatarUrl=null;let i=Mv(e.basePath,r);try{let r=await fetch(i,{method:`GET`});if(!Av(e,n,t))return;if(!r.ok){e.chatAvatarUrl=null;return}let a=await r.json();if(!Av(e,n,t))return;e.chatAvatarUrl=(typeof a.avatarUrl==`string`?a.avatarUrl.trim():``)||null}catch{Av(e,n,t)&&(e.chatAvatarUrl=null)}}var Pv=`0.1.61`;function Fv(e,t=Pv){let n=e?.trim(),r=t.trim();return!!(n&&r&&r!==`dev`&&n!==r)}function Iv(e){if(!e||e.state!==`final`)return!1;if(!e.message||typeof e.message!=`object`)return!0;let t=e.message,n=typeof t.role==`string`?t.role.toLowerCase():``;return!!(n&&n!==`assistant`)}var Lv=50,Rv=200;function zv(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n)return n.length<=t?n:n.slice(0,t)}function Bv(e){let t=zv(e?.name,Lv)??`Assistant`,n=zv(e?.avatar??void 0,Rv)??null;return{agentId:typeof e?.agentId==`string`&&e.agentId.trim()?e.agentId.trim():null,name:t,avatar:n}}function Vv(){let e=window.__FASED_INJECTED_IDENTITY__;return Bv(e)}async function Hv(e,t){if(!e.client||!e.connected)return;let n=t?.sessionKey?.trim()||e.sessionKey.trim(),r=n?{sessionKey:n}:{};try{let t=await e.client.request(`agent.identity.get`,r);if(!t)return;let n=Bv(t);e.assistantName=n.name,e.assistantAvatar=n.avatar,e.assistantAgentId=n.agentId??null}catch{}}function Uv(e){return typeof e==`object`&&!!e}function Wv(e){if(!Uv(e))return null;let t=typeof e.id==`string`?e.id.trim():``,n=e.request;if(!t||!Uv(n))return null;let r=typeof n.command==`string`?n.command.trim():``;if(!r)return null;let i=typeof e.createdAtMs==`number`?e.createdAtMs:0,a=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;return!i||!a?null:{id:t,kind:`exec`,request:{command:r,cwd:typeof n.cwd==`string`?n.cwd:null,host:typeof n.host==`string`?n.host:null,security:typeof n.security==`string`?n.security:null,ask:typeof n.ask==`string`?n.ask:null,agentId:typeof n.agentId==`string`?n.agentId:null,resolvedPath:typeof n.resolvedPath==`string`?n.resolvedPath:null,sessionKey:typeof n.sessionKey==`string`?n.sessionKey:null},createdAtMs:i,expiresAtMs:a}}function Gv(e){if(!Uv(e))return null;let t=typeof e.id==`string`?e.id.trim():``;return t?{id:t,decision:typeof e.decision==`string`?e.decision:null,resolvedBy:typeof e.resolvedBy==`string`?e.resolvedBy:null,ts:typeof e.ts==`number`?e.ts:null}:null}function Kv(e){if(!Uv(e))return null;let t=typeof e.id==`string`?e.id.trim():``;if(!t)return null;let n=typeof e.createdAtMs==`number`?e.createdAtMs:0,r=typeof e.expiresAtMs==`number`?e.expiresAtMs:0;if(!n||!r)return null;let i=Uv(e.request)?e.request:{},a=typeof i.title==`string`?i.title.trim():``;if(!a)return null;let o=typeof i.description==`string`?i.description:null,s=typeof i.severity==`string`?i.severity:null,c=typeof i.pluginId==`string`?i.pluginId:null;return{id:t,kind:`plugin`,request:{command:a,agentId:typeof i.agentId==`string`?i.agentId:null,sessionKey:typeof i.sessionKey==`string`?i.sessionKey:null},pluginTitle:a,pluginDescription:o,pluginSeverity:s,pluginId:c,createdAtMs:n,expiresAtMs:r}}function qv(e){let t=Date.now();return e.filter(e=>e.expiresAtMs>t)}function Jv(e,t){let n=qv(e).filter(e=>e.id!==t.id);return n.unshift(t),n}function Yv(e,t){return qv(e).filter(e=>e.id!==t)}function Xv(e){return/^(?:typeerror:\s*)?(?:fetch failed|failed to fetch)$/i.test(e.trim())}function Zv(e){if(e&&typeof e==`object`){let t=e.ts;if(typeof t==`number`&&Number.isFinite(t))return t}return Date.now()}function Qv(e){e.restartReconnectTimer!=null&&(globalThis.clearTimeout(e.restartReconnectTimer),e.restartReconnectTimer=null)}function $v(e,t,n=e.client){Qv(e),e.restartReconnectTimer=globalThis.setTimeout(()=>{e.restartReconnectTimer=null,!e.connected&&(!n||e.client!==n||ry(e))},Math.max(250,Math.floor(t)))}function ey(e){let t=e.uiVersion?.trim();if(!t)return;let n=e.pageUrl??(typeof window>`u`?void 0:window.location.href);if(n)try{let r=new URL(n),i=new URL(e.gatewayUrl,r);return!new Set([`ws:`,`wss:`,`http:`,`https:`]).has(i.protocol)||i.host!==r.host?void 0:t}catch{return}}function ty(e,t){let n=(e??``).trim(),r=t.mainSessionKey?.trim();if(!r)return n;if(!n)return r;let i=t.mainKey?.trim()||`main`,a=t.defaultAgentId?.trim();return n===`main`||n===i||a&&(n===`agent:${a}:main`||n===`agent:${a}:${i}`)?r:n}function ny(e,t){if(!t?.mainSessionKey)return;let n=ty(e.sessionKey,t),r=ty(e.settings.sessionKey,t),i=ty(e.settings.lastActiveSessionKey,t),a=n||r||e.sessionKey,o={...e.settings,sessionKey:r||a,lastActiveSessionKey:i||a},s=o.sessionKey!==e.settings.sessionKey||o.lastActiveSessionKey!==e.settings.lastActiveSessionKey;a!==e.sessionKey&&(e.sessionKey=a),s&&wg(e,o)}function ry(e,t){let n=e,r=t?.reason??`initial`;n.pendingShutdownMessage=null,n.resumeChatQueueAfterReconnect=!1,Qv(n),e.lastError=null,e.lastErrorCode=null,e.hello=null,e.connected=!1,e.sessionsSubscriptionActive=!1,e.sessionMessagesSubscriptionActive=!1,e.subscribedSessionMessageKey=null,r===`seq-gap`?(e.execApprovalQueue=qv(e.execApprovalQueue),Tv(e,e.chatRunId??void 0),n.resumeChatQueueAfterReconnect=!0):e.execApprovalQueue=qv(e.execApprovalQueue),e.execApprovalError=null;let i=e.client,a=ey({gatewayUrl:e.settings.gatewayUrl,uiVersion:Pv}),o=new Pc({url:e.settings.gatewayUrl,token:e.settings.token.trim()?e.settings.token:void 0,password:e.password.trim()?e.password:void 0,clientName:`fased-control-ui`,clientVersion:a,mode:Zo.UI,instanceId:e.clientInstanceId,onHello:t=>{if(e.client===o){if(Qv(n),n.pendingShutdownMessage=null,e.connected=!0,e.lastError=null,e.lastErrorCode=null,e.hello=t,e.serverVersion=t.server?.version?.trim()||null,e.serverVersion&&Fv(e.serverVersion)){e.uiRuntimeError=`Dashboard build ${Pv} does not match gateway ${e.serverVersion}. Run fased update, restart the gateway, and reload this page.`,o.stop();return}cy(e,t),e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,o_(e),n.resumeChatQueueAfterReconnect&&(n.resumeChatQueueAfterReconnect=!1,Ov(e)),fm(e),pm(e),Hv(e),ld(e),Eu(e,{quiet:!0}),op(e,{quiet:!0}),Ag(e)}},onClose:({code:t,reason:r,error:i})=>{if(e.client===o){if(e.connected=!1,e.sessionsSubscriptionActive=!1,e.sessionMessagesSubscriptionActive=!1,e.subscribedSessionMessageKey=null,e.lastErrorCode=Oc(i)??(i?.details&&typeof i.details==`object`&&typeof i.details.code==`string`?i.details.code??null:null)??(typeof i?.code==`string`?i.code:null),t!==1012){if(i?.message){e.lastError=e.lastErrorCode&&Xv(i.message)?I_({message:i.message,details:i.details,code:i.code}):i.message;return}e.lastError=n.pendingShutdownMessage??`disconnected (${t}): ${r||`no reason`}`}else e.lastError=n.pendingShutdownMessage??null,e.lastErrorCode=null;n.pendingShutdownMessage&&$v(n,1750,o)}},onEvent:t=>{e.client===o&&iy(e,t)},onGap:({expected:t,received:n})=>{e.client===o&&(e.lastError=`event gap detected (expected seq ${t}, got ${n}); reconnecting`,e.lastErrorCode=null,ry(e,{reason:`seq-gap`}))}});e.client=o,i?.stop(),o.start()}function iy(e,t){try{sy(e,t)}catch(e){console.error(`[gateway] handleGatewayEvent error:`,t.event,e)}}function ay(e,t,n){if(n!==`final`&&n!==`error`&&n!==`aborted`)return!1;let r=e.toolStreamOrder.length>0;o_(e),Tv(e,t?.runId),Ov(e);let i=t?.runId;return i&&e.refreshSessionsAfterChat.has(i)&&(e.refreshSessionsAfterChat.delete(i),n===`final`&&U(e,{activeMinutes:120})),r&&n===`final`?(q_(e),!0):!1}function oy(e,t){t?.sessionKey&&Tg(e,t.sessionKey);let n=rv(e,t),r=ay(e,t,n);n===`final`&&!r&&Iv(t)&&q_(e)}function sy(e,t){if(e.eventLogBuffer=[{ts:Date.now(),event:t.event,payload:t.payload},...e.eventLogBuffer].slice(0,250),e.tab===`debug`&&(e.eventLog=e.eventLogBuffer),t.event===`agent`){if(e.onboarding)return;g_(e,t.payload);return}if(t.event===`chat`){oy(e,t.payload);return}if(t.event===`presence`){let n=t.payload;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence,e.presenceError=null,e.presenceStatus=null);return}if(t.event===`update.available`){let n=t.payload?.updateAvailable;n?.currentVersion&&n.latestVersion&&(e.updateAvailable={currentVersion:n.currentVersion,latestVersion:n.latestVersion,channel:n.channel});return}if(t.event===`mining.changed`){let n=t.payload,r=!!n?.method;!(r&&su(e,n))&&r&&e.tab===`mining`&&tu(e,{quiet:!0});return}if(t.event===`cron`&&e.tab===`cron`){Gg(e);return}if(t.event===`sessions.changed`){e.sessionsLastEventAt=Zv(t.payload),_m(e,t.payload)||U(e);return}if(t.event===`session.message`){e.sessionMessageLastEventAt=Zv(t.payload),lv(e,t.payload)&&Rn(e);return}if(t.event===`device.pair.requested`||t.event===`device.pair.resolved`){op(e,{quiet:!0});return}if(t.event===`shutdown`){let n=t.payload;if(n?.reason){let t=`Restarting: ${n.reason}`;e.pendingShutdownMessage=t,e.lastError=t,e.lastErrorCode=null,$v(e,typeof n.restartExpectedMs==`number`&&Number.isFinite(n.restartExpectedMs)?Math.max(250,n.restartExpectedMs+250):1750)}return}if(t.event===`exec.approval.requested`){let n=Wv(t.payload);if(n){e.execApprovalQueue=Jv(e.execApprovalQueue,n),e.execApprovalError=null;let t=Math.max(0,n.expiresAtMs-Date.now()+500);globalThis.setTimeout(()=>{e.execApprovalQueue=Yv(e.execApprovalQueue,n.id)},t)}return}if(t.event===`exec.approval.resolved`){let n=Gv(t.payload);n&&(e.execApprovalQueue=Yv(e.execApprovalQueue,n.id));return}if(t.event===`plugin.approval.requested`){let n=Kv(t.payload);if(n){e.execApprovalQueue=Jv(e.execApprovalQueue,n),e.execApprovalError=null;let t=Math.max(0,n.expiresAtMs-Date.now()+500);globalThis.setTimeout(()=>{e.execApprovalQueue=Yv(e.execApprovalQueue,n.id)},t)}return}if(t.event===`plugin.approval.resolved`){let n=Gv(t.payload);n&&(e.execApprovalQueue=Yv(e.execApprovalQueue,n.id))}}function cy(e,t){let n=t.snapshot;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence),n?.health&&(e.debugHealth=n.health),n?.sessionDefaults&&ny(e,n.sessionDefaults),e.federationManagedMode=n?.gatewayMode===`managed`}var ly=`/__fased/control-ui-config.json`;async function uy(e){if(typeof window>`u`||typeof fetch!=`function`)return;let t=g(e.basePath??``),n=t?`${t}${ly}`:ly;try{let t=await fetch(n,{method:`GET`,headers:{Accept:`application/json`},credentials:`same-origin`});if(!t.ok)return;let r=await t.json();e.serverVersion=r.serverVersion?.trim()||null,e.serverVersion&&Fv(e.serverVersion)&&(e.uiRuntimeError=`Dashboard build ${Pv} does not match gateway ${e.serverVersion}. Run fased update, restart the gateway, and reload this page.`);let i=Bv({name:r.assistantName,avatar:r.assistantAvatar??null});e.assistantName=i.name,e.assistantAvatar=i.avatar}catch{}}function dy(e){e.basePath=Mg(),e.authBootstrapPending=!0;let t=uy(e);Lg(e,!0),Ng(e),Fg(e),window.addEventListener(`popstate`,e.popStateHandler),Promise.all([t,Eg(e)]).then(()=>{e.authBootstrapPending=!1,e.settings.token.trim()&&!e.client&&ry(e)},()=>{e.authBootstrapPending=!1}),Nu(e),e.tab===`logs`&&Fu(e),e.tab===`debug`&&Lu(e),(e.tab===`federation`||e.tab===`marketplace`)&&zu(e),e.tab===`mining`&&Vu(e)}function fy(e){Wn(e)}function py(e){window.removeEventListener(`popstate`,e.popStateHandler),Pu(e),Iu(e),Ru(e),Bu(e),Hu(e),e.client?.stop(),e.client=null,e.connected=!1,Ig(e),e.topbarObserver?.disconnect(),e.topbarObserver=null}function my(e,t){if(!(e.tab===`chat`&&e.chatManualRefreshInFlight)){if(e.tab===`chat`&&(t.has(`chatMessages`)||t.has(`chatToolMessages`)||t.has(`chatStream`)||t.has(`chatLoading`)||t.has(`tab`))){let n=t.has(`tab`),r=t.has(`chatLoading`)&&t.get(`chatLoading`)===!0&&!e.chatLoading;Rn(e,n||r||!e.chatHasAutoScrolled)}e.tab===`logs`&&(t.has(`logsEntries`)||t.has(`logsAutoFollow`)||t.has(`tab`))&&e.logsAutoFollow&&e.logsAtBottom&&zn(e,t.has(`tab`)||t.has(`logsAutoFollow`))}}var hy=`Fased`,gy=`Fased Agent`;function _y(e){if(Array.isArray(e))return e.map(e=>typeof e==`string`?e.trim():``).filter(Boolean).slice(0,1)}function vy(e,t){let n=t.trim();if(!n)return null;let r=e?.agents?.list,i=Array.isArray(r)?r.map(e=>e&&typeof e==`object`?{...e}:{}):r&&typeof r==`object`?Object.entries(r).map(([e,t])=>({...t&&typeof t==`object`?t:{},id:t&&typeof t==`object`&&`id`in t&&typeof t.id==`string`&&t.id.trim()?t.id:e})):[],a=i.findIndex(e=>e.id===n);return a>=0?{changed:!1,index:a,list:i}:(i.push({id:n}),{changed:!0,index:i.length-1,list:i})}var yy=`Assistant`;function by(e){return e.split(/[-_]+/).filter(Boolean).map(e=>`${e.slice(0,1).toUpperCase()}${e.slice(1)}`).join(` `)}function xy(e){return(e??``).trim().toLowerCase()===`main`}function Sy(e){let t=e.id.trim(),n=t.toLowerCase(),r=e.identity?.name?.trim()||e.name?.trim()||``;return r&&r.toLowerCase()!==n?r:xy(t)?yy:by(t)||t}function Cy(e){let t=e.id.trim(),n=Sy(e);return xy(t)?n:n&&n!==t?`${n} (${t})`:t}var wy=new Set([`agent`,`channel`,`chat`,`provider`,`model`,`source`,`tool`,`label`,`key`,`session`,`id`,`has`,`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`]),Ty=e=>e.trim().toLowerCase(),Ey=e=>{let t=e.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`).replace(/\?/g,`.`);return RegExp(`^${t}$`,`i`)},Dy=e=>{let t=e.trim().toLowerCase();if(!t)return null;t.startsWith(`$`)&&(t=t.slice(1));let n=1;t.endsWith(`k`)?(n=1e3,t=t.slice(0,-1)):t.endsWith(`m`)&&(n=1e6,t=t.slice(0,-1));let r=Number(t);return Number.isFinite(r)?r*n:null},Oy=e=>(e.match(/"[^"]+"|\S+/g)??[]).map(e=>{let t=e.replace(/^"|"$/g,``),n=t.indexOf(`:`);return n>0?{key:t.slice(0,n),value:t.slice(n+1),raw:t}:{value:t,raw:t}}),ky=e=>[e.label,e.key,e.sessionId].filter(e=>!!e).map(e=>e.toLowerCase()),Ay=e=>{let t=new Set;e.modelProvider&&t.add(e.modelProvider.toLowerCase()),e.providerOverride&&t.add(e.providerOverride.toLowerCase()),e.origin?.provider&&t.add(e.origin.provider.toLowerCase());for(let n of e.usage?.modelUsage??[])n.provider&&t.add(n.provider.toLowerCase());return Array.from(t)},jy=e=>{let t=new Set;e.model&&t.add(e.model.toLowerCase());for(let n of e.usage?.modelUsage??[])n.model&&t.add(n.model.toLowerCase());return Array.from(t)},My=e=>(e.usage?.toolUsage?.tools??[]).map(e=>e.name.toLowerCase()),Ny=(e,t)=>{let n=Ty(t.value??``);if(!n)return!0;if(!t.key)return ky(e).some(e=>e.includes(n));switch(Ty(t.key)){case`agent`:return e.agentId?.toLowerCase().includes(n)??!1;case`channel`:return e.channel?.toLowerCase().includes(n)??!1;case`chat`:return e.chatType?.toLowerCase().includes(n)??!1;case`provider`:return Ay(e).some(e=>e.includes(n));case`model`:return jy(e).some(e=>e.includes(n));case`source`:return e.source?.toLowerCase().includes(n)??!1;case`tool`:return My(e).some(e=>e.includes(n));case`label`:return e.label?.toLowerCase().includes(n)??!1;case`key`:case`session`:case`id`:if(n.includes(`*`)||n.includes(`?`)){let t=Ey(n);return t.test(e.key)||(e.sessionId?t.test(e.sessionId):!1)}return e.key.toLowerCase().includes(n)||(e.sessionId?.toLowerCase().includes(n)??!1);case`has`:switch(n){case`tools`:return(e.usage?.toolUsage?.totalCalls??0)>0;case`errors`:return(e.usage?.messageCounts?.errors??0)>0;case`context`:return!!e.contextWeight;case`usage`:return!!e.usage;case`model`:return jy(e).length>0;case`provider`:return Ay(e).length>0;default:return!0}case`mintokens`:{let t=Dy(n);return t===null?!0:(e.usage?.totalTokens??0)>=t}case`maxtokens`:{let t=Dy(n);return t===null?!0:(e.usage?.totalTokens??0)<=t}case`mincost`:{let t=Dy(n);return t===null?!0:(e.usage?.totalCost??0)>=t}case`maxcost`:{let t=Dy(n);return t===null?!0:(e.usage?.totalCost??0)<=t}case`minmessages`:{let t=Dy(n);return t===null?!0:(e.usage?.messageCounts?.total??0)>=t}case`maxmessages`:{let t=Dy(n);return t===null?!0:(e.usage?.messageCounts?.total??0)<=t}default:return!0}},Py=(e,t)=>{let n=Oy(t);if(n.length===0)return{sessions:e,warnings:[]};let r=[];for(let e of n){if(!e.key)continue;let t=Ty(e.key);if(!wy.has(t)){r.push(`Unknown filter: ${e.key}`);continue}if(e.value===``&&r.push(`Missing value for ${e.key}`),t===`has`){let t=new Set([`tools`,`errors`,`context`,`usage`,`model`,`provider`]);e.value&&!t.has(Ty(e.value))&&r.push(`Unknown has:${e.value}`)}[`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`].includes(t)&&e.value&&Dy(e.value)===null&&r.push(`Invalid number for ${e.key}`)}return{sessions:e.filter(e=>n.every(t=>Ny(e,t))),warnings:r}};function Fy(e){let t=e.split(`
|
|
144
144
|
`),n=new Map,r=[];for(let e of t){let t=/^\[Tool:\s*([^\]]+)\]/.exec(e.trim());if(t){let e=t[1];n.set(e,(n.get(e)??0)+1);continue}e.trim().startsWith(`[Tool Result]`)||r.push(e)}let i=Array.from(n.entries()).toSorted((e,t)=>t[1]-e[1]),a=i.reduce((e,[,t])=>e+t,0);return{tools:i,summary:i.length>0?`Tools: ${i.map(([e,t])=>`${e}×${t}`).join(`, `)} (${a} calls)`:``,cleanContent:r.join(`
|
|
145
145
|
`).trim()}}function Iy(e){return{byChannel:Array.from(e.byChannelMap.entries()).map(([e,t])=>({channel:e,totals:t})).toSorted((e,t)=>t.totals.totalCost-e.totals.totalCost),latency:e.latencyTotals.count>0?{count:e.latencyTotals.count,avgMs:e.latencyTotals.sum/e.latencyTotals.count,minMs:e.latencyTotals.min===1/0?0:e.latencyTotals.min,maxMs:e.latencyTotals.max,p95Ms:e.latencyTotals.p95Max}:void 0,dailyLatency:Array.from(e.dailyLatencyMap.values()).map(e=>({date:e.date,count:e.count,avgMs:e.count?e.sum/e.count:0,minMs:e.min===1/0?0:e.min,maxMs:e.max,p95Ms:e.p95Max})).toSorted((e,t)=>e.date.localeCompare(t.date)),modelDaily:Array.from(e.modelDailyMap.values()).toSorted((e,t)=>e.date.localeCompare(t.date)||t.cost-e.cost),daily:Array.from(e.dailyMap.values()).toSorted((e,t)=>e.date.localeCompare(t.date))}}var Ly=4;function Ry(e){return Math.round(e/Ly)}function W(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function zy(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString(void 0,{hour:`numeric`})}function By(e,t){let n=Array.from({length:24},()=>0),r=Array.from({length:24},()=>0);for(let i of e){let e=i.usage;if(!e?.messageCounts||e.messageCounts.total===0)continue;let a=e.firstActivity??i.updatedAt,o=e.lastActivity??i.updatedAt;if(!a||!o)continue;let s=Math.min(a,o),c=Math.max(a,o),l=Math.max(c-s,1)/6e4,u=s;for(;u<c;){let i=new Date(u),a=Hy(i,t),o=Wy(i,t),s=Math.min(o.getTime(),c),d=Math.max((s-u)/6e4,0)/l;n[a]+=e.messageCounts.errors*d,r[a]+=e.messageCounts.total*d,u=s+1}}return r.map((e,t)=>{let r=n[t];return{hour:t,rate:e>0?r/e:0,errors:r,msgs:e}}).filter(e=>e.msgs>0&&e.errors>0).toSorted((e,t)=>t.rate-e.rate).slice(0,5).map(e=>({label:zy(e.hour),value:`${(e.rate*100).toFixed(2)}%`,sub:`${Math.round(e.errors)} errors · ${Math.round(e.msgs)} msgs`}))}var Vy=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function Hy(e,t){return t===`utc`?e.getUTCHours():e.getHours()}function Uy(e,t){return t===`utc`?e.getUTCDay():e.getDay()}function Wy(e,t){let n=new Date(e);return t===`utc`?n.setUTCMinutes(59,59,999):n.setMinutes(59,59,999),n}function Gy(e,t){let n=Array.from({length:24},()=>0),r=Array.from({length:7},()=>0),i=0,a=!1;for(let o of e){let e=o.usage;if(!e||!e.totalTokens||e.totalTokens<=0)continue;i+=e.totalTokens;let s=e.firstActivity??o.updatedAt,c=e.lastActivity??o.updatedAt;if(!s||!c)continue;a=!0;let l=Math.min(s,c),u=Math.max(s,c),d=Math.max(u-l,1)/6e4,f=l;for(;f<u;){let i=new Date(f),a=Hy(i,t),o=Uy(i,t),s=Wy(i,t),c=Math.min(s.getTime(),u),l=Math.max((c-f)/6e4,0)/d;n[a]+=e.totalTokens*l,r[o]+=e.totalTokens*l,f=c+1}}let o=Vy.map((e,t)=>({label:e,tokens:r[t]}));return{hasData:a,totalTokens:i,hourTotals:n,weekdayTotals:o}}function Ky(e,t,r,i){let a=Gy(e,t);if(!a.hasData)return n`
|
|
146
146
|
<div class="card usage-mosaic">
|
|
@@ -25505,4 +25505,4 @@ Payload:
|
|
|
25505
25505
|
<li>After replacement, revoke devices that are lost, stale, or no longer operator-controlled.</li>
|
|
25506
25506
|
</ul>
|
|
25507
25507
|
`),this.walletActionMessage=this.nativeWalletCustodyHelperAvailable()?`Opened a printable device handoff for ${e}. Move it to the second trusted device or client and then verify unlock there.`:`Opened a printable device handoff for ${e}. Move it to the second device and then verify unlock there.`}async handleWalletApplyRecommendedPolicy(){await this.handleWalletPatchSettings({policyTemplate:`recommended`})}async handleWalletInitializeCustody(){if(this.walletActionBusy)return;let e=this.currentWalletCustodyWalletId();if(!e){this.walletError=`Select a wallet first.`;return}this.walletActionBusy=!0,this.walletActionMessage=null,this.walletError=null;try{let t=await this.resolveWalletCustodyApproval({operation:`wallet.custody-init`,walletId:e,includeStorageKey:this.walletCustodyRememberDeviceShare&&!this.nativeWalletCustodyHelperAvailable()}),n=await Nr(t.approvalToken,e);this.walletCustodyDeviceShare=n.deviceShare,this.walletCustodyRecoveryShare=n.recoveryShare,this.walletCustodyRecoveryInput=``,this.walletCustodyEnrollLabel=``,this.walletCustodyEnrolledDeviceShare=``,this.walletCustodyLoadedForWalletId=n.walletId;let r=await this.persistWalletCustodyDeviceShareIfNeeded(n.walletId,n.deviceShare,t),i=n.signerRestarted===!1?` Signer restart needs retry: ${n.signerRestartError??`unknown error`}`:``;this.walletActionMessage=r?`Wallet security enabled for ${n.walletId}. The wallet is locked by default; unlock with passkey before signing. Device share was not stored on this client: ${r}${i}`:`Wallet security enabled for ${n.walletId}. The wallet is locked by default; unlock with passkey before signing. Store the recovery share offline and separate from this device.${i}`,await this.handleWalletLoad()}catch(e){let t=String(e);this.walletError=t.includes(`no self-hosted local-signer keystores`)?`Custody init failed: this wallet has no local signer key yet. Create or import the wallet key before enabling split-key.`:`Custody init failed: ${t}`}finally{this.walletActionBusy=!1}}async handleWalletRecoverCustody(){if(this.walletActionBusy)return;let e=this.currentWalletCustodyWalletId();if(!e){this.walletError=`Select a wallet first.`;return}let t=this.walletCustodyRecoveryInput.trim();if(!t){this.walletError=`Paste the offline recovery share for this wallet first.`;return}this.walletActionBusy=!0,this.walletActionMessage=null,this.walletError=null;try{let n=await this.resolveWalletCustodyApproval({operation:`wallet.custody-recover`,walletId:e,includeStorageKey:this.walletCustodyRememberDeviceShare&&!this.nativeWalletCustodyHelperAvailable()}),r=await Pr(n.approvalToken,t,e);this.walletCustodyDeviceShare=r.deviceShare,this.walletCustodyRecoveryShare=r.recoveryShare,this.walletCustodyRecoveryInput=``,this.walletCustodyEnrollLabel=``,this.walletCustodyEnrolledDeviceShare=``,this.walletCustodyLoadedForWalletId=r.walletId;let i=await this.persistWalletCustodyDeviceShareIfNeeded(r.walletId,r.deviceShare,n);this.walletActionMessage=i?`Recovered ${r.walletId} and rotated to a new device share. The wallet remains locked until passkey unlock. Client-side storage unchanged: ${i}`:`Recovered ${r.walletId} and rotated to a new device share. Export the new recovery share now; the wallet remains locked until passkey unlock.`,await this.handleWalletLoad()}catch(e){this.walletError=`Custody recovery failed: ${String(e)}`}finally{this.walletActionBusy=!1}}async handleWalletEnrollCustodyDevice(){if(this.walletActionBusy)return;let e=this.currentWalletCustodyWalletId();if(!e){this.walletError=`Select a wallet first.`;return}let t=this.walletCustodyDeviceShare.trim();this.walletActionBusy=!0,this.walletActionMessage=null,this.walletError=null;try{let n=await this.hasStoredWalletCustodyDeviceShareOnClient(e),r=await this.resolveWalletCustodyApproval({operation:`wallet.custody-enroll-device`,walletId:e,includeStorageKey:!this.nativeWalletCustodyHelperAvailable()&&!t&&n}),i=t;if(!i&&n){if(!r.storageKeyBase64&&!this.nativeWalletCustodyHelperAvailable())throw Error(`This browser stores only an encrypted device share. Unlock with a PRF-capable passkey browser or paste the raw device share to enroll another device.`);i=await this.loadStoredWalletCustodyDeviceShareFromClient({walletId:e,storageKeyBase64:r.storageKeyBase64,prompt:`Authenticate to load the stored device share for ${e}.`})}if(!i)throw Error(`Current device share is required to enroll another device.`);let a=await Lr({approvalToken:r.approvalToken,walletId:e,deviceShare:i,label:this.walletCustodyEnrollLabel});this.walletCustodyEnrolledDeviceShare=a.deviceShare,this.walletCustodyEnrollLabel=a.label||this.walletCustodyEnrollLabel,await this.handleWalletLoad(),this.walletActionMessage=this.nativeWalletCustodyHelperAvailable()?`Created a second-device handoff for ${e}. Export the new device share once and open it on the second trusted device or browser.`:`Created a second-device handoff for ${e}. Export the new device share once and open it on the second device.`}catch(e){this.walletError=`Device enrollment failed: ${String(e)}`}finally{this.walletActionBusy=!1}}async handleWalletRevokeCustodyDevice(e){if(this.walletActionBusy)return;let t=this.currentWalletCustodyWalletId();if(!t){this.walletError=`Select a wallet first.`;return}let n=e.trim();if(!n){this.walletError=`Select a device first.`;return}let r=this.walletCustodyDeviceShare.trim();this.walletActionBusy=!0,this.walletActionMessage=null,this.walletError=null;try{let e=await this.hasStoredWalletCustodyDeviceShareOnClient(t),i=await this.resolveWalletCustodyApproval({operation:`wallet.custody-revoke-device`,walletId:t,includeStorageKey:!this.nativeWalletCustodyHelperAvailable()&&!r&&e}),a=r;if(!a&&e){if(!i.storageKeyBase64&&!this.nativeWalletCustodyHelperAvailable())throw Error(`This browser stores only an encrypted device share. Unlock with a PRF-capable passkey browser or paste the raw device share to revoke a device.`);a=await this.loadStoredWalletCustodyDeviceShareFromClient({walletId:t,storageKeyBase64:i.storageKeyBase64,prompt:`Authenticate to load the stored device share for ${t}.`})}if(!a)throw Error(`Current device share is required to revoke another device.`);let o=await Rr({approvalToken:i.approvalToken,walletId:t,deviceId:n,deviceShare:a});this.walletCustodyEnrolledDeviceShare=``,await this.handleWalletLoad(),this.walletActionMessage=`Revoked ${o.removedDeviceLabel||o.removedDeviceId} for ${t}.`}catch(e){this.walletError=`Device revoke failed: ${String(e)}`}finally{this.walletActionBusy=!1}}async handleWalletDisableCustody(e){if(this.walletActionBusy)return;let t=e?.trim()||this.currentWalletCustodyWalletId();if(!t){this.walletError=`Select a wallet first.`;return}let n=this.walletCustodyDeviceShare.trim(),r=this.walletCustodyRecoveryInput.trim();this.walletActionBusy=!0,this.walletActionMessage=null,this.walletError=null;try{let e=await this.hasStoredWalletCustodyDeviceShareOnClient(t),i=await this.resolveWalletCustodyApproval({operation:`wallet.custody-disable`,walletId:t,includeStorageKey:!this.nativeWalletCustodyHelperAvailable()&&!n&&!r&&e}),a=n;if(!a&&!r&&e){if(!i.storageKeyBase64&&!this.nativeWalletCustodyHelperAvailable())throw Error(`This browser stores only an encrypted device share. Unlock with a PRF-capable passkey browser, paste the device share, or paste the recovery share to disable wallet security.`);a=await this.loadStoredWalletCustodyDeviceShareFromClient({walletId:t,storageKeyBase64:i.storageKeyBase64,prompt:`Authenticate to load the stored device share for ${t}.`})}if(!a&&!r)throw Error(`Device share or recovery share is required to disable wallet security.`);let o=await zr({approvalToken:i.approvalToken,walletId:t,deviceShare:a,recoveryShare:r});await this.clearStoredWalletCustodyDeviceShareOnClient(t),this.walletCustodyDeviceShare=``,this.walletCustodyRecoveryShare=``,this.walletCustodyRecoveryInput=``,this.walletCustodyEnrollLabel=``,this.walletCustodyEnrolledDeviceShare=``,this.walletCustodyDeviceShareStored=!1,this.walletCustodyLoadedForWalletId=t,this.walletActionMessage=o.signerRestarted===!1?`Wallet security disabled for ${t}. Signer restart needs retry: ${o.signerRestartError??`unknown error`}`:`Wallet security disabled for ${t}.`,await this.handleWalletLoad()}catch(e){this.walletError=`Disable wallet security failed: ${String(e)}`}finally{this.walletActionBusy=!1}}async handleWalletUnlockCustody(){if(this.walletActionBusy)return;let e=this.walletDetailsWalletId.trim()||this.walletSendCreateForm.walletId?.trim()||void 0;if(this.walletStatus||await this.handleWalletLoad(),this.walletStatus?.custody?.mode!==`split-key-active`){this.walletError=`Split-key custody mode is not active.`;return}if(!e){this.walletError=`Select a wallet before unlocking custody.`;return}this.walletActionBusy=!0,this.walletActionMessage=null,this.walletError=null;try{let t=this.walletCustodyDeviceShare.trim(),n=await this.hasStoredWalletCustodyDeviceShareOnClient(e),r=!this.nativeWalletCustodyHelperAvailable()&&(!t&&n||this.walletCustodyRememberDeviceShare),i=await this.resolveWalletCustodyApproval({operation:`wallet.custody-unlock`,walletId:e,includeStorageKey:r}),a=t;if(!a&&n){if(!i.storageKeyBase64&&!this.nativeWalletCustodyHelperAvailable())throw Error(`Stored device share could not be unlocked on this device.`);a=await this.loadStoredWalletCustodyDeviceShareFromClient({walletId:e,storageKeyBase64:i.storageKeyBase64,prompt:`Authenticate to load the stored device share for ${e}.`})}if(!a)throw Error(`Device share is required to unlock custody.`);let o=await Mr(i.approvalToken,a,e,pX(this.walletCustodyUnlockMinutes));this.walletCustodyDeviceShare=a;let s=e?await this.persistWalletCustodyDeviceShareIfNeeded(e,a,i):null,c=dX(o.session.expiresAt);this.walletActionMessage=s?`Signing window unlocked until ${c}. Browser storage unchanged: ${s}`:`Signing window unlocked until ${c}.`,this.walletStatus&&(!e||o.custody.target.walletId===e)&&(this.walletStatus={...this.walletStatus,custody:o.custody}),await this.handleWalletLoad(),this.walletStatus&&(!e||o.custody.target.walletId===e)&&(this.walletStatus={...this.walletStatus,custody:o.custody})}catch(e){this.walletError=`Custody unlock failed: ${String(e)}`}finally{this.walletActionBusy=!1}}async handleWalletRefreshCustody(e=!1){let t=this.currentWalletCustodyWalletId();if(!t)return;let n=this.walletCustodyDeviceShare.trim()||await this.loadStoredWalletCustodyDeviceShareFromClient({walletId:t,prompt:`Authenticate to refresh the signing window for ${t}.`});if(!n){e||(this.walletError=`Device share is required to refresh custody unlock. Unlock the wallet again if only an encrypted browser copy is available.`);return}try{let r=await Fr(n,t,pX(this.walletCustodyUnlockMinutes));this.walletCustodyDeviceShare=n,this.walletCustodyLoadedForWalletId=t,this.walletStatus&&this.walletStatus.custody.target.walletId===t&&(this.walletStatus={...this.walletStatus,custody:r.custody}),e||(this.walletActionMessage=`Signing window extended until ${dX(r.session.expiresAt)}.`)}catch(t){e||(this.walletError=`Custody refresh failed: ${String(t)}`)}finally{this.scheduleWalletCustodyRefresh()}}async handleWalletLockCustody(){if(this.walletActionBusy)return;let e=this.currentWalletCustodyWalletId();if(!e){this.walletError=`Select a wallet first.`;return}this.walletActionBusy=!0,this.walletActionMessage=null,this.walletError=null;try{let t=await Ir(e);this.walletStatus&&this.walletStatus.custody.target.walletId===e&&(this.walletStatus={...this.walletStatus,custody:t.custody}),this.clearWalletCustodyRefreshTimer(),this.walletActionMessage=`Signing window locked for ${e}.`,await this.handleWalletLoad()}catch(e){this.walletError=`Custody lock failed: ${String(e)}`}finally{this.walletActionBusy=!1}}async handleAbortChat(){await hv(this)}removeQueuedMessage(e){wv(this,e)}async handleSendChat(e,t){await Ev(this,e,t)}async handleWhatsAppStart(e){await fn(this,e)}async handleWhatsAppWait(){await pn(this)}async handleWhatsAppLogout(){await mn(this)}async handleChannelQrStart(e,t=!1,n){await hn(this,e,t,n)}async handleChannelQrWait(e,t){await gn(this,e,t)}async handleChannelLogout(e,t){await _n(this,e,t)}async handleChannelInstall(e){await vn(this,e)}cancelChannelConfirmAction(){yn(this)}async confirmChannelAction(){await bn(this)}async handleChannelEnable(e){await xn(this,e)}async handleChannelConfigSave(){await Sn(this)}async handleChannelConfigReload(){await Cn(this)}handleNostrProfileEdit(e,t){kn(this,e,t)}handleNostrProfileCancel(){An(this)}handleNostrProfileFieldChange(e,t){jn(this,e,t)}async handleNostrProfileSave(){await Nn(this)}async handleNostrProfileImport(){await Pn(this)}handleNostrProfileToggleAdvanced(){Mn(this)}async handleExecApprovalDecision(e){let t=this.execApprovalQueue[0];if(!(!t||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{await this.client.request(`exec.approval.resolve`,{id:t.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(e=>e.id!==t.id)}catch(e){this.execApprovalError=`Exec approval failed: ${String(e)}`}finally{this.execApprovalBusy=!1}}}handleGatewayUrlConfirm(){let e=this.pendingGatewayUrl;if(!e)return;let t=this.pendingGatewayToken?.trim()??``;this.pendingGatewayUrl=null,this.pendingGatewayToken=null,wg(this,{...this.settings,gatewayUrl:e,...t?{token:t}:{}}),this.connect()}handleGatewayUrlCancel(){this.pendingGatewayUrl=null,this.pendingGatewayToken=null}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0}handleCloseSidebar(){this.sidebarOpen=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarCloseTimer=null)},200)}handleSplitRatioChange(e){let t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}setLoginTokenCandidate(e){this.loginTokenCandidate=e}render(){if(this.uiRuntimeError)return this.renderUiRuntimeError(this.uiRuntimeError);try{return jJ(this)}catch(e){let t=e instanceof Error?e.stack??e.message:String(e);return queueMicrotask(()=>this.reportUiRuntimeError(t)),this.renderUiRuntimeError(t)}}};G([P()],$.prototype,`settings`,void 0),G([P()],$.prototype,`password`,void 0),G([P()],$.prototype,`loginShowGatewayToken`,void 0),G([P()],$.prototype,`loginShowGatewayPassword`,void 0),G([P()],$.prototype,`tab`,void 0),G([P()],$.prototype,`onboarding`,void 0),G([P()],$.prototype,`connected`,void 0),G([P()],$.prototype,`theme`,void 0),G([P()],$.prototype,`themeResolved`,void 0),G([P()],$.prototype,`hello`,void 0),G([P()],$.prototype,`lastError`,void 0),G([P()],$.prototype,`lastErrorCode`,void 0),G([P()],$.prototype,`uiRuntimeError`,void 0),G([P()],$.prototype,`eventLog`,void 0),G([P()],$.prototype,`serverVersion`,void 0),G([P()],$.prototype,`updateAvailable`,void 0),G([P()],$.prototype,`assistantName`,void 0),G([P()],$.prototype,`assistantAvatar`,void 0),G([P()],$.prototype,`assistantAgentId`,void 0),G([P()],$.prototype,`sessionKey`,void 0),G([P()],$.prototype,`sessionsSubscriptionActive`,void 0),G([P()],$.prototype,`sessionsLastEventAt`,void 0),G([P()],$.prototype,`sessionMessagesSubscriptionActive`,void 0),G([P()],$.prototype,`subscribedSessionMessageKey`,void 0),G([P()],$.prototype,`sessionMessageLastEventAt`,void 0),G([P()],$.prototype,`chatLoading`,void 0),G([P()],$.prototype,`chatSending`,void 0),G([P()],$.prototype,`chatMessage`,void 0),G([P()],$.prototype,`chatMessages`,void 0),G([P()],$.prototype,`chatToolMessages`,void 0),G([P()],$.prototype,`chatStream`,void 0),G([P()],$.prototype,`chatStreamSegments`,void 0),G([P()],$.prototype,`chatStreamStartedAt`,void 0),G([P()],$.prototype,`chatRunId`,void 0),G([P()],$.prototype,`compactionStatus`,void 0),G([P()],$.prototype,`fallbackStatus`,void 0),G([P()],$.prototype,`chatAvatarUrl`,void 0),G([P()],$.prototype,`chatThinkingLevel`,void 0),G([P()],$.prototype,`chatQueue`,void 0),G([P()],$.prototype,`chatAttachments`,void 0),G([P()],$.prototype,`chatManualRefreshInFlight`,void 0),G([P()],$.prototype,`chatModelsLoading`,void 0),G([P()],$.prototype,`chatModelCatalog`,void 0),G([P()],$.prototype,`providerModelCatalog`,void 0),G([P()],$.prototype,`chatModelOverrides`,void 0),G([P()],$.prototype,`chatModelPatchInFlight`,void 0),G([P()],$.prototype,`chatModelPatchSessionKey`,void 0),G([P()],$.prototype,`chatModelPatchLabel`,void 0),G([P()],$.prototype,`chatSessionSearch`,void 0),G([P()],$.prototype,`chatSessionSearchOpen`,void 0),G([P()],$.prototype,`chatSessionListLimit`,void 0),G([P()],$.prototype,`chatTranscriptSearch`,void 0),G([P()],$.prototype,`chatTranscriptSearchIndex`,void 0),G([P()],$.prototype,`chatScheduleDraft`,void 0),G([P()],$.prototype,`chatSessionUsage`,void 0),G([P()],$.prototype,`chatSessionUsageLoading`,void 0),G([P()],$.prototype,`chatSessionUsageError`,void 0),G([P()],$.prototype,`sidebarOpen`,void 0),G([P()],$.prototype,`sidebarContent`,void 0),G([P()],$.prototype,`sidebarError`,void 0),G([P()],$.prototype,`splitRatio`,void 0),G([P()],$.prototype,`nodesLoading`,void 0),G([P()],$.prototype,`nodes`,void 0),G([P()],$.prototype,`commandsCatalogLoading`,void 0),G([P()],$.prototype,`commandsCatalogError`,void 0),G([P()],$.prototype,`commandsCatalog`,void 0),G([P()],$.prototype,`commandsCatalogScope`,void 0),G([P()],$.prototype,`devicesLoading`,void 0),G([P()],$.prototype,`devicesError`,void 0),G([P()],$.prototype,`devicesList`,void 0),G([P()],$.prototype,`execApprovalsLoading`,void 0),G([P()],$.prototype,`execApprovalsSaving`,void 0),G([P()],$.prototype,`execApprovalsDirty`,void 0),G([P()],$.prototype,`execApprovalsSnapshot`,void 0),G([P()],$.prototype,`sendModalVisible`,void 0),G([P()],$.prototype,`execApprovalsForm`,void 0),G([P()],$.prototype,`execApprovalsSelectedAgent`,void 0),G([P()],$.prototype,`execApprovalsTarget`,void 0),G([P()],$.prototype,`execApprovalsTargetNodeId`,void 0),G([P()],$.prototype,`execApprovalQueue`,void 0),G([P()],$.prototype,`execApprovalBusy`,void 0),G([P()],$.prototype,`execApprovalError`,void 0),G([P()],$.prototype,`pendingGatewayUrl`,void 0),G([P()],$.prototype,`pendingGatewayToken`,void 0),G([P()],$.prototype,`loginGrantInput`,void 0),G([P()],$.prototype,`loginGrantPending`,void 0),G([P()],$.prototype,`loginGrantError`,void 0),G([P()],$.prototype,`loginTokenPending`,void 0),G([P()],$.prototype,`loginTokenError`,void 0),G([P()],$.prototype,`loginTokenCandidate`,void 0),G([P()],$.prototype,`authBootstrapPending`,void 0),G([P()],$.prototype,`authNotice`,void 0),G([P()],$.prototype,`authSessionExpiresAt`,void 0),G([P()],$.prototype,`authSessionIdleTimeoutSeconds`,void 0),G([P()],$.prototype,`overviewAdvancedUnlocked`,void 0),G([P()],$.prototype,`overviewSecretsRevealUntilMs`,void 0),G([P()],$.prototype,`dashboardLayout`,void 0),G([P()],$.prototype,`dashboardWidgetDrawerOpen`,void 0),G([P()],$.prototype,`configLoading`,void 0),G([P()],$.prototype,`configRaw`,void 0),G([P()],$.prototype,`configRawOriginal`,void 0),G([P()],$.prototype,`configValid`,void 0),G([P()],$.prototype,`configIssues`,void 0),G([P()],$.prototype,`configSaving`,void 0),G([P()],$.prototype,`configApplying`,void 0),G([P()],$.prototype,`updateRunning`,void 0),G([P()],$.prototype,`applySessionKey`,void 0),G([P()],$.prototype,`configSnapshot`,void 0),G([P()],$.prototype,`configAuthStatus`,void 0),G([P()],$.prototype,`configModelCatalogStatus`,void 0),G([P()],$.prototype,`configAuthActionBusyProfileId`,void 0),G([P()],$.prototype,`configAuthAction`,void 0),G([P()],$.prototype,`configSchema`,void 0),G([P()],$.prototype,`configSchemaVersion`,void 0),G([P()],$.prototype,`configSchemaLoading`,void 0),G([P()],$.prototype,`configUiHints`,void 0),G([P()],$.prototype,`configForm`,void 0),G([P()],$.prototype,`configFormOriginal`,void 0),G([P()],$.prototype,`configFormDirty`,void 0),G([P()],$.prototype,`configFormMode`,void 0),G([P()],$.prototype,`configSearchQuery`,void 0),G([P()],$.prototype,`configActiveSection`,void 0),G([P()],$.prototype,`configActiveSubsection`,void 0),G([P()],$.prototype,`servicesWebSearchTesting`,void 0),G([P()],$.prototype,`servicesWebSearchTestMessage`,void 0),G([P()],$.prototype,`servicesCapabilities`,void 0),G([P()],$.prototype,`servicesCapabilitiesLoading`,void 0),G([P()],$.prototype,`servicesComponentBusy`,void 0),G([P()],$.prototype,`servicesComponentMessage`,void 0),G([P()],$.prototype,`servicesWebSearchProviders`,void 0),G([P()],$.prototype,`servicesWebSearchProvidersLoading`,void 0),G([P()],$.prototype,`servicesGmailProvisioning`,void 0),G([P()],$.prototype,`servicesGmailProvisionMessage`,void 0),G([P()],$.prototype,`channelsLoading`,void 0),G([P()],$.prototype,`channelsSnapshot`,void 0),G([P()],$.prototype,`channelsError`,void 0),G([P()],$.prototype,`channelsNotice`,void 0),G([P()],$.prototype,`channelsLastSuccess`,void 0),G([P()],$.prototype,`channelsView`,void 0),G([P()],$.prototype,`channelRuntimeBusy`,void 0),G([P()],$.prototype,`channelConfirmAction`,void 0),G([P()],$.prototype,`channelQrLogin`,void 0),G([P()],$.prototype,`whatsappLoginMessage`,void 0),G([P()],$.prototype,`whatsappLoginQrDataUrl`,void 0),G([P()],$.prototype,`whatsappLoginConnected`,void 0),G([P()],$.prototype,`whatsappBusy`,void 0),G([P()],$.prototype,`nostrProfileFormState`,void 0),G([P()],$.prototype,`nostrProfileAccountId`,void 0),G([P()],$.prototype,`presenceLoading`,void 0),G([P()],$.prototype,`presenceEntries`,void 0),G([P()],$.prototype,`presenceError`,void 0),G([P()],$.prototype,`presenceStatus`,void 0),G([P()],$.prototype,`agentsLoading`,void 0),G([P()],$.prototype,`agentsList`,void 0),G([P()],$.prototype,`agentsError`,void 0),G([P()],$.prototype,`agentsSelectedId`,void 0),G([P()],$.prototype,`agentsCreateBusy`,void 0),G([P()],$.prototype,`agentsCreateMessage`,void 0),G([P()],$.prototype,`agentsPanel`,void 0),G([P()],$.prototype,`agentFilesLoading`,void 0),G([P()],$.prototype,`agentFilesError`,void 0),G([P()],$.prototype,`agentFilesList`,void 0),G([P()],$.prototype,`agentFileContents`,void 0),G([P()],$.prototype,`agentFileDrafts`,void 0),G([P()],$.prototype,`agentFileActive`,void 0),G([P()],$.prototype,`agentFileSaving`,void 0),G([P()],$.prototype,`agentIdentityLoading`,void 0),G([P()],$.prototype,`agentIdentityError`,void 0),G([P()],$.prototype,`agentIdentityById`,void 0),G([P()],$.prototype,`agentSkillsLoading`,void 0),G([P()],$.prototype,`agentSkillsError`,void 0),G([P()],$.prototype,`agentSkillsReport`,void 0),G([P()],$.prototype,`agentSkillsAgentId`,void 0),G([P()],$.prototype,`toolsCatalogLoading`,void 0),G([P()],$.prototype,`toolsCatalogError`,void 0),G([P()],$.prototype,`toolsCatalogResult`,void 0),G([P()],$.prototype,`toolsEffectiveLoading`,void 0),G([P()],$.prototype,`toolsEffectiveError`,void 0),G([P()],$.prototype,`toolsEffectiveResult`,void 0),G([P()],$.prototype,`sessionsLoading`,void 0),G([P()],$.prototype,`sessionsResult`,void 0),G([P()],$.prototype,`sessionsError`,void 0),G([P()],$.prototype,`sessionsFilterActive`,void 0),G([P()],$.prototype,`sessionsFilterLimit`,void 0),G([P()],$.prototype,`sessionsFilterSearch`,void 0),G([P()],$.prototype,`sessionsIncludeGlobal`,void 0),G([P()],$.prototype,`sessionsIncludeUnknown`,void 0),G([P()],$.prototype,`sessionsHideCron`,void 0),G([P()],$.prototype,`usageLoading`,void 0),G([P()],$.prototype,`usageResult`,void 0),G([P()],$.prototype,`usageCostSummary`,void 0),G([P()],$.prototype,`usageError`,void 0),G([P()],$.prototype,`usageStartDate`,void 0),G([P()],$.prototype,`usageEndDate`,void 0),G([P()],$.prototype,`usageSelectedSessions`,void 0),G([P()],$.prototype,`usageSelectedDays`,void 0),G([P()],$.prototype,`usageSelectedHours`,void 0),G([P()],$.prototype,`usageChartMode`,void 0),G([P()],$.prototype,`usageDailyChartMode`,void 0),G([P()],$.prototype,`usageTimeSeriesMode`,void 0),G([P()],$.prototype,`usageTimeSeriesBreakdownMode`,void 0),G([P()],$.prototype,`usageTimeSeries`,void 0),G([P()],$.prototype,`usageTimeSeriesLoading`,void 0),G([P()],$.prototype,`usageTimeSeriesCursorStart`,void 0),G([P()],$.prototype,`usageTimeSeriesCursorEnd`,void 0),G([P()],$.prototype,`usageSessionLogs`,void 0),G([P()],$.prototype,`usageSessionLogsLoading`,void 0),G([P()],$.prototype,`usageSessionLogsExpanded`,void 0),G([P()],$.prototype,`usageQuery`,void 0),G([P()],$.prototype,`usageQueryDraft`,void 0),G([P()],$.prototype,`usageSessionSort`,void 0),G([P()],$.prototype,`usageSessionSortDir`,void 0),G([P()],$.prototype,`usageRecentSessions`,void 0),G([P()],$.prototype,`usageTimeZone`,void 0),G([P()],$.prototype,`usageContextExpanded`,void 0),G([P()],$.prototype,`usageHeaderPinned`,void 0),G([P()],$.prototype,`usageSessionsTab`,void 0),G([P()],$.prototype,`usageVisibleColumns`,void 0),G([P()],$.prototype,`usageLogFilterRoles`,void 0),G([P()],$.prototype,`usageLogFilterTools`,void 0),G([P()],$.prototype,`usageLogFilterHasTools`,void 0),G([P()],$.prototype,`usageLogFilterQuery`,void 0),G([P()],$.prototype,`cronLoading`,void 0),G([P()],$.prototype,`cronJobsLoadingMore`,void 0),G([P()],$.prototype,`cronJobs`,void 0),G([P()],$.prototype,`cronJobsTotal`,void 0),G([P()],$.prototype,`cronJobsHasMore`,void 0),G([P()],$.prototype,`cronJobsNextOffset`,void 0),G([P()],$.prototype,`cronJobsLimit`,void 0),G([P()],$.prototype,`cronJobsQuery`,void 0),G([P()],$.prototype,`cronJobsEnabledFilter`,void 0),G([P()],$.prototype,`cronJobsScheduleKindFilter`,void 0),G([P()],$.prototype,`cronJobsLastStatusFilter`,void 0),G([P()],$.prototype,`cronJobsAdaptiveRouteFilter`,void 0),G([P()],$.prototype,`cronJobsSortBy`,void 0),G([P()],$.prototype,`cronJobsSortDir`,void 0),G([P()],$.prototype,`cronStatus`,void 0),G([P()],$.prototype,`cronError`,void 0),G([P()],$.prototype,`cronForm`,void 0),G([P()],$.prototype,`cronFieldErrors`,void 0),G([P()],$.prototype,`agentTaskDialogOpen`,void 0),G([P()],$.prototype,`agentTaskForm`,void 0),G([P()],$.prototype,`agentTaskFieldErrors`,void 0),G([P()],$.prototype,`agentTaskEditingJobId`,void 0),G([P()],$.prototype,`agentTaskError`,void 0),G([P()],$.prototype,`agentTaskBusy`,void 0),G([P()],$.prototype,`agentTaskQuery`,void 0),G([P()],$.prototype,`agentTaskStatusFilter`,void 0),G([P()],$.prototype,`agentTaskAdaptiveRouteFilter`,void 0),G([P()],$.prototype,`agentTaskSortDir`,void 0),G([P()],$.prototype,`taskLedgerLoading`,void 0),G([P()],$.prototype,`taskLedgerBusy`,void 0),G([P()],$.prototype,`taskLedgerError`,void 0),G([P()],$.prototype,`taskLedgerMaintenanceMessage`,void 0),G([P()],$.prototype,`taskLedger`,void 0),G([P()],$.prototype,`taskLedgerOffset`,void 0),G([P()],$.prototype,`taskLedgerSourceFilter`,void 0),G([P()],$.prototype,`taskLedgerTypeFilter`,void 0),G([P()],$.prototype,`taskLedgerStatusFilter`,void 0),G([P()],$.prototype,`taskLedgerDetails`,void 0),G([P()],$.prototype,`taskLedgerDetailLoading`,void 0),G([P()],$.prototype,`taskLedgerDetailErrors`,void 0),G([P()],$.prototype,`taskWorkflowDraft`,void 0),G([P()],$.prototype,`taskWorkflowGraphDraft`,void 0),G([P()],$.prototype,`taskWorkflowBusy`,void 0),G([P()],$.prototype,`taskWorkflowError`,void 0),G([P()],$.prototype,`taskWorkflowMessage`,void 0),G([P()],$.prototype,`taskWorkflowDefinitionsLoading`,void 0),G([P()],$.prototype,`taskWorkflowDefinitionsBusy`,void 0),G([P()],$.prototype,`taskWorkflowDefinitionsError`,void 0),G([P()],$.prototype,`taskWorkflowDefinitions`,void 0),G([P()],$.prototype,`taskWorkflowTemplatesLoading`,void 0),G([P()],$.prototype,`taskWorkflowTemplatesError`,void 0),G([P()],$.prototype,`taskWorkflowTemplates`,void 0),G([P()],$.prototype,`taskStandingOrdersLoading`,void 0),G([P()],$.prototype,`taskStandingOrdersBusy`,void 0),G([P()],$.prototype,`taskStandingOrdersError`,void 0),G([P()],$.prototype,`taskStandingOrdersMessage`,void 0),G([P()],$.prototype,`taskStandingOrders`,void 0),G([P()],$.prototype,`taskStandingOrderDraft`,void 0),G([P()],$.prototype,`taskFlowRunsLoading`,void 0),G([P()],$.prototype,`taskFlowRunsBusy`,void 0),G([P()],$.prototype,`taskFlowRunsError`,void 0),G([P()],$.prototype,`taskFlowRuns`,void 0),G([P()],$.prototype,`webhookTriggersLoading`,void 0),G([P()],$.prototype,`webhookTriggersBusy`,void 0),G([P()],$.prototype,`webhookTriggersError`,void 0),G([P()],$.prototype,`webhookTriggersMessage`,void 0),G([P()],$.prototype,`webhookTriggers`,void 0),G([P()],$.prototype,`webhookTriggerDraft`,void 0),G([P()],$.prototype,`cronEditingJobId`,void 0),G([P()],$.prototype,`cronRunsJobId`,void 0),G([P()],$.prototype,`cronRunsLoadingMore`,void 0),G([P()],$.prototype,`cronRuns`,void 0),G([P()],$.prototype,`cronRunsTotal`,void 0),G([P()],$.prototype,`cronRunsHasMore`,void 0),G([P()],$.prototype,`cronRunsNextOffset`,void 0),G([P()],$.prototype,`cronRunsLimit`,void 0),G([P()],$.prototype,`cronRunsScope`,void 0),G([P()],$.prototype,`cronRunsStatuses`,void 0),G([P()],$.prototype,`cronRunsDeliveryStatuses`,void 0),G([P()],$.prototype,`cronRunsStatusFilter`,void 0),G([P()],$.prototype,`cronRunsQuery`,void 0),G([P()],$.prototype,`cronRunsSortDir`,void 0),G([P()],$.prototype,`cronRunDetail`,void 0),G([P()],$.prototype,`cronRunDetailLoading`,void 0),G([P()],$.prototype,`cronRunDetailError`,void 0),G([P()],$.prototype,`cronBusy`,void 0),G([P()],$.prototype,`federationLoading`,void 0),G([P()],$.prototype,`federationError`,void 0),G([P()],$.prototype,`federationMessage`,void 0),G([P()],$.prototype,`federationDirectory`,void 0),G([P()],$.prototype,`federationHandle`,void 0),G([P()],$.prototype,`federationNodeEndpoint`,void 0),G([P()],$.prototype,`federationToken`,void 0),G([P()],$.prototype,`federationStatus`,void 0),G([P()],$.prototype,`federationManagedMode`,void 0),G([P()],$.prototype,`federationAdminToken`,void 0),G([P()],$.prototype,`federationReviewReason`,void 0),G([P()],$.prototype,`federationReviewBusyHandle`,void 0),G([P()],$.prototype,`federationBondWalletIdDraft`,void 0),G([P()],$.prototype,`federationBondAmountDraft`,void 0),G([P()],$.prototype,`federationBondTierDraft`,void 0),G([P()],$.prototype,`federationBondAutoSubmitProof`,void 0),G([P()],$.prototype,`federationBondActionBusy`,void 0),G([P()],$.prototype,`federationBondBusyAction`,void 0),G([P()],$.prototype,`federationOperatorEconomyLoading`,void 0),G([P()],$.prototype,`federationOperatorEconomyError`,void 0),G([P()],$.prototype,`federationOperatorEconomyCollectionStatus`,void 0),G([P()],$.prototype,`federationOperatorEconomyFeeObjects`,void 0),G([P()],$.prototype,`federationOperatorEconomyBucketJournal`,void 0),G([P()],$.prototype,`federationOperatorEconomyBucketBalances`,void 0),G([P()],$.prototype,`federationOperatorEconomyReconciliationReports`,void 0),G([P()],$.prototype,`federationOperatorEconomyAutoFeeDecisions`,void 0),G([P()],$.prototype,`federationOperatorEconomyShowcase`,void 0),G([P()],$.prototype,`federationLocalOffers`,void 0),G([P()],$.prototype,`federationLocalRequests`,void 0),G([P()],$.prototype,`federationLocalOrders`,void 0),G([P()],$.prototype,`federationLocalOffersLoading`,void 0),G([P()],$.prototype,`federationLocalRequestsLoading`,void 0),G([P()],$.prototype,`federationLocalOrdersLoading`,void 0),G([P()],$.prototype,`federationLocalRequestsError`,void 0),G([P()],$.prototype,`federationLocalOrdersError`,void 0),G([P()],$.prototype,`federationLocalOffersError`,void 0),G([P()],$.prototype,`federationLocalOffersMessage`,void 0),G([P()],$.prototype,`federationLocalOfferBusy`,void 0),G([P()],$.prototype,`federationLocalOrderBusy`,void 0),G([P()],$.prototype,`federationEscrowBusyOrderId`,void 0),G([P()],$.prototype,`federationEscrowError`,void 0),G([P()],$.prototype,`federationEscrowMessage`,void 0),G([P()],$.prototype,`federationMarketplaceOrderDeliveryDraftOrderId`,void 0),G([P()],$.prototype,`federationMarketplaceOrderDeliveryKindDraft`,void 0),G([P()],$.prototype,`federationMarketplaceOrderDeliveryWebhookUrlDraft`,void 0),G([P()],$.prototype,`federationMarketplaceOrderDeliveryBusyOrderId`,void 0),G([P()],$.prototype,`federationMarketplaceOrderDeliveryError`,void 0),G([P()],$.prototype,`federationMarketplaceOrderDeliveryMessage`,void 0),G([P()],$.prototype,`federationMarketplaceManualOrderBusyId`,void 0),G([P()],$.prototype,`federationMarketplaceManualOrderError`,void 0),G([P()],$.prototype,`federationMarketplaceManualOrderMessage`,void 0),G([P()],$.prototype,`federationMarketplaceCapabilityOrderBusyId`,void 0),G([P()],$.prototype,`federationMarketplaceCapabilityOrderError`,void 0),G([P()],$.prototype,`federationMarketplaceCapabilityOrderMessage`,void 0),G([P()],$.prototype,`federationLocalOfferDraftOpen`,void 0),G([P()],$.prototype,`federationLocalListingDraftKind`,void 0),G([P()],$.prototype,`federationLocalOfferEditingId`,void 0),G([P()],$.prototype,`federationLocalRequestEditingId`,void 0),G([P()],$.prototype,`federationLocalOfferEnabledDraft`,void 0),G([P()],$.prototype,`federationLocalOfferTitleDraft`,void 0),G([P()],$.prototype,`federationLocalOfferSummaryDraft`,void 0),G([P()],$.prototype,`federationLocalOfferServiceKindDraft`,void 0),G([P()],$.prototype,`federationLocalOfferInputShapeDraft`,void 0),G([P()],$.prototype,`federationLocalOfferDeliveryShapeDraft`,void 0),G([P()],$.prototype,`federationLocalOfferCapabilitiesDraft`,void 0),G([P()],$.prototype,`federationLocalOfferPriceAmountDraft`,void 0),G([P()],$.prototype,`federationLocalOfferPricingModelDraft`,void 0),G([P()],$.prototype,`federationLocalOfferPriceUnitDraft`,void 0),G([P()],$.prototype,`federationLocalOfferCurrencyDraft`,void 0),G([P()],$.prototype,`federationLocalOfferFulfillmentModeDraft`,void 0),G([P()],$.prototype,`federationLocalOfferAcceptedAssetsDraft`,void 0),G([P()],$.prototype,`federationLocalOfferPaymentRailsDraft`,void 0),G([P()],$.prototype,`federationOffersLoading`,void 0),G([P()],$.prototype,`federationOffersError`,void 0),G([P()],$.prototype,`federationOffersHint`,void 0),G([P()],$.prototype,`federationOffers`,void 0),G([P()],$.prototype,`federationOffersQuery`,void 0),G([P()],$.prototype,`federationOffersServiceKindFilter`,void 0),G([P()],$.prototype,`federationMarketplaceSection`,void 0),G([P()],$.prototype,`federationMarketplaceKindFilter`,void 0),G([P()],$.prototype,`federationMarketplaceTrustFilter`,void 0),G([P()],$.prototype,`federationMarketplaceStatusFilter`,void 0),G([P()],$.prototype,`federationMarketplaceDateFromFilter`,void 0),G([P()],$.prototype,`federationMarketplaceDateToFilter`,void 0),G([P()],$.prototype,`federationMarketplaceSort`,void 0),G([P()],$.prototype,`federationSelectedOfferId`,void 0),G([P()],$.prototype,`federationMarketplaceIndexLoading`,void 0),G([P()],$.prototype,`federationMarketplaceIndexPublishing`,void 0),G([P()],$.prototype,`federationMarketplaceIndexError`,void 0),G([P()],$.prototype,`federationMarketplaceIndexMessage`,void 0),G([P()],$.prototype,`federationMarketplaceIndexPreview`,void 0),G([P()],$.prototype,`federationMarketplaceIndexEntries`,void 0),G([P()],$.prototype,`federationMarketplaceIndexSelectedEntryId`,void 0),G([P()],$.prototype,`federationMarketplaceIndexDetailTab`,void 0),G([P()],$.prototype,`federationMarketplaceFeedbackOrderId`,void 0),G([P()],$.prototype,`federationMarketplaceSellerProfileHandle`,void 0),G([P()],$.prototype,`federationMarketplaceSellerProfileTab`,void 0),G([P()],$.prototype,`federationMarketplaceSellerProfileLoading`,void 0),G([P()],$.prototype,`federationMarketplaceSellerProfileError`,void 0),G([P()],$.prototype,`federationMarketplaceSellerProfileEntries`,void 0),G([P()],$.prototype,`federationMarketplaceSellerProfileReviews`,void 0),G([P()],$.prototype,`federationMarketplaceSellerProfileDisputes`,void 0),G([P()],$.prototype,`federationMarketplaceSellerProfileNotaryRecords`,void 0),G([P()],$.prototype,`federationOfferReviewsLoading`,void 0),G([P()],$.prototype,`federationOfferReviewsError`,void 0),G([P()],$.prototype,`federationOfferReviews`,void 0),G([P()],$.prototype,`federationOfferDisputesLoading`,void 0),G([P()],$.prototype,`federationOfferDisputesError`,void 0),G([P()],$.prototype,`federationOfferDisputes`,void 0),G([P()],$.prototype,`federationOfferFeedbackBusy`,void 0),G([P()],$.prototype,`federationOfferFeedbackError`,void 0),G([P()],$.prototype,`federationOfferFeedbackMessage`,void 0),G([P()],$.prototype,`federationOfferFeedbackTab`,void 0),G([P()],$.prototype,`federationSummarizeSourceText`,void 0),G([P()],$.prototype,`federationSummarizeStyle`,void 0),G([P()],$.prototype,`federationSummarizeMaxSentences`,void 0),G([P()],$.prototype,`federationSummarizeBusy`,void 0),G([P()],$.prototype,`federationSummarizeError`,void 0),G([P()],$.prototype,`federationPaidSummarizeBusy`,void 0),G([P()],$.prototype,`federationPaidSummarizeError`,void 0),G([P()],$.prototype,`federationSummarizeResult`,void 0),G([P()],$.prototype,`federationPaidQuoteAmountDraft`,void 0),G([P()],$.prototype,`federationPaidQuoteAssetDecimalsDraft`,void 0),G([P()],$.prototype,`federationPaidQuoteCurrencyDraft`,void 0),G([P()],$.prototype,`federationPaidQuoteChainDraft`,void 0),G([P()],$.prototype,`federationPaidQuoteAssetKindDraft`,void 0),G([P()],$.prototype,`federationPaidQuoteAssetAddressDraft`,void 0),G([P()],$.prototype,`federationPaidQuotePayeeAddressDraft`,void 0),G([P()],$.prototype,`federationPaidQuoteExpiresMinutesDraft`,void 0),G([P()],$.prototype,`federationReviewRatingDraft`,void 0),G([P()],$.prototype,`federationReviewOutcomeDraft`,void 0),G([P()],$.prototype,`federationReviewPaymentStatusDraft`,void 0),G([P()],$.prototype,`federationReviewInvoiceIdDraft`,void 0),G([P()],$.prototype,`federationReviewReceiptIdDraft`,void 0),G([P()],$.prototype,`federationReviewSummaryDraft`,void 0),G([P()],$.prototype,`federationDisputeReasonCodeDraft`,void 0),G([P()],$.prototype,`federationDisputePaymentStatusDraft`,void 0),G([P()],$.prototype,`federationDisputeInvoiceIdDraft`,void 0),G([P()],$.prototype,`federationDisputeReceiptIdDraft`,void 0),G([P()],$.prototype,`federationDisputeSummaryDraft`,void 0),G([P()],$.prototype,`federationOperatorDisputesLoading`,void 0),G([P()],$.prototype,`federationOperatorDisputesError`,void 0),G([P()],$.prototype,`federationOperatorDisputes`,void 0),G([P()],$.prototype,`federationOperatorDisputeProviderFilter`,void 0),G([P()],$.prototype,`federationOperatorDisputeOfferIdFilter`,void 0),G([P()],$.prototype,`federationOperatorDisputeStatusFilter`,void 0),G([P()],$.prototype,`federationOperatorDisputePaymentStatusFilter`,void 0),G([P()],$.prototype,`federationOperatorSelectedCaseId`,void 0),G([P()],$.prototype,`federationOperatorDisputeReviewStatusDraft`,void 0),G([P()],$.prototype,`federationOperatorDisputeResolutionDraft`,void 0),G([P()],$.prototype,`federationOperatorDisputeReviewBusy`,void 0),G([P()],$.prototype,`federationOperatorDisputeReviewError`,void 0),G([P()],$.prototype,`federationOperatorDisputeReviewMessage`,void 0),G([P()],$.prototype,`federationDisputeNotaryRecordsLoading`,void 0),G([P()],$.prototype,`federationDisputeNotaryRecordsError`,void 0),G([P()],$.prototype,`federationDisputeNotaryRecords`,void 0),G([P()],$.prototype,`federationDisputeNotaryOpinionDraft`,void 0),G([P()],$.prototype,`federationDisputeNotaryConfidenceDraft`,void 0),G([P()],$.prototype,`federationDisputeNotaryRecommendedResolutionDraft`,void 0),G([P()],$.prototype,`federationDisputeNotarySummaryDraft`,void 0),G([P()],$.prototype,`federationDisputeNotaryBusy`,void 0),G([P()],$.prototype,`federationDisputeNotaryError`,void 0),G([P()],$.prototype,`federationDisputeNotaryMessage`,void 0),G([P()],$.prototype,`walletLoading`,void 0),G([P()],$.prototype,`walletError`,void 0),G([P()],$.prototype,`walletStatus`,void 0),G([P()],$.prototype,`walletCustodyByWalletId`,void 0),G([P()],$.prototype,`walletBalancesLoading`,void 0),G([P()],$.prototype,`walletBalancesError`,void 0),G([P()],$.prototype,`walletBalances`,void 0),G([P()],$.prototype,`miningLoading`,void 0),G([P()],$.prototype,`miningSaving`,void 0),G([P()],$.prototype,`miningActionBusy`,void 0),G([P()],$.prototype,`miningCapitalActionBusy`,void 0),G([P()],$.prototype,`miningPendingAction`,void 0),G([P()],$.prototype,`miningError`,void 0),G([P()],$.prototype,`miningMessage`,void 0),G([P()],$.prototype,`miningWallets`,void 0),G([P()],$.prototype,`miningAttachedWalletId`,void 0),G([P()],$.prototype,`miningProfile`,void 0),G([P()],$.prototype,`miningSavedProfiles`,void 0),G([P()],$.prototype,`miningSelectedSavedProfileId`,void 0),G([P()],$.prototype,`miningSaveProfileName`,void 0),G([P()],$.prototype,`miningCapitalDepositDraft`,void 0),G([P()],$.prototype,`miningCapitalWithdrawDraft`,void 0),G([P()],$.prototype,`miningReadiness`,void 0),G([P()],$.prototype,`miningStatus`,void 0),G([P()],$.prototype,`miningMainnetSync`,void 0),G([P()],$.prototype,`miningMainnetSyncBusy`,void 0),G([P()],$.prototype,`miningHistoryLoading`,void 0),G([P()],$.prototype,`miningHistoryError`,void 0),G([P()],$.prototype,`miningHistory`,void 0),G([P()],$.prototype,`miningRecovery`,void 0),G([P()],$.prototype,`miningRecoveryDisputeAuthority`,void 0),G([P()],$.prototype,`miningRecoveryTargetAuthority`,void 0),G([P()],$.prototype,`miningRecoveryEpochId`,void 0),G([P()],$.prototype,`miningRecoveryMicroRoundId`,void 0),G([P()],$.prototype,`miningRecoveryStatusFlag`,void 0),G([P()],$.prototype,`miningRecoveryBoardRoot`,void 0),G([P()],$.prototype,`miningRecoveryScoreRoot`,void 0),G([P()],$.prototype,`miningRecoveryCoordinationRoot`,void 0),G([P()],$.prototype,`miningRecoveryDraftRestored`,void 0),G([P()],$.prototype,`miningRecoveryDraftUpdatedAt`,void 0),G([P()],$.prototype,`miningRecoveryDraftSavedHint`,void 0),G([P()],$.prototype,`miningLastNotifiedAction`,void 0),G([P()],$.prototype,`miningNotifications`,void 0),G([P()],$.prototype,`notifications`,void 0),G([P()],$.prototype,`miningConfirmClearHistory`,void 0),G([P()],$.prototype,`miningRecentActionsPage`,void 0),G([P()],$.prototype,`miningHistoryModalOpen`,void 0),G([P()],$.prototype,`miningActivityFilter`,void 0),G([P()],$.prototype,`miningActivityWindow`,void 0),G([P()],$.prototype,`miningPlannerWindow`,void 0),G([P()],$.prototype,`miningChartMetric`,void 0),G([P()],$.prototype,`miningNowMs`,void 0),G([P()],$.prototype,`walletSettingsLoading`,void 0),G([P()],$.prototype,`walletSettingsBusy`,void 0),G([P()],$.prototype,`walletSettingsError`,void 0),G([P()],$.prototype,`walletSettingsMessage`,void 0),G([P()],$.prototype,`walletSettings`,void 0),G([P()],$.prototype,`walletSettingsValidation`,void 0),G([P()],$.prototype,`walletSkillGrantsLoading`,void 0),G([P()],$.prototype,`walletSkillGrantsError`,void 0),G([P()],$.prototype,`walletSkillGrantsMessage`,void 0),G([P()],$.prototype,`walletSkillGrantsWorkspace`,void 0),G([P()],$.prototype,`walletSkillGrantRows`,void 0),G([P()],$.prototype,`walletSkillGrantDraft`,void 0),G([P()],$.prototype,`walletSkillGrantBusy`,void 0),G([P()],$.prototype,`walletProvidersLoading`,void 0),G([P()],$.prototype,`walletProviders`,void 0),G([P()],$.prototype,`walletNamedWallets`,void 0),G([P()],$.prototype,`walletAssignments`,void 0),G([P()],$.prototype,`walletDefaultWalletId`,void 0),G([P()],$.prototype,`walletProviderSelection`,void 0),G([P()],$.prototype,`walletProviderTab`,void 0),G([P()],$.prototype,`walletMainPanel`,void 0),G([P()],$.prototype,`walletDetailsWalletId`,void 0),G([P()],$.prototype,`walletBalanceWalletId`,void 0),G([P()],$.prototype,`walletExpandedPanelWalletId`,void 0),G([P()],$.prototype,`walletExpandedPanel`,void 0),G([P()],$.prototype,`walletPolicyPanel`,void 0),G([P()],$.prototype,`walletCreateName`,void 0),G([P()],$.prototype,`walletCreateId`,void 0),G([P()],$.prototype,`walletCreateProvider`,void 0),G([P()],$.prototype,`walletAssignAgentId`,void 0),G([P()],$.prototype,`walletAssignWalletId`,void 0),G([P()],$.prototype,`walletRpcChain`,void 0),G([P()],$.prototype,`walletPolicyCapsEnabled`,void 0),G([P()],$.prototype,`walletPolicyAutoEnabled`,void 0),G([P()],$.prototype,`walletPolicySkillsEnabled`,void 0),G([P()],$.prototype,`walletPolicySolMaxPerTx`,void 0),G([P()],$.prototype,`walletPolicySolMaxDaily`,void 0),G([P()],$.prototype,`walletPolicySolanaAllowPrograms`,void 0),G([P()],$.prototype,`walletPolicySolanaTokenCaps`,void 0),G([P()],$.prototype,`walletPolicyTokenCapMint`,void 0),G([P()],$.prototype,`walletPolicyTokenCapDecimals`,void 0),G([P()],$.prototype,`walletPolicyTokenCapMaxPerTx`,void 0),G([P()],$.prototype,`walletPolicyTokenCapMaxDaily`,void 0),G([P()],$.prototype,`walletPolicyTokenSearchQuery`,void 0),G([P()],$.prototype,`walletPolicyTokenSearchLoading`,void 0),G([P()],$.prototype,`walletPolicyTokenSearchError`,void 0),G([P()],$.prototype,`walletPolicyTokenSearchResults`,void 0),G([P()],$.prototype,`walletRecurringTransferEnabled`,void 0),G([P()],$.prototype,`walletRecurringTransferDestination`,void 0),G([P()],$.prototype,`walletRecurringTransferMint`,void 0),G([P()],$.prototype,`walletRecurringTransferAmountMode`,void 0),G([P()],$.prototype,`walletRecurringTransferAmount`,void 0),G([P()],$.prototype,`walletRecurringTransferPercentage`,void 0),G([P()],$.prototype,`walletRecurringTransferMinAmount`,void 0),G([P()],$.prototype,`walletRecurringTransferKeepAmount`,void 0),G([P()],$.prototype,`walletRecurringTransferDecimals`,void 0),G([P()],$.prototype,`walletRecurringTransferCron`,void 0),G([P()],$.prototype,`walletRecurringTransferTz`,void 0),G([P()],$.prototype,`walletRecurringTransferName`,void 0),G([P()],$.prototype,`walletSecuritySetupWalletId`,void 0),G([P()],$.prototype,`walletSecuritySetupRole`,void 0),G([P()],$.prototype,`walletRpcProvider`,void 0),G([P()],$.prototype,`walletRpcApiKey`,void 0),G([P()],$.prototype,`walletRpcUrl`,void 0),G([P()],$.prototype,`walletProviderApiKey`,void 0),G([P()],$.prototype,`walletProviderServerSignerAccessKey`,void 0),G([P()],$.prototype,`walletProviderServerSignerAccountId`,void 0),G([P()],$.prototype,`walletProviderWalletApiBaseUrl`,void 0),G([P()],$.prototype,`walletProviderSignerApiBaseUrl`,void 0),G([P()],$.prototype,`walletProviderDefaultSolanaAddress`,void 0),G([P()],$.prototype,`walletProviderCredentialsJson`,void 0),G([P()],$.prototype,`walletActionBusy`,void 0),G([P()],$.prototype,`walletActionMessage`,void 0),G([P()],$.prototype,`walletApprovalsLoading`,void 0),G([P()],$.prototype,`walletApprovalsBusyId`,void 0),G([P()],$.prototype,`walletApprovalsError`,void 0),G([P()],$.prototype,`walletApprovalsFilter`,void 0),G([P()],$.prototype,`walletApprovals`,void 0),G([P()],$.prototype,`walletAuditLoading`,void 0),G([P()],$.prototype,`walletAuditError`,void 0),G([P()],$.prototype,`walletAuditEntries`,void 0),G([P()],$.prototype,`walletActivityPage`,void 0),G([P()],$.prototype,`walletResetConfirmText`,void 0),G([P()],$.prototype,`walletSendCreateBusy`,void 0),G([P()],$.prototype,`walletSendCreateError`,void 0),G([P()],$.prototype,`walletSendCreateForm`,void 0),G([P()],$.prototype,`walletPasskeyBusy`,void 0),G([P()],$.prototype,`walletPasskeyError`,void 0),G([P()],$.prototype,`walletPasskeyLabel`,void 0),G([P()],$.prototype,`walletCustodyClientCompatibility`,void 0),G([P()],$.prototype,`walletCustodyClientCompatibilityError`,void 0),G([P()],$.prototype,`walletCustodyDeviceShare`,void 0),G([P()],$.prototype,`walletCustodyRecoveryShare`,void 0),G([P()],$.prototype,`walletCustodyRecoveryInput`,void 0),G([P()],$.prototype,`walletCustodyEnrollLabel`,void 0),G([P()],$.prototype,`walletCustodyEnrolledDeviceShare`,void 0),G([P()],$.prototype,`walletCustodyRememberDeviceShare`,void 0),G([P()],$.prototype,`walletCustodyDeviceShareStored`,void 0),G([P()],$.prototype,`walletCustodyUnlockMinutes`,void 0),G([P()],$.prototype,`skillsLoading`,void 0),G([P()],$.prototype,`skillsReport`,void 0),G([P()],$.prototype,`skillsError`,void 0),G([P()],$.prototype,`skillsFilter`,void 0),G([P()],$.prototype,`skillsStatusFilter`,void 0),G([P()],$.prototype,`skillsLibraryPanel`,void 0),G([P()],$.prototype,`skillEdits`,void 0),G([P()],$.prototype,`skillsBusyKey`,void 0),G([P()],$.prototype,`skillMessages`,void 0),G([P()],$.prototype,`skillEnvEdits`,void 0),G([P()],$.prototype,`skillConfigEdits`,void 0),G([P()],$.prototype,`skillCreateOpen`,void 0),G([P()],$.prototype,`skillCreateName`,void 0),G([P()],$.prototype,`skillCreateDescription`,void 0),G([P()],$.prototype,`skillCreateAgentId`,void 0),G([P()],$.prototype,`skillCreateTemplate`,void 0),G([P()],$.prototype,`skillCreateBusy`,void 0),G([P()],$.prototype,`skillCreateError`,void 0),G([P()],$.prototype,`skillEditor`,void 0),G([P()],$.prototype,`skillEditorDraft`,void 0),G([P()],$.prototype,`skillEditorLoading`,void 0),G([P()],$.prototype,`skillEditorSaving`,void 0),G([P()],$.prototype,`skillEditorError`,void 0),G([P()],$.prototype,`skillsDetailKey`,void 0),G([P()],$.prototype,`skillsAttachAgentId`,void 0),G([P()],$.prototype,`clawhubSearchQuery`,void 0),G([P()],$.prototype,`clawhubSearchResults`,void 0),G([P()],$.prototype,`clawhubSearchLoading`,void 0),G([P()],$.prototype,`clawhubSearchError`,void 0),G([P()],$.prototype,`clawhubDetail`,void 0),G([P()],$.prototype,`clawhubDetailSlug`,void 0),G([P()],$.prototype,`clawhubDetailLoading`,void 0),G([P()],$.prototype,`clawhubDetailError`,void 0),G([P()],$.prototype,`clawhubInstallSlug`,void 0),G([P()],$.prototype,`clawhubInstallMessage`,void 0),G([P()],$.prototype,`clawhubReview`,void 0),G([P()],$.prototype,`clawhubReviewLoading`,void 0),G([P()],$.prototype,`clawhubReviewError`,void 0),G([P()],$.prototype,`clawhubInstallTarget`,void 0),G([P()],$.prototype,`pluginsMarketplaceLoading`,void 0),G([P()],$.prototype,`pluginsMarketplaceDetailLoading`,void 0),G([P()],$.prototype,`pluginsMarketplaceError`,void 0),G([P()],$.prototype,`pluginsMarketplaceList`,void 0),G([P()],$.prototype,`pluginsMarketplaceSelectedId`,void 0),G([P()],$.prototype,`pluginsMarketplaceDetail`,void 0),G([P()],$.prototype,`pluginsMarketplaceActionBusy`,void 0),G([P()],$.prototype,`pluginsMarketplaceMessage`,void 0),G([P()],$.prototype,`pluginsMarketplaceRemediation`,void 0),G([P()],$.prototype,`extensionsHooksLoading`,void 0),G([P()],$.prototype,`extensionsHooksError`,void 0),G([P()],$.prototype,`extensionsHooksStatus`,void 0),G([P()],$.prototype,`extensionsHooksBusyKey`,void 0),G([P()],$.prototype,`extensionsHooksMessage`,void 0),G([P()],$.prototype,`memoryLoading`,void 0),G([P()],$.prototype,`memoryError`,void 0),G([P()],$.prototype,`memoryInventory`,void 0),G([P()],$.prototype,`memoryValidation`,void 0),G([P()],$.prototype,`memoryWiki`,void 0),G([P()],$.prototype,`memoryWikiRebuilding`,void 0),G([P()],$.prototype,`memoryWikiError`,void 0),G([P()],$.prototype,`dreamingStatusLoading`,void 0),G([P()],$.prototype,`dreamingStatusError`,void 0),G([P()],$.prototype,`dreamingStatus`,void 0),G([P()],$.prototype,`dreamingModeSaving`,void 0),G([P()],$.prototype,`dreamDiaryLoading`,void 0),G([P()],$.prototype,`dreamDiaryError`,void 0),G([P()],$.prototype,`dreamDiaryPath`,void 0),G([P()],$.prototype,`dreamDiaryContent`,void 0),G([P()],$.prototype,`debugLoading`,void 0),G([P()],$.prototype,`debugStatus`,void 0),G([P()],$.prototype,`debugHealth`,void 0),G([P()],$.prototype,`debugModels`,void 0),G([P()],$.prototype,`debugModelCatalogStatus`,void 0),G([P()],$.prototype,`debugCommandsCatalog`,void 0),G([P()],$.prototype,`debugUpdateStatus`,void 0),G([P()],$.prototype,`debugPluginsMarketplace`,void 0),G([P()],$.prototype,`debugDiagnosticsStability`,void 0),G([P()],$.prototype,`debugMemoryInventory`,void 0),G([P()],$.prototype,`debugMemoryValidation`,void 0),G([P()],$.prototype,`debugMemoryRepairPreview`,void 0),G([P()],$.prototype,`debugHeartbeat`,void 0),G([P()],$.prototype,`debugCallMethod`,void 0),G([P()],$.prototype,`debugCallParams`,void 0),G([P()],$.prototype,`debugCallResult`,void 0),G([P()],$.prototype,`debugCallError`,void 0),G([P()],$.prototype,`debugAdminRpcBusy`,void 0),G([P()],$.prototype,`debugAdminRpcResult`,void 0),G([P()],$.prototype,`debugAdminRpcError`,void 0),G([P()],$.prototype,`debugAdminChatSessionKey`,void 0),G([P()],$.prototype,`debugAdminChatMessage`,void 0),G([P()],$.prototype,`debugAdminPushNodeId`,void 0),G([P()],$.prototype,`debugAdminPushTitle`,void 0),G([P()],$.prototype,`debugAdminPushBody`,void 0),G([P()],$.prototype,`debugAdminWebAccountId`,void 0),G([P()],$.prototype,`debugAcpxBridgeConfigBusy`,void 0),G([P()],$.prototype,`debugAcpxBridgeConfigResult`,void 0),G([P()],$.prototype,`debugAcpxBridgeConfigError`,void 0),G([P()],$.prototype,`debugAcpxPushTestBusy`,void 0),G([P()],$.prototype,`debugAcpxPushTestPreview`,void 0),G([P()],$.prototype,`debugAcpxPushTestAuditHistory`,void 0),G([P()],$.prototype,`debugAcpxPushTestResult`,void 0),G([P()],$.prototype,`debugAcpxPushTestError`,void 0),G([P()],$.prototype,`debugSatProtocolMaintenanceBusy`,void 0),G([P()],$.prototype,`debugSatProtocolMaintenanceResult`,void 0),G([P()],$.prototype,`debugSatProtocolMaintenanceError`,void 0),G([P()],$.prototype,`logsLoading`,void 0),G([P()],$.prototype,`logsError`,void 0),G([P()],$.prototype,`logsFile`,void 0),G([P()],$.prototype,`logsEntries`,void 0),G([P()],$.prototype,`logsFilterText`,void 0),G([P()],$.prototype,`logsLevelFilters`,void 0),G([P()],$.prototype,`logsAutoFollow`,void 0),G([P()],$.prototype,`logsTruncated`,void 0),G([P()],$.prototype,`logsCursor`,void 0),G([P()],$.prototype,`logsLastFetchAt`,void 0),G([P()],$.prototype,`logsLimit`,void 0),G([P()],$.prototype,`logsMaxBytes`,void 0),G([P()],$.prototype,`logsAtBottom`,void 0),G([P()],$.prototype,`chatNewMessagesBelow`,void 0),$=G([Qe(`fased-app`)],$);
|
|
25508
|
-
//# sourceMappingURL=app-
|
|
25508
|
+
//# sourceMappingURL=app-BXA4gPvN.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./app-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./app-BXA4gPvN.js","./icons-D3-vEvih.js","./open-external-url-DwSiwMPl.js","./marketplace-order-evidence-DkR0ZRHa.js","./mining-commit-R-6nu87p.js","./chat-model-ref-Djkv93yn.js","./task-ledger-source-route-C-yTp0QU.js","./wallet-policy-C3ZS66Rl.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e={"entry-loaded":10,"app-import-start":20,"app-imported":30,"custom-element-defined":40,connected:50,"first-updated":60,rendered:70,"boot-failed":100};function t(t,n){if(typeof window>`u`)return;let r=window.__FASED_CONTROL_UI_BOOT=window.__FASED_CONTROL_UI_BOOT??{},i=e[r.stage]??0;e[t]<i&&r.stage!==`boot-failed`||(r.stage=t,r.detail=n??``,r.updatedAt=Date.now(),typeof r.mark==`function`&&r.mark(t,n),typeof window.dispatchEvent==`function`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(`fased-control-ui-boot`,{detail:{stage:t,detail:n??``}})))}var n=`modulepreload`,r=function(e,t){return new URL(e,t).href},i={},a=function(e,t,a){let o=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function u(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}o=l(t.map(t=>{if(t=r(t,a),t=u(t),t in i)return;i[t]=!0;let o=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.href===t&&(!o||r.rel===`stylesheet`))return}let s=document.createElement(`link`);if(s.rel=o?`stylesheet`:n,o||(s.as=`script`),s.crossOrigin=``,s.href=t,c&&s.setAttribute(`nonce`,c),document.head.appendChild(s),o)return new Promise((e,n)=>{s.addEventListener(`load`,e),s.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})};function o(e){let n=e instanceof Error?e.stack??e.message:String(e);t(`boot-failed`,n||`Unknown dashboard boot error.`);let r=document.querySelector(`fased-app`);if(!r)return;r.innerHTML=``;let i=document.createElement(`style`);i.textContent=`
|
|
3
3
|
body {
|
|
4
4
|
margin: 0;
|
|
@@ -57,5 +57,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./app-CqF4Tc9n.js","./
|
|
|
57
57
|
font-weight: 650;
|
|
58
58
|
cursor: pointer;
|
|
59
59
|
}
|
|
60
|
-
`;let a=document.createElement(`div`);a.className=`boot-page`;let o=document.createElement(`section`);o.className=`boot-card`;let s=document.createElement(`h1`);s.className=`boot-title`,s.textContent=`Dashboard bundle could not load`;let c=document.createElement(`p`);c.className=`boot-desc`,c.textContent=`The gateway page loaded, but the browser could not start the dashboard bundle. Reload first. If it keeps happening after an update, clear this site's browser data and sign in again.`;let l=document.createElement(`div`);l.className=`boot-error`,l.textContent=n||`Unknown dashboard boot error.`;let u=document.createElement(`button`);u.className=`boot-button`,u.textContent=`Reload`,u.addEventListener(`click`,()=>window.location.reload()),o.append(s,c,l,u),a.append(o),r.append(i,a)}t(`entry-loaded`),t(`app-import-start`),a(()=>import(`./app-
|
|
61
|
-
//# sourceMappingURL=index-
|
|
60
|
+
`;let a=document.createElement(`div`);a.className=`boot-page`;let o=document.createElement(`section`);o.className=`boot-card`;let s=document.createElement(`h1`);s.className=`boot-title`,s.textContent=`Dashboard bundle could not load`;let c=document.createElement(`p`);c.className=`boot-desc`,c.textContent=`The gateway page loaded, but the browser could not start the dashboard bundle. Reload first. If it keeps happening after an update, clear this site's browser data and sign in again.`;let l=document.createElement(`div`);l.className=`boot-error`,l.textContent=n||`Unknown dashboard boot error.`;let u=document.createElement(`button`);u.className=`boot-button`,u.textContent=`Reload`,u.addEventListener(`click`,()=>window.location.reload()),o.append(s,c,l,u),a.append(o),r.append(i,a)}t(`entry-loaded`),t(`app-import-start`),a(()=>import(`./app-BXA4gPvN.js`).then(()=>t(`app-imported`)),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url).catch(o);export{t as n,a as t};
|
|
61
|
+
//# sourceMappingURL=index-D2QbJhVg.js.map
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
|
|
15
15
|
<link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon.png" />
|
|
16
16
|
<script data-fased-boot-watchdog src="./boot-watchdog.js" defer></script>
|
|
17
|
-
<script type="module" crossorigin src="./assets/index-
|
|
17
|
+
<script type="module" crossorigin src="./assets/index-D2QbJhVg.js"></script>
|
|
18
18
|
<link rel="stylesheet" crossorigin href="./assets/index-RwVraC3c.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.1.
|
|
1
|
+
{"version":"0.1.61"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Et as isAudioAttachment, St as normalizeMediaAttachments, Tt as runCapability, bt as buildProviderRegistry, wt as resolveMediaAttachmentLocalRoots, xt as createMediaAttachmentCache } from "./config-schema-
|
|
1
|
+
import { Et as isAudioAttachment, St as normalizeMediaAttachments, Tt as runCapability, bt as buildProviderRegistry, wt as resolveMediaAttachmentLocalRoots, xt as createMediaAttachmentCache } from "./config-schema-CGW6J3Pv.js";
|
|
2
2
|
import "./runtime-Bb6KRnCC.js";
|
|
3
3
|
import "./subsystem-DBPNbQDQ.js";
|
|
4
4
|
import { i as logVerbose, s as shouldLogVerbose } from "./globals-B_jjtAje.js";
|
|
@@ -36,7 +36,7 @@ import "./manager-Y2S_5IlI.js";
|
|
|
36
36
|
import "./query-expansion-CAI2kKLQ.js";
|
|
37
37
|
import "./common-CfUOowOp.js";
|
|
38
38
|
import "./commands-registry-DmDRhRAU.js";
|
|
39
|
-
import "./runtime-dependency-
|
|
39
|
+
import "./runtime-dependency-DLDmB94f.js";
|
|
40
40
|
import "./path-alias-guards-DjgDArrp.js";
|
|
41
41
|
import "./fs-safe-g4g7GT02.js";
|
|
42
42
|
import "./markdown-tables-DHLFQqaF.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as DEFAULT_ACCOUNT_ID, r as normalizeAccountId } from "./session-key--_1zVBRB.js";
|
|
2
2
|
import { Y as ChannelMessageActionContext, n as ChannelPlugin, ut as getChatChannelMeta } from "./types.plugin-_fbu40Re.js";
|
|
3
|
-
import { _ as FasedAgentPluginApi, t as PluginRuntime } from "./types-
|
|
4
|
-
import { a as buildChannelConfigSchema, c as emptyPluginConfigSchema, i as setAccountEnabledInConfigSection, n as formatPairingApproveHint, o as applyAccountNameToChannelSection, r as deleteAccountFromConfigSection, s as migrateBaseNameToDefaultAccount, t as PAIRING_APPROVED_MESSAGE } from "./pairing-message-
|
|
3
|
+
import { _ as FasedAgentPluginApi, t as PluginRuntime } from "./types-BYDL6dQj.js";
|
|
4
|
+
import { a as buildChannelConfigSchema, c as emptyPluginConfigSchema, i as setAccountEnabledInConfigSection, n as formatPairingApproveHint, o as applyAccountNameToChannelSection, r as deleteAccountFromConfigSection, s as migrateBaseNameToDefaultAccount, t as PAIRING_APPROVED_MESSAGE } from "./pairing-message-BMkkS038.js";
|
|
5
5
|
export { type ChannelMessageActionContext, type ChannelPlugin, DEFAULT_ACCOUNT_ID, type FasedAgentPluginApi, PAIRING_APPROVED_MESSAGE, type PluginRuntime, applyAccountNameToChannelSection, buildChannelConfigSchema, deleteAccountFromConfigSection, emptyPluginConfigSchema, formatPairingApproveHint, getChatChannelMeta, migrateBaseNameToDefaultAccount, normalizeAccountId, setAccountEnabledInConfigSection };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ht as buildCommandsMessage, Ut as buildCommandsMessagePaginated, Wt as buildHelpMessage } from "./config-schema-
|
|
1
|
+
import { Ht as buildCommandsMessage, Ut as buildCommandsMessagePaginated, Wt as buildHelpMessage } from "./config-schema-CGW6J3Pv.js";
|
|
2
2
|
import "./runtime-Bb6KRnCC.js";
|
|
3
3
|
import "./subsystem-DBPNbQDQ.js";
|
|
4
4
|
import "./globals-B_jjtAje.js";
|
|
@@ -36,7 +36,7 @@ import "./manager-Y2S_5IlI.js";
|
|
|
36
36
|
import "./query-expansion-CAI2kKLQ.js";
|
|
37
37
|
import "./common-CfUOowOp.js";
|
|
38
38
|
import "./commands-registry-DmDRhRAU.js";
|
|
39
|
-
import "./runtime-dependency-
|
|
39
|
+
import "./runtime-dependency-DLDmB94f.js";
|
|
40
40
|
import "./path-alias-guards-DjgDArrp.js";
|
|
41
41
|
import "./fs-safe-g4g7GT02.js";
|
|
42
42
|
import "./markdown-tables-DHLFQqaF.js";
|