@fased/fased 0.1.57 → 0.1.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/agents/current-model-catalog.js +5 -2
  2. package/dist/agents/model-catalog-status.js +6 -1
  3. package/dist/agents/pi-embedded-runner/session-manager-init.js +5 -20
  4. package/dist/agents/provider-extension-catalog-manifest.js +2 -2
  5. package/dist/brand.js +1 -1
  6. package/dist/build-info.json +3 -3
  7. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  8. package/dist/control-ui/assets/{app-DltSyY4Y.js → app-CpgQGqe6.js} +5 -5
  9. package/dist/control-ui/assets/{index-D5JlBp7f.js → index-DiBBflpv.js} +3 -3
  10. package/dist/control-ui/index.html +1 -1
  11. package/dist/control-ui/version.json +1 -1
  12. package/dist/plugin-sdk/{accounts-CmMwe9Dt.js → accounts-BJuN64m-.js} +1 -1
  13. package/dist/plugin-sdk/{actions-DYViFQiX.js → actions-DaEvM9Bl.js} +2 -2
  14. package/dist/plugin-sdk/{active-listener-DVbpcisf.js → active-listener-B8Kuanet.js} +1 -1
  15. package/dist/plugin-sdk/{audio-preflight-D-Mfay8i.js → audio-preflight-D7tCO0EH.js} +25 -25
  16. package/dist/plugin-sdk/{audit-JImYFOzJ.js → audit-CVWH4BVP.js} +1 -1
  17. package/dist/plugin-sdk/{channel-access-cxCK2mci.js → channel-access-CH9FAS-I.js} +1 -1
  18. package/dist/plugin-sdk/{channel-access-configure-B_qYjml8.js → channel-access-configure-CI0je66H.js} +1 -1
  19. package/dist/plugin-sdk/channel-plugin-common.js +4 -4
  20. package/dist/plugin-sdk/{chunk-CF8nvZNj.js → chunk-01oBnQjh.js} +1 -1
  21. package/dist/plugin-sdk/{chunk-items-yLFoO571.js → chunk-items-D2zDJ8q8.js} +1 -1
  22. package/dist/plugin-sdk/command-status.js +25 -25
  23. package/dist/plugin-sdk/{commands-registry-CK4KmMG0.js → commands-registry-ckg4fhYa.js} +2 -2
  24. package/dist/plugin-sdk/{common-Cky4hpqr.js → common-zHvdO8ly.js} +1 -1
  25. package/dist/plugin-sdk/{config-Dbxj_jUP.js → config-DrhYEiCM.js} +4 -1
  26. package/dist/plugin-sdk/{config-schema-aKPMn6ML.js → config-schema-BtjeV5Hm.js} +76 -85
  27. package/dist/plugin-sdk/discord.d.ts +1 -1
  28. package/dist/plugin-sdk/discord.js +19 -19
  29. package/dist/plugin-sdk/{handle-action-BSNDD2Vc.js → handle-action-5dhYpMbP.js} +13 -13
  30. package/dist/plugin-sdk/{helpers-CDo2XBSr.js → helpers-E9aafRzA.js} +1 -1
  31. package/dist/plugin-sdk/{image-ops-DbeBxbn4.js → image-ops-D2U9ctmu.js} +1 -1
  32. package/dist/plugin-sdk/index.d.ts +11 -11
  33. package/dist/plugin-sdk/index.js +27 -27
  34. package/dist/plugin-sdk/{login-CWXvFTd8.js → login-hql0fNuL.js} +3 -3
  35. package/dist/plugin-sdk/{login-qr-CJB2zjmM.js → login-qr-DJJ0svux.js} +3 -3
  36. package/dist/plugin-sdk/{manager-CbiFFLKS.js → manager-ciNnAMBn.js} +2 -2
  37. package/dist/plugin-sdk/{markdown-tables-Bskt9r8i.js → markdown-tables-BKxbua_h.js} +1 -1
  38. package/dist/plugin-sdk/{media-B3aAg5rh.js → media-DUIZ6x9H.js} +2 -2
  39. package/dist/plugin-sdk/{monitor-BJs6z7AT.js → monitor-CNSGw4uQ.js} +29 -29
  40. package/dist/plugin-sdk/{monitor-BYGbTI5V.js → monitor-D-giXewh.js} +32 -32
  41. package/dist/plugin-sdk/{openresponses-http-BGCl2dS2.js → openresponses-http-dbTd8UMk.js} +25 -25
  42. package/dist/plugin-sdk/{optional-runtime-dependency-BlTVkcAg.js → optional-runtime-dependency-CKsJL1PD.js} +1 -1
  43. package/dist/plugin-sdk/{outbound-CIemga5_.js → outbound-DhGrjRft.js} +6 -6
  44. package/dist/plugin-sdk/{outbound-attachment-2RckWqrk.js → outbound-attachment-DAF8huFz.js} +2 -2
  45. package/dist/plugin-sdk/{pairing-message-r-VQfhFB.js → pairing-message-BsJVvXkb.js} +1 -1
  46. package/dist/plugin-sdk/{pairing-store-uPnLfGgB.js → pairing-store-DwM-BNbj.js} +2 -2
  47. package/dist/plugin-sdk/{pi-model-discovery-BpEilAym.js → pi-model-discovery-DkIdlJvJ.js} +1 -1
  48. package/dist/plugin-sdk/{pi-model-discovery-runtime-DwNdFaz-.js → pi-model-discovery-runtime-Cv7okUMt.js} +2 -2
  49. package/dist/plugin-sdk/{pw-ai-H7UgunQQ.js → pw-ai-Dxd87W3J.js} +3 -3
  50. package/dist/plugin-sdk/{replies-CKMwkH4G.js → replies-Bx61SvAC.js} +2 -2
  51. package/dist/plugin-sdk/{resolve-outbound-target-B68fSoGi.js → resolve-outbound-target-bc-FpPZg.js} +1 -1
  52. package/dist/plugin-sdk/{resolve-route-B8fOfihG.js → resolve-route-D0eBYPtb.js} +1 -1
  53. package/dist/plugin-sdk/{retry-policy-B6GQldxB.js → retry-policy-HTrC4zfC.js} +1 -1
  54. package/dist/plugin-sdk/{runtime-nVJl3PlS.js → runtime-BVkIrYLQ.js} +3 -3
  55. package/dist/plugin-sdk/{runtime-dependency-DlqVSsSs.js → runtime-dependency-B2PqMdBu.js} +11 -11
  56. package/dist/plugin-sdk/sat-runtime.js +25 -25
  57. package/dist/plugin-sdk/{send-D3DQOg2a.js → send-BGDGzxUu.js} +6 -6
  58. package/dist/plugin-sdk/{send-BCJ4hi3t.js → send-C3QWSYLR.js} +8 -8
  59. package/dist/plugin-sdk/{send-hSu1HWms.js → send-DT2egZNK.js} +7 -7
  60. package/dist/plugin-sdk/{send-CPK_HlYW.js → send-DgzZUx2i.js} +5 -5
  61. package/dist/plugin-sdk/{send-BHokB4TR.js → send-KJy3ajA3.js} +6 -6
  62. package/dist/plugin-sdk/{session-DQ4Dr-mf.js → session-BCIEFOu1.js} +2 -2
  63. package/dist/plugin-sdk/{skill-commands-CmdoKLh_.js → skill-commands-CyIkcR8P.js} +2 -2
  64. package/dist/plugin-sdk/{slack-B70NHpMF.js → slack-DjKNh2uh.js} +37 -37
  65. package/dist/plugin-sdk/{slack-actions-fSmP981b.js → slack-actions-CeM9LWDp.js} +11 -11
  66. package/dist/plugin-sdk/slack.d.ts +1 -1
  67. package/dist/plugin-sdk/slack.js +9 -9
  68. package/dist/plugin-sdk/{sticker-cache-B4dG2sKU.js → sticker-cache-DcWzQ2wx.js} +3 -3
  69. package/dist/plugin-sdk/{tables-EX4Hy-a-.js → tables-B2iehyjG.js} +1 -1
  70. package/dist/plugin-sdk/{targets-BeGUCGWK.js → targets-BPket0SF.js} +1 -1
  71. package/dist/plugin-sdk/{telegram-actions-CM8SJgc9.js → telegram-actions-Cx_HWVht.js} +28 -28
  72. package/dist/plugin-sdk/telegram.d.ts +1 -1
  73. package/dist/plugin-sdk/telegram.js +8 -8
  74. package/dist/plugin-sdk/{thread-bindings.lifecycle-tHK_1mvp.js → thread-bindings.lifecycle-CYH69SIw.js} +3 -3
  75. package/dist/plugin-sdk/{thread-bindings.state-D7xG1GHu.js → thread-bindings.state-BN6461WG.js} +2 -2
  76. package/dist/plugin-sdk/{web-BFolfZ3i.js → web-vR-oNiBv.js} +30 -30
  77. package/dist/plugin-sdk/{whatsapp-actions-CYmleHCz.js → whatsapp-actions-BYNf8ceY.js} +13 -13
  78. package/dist/plugin-sdk/{whatsapp-heartbeat-BEwm4GK3.js → whatsapp-heartbeat-DZwa8MF0.js} +2 -2
  79. package/dist/plugin-sdk/whatsapp.d.ts +6 -6
  80. package/dist/plugin-sdk/whatsapp.js +12 -12
  81. package/dist/plugin-sdk/{wsl-BtMDzMv5.js → wsl-WGtdw_6h.js} +3 -3
  82. package/dist/plugin-sdk/{zod-schema.providers-core-FaYR6KdD.d.ts → zod-schema.providers-core-CIzCjXH9.d.ts} +61 -61
  83. package/extensions/acpx/package.json +1 -1
  84. package/extensions/bluebubbles/package.json +1 -1
  85. package/extensions/copilot-proxy/package.json +1 -1
  86. package/extensions/diagnostics-otel/package.json +1 -1
  87. package/extensions/fased-federation/package.json +1 -1
  88. package/extensions/google-gemini-cli-auth/package.json +1 -1
  89. package/extensions/imessage/package.json +1 -1
  90. package/extensions/irc/package.json +1 -1
  91. package/extensions/line/package.json +1 -1
  92. package/extensions/llm-task/package.json +1 -1
  93. package/extensions/lobster/package.json +1 -1
  94. package/extensions/matrix/CHANGELOG.md +6 -0
  95. package/extensions/matrix/package.json +1 -1
  96. package/extensions/mattermost/package.json +1 -1
  97. package/extensions/memory-core/package.json +2 -2
  98. package/extensions/memory-lancedb/package.json +1 -1
  99. package/extensions/minimax-portal-auth/package.json +1 -1
  100. package/extensions/msteams/CHANGELOG.md +6 -0
  101. package/extensions/msteams/package.json +1 -1
  102. package/extensions/nextcloud-talk/package.json +1 -1
  103. package/extensions/nostr/CHANGELOG.md +6 -0
  104. package/extensions/nostr/package.json +1 -1
  105. package/extensions/open-prose/package.json +1 -1
  106. package/extensions/sat-mining/package.json +1 -1
  107. package/extensions/signal/package.json +1 -1
  108. package/extensions/synology-chat/package.json +1 -1
  109. package/extensions/tlon/package.json +1 -1
  110. package/extensions/twitch/CHANGELOG.md +6 -0
  111. package/extensions/twitch/package.json +1 -1
  112. package/extensions/voice-call/CHANGELOG.md +6 -0
  113. package/extensions/voice-call/package.json +1 -1
  114. package/extensions/zalo/CHANGELOG.md +6 -0
  115. package/extensions/zalo/package.json +1 -1
  116. package/extensions/zalouser/CHANGELOG.md +6 -0
  117. package/extensions/zalouser/package.json +1 -1
  118. package/package.json +1 -1
@@ -11,7 +11,7 @@ import { buildCopilotModelDefinition, buildCopilotProxyModelDefinition, getDefau
11
11
  import { CHUTES_BASE_URL, CHUTES_MODEL_CATALOG, buildChutesModelDefinition } from "./chutes-models.js";
12
12
  import { DOUBAO_BASE_URL, DOUBAO_CODING_BASE_URL, DOUBAO_CODING_MODEL_CATALOG, DOUBAO_MODEL_CATALOG, buildDoubaoModelDefinition } from "./doubao-models.js";
13
13
  import "./huggingface-models.js";
14
- import { normalizeProviderCatalogRows } from "./model-catalog-normalized.js";
14
+ import { normalizeModelCatalogProviderId, normalizeProviderCatalogRows } from "./model-catalog-normalized.js";
15
15
  import { getOpencodeZenStaticFallbackModels } from "./opencode-zen-models.js";
16
16
  import "./synthetic-models.js";
17
17
  import "./together-models.js";
@@ -945,6 +945,9 @@ function cloneCurrentModelProvider(provider) {
945
945
  }))
946
946
  };
947
947
  }
948
+ function listCurrentModelCatalogProviderIds() {
949
+ return Object.keys(CURRENT_MODEL_PROVIDER_CATALOG).map(normalizeModelCatalogProviderId).filter(Boolean).toSorted((left, right) => left.localeCompare(right));
950
+ }
948
951
  function listCurrentModelCatalogRows() {
949
952
  return Object.entries(CURRENT_MODEL_PROVIDER_CATALOG).flatMap(([provider, providerConfig]) => normalizeProviderCatalogRows({
950
953
  provider,
@@ -955,4 +958,4 @@ function listCurrentModelCatalogRows() {
955
958
  }
956
959
 
957
960
  //#endregion
958
- export { CURRENT_MODEL_PROVIDER_CATALOG, cloneCurrentModelProvider, listCurrentModelCatalogRows };
961
+ export { CURRENT_MODEL_PROVIDER_CATALOG, cloneCurrentModelProvider, listCurrentModelCatalogProviderIds, listCurrentModelCatalogRows };
@@ -1,4 +1,5 @@
1
1
  import { normalizeProviderId } from "./provider-id.js";
2
+ import { listCurrentModelCatalogProviderIds } from "./current-model-catalog.js";
2
3
  import { deriveModelMetadata } from "./model-metadata.js";
3
4
  import { listProviderExtensionCatalogManifestEntries } from "./provider-extension-catalog-manifest.js";
4
5
 
@@ -137,7 +138,11 @@ function buildModelCatalogStatus(params) {
137
138
  })).toSorted((left, right) => left.provider.localeCompare(right.provider));
138
139
  const manifestEntries = listProviderExtensionCatalogManifestEntries();
139
140
  const mappedManifestProviderIds = [...new Set(manifestEntries.flatMap((entry) => entry.status === "mapped" ? entry.fasedProviderIds.map(normalizeProviderId) : []))].filter(Boolean).toSorted((left, right) => left.localeCompare(right));
140
- const catalogProviderIds = new Set(providerRows.map((provider) => provider.provider));
141
+ const catalogProviderIds = new Set([
142
+ ...listCurrentModelCatalogProviderIds(),
143
+ ...providerRows.map((provider) => provider.provider),
144
+ ...Object.keys(params.providerExtensionCatalog?.providers ?? {}).map(normalizeProviderId)
145
+ ]);
141
146
  const deferredProviderIds = manifestEntries.filter((entry) => entry.status === "deferred").map((entry) => normalizeProviderId(entry.upstreamProviderId)).filter(Boolean).toSorted((left, right) => left.localeCompare(right));
142
147
  const providerExtensionEntries = (params.providerExtensionCatalog?.entries ?? []).map((entry) => ({
143
148
  id: entry.id,
@@ -1,33 +1,18 @@
1
- import fs from "node:fs/promises";
2
-
3
1
  //#region src/agents/pi-embedded-runner/session-manager-init.ts
4
2
  /**
5
- * pi-coding-agent SessionManager persistence quirk:
6
- * - If the file exists but has no assistant message, SessionManager marks itself `flushed=true`
7
- * and will never persist the initial user message.
8
- * - If the file doesn't exist yet, SessionManager builds a new session in memory and flushes
9
- * header+user+assistant once the first assistant arrives (good).
10
- *
11
- * This normalizes the file/session state so the first user prompt is persisted before the first
12
- * assistant entry, even for pre-created session files.
3
+ * Keep Fased's requested identity for new transcripts while leaving existing
4
+ * transcripts under SessionManager's append lifecycle. In particular, an
5
+ * existing header-only file is already marked flushed by SessionManager and
6
+ * must not be truncated or reset to unflushed: its next assistant write uses
7
+ * exclusive creation and would fail with EEXIST.
13
8
  */
14
9
  async function prepareSessionManagerForRun(params) {
15
10
  const sm = params.sessionManager;
16
11
  const header = sm.fileEntries.find((e) => e.type === "session");
17
- const hasAssistant = sm.fileEntries.some((e) => e.type === "message" && e.message?.role === "assistant");
18
12
  if (!params.hadSessionFile && header) {
19
13
  header.id = params.sessionId;
20
14
  header.cwd = params.cwd;
21
15
  sm.sessionId = params.sessionId;
22
- return;
23
- }
24
- if (params.hadSessionFile && header && !hasAssistant) {
25
- await fs.writeFile(params.sessionFile, "", "utf-8");
26
- sm.fileEntries = [header];
27
- sm.byId?.clear?.();
28
- sm.labelsById?.clear?.();
29
- sm.leafId = null;
30
- sm.flushed = false;
31
16
  }
32
17
  }
33
18
 
@@ -56,8 +56,8 @@ const FASED_PROVIDER_EXTENSION_CATALOG_MANIFEST = [
56
56
  upstreamProviderId: "kimi-coding",
57
57
  upstreamCatalogPaths: ["extensions/kimi-coding/provider-catalog.ts"],
58
58
  status: "mapped",
59
- fasedProviderIds: ["kimi"],
60
- fasedProviderAliases: ["kimi-coding", "kimi-code"],
59
+ fasedProviderIds: ["kimi-coding"],
60
+ fasedProviderAliases: ["kimi", "kimi-code"],
61
61
  docsPath: "docs/providers/moonshot.md",
62
62
  authSurface: "api-key",
63
63
  authChoiceIds: ["kimi-code-api-key"]
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.57";
5
+ const FASED_PRODUCT_VERSION = "0.1.58";
6
6
  const FASED_DISPLAY_VERSION = `v${FASED_PRODUCT_VERSION}`;
7
7
  function formatFasedDisplayLine() {
8
8
  return `${FASED_AGENT_NAME} ${FASED_DISPLAY_VERSION}`;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.57",
3
- "commit": "91e53d4b2c1ca02701eff503d93e889ccfaab43d",
4
- "builtAt": "2026-07-13T13:04:23.327Z"
2
+ "version": "0.1.58",
3
+ "commit": "90e7d5c7628e5b40333a1a31d4bfb34a1db9eb74",
4
+ "builtAt": "2026-07-13T14:49:39.632Z"
5
5
  }
@@ -1 +1 @@
1
- bfd05e986c05a91921422f61d2871d036c3e2622a756b89cd75c7ba92ccf4947
1
+ 782c2af6b44d1581a8165b7eb7f8e771312faf6907d2df132f0c72d9d5b0cef6
@@ -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-Cc89iMdx.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-D5JlBp7f.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=Gt(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 F(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;$t(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 Ht(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 F(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 Ut(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 F(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 Wt(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 F(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 Gt(e){return`${e.title??``}\n${e.message??``}`.match(/https?:\/\/\S+/u)?.[0]??null}function Kt(e){let t=e.title?.trim(),n=e.message?.trim();return t&&n?`${t}\n\n${n}`:t||n||`Continue provider sign-in.`}function qt(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 Jt(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=qt(e,t);if(n===void 0)return;i.push(n)}return i}async function Yt(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:Kt(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(Kt(t))};if(t.type===`text`){let e=window.prompt(Kt(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-DiBBflpv.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=Gt(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 F(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;$t(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 Ht(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 F(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 Ut(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 F(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 Wt(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 F(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 Gt(e){return`${e.title??``}\n${e.message??``}`.match(/https?:\/\/\S+/u)?.[0]??null}function Kt(e){let t=e.title?.trim(),n=e.message?.trim();return t&&n?`${t}\n\n${n}`:t||n||`Continue provider sign-in.`}function qt(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 Jt(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=qt(e,t);if(n===void 0)return;i.push(n)}return i}async function Yt(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:Kt(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(Kt(t))};if(t.type===`text`){let e=window.prompt(Kt(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(`${Kt(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=qt(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(`${Kt(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=Jt(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 Xt(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 Yt(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 F(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 Zt(e){if(!(!e.client||!e.connected)&&!e.configSchemaLoading){e.configSchemaLoading=!0;try{Qt(e,await e.client.request(`config.schema`,{}))}catch(t){e.lastError=String(t)}finally{e.configSchemaLoading=!1}}}function Qt(e,t){e.configSchema=t.schema??null,e.configUiHints=t.uiHints??{},e.configSchemaVersion=t.version??null}function $t(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 en(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function tn(e){if(e.configFormMode!==`form`||!e.configForm)return e.configRaw;let t=en(e.configSchema);return Et(t?wt(e.configForm,t):e.configForm)}function nn(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 rn(e){if(!e.client||!e.connected)return null;let t=await e.client.request(`config.get`,{});return $t(e,t),typeof t.hash==`string`&&t.hash.trim()?t.hash:null}async function an(e){if(!(!e.client||!e.connected)){e.configSaving=!0,e.lastError=null;try{let t=tn(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(!nn(n))throw n;let r=await rn(e);if(!r)throw n;await e.client.request(`config.set`,{raw:t,baseHash:r})}e.configFormDirty=!1,await F(e)}catch(t){e.lastError=String(t)}finally{e.configSaving=!1}}}async function on(e){if(!(!e.client||!e.connected)){e.configApplying=!0,e.lastError=null;try{let t=tn(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(!nn(n))throw n;let r=await rn(e);if(!r)throw n;await e.client.request(`config.apply`,{raw:t,baseHash:r,sessionKey:e.applySessionKey})}e.configFormDirty=!1,await F(e)}catch(t){e.lastError=String(t)}finally{e.configApplying=!1}}}function I(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 sn(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 cn(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 ln(e){let{state:t,callbacks:r,accountId:i}=e,a=cn(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-D5JlBp7f.js";import{a as n,c as r,i,l as a,n as o,o
140
140
  `);let r=k_(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 O_(e){if(!e||typeof e!=`object`)return D_(e);let t=e;if(w_.has(t))return w_.get(t)??null;let n=D_(e);return w_.set(t,n),n}function k_(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 A_(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 j_(e){return typeof e==`string`?e:e instanceof Error&&typeof e.message==`string`?e.message:`unknown error`}function M_(e){let t=j_(e.message);switch(Dc(e)){case Go.AUTH_TOKEN_MISMATCH:return`gateway token mismatch`;case Go.AUTH_UNAUTHORIZED:return`gateway auth failed`;case Go.AUTH_RATE_LIMITED:return`too many failed authentication attempts`;case Go.PAIRING_REQUIRED:return`gateway pairing required`;case Go.CONTROL_UI_DEVICE_IDENTITY_REQUIRED:return`device identity required (use HTTPS/localhost or allow insecure auth explicitly)`;case Go.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 Go.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 N_(e){return e&&typeof e==`object`?M_(e):j_(e)}var P_=/^\s*(?:NO_REPLY|ANNOUNCE_SKIP|REPLY_SKIP)\s*$/,F_=new WeakMap;function I_(e){let t=e,n=(F_.get(t)??0)+1;return F_.set(t,n),n}function L_(e,t){return F_.get(e)===t}function R_(e,t,n){return L_(e,t)&&e.sessionKey===n}function z_(e){return P_.test(e)}function B_(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 z_(t.text);let n=T_(e);return typeof n==`string`&&z_(n)}function V_(e){let t=e;t.toolStreamById instanceof Map&&Array.isArray(t.toolStreamOrder)&&Array.isArray(t.chatToolMessages)&&Array.isArray(t.chatStreamSegments)&&r_(t)}async function H_(e){if(!e.client||!e.connected)return;let t=e.sessionKey,n=I_(e);e.chatLoading=!0,e.lastError=null;try{let r=await e.client.request(`chat.history`,{sessionKey:t,limit:200});if(!R_(e,n,t))return;e.chatMessages=(Array.isArray(r.messages)?r.messages:[]).filter(e=>!B_(e)),e.chatThinkingLevel=r.thinkingLevel??null,V_(e),e.chatStream=null,e.chatStreamStartedAt=null}catch(r){if(!R_(e,n,t))return;Pc(r)?(e.chatMessages=[],e.chatThinkingLevel=null,e.lastError=Fc(`existing chat history`)):e.lastError=String(r)}finally{L_(e,n)&&(e.chatLoading=!1)}}async function U_(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 W_(e){let t=/^data:([^;]+);base64,(.+)$/.exec(e);return t?{mimeType:t[1],content:t[2]}:null}function G_(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 K_(e){return G_(e,{roleRequirement:`required`,roleCaseSensitive:!0,requireContentArray:!0})}function q_(e){return G_(e,{roleRequirement:`optional`,allowTextField:!0})}function J_(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 Y_(e,t){let n=J_(t),r=e.chatMessages.at(-1);(r?T_(r):null)!==n&&(e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:n}],timestamp:Date.now()}])}async function X_(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=Tc();e.chatRunId=l,e.chatStream=``,e.chatStreamStartedAt=s;let u=o?i.map(e=>{let t=W_(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=N_(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 Z_(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=N_(t),!1}}function Q_(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&&!B_(n)?(e.chatMessages=[...e.chatMessages,n],null):`final`}return null}if(t.state===`delta`){let n=T_(t.message);typeof n==`string`&&!z_(n)&&(e.chatStream=n)}else if(t.state===`final`){let n=q_(t.message);n&&!B_(n)?e.chatMessages=[...e.chatMessages,n]:e.chatStream?.trim()&&!z_(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=K_(t.message);if(n&&!B_(n))e.chatMessages=[...e.chatMessages,n];else{let t=e.chatStream??``;t.trim()&&!z_(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=J_(t.errorMessage),Y_(e,t.errorMessage));return t.state}function $_(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 ev(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 tv(e){if(!e||typeof e!=`object`||Array.isArray(e))return``;let t=e.role;return typeof t==`string`?t:``}function nv(e,t){if(!e||!t)return!1;let n=tv(e),r=tv(t);if(n&&r&&n!==r)return!1;let i=T_(e),a=T_(t);return typeof i==`string`&&i.length>0&&i===a}function rv(e){let t=(e??``).trim().toLowerCase();return rd(t)?.rest??t}function iv(e,t){if(!t||rv(t.sessionKey)!==rv(e.sessionKey)||e.chatRunId)return!1;let n=$_(t);if(!n||B_(n))return!1;let r=ev(n);return r&&e.chatMessages.some(e=>ev(e)===r)||nv(e.chatMessages.at(-1),n)?!1:(e.chatMessages=[...e.chatMessages,n],!0)}var av=new WeakMap;function ov(e){return e.chatSending||!!e.chatRunId}function sv(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 cv(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 lv(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 uv(e){e.connected&&(e.chatMessage=``,await Z_(e))}function dv(e,t,n,r){let i=t.trim(),a=!!(n&&n.length>0);!i&&!a||(e.chatQueue=[...e.chatQueue,{id:Tc(),text:i,createdAt:Date.now(),attachments:a?n?.map(e=>({...e})):void 0,refreshSessions:r}])}async function fv(e,t,n){r_(e);let r=e.settings?.chatDeliveryMode===`channel`&&lv(e)?`channel`:`operator`,i=await X_(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&&Sg(e,e.sessionKey),a&&n?.restoreDraft&&n.previousDraft?.trim()&&(e.chatMessage=n.previousDraft),a&&n?.restoreAttachments&&n.previousAttachments?.length&&(e.chatAttachments=n.previousAttachments),Ln(e),a&&!e.chatRunId&&pv(e),a&&n?.refreshSessions&&i&&e.refreshSessionsAfterChat.add(i),a}async function pv(e){if(!e.connected||ov(e))return;let[t,...n]=e.chatQueue;t&&(e.chatQueue=n,await fv(e,t.text,{attachments:t.attachments,refreshSessions:t.refreshSessions})||(e.chatQueue=[t,...e.chatQueue]))}async function mv(e){let t=e.chatModelPatchPending;t&&await t.catch(()=>void 0)}function hv(e){let t=e.replace(/\s+/g,` `).trim();return!t||t.startsWith(`/`)?null:(t.length>64?`${t.slice(0,61).trimEnd()}...`:t)||null}function gv(e){let t=e?.trim()??``;return!t||/^(?:local\s+)?chat\s+\d+$/i.test(t)}function _v(e){if(!Pn(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 gv(t?.label?.trim()||t?.displayName?.trim()||``)}async function vv(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 yv(e,t){e.chatQueue=e.chatQueue.filter(e=>e.id!==t)}function bv(e,t){t&&(e.chatQueue=e.chatQueue.filter(e=>e.pendingRunId!==t))}async function xv(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(sv(i)){await uv(e);return}if(await mv(e),!e.connected)return;let c=cv(i),l=_v(e)?hv(i):null;if(t??(e.chatMessage=``,e.chatAttachments=[]),ov(e)){dv(e,i,o,c);return}await fv(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 vv(e,l)}async function Sv(e,t){await Promise.all([H_(e),U_(e),mm(e,{activeMinutes:120}),Ov(e)]),t?.scheduleScroll!==!1&&Ln(e)}var Cv=pv;function wv(e){let t=e,n=(av.get(t)??0)+1;return av.set(t,n),n}function Tv(e,t,n){return av.get(e)===t&&e.sessionKey===n}function Ev(e){let t=Pn(e.sessionKey);return t?.agentId?t.agentId:(e.hello?.snapshot)?.sessionDefaults?.defaultAgentId?.trim()||`main`}function Dv(e,t){let n=g(e),r=encodeURIComponent(t);return n?`${n}/avatar/${r}?meta=1`:`/avatar/${r}?meta=1`}async function Ov(e){if(!e.connected){e.chatAvatarUrl=null;return}let t=e.sessionKey,n=wv(e),r=Ev(e);if(!r){Tv(e,n,t)&&(e.chatAvatarUrl=null);return}e.chatAvatarUrl=null;let i=Dv(e.basePath,r);try{let r=await fetch(i,{method:`GET`});if(!Tv(e,n,t))return;if(!r.ok){e.chatAvatarUrl=null;return}let a=await r.json();if(!Tv(e,n,t))return;e.chatAvatarUrl=(typeof a.avatarUrl==`string`?a.avatarUrl.trim():``)||null}catch{Tv(e,n,t)&&(e.chatAvatarUrl=null)}}var kv=`0.1.57`;function Av(e,t=kv){let n=e?.trim(),r=t.trim();return!!(n&&r&&r!==`dev`&&n!==r)}function jv(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 Mv=50,Nv=200;function Pv(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n)return n.length<=t?n:n.slice(0,t)}function Fv(e){let t=Pv(e?.name,Mv)??`Assistant`,n=Pv(e?.avatar??void 0,Nv)??null;return{agentId:typeof e?.agentId==`string`&&e.agentId.trim()?e.agentId.trim():null,name:t,avatar:n}}function Iv(){let e=window.__FASED_INJECTED_IDENTITY__;return Fv(e)}async function Lv(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=Fv(t);e.assistantName=n.name,e.assistantAvatar=n.avatar,e.assistantAgentId=n.agentId??null}catch{}}function Rv(e){return typeof e==`object`&&!!e}function zv(e){if(!Rv(e))return null;let t=typeof e.id==`string`?e.id.trim():``,n=e.request;if(!t||!Rv(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 Bv(e){if(!Rv(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 Vv(e){if(!Rv(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=Rv(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 Hv(e){let t=Date.now();return e.filter(e=>e.expiresAtMs>t)}function Uv(e,t){let n=Hv(e).filter(e=>e.id!==t.id);return n.unshift(t),n}function Wv(e,t){return Hv(e).filter(e=>e.id!==t)}function Gv(e){return/^(?:typeerror:\s*)?(?:fetch failed|failed to fetch)$/i.test(e.trim())}function Kv(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 Jv(e,t,n=e.client){qv(e),e.restartReconnectTimer=globalThis.setTimeout(()=>{e.restartReconnectTimer=null,!e.connected&&(!n||e.client!==n||Qv(e))},Math.max(250,Math.floor(t)))}function Yv(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 Xv(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 Zv(e,t){if(!t?.mainSessionKey)return;let n=Xv(e.sessionKey,t),r=Xv(e.settings.sessionKey,t),i=Xv(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&&xg(e,o)}function Qv(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=Hv(e.execApprovalQueue),bv(e,e.chatRunId??void 0),n.resumeChatQueueAfterReconnect=!0):e.execApprovalQueue=Hv(e.execApprovalQueue),e.execApprovalError=null;let i=e.client,a=Yv({gatewayUrl:e.settings.gatewayUrl,uiVersion:kv}),o=new Nc({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:Xo.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&&Av(e.serverVersion)){e.uiRuntimeError=`Dashboard build ${kv} does not match gateway ${e.serverVersion}. Run fased update, restart the gateway, and reload this page.`,o.stop();return}ry(e,t),e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,r_(e),n.resumeChatQueueAfterReconnect&&(n.resumeChatQueueAfterReconnect=!1,Cv(e)),cm(e),lm(e),Lv(e),cd(e),Tu(e,{quiet:!0}),ap(e,{quiet:!0}),Dg(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=Dc(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&&Gv(i.message)?N_({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&&Jv(n,1750,o)}},onEvent:t=>{e.client===o&&$v(e,t)},onGap:({expected:t,received:n})=>{e.client===o&&(e.lastError=`event gap detected (expected seq ${t}, got ${n}); reconnecting`,e.lastErrorCode=null,Qv(e,{reason:`seq-gap`}))}});e.client=o,i?.stop(),o.start()}function $v(e,t){try{ny(e,t)}catch(e){console.error(`[gateway] handleGatewayEvent error:`,t.event,e)}}function ey(e,t,n){if(n!==`final`&&n!==`error`&&n!==`aborted`)return!1;let r=e.toolStreamOrder.length>0;r_(e),bv(e,t?.runId),Cv(e);let i=t?.runId;return i&&e.refreshSessionsAfterChat.has(i)&&(e.refreshSessionsAfterChat.delete(i),n===`final`&&mm(e,{activeMinutes:120})),r&&n===`final`?(H_(e),!0):!1}function ty(e,t){t?.sessionKey&&Sg(e,t.sessionKey);let n=Q_(e,t),r=ey(e,t,n);n===`final`&&!r&&jv(t)&&H_(e)}function ny(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;p_(e,t.payload);return}if(t.event===`chat`){ty(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&&ou(e,n))&&r&&e.tab===`mining`&&eu(e,{quiet:!0});return}if(t.event===`cron`&&e.tab===`cron`){Hg(e);return}if(t.event===`sessions.changed`){e.sessionsLastEventAt=Kv(t.payload),pm(e,t.payload)||mm(e);return}if(t.event===`session.message`){e.sessionMessageLastEventAt=Kv(t.payload),iv(e,t.payload)&&Ln(e);return}if(t.event===`device.pair.requested`||t.event===`device.pair.resolved`){ap(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,Jv(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=zv(t.payload);if(n){e.execApprovalQueue=Uv(e.execApprovalQueue,n),e.execApprovalError=null;let t=Math.max(0,n.expiresAtMs-Date.now()+500);globalThis.setTimeout(()=>{e.execApprovalQueue=Wv(e.execApprovalQueue,n.id)},t)}return}if(t.event===`exec.approval.resolved`){let n=Bv(t.payload);n&&(e.execApprovalQueue=Wv(e.execApprovalQueue,n.id));return}if(t.event===`plugin.approval.requested`){let n=Vv(t.payload);if(n){e.execApprovalQueue=Uv(e.execApprovalQueue,n),e.execApprovalError=null;let t=Math.max(0,n.expiresAtMs-Date.now()+500);globalThis.setTimeout(()=>{e.execApprovalQueue=Wv(e.execApprovalQueue,n.id)},t)}return}if(t.event===`plugin.approval.resolved`){let n=Bv(t.payload);n&&(e.execApprovalQueue=Wv(e.execApprovalQueue,n.id))}}function ry(e,t){let n=t.snapshot;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence),n?.health&&(e.debugHealth=n.health),n?.sessionDefaults&&Zv(e,n.sessionDefaults),e.federationManagedMode=n?.gatewayMode===`managed`}var iy=`/__fased/control-ui-config.json`;async function ay(e){if(typeof window>`u`||typeof fetch!=`function`)return;let t=g(e.basePath??``),n=t?`${t}${iy}`:iy;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&&Av(e.serverVersion)&&(e.uiRuntimeError=`Dashboard build ${kv} does not match gateway ${e.serverVersion}. Run fased update, restart the gateway, and reload this page.`);let i=Fv({name:r.assistantName,avatar:r.assistantAvatar??null});e.assistantName=i.name,e.assistantAvatar=i.avatar}catch{}}function oy(e){e.basePath=kg(),e.authBootstrapPending=!0;let t=ay(e);Pg(e,!0),Ag(e),Mg(e),window.addEventListener(`popstate`,e.popStateHandler),Promise.all([t,Cg(e)]).then(()=>{e.authBootstrapPending=!1,e.settings.token.trim()&&!e.client&&Qv(e)},()=>{e.authBootstrapPending=!1}),Mu(e),e.tab===`logs`&&Pu(e),e.tab===`debug`&&Iu(e),(e.tab===`federation`||e.tab===`marketplace`)&&Ru(e),e.tab===`mining`&&Bu(e)}function sy(e){Un(e)}function cy(e){window.removeEventListener(`popstate`,e.popStateHandler),Nu(e),Fu(e),Lu(e),zu(e),Vu(e),e.client?.stop(),e.client=null,e.connected=!1,Ng(e),e.topbarObserver?.disconnect(),e.topbarObserver=null}function ly(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;Ln(e,n||r||!e.chatHasAutoScrolled)}e.tab===`logs`&&(t.has(`logsEntries`)||t.has(`logsAutoFollow`)||t.has(`tab`))&&e.logsAutoFollow&&e.logsAtBottom&&Rn(e,t.has(`tab`)||t.has(`logsAutoFollow`))}}var uy=`Fased`,dy=`Fased Agent`;function fy(e){if(Array.isArray(e))return e.map(e=>typeof e==`string`?e.trim():``).filter(Boolean).slice(0,1)}function py(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 my=`Assistant`;function hy(e){return e.split(/[-_]+/).filter(Boolean).map(e=>`${e.slice(0,1).toUpperCase()}${e.slice(1)}`).join(` `)}function gy(e){return(e??``).trim().toLowerCase()===`main`}function _y(e){let t=e.id.trim(),n=t.toLowerCase(),r=e.identity?.name?.trim()||e.name?.trim()||``;return r&&r.toLowerCase()!==n?r:gy(t)?my:hy(t)||t}function vy(e){let t=e.id.trim(),n=_y(e);return gy(t)?n:n&&n!==t?`${n} (${t})`:t}var yy=new Set([`agent`,`channel`,`chat`,`provider`,`model`,`source`,`tool`,`label`,`key`,`session`,`id`,`has`,`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`]),by=e=>e.trim().toLowerCase(),xy=e=>{let t=e.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`).replace(/\?/g,`.`);return RegExp(`^${t}$`,`i`)},Sy=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},Cy=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}}),wy=e=>[e.label,e.key,e.sessionId].filter(e=>!!e).map(e=>e.toLowerCase()),Ty=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)},Ey=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)},Dy=e=>(e.usage?.toolUsage?.tools??[]).map(e=>e.name.toLowerCase()),Oy=(e,t)=>{let n=by(t.value??``);if(!n)return!0;if(!t.key)return wy(e).some(e=>e.includes(n));switch(by(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 Ty(e).some(e=>e.includes(n));case`model`:return Ey(e).some(e=>e.includes(n));case`source`:return e.source?.toLowerCase().includes(n)??!1;case`tool`:return Dy(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=xy(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 Ey(e).length>0;case`provider`:return Ty(e).length>0;default:return!0}case`mintokens`:{let t=Sy(n);return t===null?!0:(e.usage?.totalTokens??0)>=t}case`maxtokens`:{let t=Sy(n);return t===null?!0:(e.usage?.totalTokens??0)<=t}case`mincost`:{let t=Sy(n);return t===null?!0:(e.usage?.totalCost??0)>=t}case`maxcost`:{let t=Sy(n);return t===null?!0:(e.usage?.totalCost??0)<=t}case`minmessages`:{let t=Sy(n);return t===null?!0:(e.usage?.messageCounts?.total??0)>=t}case`maxmessages`:{let t=Sy(n);return t===null?!0:(e.usage?.messageCounts?.total??0)<=t}default:return!0}},ky=(e,t)=>{let n=Cy(t);if(n.length===0)return{sessions:e,warnings:[]};let r=[];for(let e of n){if(!e.key)continue;let t=by(e.key);if(!yy.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(by(e.value))&&r.push(`Unknown has:${e.value}`)}[`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`].includes(t)&&e.value&&Sy(e.value)===null&&r.push(`Invalid number for ${e.key}`)}return{sessions:e.filter(e=>n.every(t=>Oy(e,t))),warnings:r}};function Ay(e){let t=e.split(`
143
+ `):``}function j_(e){return typeof e==`string`?e:e instanceof Error&&typeof e.message==`string`?e.message:`unknown error`}function M_(e){let t=j_(e.message);switch(Dc(e)){case Go.AUTH_TOKEN_MISMATCH:return`gateway token mismatch`;case Go.AUTH_UNAUTHORIZED:return`gateway auth failed`;case Go.AUTH_RATE_LIMITED:return`too many failed authentication attempts`;case Go.PAIRING_REQUIRED:return`gateway pairing required`;case Go.CONTROL_UI_DEVICE_IDENTITY_REQUIRED:return`device identity required (use HTTPS/localhost or allow insecure auth explicitly)`;case Go.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 Go.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 N_(e){return e&&typeof e==`object`?M_(e):j_(e)}var P_=/^\s*(?:NO_REPLY|ANNOUNCE_SKIP|REPLY_SKIP)\s*$/,F_=new WeakMap;function I_(e){let t=e,n=(F_.get(t)??0)+1;return F_.set(t,n),n}function L_(e,t){return F_.get(e)===t}function R_(e,t,n){return L_(e,t)&&e.sessionKey===n}function z_(e){return P_.test(e)}function B_(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 z_(t.text);let n=T_(e);return typeof n==`string`&&z_(n)}function V_(e){let t=e;t.toolStreamById instanceof Map&&Array.isArray(t.toolStreamOrder)&&Array.isArray(t.chatToolMessages)&&Array.isArray(t.chatStreamSegments)&&r_(t)}async function H_(e){if(!e.client||!e.connected)return;let t=e.sessionKey,n=I_(e);e.chatLoading=!0,e.lastError=null;try{let r=await e.client.request(`chat.history`,{sessionKey:t,limit:200});if(!R_(e,n,t))return;e.chatMessages=(Array.isArray(r.messages)?r.messages:[]).filter(e=>!B_(e)),e.chatThinkingLevel=r.thinkingLevel??null,V_(e),e.chatStream=null,e.chatStreamStartedAt=null}catch(r){if(!R_(e,n,t))return;Pc(r)?(e.chatMessages=[],e.chatThinkingLevel=null,e.lastError=Fc(`existing chat history`)):e.lastError=String(r)}finally{L_(e,n)&&(e.chatLoading=!1)}}async function U_(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 W_(e){let t=/^data:([^;]+);base64,(.+)$/.exec(e);return t?{mimeType:t[1],content:t[2]}:null}function G_(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 K_(e){return G_(e,{roleRequirement:`required`,roleCaseSensitive:!0,requireContentArray:!0})}function q_(e){return G_(e,{roleRequirement:`optional`,allowTextField:!0})}function J_(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 Y_(e,t){let n=J_(t),r=e.chatMessages.at(-1);(r?T_(r):null)!==n&&(e.chatMessages=[...e.chatMessages,{role:`assistant`,content:[{type:`text`,text:n}],timestamp:Date.now()}])}async function X_(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=Tc();e.chatRunId=l,e.chatStream=``,e.chatStreamStartedAt=s;let u=o?i.map(e=>{let t=W_(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=N_(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 Z_(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=N_(t),!1}}function Q_(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&&!B_(n)?(e.chatMessages=[...e.chatMessages,n],null):`final`}return null}if(t.state===`delta`){let n=T_(t.message);typeof n==`string`&&!z_(n)&&(e.chatStream=n)}else if(t.state===`final`){let n=q_(t.message);n&&!B_(n)?e.chatMessages=[...e.chatMessages,n]:e.chatStream?.trim()&&!z_(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=K_(t.message);if(n&&!B_(n))e.chatMessages=[...e.chatMessages,n];else{let t=e.chatStream??``;t.trim()&&!z_(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=J_(t.errorMessage),Y_(e,t.errorMessage));return t.state}function $_(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 ev(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 tv(e){if(!e||typeof e!=`object`||Array.isArray(e))return``;let t=e.role;return typeof t==`string`?t:``}function nv(e,t){if(!e||!t)return!1;let n=tv(e),r=tv(t);if(n&&r&&n!==r)return!1;let i=T_(e),a=T_(t);return typeof i==`string`&&i.length>0&&i===a}function rv(e){let t=(e??``).trim().toLowerCase();return rd(t)?.rest??t}function iv(e,t){if(!t||rv(t.sessionKey)!==rv(e.sessionKey)||e.chatRunId)return!1;let n=$_(t);if(!n||B_(n))return!1;let r=ev(n);return r&&e.chatMessages.some(e=>ev(e)===r)||nv(e.chatMessages.at(-1),n)?!1:(e.chatMessages=[...e.chatMessages,n],!0)}var av=new WeakMap;function ov(e){return e.chatSending||!!e.chatRunId}function sv(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 cv(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 lv(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 uv(e){e.connected&&(e.chatMessage=``,await Z_(e))}function dv(e,t,n,r){let i=t.trim(),a=!!(n&&n.length>0);!i&&!a||(e.chatQueue=[...e.chatQueue,{id:Tc(),text:i,createdAt:Date.now(),attachments:a?n?.map(e=>({...e})):void 0,refreshSessions:r}])}async function fv(e,t,n){r_(e);let r=e.settings?.chatDeliveryMode===`channel`&&lv(e)?`channel`:`operator`,i=await X_(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&&Sg(e,e.sessionKey),a&&n?.restoreDraft&&n.previousDraft?.trim()&&(e.chatMessage=n.previousDraft),a&&n?.restoreAttachments&&n.previousAttachments?.length&&(e.chatAttachments=n.previousAttachments),Ln(e),a&&!e.chatRunId&&pv(e),a&&n?.refreshSessions&&i&&e.refreshSessionsAfterChat.add(i),a}async function pv(e){if(!e.connected||ov(e))return;let[t,...n]=e.chatQueue;t&&(e.chatQueue=n,await fv(e,t.text,{attachments:t.attachments,refreshSessions:t.refreshSessions})||(e.chatQueue=[t,...e.chatQueue]))}async function mv(e){let t=e.chatModelPatchPending;t&&await t.catch(()=>void 0)}function hv(e){let t=e.replace(/\s+/g,` `).trim();return!t||t.startsWith(`/`)?null:(t.length>64?`${t.slice(0,61).trimEnd()}...`:t)||null}function gv(e){let t=e?.trim()??``;return!t||/^(?:local\s+)?chat\s+\d+$/i.test(t)}function _v(e){if(!Pn(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 gv(t?.label?.trim()||t?.displayName?.trim()||``)}async function vv(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 yv(e,t){e.chatQueue=e.chatQueue.filter(e=>e.id!==t)}function bv(e,t){t&&(e.chatQueue=e.chatQueue.filter(e=>e.pendingRunId!==t))}async function xv(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(sv(i)){await uv(e);return}if(await mv(e),!e.connected)return;let c=cv(i),l=_v(e)?hv(i):null;if(t??(e.chatMessage=``,e.chatAttachments=[]),ov(e)){dv(e,i,o,c);return}await fv(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 vv(e,l)}async function Sv(e,t){await Promise.all([H_(e),U_(e),mm(e,{activeMinutes:120}),Ov(e)]),t?.scheduleScroll!==!1&&Ln(e)}var Cv=pv;function wv(e){let t=e,n=(av.get(t)??0)+1;return av.set(t,n),n}function Tv(e,t,n){return av.get(e)===t&&e.sessionKey===n}function Ev(e){let t=Pn(e.sessionKey);return t?.agentId?t.agentId:(e.hello?.snapshot)?.sessionDefaults?.defaultAgentId?.trim()||`main`}function Dv(e,t){let n=g(e),r=encodeURIComponent(t);return n?`${n}/avatar/${r}?meta=1`:`/avatar/${r}?meta=1`}async function Ov(e){if(!e.connected){e.chatAvatarUrl=null;return}let t=e.sessionKey,n=wv(e),r=Ev(e);if(!r){Tv(e,n,t)&&(e.chatAvatarUrl=null);return}e.chatAvatarUrl=null;let i=Dv(e.basePath,r);try{let r=await fetch(i,{method:`GET`});if(!Tv(e,n,t))return;if(!r.ok){e.chatAvatarUrl=null;return}let a=await r.json();if(!Tv(e,n,t))return;e.chatAvatarUrl=(typeof a.avatarUrl==`string`?a.avatarUrl.trim():``)||null}catch{Tv(e,n,t)&&(e.chatAvatarUrl=null)}}var kv=`0.1.58`;function Av(e,t=kv){let n=e?.trim(),r=t.trim();return!!(n&&r&&r!==`dev`&&n!==r)}function jv(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 Mv=50,Nv=200;function Pv(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n)return n.length<=t?n:n.slice(0,t)}function Fv(e){let t=Pv(e?.name,Mv)??`Assistant`,n=Pv(e?.avatar??void 0,Nv)??null;return{agentId:typeof e?.agentId==`string`&&e.agentId.trim()?e.agentId.trim():null,name:t,avatar:n}}function Iv(){let e=window.__FASED_INJECTED_IDENTITY__;return Fv(e)}async function Lv(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=Fv(t);e.assistantName=n.name,e.assistantAvatar=n.avatar,e.assistantAgentId=n.agentId??null}catch{}}function Rv(e){return typeof e==`object`&&!!e}function zv(e){if(!Rv(e))return null;let t=typeof e.id==`string`?e.id.trim():``,n=e.request;if(!t||!Rv(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 Bv(e){if(!Rv(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 Vv(e){if(!Rv(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=Rv(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 Hv(e){let t=Date.now();return e.filter(e=>e.expiresAtMs>t)}function Uv(e,t){let n=Hv(e).filter(e=>e.id!==t.id);return n.unshift(t),n}function Wv(e,t){return Hv(e).filter(e=>e.id!==t)}function Gv(e){return/^(?:typeerror:\s*)?(?:fetch failed|failed to fetch)$/i.test(e.trim())}function Kv(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 Jv(e,t,n=e.client){qv(e),e.restartReconnectTimer=globalThis.setTimeout(()=>{e.restartReconnectTimer=null,!e.connected&&(!n||e.client!==n||Qv(e))},Math.max(250,Math.floor(t)))}function Yv(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 Xv(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 Zv(e,t){if(!t?.mainSessionKey)return;let n=Xv(e.sessionKey,t),r=Xv(e.settings.sessionKey,t),i=Xv(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&&xg(e,o)}function Qv(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=Hv(e.execApprovalQueue),bv(e,e.chatRunId??void 0),n.resumeChatQueueAfterReconnect=!0):e.execApprovalQueue=Hv(e.execApprovalQueue),e.execApprovalError=null;let i=e.client,a=Yv({gatewayUrl:e.settings.gatewayUrl,uiVersion:kv}),o=new Nc({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:Xo.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&&Av(e.serverVersion)){e.uiRuntimeError=`Dashboard build ${kv} does not match gateway ${e.serverVersion}. Run fased update, restart the gateway, and reload this page.`,o.stop();return}ry(e,t),e.chatRunId=null,e.chatStream=null,e.chatStreamStartedAt=null,r_(e),n.resumeChatQueueAfterReconnect&&(n.resumeChatQueueAfterReconnect=!1,Cv(e)),cm(e),lm(e),Lv(e),cd(e),Tu(e,{quiet:!0}),ap(e,{quiet:!0}),Dg(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=Dc(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&&Gv(i.message)?N_({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&&Jv(n,1750,o)}},onEvent:t=>{e.client===o&&$v(e,t)},onGap:({expected:t,received:n})=>{e.client===o&&(e.lastError=`event gap detected (expected seq ${t}, got ${n}); reconnecting`,e.lastErrorCode=null,Qv(e,{reason:`seq-gap`}))}});e.client=o,i?.stop(),o.start()}function $v(e,t){try{ny(e,t)}catch(e){console.error(`[gateway] handleGatewayEvent error:`,t.event,e)}}function ey(e,t,n){if(n!==`final`&&n!==`error`&&n!==`aborted`)return!1;let r=e.toolStreamOrder.length>0;r_(e),bv(e,t?.runId),Cv(e);let i=t?.runId;return i&&e.refreshSessionsAfterChat.has(i)&&(e.refreshSessionsAfterChat.delete(i),n===`final`&&mm(e,{activeMinutes:120})),r&&n===`final`?(H_(e),!0):!1}function ty(e,t){t?.sessionKey&&Sg(e,t.sessionKey);let n=Q_(e,t),r=ey(e,t,n);n===`final`&&!r&&jv(t)&&H_(e)}function ny(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;p_(e,t.payload);return}if(t.event===`chat`){ty(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&&ou(e,n))&&r&&e.tab===`mining`&&eu(e,{quiet:!0});return}if(t.event===`cron`&&e.tab===`cron`){Hg(e);return}if(t.event===`sessions.changed`){e.sessionsLastEventAt=Kv(t.payload),pm(e,t.payload)||mm(e);return}if(t.event===`session.message`){e.sessionMessageLastEventAt=Kv(t.payload),iv(e,t.payload)&&Ln(e);return}if(t.event===`device.pair.requested`||t.event===`device.pair.resolved`){ap(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,Jv(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=zv(t.payload);if(n){e.execApprovalQueue=Uv(e.execApprovalQueue,n),e.execApprovalError=null;let t=Math.max(0,n.expiresAtMs-Date.now()+500);globalThis.setTimeout(()=>{e.execApprovalQueue=Wv(e.execApprovalQueue,n.id)},t)}return}if(t.event===`exec.approval.resolved`){let n=Bv(t.payload);n&&(e.execApprovalQueue=Wv(e.execApprovalQueue,n.id));return}if(t.event===`plugin.approval.requested`){let n=Vv(t.payload);if(n){e.execApprovalQueue=Uv(e.execApprovalQueue,n),e.execApprovalError=null;let t=Math.max(0,n.expiresAtMs-Date.now()+500);globalThis.setTimeout(()=>{e.execApprovalQueue=Wv(e.execApprovalQueue,n.id)},t)}return}if(t.event===`plugin.approval.resolved`){let n=Bv(t.payload);n&&(e.execApprovalQueue=Wv(e.execApprovalQueue,n.id))}}function ry(e,t){let n=t.snapshot;n?.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence),n?.health&&(e.debugHealth=n.health),n?.sessionDefaults&&Zv(e,n.sessionDefaults),e.federationManagedMode=n?.gatewayMode===`managed`}var iy=`/__fased/control-ui-config.json`;async function ay(e){if(typeof window>`u`||typeof fetch!=`function`)return;let t=g(e.basePath??``),n=t?`${t}${iy}`:iy;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&&Av(e.serverVersion)&&(e.uiRuntimeError=`Dashboard build ${kv} does not match gateway ${e.serverVersion}. Run fased update, restart the gateway, and reload this page.`);let i=Fv({name:r.assistantName,avatar:r.assistantAvatar??null});e.assistantName=i.name,e.assistantAvatar=i.avatar}catch{}}function oy(e){e.basePath=kg(),e.authBootstrapPending=!0;let t=ay(e);Pg(e,!0),Ag(e),Mg(e),window.addEventListener(`popstate`,e.popStateHandler),Promise.all([t,Cg(e)]).then(()=>{e.authBootstrapPending=!1,e.settings.token.trim()&&!e.client&&Qv(e)},()=>{e.authBootstrapPending=!1}),Mu(e),e.tab===`logs`&&Pu(e),e.tab===`debug`&&Iu(e),(e.tab===`federation`||e.tab===`marketplace`)&&Ru(e),e.tab===`mining`&&Bu(e)}function sy(e){Un(e)}function cy(e){window.removeEventListener(`popstate`,e.popStateHandler),Nu(e),Fu(e),Lu(e),zu(e),Vu(e),e.client?.stop(),e.client=null,e.connected=!1,Ng(e),e.topbarObserver?.disconnect(),e.topbarObserver=null}function ly(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;Ln(e,n||r||!e.chatHasAutoScrolled)}e.tab===`logs`&&(t.has(`logsEntries`)||t.has(`logsAutoFollow`)||t.has(`tab`))&&e.logsAutoFollow&&e.logsAtBottom&&Rn(e,t.has(`tab`)||t.has(`logsAutoFollow`))}}var uy=`Fased`,dy=`Fased Agent`;function fy(e){if(Array.isArray(e))return e.map(e=>typeof e==`string`?e.trim():``).filter(Boolean).slice(0,1)}function py(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 my=`Assistant`;function hy(e){return e.split(/[-_]+/).filter(Boolean).map(e=>`${e.slice(0,1).toUpperCase()}${e.slice(1)}`).join(` `)}function gy(e){return(e??``).trim().toLowerCase()===`main`}function _y(e){let t=e.id.trim(),n=t.toLowerCase(),r=e.identity?.name?.trim()||e.name?.trim()||``;return r&&r.toLowerCase()!==n?r:gy(t)?my:hy(t)||t}function vy(e){let t=e.id.trim(),n=_y(e);return gy(t)?n:n&&n!==t?`${n} (${t})`:t}var yy=new Set([`agent`,`channel`,`chat`,`provider`,`model`,`source`,`tool`,`label`,`key`,`session`,`id`,`has`,`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`]),by=e=>e.trim().toLowerCase(),xy=e=>{let t=e.replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\*/g,`.*`).replace(/\?/g,`.`);return RegExp(`^${t}$`,`i`)},Sy=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},Cy=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}}),wy=e=>[e.label,e.key,e.sessionId].filter(e=>!!e).map(e=>e.toLowerCase()),Ty=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)},Ey=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)},Dy=e=>(e.usage?.toolUsage?.tools??[]).map(e=>e.name.toLowerCase()),Oy=(e,t)=>{let n=by(t.value??``);if(!n)return!0;if(!t.key)return wy(e).some(e=>e.includes(n));switch(by(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 Ty(e).some(e=>e.includes(n));case`model`:return Ey(e).some(e=>e.includes(n));case`source`:return e.source?.toLowerCase().includes(n)??!1;case`tool`:return Dy(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=xy(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 Ey(e).length>0;case`provider`:return Ty(e).length>0;default:return!0}case`mintokens`:{let t=Sy(n);return t===null?!0:(e.usage?.totalTokens??0)>=t}case`maxtokens`:{let t=Sy(n);return t===null?!0:(e.usage?.totalTokens??0)<=t}case`mincost`:{let t=Sy(n);return t===null?!0:(e.usage?.totalCost??0)>=t}case`maxcost`:{let t=Sy(n);return t===null?!0:(e.usage?.totalCost??0)<=t}case`minmessages`:{let t=Sy(n);return t===null?!0:(e.usage?.messageCounts?.total??0)>=t}case`maxmessages`:{let t=Sy(n);return t===null?!0:(e.usage?.messageCounts?.total??0)<=t}default:return!0}},ky=(e,t)=>{let n=Cy(t);if(n.length===0)return{sessions:e,warnings:[]};let r=[];for(let e of n){if(!e.key)continue;let t=by(e.key);if(!yy.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(by(e.value))&&r.push(`Unknown has:${e.value}`)}[`mintokens`,`maxtokens`,`mincost`,`maxcost`,`minmessages`,`maxmessages`].includes(t)&&e.value&&Sy(e.value)===null&&r.push(`Invalid number for ${e.key}`)}return{sessions:e.filter(e=>n.every(t=>Oy(e,t))),warnings:r}};function Ay(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 jy(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 My=4;function Ny(e){return Math.round(e/My)}function W(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Py(e){let t=new Date;return t.setHours(e,0,0,0),t.toLocaleTimeString(void 0,{hour:`numeric`})}function Fy(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=Ly(i,t),o=zy(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:Py(e.hour),value:`${(e.rate*100).toFixed(2)}%`,sub:`${Math.round(e.errors)} errors · ${Math.round(e.msgs)} msgs`}))}var Iy=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function Ly(e,t){return t===`utc`?e.getUTCHours():e.getHours()}function Ry(e,t){return t===`utc`?e.getUTCDay():e.getDay()}function zy(e,t){let n=new Date(e);return t===`utc`?n.setUTCMinutes(59,59,999):n.setMinutes(59,59,999),n}function By(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=Ly(i,t),o=Ry(i,t),s=zy(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=Iy.map((e,t)=>({label:e,tokens:r[t]}));return{hasData:a,totalTokens:i,hourTotals:n,weekdayTotals:o}}function Vy(e,t,r,i){let a=By(e,t);if(!a.hasData)return n`
146
146
  <div class="card usage-mosaic">
@@ -3569,7 +3569,7 @@ import{n as e,t}from"./index-D5JlBp7f.js";import{a as n,c as r,i,l as a,n as o,o
3569
3569
  aria-selected=${r.value===t}
3570
3570
  title=${r.label}
3571
3571
  ?disabled=${s}
3572
- @click=${async t=>{await Gx(e,r.value);let n=t.currentTarget.closest(`details`);n instanceof HTMLDetailsElement&&(n.open=!1)}}
3572
+ @click=${async t=>{let n=t.currentTarget;await Gx(e,r.value);let i=n instanceof HTMLElement?n.closest(`details`):null;i instanceof HTMLDetailsElement&&(i.open=!1)}}
3573
3573
  >
3574
3574
  ${r.label}
3575
3575
  </button>
@@ -3617,7 +3617,7 @@ import{n as e,t}from"./index-D5JlBp7f.js";import{a as n,c as r,i,l as a,n as o,o
3617
3617
  aria-selected=${t.value===r}
3618
3618
  title=${t.label}
3619
3619
  ?disabled=${s}
3620
- @click=${async n=>{await Yx(e,t.value);let r=n.currentTarget.closest(`details`);r instanceof HTMLDetailsElement&&(r.open=!1)}}
3620
+ @click=${async n=>{let r=n.currentTarget;await Yx(e,t.value);let i=r instanceof HTMLElement?r.closest(`details`):null;i instanceof HTMLDetailsElement&&(i.open=!1)}}
3621
3621
  >
3622
3622
  ${t.label}
3623
3623
  </button>
@@ -25474,4 +25474,4 @@ Payload:
25474
25474
  <li>After replacement, revoke devices that are lost, stale, or no longer operator-controlled.</li>
25475
25475
  </ul>
25476
25476
  `),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 Mr(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 Nr(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 Ir({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 Lr({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 Rr({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 jr(i.approvalToken,a,e,QY(this.walletCustodyUnlockMinutes));this.walletCustodyDeviceShare=a;let s=e?await this.persistWalletCustodyDeviceShareIfNeeded(e,a,i):null,c=XY(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 Pr(n,t,QY(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 ${XY(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 Fr(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 uv(this)}removeQueuedMessage(e){yv(this,e)}async handleSendChat(e,t){await xv(this,e,t)}async handleWhatsAppStart(e){await dn(this,e)}async handleWhatsAppWait(){await fn(this)}async handleWhatsAppLogout(){await pn(this)}async handleChannelQrStart(e,t=!1,n){await mn(this,e,t,n)}async handleChannelQrWait(e,t){await hn(this,e,t)}async handleChannelLogout(e,t){await gn(this,e,t)}async handleChannelInstall(e){await _n(this,e)}cancelChannelConfirmAction(){vn(this)}async confirmChannelAction(){await yn(this)}async handleChannelEnable(e){await bn(this,e)}async handleChannelConfigSave(){await xn(this)}async handleChannelConfigReload(){await Sn(this)}handleNostrProfileEdit(e,t){On(this,e,t)}handleNostrProfileCancel(){kn(this)}handleNostrProfileFieldChange(e,t){An(this,e,t)}async handleNostrProfileSave(){await Mn(this)}async handleNostrProfileImport(){await Nn(this)}handleNostrProfileToggleAdvanced(){jn(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,xg(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 gJ(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,`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`)],$);
25477
- //# sourceMappingURL=app-DltSyY4Y.js.map
25477
+ //# sourceMappingURL=app-CpgQGqe6.js.map
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./app-DltSyY4Y.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]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./app-CpgQGqe6.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-DltSyY4Y.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-DltSyY4Y.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-D5JlBp7f.js.map
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-CpgQGqe6.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-DiBBflpv.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-D5JlBp7f.js"></script>
17
+ <script type="module" crossorigin src="./assets/index-DiBBflpv.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.57"}
1
+ {"version":"0.1.58"}
@@ -2,7 +2,7 @@ import { i as defaultRuntime } from "./subsystem-DBPNbQDQ.js";
2
2
  import { c as success, n as info, p as getChildLogger } from "./globals-B_jjtAje.js";
3
3
  import { a as resolveOAuthDir, c as expandHomePrefix, u as resolveRequiredHomeDir } from "./paths-BEmvSyOV.js";
4
4
  import { h as resolveUserPath } from "./utils-CYk9EKoq.js";
5
- import { ya as formatCliCommand } from "./config-Dbxj_jUP.js";
5
+ import { ba as formatCliCommand } from "./config-DrhYEiCM.js";
6
6
  import { n as resolveAccountEntry, t as createAccountListHelpers } from "./account-helpers-Bdfws46K.js";
7
7
  import { f as DEFAULT_ACCOUNT_ID, p as normalizeAccountId } from "./session-key-HSJ2KQTc.js";
8
8
  import path from "node:path";
@@ -1,8 +1,8 @@
1
1
  import { i as logVerbose } from "./globals-B_jjtAje.js";
2
- import { n as loadConfig } from "./config-Dbxj_jUP.js";
2
+ import { n as loadConfig } from "./config-DrhYEiCM.js";
3
3
  import { i as resolveSlackAccount, s as resolveSlackBotToken } from "./accounts-CuqIKU8X.js";
4
4
  import { n as validateSlackBlocksArray } from "./blocks-input-Bg-8S2pl.js";
5
- import { i as buildSlackBlocksFallbackText, t as sendMessageSlack } from "./send-CPK_HlYW.js";
5
+ import { i as buildSlackBlocksFallbackText, t as sendMessageSlack } from "./send-DgzZUx2i.js";
6
6
  import { n as createSlackWebClient } from "./client-pI228AVT.js";
7
7
 
8
8
  //#region src/slack/actions.ts
@@ -1,4 +1,4 @@
1
- import { ya as formatCliCommand } from "./config-Dbxj_jUP.js";
1
+ import { ba as formatCliCommand } from "./config-DrhYEiCM.js";
2
2
  import { f as DEFAULT_ACCOUNT_ID } from "./session-key-HSJ2KQTc.js";
3
3
 
4
4
  //#region src/web/active-listener.ts