@vibe-lark/larkpal 0.1.85 → 0.1.87

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 (111) hide show
  1. package/dist/account-id-BM1T6029-BzQ_cMoi.mjs +1 -0
  2. package/dist/activation-context--5yu1dPF-XV0Y0pTy.mjs +1 -0
  3. package/dist/anthropic-CFZUCb1w.mjs +39 -0
  4. package/dist/assistant-visible-text-DuFWokAt-BOJV_zwc.mjs +9 -0
  5. package/dist/azure-openai-responses-BEuiMaF-.mjs +1 -0
  6. package/dist/boundary-file-read-BSd9MXPy-gnNVhPKT.mjs +1 -0
  7. package/dist/browser-lifecycle-cleanup-BdNsMhMD-BM97qA_M.mjs +1 -0
  8. package/dist/build-Bkj0hOS2.mjs +3 -0
  9. package/dist/bundled-compat-BpaDaAAu-DJtrIX6i.mjs +27 -0
  10. package/dist/bundled-dir-U738ay4K-BxbzrJOo.mjs +1 -0
  11. package/dist/call-DimWbpgJ-B4pv55RH.mjs +20 -0
  12. package/dist/channel-bootstrap.runtime-BVclcGv1-CEZ0-JP9.mjs +1 -0
  13. package/dist/channel-bootstrap.runtime-Cwcr38m2-Dt6QlQkX.mjs +1 -0
  14. package/dist/chunk-DHbaKqs-.mjs +1 -0
  15. package/dist/cli.mjs +7 -92
  16. package/dist/command-format-LSnUCVVF-Dn4h9IOh.mjs +16 -0
  17. package/dist/config-Bim2pi8a-03N-28sw.mjs +1 -0
  18. package/dist/delivery-context.shared-j5hC5qb1-BSLQG47q.mjs +1 -0
  19. package/dist/diagnostic-ClMwNnUA-BMKvPQJT.mjs +1 -0
  20. package/dist/dist-J5UB83Ws.mjs +601 -0
  21. package/dist/dist-coestTs9.mjs +5 -0
  22. package/dist/env-api-keys-Cuz5irWW.mjs +1 -0
  23. package/dist/event-stream-B7Ei41Bu.mjs +1 -0
  24. package/dist/facade-loader-DFzIYYt_-4bzFvy-b.mjs +1 -0
  25. package/dist/from-Ba69_5cR.mjs +14 -0
  26. package/dist/gateway-method-policy-C7rf0SeV-CTJcMQCE.mjs +1 -0
  27. package/dist/github-copilot-headers-BfhryVuU.mjs +1 -0
  28. package/dist/google-ABo-1guT.mjs +1 -0
  29. package/dist/google-gemini-cli-CGlN1zUA.mjs +2 -0
  30. package/dist/google-shared-C60sNhwd.mjs +301 -0
  31. package/dist/google-vertex-De0nAItu.mjs +1 -0
  32. package/dist/hash-Dw-N8Y9l.mjs +1 -0
  33. package/dist/headers-Bpsp70B9.mjs +1 -0
  34. package/dist/home-dir-C44RaPME-B5iLWwCq.mjs +1 -0
  35. package/dist/ids-BPsM98Uu-CJBJAeVC.mjs +1 -0
  36. package/dist/image-2w3cApg7-CrpUMCvm.mjs +3 -0
  37. package/dist/interactive-init-C5MFL5MW.mjs +8 -0
  38. package/dist/io-CH2g3vsv-JJtUIa_U.mjs +10 -0
  39. package/dist/jiti-loader-cache-Bat69wam-DNIteTtO.mjs +9 -0
  40. package/dist/json-file-BQRNuxmK-hRjIgOXI.mjs +1 -0
  41. package/dist/json-parse-BESd8UAM.mjs +3 -0
  42. package/dist/jws-YaZ38F_i.mjs +12 -0
  43. package/dist/lark-cli-provider-BLMxH6CN.mjs +4 -0
  44. package/dist/lark-logger-xpMKNNtY.mjs +1 -0
  45. package/dist/live-smoke-DpURW676.mjs +33 -0
  46. package/dist/load-context-mb7uvLSn-3xYwSnOZ.mjs +1 -0
  47. package/dist/loader-708jrx4Y-BbJRXNlQ.mjs +4 -0
  48. package/dist/main.mjs +480 -18553
  49. package/dist/manifest-registry-_hxKCS2K-OL8KK_o4.mjs +15 -0
  50. package/dist/mcp-server.mjs +4 -527
  51. package/dist/message-channel-Bk_YHfQg-n2Hw2Y0L.mjs +1 -0
  52. package/dist/message-channel-core-DTA--Gjh-CIh10vfo.mjs +1 -0
  53. package/dist/message.config.runtime-K-k4XOyq-F_h0Cgkl.mjs +1 -0
  54. package/dist/message.gateway.runtime-DqHOHRTQ-ge4c5p4s.mjs +1 -0
  55. package/dist/mistral-DyL3Zo1b.mjs +7 -0
  56. package/dist/model-auth-env-oyg2Hexc-DJbt9J3o.mjs +1 -0
  57. package/dist/models-config-BmpSQJQF-BL6S5qAo.mjs +1 -0
  58. package/dist/models-config.runtime-SOhLEw-f.mjs +1 -0
  59. package/dist/multipart-parser-B9dwXBqu.mjs +2 -0
  60. package/dist/oauth-25y2wc7K.mjs +75 -0
  61. package/dist/openai-C-rgGb7X.mjs +16 -0
  62. package/dist/openai-codex-responses-BbyAPsP1.mjs +7 -0
  63. package/dist/openai-completions-Bu5qvQzb.mjs +5 -0
  64. package/dist/openai-responses-pIdwQBc4.mjs +1 -0
  65. package/dist/openai-responses-shared-DqW1JSux.mjs +10 -0
  66. package/dist/paths-D6msg0S1-BO4XgM1u.mjs +1 -0
  67. package/dist/paths-D92DjaZ--DdtJ-zYp.mjs +1 -0
  68. package/dist/pi-model-discovery-Bd0TWzo8-DvSM0eWu.mjs +1 -0
  69. package/dist/pi-model-discovery-runtime-PrjWOmsV.mjs +1 -0
  70. package/dist/pi-tools.before-tool-call.runtime-Bn7uqKie-WPxU5oNX.mjs +2 -0
  71. package/dist/plugin-auto-enable-DdH3n9V8-Dr_bUXkG.mjs +1 -0
  72. package/dist/process-scoped-map-B2cWkYET-Co-i-MXA.mjs +1 -0
  73. package/dist/provider-discovery.runtime-DY0VWQ81.mjs +1 -0
  74. package/dist/provider-model-compat-CFqcq0it-BUwZENrz.mjs +1 -0
  75. package/dist/provider-runtime-C8rljsNs-BDvu6FW3.mjs +1 -0
  76. package/dist/provider-runtime-CT50mNIX-DImw7ZZu.mjs +79 -0
  77. package/dist/provider-stream-COLujAAo-Dpq1DSIk.mjs +248 -0
  78. package/dist/providers.runtime-Ba7tOlq7-B4t6ywCr.mjs +1 -0
  79. package/dist/public-surface-loader-BVl0NQAE-TfJ3izj1.mjs +1 -0
  80. package/dist/resolve-C33B7eeu-DZM_z6Wr.mjs +1 -0
  81. package/dist/runtime-Cym-fqI8-1GOIuRRQ.mjs +1 -0
  82. package/dist/runtime-channel-state-CohMybAh-BBzhl07Q.mjs +1 -0
  83. package/dist/runtime-snapshot-C54O1-gI-DxusscPf.mjs +1 -0
  84. package/dist/runtime-state-IBOIXKOx-Cw1GA1td.mjs +1 -0
  85. package/dist/runtime-web-tools-fallback.runtime-Ca-qn1mj-BsYE2gOd.mjs +1 -0
  86. package/dist/runtime-web-tools-manifest.runtime-BgxQTjmq-P6MKP9gQ.mjs +1 -0
  87. package/dist/runtime-web-tools-public-artifacts.runtime-D9qcoWIX-5VoyjouO.mjs +1 -0
  88. package/dist/session-archive.runtime-B52_5vs4-cU2tYbBz.mjs +1 -0
  89. package/dist/session-key-Cn2QoOyX-QZeYmbxd.mjs +1 -0
  90. package/dist/session-transcript-files.fs-DEeFXruQ-CXIAFSsr.mjs +1 -0
  91. package/dist/src-CCDx_C-U.mjs +3 -0
  92. package/dist/src-DACmA9V6.mjs +5 -0
  93. package/dist/subagent-announce-L5WsQatW--rMn240x.mjs +2 -0
  94. package/dist/subagent-announce.registry.runtime-DiqZyeTs-DNfNHsls.mjs +1 -0
  95. package/dist/subagent-registry-steer-runtime-DFgZFC0j-XYS1_qwl.mjs +1 -0
  96. package/dist/subagent-system-prompt-C1qnN--K-CsU4f97T.mjs +23 -0
  97. package/dist/target-parsing-loaded-DKkb6jJY-B830OA1a.mjs +12 -0
  98. package/dist/task-registry-delivery-runtime-Dd1CUkZF-B2Hj2k8C.mjs +16 -0
  99. package/dist/task-registry-delivery-runtime-ragbeVx5-Bdvo2Q5u.mjs +1 -0
  100. package/dist/thinking-Bh-7MqXz-uApNUe6g.mjs +1 -0
  101. package/dist/transcript-E_-ISOkD-VTwb782D.mjs +5 -0
  102. package/dist/transcript.runtime-BqhvZZdl-B4E0TiX5.mjs +1 -0
  103. package/dist/transform-messages-BTA3xbAI.mjs +1 -0
  104. package/dist/web-provider-public-artifacts-BlpRwIUS-DbVhDOrY.mjs +1 -0
  105. package/dist/web-search-providers.runtime--0aUtC3b-Bjh4Bmrz.mjs +1 -0
  106. package/package.json +1 -2
  107. package/dist/interactive-init-B6j8j_Ap.mjs +0 -450
  108. package/dist/lark-cli-provider-7LvtOIF_.mjs +0 -554
  109. package/dist/lark-logger-D7_pEVQc.mjs +0 -143
  110. package/dist/live-smoke-nvTUPtrv.mjs +0 -7135
  111. package/dist/rolldown-runtime-wcPFST8Q.mjs +0 -13
@@ -0,0 +1,10 @@
1
+ import{a as e,t}from"./chunk-DHbaKqs-.mjs";import{c as n,i as r,o as i,s as a,u as o}from"./home-dir-C44RaPME-B5iLWwCq.mjs";import{o as s,r as c,s as l,t as u}from"./paths-D92DjaZ--DdtJ-zYp.mjs";import{t as d}from"./account-id-BM1T6029-BzQ_cMoi.mjs";import{c as f,l as p,o as m,s as h,t as g}from"./bundled-dir-U738ay4K-BxbzrJOo.mjs";import{i as _,t as v}from"./ids-BPsM98Uu-CJBJAeVC.mjs";import{$ as y,A as ee,B as te,D as ne,E as b,F as re,G as ie,H as ae,I as x,J as S,K as oe,L as C,M as w,Mt as se,N as T,O as ce,P as le,Q as ue,R as de,S as fe,T as pe,U as E,W as me,X as D,Y as he,Z as ge,a as _e,at as O,ct as ve,d as ye,et as be,g as xe,i as Se,it as Ce,j as k,k as A,l as j,nt as we,ot as M,q as Te,rt as Ee,st as N,t as De,tt as Oe,u as ke,vt as Ae,w as je,yt as Me,z as Ne}from"./bundled-compat-BpaDaAAu-DJtrIX6i.mjs";import{A as Pe,D as Fe,E as Ie,M as Le,_ as Re,c as ze,h as Be,j as Ve,l as He,o as P,v as Ue}from"./manifest-registry-_hxKCS2K-OL8KK_o4.mjs";import{r as We,t as Ge}from"./boundary-file-read-BSd9MXPy-gnNVhPKT.mjs";import{r as Ke,t as qe}from"./jiti-loader-cache-Bat69wam-DNIteTtO.mjs";import{a as Je,c as Ye,d as Xe,f as Ze,i as Qe,l as $e,n as et,o as tt,r as nt,s as rt,t as it,v as at,x as ot}from"./runtime-snapshot-C54O1-gI-DxusscPf.mjs";import{i as st}from"./session-key-Cn2QoOyX-QZeYmbxd.mjs";import{t as ct}from"./public-surface-loader-BVl0NQAE-TfJ3izj1.mjs";import F from"node:fs";import I from"node:path";import{fileURLToPath as lt}from"node:url";import ut from"node:os";import{execFileSync as dt}from"node:child_process";import ft from"node:crypto";import{isDeepStrictEqual as pt}from"node:util";import{z as L}from"zod";import mt from"dotenv";const ht={ms:1,s:1e3,m:6e4,h:36e5,d:864e5};function gt(e,t){let r=i(n(e)??``);if(!r)throw Error(`invalid duration (empty)`);let a=/^(\d+(?:\.\d+)?)(ms|s|m|h|d)?$/.exec(r);if(a){let n=Number(a[1]);if(!Number.isFinite(n)||n<0)throw Error(`invalid duration: ${e}`);let r=a[2]??t?.defaultUnit??`ms`,i=Math.round(n*ht[r]);if(!Number.isFinite(i))throw Error(`invalid duration: ${e}`);return i}let o=0,s=0;for(let t of r.matchAll(/(\d+(?:\.\d+)?)(ms|s|m|h|d)/g)){let[n,r,i]=t,a=t.index??-1;if(!n||!r||!i||a<0||a!==s)throw Error(`invalid duration: ${e}`);let c=Number(r);if(!Number.isFinite(c)||c<0)throw Error(`invalid duration: ${e}`);let l=ht[i];if(!l)throw Error(`invalid duration: ${e}`);o+=c*l,s+=n.length}if(s!==r.length||s===0)throw Error(`invalid duration: ${e}`);let c=Math.round(o);if(!Number.isFinite(c))throw Error(`invalid duration: ${e}`);return c}function _t(e,t){if(!e||typeof e!=`object`)return;if(Object.hasOwn(e,t))return e[t];let n=i(t),r=Object.keys(e).find(e=>i(e)===n);return r?e[r]:void 0}function vt(e){if(typeof e!=`string`)return!1;switch(i(e)){case`1`:case`on`:case`true`:case`yes`:return!0;default:return!1}}var yt={blockedEverywhereKeys:`NODE_OPTIONS.NODE_PATH.PYTHONHOME.PYTHONPATH.PERL5LIB.PERL5OPT.RUBYLIB.RUBYOPT.BASH_ENV.ENV.BROWSER.GIT_EDITOR.GIT_EXTERNAL_DIFF.GIT_DIR.GIT_WORK_TREE.GIT_COMMON_DIR.GIT_EXEC_PATH.GIT_INDEX_FILE.GIT_OBJECT_DIRECTORY.GIT_ALTERNATE_OBJECT_DIRECTORIES.GIT_NAMESPACE.GIT_SEQUENCE_EDITOR.GIT_TEMPLATE_DIR.GIT_SSL_NO_VERIFY.GIT_SSL_CAINFO.GIT_SSL_CAPATH.CC.CXX.CARGO_BUILD_RUSTC.CARGO_BUILD_RUSTC_WRAPPER.RUSTC_WRAPPER.CMAKE_C_COMPILER.CMAKE_CXX_COMPILER.SHELL.SHELLOPTS.PS4.GCONV_PATH.IFS.SSLKEYLOGFILE.JAVA_OPTS.JAVA_TOOL_OPTIONS._JAVA_OPTIONS.JDK_JAVA_OPTIONS.PYTHONBREAKPOINT.DOTNET_STARTUP_HOOKS.DOTNET_ADDITIONAL_DEPS.GLIBC_TUNABLES.MAVEN_OPTS.MAKEFLAGS.MFLAGS.SBT_OPTS.GRADLE_OPTS.ANT_OPTS.HGRCPATH.EXINIT.VIMINIT.MYVIMRC.GVIMINIT.LUA_INIT.LUA_INIT_5_1.LUA_INIT_5_2.LUA_INIT_5_3.LUA_INIT_5_4.EMACSLOADPATH.RUBYSHELL.GIT_HOOK_PATH.SVN_EDITOR.SVN_SSH.BZR_EDITOR.BZR_SSH.BZR_PLUGIN_PATH.SUDO_ASKPASS.JULIA_EDITOR.CONFIG_SITE.CONFIG_SHELL.CMAKE_TOOLCHAIN_FILE.CATALINA_OPTS.CORECLR_PROFILER.HELM_PLUGINS.PACKER_PLUGIN_PATH.VAGRANT_VAGRANTFILE.ERL_AFLAGS.ERL_FLAGS.ERL_ZFLAGS.ELIXIR_ERL_OPTIONS.R_ENVIRON.R_PROFILE.R_ENVIRON_USER.R_PROFILE_USER.HOSTALIASES`.split(`.`),blockedOverrideOnlyKeys:`HOME.GRADLE_USER_HOME.ZDOTDIR.GIT_DIR.GIT_WORK_TREE.GIT_COMMON_DIR.GIT_INDEX_FILE.GIT_OBJECT_DIRECTORY.GIT_ALTERNATE_OBJECT_DIRECTORIES.GIT_NAMESPACE.GIT_SSH_COMMAND.GIT_SSH.GIT_PROXY_COMMAND.GIT_ASKPASS.GIT_SSL_NO_VERIFY.GIT_SSL_CAINFO.GIT_SSL_CAPATH.SSH_ASKPASS.LESSOPEN.LESSCLOSE.PAGER.MANPAGER.GIT_PAGER.EDITOR.VISUAL.FCEDIT.SUDO_EDITOR.PROMPT_COMMAND.HISTFILE.PERL5DB.PERL5DBCMD.OPENSSL_CONF.OPENSSL_ENGINES.PYTHONSTARTUP.WGETRC.CURL_HOME.CLASSPATH.CFLAGS.CGO_CFLAGS.CGO_LDFLAGS.GOFLAGS.MAKEFLAGS.MFLAGS.CORECLR_PROFILER_PATH.PHPRC.PHP_INI_SCAN_DIR.DENO_DIR.BUN_CONFIG_REGISTRY.YARN_RC_FILENAME.HTTP_PROXY.HTTPS_PROXY.ALL_PROXY.NO_PROXY.NODE_TLS_REJECT_UNAUTHORIZED.NODE_EXTRA_CA_CERTS.SSL_CERT_FILE.SSL_CERT_DIR.REQUESTS_CA_BUNDLE.CURL_CA_BUNDLE.DOCKER_HOST.DOCKER_TLS_VERIFY.DOCKER_CERT_PATH.PIP_INDEX_URL.PIP_PYPI_URL.PIP_EXTRA_INDEX_URL.PIP_CONFIG_FILE.PIP_FIND_LINKS.PIP_TRUSTED_HOST.UV_INDEX.UV_INDEX_URL.UV_PYTHON.UV_EXTRA_INDEX_URL.UV_DEFAULT_INDEX.DOCKER_CONTEXT.LIBRARY_PATH.LDFLAGS.CPATH.C_INCLUDE_PATH.CPLUS_INCLUDE_PATH.OBJC_INCLUDE_PATH.GOPROXY.GONOSUMCHECK.GONOSUMDB.GONOPROXY.GOPRIVATE.GOENV.GOPATH.HGRCPATH.PYTHONUSERBASE.RUSTC_WRAPPER.RUSTFLAGS.CARGO_HOME.VIRTUAL_ENV.LUA_PATH.LUA_CPATH.GEM_HOME.GEM_PATH.BUNDLE_GEMFILE.COMPOSER_HOME.CARGO_BUILD_RUSTC_WRAPPER.XDG_CONFIG_HOME.XDG_CONFIG_DIRS.AWS_CONFIG_FILE.KUBECONFIG.GOOGLE_APPLICATION_CREDENTIALS.AWS_SHARED_CREDENTIALS_FILE.AWS_WEB_IDENTITY_TOKEN_FILE.AZURE_AUTH_LOCATION.HELM_HOME.ANSIBLE_CONFIG.ANSIBLE_LIBRARY.ANSIBLE_CALLBACK_PLUGINS.ANSIBLE_COLLECTIONS_PATH.ANSIBLE_CONNECTION_PLUGINS.ANSIBLE_FILTER_PLUGINS.ANSIBLE_INVENTORY_PLUGINS.ANSIBLE_LOOKUP_PLUGINS.ANSIBLE_MODULE_UTILS.ANSIBLE_REMOTE_TEMP.ANSIBLE_ROLES_PATH.ANSIBLE_STRATEGY_PLUGINS.R_LIBS_USER.TF_CLI_CONFIG_FILE.TF_PLUGIN_CACHE_DIR.AMQP_URL.AWS_ACCESS_KEY_ID.AWS_CONTAINER_CREDENTIALS_FULL_URI.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.AWS_SECRET_ACCESS_KEY.AWS_SECURITY_TOKEN.AWS_SESSION_TOKEN.AZURE_CLIENT_ID.AZURE_CLIENT_SECRET.DATABASE_URL.GH_TOKEN.GITHUB_TOKEN.GITLAB_TOKEN.MONGODB_URI.NODE_AUTH_TOKEN.NPM_TOKEN.REDIS_URL.SSH_AUTH_SOCK`.split(`.`),allowedInheritedOverrideOnlyKeys:`ALL_PROXY.AWS_CONFIG_FILE.AWS_SHARED_CREDENTIALS_FILE.AWS_WEB_IDENTITY_TOKEN_FILE.AZURE_AUTH_LOCATION.CURL_CA_BUNDLE.DOCKER_CERT_PATH.DOCKER_CONTEXT.DOCKER_HOST.DOCKER_TLS_VERIFY.GIT_PAGER.GOOGLE_APPLICATION_CREDENTIALS.GRADLE_USER_HOME.HISTFILE.HOME.HTTPS_PROXY.HTTP_PROXY.KUBECONFIG.MANPAGER.NODE_EXTRA_CA_CERTS.NODE_TLS_REJECT_UNAUTHORIZED.NO_PROXY.PAGER.REQUESTS_CA_BUNDLE.SSH_AUTH_SOCK.SSL_CERT_DIR.SSL_CERT_FILE.ZDOTDIR`.split(`.`),blockedOverridePrefixes:[`GIT_CONFIG_`,`NPM_CONFIG_`,`CARGO_REGISTRIES_`,`TF_VAR_`],blockedPrefixes:[`DYLD_`,`LD_`,`BASH_FUNC_`]};function bt(e){return Object.freeze(Array.from(new Set(e.map(e=>e.toUpperCase()))).toSorted((e,t)=>e.localeCompare(t)))}function xt(e){let t=e.blockedEverywhereKeys??[],n=e.blockedOverrideOnlyKeys??[],r=e.allowedInheritedOverrideOnlyKeys??[],i=new Set(r.map(e=>e.toUpperCase())),a=e.blockedPrefixes??[],o=e.blockedOverridePrefixes??[],s=e.blockedInheritedPrefixes??a;return{blockedInheritedKeys:bt([...t,...n.filter(e=>!i.has(e.toUpperCase()))]),blockedInheritedPrefixes:bt(s),blockedKeys:bt(t),blockedOverrideKeys:bt(n),blockedPrefixes:bt(a),blockedOverridePrefixes:bt(o)}}function St(e=yt){let t=xt(e);return Object.freeze({blockedEverywhereKeys:Object.freeze(e.blockedEverywhereKeys??[]),blockedOverrideOnlyKeys:Object.freeze(e.blockedOverrideOnlyKeys??[]),allowedInheritedOverrideOnlyKeys:Object.freeze(e.allowedInheritedOverrideOnlyKeys??[]),blockedInheritedKeys:t.blockedInheritedKeys,blockedInheritedPrefixes:t.blockedInheritedPrefixes,blockedPrefixes:t.blockedPrefixes,blockedOverridePrefixes:t.blockedOverridePrefixes,blockedKeys:t.blockedKeys,blockedOverrideKeys:t.blockedOverrideKeys})}const Ct=St(),wt=/^[A-Za-z_][A-Za-z0-9_]*$/,Tt=/^[A-Za-z_][A-Za-z0-9_()]*$/,Et=Object.freeze([...Ct.blockedKeys]),Dt=Object.freeze([...Ct.blockedPrefixes]),Ot=Object.freeze([...Ct.blockedInheritedKeys]),kt=Object.freeze([...Ct.blockedInheritedPrefixes]),At=Object.freeze([...Ct.blockedOverrideKeys]),jt=Object.freeze([...Ct.blockedOverridePrefixes]),Mt=Object.freeze([`TERM`,`LANG`,`LC_ALL`,`LC_CTYPE`,`LC_MESSAGES`,`COLORTERM`,`NO_COLOR`,`FORCE_COLOR`]);Object.freeze([`LC_`]);const Nt=new Set(Et),Pt=new Set(Ot),Ft=new Set(At);new Set(Mt);function R(e,t){let n=e.trim();return!n||t?.portable&&!wt.test(n)?null:n}function It(e){let t=R(e);return t&&(wt.test(t)||Tt.test(t))?t:null}function Lt(e){let t=R(e);if(!t)return!1;let n=t.toUpperCase();return Nt.has(n)?!0:Dt.some(e=>n.startsWith(e))}function Rt(e){let t=R(e);if(!t)return!1;let n=t.toUpperCase();return Pt.has(n)?!0:kt.some(e=>n.startsWith(e))}function zt(e){let t=R(e);if(!t)return!1;let n=t.toUpperCase();return Ft.has(n)?!0:jt.some(e=>n.startsWith(e))}function Bt(e,t){let n=[];for(let[r,i]of Object.entries(e)){if(typeof i!=`string`)continue;let e=R(r,t);e&&n.push([e,i])}return n}function Vt(e){return Array.from(new Set(e)).toSorted((e,t)=>e.localeCompare(t))}function Ht(e){let t=e?.overrides??void 0;if(!t)return{acceptedOverrides:void 0,rejectedOverrideBlockedKeys:[],rejectedOverrideInvalidKeys:[]};let n=e?.blockPathOverrides??!0,r={},i=[],a=[];for(let[e,o]of Object.entries(t)){if(typeof o!=`string`)continue;let t=It(e);if(!t){let t=e.trim();a.push(t||e);continue}let s=t.toUpperCase();if(n&&s===`PATH`){i.push(s);continue}if(Lt(s)||zt(s)){i.push(s);continue}r[t]=o}return{acceptedOverrides:r,rejectedOverrideBlockedKeys:Vt(i),rejectedOverrideInvalidKeys:Vt(a)}}function Ut(e){let t=e?.baseEnv??process.env,n={};for(let[e,r]of Bt(t))Rt(e)||(n[e]=r);let r=Ht({overrides:e?.overrides??void 0,blockPathOverrides:e?.blockPathOverrides??!0});if(r.acceptedOverrides)for(let[e,t]of Object.entries(r.acceptedOverrides))n[e]=t;return{env:at(n),rejectedOverrideBlockedKeys:r.rejectedOverrideBlockedKeys,rejectedOverrideInvalidKeys:r.rejectedOverrideInvalidKeys}}function Wt(e){return Ut(e).env}const Gt=/^[A-Z_][A-Z0-9_]*$/;var Kt=class extends Error{constructor(e,t){super(`Missing env var "${e}" referenced at config path: ${t}`),this.varName=e,this.configPath=t,this.name=`MissingEnvVarError`}};function qt(e,t){if(e[t]!==`$`)return null;let n=e[t+1],r=e[t+2];if(n===`$`&&r===`{`){let n=t+3,r=e.indexOf(`}`,n);if(r!==-1){let t=e.slice(n,r);if(Gt.test(t))return{kind:`escaped`,name:t,end:r}}}if(n===`{`){let n=t+2,r=e.indexOf(`}`,n);if(r!==-1){let t=e.slice(n,r);if(Gt.test(t))return{kind:`substitution`,name:t,end:r}}}return null}function Jt(e,t,n,r){if(!e.includes(`$`))return e;let i=[];for(let a=0;a<e.length;a+=1){let o=e[a];if(o!==`$`){i.push(o);continue}let s=qt(e,a);if(s?.kind===`escaped`){i.push(`\${${s.name}}`),a=s.end;continue}if(s?.kind===`substitution`){let e=t[s.name];if(e===void 0||e===``){if(r?.onMissing){r.onMissing({varName:s.name,configPath:n}),i.push(`\${${s.name}}`),a=s.end;continue}throw new Kt(s.name,n)}i.push(e),a=s.end;continue}i.push(o)}return i.join(``)}function Yt(e){if(!e.includes(`$`))return!1;for(let t=0;t<e.length;t+=1){if(e[t]!==`$`)continue;let n=qt(e,t);if(n?.kind===`escaped`){t=n.end;continue}if(n?.kind===`substitution`)return!0}return!1}function Xt(e,t,n,r){if(typeof e==`string`)return Jt(e,t,n,r);if(Array.isArray(e))return e.map((e,i)=>Xt(e,t,`${n}[${i}]`,r));if(m(e)){let i={};for(let[a,o]of Object.entries(e))i[a]=Xt(o,t,n?`${n}.${a}`:a,r);return i}return e}function Zt(e,t=process.env,n){return Xt(e,t,``,n)}function Qt(e){return Lt(e)||zt(e)}function $t(e){let t=e?.env;if(!t)return{};let n={};if(t.vars)for(let[e,r]of Object.entries(t.vars)){if(!r)continue;let t=R(e,{portable:!0});t&&(Qt(t)||(n[t]=r))}for(let[e,r]of Object.entries(t)){if(e===`shellEnv`||e===`vars`||typeof r!=`string`||!r.trim())continue;let t=R(e,{portable:!0});t&&(Qt(t)||(n[t]=r))}return n}function en(e){return $t(e)}function tn(e,t=process.env){let n={...t};return nn(e,n),n}function nn(e,t=process.env){let n=en(e);for(let[e,r]of Object.entries(n))t[e]?.trim()||Yt(r)||(t[e]=r)}var z=e(t(((e,t)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:new RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,`toString`,{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t;for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}else if(t=e.match(r.twoOctet))return(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})();else if(t=e.match(r.threeOctet))return(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})();else return null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[new e([100,65435,0,0,0,0,0,0]),96],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString(),n=0,r=-1,i;for(;i=e.exec(t);)i[0].length>r&&(n=i.index,r=i[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(t.parts===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,`toString`,{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch{throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`)}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(e)}))(),1);const rn=new Set([`unspecified`,`broadcast`,`multicast`,`linkLocal`,`loopback`,`carrierGradeNat`,`private`,`reserved`]),an=new Set([`loopback`,`private`,`linkLocal`,`carrierGradeNat`]),on=new Set([`unspecified`,`loopback`,`linkLocal`,`uniqueLocal`,`multicast`,`reserved`,`benchmarking`,`discard`,`orchid2`]),sn=[z.default.IPv4.parse(`198.18.0.0`),15],cn=[{matches:e=>e[0]===0&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===0,toHextets:e=>[e[6],e[7]]},{matches:e=>e[0]===100&&e[1]===65435&&e[2]===1&&e[3]===0&&e[4]===0&&e[5]===0,toHextets:e=>[e[6],e[7]]},{matches:e=>e[0]===8194,toHextets:e=>[e[1],e[2]]},{matches:e=>e[0]===8193&&e[1]===0,toHextets:e=>[e[6]^65535,e[7]^65535]},{matches:e=>(e[4]&64767)==0&&e[5]===24318,toHextets:e=>[e[6],e[7]]}];function ln(e){return e.startsWith(`[`)&&e.endsWith(`]`)?e.slice(1,-1):e}function un(e){return/^[0-9]+$/.test(e)||/^0x[0-9a-f]+$/i.test(e)}function dn(e){if(!e.includes(`:`)||!e.includes(`.`))return;let t=/^(.*:)([^:%]+(?:\.[^:%]+){3})(%[0-9A-Za-z]+)?$/i.exec(e);if(!t)return;let[,n,r,i=``]=t;if(!z.default.IPv4.isValidFourPartDecimal(r))return;let a=r.split(`.`).map(e=>Number.parseInt(e,10)),o=`${n}${(a[0]<<8|a[1]).toString(16)}:${(a[2]<<8|a[3]).toString(16)}${i}`;if(z.default.IPv6.isValid(o))return z.default.IPv6.parse(o)}function fn(e){return e.kind()===`ipv4`}function pn(e){return e.kind()===`ipv6`}function mn(e){return!pn(e)||!e.isIPv4MappedAddress()?e:e.toIPv4Address()}function hn(e){let t=n(e);if(t)return ln(t)}function gn(e){let t=hn(e);if(t)return z.default.IPv4.isValid(t)?z.default.IPv4.isValidFourPartDecimal(t)?z.default.IPv4.parse(t):void 0:z.default.IPv6.isValid(t)?z.default.IPv6.parse(t):dn(t)}function _n(e){let t=hn(e);if(t)return z.default.isValid(t)?z.default.parse(t):dn(t)}function vn(e){let t=gn(e);if(t)return i(mn(t).toString())}function yn(e){let t=n(e);if(!t)return!1;let r=ln(t);return r?z.default.IPv4.isValidFourPartDecimal(r):!1}function bn(e){let t=n(e);if(!t)return!1;let r=ln(t);if(!r||r.includes(`:`)||yn(r))return!1;let i=r.split(`.`);return!(i.length===0||i.length>4||i.some(e=>e.length===0)||!i.every(e=>un(e)))}function xn(e){let t=gn(e);return t?mn(t).range()===`loopback`:!1}function Sn(e){let t=gn(e);if(!t)return!1;let n=mn(t);return fn(n)?an.has(n.range()):Cn(n)}function Cn(e){let t=e.range();return on.has(t)?!0:(e.parts[0]&65472)==65216}function wn(e,t={}){let n=e.match(sn);return n&&t.allowRfc2544BenchmarkRange===!0?!1:rn.has(e.range())||n}function Tn(e,t){let n=[e>>>8&255,e&255,t>>>8&255,t&255];return z.default.IPv4.parse(n.join(`.`))}function En(e){if(e.isIPv4MappedAddress())return e.toIPv4Address();if(e.range()===`rfc6145`||e.range()===`rfc6052`)return Tn(e.parts[6],e.parts[7]);for(let t of cn){if(!t.matches(e.parts))continue;let[n,r]=t.toHextets(e.parts);return Tn(n,r)}}function Dn(e){let t=e?.commands?.ownerDisplay;return t===`hash`?{ownerDisplay:`hash`,ownerDisplaySecret:n(e?.commands?.ownerDisplaySecret)}:{ownerDisplay:t,ownerDisplaySecret:void 0}}function On(e,t=()=>ft.randomBytes(32).toString(`hex`)){let n=Dn(e);if(n.ownerDisplay!==`hash`||n.ownerDisplaySecret)return{config:e};let r=t();return{config:{...e,commands:{...e.commands,ownerDisplay:`hash`,ownerDisplaySecret:r}},generatedSecret:r}}const kn=[`.js`,`.mjs`,`.cjs`,`.ts`,`.mts`,`.cts`],An=lt(import.meta.url),jn=An.includes(`${I.sep}dist${I.sep}`)||An.includes(`${I.sep}dist-runtime${I.sep}`),Mn=new Map,Nn=new Map,Pn=new Map;function Fn(e){return qe({cache:Mn,modulePath:e,importerUrl:import.meta.url})}function In(e){let t=xe(e);return t.ok?t.moduleExport:Fn(e)(e)}function Ln(e){return JSON.stringify({...zn(e),pluginIds:[...e.pluginIds??[]].toSorted()})}function Rn(e){return JSON.stringify(zn(e))}function zn(e){let{roots:t,loadPaths:n}=Ue({workspaceDir:e.workspaceDir,env:e.env});return{roots:t,loadPaths:n}}function Bn(e){let t=jn?kn:[...kn.slice(3),...kn.slice(0,3)];for(let n of t){let t=I.join(e,`doctor-contract-api${n}`);if(F.existsSync(t))return t}for(let n of t){let t=I.join(e,`contract-api${n}`);if(F.existsSync(t))return t}return null}function Vn(e){return Array.isArray(e)?e.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return Array.isArray(t.path)&&typeof t.message==`string`}):[]}function Hn(e){return typeof e==`function`?e:void 0}function Un(e){let t=$e($e(e)?.talk);return t?[`voiceId`,`voiceAliases`,`modelId`,`outputFormat`,`apiKey`].some(e=>Object.prototype.hasOwnProperty.call(t,e)):!1}function Wn(e){let t=new Set,n=$e(e);if(!n)return[];let r=$e(n.channels);if(r)for(let e of Object.keys(r))e!==`defaults`&&t.add(e);let i=$e($e(n.plugins)?.entries);if(i)for(let e of Object.keys(i))t.add(e);return Un(n)&&t.add(`elevenlabs`),[...t].toSorted()}function Gn(e){let t=$e(e.raw);if(!t)return[];let n=new Set;for(let r of e.touchedPaths){let[i,a,o]=r;if(i===`channels`){if(!a)return Wn(e.raw);a!==`defaults`&&n.add(a);continue}if(i===`plugins`){if(a!==`entries`||!o)return Wn(e.raw);n.add(o);continue}i===`talk`&&Un(t)&&n.add(`elevenlabs`)}return[...n].toSorted()}function Kn(e){let t=Pn.get(e);return t||(t=new Map,Pn.set(e,t)),t}function qn(e,t){let n=Kn(t),r=n.get(e.id);if(r!==void 0)return r;let i=Bn(e.rootDir);if(!i)return n.set(e.id,null),null;let a;try{a=In(i)}catch{return n.set(e.id,null),null}let o=Vn(a.default?.legacyConfigRules??a.legacyConfigRules),s=Hn(a.normalizeCompatibilityConfig??a.default?.normalizeCompatibilityConfig);if(o.length===0&&!s)return n.set(e.id,null),null;let c={pluginId:e.id,rules:o,normalizeCompatibilityConfig:s};return n.set(e.id,c),c}function Jn(e){let t=e?.env??process.env,n=Rn({workspaceDir:e?.workspaceDir,env:t}),r=Ln({workspaceDir:e?.workspaceDir,env:t,pluginIds:e?.pluginIds}),i=Nn.get(r);if(i)return i;if(e?.pluginIds&&e.pluginIds.length===0)return Nn.set(r,[]),[];let a=Re({workspaceDir:e?.workspaceDir,env:t,cache:!0}),o=P({workspaceDir:e?.workspaceDir,env:t,cache:!0,candidates:a.candidates,diagnostics:a.diagnostics}),s=[],c=e?.pluginIds?new Set(e.pluginIds):null;for(let e of o.plugins){if(c&&!c.has(e.id)&&!e.channels.some(e=>c.has(e))&&!e.providers.some(e=>c.has(e)))continue;let t=qn(e,n);t&&s.push(t)}return Nn.set(r,s),s}function Yn(e){return Jn(e).flatMap(e=>e.rules)}function Xn(e,t){let n=e,r=[];for(let e of Jn(t)){let t=e.normalizeCompatibilityConfig?.({cfg:n});!t||t.changes.length===0||(n=t.config,r.push(...t.changes))}return{config:n,changes:r}}function Zn(e){return e===`lan`||e===`tailnet`||e===`custom`||e===`auto`}function Qn(e){return e.dangerouslyAllowHostHeaderOriginFallback===!0?!0:Array.isArray(e.allowedOrigins)&&e.allowedOrigins.some(e=>typeof e==`string`&&e.trim().length>0)}function $n(e,t=u){return typeof e==`number`&&e>0?e:t}function er(e){let t=new Set([`http://localhost:${e.port}`,`http://127.0.0.1:${e.port}`]),n=e.customBindHost?.trim();return e.bind===`custom`&&n&&t.add(`http://${n}:${e.port}`),[...t]}const tr=new Set(`name.token.tokenFile.botToken.appToken.account.signalNumber.authDir.cliPath.dbPath.httpUrl.httpHost.httpPort.webhookPath.webhookUrl.webhookSecret.service.region.homeserver.userId.accessToken.password.deviceName.url.code.dmPolicy.allowFrom.groupPolicy.groupAllowFrom.defaultTo`.split(`.`));function nr(e){return e&&typeof e==`object`?e:null}function rr(e){return nr(ot(e)?.setup)}function ir(e){return ye(e,`configPromotion`)?nr(ke(e)?.setup):null}function ar(e){return tr.has(e)}function or(e){let t=Object.keys(e.channel.accounts??{}).some(Boolean),n=Object.entries(e.channel).filter(([e,t])=>e!==`accounts`&&e!==`defaultAccount`&&e!==`enabled`&&t!==void 0).map(([e])=>e);if(n.length===0)return[];let r,i=()=>(r??=rr(e.channelKey),r),a,o=()=>(a??=ir(e.channelKey),a),s=n.filter(e=>ar(e)?!0:!!(i()?.singleAccountKeysToMove?.includes(e)||o()?.singleAccountKeysToMove?.includes(e)));if(!t||s.length===0)return s;let c=i()?.namedAccountPromotionKeys??o()?.namedAccountPromotionKeys;return c?s.filter(e=>c.includes(e)):s}const sr=`openclaw`,cr=new Set([`localhost`,`127.0.0.1`,`::1`,`[::1]`]),lr=new Set([`https://api.moonshot.ai/v1`,`https://api.moonshot.cn/v1`]),ur=new Set([`https://coding-intl.dashscope.aliyuncs.com/v1`,`https://coding.dashscope.aliyuncs.com/v1`,`https://dashscope.aliyuncs.com/compatible-mode/v1`,`https://dashscope-intl.aliyuncs.com/compatible-mode/v1`]),dr=new Set([`openai-responses`,`azure-openai-responses`,`openai-codex-responses`]),fr=new Set([`openai`,`azure-openai`,`azure-openai-responses`]),pr=new Set([`moonshot`,`kimi`]),mr=new Set([`xai-native`]);let hr=null;function gr(e){return`${sr}/${e}`}function _r(e){try{return a(new URL(e).hostname)}catch{return}}function vr(e){return/^[a-z0-9.[\]-]+(?::\d+)?(?:[/?#].*)?$/i.test(e)}function yr(e){let t=n(e);if(!t)return;let r=_r(t);if(r)return r;if(vr(t))return _r(`https://${t}`)}function br(e){let t=n(e);if(!t)return;let r=_r(t)||!vr(t)?t:`https://${t}`;try{let e=new URL(r);return e.protocol!==`http:`&&e.protocol!==`https:`?void 0:(e.hash=``,e.search=``,a(e.toString().replace(/\/+$/,``)))}catch{return}}function xr(e){return mr.has(e)}function Sr(){if(!hr){let e=P({cache:!0}),t=[];for(let n of e.plugins)for(let e of n.providerEndpoints??[])xr(e.endpointClass)&&t.push({endpointClass:e.endpointClass,hosts:(e.hosts??[]).map(e=>e.toLowerCase()),normalizedBaseUrls:(e.baseUrls??[]).map(e=>br(e)).filter(e=>e!==void 0)});hr=t}return hr}function Cr(e){for(let t of Sr())if(t.hosts.includes(e.host)||e.normalizedBaseUrl&&t.normalizedBaseUrls.includes(e.normalizedBaseUrl))return{endpointClass:t.endpointClass,hostname:e.host}}function wr(e){return cr.has(e)||e.endsWith(`.localhost`)||e.endsWith(`.local`)||e.endsWith(`.internal`)}function Tr(e){if(typeof e!=`string`||!e.trim())return{endpointClass:`default`};let t=yr(e);if(!t)return{endpointClass:`invalid`};let n=br(e);if(n&&lr.has(n))return{endpointClass:`moonshot-native`,hostname:t};if(n&&ur.has(n))return{endpointClass:`modelstudio-native`,hostname:t};if(t===`api.openai.com`)return{endpointClass:`openai-public`,hostname:t};if(t===`api.anthropic.com`)return{endpointClass:`anthropic-public`,hostname:t};if(t===`api.mistral.ai`)return{endpointClass:`mistral-public`,hostname:t};if(t===`api.cerebras.ai`)return{endpointClass:`cerebras-native`,hostname:t};if(t===`llm.chutes.ai`)return{endpointClass:`chutes-native`,hostname:t};if(t===`api.deepseek.com`)return{endpointClass:`deepseek-native`,hostname:t};if(t.endsWith(`.githubcopilot.com`))return{endpointClass:`github-copilot-native`,hostname:t};if(t===`api.groq.com`)return{endpointClass:`groq-native`,hostname:t};if(t===`chatgpt.com`)return{endpointClass:`openai-codex`,hostname:t};if(t===`opencode.ai`||t.endsWith(`.opencode.ai`))return{endpointClass:`opencode-native`,hostname:t};if(t===`openrouter.ai`||t.endsWith(`.openrouter.ai`))return{endpointClass:`openrouter`,hostname:t};if(t===`api.z.ai`)return{endpointClass:`zai-native`,hostname:t};if(t.endsWith(`.openai.azure.com`))return{endpointClass:`azure-openai`,hostname:t};if(t===`generativelanguage.googleapis.com`)return{endpointClass:`google-generative-ai`,hostname:t};if(t===`aiplatform.googleapis.com`)return{endpointClass:`google-vertex`,hostname:t,googleVertexRegion:`global`};let r=/^([a-z0-9-]+)-aiplatform\.googleapis\.com$/.exec(t);return r?{endpointClass:`google-vertex`,hostname:t,googleVertexRegion:r[1]}:Cr({host:t,normalizedBaseUrl:n})||(wr(t)?{endpointClass:`local`,hostname:t}:{endpointClass:`custom`,hostname:t})}function Er(e){switch(e){case`openai`:case`openai-codex`:case`azure-openai`:case`azure-openai-responses`:return`openai-family`;case`openrouter`:return`openrouter`;case`anthropic`:return`anthropic`;case`chutes`:return`chutes`;case`deepseek`:return`deepseek`;case`google`:return`google`;case`xai`:return`xai`;case`zai`:return`zai`;case`moonshot`:case`kimi`:return`moonshot`;case`qwen`:case`qwencloud`:case`modelstudio`:case`dashscope`:return`modelstudio`;case`github-copilot`:return`github-copilot`;case`groq`:return`groq`;case`mistral`:return`mistral`;case`together`:return`together`;default:return e||`unknown`}}function Dr(e){let t=a(e);return t!==void 0&&dr.has(t)}function Or(e=process.env){return{product:`OpenClaw`,version:Fe(e)}}function kr(e=process.env){let t=Or(e);return{provider:`openrouter`,enabledByDefault:!0,verification:`vendor-documented`,hook:`request-headers`,docsUrl:`https://openrouter.ai/docs/app-attribution`,reviewNote:`Documented app attribution headers. Verified in OpenClaw runtime wrapper.`,...t,headers:{"HTTP-Referer":`https://openclaw.ai`,"X-OpenRouter-Title":t.product,"X-OpenRouter-Categories":`cli-agent`}}}function Ar(e=process.env){let t=Or(e);return{provider:`openai`,enabledByDefault:!0,verification:`vendor-hidden-api-spec`,hook:`request-headers`,reviewNote:`OpenAI native traffic supports hidden originator/User-Agent attribution. Verified against the Codex wire contract.`,...t,headers:{originator:sr,version:t.version,"User-Agent":gr(t.version)}}}function jr(e=process.env){let t=Or(e);return{provider:`openai-codex`,enabledByDefault:!0,verification:`vendor-hidden-api-spec`,hook:`request-headers`,reviewNote:`OpenAI Codex ChatGPT-backed traffic supports the same hidden originator/User-Agent attribution contract.`,...t,headers:{originator:sr,version:t.version,"User-Agent":gr(t.version)}}}function Mr(e,t,n,r=process.env){return{provider:e,enabledByDefault:!1,verification:`vendor-sdk-hook-only`,hook:t,reviewNote:n,...Or(r)}}function Nr(e=process.env){return[kr(e),Ar(e),jr(e),Mr(`anthropic`,`default-headers`,`Anthropic JS SDK exposes defaultHeaders, but app attribution is not yet verified.`,e),Mr(`google`,`user-agent-extra`,`Google GenAI JS SDK exposes userAgentExtra/httpOptions, but provider-side attribution is not yet verified.`,e),Mr(`groq`,`default-headers`,`Groq JS SDK exposes defaultHeaders, but app attribution is not yet verified.`,e),Mr(`mistral`,`custom-user-agent`,`Mistral JS SDK exposes a custom userAgent option, but app attribution is not yet verified.`,e),Mr(`together`,`default-headers`,`Together JS SDK exposes defaultHeaders, but app attribution is not yet verified.`,e)]}function Pr(e,t=process.env){let n=j(e??``);return Nr(t).find(e=>e.provider===n)}function Fr(e,t=process.env){let n=Pr(e,t);if(n?.enabledByDefault)return n.headers}function Ir(e,t=process.env){let n=j(e.provider??``),r=Pr(n,t),i=Tr(e.baseUrl).endpointClass,o=a(e.api),s=i!==`default`,c=i===`openai-public`||i===`openai-codex`||i===`azure-openai`,l=i===`openai-public`,u=i===`openai-codex`,d=l||u,f=s&&!c,p;n===`openai`&&(o===`openai-completions`||o===`openai-responses`||e.capability===`audio`&&o===`openai-audio-transcriptions`)&&l?p=`openai`:n===`openai-codex`&&(o===`openai-codex-responses`||o===`openai-responses`)&&u?p=`openai-codex`:n===`openrouter`&&r?.enabledByDefault&&(i===`openrouter`||i===`default`)&&(p=`openrouter`);let m=p?Fr(p,t):void 0;return{provider:n||void 0,policy:r,endpointClass:i,usesConfiguredBaseUrl:s,knownProviderFamily:Er(n||void 0),attributionProvider:p,attributionHeaders:m,allowsHiddenAttribution:p!==void 0&&r?.verification===`vendor-hidden-api-spec`,usesKnownNativeOpenAIEndpoint:c,usesKnownNativeOpenAIRoute:i===`default`?n===`openai`:c,usesVerifiedOpenAIAttributionHost:d,usesExplicitProxyLikeEndpoint:f}}function Lr(e,t=process.env){let n=Ir(e,t),r=n.provider,i=a(e.api),o=n.endpointClass,s=o===`anthropic-public`||o===`cerebras-native`||o===`chutes-native`||o===`deepseek-native`||o===`github-copilot-native`||o===`groq-native`||o===`mistral-public`||o===`moonshot-native`||o===`modelstudio-native`||o===`openai-public`||o===`openai-codex`||o===`opencode-native`||o===`azure-openai`||o===`openrouter`||o===`xai-native`||o===`zai-native`||o===`google-generative-ai`||o===`google-vertex`,c;r&&pr.has(r)&&(c=`moonshot`);let l=Dr(i),u=e.compat?.supportsPromptCacheKey,d=u===!0?!1:u===!1?l:l&&n.usesExplicitProxyLikeEndpoint;return{...n,isKnownNativeEndpoint:s,allowsOpenAIServiceTier:r===`openai`&&i===`openai-responses`&&o===`openai-public`||r===`openai-codex`&&(i===`openai-codex-responses`||i===`openai-responses`)&&o===`openai-codex`,supportsOpenAIReasoningCompatPayload:r!==void 0&&i!==void 0&&!n.usesExplicitProxyLikeEndpoint&&(r===`openai`||r===`openai-codex`||r===`azure-openai`||r===`azure-openai-responses`)&&(i===`openai-completions`||i===`openai-responses`||i===`openai-codex-responses`||i===`azure-openai-responses`),allowsAnthropicServiceTier:r===`anthropic`&&i===`anthropic-messages`&&(o===`default`||o===`anthropic-public`),supportsResponsesStoreField:e.compat?.supportsStore!==!1&&l,allowsResponsesStore:e.compat?.supportsStore!==!1&&r!==void 0&&l&&fr.has(r)&&n.usesKnownNativeOpenAIEndpoint,shouldStripResponsesPromptCache:d,supportsNativeStreamingUsageCompat:o===`moonshot-native`||o===`modelstudio-native`,compatibilityFamily:c}}const Rr=new Set(`ALL_PROXY.ANTHROPIC_API_KEY.ANTHROPIC_OAUTH_TOKEN.BROWSER_EXECUTABLE_PATH.CLAWHUB_AUTH_TOKEN.CLAWHUB_CONFIG_PATH.CLAWHUB_TOKEN.CLAWHUB_URL.HTTP_PROXY.HTTPS_PROXY.IRC_HOST.MATTERMOST_URL.MATRIX_HOMESERVER.MINIMAX_API_HOST.NODE_TLS_REJECT_UNAUTHORIZED.NO_PROXY.OPENAI_API_KEY.OPENAI_API_KEYS.OPENCLAW_AGENT_DIR.OPENCLAW_ALLOW_INSECURE_PRIVATE_WS.OPENCLAW_ALLOW_PROJECT_LOCAL_BIN.OPENCLAW_BROWSER_EXECUTABLE_PATH.OPENCLAW_BROWSER_CONTROL_MODULE.OPENCLAW_BUNDLED_HOOKS_DIR.OPENCLAW_BUNDLED_PLUGINS_DIR.OPENCLAW_BUNDLED_SKILLS_DIR.OPENCLAW_CACHE_TRACE.OPENCLAW_CACHE_TRACE_FILE.OPENCLAW_CACHE_TRACE_MESSAGES.OPENCLAW_CACHE_TRACE_PROMPT.OPENCLAW_CACHE_TRACE_SYSTEM.OPENCLAW_CONFIG_PATH.OPENCLAW_GATEWAY_PASSWORD.OPENCLAW_GATEWAY_PORT.OPENCLAW_GATEWAY_SECRET.OPENCLAW_GATEWAY_TOKEN.OPENCLAW_GATEWAY_URL.OPENCLAW_HOME.OPENCLAW_LIVE_ANTHROPIC_KEY.OPENCLAW_LIVE_ANTHROPIC_KEYS.OPENCLAW_LIVE_GEMINI_KEY.OPENCLAW_LIVE_OPENAI_KEY.OPENCLAW_MPM_CATALOG_PATHS.OPENCLAW_NODE_EXEC_FALLBACK.OPENCLAW_NODE_EXEC_HOST.OPENCLAW_OAUTH_DIR.OPENCLAW_PINNED_PYTHON.OPENCLAW_PINNED_WRITE_PYTHON.OPENCLAW_PLUGIN_CATALOG_PATHS.OPENCLAW_PROFILE.OPENCLAW_RAW_STREAM.OPENCLAW_RAW_STREAM_PATH.OPENCLAW_SHOW_SECRETS.OPENCLAW_SKIP_BROWSER_CONTROL_SERVER.OPENCLAW_STATE_DIR.OPENCLAW_TEST_TAILSCALE_BINARY.PI_CODING_AGENT_DIR.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH.SYNOLOGY_CHAT_INCOMING_URL.SYNOLOGY_NAS_HOST.UV_PYTHON`.split(`.`)),zr=[`_API_HOST`,`_BASE_URL`,`_HOMESERVER`],Br=[`ANTHROPIC_API_KEY_`,`CLAWHUB_`,`OPENAI_API_KEY_`,`OPENCLAW_`,`OPENCLAW_CLAWHUB_`,`OPENCLAW_DISABLE_`,`OPENCLAW_SKIP_`,`OPENCLAW_UPDATE_`];function Vr(e){return Lt(e)||zt(e)}function Hr(e){return!1}function Ur(e){let t=e.toUpperCase();return Vr(t)||Rr.has(t)||Br.some(e=>t.startsWith(e))||zr.some(e=>t.endsWith(e))}function Wr(e){let t;try{t=F.readFileSync(e.filePath,`utf8`)}catch(t){return e.quiet||(t&&typeof t==`object`&&`code`in t?String(t.code):void 0)!==`ENOENT`&&console.warn(`[dotenv] Failed to read ${e.filePath}: ${String(t)}`),null}let n;try{n=mt.parse(t)}catch(t){return e.quiet||console.warn(`[dotenv] Failed to parse ${e.filePath}: ${String(t)}`),null}let r=[];for(let[t,i]of Object.entries(n)){let n=R(t,{portable:!0});!n||e.shouldBlockKey(n)||r.push({key:n,value:i})}return{filePath:e.filePath,entries:r}}function Gr(e,t){let n=Wr({filePath:e,shouldBlockKey:Ur,quiet:t?.quiet??!0});if(n)for(let{key:e,value:t}of n.entries)process.env[e]===void 0&&(process.env[e]=t)}function Kr(e){let t=new Set(Object.keys(process.env)),n=new Map,r=new Map;for(let i of e)for(let{key:e,value:a}of i.entries){if(t.has(e))continue;let o=r.get(e);if(o){if(o.value!==a){let t=`${o.filePath}\u0000${i.filePath}`,r=n.get(t);r?r.keys.add(e):n.set(t,{keptPath:o.filePath,ignoredPath:i.filePath,keys:new Set([e])})}continue}r.set(e,{value:a,filePath:i.filePath}),process.env[e]===void 0&&(process.env[e]=a)}for(let e of n.values()){let t=[...e.keys].toSorted();t.length!==0&&console.warn(`[dotenv] Conflicting values in ${e.keptPath} and ${e.ignoredPath} for ${t.join(`, `)}; keeping ${e.keptPath}.`)}}function qr(e){let t=e?.quiet??!0,n=e?.stateEnvPath??I.join(f(process.env),`.env`),i=I.join(r(process.env,ut.homedir),`.openclaw`,`.env`),a=process.env.OPENCLAW_STATE_DIR?.trim()!==void 0&&I.resolve(n)!==I.resolve(i),o=[Wr({filePath:n,shouldBlockKey:Hr,quiet:t})];a||o.push(Wr({filePath:I.join(r(process.env,ut.homedir),`.config`,`openclaw`,`gateway.env`),shouldBlockKey:Hr,quiet:t})),Kr(o.filter(e=>e!==null))}function Jr(e){let t=e?.quiet??!0;Gr(I.join(process.cwd(),`.env`),{quiet:t}),qr({quiet:t})}function Yr(e,t){let n=I.resolve(e),r=I.resolve(t),i=I.relative(n,r);return i===``||!i.startsWith(`..${I.sep}`)&&i!==`..`&&!I.isAbsolute(i)}var Xr=e(Ve(),1);const Zr=`$include`;var B=class extends Error{constructor(e,t,n){super(e),this.includePath=t,this.cause=n,this.name=`ConfigIncludeError`}},Qr=class extends B{constructor(e){super(`Circular include detected: ${e.join(` -> `)}`,e[e.length-1]),this.chain=e,this.name=`CircularIncludeError`}};function $r(e,t){if(Array.isArray(e)&&Array.isArray(t))return[...e,...t];if(m(e)&&m(t)){let n={...e};for(let e of Object.keys(t))l(e)||(n[e]=e in n?$r(n[e],t[e]):t[e]);return n}return t}var ei=class e{constructor(e,t,n){this.basePath=e,this.resolver=t,this.visited=new Set,this.depth=0,this.visited.add(I.normalize(e)),this.rootDir=I.normalize(n??I.dirname(e)),this.rootRealDir=I.normalize(ti(this.rootDir))}process(e){return Array.isArray(e)?e.map(e=>this.process(e)):m(e)?`$include`in e?this.processInclude(e):this.processObject(e):e}processObject(e){let t={};for(let[n,r]of Object.entries(e))t[n]=this.process(r);return t}processInclude(e){let t=e[Zr],n=Object.keys(e).filter(e=>e!==Zr),r=this.resolveInclude(t);if(n.length===0)return r;if(!m(r))throw new B(`Sibling keys require included content to be an object`,typeof t==`string`?t:Zr);let i={};for(let t of n)i[t]=this.process(e[t]);return $r(r,i)}resolveInclude(e){if(typeof e==`string`)return this.loadFile(e);if(Array.isArray(e))return e.reduce((e,t)=>{if(typeof t!=`string`)throw new B(`Invalid $include array item: expected string, got ${typeof t}`,String(t));return $r(e,this.loadFile(t))},{});throw new B(`Invalid $include value: expected string or array of strings, got ${typeof e}`,String(e))}loadFile(e){let t=this.resolvePath(e);this.checkCircular(t),this.checkDepth(e);let n=this.readFile(e,t),r=this.parseFile(e,t,n);return this.processNested(t,r)}resolvePath(e){let t=I.dirname(this.basePath),n=I.isAbsolute(e)?e:I.resolve(t,e),r=I.normalize(n);if(!Yr(this.rootDir,r))throw new B(`Include path escapes config directory: ${e} (root: ${this.rootDir})`,e);try{let t=F.realpathSync(r);if(!Yr(this.rootRealDir,t))throw new B(`Include path resolves outside config directory (symlink): ${e} (root: ${this.rootDir})`,e)}catch(e){if(e instanceof B)throw e}return r}checkCircular(e){if(this.visited.has(e))throw new Qr([...this.visited,e])}checkDepth(e){if(this.depth>=10)throw new B(`Maximum include depth (10) exceeded at: ${e}`,e)}readFile(e,t){try{return this.resolver.readFileWithGuards?this.resolver.readFileWithGuards({includePath:e,resolvedPath:t,rootRealDir:this.rootRealDir}):this.resolver.readFile(t)}catch(n){throw n instanceof B?n:new B(`Failed to read include file: ${e} (resolved: ${t})`,e,n instanceof Error?n:void 0)}}parseFile(e,t,n){try{return this.resolver.parseJson(n)}catch(n){throw new B(`Failed to parse include file: ${e} (resolved: ${t})`,e,n instanceof Error?n:void 0)}}processNested(t,n){let r=new e(t,this.resolver,this.rootDir);return r.visited=new Set([...this.visited,t]),r.depth=this.depth+1,r.process(n)}};function ti(e){try{return F.realpathSync(e)}catch{return e}}function ni(e){let t=e.ioFs??F,n=e.maxBytes??2097152;if(!Ge(t))return t.readFileSync(e.resolvedPath,`utf-8`);let r=We({absolutePath:e.resolvedPath,rootPath:e.rootRealDir,rootRealPath:e.rootRealDir,boundaryLabel:`config directory`,skipLexicalRootCheck:!0,maxBytes:n,ioFs:t});if(!r.ok)throw r.reason===`validation`?new B(`Include file failed security checks (regular file, max ${n} bytes, no hardlinks): ${e.includePath}`,e.includePath):new B(`Failed to read include file: ${e.includePath} (resolved: ${e.resolvedPath})`,e.includePath,r.error instanceof Error?r.error:void 0);try{return t.readFileSync(r.fd,`utf-8`)}finally{t.closeSync(r.fd)}}const ri={readFile:e=>F.readFileSync(e,`utf-8`),readFileWithGuards:({includePath:e,resolvedPath:t,rootRealDir:n})=>ni({includePath:e,resolvedPath:t,rootRealDir:n}),parseJson:e=>Xr.default.parse(e)};function ii(e,t,n=ri){return new ei(t,n).process(e)}const ai=new Set,oi=e=>!e||e.length===0?ai:new Set(e);function si(e,t){let n=new Set;for(let t of e)t.startsWith(`--`)&&n.add(t);for(let e of t)e.startsWith(`--`)&&n.add(e);return Array.from(n)}function ci(e){let t=new Map;for(let n of e)if(!(!n.startsWith(`--`)||n.length<=2))for(let e=3;e<=n.length;e+=1){let r=n.slice(0,e),i=t.get(r);if(i===void 0){t.set(r,n);continue}i!==n&&t.set(r,null)}return t}function li(e){let t=oi(e.allowedValueFlags),n=oi(e.deniedFlags),r=si(t,n);return{minPositional:e.minPositional,maxPositional:e.maxPositional,allowedValueFlags:t,deniedFlags:n,knownLongFlags:r,knownLongFlagsSet:new Set(r),longFlagPrefixMap:ci(r)}}function ui(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,li(t)]))}ui({jq:{maxPositional:1,allowedValueFlags:[`--arg`,`--argjson`,`--argstr`],deniedFlags:[`--argfile`,`--rawfile`,`--slurpfile`,`--from-file`,`--library-path`,`-L`,`-f`]},grep:{maxPositional:0,allowedValueFlags:[`--regexp`,`--max-count`,`--after-context`,`--before-context`,`--context`,`--devices`,`--binary-files`,`--exclude`,`--include`,`--label`,`-e`,`-m`,`-A`,`-B`,`-C`,`-D`],deniedFlags:[`--file`,`--exclude-from`,`--dereference-recursive`,`--directories`,`--recursive`,`-f`,`-d`,`-r`,`-R`]},cut:{maxPositional:0,allowedValueFlags:[`--bytes`,`--characters`,`--fields`,`--delimiter`,`--output-delimiter`,`-b`,`-c`,`-f`,`-d`]},sort:{maxPositional:0,allowedValueFlags:[`--key`,`--field-separator`,`--buffer-size`,`--parallel`,`--batch-size`,`-k`,`-t`,`-S`],deniedFlags:[`--compress-program`,`--files0-from`,`--output`,`--random-source`,`--temporary-directory`,`-T`,`-o`]},uniq:{maxPositional:0,allowedValueFlags:[`--skip-fields`,`--skip-chars`,`--check-chars`,`--group`,`-f`,`-s`,`-w`]},head:{maxPositional:0,allowedValueFlags:[`--lines`,`--bytes`,`-n`,`-c`]},tail:{maxPositional:0,allowedValueFlags:[`--lines`,`--bytes`,`--sleep-interval`,`--max-unchanged-stats`,`--pid`,`-n`,`-c`]},tr:{minPositional:1,maxPositional:2},wc:{maxPositional:0,deniedFlags:[`--files0-from`]}});function di(e){let t=i(e);return t.length>0?t:null}function fi(e){if(typeof e!=`number`||!Number.isFinite(e))return;let t=Math.trunc(e);return t>=0?t:void 0}function pi(e){if(!Array.isArray(e)||e.length===0)return;let t=Array.from(new Set(e.map(e=>e.trim()).filter(e=>e.length>0))).toSorted((e,t)=>e.localeCompare(t));return t.length>0?t:void 0}function mi(e){let t=fi(e.minPositional),n=fi(e.maxPositional);return{minPositional:t,maxPositional:t!==void 0&&n!==void 0&&n<t?t:n,allowedValueFlags:pi(e.allowedValueFlags),deniedFlags:pi(e.deniedFlags)}}function hi(e){let t={};if(!e)return t;for(let[n,r]of Object.entries(e)){let e=di(n);e&&(t[e]=mi(r))}return t}const gi=new Set([`-u`,`--unset`,`-c`,`--chdir`,`-s`,`--split-string`,`--default-signal`,`--ignore-signal`,`--block-signal`]),_i=[`-u`,`-c`,`-s`,`--unset=`,`--chdir=`,`--split-string=`,`--default-signal=`,`--ignore-signal=`,`--block-signal=`],vi=new Set([`-i`,`--ignore-environment`,`-0`,`--null`]),yi=new Set([`-n`,`--adjustment`,`--priority`]),bi=new Set([`-t`,`-w`]),xi=new Set([`-i`,`--input`,`-o`,`--output`,`-e`,`--error`]),Si=new Set([`-a`,`--append`,`-h`,`--help`,`-l`,`-p`,`-q`,`--quiet`,`-v`,`--verbose`,`-V`,`--version`]),Ci=new Set([`-f`,`--format`,`-o`,`--output`]),wi=new Set([`-a`,`-d`,`-k`,`-p`,`-q`,`-r`]),Ti=new Set([`-F`,`-t`]),Ei=new Set([`-f`,`-p`,`-d`]),Di=new Set([`--foreground`,`--preserve-status`,`-v`,`--verbose`]),Oi=new Set([`-k`,`--kill-after`,`-s`,`--signal`]),ki=new Set([`-k`,`--kill-cache`,`-l`,`--log`,`-n`,`--no-cache`,`-r`,`--run`,`-v`,`--verbose`]);function Ai(e){return/^-[A-Za-z0-9_]+$/.test(e)}function ji(e){return e===`-arm64`||e===`-arm64e`||e===`-i386`||e===`-x86_64`||e===`-x86_64h`}function Mi(e){return ji(`-${e}`)}function Ni(e){let t=new Set;for(let n of e)t.add(n),t.add(`${n}.exe`);return Array.from(t)}function Pi(e){return/^[A-Za-z_][A-Za-z0-9_]*=.*/.test(e)}function Fi(e){for(let t of _i)if(e.startsWith(t))return!0;return!1}function Ii(e,t){let n=1,r=!1;for(;n<e.length;){let a=e[n]?.trim()??``;if(!a){n+=1;continue}if(r){r=!1,n+=1;continue}if(t.separators?.has(a)){n+=1;break}let o=t.onToken(a,i(a));if(o===`stop`)break;if(o===`invalid`)return null;o===`consume-next`&&(r=!0),n+=1}if(r)return null;let a=t.adjustCommandIndex?t.adjustCommandIndex(n,e):n;return a===null||a>=e.length?null:e.slice(a)}function Li(e){let t=Ri(e);return t?e.slice(t.commandIndex):null}function Ri(e){let t=1,n=!1,r=[];for(;t<e.length;){let a=e[t]?.trim()??``;if(!a){t+=1;continue}if(n){n=!1,t+=1;continue}if(a===`--`||a===`-`){t+=1;break}if(Pi(a)){let e=a.indexOf(`=`);e>0&&r.push(a.slice(0,e)),t+=1;continue}if(!a.startsWith(`-`)||a===`-`)break;let o=i(a),[s]=o.split(`=`,2);if(vi.has(s)){t+=1;continue}if(gi.has(s)){if(o.includes(`=`)){t+=1;continue}n=!0,t+=1;continue}if(Fi(o)){t+=1;continue}return null}return n||t>=e.length?null:{assignmentKeys:r,commandIndex:t}}function zi(e){let t=1,n=!1;for(;t<e.length;){let r=e[t]?.trim()??``;if(!r){t+=1;continue}if(n)return!0;if(r===`--`||r===`-`){t+=1;break}if(Pi(r))return!0;if(!r.startsWith(`-`)||r===`-`)break;let a=i(r),[o]=a.split(`=`,2);if(vi.has(o))return!0;if(gi.has(o)){if(a.includes(`=`))return!0;n=!0,t+=1;continue}return Fi(a),!0}return!1}function Bi(e,t){return Ii(e,{separators:new Set([`--`]),onToken:(e,n)=>{if(!e.startsWith(`-`)||e===`-`)return`stop`;let[r]=n.split(`=`,2);return t.onFlag(r,n)},adjustCommandIndex:t.adjustCommandIndex})}function Vi(e){return Bi(e,{onFlag:(e,t)=>/^-\d+$/.test(t)?`continue`:yi.has(e)?t.includes(`=`)||t!==e?`continue`:`consume-next`:t.startsWith(`-n`)&&t.length>2?`continue`:`invalid`})}function Hi(e){return Bi(e,{onFlag:(e,t)=>e===`-d`||e===`-i`||e===`-m`||e===`-s`||e===`-u`?`continue`:bi.has(e)?t!==e||t.includes(`=`)?`continue`:`consume-next`:`invalid`})}function Ui(e){return Ii(e,{separators:new Set([`--`]),onToken:(e,t)=>!e.startsWith(`-`)||e===`-`?`stop`:t===`--help`||t===`--version`?`continue`:`invalid`})}function Wi(e){return Bi(e,{onFlag:(e,t)=>Ei.has(e)?t!==e||t.includes(`=`)?`continue`:`consume-next`:`invalid`})}function Gi(e){return Bi(e,{onFlag:(e,t)=>xi.has(e)?t.includes(`=`)?`continue`:`consume-next`:`invalid`})}function Ki(e){return Bi(e,{onFlag:(e,t)=>Si.has(e)?`continue`:Ci.has(e)?t.includes(`=`)?`continue`:`consume-next`:`invalid`})}function qi(e=process.platform){return e===`darwin`||e===`freebsd`}function Ji(e){return qi()?Ii(e,{separators:new Set([`--`]),onToken:(e,t)=>{if(!t.startsWith(`-`)||t===`-`)return`stop`;let[n]=e.split(`=`,2);return Ti.has(n)?e.includes(`=`)?`continue`:`consume-next`:wi.has(n)?`continue`:`invalid`},adjustCommandIndex:(e,t)=>{let n=!1;for(let r=e;r<t.length;r+=1)if(t[r]?.trim()??``){if(!n){n=!0;continue}return r}return null}}):null}function Yi(e){return Bi(e,{onFlag:(e,t)=>Di.has(e)?`continue`:Oi.has(e)?t.includes(`=`)?`continue`:`consume-next`:`invalid`,adjustCommandIndex:(e,t)=>{let n=e+1;return n<t.length?n:null}})}function Xi(e){let t=!1;return Ii(e,{onToken:(e,n)=>t?(t=!1,Mi(n)?`continue`:`invalid`):!e.startsWith(`-`)||e===`-`?`stop`:n===`-32`||n===`-64`?`continue`:n===`-arch`?(t=!0,`continue`):n===`-c`||n===`-d`||n===`-e`||n===`-h`?`invalid`:Ai(e)&&ji(n)?`continue`:`invalid`})}function Zi(e=process.platform){return e===`darwin`}function Qi(e=process.platform){return e===`darwin`}function $i(e){return Ii(e,{onToken:(e,t)=>!e.startsWith(`-`)||e===`-`?`stop`:ki.has(t)?`continue`:`invalid`})}const ea=[{name:`arch`,unwrap:(e,t)=>Zi(t)?Xi(e):null,transparentUsage:(e,t)=>Zi(t)},{name:`caffeinate`,unwrap:Hi,transparentUsage:!0},{name:`chrt`},{name:`doas`},{name:`env`,unwrap:Li,transparentUsage:e=>!zi(e)},{name:`ionice`},{name:`nice`,unwrap:Vi,transparentUsage:!0},{name:`nohup`,unwrap:Ui,transparentUsage:!0},{name:`sandbox-exec`,unwrap:Wi,transparentUsage:!0},{name:`script`,unwrap:Ji,transparentUsage:!0},{name:`setsid`},{name:`stdbuf`,unwrap:Gi,transparentUsage:!0},{name:`sudo`},{name:`taskset`},{name:`time`,unwrap:Ki,transparentUsage:!0},{name:`timeout`,unwrap:Yi,transparentUsage:!0},{name:`xcrun`,unwrap:(e,t)=>Qi(t)?$i(e):null,transparentUsage:(e,t)=>Qi(t)}];new Map(ea.map(e=>[e.name,e])),new Set(Ni(ea.map(e=>e.name)));const ta=[`ash`,`bash`,`dash`,`fish`,`ksh`,`sh`,`zsh`],na=[`cmd`],ra=[`powershell`,`pwsh`],ia=[`busybox`,`toybox`];function aa(e){let t=new Set;for(let n of e)t.add(n),t.add(`${n}.exe`);return Array.from(t)}new Set(ta),new Set(aa(na)),new Set(aa(ra)),new Set(ta),new Set(na),new Set(ra),new Set(ia),new Set([...ta,...na,...ra]);const oa={awk:`awk-family interpreters can execute commands, access ENVIRON, and write files, so prefer explicit allowlist entries or approval-gated runs instead of safeBins.`,jq:"jq supports broad jq programs and builtins (for example `env`), so prefer explicit allowlist entries or approval-gated runs instead of safeBins.",sed:`sed scripts can execute commands and write files, so prefer explicit allowlist entries or approval-gated runs instead of safeBins.`};oa.jq,oa.awk,oa.awk,oa.awk,oa.awk,oa.sed,oa.sed;function sa(e){if(!Array.isArray(e))return[];let t=e.map(e=>e.trim()).filter(e=>e.length>0);return Array.from(new Set(t))}function ca(e){return a(e)??``}function la(e,t){return Array.isArray(e)&&e.some(e=>ca(e)===t)}function ua(e,t){if(!(!e||typeof e!=`object`||Array.isArray(e))){for(let[n,r]of Object.entries(e))if(ca(n)===t)return r&&typeof r==`object`&&!Array.isArray(r)?r:{}}}function da(e){let t=e.config?.plugins;if(t?.enabled===!1)return!1;let n=ca(e.plugin.id);if(!n||la(t?.deny,n))return!1;let r=ua(t?.entries,n);return r?.enabled===!1?!1:r?.enabled===!0||la(t?.allow,n)?!0:e.isImplicitlyAllowed?.(n)??!1}const fa={config:0,bundled:1,global:2,workspace:3};function pa(e){return e?fa[e]??2**53-1:2**53-1}function ma(e,t){return da({config:t,isImplicitlyAllowed:e=>ca(t?.plugins?.slots?.contextEngine)===e,plugin:e})}function ha(e,t){return e.origin!==`workspace`||t?.includeUntrustedWorkspacePlugins===!0?!0:ma(e,t?.config)}function ga(e){let t=P({config:e?.config,workspaceDir:e?.workspaceDir,env:e?.env}),n=new Map,r=Object.create(null);for(let r of t.plugins)if(ha(r,e))for(let[e,t]of Object.entries(r.providerAuthAliases??{}).toSorted(([e],[t])=>e.localeCompare(t))){let i=j(e),a=j(t);if(i&&a){let e=n.get(i);(!e||pa(r.origin)<pa(e.origin))&&n.set(i,{origin:r.origin,target:a})}}for(let[e,t]of n)r[e]=t.target;return r}function _a(e,t){let n=j(e);return n&&(ga(t)[n]??n)}const va={anthropic:[`ANTHROPIC_OAUTH_TOKEN`,`ANTHROPIC_API_KEY`],openai:[`OPENAI_API_KEY`],voyage:[`VOYAGE_API_KEY`],cerebras:[`CEREBRAS_API_KEY`],"anthropic-openai":[`ANTHROPIC_API_KEY`],"qwen-dashscope":[`DASHSCOPE_API_KEY`]},ya={minimax:[`MINIMAX_API_KEY`],"minimax-cn":[`MINIMAX_API_KEY`]};function ba(e,t){return da({config:t,isImplicitlyAllowed:n=>Be(e.kind,`context-engine`)&&ca(t?.plugins?.slots?.contextEngine)===n,plugin:e})}function xa(e,t){return e.origin!==`workspace`||t?.includeUntrustedWorkspacePlugins!==!1?!0:ba(e,t?.config)}function Sa(e,t,n){let r=t.trim();if(!r||n.length===0)return;let i=e[r]??=[],a=new Set(i);for(let e of n){let t=e.trim();!t||a.has(t)||(a.add(t),i.push(t))}}function Ca(e){let t=P({config:e?.config,workspaceDir:e?.workspaceDir,env:e?.env}),n={};for(let r of t.plugins)if(xa(r,e)&&r.providerAuthEnvVars)for(let[e,t]of Object.entries(r.providerAuthEnvVars).toSorted(([e],[t])=>e.localeCompare(t)))Sa(n,e,t);let r=ga(e);for(let[e,t]of Object.entries(r).toSorted(([e],[t])=>e.localeCompare(t))){let r=n[t];r&&Sa(n,e,r)}return n}function wa(e){return{...Ca(e),...va}}function Ta(e){return{...wa(e),...ya}}const Ea=new Set;function Da(e){let t;Ea.add(()=>{t=void 0});let n=()=>(t??=e(),t);return new Proxy({},{get(e,t){if(typeof t==`string`)return n()[t]},has(e,t){return typeof t==`string`&&Object.hasOwn(n(),t)},ownKeys(){return Reflect.ownKeys(n())},getOwnPropertyDescriptor(e,t){if(typeof t!=`string`)return;let r=n()[t];if(r!==void 0)return{configurable:!0,enumerable:!0,value:r,writable:!1}}})}Da(()=>wa()),Da(()=>Ta());function Oa(e){return[...new Set([...Object.values(wa(e)).flatMap(e=>e),...Object.values(Ta(e)).flatMap(e=>e)])]}function ka(e){let t=e.registry??P({config:e.config,workspaceDir:e.workspaceDir,env:e.env});return Pe({command:e.command,registry:t})}const Aa=/^data:/i,ja=/^https?:\/\//i,Ma=/^[a-z][a-z0-9+.-]*:/i,Na=/^[a-zA-Z]:[\\/]/;function Pa(e){return Aa.test(e)}function Fa(e){return ja.test(e)}function Ia(e){return Ma.test(e)}function La(e){return Na.test(e)}function Ra(e,t){let n=I.relative(e,t);return n===``?!0:!n.startsWith(`..`)&&!I.isAbsolute(n)}const za={b:1,kb:1024,k:1024,mb:1024**2,m:1024**2,gb:1024**3,g:1024**3,tb:1024**4,t:1024**4};function Ba(e,t){let r=i(n(e)??``);if(!r)throw Error(`invalid byte size (empty)`);let a=/^(\d+(?:\.\d+)?)([a-z]+)?$/.exec(r);if(!a)throw Error(`invalid byte size: ${e}`);let o=Number(a[1]);if(!Number.isFinite(o)||o<0)throw Error(`invalid byte size: ${e}`);let s=za[i(a[2]??t?.defaultUnit??`b`)];if(!s)throw Error(`invalid byte size unit: ${e}`);let c=Math.round(o*s);if(!Number.isFinite(c))throw Error(`invalid byte size: ${e}`);return c}function Va(e){return a(e)||void 0}function Ha(e){let t=Va(e.network);return t?t===`host`?`host`:t.startsWith(`container:`)&&e.allowContainerNamespaceJoin!==!0?`container_namespace_join`:null:null}const V=L.union([L.string(),L.object({primary:L.string().optional(),fallbacks:L.array(L.string()).optional()}).strict()]),Ua=L.object({every:L.string().optional(),activeHours:L.object({start:L.string().optional(),end:L.string().optional(),timezone:L.string().optional()}).strict().optional(),model:L.string().optional(),session:L.string().optional(),includeReasoning:L.boolean().optional(),target:L.string().optional(),directPolicy:L.union([L.literal(`allow`),L.literal(`block`)]).optional(),to:L.string().optional(),accountId:L.string().optional(),prompt:L.string().optional(),includeSystemPromptSection:L.boolean().optional(),ackMaxChars:L.number().int().nonnegative().optional(),suppressToolErrorWarnings:L.boolean().optional(),timeoutSeconds:L.number().int().positive().optional(),lightContext:L.boolean().optional(),isolatedSession:L.boolean().optional()}).strict().superRefine((e,t)=>{if(!e.every)return;try{gt(e.every,{defaultUnit:`m`})}catch{t.addIssue({code:L.ZodIssueCode.custom,path:[`every`],message:`invalid duration (use ms, s, m, h)`})}let n=e.activeHours;if(!n)return;let r=/^([01]\d|2[0-3]|24):([0-5]\d)$/,i=(e,n,i)=>{if(!e)return;if(!r.test(e)){t.addIssue({code:L.ZodIssueCode.custom,path:[`activeHours`,i],message:`invalid time (use "HH:MM" 24h format)`});return}let[a,o]=e.split(`:`),s=Number(a),c=Number(o);if(s===24&&c!==0){t.addIssue({code:L.ZodIssueCode.custom,path:[`activeHours`,i],message:`invalid time (24:00 is the only allowed 24:xx value)`});return}s===24&&!n.allow24&&t.addIssue({code:L.ZodIssueCode.custom,path:[`activeHours`,i],message:`invalid time (start cannot be 24:00)`})};i(n.start,{allow24:!1},`start`),i(n.end,{allow24:!0},`end`)}).optional(),Wa=L.object({image:L.string().optional(),containerPrefix:L.string().optional(),workdir:L.string().optional(),readOnlyRoot:L.boolean().optional(),tmpfs:L.array(L.string()).optional(),network:L.string().optional(),user:L.string().optional(),capDrop:L.array(L.string()).optional(),env:L.record(L.string(),L.string()).optional(),setupCommand:L.union([L.string(),L.array(L.string())]).transform(e=>Array.isArray(e)?e.join(`
2
+ `):e).optional(),pidsLimit:L.number().int().positive().optional(),memory:L.union([L.string(),L.number()]).optional(),memorySwap:L.union([L.string(),L.number()]).optional(),cpus:L.number().positive().optional(),ulimits:L.record(L.string(),L.union([L.string(),L.number(),L.object({soft:L.number().int().nonnegative().optional(),hard:L.number().int().nonnegative().optional()}).strict()])).optional(),seccompProfile:L.string().optional(),apparmorProfile:L.string().optional(),dns:L.array(L.string()).optional(),extraHosts:L.array(L.string()).optional(),binds:L.array(L.string()).optional(),dangerouslyAllowReservedContainerTargets:L.boolean().optional(),dangerouslyAllowExternalBindSources:L.boolean().optional(),dangerouslyAllowContainerNamespaceJoin:L.boolean().optional()}).strict().superRefine((e,t)=>{if(e.binds)for(let r=0;r<e.binds.length;r+=1){let i=n(e.binds[r])??``;if(!i){t.addIssue({code:L.ZodIssueCode.custom,path:[`binds`,r],message:`Sandbox security: bind mount entry must be a non-empty string.`});continue}let a=i.indexOf(`:`),o=(a<=0?i:i.slice(0,a)).trim();o.startsWith(`/`)||t.addIssue({code:L.ZodIssueCode.custom,path:[`binds`,r],message:`Sandbox security: bind mount "${i}" uses a non-absolute source path "${o}". Only absolute POSIX paths are supported for sandbox binds.`})}let r=Ha({network:e.network,allowContainerNamespaceJoin:e.dangerouslyAllowContainerNamespaceJoin===!0});r===`host`&&t.addIssue({code:L.ZodIssueCode.custom,path:[`network`],message:`Sandbox security: network mode "host" is blocked. Use "bridge" or "none" instead.`}),r===`container_namespace_join`&&t.addIssue({code:L.ZodIssueCode.custom,path:[`network`],message:`Sandbox security: network mode "container:*" is blocked by default. Use a custom bridge network, or set dangerouslyAllowContainerNamespaceJoin=true only when you fully trust this runtime.`}),i(e.seccompProfile??``)===`unconfined`&&t.addIssue({code:L.ZodIssueCode.custom,path:[`seccompProfile`],message:`Sandbox security: seccomp profile "unconfined" is blocked. Use a custom seccomp profile file or omit this setting.`}),i(e.apparmorProfile??``)===`unconfined`&&t.addIssue({code:L.ZodIssueCode.custom,path:[`apparmorProfile`],message:`Sandbox security: apparmor profile "unconfined" is blocked. Use a named AppArmor profile or omit this setting.`})}).optional(),Ga=L.object({enabled:L.boolean().optional(),image:L.string().optional(),containerPrefix:L.string().optional(),network:L.string().optional(),cdpPort:L.number().int().positive().optional(),cdpSourceRange:L.string().optional(),vncPort:L.number().int().positive().optional(),noVncPort:L.number().int().positive().optional(),headless:L.boolean().optional(),enableNoVnc:L.boolean().optional(),allowHostControl:L.boolean().optional(),autoStart:L.boolean().optional(),autoStartTimeoutMs:L.number().int().positive().optional(),binds:L.array(L.string()).optional()}).superRefine((e,t)=>{i(e.network??``)===`host`&&t.addIssue({code:L.ZodIssueCode.custom,path:[`network`],message:`Sandbox security: browser network mode "host" is blocked. Use "bridge" or a custom bridge network instead.`})}).strict().optional(),Ka=L.object({idleHours:L.number().int().nonnegative().optional(),maxAgeDays:L.number().int().nonnegative().optional()}).strict().optional(),qa=L.object({memoryGetMaxChars:L.number().int().min(1).max(25e4).optional(),memoryGetDefaultLines:L.number().int().min(1).max(5e3).optional(),toolResultMaxChars:L.number().int().min(1).max(25e4).optional(),postCompactionMaxChars:L.number().int().min(1).max(5e4).optional()}).strict().optional(),Ja=L.object({maxSkillsPromptChars:L.number().int().min(0).optional()}).strict().optional(),H=L.object({allow:L.array(L.string()).optional(),alsoAllow:L.array(L.string()).optional(),deny:L.array(L.string()).optional()}).strict().superRefine((e,t)=>{e.allow&&e.allow.length>0&&e.alsoAllow&&e.alsoAllow.length>0&&t.addIssue({code:L.ZodIssueCode.custom,message:`tools policy cannot set both allow and alsoAllow in the same scope (merge alsoAllow into allow, or remove allow and use profile + alsoAllow)`})}).optional(),Ya=L.preprocess(e=>{if(typeof e!=`string`)return e;let t=e.trim();return t.length>0?t:void 0},L.string().optional()),Xa=L.array(L.string()).transform(e=>{let t=[...new Set(e.map(e=>e.trim()).filter(e=>e.length>0))];return t.length>0?t:void 0}).optional(),Za=L.object({country:Ya,region:Ya,city:Ya,timezone:Ya}).strict().transform(e=>e.country||e.region||e.city||e.timezone?e:void 0).optional(),Qa=L.object({enabled:L.boolean().optional(),provider:L.string().optional(),maxResults:L.number().int().positive().optional(),timeoutSeconds:L.number().int().positive().optional(),cacheTtlMinutes:L.number().nonnegative().optional(),apiKey:D.optional().register(N),openaiCodex:L.object({enabled:L.boolean().optional(),mode:L.union([L.literal(`cached`),L.literal(`live`)]).optional(),allowedDomains:Xa,contextSize:L.union([L.literal(`low`),L.literal(`medium`),L.literal(`high`)]).optional(),userLocation:Za}).strict().optional()}).strict().optional(),$a=L.object({enabled:L.boolean().optional(),provider:L.string().optional(),maxChars:L.number().int().positive().optional(),maxCharsCap:L.number().int().positive().optional(),maxResponseBytes:L.number().int().positive().optional(),timeoutSeconds:L.number().int().positive().optional(),cacheTtlMinutes:L.number().nonnegative().optional(),maxRedirects:L.number().int().nonnegative().optional(),userAgent:L.string().optional(),readability:L.boolean().optional(),ssrfPolicy:L.object({allowRfc2544BenchmarkRange:L.boolean().optional()}).strict().optional(),firecrawl:L.object({enabled:L.boolean().optional(),apiKey:D.optional().register(N),baseUrl:L.string().optional(),onlyMainContent:L.boolean().optional(),maxAgeMs:L.number().int().nonnegative().optional(),timeoutSeconds:L.number().int().positive().optional()}).strict().optional()}).strict().optional(),eo=L.object({enabled:L.boolean().optional(),model:L.string().optional(),inlineCitations:L.boolean().optional(),maxTurns:L.number().int().optional(),timeoutSeconds:L.number().int().positive().optional(),cacheTtlMinutes:L.number().nonnegative().optional()}).strict().optional(),to=L.object({search:Qa,fetch:$a,x_search:eo}).strict().optional(),no=L.union([L.literal(`minimal`),L.literal(`coding`),L.literal(`messaging`),L.literal(`full`)]).optional();function ro(e,t,n){e.allow&&e.allow.length>0&&e.alsoAllow&&e.alsoAllow.length>0&&t.addIssue({code:L.ZodIssueCode.custom,message:n})}const io=L.object({allow:L.array(L.string()).optional(),alsoAllow:L.array(L.string()).optional(),deny:L.array(L.string()).optional(),profile:no}).strict().superRefine((e,t)=>{ro(e,t,`tools.byProvider policy cannot set both allow and alsoAllow in the same scope (merge alsoAllow into allow, or remove allow and use profile + alsoAllow)`)}),ao=L.record(L.string(),L.array(L.union([L.string(),L.number()]))).optional(),oo=L.object({enabled:L.boolean().optional(),workspaceOnly:L.boolean().optional(),allowModels:L.array(L.string()).optional()}).strict().optional(),so=L.object({minPositional:L.number().int().nonnegative().optional(),maxPositional:L.number().int().nonnegative().optional(),allowedValueFlags:L.array(L.string()).optional(),deniedFlags:L.array(L.string()).optional()}).strict(),co={host:L.enum([`auto`,`sandbox`,`gateway`,`node`]).optional(),security:L.enum([`deny`,`allowlist`,`full`]).optional(),ask:L.enum([`off`,`on-miss`,`always`]).optional(),node:L.string().optional(),pathPrepend:L.array(L.string()).optional(),safeBins:L.array(L.string()).optional(),strictInlineEval:L.boolean().optional(),safeBinTrustedDirs:L.array(L.string()).optional(),safeBinProfiles:L.record(L.string(),so).optional(),backgroundMs:L.number().int().positive().optional(),timeoutSec:L.number().int().positive().optional(),cleanupMs:L.number().int().positive().optional(),notifyOnExit:L.boolean().optional(),notifyOnExitEmptySuccess:L.boolean().optional(),applyPatch:oo},lo=L.object({...co,approvalRunningNoticeMs:L.number().int().nonnegative().optional()}).strict().optional(),uo=L.object(co).strict().optional(),fo=L.object({workspaceOnly:L.boolean().optional()}).strict().optional(),po=L.object({genericRepeat:L.boolean().optional(),knownPollNoProgress:L.boolean().optional(),pingPong:L.boolean().optional()}).strict().optional(),mo=L.object({enabled:L.boolean().optional(),historySize:L.number().int().positive().optional(),warningThreshold:L.number().int().positive().optional(),unknownToolThreshold:L.number().int().positive().optional(),criticalThreshold:L.number().int().positive().optional(),globalCircuitBreakerThreshold:L.number().int().positive().optional(),detectors:po}).strict().superRefine((e,t)=>{e.warningThreshold!==void 0&&e.criticalThreshold!==void 0&&e.warningThreshold>=e.criticalThreshold&&t.addIssue({code:L.ZodIssueCode.custom,path:[`criticalThreshold`],message:`tools.loopDetection.warningThreshold must be lower than criticalThreshold.`}),e.criticalThreshold!==void 0&&e.globalCircuitBreakerThreshold!==void 0&&e.criticalThreshold>=e.globalCircuitBreakerThreshold&&t.addIssue({code:L.ZodIssueCode.custom,path:[`globalCircuitBreakerThreshold`],message:`tools.loopDetection.criticalThreshold must be lower than globalCircuitBreakerThreshold.`})}).optional(),ho=L.object({target:L.string().min(1).optional(),command:L.string().min(1).optional(),workspaceRoot:L.string().min(1).optional(),strictHostKeyChecking:L.boolean().optional(),updateHostKeys:L.boolean().optional(),identityFile:L.string().min(1).optional(),certificateFile:L.string().min(1).optional(),knownHostsFile:L.string().min(1).optional(),identityData:D.optional().register(N),certificateData:D.optional().register(N),knownHostsData:D.optional().register(N)}).strict().optional(),go=L.object({mode:L.union([L.literal(`off`),L.literal(`non-main`),L.literal(`all`)]).optional(),backend:L.string().min(1).optional(),workspaceAccess:L.union([L.literal(`none`),L.literal(`ro`),L.literal(`rw`)]).optional(),sessionToolsVisibility:L.union([L.literal(`spawned`),L.literal(`all`)]).optional(),scope:L.union([L.literal(`session`),L.literal(`agent`),L.literal(`shared`)]).optional(),workspaceRoot:L.string().optional(),docker:Wa,ssh:ho,browser:Ga,prune:Ka}).strict().superRefine((e,t)=>{Ha({network:e.browser?.network,allowContainerNamespaceJoin:e.docker?.dangerouslyAllowContainerNamespaceJoin===!0})===`container_namespace_join`&&t.addIssue({code:L.ZodIssueCode.custom,path:[`browser`,`network`],message:`Sandbox security: browser network mode "container:*" is blocked by default. Set sandbox.docker.dangerouslyAllowContainerNamespaceJoin=true only when you fully trust this runtime.`})}).optional(),_o={profile:no,allow:L.array(L.string()).optional(),alsoAllow:L.array(L.string()).optional(),deny:L.array(L.string()).optional(),byProvider:L.record(L.string(),io).optional()},vo=L.object({..._o,elevated:L.object({enabled:L.boolean().optional(),allowFrom:ao}).strict().optional(),exec:lo,fs:fo,loopDetection:mo,sandbox:L.object({tools:H}).strict().optional()}).strict().superRefine((e,t)=>{ro(e,t,`agent tools cannot set both allow and alsoAllow in the same scope (merge alsoAllow into allow, or remove allow and use profile + alsoAllow)`)}).optional(),yo=L.object({enabled:L.boolean().optional(),sources:L.array(L.union([L.literal(`memory`),L.literal(`sessions`)])).optional(),extraPaths:L.array(L.string()).optional(),qmd:L.object({extraCollections:L.array(L.object({path:L.string(),name:L.string().optional(),pattern:L.string().optional()}).strict()).optional()}).strict().optional(),multimodal:L.object({enabled:L.boolean().optional(),modalities:L.array(L.union([L.literal(`image`),L.literal(`audio`),L.literal(`all`)])).optional(),maxFileBytes:L.number().int().positive().optional()}).strict().optional(),experimental:L.object({sessionMemory:L.boolean().optional()}).strict().optional(),provider:L.string().optional(),remote:L.object({baseUrl:L.string().optional(),apiKey:D.optional().register(N),headers:L.record(L.string(),L.string()).optional(),batch:L.object({enabled:L.boolean().optional(),wait:L.boolean().optional(),concurrency:L.number().int().positive().optional(),pollIntervalMs:L.number().int().nonnegative().optional(),timeoutMinutes:L.number().int().positive().optional()}).strict().optional()}).strict().optional(),fallback:L.string().optional(),model:L.string().optional(),outputDimensionality:L.number().int().positive().optional(),local:L.object({modelPath:L.string().optional(),modelCacheDir:L.string().optional()}).strict().optional(),store:L.object({driver:L.literal(`sqlite`).optional(),path:L.string().optional(),fts:L.object({tokenizer:L.union([L.literal(`unicode61`),L.literal(`trigram`)]).optional()}).strict().optional(),vector:L.object({enabled:L.boolean().optional(),extensionPath:L.string().optional()}).strict().optional()}).strict().optional(),chunking:L.object({tokens:L.number().int().positive().optional(),overlap:L.number().int().nonnegative().optional()}).strict().optional(),sync:L.object({onSessionStart:L.boolean().optional(),onSearch:L.boolean().optional(),watch:L.boolean().optional(),watchDebounceMs:L.number().int().nonnegative().optional(),intervalMinutes:L.number().int().nonnegative().optional(),sessions:L.object({deltaBytes:L.number().int().nonnegative().optional(),deltaMessages:L.number().int().nonnegative().optional(),postCompactionForce:L.boolean().optional()}).strict().optional()}).strict().optional(),query:L.object({maxResults:L.number().int().positive().optional(),minScore:L.number().min(0).max(1).optional(),hybrid:L.object({enabled:L.boolean().optional(),vectorWeight:L.number().min(0).max(1).optional(),textWeight:L.number().min(0).max(1).optional(),candidateMultiplier:L.number().int().positive().optional(),mmr:L.object({enabled:L.boolean().optional(),lambda:L.number().min(0).max(1).optional()}).strict().optional(),temporalDecay:L.object({enabled:L.boolean().optional(),halfLifeDays:L.number().int().positive().optional()}).strict().optional()}).strict().optional()}).strict().optional(),cache:L.object({enabled:L.boolean().optional(),maxEntries:L.number().int().positive().optional()}).strict().optional()}).strict().optional(),bo=L.object({agent:L.string().optional(),backend:L.string().optional(),mode:L.enum([`persistent`,`oneshot`]).optional(),cwd:L.string().optional()}).strict().optional(),xo=L.union([L.object({type:L.literal(`embedded`)}).strict(),L.object({type:L.literal(`acp`),acp:bo}).strict()]).optional(),So=L.object({runtime:L.string().optional(),fallback:L.enum([`pi`,`none`]).optional()}).strict().optional(),Co=L.object({id:L.string(),default:L.boolean().optional(),name:L.string().optional(),workspace:L.string().optional(),agentDir:L.string().optional(),systemPromptOverride:L.string().optional(),embeddedHarness:So,model:V.optional(),thinkingDefault:L.enum([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`adaptive`,`max`]).optional(),reasoningDefault:L.enum([`on`,`off`,`stream`]).optional(),fastModeDefault:L.boolean().optional(),skills:L.array(L.string()).optional(),memorySearch:yo,humanDelay:de.optional(),skillsLimits:Ja,contextLimits:qa,heartbeat:Ua,identity:Ne,groupChat:re,subagents:L.object({allowAgents:L.array(L.string()).optional(),model:L.union([L.string(),L.object({primary:L.string().optional(),fallbacks:L.array(L.string()).optional()}).strict()]).optional(),thinking:L.string().optional(),requireAgentId:L.boolean().optional()}).strict().optional(),embeddedPi:L.object({executionContract:L.union([L.literal(`default`),L.literal(`strict-agentic`)]).optional()}).strict().optional(),sandbox:go,params:L.record(L.string(),L.unknown()).optional(),tools:vo,runtime:xo}).strict(),wo=L.object({..._o,web:to,media:be,links:y,sessions:L.object({visibility:L.enum([`self`,`tree`,`agent`,`all`]).optional()}).strict().optional(),loopDetection:mo,message:L.object({allowCrossContextSend:L.boolean().optional(),crossContext:L.object({allowWithinProvider:L.boolean().optional(),allowAcrossProviders:L.boolean().optional(),marker:L.object({enabled:L.boolean().optional(),prefix:L.string().optional(),suffix:L.string().optional()}).strict().optional()}).strict().optional(),broadcast:L.object({enabled:L.boolean().optional()}).strict().optional()}).strict().optional(),agentToAgent:L.object({enabled:L.boolean().optional(),allow:L.array(L.string()).optional()}).strict().optional(),elevated:L.object({enabled:L.boolean().optional(),allowFrom:ao}).strict().optional(),exec:uo,fs:fo,subagents:L.object({tools:H}).strict().optional(),sandbox:L.object({tools:H}).strict().optional(),sessions_spawn:L.object({attachments:L.object({enabled:L.boolean().optional(),maxTotalBytes:L.number().optional(),maxFiles:L.number().optional(),maxFileBytes:L.number().optional(),retainOnSessionKeep:L.boolean().optional()}).strict().optional()}).strict().optional(),experimental:L.object({planTool:L.boolean().optional()}).strict().optional()}).strict().superRefine((e,t)=>{ro(e,t,`tools cannot set both allow and alsoAllow in the same scope (merge alsoAllow into allow, or remove allow and use profile + alsoAllow)`)}).optional(),To=/^[A-Za-z0-9._-]+$/,Eo=/^\[[0-9A-Fa-f:.%]+\]$/,Do=/\s/;function Oo(e){for(let t of e){let e=t.charCodeAt(0);if(e<=31||e===127||Do.test(t))return!0}return!1}function ko(e){let t=n(e);if(!t||Oo(t)||t.startsWith(`-`)||t.includes(`/`)||t.includes(`\\`))return;let r=t.indexOf(`@`),i=t.lastIndexOf(`@`),a,o=t;if(!(r!==-1&&(r!==i||r===0||r===t.length-1||(a=t.slice(0,r),o=t.slice(r+1),!To.test(a))))&&!(!o||o.startsWith(`-`)||o.includes(`@`))&&!(o.includes(`:`)&&!Eo.test(o))&&!(!To.test(o)&&!Eo.test(o)))return a?`${a}@${o}`:o}function Ao(e){return ko(e)!==void 0}const jo=/^[A-Za-z]:\//,Mo=/^[A-Za-z]:$/;function No(e){let t=e.trim();if(!t||t.includes(`\0`))return;let n=I.posix.normalize(t.replaceAll(`\\`,`/`));if(!(n.startsWith(`/`)||jo.test(n))||n===`/`)return;let r=n.endsWith(`/`)?n.slice(0,-1):n;if(!Mo.test(r))return r}function Po(e){return e.split(`/`).filter(Boolean)}function Fo(e){let t=No(e);if(!t)return!1;let n=Po(t);return n.length===0?!1:n.every(e=>e===`*`||!e.includes(`*`))}function Io(e){let t=e.trim();return t?i(t.startsWith(`/`)?t.slice(1):t).replace(/-/g,`_`):``}function Lo(e){return e.trim()}function Ro(e){let t=Array.isArray(e.commands)?e.commands:[],n=e.reservedCommands??new Set,r=e.checkReserved!==!1,i=e.checkDuplicates!==!1,a=new Set,o=[],s=[],c=e.config.label,l=e.config.prefix??`/`;for(let u=0;u<t.length;u+=1){let d=t[u],f=Io(d?.command??``);if(!f){s.push({index:u,field:`command`,message:`${c} custom command is missing a command name.`});continue}if(!e.config.pattern.test(f)){s.push({index:u,field:`command`,message:`${c} custom command "${l}${f}" is invalid (${e.config.patternDescription}).`});continue}if(r&&n.has(f)){s.push({index:u,field:`command`,message:`${c} custom command "${l}${f}" conflicts with a native command.`});continue}if(i&&a.has(f)){s.push({index:u,field:`command`,message:`${c} custom command "${l}${f}" is duplicated.`});continue}let p=Lo(d?.description??``);if(!p){s.push({index:u,field:`description`,message:`${c} custom command "${l}${f}" is missing a description.`});continue}i&&a.add(f),o.push({command:f,description:p})}return{commands:o,issues:s}}const U=L.object({showOk:L.boolean().optional(),showAlerts:L.boolean().optional(),useIndicator:L.boolean().optional()}).strict().optional(),W=L.object({enabled:L.boolean().optional()}).strict().optional();function zo(e,t){if(e)for(let[n,r]of Object.entries(e))!r||r.enabled===!1||t(n,r)}function Bo(e,t){let r=n(e.webhookUrl)??``,i=Me(e.webhookSecret);r&&!i&&t.addIssue({code:L.ZodIssueCode.custom,message:`channels.telegram.webhookUrl requires channels.telegram.webhookSecret`,path:[`webhookSecret`]}),zo(e.accounts,(e,r)=>{(n(r.webhookUrl)??``)&&!Me(r.webhookSecret)&&!i&&t.addIssue({code:L.ZodIssueCode.custom,message:`channels.telegram.accounts.*.webhookUrl requires channels.telegram.webhookSecret or channels.telegram.accounts.*.webhookSecret`,path:[`accounts`,e,`webhookSecret`]})})}function Vo(e,t){let n=e.mode===`http`||e.mode===`socket`?e.mode:`socket`;n===`http`&&!Me(e.signingSecret)&&t.addIssue({code:L.ZodIssueCode.custom,message:`channels.slack.mode="http" requires channels.slack.signingSecret`,path:[`signingSecret`]}),zo(e.accounts,(r,i)=>{(i.mode===`http`||i.mode===`socket`?i.mode:n)===`http`&&(Me(i.signingSecret??e.signingSecret)||t.addIssue({code:L.ZodIssueCode.custom,message:`channels.slack.accounts.*.mode="http" requires channels.slack.signingSecret or channels.slack.accounts.*.signingSecret`,path:[`accounts`,r,`signingSecret`]}))})}const G=L.record(L.string(),H).optional(),Ho=L.union([L.string(),L.number()]).transform((e,t)=>typeof e==`number`?!Number.isSafeInteger(e)||e<0?(t.addIssue({code:L.ZodIssueCode.custom,message:`Discord ID "${String(e)}" is not a valid non-negative safe integer. Wrap it in quotes in your config file.`}),L.NEVER):String(e):e).pipe(L.string()),Uo=L.array(Ho),Wo=L.enum([`off`,`dm`,`group`,`all`,`allowlist`]),Go=L.array(L.union([L.string(),L.number()])),Ko=L.union([L.array(L.string()),L.object({inlineButtons:Wo.optional()}).strict()]),qo=L.enum([`length`,`newline`]),Jo=L.enum([`off`,`partial`,`block`,`progress`]),Yo=L.object({enabled:L.boolean().optional(),coalesce:A.optional()}).strict(),Xo=L.object({chunk:ce.optional(),toolProgress:L.boolean().optional()}).strict(),Zo=L.object({mode:Jo.optional(),chunkMode:qo.optional(),preview:Xo.optional(),block:Yo.optional()}).strict(),Qo=Zo.extend({nativeTransport:L.boolean().optional()}).strict(),$o=L.union([L.array(L.string()),L.object({interactiveReplies:L.boolean().optional()}).strict()]),es=L.enum([`always`,`once`,`silent`]).optional(),ts={label:`Telegram`,pattern:/^[a-z0-9_]{1,32}$/,patternDescription:`use a-z, 0-9, underscore; max 32 chars`},ns=L.object({requireMention:L.boolean().optional(),ingest:L.boolean().optional(),disableAudioPreflight:L.boolean().optional(),groupPolicy:x.optional(),skills:L.array(L.string()).optional(),enabled:L.boolean().optional(),allowFrom:L.array(L.union([L.string(),L.number()])).optional(),systemPrompt:L.string().optional(),agentId:L.string().optional(),errorPolicy:es,errorCooldownMs:L.number().int().nonnegative().optional()}).strict(),rs=L.object({requireMention:L.boolean().optional(),ingest:L.boolean().optional(),disableAudioPreflight:L.boolean().optional(),groupPolicy:x.optional(),tools:H,toolsBySender:G,skills:L.array(L.string()).optional(),enabled:L.boolean().optional(),allowFrom:L.array(L.union([L.string(),L.number()])).optional(),systemPrompt:L.string().optional(),topics:L.record(L.string(),ns.optional()).optional(),errorPolicy:es,errorCooldownMs:L.number().int().nonnegative().optional()}).strict(),is=L.union([L.boolean(),L.object({enabled:L.boolean().optional(),prompt:L.string().optional()}).strict()]).optional(),as=L.object({dmPolicy:T.optional(),tools:H,toolsBySender:G,skills:L.array(L.string()).optional(),enabled:L.boolean().optional(),allowFrom:L.array(L.union([L.string(),L.number()])).optional(),systemPrompt:L.string().optional(),topics:L.record(L.string(),ns.optional()).optional(),errorPolicy:es,errorCooldownMs:L.number().int().nonnegative().optional(),requireTopic:L.boolean().optional(),autoTopicLabel:is}).strict(),os=L.object({command:L.string().overwrite(Io),description:L.string().overwrite(Lo)}).strict(),ss=(e,t)=>{if(!e.customCommands||e.customCommands.length===0)return;let{issues:n}=Ro({commands:e.customCommands,checkReserved:!1,checkDuplicates:!1,config:ts});for(let e of n)t.addIssue({code:L.ZodIssueCode.custom,path:[`customCommands`,e.index,e.field],message:e.message})},cs=L.object({name:L.string().optional(),capabilities:Ko.optional(),execApprovals:L.object({enabled:L.boolean().optional(),approvers:Go.optional(),agentFilter:L.array(L.string()).optional(),sessionFilter:L.array(L.string()).optional(),target:L.enum([`dm`,`channel`,`both`]).optional()}).strict().optional(),markdown:E,enabled:L.boolean().optional(),commands:oe,customCommands:L.array(os).optional(),configWrites:L.boolean().optional(),dmPolicy:T.optional().default(`pairing`),botToken:D.optional().register(N),tokenFile:L.string().optional(),replyToMode:S.optional(),groups:L.record(L.string(),rs.optional()).optional(),allowFrom:L.array(L.union([L.string(),L.number()])).optional(),defaultTo:L.union([L.string(),L.number()]).optional(),groupAllowFrom:L.array(L.union([L.string(),L.number()])).optional(),groupPolicy:x.optional().default(`allowlist`),contextVisibility:k.optional(),historyLimit:L.number().int().min(0).optional(),dmHistoryLimit:L.number().int().min(0).optional(),dms:L.record(L.string(),w.optional()).optional(),direct:L.record(L.string(),as.optional()).optional(),textChunkLimit:L.number().int().positive().optional(),streaming:Zo.optional(),mediaMaxMb:L.number().positive().optional(),timeoutSeconds:L.number().int().positive().optional(),pollingStallThresholdMs:L.number().int().min(3e4).max(6e5).optional(),retry:he,network:L.object({autoSelectFamily:L.boolean().optional(),dnsResultOrder:L.enum([`ipv4first`,`verbatim`]).optional(),dangerouslyAllowPrivateNetwork:L.boolean().optional().describe(`Dangerous opt-in for trusted Telegram fake-IP or transparent-proxy environments where api.telegram.org resolves to private/internal/special-use addresses during media downloads.`)}).strict().optional(),proxy:L.string().optional(),webhookUrl:L.string().optional().describe(`Public HTTPS webhook URL registered with Telegram for inbound updates. This must be internet-reachable and requires channels.telegram.webhookSecret.`),webhookSecret:D.optional().describe(`Secret token sent to Telegram during webhook registration and verified on inbound webhook requests. Telegram returns this value for verification; this is not the gateway auth token and not the bot token.`).register(N),webhookPath:L.string().optional().describe(`Local webhook route path served by the gateway listener. Defaults to /telegram-webhook.`),webhookHost:L.string().optional().describe(`Local bind host for the webhook listener. Defaults to 127.0.0.1; keep loopback unless you intentionally expose direct ingress.`),webhookPort:L.number().int().nonnegative().optional().describe(`Local bind port for the webhook listener. Defaults to 8787; set to 0 to let the OS assign an ephemeral port.`),webhookCertPath:L.string().optional().describe(`Path to the self-signed certificate (PEM) to upload to Telegram during webhook registration. Required for self-signed certs (direct IP or no domain).`),actions:L.object({reactions:L.boolean().optional(),sendMessage:L.boolean().optional(),poll:L.boolean().optional(),deleteMessage:L.boolean().optional(),editMessage:L.boolean().optional(),sticker:L.boolean().optional(),createForumTopic:L.boolean().optional(),editForumTopic:L.boolean().optional()}).strict().optional(),threadBindings:L.object({enabled:L.boolean().optional(),idleHours:L.number().nonnegative().optional(),maxAgeHours:L.number().nonnegative().optional(),spawnSubagentSessions:L.boolean().optional(),spawnAcpSessions:L.boolean().optional()}).strict().optional(),reactionNotifications:L.enum([`off`,`own`,`all`]).optional(),reactionLevel:L.enum([`off`,`ack`,`minimal`,`extensive`]).optional(),heartbeat:U,healthMonitor:W,linkPreview:L.boolean().optional(),silentErrorReplies:L.boolean().optional(),responsePrefix:L.string().optional(),ackReaction:L.string().optional(),errorPolicy:es,errorCooldownMs:L.number().int().nonnegative().optional(),apiRoot:L.string().url().optional(),trustedLocalFileRoots:L.array(L.string()).optional().describe(`Trusted local filesystem roots for self-hosted Telegram Bot API absolute file_path values. Only absolute paths under these roots are read directly; all other absolute paths are rejected.`),autoTopicLabel:is}).strict(),ls=cs.superRefine((e,t)=>{ss(e,t)});cs.extend({accounts:L.record(L.string(),ls.optional()).optional(),defaultAccount:L.string().optional()}).superRefine((e,t)=>{if(M({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.telegram.dmPolicy="open" requires channels.telegram.allowFrom to include "*"`}),O({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.telegram.dmPolicy="allowlist" requires channels.telegram.allowFrom to contain at least one sender ID`}),ss(e,t),e.accounts)for(let[n,r]of Object.entries(e.accounts)){if(!r)continue;let i=r.dmPolicy??e.dmPolicy,a=r.allowFrom??e.allowFrom;M({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.telegram.accounts.*.dmPolicy="open" requires channels.telegram.accounts.*.allowFrom (or channels.telegram.allowFrom) to include "*"`}),O({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.telegram.accounts.*.dmPolicy="allowlist" requires channels.telegram.accounts.*.allowFrom (or channels.telegram.allowFrom) to contain at least one sender ID`})}if(!e.accounts){Bo(e,t);return}for(let[n,r]of Object.entries(e.accounts)){if(!r||r.enabled===!1)continue;let i=r.dmPolicy??e.dmPolicy,a=Array.isArray(r.allowFrom)?r.allowFrom:e.allowFrom;M({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.telegram.accounts.*.dmPolicy="open" requires channels.telegram.allowFrom or channels.telegram.accounts.*.allowFrom to include "*"`}),O({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.telegram.accounts.*.dmPolicy="allowlist" requires channels.telegram.allowFrom or channels.telegram.accounts.*.allowFrom to contain at least one sender ID`})}Bo(e,t)});const us=L.object({enabled:L.boolean().optional(),policy:T.optional(),allowFrom:Uo.optional(),groupEnabled:L.boolean().optional(),groupChannels:Uo.optional()}).strict(),ds=L.object({inheritParent:L.boolean().optional()}).strict(),fs=L.object({requireMention:L.boolean().optional(),ignoreOtherMentions:L.boolean().optional(),tools:H,toolsBySender:G,skills:L.array(L.string()).optional(),enabled:L.boolean().optional(),users:Uo.optional(),roles:Uo.optional(),systemPrompt:L.string().optional(),includeThreadStarter:L.boolean().optional(),autoThread:L.boolean().optional(),autoThreadName:L.enum([`message`,`generated`]).optional(),autoArchiveDuration:L.union([L.enum([`60`,`1440`,`4320`,`10080`]),L.literal(60),L.literal(1440),L.literal(4320),L.literal(10080)]).optional()}).strict(),ps=L.object({slug:L.string().optional(),requireMention:L.boolean().optional(),ignoreOtherMentions:L.boolean().optional(),tools:H,toolsBySender:G,reactionNotifications:L.enum([`off`,`own`,`all`,`allowlist`]).optional(),users:Uo.optional(),roles:Uo.optional(),channels:L.record(L.string(),fs.optional()).optional()}).strict(),ms=L.object({components:L.object({accentColor:C.optional()}).strict().optional()}).strict().optional(),hs=L.object({guildId:L.string().min(1),channelId:L.string().min(1)}).strict(),gs=L.object({enabled:L.boolean().optional(),autoJoin:L.array(hs).optional(),daveEncryption:L.boolean().optional(),decryptionFailureTolerance:L.number().int().min(0).optional(),tts:we.optional()}).strict().optional(),_s=L.object({name:L.string().optional(),capabilities:L.array(L.string()).optional(),markdown:E,enabled:L.boolean().optional(),commands:oe,configWrites:L.boolean().optional(),token:D.optional().register(N),proxy:L.string().optional(),allowBots:L.union([L.boolean(),L.literal(`mentions`)]).optional(),dangerouslyAllowNameMatching:L.boolean().optional(),groupPolicy:x.optional().default(`allowlist`),contextVisibility:k.optional(),historyLimit:L.number().int().min(0).optional(),dmHistoryLimit:L.number().int().min(0).optional(),dms:L.record(L.string(),w.optional()).optional(),textChunkLimit:L.number().int().positive().optional(),streaming:Zo.optional(),maxLinesPerMessage:L.number().int().positive().optional(),mediaMaxMb:L.number().positive().optional(),retry:he,actions:L.object({reactions:L.boolean().optional(),stickers:L.boolean().optional(),emojiUploads:L.boolean().optional(),stickerUploads:L.boolean().optional(),polls:L.boolean().optional(),permissions:L.boolean().optional(),messages:L.boolean().optional(),threads:L.boolean().optional(),pins:L.boolean().optional(),search:L.boolean().optional(),memberInfo:L.boolean().optional(),roleInfo:L.boolean().optional(),roles:L.boolean().optional(),channelInfo:L.boolean().optional(),voiceStatus:L.boolean().optional(),events:L.boolean().optional(),moderation:L.boolean().optional(),channels:L.boolean().optional(),presence:L.boolean().optional()}).strict().optional(),replyToMode:S.optional(),thread:ds.optional(),dmPolicy:T.optional(),allowFrom:Uo.optional(),defaultTo:L.string().optional(),dm:us.optional(),guilds:L.record(L.string(),ps.optional()).optional(),heartbeat:U,healthMonitor:W,execApprovals:L.object({enabled:L.boolean().optional(),approvers:Uo.optional(),agentFilter:L.array(L.string()).optional(),sessionFilter:L.array(L.string()).optional(),cleanupAfterResolve:L.boolean().optional(),target:L.enum([`dm`,`channel`,`both`]).optional()}).strict().optional(),agentComponents:L.object({enabled:L.boolean().optional()}).strict().optional(),ui:ms,slashCommand:L.object({ephemeral:L.boolean().optional()}).strict().optional(),threadBindings:L.object({enabled:L.boolean().optional(),idleHours:L.number().nonnegative().optional(),maxAgeHours:L.number().nonnegative().optional(),spawnSubagentSessions:L.boolean().optional(),spawnAcpSessions:L.boolean().optional()}).strict().optional(),intents:L.object({presence:L.boolean().optional(),guildMembers:L.boolean().optional()}).strict().optional(),voice:gs,pluralkit:L.object({enabled:L.boolean().optional(),token:D.optional().register(N)}).strict().optional(),responsePrefix:L.string().optional(),ackReaction:L.string().optional(),ackReactionScope:L.enum([`group-mentions`,`group-all`,`direct`,`all`,`off`,`none`]).optional(),activity:L.string().optional(),status:L.enum([`online`,`dnd`,`idle`,`invisible`]).optional(),autoPresence:L.object({enabled:L.boolean().optional(),intervalMs:L.number().int().positive().optional(),minUpdateIntervalMs:L.number().int().positive().optional(),healthyText:L.string().optional(),degradedText:L.string().optional(),exhaustedText:L.string().optional()}).strict().optional(),activityType:L.union([L.literal(0),L.literal(1),L.literal(2),L.literal(3),L.literal(4),L.literal(5)]).optional(),activityUrl:L.string().url().optional(),inboundWorker:L.object({runTimeoutMs:L.number().int().nonnegative().optional()}).strict().optional(),eventQueue:L.object({listenerTimeout:L.number().int().positive().optional(),maxQueueSize:L.number().int().positive().optional(),maxConcurrency:L.number().int().positive().optional()}).strict().optional()}).strict().superRefine((e,t)=>{let r=!!(n(e.activity)??``),i=e.activityType!==void 0,a=!!(n(e.activityUrl)??``);(i||a)&&!r&&t.addIssue({code:L.ZodIssueCode.custom,message:`channels.discord.activity is required when activityType or activityUrl is set`,path:[`activity`]}),e.activityType===1&&!a&&t.addIssue({code:L.ZodIssueCode.custom,message:`channels.discord.activityUrl is required when activityType is 1 (Streaming)`,path:[`activityUrl`]}),a&&e.activityType!==1&&t.addIssue({code:L.ZodIssueCode.custom,message:`channels.discord.activityType must be 1 (Streaming) when activityUrl is set`,path:[`activityType`]});let o=e.autoPresence?.intervalMs,s=e.autoPresence?.minUpdateIntervalMs;typeof o==`number`&&typeof s==`number`&&s>o&&t.addIssue({code:L.ZodIssueCode.custom,message:`channels.discord.autoPresence.minUpdateIntervalMs must be less than or equal to channels.discord.autoPresence.intervalMs`,path:[`autoPresence`,`minUpdateIntervalMs`]})});_s.extend({accounts:L.record(L.string(),_s.optional()).optional(),defaultAccount:L.string().optional()}).superRefine((e,t)=>{let n=e.dmPolicy??e.dm?.policy??`pairing`,r=e.allowFrom??e.dm?.allowFrom,i=e.allowFrom===void 0?[`dm`,`allowFrom`]:[`allowFrom`];if(M({policy:n,allowFrom:r,ctx:t,path:[...i],message:`channels.discord.dmPolicy="open" requires channels.discord.allowFrom (or channels.discord.dm.allowFrom) to include "*"`}),O({policy:n,allowFrom:r,ctx:t,path:[...i],message:`channels.discord.dmPolicy="allowlist" requires channels.discord.allowFrom (or channels.discord.dm.allowFrom) to contain at least one sender ID`}),e.accounts)for(let[n,r]of Object.entries(e.accounts)){if(!r)continue;let i=r.dmPolicy??r.dm?.policy??e.dmPolicy??e.dm?.policy??`pairing`,a=r.allowFrom??r.dm?.allowFrom??e.allowFrom??e.dm?.allowFrom;M({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.discord.accounts.*.dmPolicy="open" requires channels.discord.accounts.*.allowFrom (or channels.discord.allowFrom) to include "*"`}),O({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.discord.accounts.*.dmPolicy="allowlist" requires channels.discord.accounts.*.allowFrom (or channels.discord.allowFrom) to contain at least one sender ID`})}});const vs=L.object({enabled:L.boolean().optional(),policy:T.optional().default(`pairing`),allowFrom:L.array(L.union([L.string(),L.number()])).optional()}).strict().superRefine((e,t)=>{M({policy:e.policy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.googlechat.dm.policy="open" requires channels.googlechat.dm.allowFrom to include "*"`}),O({policy:e.policy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.googlechat.dm.policy="allowlist" requires channels.googlechat.dm.allowFrom to contain at least one sender ID`})}),ys=L.object({enabled:L.boolean().optional(),requireMention:L.boolean().optional(),users:L.array(L.union([L.string(),L.number()])).optional(),systemPrompt:L.string().optional()}).strict(),bs=L.object({name:L.string().optional(),capabilities:L.array(L.string()).optional(),enabled:L.boolean().optional(),configWrites:L.boolean().optional(),allowBots:L.boolean().optional(),dangerouslyAllowNameMatching:L.boolean().optional(),requireMention:L.boolean().optional(),groupPolicy:x.optional().default(`allowlist`),groupAllowFrom:L.array(L.union([L.string(),L.number()])).optional(),groups:L.record(L.string(),ys.optional()).optional(),defaultTo:L.string().optional(),serviceAccount:L.union([L.string(),L.record(L.string(),L.unknown()),ge]).optional().register(N),serviceAccountRef:ge.optional().register(N),serviceAccountFile:L.string().optional(),audienceType:L.enum([`app-url`,`project-number`]).optional(),audience:L.string().optional(),appPrincipal:L.string().optional(),webhookPath:L.string().optional(),webhookUrl:L.string().optional(),botUser:L.string().optional(),historyLimit:L.number().int().min(0).optional(),dmHistoryLimit:L.number().int().min(0).optional(),dms:L.record(L.string(),w.optional()).optional(),textChunkLimit:L.number().int().positive().optional(),chunkMode:L.enum([`length`,`newline`]).optional(),blockStreaming:L.boolean().optional(),blockStreamingCoalesce:A.optional(),mediaMaxMb:L.number().positive().optional(),replyToMode:S.optional(),actions:L.object({reactions:L.boolean().optional()}).strict().optional(),dm:vs.optional(),healthMonitor:W,typingIndicator:L.enum([`none`,`message`,`reaction`]).optional(),responsePrefix:L.string().optional()}).strict();bs.extend({accounts:L.record(L.string(),bs.optional()).optional(),defaultAccount:L.string().optional()});const xs=L.object({enabled:L.boolean().optional(),policy:T.optional(),allowFrom:L.array(L.union([L.string(),L.number()])).optional(),groupEnabled:L.boolean().optional(),groupChannels:L.array(L.union([L.string(),L.number()])).optional(),replyToMode:S.optional()}).strict(),Ss=L.object({enabled:L.boolean().optional(),requireMention:L.boolean().optional(),tools:H,toolsBySender:G,allowBots:L.boolean().optional(),users:L.array(L.union([L.string(),L.number()])).optional(),skills:L.array(L.string()).optional(),systemPrompt:L.string().optional()}).strict(),Cs=L.object({historyScope:L.enum([`thread`,`channel`]).optional(),inheritParent:L.boolean().optional(),initialHistoryLimit:L.number().int().min(0).optional(),requireExplicitMention:L.boolean().optional()}).strict(),ws=L.object({direct:S.optional(),group:S.optional(),channel:S.optional()}).strict(),Ts=L.object({name:L.string().optional(),mode:L.enum([`socket`,`http`]).optional(),signingSecret:D.optional().register(N),webhookPath:L.string().optional(),capabilities:$o.optional(),execApprovals:L.object({enabled:L.boolean().optional(),approvers:L.array(L.union([L.string(),L.number()])).optional(),agentFilter:L.array(L.string()).optional(),sessionFilter:L.array(L.string()).optional(),target:L.enum([`dm`,`channel`,`both`]).optional()}).strict().optional(),markdown:E,enabled:L.boolean().optional(),commands:oe,configWrites:L.boolean().optional(),botToken:D.optional().register(N),appToken:D.optional().register(N),userToken:D.optional().register(N),userTokenReadOnly:L.boolean().optional().default(!0),allowBots:L.boolean().optional(),dangerouslyAllowNameMatching:L.boolean().optional(),requireMention:L.boolean().optional(),groupPolicy:x.optional(),contextVisibility:k.optional(),historyLimit:L.number().int().min(0).optional(),dmHistoryLimit:L.number().int().min(0).optional(),dms:L.record(L.string(),w.optional()).optional(),textChunkLimit:L.number().int().positive().optional(),streaming:Qo.optional(),mediaMaxMb:L.number().positive().optional(),reactionNotifications:L.enum([`off`,`own`,`all`,`allowlist`]).optional(),reactionAllowlist:L.array(L.union([L.string(),L.number()])).optional(),replyToMode:S.optional(),replyToModeByChatType:ws.optional(),thread:Cs.optional(),actions:L.object({reactions:L.boolean().optional(),messages:L.boolean().optional(),pins:L.boolean().optional(),search:L.boolean().optional(),permissions:L.boolean().optional(),memberInfo:L.boolean().optional(),channelInfo:L.boolean().optional(),emojiList:L.boolean().optional()}).strict().optional(),slashCommand:L.object({enabled:L.boolean().optional(),name:L.string().optional(),sessionPrefix:L.string().optional(),ephemeral:L.boolean().optional()}).strict().optional(),dmPolicy:T.optional(),allowFrom:L.array(L.union([L.string(),L.number()])).optional(),defaultTo:L.string().optional(),dm:xs.optional(),channels:L.record(L.string(),Ss.optional()).optional(),heartbeat:U,healthMonitor:W,responsePrefix:L.string().optional(),ackReaction:L.string().optional(),typingReaction:L.string().optional()}).strict().superRefine(()=>{});Ts.safeExtend({mode:L.enum([`socket`,`http`]).optional().default(`socket`),signingSecret:D.optional().register(N),webhookPath:L.string().optional().default(`/slack/events`),groupPolicy:x.optional().default(`allowlist`),contextVisibility:k.optional(),accounts:L.record(L.string(),Ts.optional()).optional(),defaultAccount:L.string().optional()}).superRefine((e,t)=>{let n=e.dmPolicy??e.dm?.policy??`pairing`,r=e.allowFrom??e.dm?.allowFrom,i=e.allowFrom===void 0?[`dm`,`allowFrom`]:[`allowFrom`];if(M({policy:n,allowFrom:r,ctx:t,path:[...i],message:`channels.slack.dmPolicy="open" requires channels.slack.allowFrom (or channels.slack.dm.allowFrom) to include "*"`}),O({policy:n,allowFrom:r,ctx:t,path:[...i],message:`channels.slack.dmPolicy="allowlist" requires channels.slack.allowFrom (or channels.slack.dm.allowFrom) to contain at least one sender ID`}),e.mode,!e.accounts){Vo(e,t);return}for(let[n,r]of Object.entries(e.accounts)){if(!r||r.enabled===!1)continue;r.mode;let i=r.dmPolicy??r.dm?.policy??e.dmPolicy??e.dm?.policy??`pairing`,a=r.allowFrom??r.dm?.allowFrom??e.allowFrom??e.dm?.allowFrom;M({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.slack.accounts.*.dmPolicy="open" requires channels.slack.accounts.*.allowFrom (or channels.slack.allowFrom) to include "*"`}),O({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.slack.accounts.*.dmPolicy="allowlist" requires channels.slack.accounts.*.allowFrom (or channels.slack.allowFrom) to contain at least one sender ID`})}Vo(e,t)});const Es=L.object({requireMention:L.boolean().optional(),ingest:L.boolean().optional(),tools:H,toolsBySender:G}).strict(),Ds=L.record(L.string(),Es.optional()).optional(),Os=L.object({name:L.string().optional(),capabilities:L.array(L.string()).optional(),markdown:E,enabled:L.boolean().optional(),configWrites:L.boolean().optional(),account:L.string().optional(),accountUuid:L.string().optional(),httpUrl:L.string().optional(),httpHost:L.string().optional(),httpPort:L.number().int().positive().optional(),cliPath:le.optional(),autoStart:L.boolean().optional(),startupTimeoutMs:L.number().int().min(1e3).max(12e4).optional(),receiveMode:L.union([L.literal(`on-start`),L.literal(`manual`)]).optional(),ignoreAttachments:L.boolean().optional(),ignoreStories:L.boolean().optional(),sendReadReceipts:L.boolean().optional(),dmPolicy:T.optional().default(`pairing`),allowFrom:L.array(L.union([L.string(),L.number()])).optional(),defaultTo:L.string().optional(),groupAllowFrom:L.array(L.union([L.string(),L.number()])).optional(),groupPolicy:x.optional().default(`allowlist`),contextVisibility:k.optional(),groups:Ds,historyLimit:L.number().int().min(0).optional(),dmHistoryLimit:L.number().int().min(0).optional(),dms:L.record(L.string(),w.optional()).optional(),textChunkLimit:L.number().int().positive().optional(),chunkMode:L.enum([`length`,`newline`]).optional(),blockStreaming:L.boolean().optional(),blockStreamingCoalesce:A.optional(),mediaMaxMb:L.number().int().positive().optional(),reactionNotifications:L.enum([`off`,`own`,`all`,`allowlist`]).optional(),reactionAllowlist:L.array(L.union([L.string(),L.number()])).optional(),actions:L.object({reactions:L.boolean().optional()}).strict().optional(),reactionLevel:L.enum([`off`,`ack`,`minimal`,`extensive`]).optional(),heartbeat:U,healthMonitor:W,responsePrefix:L.string().optional()}).strict(),ks=Os;Os.extend({accounts:L.record(L.string(),ks.optional()).optional(),defaultAccount:L.string().optional()}).superRefine((e,t)=>{if(M({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.signal.dmPolicy="open" requires channels.signal.allowFrom to include "*"`}),O({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.signal.dmPolicy="allowlist" requires channels.signal.allowFrom to contain at least one sender ID`}),e.accounts)for(let[n,r]of Object.entries(e.accounts)){if(!r)continue;let i=r.dmPolicy??e.dmPolicy,a=r.allowFrom??e.allowFrom;M({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.signal.accounts.*.dmPolicy="open" requires channels.signal.accounts.*.allowFrom (or channels.signal.allowFrom) to include "*"`}),O({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.signal.accounts.*.dmPolicy="allowlist" requires channels.signal.accounts.*.allowFrom (or channels.signal.allowFrom) to contain at least one sender ID`})}});const As=L.object({requireMention:L.boolean().optional(),tools:H,toolsBySender:G,skills:L.array(L.string()).optional(),enabled:L.boolean().optional(),allowFrom:L.array(L.union([L.string(),L.number()])).optional(),systemPrompt:L.string().optional()}).strict(),js=L.object({enabled:L.boolean().optional(),service:L.string().optional(),password:D.optional().register(N),passwordFile:L.string().optional(),register:L.boolean().optional(),registerEmail:L.string().optional()}).strict(),Ms=L.object({name:L.string().optional(),capabilities:L.array(L.string()).optional(),markdown:E,enabled:L.boolean().optional(),configWrites:L.boolean().optional(),host:L.string().optional(),port:L.number().int().min(1).max(65535).optional(),tls:L.boolean().optional(),nick:L.string().optional(),username:L.string().optional(),realname:L.string().optional(),password:D.optional().register(N),passwordFile:L.string().optional(),nickserv:js.optional(),channels:L.array(L.string()).optional(),dmPolicy:T.optional().default(`pairing`),allowFrom:L.array(L.union([L.string(),L.number()])).optional(),defaultTo:L.string().optional(),groupAllowFrom:L.array(L.union([L.string(),L.number()])).optional(),groupPolicy:x.optional().default(`allowlist`),contextVisibility:k.optional(),groups:L.record(L.string(),As.optional()).optional(),mentionPatterns:L.array(L.string()).optional(),historyLimit:L.number().int().min(0).optional(),dmHistoryLimit:L.number().int().min(0).optional(),dms:L.record(L.string(),w.optional()).optional(),textChunkLimit:L.number().int().positive().optional(),chunkMode:L.enum([`length`,`newline`]).optional(),blockStreaming:L.boolean().optional(),blockStreamingCoalesce:A.optional(),mediaMaxMb:L.number().positive().optional(),heartbeat:U,healthMonitor:W,responsePrefix:L.string().optional()}).strict();function Ns(e,t){M({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.irc.dmPolicy="open" requires channels.irc.allowFrom to include "*"`}),O({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.irc.dmPolicy="allowlist" requires channels.irc.allowFrom to contain at least one sender ID`}),e.nickserv?.register&&!e.nickserv.registerEmail?.trim()&&t.addIssue({code:L.ZodIssueCode.custom,path:[`nickserv`,`registerEmail`],message:`channels.irc.nickserv.register=true requires channels.irc.nickserv.registerEmail`})}const Ps=Ms.superRefine((e,t)=>{e.nickserv?.register&&!e.nickserv.registerEmail?.trim()&&t.addIssue({code:L.ZodIssueCode.custom,path:[`nickserv`,`registerEmail`],message:`channels.irc.nickserv.register=true requires channels.irc.nickserv.registerEmail`})});Ms.extend({accounts:L.record(L.string(),Ps.optional()).optional(),defaultAccount:L.string().optional()}).superRefine((e,t)=>{if(Ns(e,t),e.accounts)for(let[n,r]of Object.entries(e.accounts)){if(!r)continue;let i=r.dmPolicy??e.dmPolicy,a=r.allowFrom??e.allowFrom;M({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.irc.accounts.*.dmPolicy="open" requires channels.irc.accounts.*.allowFrom (or channels.irc.allowFrom) to include "*"`}),O({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.irc.accounts.*.dmPolicy="allowlist" requires channels.irc.accounts.*.allowFrom (or channels.irc.allowFrom) to contain at least one sender ID`})}});const Fs=L.object({name:L.string().optional(),capabilities:L.array(L.string()).optional(),markdown:E,enabled:L.boolean().optional(),configWrites:L.boolean().optional(),cliPath:le.optional(),dbPath:L.string().optional(),remoteHost:L.string().refine(Ao,`expected SSH host or user@host (no spaces/options)`).optional(),service:L.union([L.literal(`imessage`),L.literal(`sms`),L.literal(`auto`)]).optional(),region:L.string().optional(),dmPolicy:T.optional().default(`pairing`),allowFrom:L.array(L.union([L.string(),L.number()])).optional(),defaultTo:L.string().optional(),groupAllowFrom:L.array(L.union([L.string(),L.number()])).optional(),groupPolicy:x.optional().default(`allowlist`),contextVisibility:k.optional(),historyLimit:L.number().int().min(0).optional(),dmHistoryLimit:L.number().int().min(0).optional(),dms:L.record(L.string(),w.optional()).optional(),includeAttachments:L.boolean().optional(),attachmentRoots:L.array(L.string().refine(Fo,`expected absolute path root`)).optional(),remoteAttachmentRoots:L.array(L.string().refine(Fo,`expected absolute path root`)).optional(),mediaMaxMb:L.number().int().positive().optional(),textChunkLimit:L.number().int().positive().optional(),chunkMode:L.enum([`length`,`newline`]).optional(),blockStreaming:L.boolean().optional(),blockStreamingCoalesce:A.optional(),groups:L.record(L.string(),L.object({requireMention:L.boolean().optional(),tools:H,toolsBySender:G}).strict().optional()).optional(),heartbeat:U,healthMonitor:W,responsePrefix:L.string().optional()}).strict(),Is=Fs;Fs.extend({accounts:L.record(L.string(),Is.optional()).optional(),defaultAccount:L.string().optional()}).superRefine((e,t)=>{if(M({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.imessage.dmPolicy="open" requires channels.imessage.allowFrom to include "*"`}),O({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.imessage.dmPolicy="allowlist" requires channels.imessage.allowFrom to contain at least one sender ID`}),e.accounts)for(let[n,r]of Object.entries(e.accounts)){if(!r)continue;let i=r.dmPolicy??e.dmPolicy,a=r.allowFrom??e.allowFrom;M({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.imessage.accounts.*.dmPolicy="open" requires channels.imessage.accounts.*.allowFrom (or channels.imessage.allowFrom) to include "*"`}),O({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.imessage.accounts.*.dmPolicy="allowlist" requires channels.imessage.accounts.*.allowFrom (or channels.imessage.allowFrom) to contain at least one sender ID`})}});const Ls=L.union([L.string(),L.number()]),Rs=L.object({reactions:L.boolean().optional(),edit:L.boolean().optional(),unsend:L.boolean().optional(),reply:L.boolean().optional(),sendWithEffect:L.boolean().optional(),renameGroup:L.boolean().optional(),setGroupIcon:L.boolean().optional(),addParticipant:L.boolean().optional(),removeParticipant:L.boolean().optional(),leaveGroup:L.boolean().optional(),sendAttachment:L.boolean().optional()}).strict().optional(),zs=L.object({requireMention:L.boolean().optional(),tools:H,toolsBySender:G}).strict(),Bs=L.object({name:L.string().optional(),capabilities:L.array(L.string()).optional(),markdown:E,configWrites:L.boolean().optional(),enabled:L.boolean().optional(),serverUrl:L.string().optional(),password:D.optional().register(N),webhookPath:L.string().optional(),dmPolicy:T.optional().default(`pairing`),allowFrom:L.array(Ls).optional(),groupAllowFrom:L.array(Ls).optional(),groupPolicy:x.optional().default(`allowlist`),contextVisibility:k.optional(),historyLimit:L.number().int().min(0).optional(),dmHistoryLimit:L.number().int().min(0).optional(),dms:L.record(L.string(),w.optional()).optional(),textChunkLimit:L.number().int().positive().optional(),sendTimeoutMs:L.number().int().positive().optional(),chunkMode:L.enum([`length`,`newline`]).optional(),mediaMaxMb:L.number().int().positive().optional(),mediaLocalRoots:L.array(L.string()).optional(),sendReadReceipts:L.boolean().optional(),network:L.object({dangerouslyAllowPrivateNetwork:L.boolean().optional()}).strict().optional(),blockStreaming:L.boolean().optional(),blockStreamingCoalesce:A.optional(),groups:L.record(L.string(),zs.optional()).optional(),enrichGroupParticipantsFromContacts:L.boolean().optional(),heartbeat:U,healthMonitor:W,responsePrefix:L.string().optional(),coalesceSameSenderDms:L.boolean().optional()}).strict(),Vs=Bs;Bs.extend({accounts:L.record(L.string(),Vs.optional()).optional(),defaultAccount:L.string().optional(),actions:Rs}).superRefine((e,t)=>{if(M({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.bluebubbles.dmPolicy="open" requires channels.bluebubbles.allowFrom to include "*"`}),O({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.bluebubbles.dmPolicy="allowlist" requires channels.bluebubbles.allowFrom to contain at least one sender ID`}),e.accounts)for(let[n,r]of Object.entries(e.accounts)){if(!r)continue;let i=r.dmPolicy??e.dmPolicy,a=r.allowFrom??e.allowFrom;M({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.bluebubbles.accounts.*.dmPolicy="open" requires channels.bluebubbles.accounts.*.allowFrom (or channels.bluebubbles.allowFrom) to include "*"`}),O({policy:i,allowFrom:a,ctx:t,path:[`accounts`,n,`allowFrom`],message:`channels.bluebubbles.accounts.*.dmPolicy="allowlist" requires channels.bluebubbles.accounts.*.allowFrom (or channels.bluebubbles.allowFrom) to contain at least one sender ID`})}});const Hs=L.object({requireMention:L.boolean().optional(),tools:H,toolsBySender:G,replyStyle:ae.optional()}).strict(),Us=L.object({requireMention:L.boolean().optional(),tools:H,toolsBySender:G,replyStyle:ae.optional(),channels:L.record(L.string(),Hs.optional()).optional()}).strict();L.object({enabled:L.boolean().optional(),capabilities:L.array(L.string()).optional(),dangerouslyAllowNameMatching:L.boolean().optional(),markdown:E,configWrites:L.boolean().optional(),appId:L.string().optional(),appPassword:D.optional().register(N),tenantId:L.string().optional(),authType:L.enum([`secret`,`federated`]).optional(),certificatePath:L.string().optional(),certificateThumbprint:L.string().optional(),useManagedIdentity:L.boolean().optional(),managedIdentityClientId:L.string().optional(),webhook:L.object({port:L.number().int().positive().optional(),path:L.string().optional()}).strict().optional(),dmPolicy:T.optional().default(`pairing`),allowFrom:L.array(L.string()).optional(),defaultTo:L.string().optional(),groupAllowFrom:L.array(L.string()).optional(),groupPolicy:x.optional().default(`allowlist`),contextVisibility:k.optional(),textChunkLimit:L.number().int().positive().optional(),chunkMode:L.enum([`length`,`newline`]).optional(),typingIndicator:L.boolean().optional(),blockStreaming:L.boolean().optional(),blockStreamingCoalesce:A.optional(),mediaAllowHosts:L.array(L.string()).optional(),mediaAuthAllowHosts:L.array(L.string()).optional(),requireMention:L.boolean().optional(),historyLimit:L.number().int().min(0).optional(),dmHistoryLimit:L.number().int().min(0).optional(),dms:L.record(L.string(),w.optional()).optional(),replyStyle:ae.optional(),teams:L.record(L.string(),Us.optional()).optional(),mediaMaxMb:L.number().positive().optional(),sharePointSiteId:L.string().optional(),heartbeat:U,healthMonitor:W,responsePrefix:L.string().optional(),welcomeCard:L.boolean().optional(),promptStarters:L.array(L.string()).optional(),groupWelcomeCard:L.boolean().optional(),feedbackEnabled:L.boolean().optional(),feedbackReflection:L.boolean().optional(),feedbackReflectionCooldownMs:L.number().int().min(0).optional(),delegatedAuth:L.object({enabled:L.boolean().optional(),scopes:L.array(L.string()).optional()}).strict().optional(),sso:L.object({enabled:L.boolean().optional(),connectionName:L.string().optional()}).strict().optional()}).strict().superRefine((e,t)=>{M({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.msteams.dmPolicy="open" requires channels.msteams.allowFrom to include "*"`}),O({policy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,path:[`allowFrom`],message:`channels.msteams.dmPolicy="allowlist" requires channels.msteams.allowFrom to contain at least one sender ID`}),e.sso?.enabled===!0&&!e.sso.connectionName?.trim()&&t.addIssue({code:L.ZodIssueCode.custom,path:[`sso`,`connectionName`],message:`channels.msteams.sso.enabled=true requires channels.msteams.sso.connectionName to identify the Bot Framework OAuth connection`})});const Ws=L.record(L.string(),H).optional(),Gs=L.object({requireMention:L.boolean().optional(),tools:H,toolsBySender:Ws,systemPrompt:L.string().optional()}).strict().optional(),Ks=L.record(L.string(),Gs).optional(),qs=L.object({systemPrompt:L.string().optional()}).strict().optional(),Js=L.record(L.string(),qs).optional(),Ys=L.object({emoji:L.string().optional(),direct:L.boolean().optional().default(!0),group:L.enum([`always`,`mentions`,`never`]).optional().default(`mentions`)}).strict().optional();function Xs(e){return{enabled:L.boolean().optional(),capabilities:L.array(L.string()).optional(),markdown:E,configWrites:L.boolean().optional(),sendReadReceipts:L.boolean().optional(),messagePrefix:L.string().optional(),responsePrefix:L.string().optional(),dmPolicy:e.useDefaults?T.optional().default(`pairing`):T.optional(),selfChatMode:L.boolean().optional(),allowFrom:L.array(L.string()).optional(),defaultTo:L.string().optional(),groupAllowFrom:L.array(L.string()).optional(),groupPolicy:e.useDefaults?x.optional().default(`allowlist`):x.optional(),contextVisibility:k.optional(),historyLimit:L.number().int().min(0).optional(),dmHistoryLimit:L.number().int().min(0).optional(),dms:L.record(L.string(),w.optional()).optional(),textChunkLimit:L.number().int().positive().optional(),chunkMode:L.enum([`length`,`newline`]).optional(),blockStreaming:L.boolean().optional(),blockStreamingCoalesce:A.optional(),groups:Ks,direct:Js,ackReaction:Ys,reactionLevel:L.enum([`off`,`ack`,`minimal`,`extensive`]).optional(),debounceMs:e.useDefaults?L.number().int().nonnegative().optional().default(0):L.number().int().nonnegative().optional(),replyToMode:S.optional(),heartbeat:U,healthMonitor:W}}function Zs(e){e.dmPolicy===`open`&&(Le(Array.isArray(e.allowFrom)?e.allowFrom:[]).includes(`*`)||e.ctx.addIssue({code:L.ZodIssueCode.custom,path:e.path??[`allowFrom`],message:e.message}))}function Qs(e){e.dmPolicy===`allowlist`&&(Le(Array.isArray(e.allowFrom)?e.allowFrom:[]).length>0||e.ctx.addIssue({code:L.ZodIssueCode.custom,path:e.path??[`allowFrom`],message:e.message}))}const $s=L.object({...Xs({useDefaults:!1}),name:L.string().optional(),enabled:L.boolean().optional(),authDir:L.string().optional(),mediaMaxMb:L.number().int().positive().optional()}).strict();L.object({...Xs({useDefaults:!0}),accounts:L.record(L.string(),$s.optional()).optional(),defaultAccount:L.string().optional(),mediaMaxMb:L.number().int().positive().optional().default(50),actions:L.object({reactions:L.boolean().optional(),sendMessage:L.boolean().optional(),polls:L.boolean().optional()}).strict().optional()}).strict().superRefine((e,t)=>{let n=_t(e.accounts,`default`);if(Zs({dmPolicy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,message:`channels.whatsapp.dmPolicy="open" requires channels.whatsapp.allowFrom to include "*"`}),Qs({dmPolicy:e.dmPolicy,allowFrom:e.allowFrom,ctx:t,message:`channels.whatsapp.dmPolicy="allowlist" requires channels.whatsapp.allowFrom to contain at least one sender ID`}),e.accounts)for(let[r,i]of Object.entries(e.accounts)){if(!i)continue;let a=i.dmPolicy??(r===`default`?void 0:n?.dmPolicy)??e.dmPolicy,o=i.allowFrom??(r===`default`?void 0:n?.allowFrom)??e.allowFrom;Zs({dmPolicy:a,allowFrom:o,ctx:t,path:[`accounts`,r,`allowFrom`],message:`channels.whatsapp.accounts.*.dmPolicy="open" requires channels.whatsapp.accounts.*.allowFrom (or channels.whatsapp.allowFrom) to include "*"`}),Qs({dmPolicy:a,allowFrom:o,ctx:t,path:[`accounts`,r,`allowFrom`],message:`channels.whatsapp.accounts.*.dmPolicy="allowlist" requires channels.whatsapp.accounts.*.allowFrom (or channels.whatsapp.allowFrom) to contain at least one sender ID`})}});function ec(e){if(typeof e==`number`&&Number.isFinite(e)){let t=Math.floor(e);return t>=0?t:null}if(typeof e==`string`){let t=e.trim();if(!t)return null;try{let e=Ba(t,{defaultUnit:`b`});return e>=0?e:null}catch{return null}}return null}function tc(e){return ec(e)!==null}const nc=L.union([L.literal(`allow`),L.literal(`disallow`)]),rc=L.object({direct:nc.optional(),group:nc.optional(),internal:nc.optional()}).strict(),ic=L.object({direct:L.boolean().optional(),group:L.boolean().optional(),internal:L.boolean().optional()}).strict(),ac=L.object({params:L.record(L.string(),L.unknown()).optional(),embeddedHarness:So,model:V.optional(),imageModel:V.optional(),imageGenerationModel:V.optional(),videoGenerationModel:V.optional(),musicGenerationModel:V.optional(),mediaGenerationAutoProviderFallback:L.boolean().optional(),pdfModel:V.optional(),pdfMaxBytesMb:L.number().positive().optional(),pdfMaxPages:L.number().int().positive().optional(),models:L.record(L.string(),L.object({alias:L.string().optional(),params:L.record(L.string(),L.unknown()).optional(),streaming:L.boolean().optional()}).strict()).optional(),workspace:L.string().optional(),skills:L.array(L.string()).optional(),silentReply:rc.optional(),silentReplyRewrite:ic.optional(),repoRoot:L.string().optional(),systemPromptOverride:L.string().optional(),promptOverlays:L.object({gpt5:L.object({personality:L.union([L.literal(`friendly`),L.literal(`on`),L.literal(`off`)]).optional()}).strict().optional()}).strict().optional(),skipBootstrap:L.boolean().optional(),contextInjection:L.union([L.literal(`always`),L.literal(`continuation-skip`)]).optional(),bootstrapMaxChars:L.number().int().positive().optional(),bootstrapTotalMaxChars:L.number().int().positive().optional(),experimental:L.object({localModelLean:L.boolean().optional()}).strict().optional(),bootstrapPromptTruncationWarning:L.union([L.literal(`off`),L.literal(`once`),L.literal(`always`)]).optional(),userTimezone:L.string().optional(),startupContext:L.object({enabled:L.boolean().optional(),applyOn:L.array(L.union([L.literal(`new`),L.literal(`reset`)])).optional(),dailyMemoryDays:L.number().int().min(1).max(14).optional(),maxFileBytes:L.number().int().min(1).max(64*1024).optional(),maxFileChars:L.number().int().min(1).max(1e4).optional(),maxTotalChars:L.number().int().min(1).max(5e4).optional()}).strict().optional(),contextLimits:qa,timeFormat:L.union([L.literal(`auto`),L.literal(`12`),L.literal(`24`)]).optional(),envelopeTimezone:L.string().optional(),envelopeTimestamp:L.union([L.literal(`on`),L.literal(`off`)]).optional(),envelopeElapsed:L.union([L.literal(`on`),L.literal(`off`)]).optional(),contextTokens:L.number().int().positive().optional(),cliBackends:L.record(L.string(),ee).optional(),memorySearch:yo,contextPruning:L.object({mode:L.union([L.literal(`off`),L.literal(`cache-ttl`)]).optional(),ttl:L.string().optional(),keepLastAssistants:L.number().int().nonnegative().optional(),softTrimRatio:L.number().min(0).max(1).optional(),hardClearRatio:L.number().min(0).max(1).optional(),minPrunableToolChars:L.number().int().nonnegative().optional(),tools:L.object({allow:L.array(L.string()).optional(),deny:L.array(L.string()).optional()}).strict().optional(),softTrim:L.object({maxChars:L.number().int().nonnegative().optional(),headChars:L.number().int().nonnegative().optional(),tailChars:L.number().int().nonnegative().optional()}).strict().optional(),hardClear:L.object({enabled:L.boolean().optional(),placeholder:L.string().optional()}).strict().optional()}).strict().optional(),llm:L.object({idleTimeoutSeconds:L.number().int().nonnegative().optional().describe(`Idle timeout for LLM streaming responses in seconds. If no token is received within this time, the request is aborted. Set to 0 to disable. Default: 120 seconds.`)}).strict().optional(),compaction:L.object({mode:L.union([L.literal(`default`),L.literal(`safeguard`)]).optional(),provider:L.string().optional(),reserveTokens:L.number().int().nonnegative().optional(),keepRecentTokens:L.number().int().positive().optional(),reserveTokensFloor:L.number().int().nonnegative().optional(),maxHistoryShare:L.number().min(.1).max(.9).optional(),customInstructions:L.string().optional(),identifierPolicy:L.union([L.literal(`strict`),L.literal(`off`),L.literal(`custom`)]).optional(),identifierInstructions:L.string().optional(),recentTurnsPreserve:L.number().int().min(0).max(12).optional(),qualityGuard:L.object({enabled:L.boolean().optional(),maxRetries:L.number().int().nonnegative().optional()}).strict().optional(),postIndexSync:L.enum([`off`,`async`,`await`]).optional(),postCompactionSections:L.array(L.string()).optional(),model:L.string().optional(),timeoutSeconds:L.number().int().positive().optional(),memoryFlush:L.object({enabled:L.boolean().optional(),softThresholdTokens:L.number().int().nonnegative().optional(),forceFlushTranscriptBytes:L.union([L.number().int().nonnegative(),L.string().refine(tc,`Expected byte size string like 2mb`)]).optional(),prompt:L.string().optional(),systemPrompt:L.string().optional()}).strict().optional(),truncateAfterCompaction:L.boolean().optional(),notifyUser:L.boolean().optional()}).strict().optional(),embeddedPi:L.object({projectSettingsPolicy:L.union([L.literal(`trusted`),L.literal(`sanitize`),L.literal(`ignore`)]).optional(),executionContract:L.union([L.literal(`default`),L.literal(`strict-agentic`)]).optional()}).strict().optional(),thinkingDefault:L.union([L.literal(`off`),L.literal(`minimal`),L.literal(`low`),L.literal(`medium`),L.literal(`high`),L.literal(`xhigh`),L.literal(`adaptive`),L.literal(`max`)]).optional(),verboseDefault:L.union([L.literal(`off`),L.literal(`on`),L.literal(`full`)]).optional(),elevatedDefault:L.union([L.literal(`off`),L.literal(`on`),L.literal(`ask`),L.literal(`full`)]).optional(),blockStreamingDefault:L.union([L.literal(`off`),L.literal(`on`)]).optional(),blockStreamingBreak:L.union([L.literal(`text_end`),L.literal(`message_end`)]).optional(),blockStreamingChunk:ce.optional(),blockStreamingCoalesce:A.optional(),humanDelay:de.optional(),timeoutSeconds:L.number().int().positive().optional(),mediaMaxMb:L.number().positive().optional(),imageMaxDimensionPx:L.number().int().positive().optional(),typingIntervalSeconds:L.number().int().positive().optional(),typingMode:Ee.optional(),heartbeat:Ua,maxConcurrent:L.number().int().positive().optional(),subagents:L.object({allowAgents:L.array(L.string()).optional(),maxConcurrent:L.number().int().positive().optional(),maxSpawnDepth:L.number().int().min(1).max(5).optional().describe(`Maximum nesting depth for sub-agent spawning. 1 = no nesting (default), 2 = sub-agents can spawn sub-sub-agents.`),maxChildrenPerAgent:L.number().int().min(1).max(20).optional().describe(`Maximum number of active children a single agent session can spawn (default: 5).`),archiveAfterMinutes:L.number().int().min(0).optional(),model:V.optional(),thinking:L.string().optional(),runTimeoutSeconds:L.number().int().min(0).optional(),announceTimeoutMs:L.number().int().positive().optional(),requireAgentId:L.boolean().optional()}).strict().optional(),sandbox:go}).strict().optional(),oc=L.object({defaults:L.lazy(()=>ac).optional(),list:L.array(Co).optional()}).strict().optional(),sc=L.object({channel:L.string(),accountId:L.string().optional(),peer:L.object({kind:L.union([L.literal(`direct`),L.literal(`group`),L.literal(`channel`),L.literal(`dm`)]),id:L.string()}).strict().optional(),guildId:L.string().optional(),teamId:L.string().optional(),roles:L.array(L.string()).optional()}).strict(),cc=L.object({type:L.literal(`route`).optional(),agentId:L.string(),comment:L.string().optional(),match:sc}).strict(),lc=L.object({type:L.literal(`acp`),agentId:L.string(),comment:L.string().optional(),match:sc,acp:L.object({mode:L.enum([`persistent`,`oneshot`]).optional(),label:L.string().optional(),cwd:L.string().optional(),backend:L.string().optional()}).strict().optional()}).strict().superRefine((e,t)=>{if(!(n(e.match.peer?.id)??``)){t.addIssue({code:L.ZodIssueCode.custom,path:[`match`,`peer`],message:`ACP bindings require match.peer.id to target a concrete conversation.`});return}}),uc=L.array(L.union([cc,lc])).optional(),dc=L.enum([`parallel`,`sequential`]),fc=L.object({strategy:dc.optional()}).catchall(L.array(L.string())).optional(),pc=L.object({transcription:Oe}).strict().optional(),mc=L.object({channel:L.string().min(1),to:L.string().min(1),accountId:L.string().optional(),threadId:L.union([L.string(),L.number()]).optional()}).strict(),hc=L.object({enabled:L.boolean().optional(),mode:L.union([L.literal(`session`),L.literal(`targets`),L.literal(`both`)]).optional(),agentFilter:L.array(L.string()).optional(),sessionFilter:L.array(L.string()).optional(),targets:L.array(mc).optional()}).strict().optional(),gc=L.object({exec:hc,plugin:hc}).strict().optional(),_c=L.union([L.literal(`npm`),L.literal(`archive`),L.literal(`path`),L.literal(`clawhub`)]),vc=L.union([_c,L.literal(`marketplace`)]),yc={source:_c,spec:L.string().optional(),sourcePath:L.string().optional(),installPath:L.string().optional(),version:L.string().optional(),resolvedName:L.string().optional(),resolvedVersion:L.string().optional(),resolvedSpec:L.string().optional(),integrity:L.string().optional(),shasum:L.string().optional(),resolvedAt:L.string().optional(),installedAt:L.string().optional(),clawhubUrl:L.string().optional(),clawhubPackage:L.string().optional(),clawhubFamily:L.union([L.literal(`code-plugin`),L.literal(`bundle-plugin`)]).optional(),clawhubChannel:L.union([L.literal(`official`),L.literal(`community`),L.literal(`private`)]).optional()},bc={...yc,source:vc,marketplaceName:L.string().optional(),marketplaceSource:L.string().optional(),marketplacePlugin:L.string().optional()};function xc(e){let t=e.trim();return!(!t||I.isAbsolute(t)||t.startsWith(`~`)||t.includes(`:`)||t.split(/[\\/]+/g).some(e=>e===`..`))}const Sc=L.string().refine(xc,`module must be a safe relative path (no absolute paths)`),Cc=L.object({id:L.string().optional(),match:L.object({path:L.string().optional(),source:L.string().optional()}).optional(),action:L.union([L.literal(`wake`),L.literal(`agent`)]).optional(),wakeMode:L.union([L.literal(`now`),L.literal(`next-heartbeat`)]).optional(),name:L.string().optional(),agentId:L.string().optional(),sessionKey:L.string().optional().register(N),messageTemplate:L.string().optional(),textTemplate:L.string().optional(),deliver:L.boolean().optional(),allowUnsafeExternalContent:L.boolean().optional(),channel:L.string().trim().min(1).optional(),to:L.string().optional(),model:L.string().optional(),thinking:L.string().optional(),timeoutSeconds:L.number().int().positive().optional(),transform:L.object({module:Sc,export:L.string().optional()}).strict().optional()}).strict().optional(),wc=L.object({event:L.string(),module:Sc,export:L.string().optional()}).strict(),Tc=L.object({enabled:L.boolean().optional(),env:L.record(L.string(),L.string()).optional()}).passthrough(),Ec=L.object({...yc,hooks:L.array(L.string()).optional()}).strict(),Dc=L.object({enabled:L.boolean().optional(),handlers:L.array(wc).optional(),entries:L.record(L.string(),Tc).optional(),load:L.object({extraDirs:L.array(L.string()).optional()}).strict().optional(),installs:L.record(L.string(),Ec).optional()}).strict().optional(),Oc=L.object({account:L.string().optional(),label:L.string().optional(),topic:L.string().optional(),subscription:L.string().optional(),pushToken:L.string().optional().register(N),hookUrl:L.string().optional(),includeBody:L.boolean().optional(),maxBytes:L.number().int().positive().optional(),renewEveryMinutes:L.number().int().positive().optional(),allowUnsafeExternalContent:L.boolean().optional(),serve:L.object({bind:L.string().optional(),port:L.number().int().positive().optional(),path:L.string().optional()}).strict().optional(),tailscale:L.object({mode:L.union([L.literal(`off`),L.literal(`serve`),L.literal(`funnel`)]).optional(),path:L.string().optional(),target:L.string().optional()}).strict().optional(),model:L.string().optional(),thinking:L.union([L.literal(`off`),L.literal(`minimal`),L.literal(`low`),L.literal(`medium`),L.literal(`high`)]).optional()}).strict().optional(),kc=L.record(L.string(),L.record(L.string(),L.string())).optional();let Ac;const jc=Ke({modulePath:lt(import.meta.url),moduleUrl:import.meta.url})??lt(new URL(`../..`,import.meta.url));function Mc(e){Ac||=new Map;let t=Ac.get(e);if(t)return t;for(let t of ne({includeChannelConfigs:!1,includeSyntheticChannelConfigs:!1})){let n=t.manifest.channelConfigs?.[e]?.runtime;if(n)return Ac.set(e,n),n;if(!t.manifest.channels?.includes(e))continue;let r=b({pluginDir:I.resolve(jc,`extensions`,t.dirName),manifest:t.manifest,...t.packageManifest?{packageManifest:t.packageManifest}:{}})?.[e]?.runtime;if(r)return Ac.set(e,r),r}}function Nc(e){return Object.keys(e).some(e=>e!==`defaults`&&e!==`modelByChannel`)}function Pc(e,t,n=[]){if(!e||typeof e!=`object`)return;if(Array.isArray(e)){e.forEach((e,r)=>Pc(e,t,[...n,r]));return}let r=e,i=r.bindings;if(i&&typeof i==`object`&&!Array.isArray(i)){let e=i.acp;e&&typeof e==`object`&&t.addIssue({code:L.ZodIssueCode.custom,path:[...n,`bindings`,`acp`],message:`Legacy channel-local ACP bindings were removed; use top-level bindings[] entries.`})}for(let[e,i]of Object.entries(r))Pc(i,t,[...n,e])}function Fc(e,t){if(!e||!Nc(e))return e;let n;for(let r of Object.keys(e)){let i=Mc(r);if(!i||!Object.prototype.hasOwnProperty.call(e,r))continue;let a=i.safeParse(e[r]);if(!a.success){for(let e of a.issues)t.addIssue({code:L.ZodIssueCode.custom,message:e.message??`Invalid channels.${r} config.`,path:[r,...Array.isArray(e.path)?e.path:[]]});continue}n??={...e},n[r]=a.data}return n??e}const Ic=L.object({defaults:L.object({groupPolicy:x.optional(),contextVisibility:k.optional(),heartbeat:U}).strict().optional(),modelByChannel:kc}).passthrough().superRefine((e,t)=>{Pc(e,t)}).transform((e,t)=>Fc(e,t)).optional(),Lc=L.object({mode:L.union([L.literal(`daily`),L.literal(`idle`)]).optional(),atHour:L.number().int().min(0).max(23).optional(),idleMinutes:L.number().int().positive().optional()}).strict(),Rc=Ce(),zc=L.object({scope:L.union([L.literal(`per-sender`),L.literal(`global`)]).optional(),dmScope:L.union([L.literal(`main`),L.literal(`per-peer`),L.literal(`per-channel-peer`),L.literal(`per-account-channel-peer`)]).optional(),identityLinks:L.record(L.string(),L.array(L.string())).optional(),resetTriggers:L.array(L.string()).optional(),idleMinutes:L.number().int().positive().optional(),reset:Lc.optional(),resetByType:L.object({direct:Lc.optional(),dm:Lc.optional(),group:Lc.optional(),thread:Lc.optional()}).strict().optional(),resetByChannel:L.record(L.string(),Lc).optional(),store:L.string().optional(),typingIntervalSeconds:L.number().int().positive().optional(),typingMode:Ee.optional(),parentForkMaxTokens:L.number().int().nonnegative().optional(),mainKey:L.string().optional(),sendPolicy:Rc.optional(),agentToAgent:L.object({maxPingPongTurns:L.number().int().min(0).max(5).optional()}).strict().optional(),threadBindings:L.object({enabled:L.boolean().optional(),idleHours:L.number().nonnegative().optional(),maxAgeHours:L.number().nonnegative().optional()}).strict().optional(),maintenance:L.object({mode:L.enum([`enforce`,`warn`]).optional(),pruneAfter:L.union([L.string(),L.number()]).optional(),pruneDays:L.number().int().positive().optional(),maxEntries:L.number().int().positive().optional(),rotateBytes:L.union([L.string(),L.number()]).optional(),resetArchiveRetention:L.union([L.string(),L.number(),L.literal(!1)]).optional(),maxDiskBytes:L.union([L.string(),L.number()]).optional(),highWaterBytes:L.union([L.string(),L.number()]).optional()}).strict().superRefine((e,t)=>{if(e.pruneAfter!==void 0)try{gt(o(e.pruneAfter)??``,{defaultUnit:`d`})}catch{t.addIssue({code:L.ZodIssueCode.custom,path:[`pruneAfter`],message:`invalid duration (use ms, s, m, h, d)`})}if(e.rotateBytes!==void 0)try{Ba(o(e.rotateBytes)??``,{defaultUnit:`b`})}catch{t.addIssue({code:L.ZodIssueCode.custom,path:[`rotateBytes`],message:`invalid size (use b, kb, mb, gb, tb)`})}if(e.resetArchiveRetention!==void 0&&e.resetArchiveRetention!==!1)try{gt(o(e.resetArchiveRetention)??``,{defaultUnit:`d`})}catch{t.addIssue({code:L.ZodIssueCode.custom,path:[`resetArchiveRetention`],message:`invalid duration (use ms, s, m, h, d)`})}if(e.maxDiskBytes!==void 0)try{Ba(o(e.maxDiskBytes)??``,{defaultUnit:`b`})}catch{t.addIssue({code:L.ZodIssueCode.custom,path:[`maxDiskBytes`],message:`invalid size (use b, kb, mb, gb, tb)`})}if(e.highWaterBytes!==void 0)try{Ba(o(e.highWaterBytes)??``,{defaultUnit:`b`})}catch{t.addIssue({code:L.ZodIssueCode.custom,path:[`highWaterBytes`],message:`invalid size (use b, kb, mb, gb, tb)`})}}).optional()}).strict().optional(),Bc=L.object({messagePrefix:L.string().optional(),responsePrefix:L.string().optional(),groupChat:re,queue:Te,inbound:te,ackReaction:L.string().optional(),ackReactionScope:L.enum([`group-mentions`,`group-all`,`direct`,`all`,`off`,`none`]).optional(),removeAckAfterReply:L.boolean().optional(),statusReactions:L.object({enabled:L.boolean().optional(),emojis:L.object({thinking:L.string().optional(),tool:L.string().optional(),coding:L.string().optional(),web:L.string().optional(),done:L.string().optional(),error:L.string().optional(),stallSoft:L.string().optional(),stallHard:L.string().optional(),compacting:L.string().optional()}).strict().optional(),timing:L.object({debounceMs:L.number().int().min(0).optional(),stallSoftMs:L.number().int().min(0).optional(),stallHardMs:L.number().int().min(0).optional(),doneHoldMs:L.number().int().min(0).optional(),errorHoldMs:L.number().int().min(0).optional()}).strict().optional()}).strict().optional(),suppressToolErrors:L.boolean().optional(),tts:we}).strict().optional(),Vc=L.object({native:ie.optional().default(`auto`),nativeSkills:ie.optional().default(`auto`),text:L.boolean().optional(),modelsWrite:L.boolean().optional().default(!0),bash:L.boolean().optional(),bashForegroundMs:L.number().int().min(0).max(3e4).optional(),config:L.boolean().optional(),mcp:L.boolean().optional(),plugins:L.boolean().optional(),debug:L.boolean().optional(),restart:L.boolean().optional().default(!0),useAccessGroups:L.boolean().optional(),ownerAllowFrom:L.array(L.union([L.string(),L.number()])).optional(),ownerDisplay:L.enum([`raw`,`hash`]).optional().default(`raw`),ownerDisplaySecret:L.string().optional().register(N),allowFrom:ao.optional()}).strict().optional().default(()=>({native:`auto`,nativeSkills:`auto`,modelsWrite:!0,restart:!0,ownerDisplay:`raw`})),Hc=L.object({mode:L.literal(`efficient`).optional()}).strict().optional(),Uc=L.object({browserProxy:L.object({enabled:L.boolean().optional(),allowProfiles:L.array(L.string()).optional()}).strict().optional()}).strict().optional(),Wc=L.object({path:L.string(),name:L.string().optional(),pattern:L.string().optional()}).strict(),Gc=L.object({enabled:L.boolean().optional(),exportDir:L.string().optional(),retentionDays:L.number().int().nonnegative().optional()}).strict(),Kc=L.object({interval:L.string().optional(),debounceMs:L.number().int().nonnegative().optional(),onBoot:L.boolean().optional(),waitForBootSync:L.boolean().optional(),embedInterval:L.string().optional(),commandTimeoutMs:L.number().int().nonnegative().optional(),updateTimeoutMs:L.number().int().nonnegative().optional(),embedTimeoutMs:L.number().int().nonnegative().optional()}).strict(),qc=L.object({maxResults:L.number().int().positive().optional(),maxSnippetChars:L.number().int().positive().optional(),maxInjectedChars:L.number().int().positive().optional(),timeoutMs:L.number().int().nonnegative().optional()}).strict(),Jc=L.object({enabled:L.boolean().optional(),serverName:L.string().optional(),startDaemon:L.boolean().optional()}).strict(),Yc=L.union([L.literal(`silent`),L.literal(`fatal`),L.literal(`error`),L.literal(`warn`),L.literal(`info`),L.literal(`debug`),L.literal(`trace`)]),Xc=L.object({command:L.string().optional(),mcporter:Jc.optional(),searchMode:L.union([L.literal(`query`),L.literal(`search`),L.literal(`vsearch`)]).optional(),searchTool:L.string().trim().min(1).optional(),includeDefaultMemory:L.boolean().optional(),paths:L.array(Wc).optional(),sessions:Gc.optional(),update:Kc.optional(),limits:qc.optional(),scope:Rc.optional()}).strict(),Zc=L.object({backend:L.union([L.literal(`builtin`),L.literal(`qmd`)]).optional(),citations:L.union([L.literal(`auto`),L.literal(`on`),L.literal(`off`)]).optional(),qmd:Xc.optional()}).strict().optional(),Qc=L.string().url().refine(e=>{let t=new URL(e).protocol;return t===`http:`||t===`https:`},`Expected http:// or https:// URL`),$c={allowUrl:L.boolean().optional(),urlAllowlist:L.array(L.string()).optional(),allowedMimes:L.array(L.string()).optional(),maxBytes:L.number().int().positive().optional(),maxRedirects:L.number().int().nonnegative().optional(),timeoutMs:L.number().int().positive().optional()},el=L.object({enabled:L.boolean().optional(),apiKey:D.optional().register(N),env:L.record(L.string(),L.string()).optional(),config:L.record(L.string(),L.unknown()).optional()}).strict(),tl=L.object({enabled:L.boolean().optional(),hooks:L.object({allowPromptInjection:L.boolean().optional()}).strict().optional(),subagent:L.object({allowModelOverride:L.boolean().optional(),allowedModels:L.array(L.string()).optional()}).strict().optional(),config:L.record(L.string(),L.unknown()).optional()}).strict(),nl=L.object({apiKey:D.optional().register(N)}).catchall(L.unknown()),rl=L.object({provider:L.string().optional(),providers:L.record(L.string(),nl).optional(),interruptOnSpeech:L.boolean().optional(),silenceTimeoutMs:L.number().int().positive().optional()}).strict().superRefine((e,t)=>{let n=i(e.provider??``),r=e.providers?Object.keys(e.providers):[];n&&r.length>0&&!(n in e.providers)&&t.addIssue({code:L.ZodIssueCode.custom,path:[`provider`],message:`talk.provider must match a key in talk.providers (missing "${n}")`}),!n&&r.length>1&&t.addIssue({code:L.ZodIssueCode.custom,path:[`provider`],message:`talk.provider is required when talk.providers defines multiple providers`})}),il=L.object({command:L.string().optional(),args:L.array(L.string()).optional(),env:L.record(L.string(),L.union([L.string(),L.number(),L.boolean()])).optional(),cwd:L.string().optional(),workingDirectory:L.string().optional(),url:Qc.optional(),headers:L.record(L.string(),L.union([L.string().register(N),L.number(),L.boolean()]).register(N)).optional()}).catchall(L.unknown()),al=L.object({servers:L.record(L.string(),il).optional()}).strict().optional(),ol=L.object({$schema:L.string().optional(),meta:L.object({lastTouchedVersion:L.string().optional(),lastTouchedAt:L.union([L.string(),L.number().transform((e,t)=>{let n=new Date(e);return Number.isNaN(n.getTime())?(t.addIssue({code:L.ZodIssueCode.custom,message:`Invalid timestamp`}),L.NEVER):n.toISOString()})]).optional()}).strict().optional(),env:L.object({shellEnv:L.object({enabled:L.boolean().optional(),timeoutMs:L.number().int().nonnegative().optional()}).strict().optional(),vars:L.record(L.string(),L.string()).optional()}).catchall(L.string()).optional(),wizard:L.object({lastRunAt:L.string().optional(),lastRunVersion:L.string().optional(),lastRunCommit:L.string().optional(),lastRunCommand:L.string().optional(),lastRunMode:L.union([L.literal(`local`),L.literal(`remote`)]).optional()}).strict().optional(),diagnostics:L.object({enabled:L.boolean().optional(),flags:L.array(L.string()).optional(),stuckSessionWarnMs:L.number().int().positive().optional(),otel:L.object({enabled:L.boolean().optional(),endpoint:L.string().optional(),protocol:L.union([L.literal(`http/protobuf`),L.literal(`grpc`)]).optional(),headers:L.record(L.string(),L.string()).optional(),serviceName:L.string().optional(),traces:L.boolean().optional(),metrics:L.boolean().optional(),logs:L.boolean().optional(),sampleRate:L.number().min(0).max(1).optional(),flushIntervalMs:L.number().int().nonnegative().optional()}).strict().optional(),cacheTrace:L.object({enabled:L.boolean().optional(),filePath:L.string().optional(),includeMessages:L.boolean().optional(),includePrompt:L.boolean().optional(),includeSystem:L.boolean().optional()}).strict().optional()}).strict().optional(),logging:L.object({level:Yc.optional(),file:L.string().optional(),maxFileBytes:L.number().int().positive().optional(),consoleLevel:Yc.optional(),consoleStyle:L.union([L.literal(`pretty`),L.literal(`compact`),L.literal(`json`)]).optional(),redactSensitive:L.union([L.literal(`off`),L.literal(`tools`)]).optional(),redactPatterns:L.array(L.string()).optional()}).strict().optional(),cli:L.object({banner:L.object({taglineMode:L.union([L.literal(`random`),L.literal(`default`),L.literal(`off`)]).optional()}).strict().optional()}).strict().optional(),update:L.object({channel:L.union([L.literal(`stable`),L.literal(`beta`),L.literal(`dev`)]).optional(),checkOnStart:L.boolean().optional(),auto:L.object({enabled:L.boolean().optional(),stableDelayHours:L.number().nonnegative().max(168).optional(),stableJitterHours:L.number().nonnegative().max(168).optional(),betaCheckIntervalHours:L.number().positive().max(24).optional()}).strict().optional()}).strict().optional(),browser:L.object({enabled:L.boolean().optional(),evaluateEnabled:L.boolean().optional(),cdpUrl:L.string().optional(),remoteCdpTimeoutMs:L.number().int().nonnegative().optional(),remoteCdpHandshakeTimeoutMs:L.number().int().nonnegative().optional(),color:L.string().optional(),executablePath:L.string().optional(),headless:L.boolean().optional(),noSandbox:L.boolean().optional(),attachOnly:L.boolean().optional(),cdpPortRangeStart:L.number().int().min(1).max(65535).optional(),defaultProfile:L.string().optional(),snapshotDefaults:Hc,ssrfPolicy:L.object({dangerouslyAllowPrivateNetwork:L.boolean().optional(),allowedHostnames:L.array(L.string()).optional(),hostnameAllowlist:L.array(L.string()).optional()}).strict().optional(),profiles:L.record(L.string().regex(/^[a-z0-9-]+$/,`Profile names must be alphanumeric with hyphens only`),L.object({cdpPort:L.number().int().min(1).max(65535).optional(),cdpUrl:L.string().optional(),userDataDir:L.string().optional(),driver:L.union([L.literal(`openclaw`),L.literal(`clawd`),L.literal(`existing-session`)]).optional(),attachOnly:L.boolean().optional(),color:C}).strict().refine(e=>e.driver===`existing-session`||e.cdpPort||e.cdpUrl,{message:`Profile must set cdpPort or cdpUrl`}).refine(e=>e.driver===`existing-session`||!e.userDataDir,{message:`Profile userDataDir is only supported with driver="existing-session"`})).optional(),extraArgs:L.array(L.string()).optional()}).strict().optional(),ui:L.object({seamColor:C.optional(),assistant:L.object({name:L.string().max(50).optional(),avatar:L.string().max(200).optional()}).strict().optional()}).strict().optional(),secrets:ue,auth:L.object({profiles:L.record(L.string(),L.object({provider:L.string(),mode:L.union([L.literal(`api_key`),L.literal(`oauth`),L.literal(`token`)]),email:L.string().optional(),displayName:L.string().optional()}).strict()).optional(),order:L.record(L.string(),L.array(L.string())).optional(),cooldowns:L.object({billingBackoffHours:L.number().positive().optional(),billingBackoffHoursByProvider:L.record(L.string(),L.number().positive()).optional(),billingMaxHours:L.number().positive().optional(),authPermanentBackoffMinutes:L.number().positive().optional(),authPermanentMaxMinutes:L.number().positive().optional(),failureWindowHours:L.number().positive().optional(),overloadedProfileRotations:L.number().int().nonnegative().optional(),overloadedBackoffMs:L.number().int().nonnegative().optional(),rateLimitedProfileRotations:L.number().int().nonnegative().optional()}).strict().optional()}).strict().optional(),acp:L.object({enabled:L.boolean().optional(),dispatch:L.object({enabled:L.boolean().optional()}).strict().optional(),backend:L.string().optional(),defaultAgent:L.string().optional(),allowedAgents:L.array(L.string()).optional(),maxConcurrentSessions:L.number().int().positive().optional(),stream:L.object({coalesceIdleMs:L.number().int().nonnegative().optional(),maxChunkChars:L.number().int().positive().optional(),repeatSuppression:L.boolean().optional(),deliveryMode:L.union([L.literal(`live`),L.literal(`final_only`)]).optional(),hiddenBoundarySeparator:L.union([L.literal(`none`),L.literal(`space`),L.literal(`newline`),L.literal(`paragraph`)]).optional(),maxOutputChars:L.number().int().positive().optional(),maxSessionUpdateChars:L.number().int().positive().optional(),tagVisibility:L.record(L.string(),L.boolean()).optional()}).strict().optional(),runtime:L.object({ttlMinutes:L.number().int().positive().optional(),installCommand:L.string().optional()}).strict().optional()}).strict().optional(),models:me,nodeHost:Uc,agents:oc,tools:wo,bindings:uc,broadcast:fc,audio:pc,media:L.object({preserveFilenames:L.boolean().optional(),ttlHours:L.number().int().min(1).max(168).optional()}).strict().optional(),messages:Bc,commands:Vc,approvals:gc,session:zc,cron:L.object({enabled:L.boolean().optional(),store:L.string().optional(),maxConcurrentRuns:L.number().int().positive().optional(),retry:L.object({maxAttempts:L.number().int().min(0).max(10).optional(),backoffMs:L.array(L.number().int().nonnegative()).min(1).max(10).optional(),retryOn:L.array(L.enum([`rate_limit`,`overloaded`,`network`,`timeout`,`server_error`])).min(1).optional()}).strict().optional(),webhook:Qc.optional(),webhookToken:D.optional().register(N),sessionRetention:L.union([L.string(),L.literal(!1)]).optional(),runLog:L.object({maxBytes:L.union([L.string(),L.number()]).optional(),keepLines:L.number().int().positive().optional()}).strict().optional(),failureAlert:L.object({enabled:L.boolean().optional(),after:L.number().int().min(1).optional(),cooldownMs:L.number().int().min(0).optional(),mode:L.enum([`announce`,`webhook`]).optional(),accountId:L.string().optional()}).strict().optional(),failureDestination:L.object({channel:L.string().optional(),to:L.string().optional(),accountId:L.string().optional(),mode:L.enum([`announce`,`webhook`]).optional()}).strict().optional()}).strict().superRefine((e,t)=>{if(e.sessionRetention!==void 0&&e.sessionRetention!==!1)try{gt(o(e.sessionRetention)??``,{defaultUnit:`h`})}catch{t.addIssue({code:L.ZodIssueCode.custom,path:[`sessionRetention`],message:`invalid duration (use ms, s, m, h, d)`})}if(e.runLog?.maxBytes!==void 0)try{Ba(o(e.runLog.maxBytes)??``,{defaultUnit:`b`})}catch{t.addIssue({code:L.ZodIssueCode.custom,path:[`runLog`,`maxBytes`],message:`invalid size (use b, kb, mb, gb, tb)`})}}).optional(),hooks:L.object({enabled:L.boolean().optional(),path:L.string().optional(),token:L.string().optional().register(N),defaultSessionKey:L.string().optional(),allowRequestSessionKey:L.boolean().optional(),allowedSessionKeyPrefixes:L.array(L.string()).optional(),allowedAgentIds:L.array(L.string()).optional(),maxBodyBytes:L.number().int().positive().optional(),presets:L.array(L.string()).optional(),transformsDir:L.string().optional(),mappings:L.array(Cc).optional(),gmail:Oc,internal:Dc}).strict().optional(),web:L.object({enabled:L.boolean().optional(),heartbeatSeconds:L.number().int().positive().optional(),reconnect:L.object({initialMs:L.number().positive().optional(),maxMs:L.number().positive().optional(),factor:L.number().positive().optional(),jitter:L.number().min(0).max(1).optional(),maxAttempts:L.number().int().min(0).optional()}).strict().optional()}).strict().optional(),channels:Ic,discovery:L.object({wideArea:L.object({enabled:L.boolean().optional(),domain:L.string().optional()}).strict().optional(),mdns:L.object({mode:L.enum([`off`,`minimal`,`full`]).optional()}).strict().optional()}).strict().optional(),canvasHost:L.object({enabled:L.boolean().optional(),root:L.string().optional(),port:L.number().int().positive().optional(),liveReload:L.boolean().optional()}).strict().optional(),talk:rl.optional(),gateway:L.object({port:L.number().int().positive().optional(),mode:L.union([L.literal(`local`),L.literal(`remote`)]).optional(),bind:L.union([L.literal(`auto`),L.literal(`lan`),L.literal(`loopback`),L.literal(`custom`),L.literal(`tailnet`)]).optional(),customBindHost:L.string().optional(),controlUi:L.object({enabled:L.boolean().optional(),basePath:L.string().optional(),root:L.string().optional(),embedSandbox:L.union([L.literal(`strict`),L.literal(`scripts`),L.literal(`trusted`)]).optional(),allowExternalEmbedUrls:L.boolean().optional(),allowedOrigins:L.array(L.string()).optional(),dangerouslyAllowHostHeaderOriginFallback:L.boolean().optional(),allowInsecureAuth:L.boolean().optional(),dangerouslyDisableDeviceAuth:L.boolean().optional()}).strict().optional(),auth:L.object({mode:L.union([L.literal(`none`),L.literal(`token`),L.literal(`password`),L.literal(`trusted-proxy`)]).optional(),token:D.optional().register(N),password:D.optional().register(N),allowTailscale:L.boolean().optional(),rateLimit:L.object({maxAttempts:L.number().optional(),windowMs:L.number().optional(),lockoutMs:L.number().optional(),exemptLoopback:L.boolean().optional()}).strict().optional(),trustedProxy:L.object({userHeader:L.string().min(1,`userHeader is required for trusted-proxy mode`),requiredHeaders:L.array(L.string()).optional(),allowUsers:L.array(L.string()).optional()}).strict().optional()}).strict().optional(),trustedProxies:L.array(L.string()).optional(),allowRealIpFallback:L.boolean().optional(),tools:L.object({deny:L.array(L.string()).optional(),allow:L.array(L.string()).optional()}).strict().optional(),webchat:L.object({chatHistoryMaxChars:L.number().int().positive().max(5e5).optional()}).strict().optional(),channelHealthCheckMinutes:L.number().int().min(0).optional(),channelStaleEventThresholdMinutes:L.number().int().min(1).optional(),channelMaxRestartsPerHour:L.number().int().min(1).optional(),tailscale:L.object({mode:L.union([L.literal(`off`),L.literal(`serve`),L.literal(`funnel`)]).optional(),resetOnExit:L.boolean().optional()}).strict().optional(),remote:L.object({url:L.string().optional(),transport:L.union([L.literal(`ssh`),L.literal(`direct`)]).optional(),token:D.optional().register(N),password:D.optional().register(N),tlsFingerprint:L.string().optional(),sshTarget:L.string().optional(),sshIdentity:L.string().optional()}).strict().optional(),reload:L.object({mode:L.union([L.literal(`off`),L.literal(`restart`),L.literal(`hot`),L.literal(`hybrid`)]).optional(),debounceMs:L.number().int().min(0).optional(),deferralTimeoutMs:L.number().int().min(0).optional()}).strict().optional(),tls:L.object({enabled:L.boolean().optional(),autoGenerate:L.boolean().optional(),certPath:L.string().optional(),keyPath:L.string().optional(),caPath:L.string().optional()}).optional(),http:L.object({endpoints:L.object({chatCompletions:L.object({enabled:L.boolean().optional(),maxBodyBytes:L.number().int().positive().optional(),maxImageParts:L.number().int().nonnegative().optional(),maxTotalImageBytes:L.number().int().positive().optional(),images:L.object({...$c}).strict().optional()}).strict().optional(),responses:L.object({enabled:L.boolean().optional(),maxBodyBytes:L.number().int().positive().optional(),maxUrlParts:L.number().int().nonnegative().optional(),files:L.object({...$c,maxChars:L.number().int().positive().optional(),pdf:L.object({maxPages:L.number().int().positive().optional(),maxPixels:L.number().int().positive().optional(),minTextChars:L.number().int().nonnegative().optional()}).strict().optional()}).strict().optional(),images:L.object({...$c}).strict().optional()}).strict().optional()}).strict().optional(),securityHeaders:L.object({strictTransportSecurity:L.union([L.string(),L.literal(!1)]).optional()}).strict().optional()}).strict().optional(),push:L.object({apns:L.object({relay:L.object({baseUrl:L.string().optional(),timeoutMs:L.number().int().positive().optional()}).strict().optional()}).strict().optional()}).strict().optional(),nodes:L.object({browser:L.object({mode:L.union([L.literal(`auto`),L.literal(`manual`),L.literal(`off`)]).optional(),node:L.string().optional()}).strict().optional(),allowCommands:L.array(L.string()).optional(),denyCommands:L.array(L.string()).optional()}).strict().optional()}).strict().superRefine((e,t)=>{let n=e.channelHealthCheckMinutes??5;e.channelStaleEventThresholdMinutes!=null&&n!==0&&e.channelStaleEventThresholdMinutes<n&&t.addIssue({code:L.ZodIssueCode.custom,path:[`channelStaleEventThresholdMinutes`],message:`channelStaleEventThresholdMinutes should be >= channelHealthCheckMinutes to avoid delayed stale detection`})}).optional(),memory:Zc,mcp:al,skills:L.object({allowBundled:L.array(L.string()).optional(),load:L.object({extraDirs:L.array(L.string()).optional(),watch:L.boolean().optional(),watchDebounceMs:L.number().int().min(0).optional()}).strict().optional(),install:L.object({preferBrew:L.boolean().optional(),nodeManager:L.union([L.literal(`npm`),L.literal(`pnpm`),L.literal(`yarn`),L.literal(`bun`)]).optional()}).strict().optional(),limits:L.object({maxCandidatesPerRoot:L.number().int().min(1).optional(),maxSkillsLoadedPerSource:L.number().int().min(1).optional(),maxSkillsInPrompt:L.number().int().min(0).optional(),maxSkillsPromptChars:L.number().int().min(0).optional(),maxSkillFileBytes:L.number().int().min(0).optional()}).strict().optional(),entries:L.record(L.string(),el).optional()}).strict().optional(),plugins:L.object({enabled:L.boolean().optional(),allow:L.array(L.string()).optional(),deny:L.array(L.string()).optional(),load:L.object({paths:L.array(L.string()).optional()}).strict().optional(),slots:L.object({memory:L.string().optional(),contextEngine:L.string().optional()}).strict().optional(),entries:L.record(L.string(),tl).optional(),installs:L.record(L.string(),L.object({...bc}).strict()).optional()}).strict().optional(),surfaces:L.record(L.string(),L.object({silentReply:rc.optional(),silentReplyRewrite:ic.optional()}).strict()).optional()}).strict().superRefine((e,t)=>{let n=e.agents?.list??[];if(n.length===0)return;let r=new Set(n.map(e=>e.id)),i=e.broadcast;if(i){for(let[e,n]of Object.entries(i))if(e!==`strategy`&&Array.isArray(n))for(let i=0;i<n.length;i+=1){let a=n[i];r.has(a)||t.addIssue({code:L.ZodIssueCode.custom,path:[`broadcast`,e,i],message:`Unknown agent id "${a}" (not in agents.list).`})}}});function sl(e){let t=e.trim(),n=/^([vV]?[0-9]+\.[0-9]+\.[0-9]+)\.beta(?:\.([0-9A-Za-z.-]+))?$/.exec(t);if(!n)return t;let r=n[1],i=n[2];return i?`${r}-beta.${i}`:`${r}-beta`}function cl(e,t){if(!e?.length&&!t?.length)return 0;if(!e?.length)return 1;if(!t?.length)return-1;let n=Math.max(e.length,t.length);for(let r=0;r<n;r+=1){let n=e[r],i=t[r];if(n==null&&i==null)return 0;if(n==null)return-1;if(i==null)return 1;if(n===i)continue;let a=/^[0-9]+$/.test(n),o=/^[0-9]+$/.test(i);return a&&o?Number.parseInt(n,10)<Number.parseInt(i,10)?-1:1:a&&!o?-1:!a&&o?1:n<i?-1:1}return 0}function ll(e,t){for(let n of t)try{return ct({dirName:e,artifactBasename:n})}catch(e){if(e instanceof Error&&e.message.startsWith(`Unable to resolve bundled plugin public surface `))continue}}function ul(e){return ll(e,[`doctor-contract-api.js`,`contract-api.js`])}function K(e){return{...e}}function q(e,t){let n=e[t];if(h(n))return n;let r={};return e[t]=r,r}function dl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function fl(e){let t=h(e)&&h(e.channels)?e.channels:null;return t?Object.keys(t).filter(e=>e!==`defaults`).toSorted():[]}function pl(e){let t=ul(e)?.normalizeCompatibilityConfig;return typeof t==`function`?t:_e(e)?.doctor?.normalizeCompatibilityConfig}function ml(e){let t=e,n=[],r=[];for(let i of fl(e)){let e=pl(i);if(!e){r.push(i);continue}let a=e({cfg:t});!a||a.changes.length===0||(t=a.config,n.push(...a.changes))}if(r.length>0){let e=Xn(t,{pluginIds:r});t=e.config,n.push(...e.changes)}return{next:t,changes:n}}const J=e=>h(e)?e:null,hl=(e,t)=>{let n=e[t];if(h(n))return n;let r={};return e[t]=r,r},gl=(e,t)=>{for(let[n,r]of Object.entries(t)){if(r===void 0||l(n))continue;let t=e[n];if(t===void 0){e[n]=r;continue}h(t)&&h(r)&&gl(t,r)}},_l=e=>{let t=J(e),n=Array.isArray(t?.command)?t?.command:null;if(!n||n.length===0||typeof n[0]!=`string`||!n.every(e=>typeof e==`string`))return null;let r=n[0].trim();if(!r||!ve(r))return null;let i=n.slice(1),a=typeof t?.timeoutSeconds==`number`?t?.timeoutSeconds:void 0,o={command:r,type:`cli`};return i.length>0&&(o.args=i),a!==void 0&&(o.timeoutSeconds=a),o},Y=e=>e;function vl(e){let t=_l(e.source);if(!t){e.changes.push(e.invalidMessage);return}let n=hl(hl(hl(e.raw,`tools`),`media`),`audio`);if((Array.isArray(n.models)?n.models:[]).length===0){n.enabled=!0,n.models=[t],e.changes.push(e.movedMessage);return}e.changes.push(e.alreadySetMessage)}const yl=[Y({id:`audio.transcription-v2`,describe:`Move audio.transcription to tools.media.audio.models`,apply:(e,t)=>{let n=J(e.audio);n?.transcription!==void 0&&(vl({raw:e,source:n.transcription,changes:t,movedMessage:`Moved audio.transcription → tools.media.audio.models.`,alreadySetMessage:`Removed audio.transcription (tools.media.audio.models already set).`,invalidMessage:`Removed audio.transcription (invalid or empty command).`}),delete n.transcription,Object.keys(n).length===0?delete e.audio:e.audio=n)}})];function bl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xl(e){let t=J(e);return!!(t&&bl(t,`ttlHours`))}function Sl(e){let t=J(e);return t?Object.values(t).some(e=>xl(J(e)?.threadBindings)):!1}function Cl(e){let t=J(e.owner.threadBindings);if(!t||!bl(t,`ttlHours`))return!1;let n=t.idleHours!==void 0;return n||(t.idleHours=t.ttlHours),delete t.ttlHours,e.owner.threadBindings=t,n?e.changes.push(`Removed ${e.pathPrefix}.threadBindings.ttlHours (${e.pathPrefix}.threadBindings.idleHours already set).`):e.changes.push(`Moved ${e.pathPrefix}.threadBindings.ttlHours → ${e.pathPrefix}.threadBindings.idleHours.`),!0}function wl(e){let t=J(e);return t?Object.values(t).some(e=>{let t=J(e);return t?xl(t.threadBindings)||Sl(t.accounts):!1}):!1}const Tl=[Y({id:`thread-bindings.ttlHours->idleHours`,describe:`Move legacy threadBindings.ttlHours keys to threadBindings.idleHours (session + channel configs)`,legacyRules:[{path:[`session`,`threadBindings`],message:`session.threadBindings.ttlHours was renamed to session.threadBindings.idleHours. Run "openclaw doctor --fix".`,match:e=>xl(e)},{path:[`channels`],message:`channels.<id>.threadBindings.ttlHours was renamed to channels.<id>.threadBindings.idleHours. Run "openclaw doctor --fix".`,match:e=>wl(e)}],apply:(e,t)=>{let n=J(e.session);n&&(Cl({owner:n,pathPrefix:`session`,changes:t}),e.session=n);let r=J(e.channels);if(r){for(let[e,n]of Object.entries(r)){let i=J(n);if(!i)continue;Cl({owner:i,pathPrefix:`channels.${e}`,changes:t});let a=J(i.accounts);if(a){for(let[n,r]of Object.entries(a)){let i=J(r);i&&(Cl({owner:i,pathPrefix:`channels.${e}.accounts.${n}`,changes:t}),a[n]=i)}i.accounts=a}r[e]=i}e.channels=r}}})],El=new Set([`every`,`activeHours`,`model`,`session`,`includeReasoning`,`target`,`directPolicy`,`to`,`accountId`,`prompt`,`ackMaxChars`,`suppressToolErrorWarnings`,`lightContext`,`isolatedSession`]),Dl=new Set([`showOk`,`showAlerts`,`useIndicator`]),Ol={path:[`memorySearch`],message:`top-level memorySearch was moved; use agents.defaults.memorySearch instead. Run "openclaw doctor --fix".`},kl={path:[`heartbeat`],message:`top-level heartbeat is not a valid config path; use agents.defaults.heartbeat (cadence/target/model settings) or channels.defaults.heartbeat (showOk/showAlerts/useIndicator).`},Al=[{path:[`agents`,`defaults`,`sandbox`],message:`agents.defaults.sandbox.perSession is legacy; use agents.defaults.sandbox.scope instead. Run "openclaw doctor --fix".`,match:e=>Pl(e)},{path:[`agents`,`list`],message:`agents.list[].sandbox.perSession is legacy; use agents.list[].sandbox.scope instead. Run "openclaw doctor --fix".`,match:e=>Fl(e)}];function jl(e){return e?`session`:`shared`}function Ml(e){let t={},n={};for(let[r,i]of Object.entries(e))if(!l(r)){if(Dl.has(r)){n[r]=i;continue}if(El.has(r)){t[r]=i;continue}t[r]=i}return{agentHeartbeat:Object.keys(t).length>0?t:null,channelHeartbeat:Object.keys(n).length>0?n:null}}function Nl(e){let t=hl(e.raw,e.rootKey),n=hl(t,`defaults`),r=J(n[e.fieldKey]);if(!r)n[e.fieldKey]=e.legacyValue,e.changes.push(e.movedMessage);else{let t=structuredClone(r);gl(t,e.legacyValue),n[e.fieldKey]=t,e.changes.push(e.mergedMessage)}t.defaults=n,e.raw[e.rootKey]=t}function Pl(e){let t=J(e);return!!(t&&Object.prototype.hasOwnProperty.call(t,`perSession`))}function Fl(e){return Array.isArray(e)?e.some(e=>Pl(J(e)?.sandbox)):!1}function Il(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,`perSession`))return;let r=e.perSession;typeof r==`boolean`&&(e.scope===void 0?(e.scope=jl(r),n.push(`Moved ${t}.perSession → ${t}.scope (${String(e.scope)}).`)):n.push(`Removed ${t}.perSession (${t}.scope already set).`),delete e.perSession)}const Ll=[Y({id:`agents.sandbox.perSession->scope`,describe:`Move legacy agent sandbox perSession aliases to sandbox.scope`,legacyRules:Al,apply:(e,t)=>{let n=J(e.agents),r=J(J(n?.defaults)?.sandbox);if(r&&Il(r,`agents.defaults.sandbox`,t),Array.isArray(n?.list))for(let[e,r]of n.list.entries()){let n=J(J(r)?.sandbox);n&&Il(n,`agents.list.${e}.sandbox`,t)}}}),Y({id:`memorySearch->agents.defaults.memorySearch`,describe:`Move top-level memorySearch to agents.defaults.memorySearch`,legacyRules:[Ol],apply:(e,t)=>{let n=J(e.memorySearch);n&&(Nl({raw:e,rootKey:`agents`,fieldKey:`memorySearch`,legacyValue:n,changes:t,movedMessage:`Moved memorySearch → agents.defaults.memorySearch.`,mergedMessage:`Merged memorySearch → agents.defaults.memorySearch (filled missing fields from legacy; kept explicit agents.defaults values).`}),delete e.memorySearch)}}),Y({id:`heartbeat->agents.defaults.heartbeat`,describe:`Move top-level heartbeat to agents.defaults.heartbeat/channels.defaults.heartbeat`,legacyRules:[kl],apply:(e,t)=>{let n=J(e.heartbeat);if(!n)return;let{agentHeartbeat:r,channelHeartbeat:i}=Ml(n);r&&Nl({raw:e,rootKey:`agents`,fieldKey:`heartbeat`,legacyValue:r,changes:t,movedMessage:`Moved heartbeat → agents.defaults.heartbeat.`,mergedMessage:`Merged heartbeat → agents.defaults.heartbeat (filled missing fields from legacy; kept explicit agents.defaults values).`}),i&&Nl({raw:e,rootKey:`channels`,fieldKey:`heartbeat`,legacyValue:i,changes:t,movedMessage:`Moved heartbeat visibility → channels.defaults.heartbeat.`,mergedMessage:`Merged heartbeat visibility → channels.defaults.heartbeat (filled missing fields from legacy; kept explicit channels.defaults values).`}),!r&&!i&&t.push(`Removed empty top-level heartbeat.`),delete e.heartbeat}})],Rl={path:[`gateway`,`bind`],message:`gateway.bind host aliases (for example 0.0.0.0/localhost) are legacy; use bind modes (lan/loopback/custom/tailnet/auto) instead. Run "openclaw doctor --fix".`,match:e=>zl(e),requireSourceLiteral:!0};function zl(e){let t=a(e);return!t||t===`auto`||t===`loopback`||t===`lan`||t===`tailnet`||t===`custom`?!1:t===`0.0.0.0`||t===`::`||t===`[::]`||t===`*`||t===`127.0.0.1`||t===`localhost`||t===`::1`||t===`[::1]`}function Bl(e){return e.replace(/\r/g,`\\r`).replace(/\n/g,`\\n`).replace(/\t/g,`\\t`)}const Vl=[Y({id:`gateway.controlUi.allowedOrigins-seed-for-non-loopback`,describe:`Seed gateway.controlUi.allowedOrigins for existing non-loopback gateway installs`,apply:(e,t)=>{let n=J(e.gateway);if(!n)return;let r=n.bind;if(!Zn(r))return;let i=J(n.controlUi)??{};if(Qn({allowedOrigins:i.allowedOrigins,dangerouslyAllowHostHeaderOriginFallback:i.dangerouslyAllowHostHeaderOriginFallback}))return;let a=er({port:$n(n.port,u),bind:r,customBindHost:typeof n.customBindHost==`string`?n.customBindHost:void 0});n.controlUi={...i,allowedOrigins:a},e.gateway=n,t.push(`Seeded gateway.controlUi.allowedOrigins ${JSON.stringify(a)} for bind=${r}. Required since v2026.2.26. Add other machine origins to gateway.controlUi.allowedOrigins if needed.`)}}),Y({id:`gateway.bind.host-alias->bind-mode`,describe:`Normalize gateway.bind host aliases to supported bind modes`,legacyRules:[Rl],apply:(e,t)=>{let n=J(e.gateway);if(!n)return;let r=n.bind;if(typeof r!=`string`)return;let i=a(r);if(!i)return;let o;i===`0.0.0.0`||i===`::`||i===`[::]`||i===`*`?o=`lan`:(i===`127.0.0.1`||i===`localhost`||i===`::1`||i===`[::1]`)&&(o=`loopback`),!(!o||i===o)&&(n.bind=o,e.gateway=n,t.push(`Normalized gateway.bind "${Bl(r)}" → "${o}".`))}})],Hl=`tools.web.x_search`,Ul=`plugins.entries.xai.config.webSearch.apiKey`;function Wl(e){return e&&{...e}}function Gl(e,t){let n=e[t];if(h(n))return n;let r={};return e[t]=r,r}function Kl(e){if(!h(e))return;let t=h(e.tools)?e.tools:void 0,n=h(t?.web)?t.web:void 0;return h(n?.x_search)?n.x_search:void 0}function ql(e){return e.apiKey}function Jl(e){if(!h(e))return{config:e,changes:[]};let t=Kl(e);if(!t||!Object.prototype.hasOwnProperty.call(t,`apiKey`))return{config:e,changes:[]};let n=structuredClone(e),r=Gl(Gl(n,`tools`),`web`),i=Wl(t)??{};delete i.apiKey,Object.keys(i).length===0?delete r.x_search:r.x_search=i;let a=Gl(Gl(Gl(n,`plugins`),`entries`),`xai`),o=a.enabled!==void 0;o||(a.enabled=!0);let s=Gl(a,`config`),c=ql(t),l=[];if(c!==void 0){let e=h(s.webSearch)?Wl(s.webSearch):void 0;e?Object.prototype.hasOwnProperty.call(e,`apiKey`)?l.push(`Removed ${Hl}.apiKey (${Ul} already set).`):(e.apiKey=c,s.webSearch=e,l.push(`Merged ${Hl}.apiKey → ${Ul} (filled missing plugin auth).`)):(s.webSearch={apiKey:c},l.push(`Moved ${Hl}.apiKey → ${Ul}.`))}return c!==void 0&&Object.keys(i).length===0&&!o&&l.push(`Removed empty ${Hl}.`),{config:n,changes:l}}const Yl=[Y({id:`tools.web.x_search.apiKey->plugins.entries.xai.config.webSearch.apiKey`,describe:`Move legacy x_search auth into the xAI plugin webSearch config`,legacyRules:[{path:[`tools`,`web`,`x_search`,`apiKey`],message:`tools.web.x_search.apiKey moved to the xAI plugin; use plugins.entries.xai.config.webSearch.apiKey instead. Run "openclaw doctor --fix".`}],apply:(e,t)=>{let n=Jl(e);if(n.changes.length){for(let t of Object.keys(e))delete e[t];Object.assign(e,n.config),t.push(...n.changes)}}})],Xl=[`openai`,`elevenlabs`,`microsoft`,`edge`],Zl=new Set([`voice-call`]);function Ql(e){let t=J(e);return t?Xl.some(e=>Object.prototype.hasOwnProperty.call(t,e)):!1}function $l(e){let t=J(e);return t?Object.entries(t).some(([e,t])=>l(e)||!Zl.has(e)?!1:Ql(J(J(t)?.config)?.tts)):!1}function eu(e){let t=J(e.providers)??{};return e.providers=t,t}function tu(e,t,n){let r=J(e[t]);if(!r)return!1;let i=eu(e),a=J(i[n])??{},o=structuredClone(a);return gl(o,r),i[n]=o,delete e[t],!0}function nu(e,t,n){if(!e)return;let r=tu(e,`openai`,`openai`),i=tu(e,`elevenlabs`,`elevenlabs`),a=tu(e,`microsoft`,`microsoft`),o=tu(e,`edge`,`microsoft`);r&&n.push(`Moved ${t}.openai → ${t}.providers.openai.`),i&&n.push(`Moved ${t}.elevenlabs → ${t}.providers.elevenlabs.`),a&&n.push(`Moved ${t}.microsoft → ${t}.providers.microsoft.`),o&&n.push(`Moved ${t}.edge → ${t}.providers.microsoft.`)}const ru=[Y({id:`tts.providers-generic-shape`,describe:`Move legacy bundled TTS config keys into messages.tts.providers`,legacyRules:[{path:[`messages`,`tts`],message:`messages.tts.<provider> keys (openai/elevenlabs/microsoft/edge) are legacy; use messages.tts.providers.<provider>. Run "openclaw doctor --fix".`,match:e=>Ql(e)},{path:[`plugins`,`entries`],message:`plugins.entries.voice-call.config.tts.<provider> keys (openai/elevenlabs/microsoft/edge) are legacy; use plugins.entries.voice-call.config.tts.providers.<provider>. Run "openclaw doctor --fix".`,match:e=>$l(e)}],apply:(e,t)=>{nu(J(J(e.messages)?.tts),`messages.tts`,t);let n=J(J(e.plugins)?.entries);if(n)for(let[e,r]of Object.entries(n))l(e)||!Zl.has(e)||nu(J(J(J(r)?.config)?.tts),`plugins.entries.${e}.config.tts`,t)}})],iu=[...Ll,...Vl,...Yl,...ru],au=new Set([`openaiCodex`]),ou=new Set([`tavily`]),su=`brave`;let cu,lu;function uu(){return cu??=P({cache:!0}).plugins.filter(e=>e.origin===`bundled`).flatMap(e=>e.contracts?.webSearchProviders??[]).filter(e=>!ou.has(e)).toSorted((e,t)=>e.localeCompare(t)),cu}function du(){return lu??=new Set(uu()),lu}function fu(e){if(!h(e))return;let t=h(e.tools)?e.tools:void 0,n=h(t?.web)?t.web:void 0;return h(n?.search)?n.search:void 0}function pu(e,t){let n=e[t];return h(n)?K(n):void 0}function mu(e){let t=fu(e);return t?dl(t,`apiKey`)?!0:uu().some(e=>h(t[e])):!1}function hu(e){let t=pu(e,su),n=t??{},r=dl(e,`apiKey`);if(r&&(n.apiKey=e.apiKey),Object.keys(n).length===0)return null;let i=ze({contract:`webSearchProviders`,value:su,origin:`bundled`})??su;return{pluginId:i,payload:n,legacyPath:r?`tools.web.search.apiKey`:`tools.web.search.${su}`,targetPath:r&&!t?`plugins.entries.${i}.config.webSearch.apiKey`:`plugins.entries.${i}.config.webSearch`}}function gu(e){let t=q(q(q(e.root,`plugins`),`entries`),e.pluginId),n=q(t,`config`),r=t.enabled!==void 0,i=h(n.webSearch)?K(n.webSearch):void 0;if(r||(t.enabled=!0),!i){n.webSearch=K(e.payload),e.changes.push(`Moved ${e.legacyPath} → ${e.targetPath}.`);return}let a=K(i);gl(a,e.payload);let o=JSON.stringify(a)!==JSON.stringify(i)||!r;if(n.webSearch=a,o){e.changes.push(`Merged ${e.legacyPath} → ${e.targetPath} (filled missing fields from legacy; kept explicit plugin config values).`);return}e.changes.push(`Removed ${e.legacyPath} (${e.targetPath} already set).`)}function _u(e){let t=fu(e);if(!t)return[];let n=[];`apiKey`in t&&n.push(`tools.web.search.apiKey`);for(let e of uu()){let r=t[e];if(h(r))for(let t of Object.keys(r))n.push(`tools.web.search.${e}.${t}`)}return n}function vu(e){return!h(e)||!mu(e)?{config:e,changes:[]}:yu(e)}function yu(e){let t=K(e),n=q(q(t,`tools`),`web`),r=fu(t);if(!r)return{config:e,changes:[]};let i={},a=[];for(let[e,t]of Object.entries(r))e!==`apiKey`&&(du().has(e)&&h(t)||(au.has(e)||!h(t))&&(i[e]=t));n.search=i;let o=hu(r);o&&gu({root:t,legacyPath:o.legacyPath,targetPath:o.targetPath,pluginId:o.pluginId,payload:o.payload,changes:a});for(let e of uu()){if(e===su)continue;let n=pu(r,e);if(!n||Object.keys(n).length===0)continue;let i=ze({contract:`webSearchProviders`,value:e,origin:`bundled`});i&&gu({root:t,legacyPath:`tools.web.search.${e}`,targetPath:`plugins.entries.${i}.config.webSearch`,pluginId:i,payload:n,changes:a})}return{config:t,changes:a}}const bu=[{path:[`tools`,`web`,`search`],message:`tools.web.search provider-owned config moved to plugins.entries.<plugin>.config.webSearch. Run "openclaw doctor --fix".`,match:(e,t)=>_u(t).length>0,requireSourceLiteral:!0}];function xu(e,t){for(let t of Object.keys(e))delete e[t];Object.assign(e,t)}const Su=[Y({id:`tools.web.search-provider-config->plugins.entries`,describe:`Move legacy tools.web.search provider-owned config into plugins.entries.<plugin>.config.webSearch`,legacyRules:bu,apply:(e,t)=>{let n=vu(e);n.changes.length!==0&&(xu(e,n.config),t.push(...n.changes))}})],Cu=[...Tl,...yl,...iu,...Su],wu=Cu.map(({legacyRules:e,...t})=>t),Tu=Cu.flatMap(e=>e.legacyRules??[]);function Eu(e){if(!e||typeof e!=`object`)return{next:null,changes:[]};let t=e,n=structuredClone(t),r=[];for(let e of wu)e.apply(n,r);let i=ml(n);return r.push(...i.changes),r.length===0?{next:null,changes:[]}:{next:i.next,changes:r}}const Du=[`provider-policy-api.js`],Ou=new Map;function ku(e){return`${e}::${g()??`<default>`}`}function Au(e){return typeof e.normalizeConfig==`function`||typeof e.applyConfigDefaults==`function`||typeof e.resolveConfigApiKey==`function`}function ju(e){for(let t of Du)try{let n=ct({dirName:e,artifactBasename:t});if(Au(n))return n}catch(e){if(e instanceof Error&&e.message.startsWith(`Unable to resolve bundled plugin public surface `))continue;throw e}return null}function Mu(e){let t=j(e);if(!t)return null;let n=ku(t);if(Ou.has(n))return Ou.get(n)??null;let r=ju(t);return r?(Ou.set(n,r),r):(Ou.set(n,null),null)}function Nu(e){let t=Mu(e.provider)?.normalizeConfig?.({provider:e.provider,providerConfig:e.providerConfig});return t&&t!==e.providerConfig?t:e.providerConfig}function Pu(e){return Mu(e.provider)?.applyConfigDefaults?.({provider:e.provider,config:e.config,env:e.env})??e.config}function Fu(e){if(typeof e==`string`){let t=e.trim();return t.length>0?t:void 0}return Ae(e)??void 0}function Iu(e){if(!(typeof e!=`number`||!Number.isInteger(e)||e<=0))return e}function Lu(e){if(!h(e))return;let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){if(n===`apiKey`){let e=Fu(r);e!==void 0&&(t.apiKey=e);continue}t[n]=r}return Object.keys(t).length>0?t:void 0}function Ru(e){if(!h(e))return;let t={};for(let[r,i]of Object.entries(e)){let e=n(r);if(!e)continue;let a=Lu(i);a&&(t[e]={...t[e],...a})}return Object.keys(t).length>0?t:void 0}function zu(e){if(!h(e))return;let t=e,r={};typeof t.interruptOnSpeech==`boolean`&&(r.interruptOnSpeech=t.interruptOnSpeech);let i=Iu(t.silenceTimeoutMs);i!==void 0&&(r.silenceTimeoutMs=i);let a=Ru(t.providers),o=n(t.provider);return a&&(r.providers=a),o&&(r.provider=o),Object.keys(r).length>0?r:void 0}function Bu(e){if(!e.talk)return e;let t=zu(e.talk);return t?{...e,talk:t}:e}let Vu={warned:!1};const Hu={opus:`anthropic/claude-opus-4-7`,sonnet:`anthropic/claude-sonnet-4-6`,gpt:`openai/gpt-5.4`,"gpt-mini":`openai/gpt-5.4-mini`,"gpt-nano":`openai/gpt-5.4-nano`,gemini:`google/gemini-3.1-pro-preview`,"gemini-flash":`google/gemini-3-flash-preview`,"gemini-flash-lite":`google/gemini-3.1-flash-lite-preview`},Uu={input:0,output:0,cacheRead:0,cacheWrite:0},Wu=[`text`],Gu=8192,Ku={"devstral-medium-latest":32768,"magistral-small":4e4,"mistral-large-latest":16384,"mistral-medium-2508":8192,"mistral-small-latest":16384,"pixtral-large-latest":32768};function qu(e){return typeof e==`number`&&Number.isFinite(e)&&e>0}function Ju(e){return{input:typeof e?.input==`number`?e.input:Uu.input,output:typeof e?.output==`number`?e.output:Uu.output,cacheRead:typeof e?.cacheRead==`number`?e.cacheRead:Uu.cacheRead,cacheWrite:typeof e?.cacheWrite==`number`?e.cacheWrite:Uu.cacheWrite,...e?.tieredPricing?{tieredPricing:e.tieredPricing}:{}}}function Yu(e){let t=Math.min(e.rawMaxTokens,e.contextWindow);if(j(e.providerId)!==`mistral`||t<e.contextWindow)return t;let n=Ku[e.modelId]??Gu;return Math.min(n,e.contextWindow)}function Xu(e){let t=e.messages;if(t?.ackReactionScope!==void 0)return e;let n=t?{...t}:{};return n.ackReactionScope=`group-mentions`,{...e,messages:n}}function Zu(e,t={}){let n=e.session;if(!n||n.mainKey===void 0)return e;let r=n.mainKey.trim(),i=t.warn??console.warn,a=t.warnState??Vu,o={...e,session:{...n,mainKey:`main`}};return r&&r!==`main`&&!a.warned&&(a.warned=!0,i(`session.mainKey is ignored; main session is always "main".`)),o}function Qu(e){return Bu(e)}function $u(e){let t=!1,n=e,r=n.models?.providers;if(r){let e={...r};for(let[n,i]of Object.entries(r)){let r=Nu({provider:n,providerConfig:i}),a=r.models;if(!Array.isArray(a)||a.length===0){r!==i&&(e[n]=r,t=!0);continue}let o=r.api,s=r;s!==i&&(t=!0);let c=!1,l=a.map(e=>{let t=e,r=!1,i=typeof t.reasoning==`boolean`?t.reasoning:!1;t.reasoning!==i&&(r=!0);let a=t.input??[...Wu];t.input===void 0&&(r=!0);let s=Ju(t.cost);(!t.cost||t.cost.input!==s.input||t.cost.output!==s.output||t.cost.cacheRead!==s.cacheRead||t.cost.cacheWrite!==s.cacheWrite)&&(r=!0);let l=qu(t.contextWindow)?t.contextWindow:2e5;t.contextWindow!==l&&(r=!0);let u=Math.min(Gu,l),d=qu(t.maxTokens)?t.maxTokens:u,f=Yu({providerId:n,modelId:t.id,contextWindow:l,rawMaxTokens:d});t.maxTokens!==f&&(r=!0);let p=t.api??o;return t.api!==p&&(r=!0),r?(c=!0,Object.assign({},t,{reasoning:i,input:a,cost:s,contextWindow:l,maxTokens:f,api:p})):e});if(!c){s!==i&&(e[n]=s);continue}e[n]={...s,models:l},t=!0}t&&(n={...n,models:{...n.models,providers:e}})}let i=n.agents?.defaults;if(!i)return t?n:e;let a=i.models??{};if(Object.keys(a).length===0)return t?n:e;let o={...a};for(let[e,n]of Object.entries(Hu)){let r=o[n];r&&r.alias===void 0&&(o[n]={...r,alias:e},t=!0)}return t?{...n,agents:{...n.agents,defaults:{...i,models:o}}}:e}function ed(e){let t=e.agents,n=t?.defaults,r=typeof n?.maxConcurrent==`number`&&Number.isFinite(n.maxConcurrent),i=typeof n?.subagents?.maxConcurrent==`number`&&Number.isFinite(n.subagents.maxConcurrent);if(r&&i)return e;let a=!1,o=n?{...n}:{};r||(o.maxConcurrent=4,a=!0);let s=n?.subagents?{...n.subagents}:{};return i||(s.maxConcurrent=8,a=!0),a?{...e,agents:{...t,defaults:{...o,subagents:s}}}:e}function td(e){let t=e.logging;return!t||t.redactSensitive?e:{...e,logging:{...t,redactSensitive:`tools`}}}function nd(e,t){if(t.ANTHROPIC_API_KEY?.trim()||t.ANTHROPIC_OAUTH_TOKEN?.trim())return!0;let n=e.auth?.profiles;if(n)for(let e of Object.values(n)){let t=j(e?.provider);if(t===`anthropic`||t===`claude-cli`)return!0}let r=e.auth?.order;return r?Object.keys(r).some(e=>{let t=j(e);return t!==`anthropic`&&t!==`claude-cli`?!1:r[e]!==void 0}):!1}function rd(e){return!e.agents?.defaults||!nd(e,process.env)?e:Pu({provider:`anthropic`,config:e,env:process.env})??e}function id(e){let t=e.agents?.defaults;if(!t)return e;let n=t?.compaction;return n?.mode?e:{...e,agents:{...e.agents,defaults:{...t,compaction:{...n,mode:`safeguard`}}}}}function ad(e){let t={};for(let n of[`voiceId`,`voiceAliases`,`modelId`,`outputFormat`,`apiKey`])e[n]!==void 0&&(t[n]=e[n]);return Object.keys(t).length>0?t:void 0}function od(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}function sd(e,t){let n=e.talk;if(!od(n))return e;let r=zu(n)??{},i=ad(n);return i&&(r.providers={...r.providers,elevenlabs:{...i,...r.providers?.elevenlabs}}),Object.keys(r).length===0||pt(r,n)?e:(t.push(`Normalized talk.provider/providers shape (trimmed provider ids and merged missing compatibility fields).`),{...e,talk:r})}function cd(e,t){let r=e.browser;if(!h(r))return e;let i=structuredClone(r),a=!1;`relayBindHost`in i&&(delete i.relayBindHost,a=!0,t.push(`Removed browser.relayBindHost (legacy Chrome extension relay setting; host-local Chrome now uses Chrome MCP existing-session attach).`));let o=i.profiles;if(h(o)){let e={...o},r=!1;for(let[i,a]of Object.entries(o))h(a)&&(n(a.driver)??``)===`extension`&&(e[i]={...a,driver:`existing-session`},r=!0,t.push(`Moved browser.profiles.${i}.driver "extension" → "existing-session" (Chrome MCP attach).`));r&&(i.profiles=e,a=!0)}let s=i.ssrfPolicy;if(h(s)&&`allowPrivateNetwork`in s){let e=s.allowPrivateNetwork,n=s.dangerouslyAllowPrivateNetwork,r=n;typeof e==`boolean`||typeof n==`boolean`?r=e===!0||n===!0:n===void 0&&(r=e);let o={...s};delete o.allowPrivateNetwork,r!==void 0&&(o.dangerouslyAllowPrivateNetwork=r),i.ssrfPolicy=o,a=!0,t.push(`Moved browser.ssrfPolicy.allowPrivateNetwork → browser.ssrfPolicy.dangerouslyAllowPrivateNetwork (${String(r)}).`)}return a?{...e,browser:i}:e}function ld(e,t){let n=e.channels;if(!n)return e;let r=!1,i={...n};for(let[e,o]of Object.entries(n)){if(!h(o))continue;let n=o.accounts;if(!h(n))continue;let s=Object.keys(n);if(s.length===0||s.some(e=>a(e)===`default`))continue;let c=or({channelKey:e,channel:o});if(c.length===0)continue;let l={};for(let e of c){let t=o[e];l[e]=t&&typeof t==`object`?structuredClone(t):t}let u={...o};for(let e of c)delete u[e];u.accounts={...n,[d]:l},i[e]=u,r=!0,t.push(`Moved channels.${e} single-account top-level values into channels.${e}.accounts.default.`)}return r?{...e,channels:i}:e}function ud(e,t){let r=`nano-banana-pro`,i=`google/gemini-3-pro-image-preview`,a=e.skills;if(!h(a))return e;let o=e,s=!1,c=structuredClone(a);if(Array.isArray(c.allowBundled)){let e=c.allowBundled.filter(e=>typeof e!=`string`||e.trim()!==r);e.length!==c.allowBundled.length&&(e.length===0?(delete c.allowBundled,t.push(`Removed skills.allowBundled entry for ${r}.`)):(c.allowBundled=e,t.push(`Removed ${r} from skills.allowBundled.`)),s=!0)}let l=c.entries;if(!h(l))return s?{...e,skills:c}:e;let u=l[r];if(!h(u))return s?{...e,skills:c}:e;o.agents?.defaults?.imageGenerationModel===void 0&&(o={...o,agents:{...o.agents,defaults:{...o.agents?.defaults,imageGenerationModel:{primary:i}}}},t.push(`Moved skills.entries.${r} → agents.defaults.imageGenerationModel.primary (${i}).`));let d=n((h(u.env)?u.env:void 0)?.GEMINI_API_KEY)??``,f=d||(typeof u.apiKey==`string`?n(u.apiKey):u.apiKey&&h(u.apiKey)?structuredClone(u.apiKey):void 0),p=h(o.models)?structuredClone(o.models):{},m=h(p.providers)?{...p.providers}:{},g=h(m.google)?{...m.google}:{};g.apiKey===void 0&&f&&(g.apiKey=f,g.baseUrl||=`https://generativelanguage.googleapis.com/v1beta`,Array.isArray(g.models)||(g.models=[]),m.google=g,p.providers=m,o={...o,models:p},t.push(`Moved skills.entries.${r}.${d?`env.GEMINI_API_KEY`:`apiKey`} → models.providers.google.apiKey.`));let _={...l};if(delete _[r],Object.keys(_).length===0?delete c.entries:c.entries=_,t.push(`Removed legacy skills.entries.${r}.`),s=!0,Object.keys(c).length===0){let{skills:e,...t}=o;return t}return s?{...o,skills:c}:o}function dd(e,t){let n=e.tools;if(!h(n))return e;let r=n.message;if(!h(r)||!(`allowCrossContextSend`in r))return e;let i=r.allowCrossContextSend;if(typeof i!=`boolean`)return e;let a={...r};if(delete a.allowCrossContextSend,i){let e=h(a.crossContext)?structuredClone(a.crossContext):{};e.allowWithinProvider=!0,e.allowAcrossProviders=!0,a.crossContext=e,t.push(`Moved tools.message.allowCrossContextSend → tools.message.crossContext.allowWithinProvider/allowAcrossProviders (true).`)}else t.push(`Removed tools.message.allowCrossContextSend=false (default cross-context policy already matches canonical settings).`);return{...e,tools:{...e.tools,message:a}}}function fd(e){let t={};return typeof e.detectLanguage==`boolean`&&(t.detect_language=e.detectLanguage),typeof e.punctuate==`boolean`&&(t.punctuate=e.punctuate),typeof e.smartFormat==`boolean`&&(t.smart_format=e.smartFormat),t}function pd(e){let t=h(e.owner.deepgram)?structuredClone(e.owner.deepgram):null;if(!t)return!1;let n=fd(t),r=h(e.owner.providerOptions)?structuredClone(e.owner.providerOptions):{},i=h(r.deepgram)?structuredClone(r.deepgram):{},a={...n,...i};delete e.owner.deepgram,r.deepgram=a,e.owner.providerOptions=r;let o=Object.keys(i).length>0;return e.changes.push(o?`Merged ${e.pathPrefix}.deepgram → ${e.pathPrefix}.providerOptions.deepgram (filled missing canonical fields from legacy).`:`Moved ${e.pathPrefix}.deepgram → ${e.pathPrefix}.providerOptions.deepgram.`),!0}function md(e,t){let n=e.tools;if(!h(n))return e;let r=n.media;if(!h(r))return e;let i=!1,a=structuredClone(r),o=(e,n)=>{if(!Array.isArray(e))return!1;let r=!1;for(let[i,a]of e.entries())h(a)&&pd({owner:a,pathPrefix:`${n}[${i}]`,changes:t})&&(r=!0);return r};for(let e of[`audio`,`image`,`video`]){let n=h(a[e])?structuredClone(a[e]):null;if(!n)continue;let r=!1;pd({owner:n,pathPrefix:`tools.media.${e}`,changes:t})&&(r=!0),o(n.models,`tools.media.${e}.models`)&&(r=!0),r&&(a[e]=n,i=!0)}return o(a.models,`tools.media.models`)&&(i=!0),i?{...e,tools:{...e.tools,media:a}}:e}function hd(e,t){let r=e.models?.providers;if(!h(r))return e;let i=!1,a={...r};for(let[e,o]of Object.entries(r)){if(j(e)!==`mistral`||!h(o))continue;let r=o.models;if(!Array.isArray(r))continue;let s=!1,c=r.map((r,i)=>{if(!h(r))return r;let a=n(r.id)??``,o=typeof r.contextWindow==`number`&&Number.isFinite(r.contextWindow)?r.contextWindow:null,c=typeof r.maxTokens==`number`&&Number.isFinite(r.maxTokens)?r.maxTokens:null;if(!a||o===null||c===null)return r;let l=Yu({providerId:e,modelId:a,contextWindow:o,rawMaxTokens:c});return l===c?r:(s=!0,t.push(`Normalized models.providers.${e}.models[${i}].maxTokens (${c} → ${l}) to avoid Mistral context-window rejects.`),Object.assign({},r,{maxTokens:l}))});s&&(a[e]={...o,models:c},i=!0)}return i?{...e,models:{...e.models,providers:a}}:e}const gd=new Set([`__proto__`,`prototype`,`constructor`]);function _d(e){if(!h(e))return;let t=h(e.tools)?e.tools:void 0,n=h(t?.web)?t.web:void 0;return h(n?.fetch)?n.fetch:void 0}function vd(e){let t=e.firecrawl;if(!h(t))return;let n=K(t);return delete n.enabled,n}function yd(e){let t=_d(e);return t?h(t.firecrawl):!1}function bd(e){let t=q(q(q(e.root,`plugins`),`entries`),`firecrawl`),n=q(t,`config`),r=t.enabled!==void 0,i=h(n.webFetch)?K(n.webFetch):void 0;if(r||(t.enabled=!0),!i){n.webFetch=K(e.payload),e.changes.push(`Moved tools.web.fetch.firecrawl → plugins.entries.firecrawl.config.webFetch.`);return}let a=K(i);gl(a,e.payload);let o=JSON.stringify(a)!==JSON.stringify(i)||!r;if(n.webFetch=a,o){e.changes.push(`Merged tools.web.fetch.firecrawl → plugins.entries.firecrawl.config.webFetch (filled missing fields from legacy; kept explicit plugin config values).`);return}e.changes.push(`Removed tools.web.fetch.firecrawl (plugins.entries.firecrawl.config.webFetch already set).`)}function xd(e){return!h(e)||!yd(e)?{config:e,changes:[]}:Sd(e)}function Sd(e){let t=structuredClone(e),n=q(q(t,`tools`),`web`),r=_d(t);if(!r)return{config:e,changes:[]};let i={};for(let[e,t]of Object.entries(r))e===`firecrawl`&&h(t)||gd.has(e)||(i[e]=t);n.fetch=i;let a=vd(r),o=[];return a&&Object.keys(a).length>0?bd({root:t,payload:a,changes:o}):dl(r,`firecrawl`)&&o.push(`Removed empty tools.web.fetch.firecrawl.`),{config:t,changes:o}}function Cd(e,t,n){let r=ld(e,t);r=cd(r,t),r=n?n(r):r;for(let e of[vu,xd,Jl]){let n=e(r);n.changes.length!==0&&(r=n.config,t.push(...n.changes))}return r=ud(r,t),r=sd(r,t),r=dd(r,t),r=md(r,t),hd(r,t)}function wd(e){let t=[];return{config:Cd(e,t),changes:t}}function Td(e){if(!e||typeof e!=`object`)return{next:null,changes:[]};let t=e,n=Eu(t),r=wd(n.next??t),i=r.config,a=[...n.changes,...r.changes];return a.length===0||pt(i,t)?{next:null,changes:[]}:{next:i,changes:a}}const Ed=15e3;let Dd=[],Od,kd=1;const Ad=new Map,jd=new WeakMap;function Md(e){let t=Wt({baseEnv:e}),n=ut.homedir().trim();return n?t.HOME=n:delete t.HOME,delete t.ZDOTDIR,t}function Nd(e){return typeof e!=`number`||!Number.isFinite(e)?Ed:Math.max(0,e)}function Pd(){if(Od!==void 0)return Od;try{let e=F.readFileSync(`/etc/shells`,`utf8`).split(/\r?\n/).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`#`)&&I.isAbsolute(e));Od=new Set(e)}catch{Od=null}return Od}function Fd(e){return!I.isAbsolute(e)||I.normalize(e)!==e?!1:Pd()?.has(e)===!0}function Id(e){let t=e.SHELL?.trim();return t&&Fd(t)?t:`/bin/sh`}function Ld(e){return e.exec(e.shell,[`-l`,`-c`,`env -0`],{encoding:`buffer`,timeout:e.timeoutMs,maxBuffer:2097152,env:e.env,stdio:[`ignore`,`pipe`,`pipe`]})}function Rd(e){let t=new Map,n=e.toString(`utf8`).split(`\0`);for(let e of n){if(!e)continue;let n=e.indexOf(`=`);if(n<=0)continue;let r=e.slice(0,n),i=e.slice(n+1);r&&t.set(r,i)}return t}function zd(e){if(!e)return`default`;let t=e,n=jd.get(t);return n||(n=kd,kd+=1,jd.set(t,n)),`exec:${n}`}function Bd(e){let t=Object.entries(e.execEnv).filter(([e])=>e===`HOME`||e===`PATH`||e===`TERM`||e===`LANG`||e===`LC_ALL`||e===`LC_CTYPE`||e===`USER`||e===`LOGNAME`||e===`TMPDIR`?!0:e.startsWith(`XDG_`)||e.startsWith(`OPENCLAW_`)).toSorted(([e],[t])=>e.localeCompare(t));return JSON.stringify([e.shell,e.timeoutMs,zd(e.exec),t])}function Vd(e){let t=e.exec??dt,n=Nd(e.timeoutMs),r=Id(e.env),i=Md(e.env),a=Bd({shell:r,timeoutMs:n,exec:e.exec,execEnv:i}),o=Ad.get(a);if(o)return{ok:!0,shellEnv:new Map(o)};try{let e=Rd(Ld({shell:r,env:i,exec:t,timeoutMs:n}));return Ad.set(a,[...e.entries()]),{ok:!0,shellEnv:e}}catch(e){return{ok:!1,error:se(e)}}}function Hd(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ud(e){let t=e.logger??console;if(!e.enabled)return Dd=[],{ok:!0,applied:[],skippedReason:`disabled`};if(e.expectedKeys.some(t=>Hd(e.env,t)))return Dd=[],{ok:!0,applied:[],skippedReason:`already-has-keys`};let n=Vd({env:e.env,timeoutMs:e.timeoutMs,exec:e.exec});if(!n.ok)return t.warn(`[openclaw] shell env fallback failed: ${n.error}`),Dd=[],{ok:!1,error:n.error,applied:[]};let r=[];for(let t of e.expectedKeys){if(Hd(e.env,t))continue;let i=n.shellEnv.get(t);i?.trim()&&(e.env[t]=i,r.push(t))}return Dd=r,{ok:!0,applied:r}}function Wd(e){return vt(e.OPENCLAW_LOAD_SHELL_ENV)}function Gd(e){return vt(e.OPENCLAW_DEFER_SHELL_ENV_FALLBACK)}function Kd(e){let t=e.OPENCLAW_SHELL_ENV_TIMEOUT_MS?.trim();if(!t)return Ed;let n=Number.parseInt(t,10);return Number.isFinite(n)?Math.max(0,n):Ed}function qd(){return[...Dd]}var Jd=class extends Error{constructor(e){super($d(e)),this.name=`DuplicateAgentDirError`,this.duplicates=e}};function Yd(e){let t=I.resolve(e);return process.platform===`darwin`||process.platform===`win32`?i(t):t}function Xd(e){let t=new Set,n=Array.isArray(e.agents?.list)?e.agents?.list:[],r=n.find(e=>e?.default)?.id??n[0]?.id??`main`;t.add(st(r));for(let e of n)e?.id&&t.add(st(e.id));let i=e.bindings;if(Array.isArray(i))for(let e of i){let n=e?.agentId;typeof n==`string`&&n.trim()&&t.add(st(n))}return[...t]}function Zd(e,t,n){let i=st(t),a=(Array.isArray(e.agents?.list)?e.agents?.list.find(e=>st(e.id)===i)?.agentDir:void 0)?.trim();if(a)return p(a);let o=n?.env??process.env,c=s(o,n?.homedir??(()=>r(o,ut.homedir)));return I.join(c,`agents`,i,`agent`)}function Qd(e,t){let n=new Map;for(let r of Xd(e)){let i=Zd(e,r,t),a=Yd(i),o=n.get(a);o?o.agentIds.push(r):n.set(a,{agentDir:i,agentIds:[r]})}return[...n.values()].filter(e=>e.agentIds.length>1)}function $d(e){return[`Duplicate agentDir detected (multi-agent config).`,`Each agent must have a unique agentDir; sharing it causes auth/session state collisions and token invalidation.`,``,`Conflicts:`,...e.map(e=>`- ${e.agentDir}: ${e.agentIds.map(e=>`"${e}"`).join(`, `)}`),``,`Fix: remove the shared agents.list[].agentDir override (or give each agent its own directory).`,`If you want to share credentials, copy auth-profiles.json instead of sharing the entire agentDir.`].join(`
3
+ `)}async function ef(e,t){let n=`${e}.bak`;await t.unlink(`${n}.4`).catch(()=>{});for(let e=3;e>=1;--e)await t.rename(`${n}.${e}`,`${n}.${e+1}`).catch(()=>{});await t.rename(n,`${n}.1`).catch(()=>{})}async function tf(e,t){if(!t.chmod)return;let n=`${e}.bak`;await t.chmod(n,384).catch(()=>{});for(let e=1;e<5;e++)await t.chmod(`${n}.${e}`,384).catch(()=>{})}async function nf(e,t){if(!t.readdir)return;let n=I.dirname(e),r=`${I.basename(e)}.bak.`,i=new Set;for(let e=1;e<5;e++)i.add(String(e));let a;try{a=await t.readdir(n)}catch{return}for(let e of a){if(!e.startsWith(r))continue;let a=e.slice(r.length);i.has(a)||await t.unlink(I.join(n,e)).catch(()=>{})}}async function rf(e,t){await ef(e,t),await t.copyFile(e,`${e}.bak`).catch(()=>{}),await tf(e,t),await nf(e,t)}const af=/\$\{[A-Z_][A-Z0-9_]*\}/;function of(e){return af.test(e)}function sf(e,t){let n=/^[A-Z_][A-Z0-9_]*$/,r=[];for(let i=0;i<e.length;i++){if(e[i]===`$`){if(e[i+1]===`$`&&e[i+2]===`{`){let t=i+3,a=e.indexOf(`}`,t);if(a!==-1){let o=e.slice(t,a);if(n.test(o)){r.push(`\${${o}}`),i=a;continue}}}if(e[i+1]===`{`){let a=i+2,o=e.indexOf(`}`,a);if(o!==-1){let s=e.slice(a,o);if(n.test(s)){let e=t[s];if(e===void 0||e===``)return null;r.push(e),i=o;continue}}}}r.push(e[i])}return r.join(``)}function cf(e,t,n=process.env){if(t==null)return e;if(typeof e==`string`&&typeof t==`string`)return of(t)&&sf(t,n)===e?t:e;if(Array.isArray(e)&&Array.isArray(t))return e.map((e,r)=>r<t.length?cf(e,t[r],n):e);if(m(e)&&m(t)){let r={};for(let[i,a]of Object.entries(e))i in t?r[i]=cf(a,t[i],n):r[i]=a;return r}return e}function lf(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function uf(e){return e||{pid:process.pid,ppid:process.ppid,cwd:process.cwd(),argv:process.argv.slice(0,8),execArgv:process.execArgv.slice(0,8)}}function df(e,t){return I.join(s(e,t),`logs`,`config-audit.jsonl`)}function ff(e){let t=typeof e.changedPathCount==`number`?`, changedPaths=${e.changedPathCount}`:``;return`Config overwrite: ${e.configPath} (sha256 ${e.previousHash??`unknown`} -> ${e.nextHash}, backup=${e.configPath}.bak${t})`}function pf(e){let t=uf(e.processInfo);return{ts:e.now??new Date().toISOString(),source:`config-io`,event:`config.write`,configPath:e.configPath,pid:t.pid,ppid:t.ppid,cwd:t.cwd,argv:t.argv,execArgv:t.execArgv,watchMode:e.env.OPENCLAW_WATCH_MODE===`1`,watchSession:lf(e.env.OPENCLAW_WATCH_SESSION),watchCommand:lf(e.env.OPENCLAW_WATCH_COMMAND),existsBefore:e.existsBefore,previousHash:e.previousHash,nextHash:e.nextHash,previousBytes:e.previousBytes,nextBytes:e.nextBytes,previousDev:e.previousMetadata.dev,previousIno:e.previousMetadata.ino,previousMode:e.previousMetadata.mode,previousNlink:e.previousMetadata.nlink,previousUid:e.previousMetadata.uid,previousGid:e.previousMetadata.gid,changedPathCount:typeof e.changedPathCount==`number`?e.changedPathCount:null,hasMetaBefore:e.hasMetaBefore,hasMetaAfter:e.hasMetaAfter,gatewayModeBefore:e.gatewayModeBefore,gatewayModeAfter:e.gatewayModeAfter,suspicious:e.suspicious}}function mf(e){let t=e.err&&typeof e.err==`object`&&`code`in e.err&&typeof e.err.code==`string`?e.err.code:void 0,n=e.err&&typeof e.err==`object`&&`message`in e.err&&typeof e.err.message==`string`?e.err.message:void 0,r=e.nextMetadata??{dev:null,ino:null,mode:null,nlink:null,uid:null,gid:null},i=e.result!==`failed`&&e.result!==`rejected`;return{...e.base,result:e.result,nextHash:i?e.base.nextHash:null,nextBytes:i?e.base.nextBytes:null,nextDev:i?r.dev:null,nextIno:i?r.ino:null,nextMode:i?r.mode:null,nextNlink:i?r.nlink:null,nextUid:i?r.uid:null,nextGid:i?r.gid:null,errorCode:t,errorMessage:n}}function hf(e){if(`record`in e)return e.record;let{fs:t,env:n,homedir:r,...i}=e;return i}async function gf(e){try{let t=df(e.env,e.homedir),n=hf(e);await e.fs.promises.mkdir(I.dirname(t),{recursive:!0,mode:448}),await e.fs.promises.appendFile(t,`${JSON.stringify(n)}\n`,{encoding:`utf-8`,mode:384})}catch{}}function _f(e){try{let t=df(e.env,e.homedir),n=hf(e);e.fs.mkdirSync(I.dirname(t),{recursive:!0,mode:448}),e.fs.appendFileSync(t,`${JSON.stringify(n)}\n`,{encoding:`utf-8`,mode:384})}catch{}}function vf(e){return e.map(e=>`- ${Ye(e.path||`<root>`)}: ${Ye(e.message)}`).join(`
4
+ `)}function yf(e,t){return`Invalid config at ${e}:\\n${t}`}function bf(e){e.loggedConfigPaths.has(e.configPath)||(e.loggedConfigPaths.add(e.configPath),e.logger.error(yf(e.configPath,e.details)))}function xf(e,t){let n=Error(`Invalid config at ${e}:\n${t}`);return n.code=`INVALID_CONFIG`,n.details=t,n}function Sf(e){let t=vf(e.issues);throw bf({configPath:e.configPath,details:t,logger:e.logger,loggedConfigPaths:e.loggedConfigPaths}),xf(e.configPath,t)}function Cf(e){return{ts:e.ts,source:`config-io`,event:`config.observe`,phase:`read`,configPath:e.configPath,pid:process.pid,ppid:process.ppid,cwd:process.cwd(),argv:process.argv.slice(0,8),execArgv:process.execArgv.slice(0,8),exists:!0,valid:e.valid,hash:e.current.hash,bytes:e.current.bytes,mtimeMs:e.current.mtimeMs,ctimeMs:e.current.ctimeMs,dev:e.current.dev,ino:e.current.ino,mode:e.current.mode,nlink:e.current.nlink,uid:e.current.uid,gid:e.current.gid,hasMeta:e.current.hasMeta,gatewayMode:e.current.gatewayMode,suspicious:e.suspicious,lastKnownGoodHash:e.lastKnownGood?.hash??null,lastKnownGoodBytes:e.lastKnownGood?.bytes??null,lastKnownGoodMtimeMs:e.lastKnownGood?.mtimeMs??null,lastKnownGoodCtimeMs:e.lastKnownGood?.ctimeMs??null,lastKnownGoodDev:e.lastKnownGood?.dev??null,lastKnownGoodIno:e.lastKnownGood?.ino??null,lastKnownGoodMode:e.lastKnownGood?.mode??null,lastKnownGoodNlink:e.lastKnownGood?.nlink??null,lastKnownGoodUid:e.lastKnownGood?.uid??null,lastKnownGoodGid:e.lastKnownGood?.gid??null,lastKnownGoodGatewayMode:e.lastKnownGood?.gatewayMode??null,backupHash:e.backup?.hash??null,backupBytes:e.backup?.bytes??null,backupMtimeMs:e.backup?.mtimeMs??null,backupCtimeMs:e.backup?.ctimeMs??null,backupDev:e.backup?.dev??null,backupIno:e.backup?.ino??null,backupMode:e.backup?.mode??null,backupNlink:e.backup?.nlink??null,backupUid:e.backup?.uid??null,backupGid:e.backup?.gid??null,backupGatewayMode:e.backup?.gatewayMode??null,clobberedPath:e.clobberedPath,restoredFromBackup:e.restoredFromBackup,restoredBackupPath:e.restoredBackupPath}}function wf(e,t){return{fs:e.fs,env:e.env,homedir:e.homedir,record:Cf(t)}}function X(e){return ft.createHash(`sha256`).update(e??``).digest(`hex`)}function Tf(e){if(typeof e.hash==`string`){let t=e.hash.trim();if(t)return t}return typeof e.raw==`string`?X(e.raw):null}function Ef(e){return h(e)&&h(e.meta)&&(typeof e.meta.lastTouchedVersion==`string`||typeof e.meta.lastTouchedAt==`string`)}function Df(e){return!h(e)||!h(e.gateway)?null:typeof e.gateway.mode==`string`?e.gateway.mode:null}function Of(e){return e?{dev:typeof e.dev==`number`||typeof e.dev==`bigint`?String(e.dev):null,ino:typeof e.ino==`number`||typeof e.ino==`bigint`?String(e.ino):null,mode:typeof e.mode==`number`?e.mode:null,nlink:typeof e.nlink==`number`?e.nlink:null,uid:typeof e.uid==`number`?e.uid:null,gid:typeof e.gid==`number`?e.gid:null}:{dev:null,ino:null,mode:null,nlink:null,uid:null,gid:null}}function kf(e){return{hash:e.hash,bytes:Buffer.byteLength(e.raw,`utf-8`),mtimeMs:e.stat?.mtimeMs??null,ctimeMs:e.stat?.ctimeMs??null,...Of(e.stat),hasMeta:Ef(e.parsed),gatewayMode:Df(e.gatewaySource),observedAt:e.observedAt}}function Af(e,t){try{return e.json5.parse(t)}catch{return{}}}function jf(e,t){return I.join(s(e,t),`logs`,`config-health.json`)}async function Mf(e){try{let t=await e.fs.promises.readFile(jf(e.env,e.homedir),`utf-8`),n=e.json5.parse(t);return h(n)?n:{}}catch{return{}}}function Nf(e){try{let t=e.fs.readFileSync(jf(e.env,e.homedir),`utf-8`),n=e.json5.parse(t);return h(n)?n:{}}catch{return{}}}async function Pf(e,t){try{let n=jf(e.env,e.homedir);await e.fs.promises.mkdir(I.dirname(n),{recursive:!0,mode:448}),await e.fs.promises.writeFile(n,`${JSON.stringify(t,null,2)}\n`,{encoding:`utf-8`,mode:384})}catch{}}function Ff(e,t){try{let n=jf(e.env,e.homedir);e.fs.mkdirSync(I.dirname(n),{recursive:!0,mode:448}),e.fs.writeFileSync(n,`${JSON.stringify(t,null,2)}\n`,{encoding:`utf-8`,mode:384})}catch{}}function If(e,t){let n=e.entries;if(!n||!h(n))return{};let r=n[t];return r&&h(r)?r:{}}function Lf(e,t,n){return{...e,entries:{...e.entries,[t]:n}}}function Rf(e,t){return{...e,lastObservedSuspiciousSignature:t}}function zf(e){if(!h(e))return!1;let t=Object.keys(e);if(t.length!==1||t[0]!==`update`)return!1;let n=e.update;return h(n)?Object.keys(n).length===1&&typeof n.channel==`string`:!1}function Bf(e){let t=[],n=e.lastKnownGood;return n?(n.bytes>=512&&e.bytes<Math.floor(n.bytes*.5)&&t.push(`size-drop-vs-last-good:${n.bytes}->${e.bytes}`),n.hasMeta&&!e.hasMeta&&t.push(`missing-meta-vs-last-good`),n.gatewayMode&&!e.gatewayMode&&t.push(`gateway-mode-missing-vs-last-good`),n.gatewayMode&&zf(e.parsed)&&t.push(`update-channel-only-root`),t):t}function Vf(e,t){return`${e.hash}:${t.join(`,`)}`}function Hf(e){return e===`missing-meta-vs-last-good`||e===`gateway-mode-missing-vs-last-good`||e===`update-channel-only-root`||e.startsWith(`size-drop-vs-last-good:`)}function Uf(e){let t=Bf({bytes:e.current.bytes,hasMeta:e.current.hasMeta,gatewayMode:e.current.gatewayMode,parsed:e.parsed,lastKnownGood:e.backupBaseline});if(!t.some(Hf))return null;let n=Vf(e.current,t);return e.entry.lastObservedSuspiciousSignature===n?null:{suspicious:t,suspiciousSignature:n}}async function Wf(e,t){try{let n=await e.fs.promises.readFile(t,`utf-8`),r=await e.fs.promises.stat(t).catch(()=>null),i=Af(e,n);return kf({hash:X(n),raw:n,parsed:i,gatewaySource:i,stat:r,observedAt:new Date().toISOString()})}catch{return null}}function Gf(e,t){try{let n=e.fs.readFileSync(t,`utf-8`),r=e.fs.statSync(t,{throwIfNoEntry:!1})??null,i=Af(e,n);return kf({hash:X(n),raw:n,parsed:i,gatewaySource:i,stat:r,observedAt:new Date().toISOString()})}catch{return null}}function Kf(e){return e.replaceAll(`:`,`-`).replaceAll(`.`,`-`)}function qf(e){return`${e}.last-good`}function Jf(e){return/(^|\.)(api[-_]?key|auth|bearer|credential|password|private[-_]?key|secret|token)(\.|$)/i.test(e)}function Yf(e,t=``,n=[]){if(typeof e==`string`){let r=e.trim();return r===`***`||r===`[redacted]`?(n.push(t||`<root>`),n):(Jf(t)&&(r.includes(`...`)||r.includes(`…`))&&n.push(t||`<root>`),n)}if(Array.isArray(e))return e.forEach((e,r)=>Yf(e,`${t}[${r}]`,n)),n;if(h(e))for(let[r,i]of Object.entries(e))Yf(i,t?`${t}.${r}`:r,n);return n}async function Xf(e){let t=`${e.configPath}.clobbered.${Kf(e.observedAt)}`;try{return await e.deps.fs.promises.writeFile(t,e.raw,{encoding:`utf-8`,mode:384,flag:`wx`}),t}catch{return null}}function Zf(e){let t=`${e.configPath}.clobbered.${Kf(e.observedAt)}`;try{return e.deps.fs.writeFileSync(t,e.raw,{encoding:`utf-8`,mode:384,flag:`wx`}),t}catch{return null}}async function Qf(e){let t=await e.deps.fs.promises.stat(e.configPath).catch(()=>null),n=new Date().toISOString(),r=kf({hash:X(e.raw),raw:e.raw,parsed:e.parsed,gatewaySource:e.parsed,stat:t,observedAt:n}),i=await Mf(e.deps),a=If(i,e.configPath),o=`${e.configPath}.bak`,s=a.lastKnownGood??await Wf(e.deps,o)??void 0,c=Uf({current:r,parsed:e.parsed,entry:a,backupBaseline:s});if(!c)return{raw:e.raw,parsed:e.parsed};let{suspicious:l,suspiciousSignature:u}=c,d=await e.deps.fs.promises.readFile(o,`utf-8`).catch(()=>null);if(!d)return{raw:e.raw,parsed:e.parsed};let f;try{f=e.deps.json5.parse(d)}catch{return{raw:e.raw,parsed:e.parsed}}let p=s??await Wf(e.deps,o);if(!p?.gatewayMode)return{raw:e.raw,parsed:e.parsed};let m=await Xf({deps:e.deps,configPath:e.configPath,raw:e.raw,observedAt:n}),h=!1;try{await e.deps.fs.promises.copyFile(o,e.configPath),h=!0}catch{}return e.deps.logger.warn(`Config auto-restored from backup: ${e.configPath} (${l.join(`, `)})`),await gf(wf(e.deps,{ts:n,configPath:e.configPath,valid:!0,current:r,suspicious:l,lastKnownGood:a.lastKnownGood,backup:p,clobberedPath:m,restoredFromBackup:h,restoredBackupPath:o})),i=Lf(i,e.configPath,Rf(a,u)),await Pf(e.deps,i),{raw:d,parsed:f}}function $f(e){let t=e.deps.fs.statSync(e.configPath,{throwIfNoEntry:!1})??null,n=new Date().toISOString(),r=kf({hash:X(e.raw),raw:e.raw,parsed:e.parsed,gatewaySource:e.parsed,stat:t,observedAt:n}),i=Nf(e.deps),a=If(i,e.configPath),o=`${e.configPath}.bak`,s=a.lastKnownGood??Gf(e.deps,o)??void 0,c=Uf({current:r,parsed:e.parsed,entry:a,backupBaseline:s});if(!c)return{raw:e.raw,parsed:e.parsed};let{suspicious:l,suspiciousSignature:u}=c,d;try{d=e.deps.fs.readFileSync(o,`utf-8`)}catch{return{raw:e.raw,parsed:e.parsed}}let f;try{f=e.deps.json5.parse(d)}catch{return{raw:e.raw,parsed:e.parsed}}let p=s??Gf(e.deps,o);if(!p?.gatewayMode)return{raw:e.raw,parsed:e.parsed};let m=Zf({deps:e.deps,configPath:e.configPath,raw:e.raw,observedAt:n}),h=!1;try{e.deps.fs.copyFileSync(o,e.configPath),h=!0}catch{}return e.deps.logger.warn(`Config auto-restored from backup: ${e.configPath} (${l.join(`, `)})`),_f(wf(e.deps,{ts:n,configPath:e.configPath,valid:!0,current:r,suspicious:l,lastKnownGood:a.lastKnownGood,backup:p,clobberedPath:m,restoredFromBackup:h,restoredBackupPath:o})),i=Lf(i,e.configPath,Rf(a,u)),Ff(e.deps,i),{raw:d,parsed:f}}async function ep(e){let{deps:t,snapshot:n}=e;if(!n.exists||!n.valid||typeof n.raw!=`string`)return!1;let r=Yf(n.parsed);if(r.length>0)return e.logger?.warn(`Config last-known-good promotion skipped: redacted secret placeholder at ${r[0]}`),!1;let i=await t.fs.promises.stat(n.path).catch(()=>null),a=new Date().toISOString(),o=kf({hash:Tf(n)??X(n.raw),raw:n.raw,parsed:n.parsed,gatewaySource:n.resolved,stat:i,observedAt:a}),s=qf(n.path);await t.fs.promises.writeFile(s,n.raw,{encoding:`utf-8`,mode:384}),await t.fs.promises.chmod?.(s,384).catch(()=>{});let c=await Mf(t),l=If(c,n.path);return await Pf(t,Lf(c,n.path,{...l,lastKnownGood:o,lastPromotedGood:o,lastObservedSuspiciousSignature:null})),!0}async function tp(e){let{deps:t,snapshot:n}=e;if(!n.exists||typeof n.raw!=`string`)return!1;let r=await Mf(t),i=If(r,n.path),a=i.lastPromotedGood;if(!a?.hash)return!1;let o=qf(n.path),s=await t.fs.promises.readFile(o,`utf-8`).catch(()=>null);if(!s||X(s)!==a.hash)return!1;let c;try{c=t.json5.parse(s)}catch{return!1}let l=Yf(c);if(l.length>0)return t.logger.warn(`Config last-known-good recovery skipped: redacted secret placeholder at ${l[0]}`),!1;let u=new Date().toISOString(),d=await t.fs.promises.stat(n.path).catch(()=>null),f=kf({hash:Tf(n)??X(n.raw),raw:n.raw,parsed:n.parsed,gatewaySource:n.resolved,stat:d,observedAt:u}),p=await Xf({deps:t,configPath:n.path,raw:n.raw,observedAt:u});return await t.fs.promises.copyFile(o,n.path),await t.fs.promises.chmod?.(n.path,384).catch(()=>{}),t.logger.warn(`Config auto-restored from last-known-good: ${n.path} (${e.reason})`),await gf(wf(t,{ts:u,configPath:n.path,valid:n.valid,current:f,suspicious:[e.reason],lastKnownGood:a,backup:a,clobberedPath:p,restoredFromBackup:!0,restoredBackupPath:o})),await Pf(t,Lf(r,n.path,{...i,lastKnownGood:a,lastPromotedGood:a,lastObservedSuspiciousSignature:null})),!0}function np(e){let{config:t,configPath:n,generatedSecret:r,logger:i,state:a,persistConfig:o}=e;return r?(a.pendingByPath.set(n,r),a.persistInFlight.has(n)||(a.persistInFlight.add(n),o(t,{expectedConfigPath:n}).then(()=>{a.pendingByPath.delete(n),a.persistWarned.delete(n)}).catch(e=>{a.persistWarned.has(n)||(a.persistWarned.add(n),i.warn(`Failed to persist auto-generated commands.ownerDisplaySecret at ${n}: ${String(e)}`))}).finally(()=>{a.persistInFlight.delete(n)})),t):(a.pendingByPath.delete(n),a.persistWarned.delete(n),t)}const rp=/^(?<policyPath>[a-z0-9_.-]+)\s*=\s*"open"\s+requires\s+(?<allowPath>[a-z0-9_.-]+)(?:\s+\(or\s+[a-z0-9_.-]+\))?\s+to include "\*"$/i;function ip(e){return structuredClone(e)}function ap(e,t){if(!h(e)||!h(t))return ip(t);let n={},r=new Set([...Object.keys(e),...Object.keys(t)]);for(let i of r){let r=i in e;if(!(i in t)){n[i]=null;continue}let a=t[i];if(!r){n[i]=ip(a);continue}let o=e[i];if(h(o)&&h(a)){let e=ap(o,a);if(h(e)&&Object.keys(e).length===0)continue;n[i]=e;continue}pt(o,a)||(n[i]=ip(a))}return n}function op(e,t){if(!h(e)||!h(t))return ip(e);let n={};for(let[r,i]of Object.entries(e)){if(!(r in t)){n[r]=ip(i);continue}n[r]=op(i,t[r])}return n}function sp(e){return h(e)&&Object.prototype.hasOwnProperty.call(e,`$include`)}function cp(e,t=[]){return h(e)?sp(e)?[t]:Object.entries(e).flatMap(([e,n])=>cp(n,[...t,e])):[]}function lp(e,t){if(t.length===0)return h(e)?Object.keys(e).length>0:!0;if(!h(e))return!0;let[n,...r]=t;return Object.prototype.hasOwnProperty.call(e,n)?lp(e[n],r):!1}function up(e){return e.length>0?e.join(`.`):`<root>`}function dp(e,t){let n=e;for(let e of t){if(!h(n))return;n=n[e]}return n}function fp(e,t,n){if(t.length===0)return ip(n);if(!h(e))return e;let[r,...i]=t;return{...e,[r]:fp(e[r],i,n)}}function pp(e){let t=e.persistedCandidate;for(let n of cp(e.rootAuthoredConfig)){if(lp(e.patch,n))throw Error(`Config write would flatten $include-owned config at ${up(n)}; edit that include file directly or remove the $include first.`);t=fp(t,n,dp(e.rootAuthoredConfig,n))}return t}function mp(e){let t=ap(e.runtimeConfig,e.nextConfig),n=op(e.sourceConfig,e.runtimeConfig),r=pp({patch:t,rootAuthoredConfig:e.rootAuthoredConfig??e.sourceConfig,persistedCandidate:Je(n,t)});return _p({rootAuthoredConfig:e.rootAuthoredConfig??e.sourceConfig,nextConfig:e.nextConfig,persistedCandidate:r})}function hp(e){if(!(!h(e)||typeof e.$schema!=`string`))return e.$schema}function gp(e){return h(e)&&Object.prototype.hasOwnProperty.call(e,`$schema`)}function _p(e){if(gp(e.nextConfig))return e.persistedCandidate;let t=hp(e.rootAuthoredConfig);return t===void 0||!h(e.persistedCandidate)?e.persistedCandidate:{...e.persistedCandidate,$schema:t}}function vp(e,t){let n=t.match(rp),r=n?.groups?.policyPath?.trim(),i=n?.groups?.allowPath?.trim();return!r||!i?`Config validation failed: ${e}: ${t}`:[`Config validation failed: ${e}`,``,`Configuration mismatch: ${r} is "open", but ${i} does not include "*".`,``,`Fix with:`,` openclaw config set ${i} '["*"]'`,``,`Or switch policy:`,` openclaw config set ${r} "pairing"`].join(`
5
+ `)}function yp(e){return/^[0-9]+$/.test(e)}function bp(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function xp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const Sp=Symbol(`write-pruned-object`);function Cp(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:e}function wp(e,t,n){if(n>=t.length)return{changed:!1,value:e};let r=t[n],i=n===t.length-1;if(Array.isArray(e)){if(!yp(r))return{changed:!1,value:e};let a=Number.parseInt(r,10);if(!Number.isFinite(a)||a<0||a>=e.length)return{changed:!1,value:e};if(i){let t=e.slice();return t.splice(a,1),{changed:!0,value:t}}let o=wp(e[a],t,n+1);if(!o.changed)return{changed:!1,value:e};let s=e.slice();return o.value===Sp?s.splice(a,1):s[a]=o.value,{changed:!0,value:s}}if(l(r)||!bp(e)||!xp(e,r))return{changed:!1,value:e};if(i){let t={...e};return delete t[r],{changed:!0,value:Object.keys(t).length===0?Sp:t}}let a=wp(e[r],t,n+1);if(!a.changed)return{changed:!1,value:e};let o={...e};return a.value===Sp?delete o[r]:o[r]=a.value,{changed:!0,value:Object.keys(o).length===0?Sp:o}}function Tp(e,t){if(t.length===0)return{changed:!1,next:e};let n=wp(e,t,0);return n.changed?n.value===Sp?{changed:!0,next:{}}:bp(n.value)?{changed:!0,next:Cp(n.value)}:{changed:!1,next:e}:{changed:!1,next:e}}function Ep(e,t,n,r){if(Array.isArray(e)&&Array.isArray(t)){let i=Math.max(e.length,t.length);for(let a=0;a<i;a+=1){let i=n?`${n}[${a}]`:`[${a}]`;if(a>=e.length||a>=t.length){r.add(i);continue}Ep(e[a],t[a],i,r)}return}if(h(e)&&h(t)){let i=new Set([...Object.keys(e),...Object.keys(t)]);for(let a of i){let i=n?`${n}.${a}`:a,o=a in e;if(!(a in t)||!o){r.add(i);continue}Ep(e[a],t[a],i,r)}return}pt(e,t)||r.add(n)}function Dp(e){if(!e)return``;if(e.endsWith(`]`)){let t=e.lastIndexOf(`[`);return t>0?e.slice(0,t):``}let t=e.lastIndexOf(`.`);return t>=0?e.slice(0,t):``}function Op(e,t){if(t.has(e))return!0;let n=Dp(e);for(;n;){if(t.has(n))return!0;n=Dp(n)}return t.has(``)}function kp(e,t,n,r){if(typeof e==`string`){if(!Op(t,r)){let e=n.get(t);if(e!==void 0)return e}return e}if(Array.isArray(e)){let i=!1,a=e.map((e,a)=>{let o=kp(e,`${t}[${a}]`,n,r);return o!==e&&(i=!0),o});return i?a:e}if(h(e)){let i=!1,a={};for(let[o,s]of Object.entries(e)){let e=kp(s,t?`${t}.${o}`:o,n,r);e!==s&&(i=!0),a[o]=e}return i?a:e}return e}function Ap(e){if(!e||typeof e!=`object`)return[];let t=e.channels;return!t||typeof t!=`object`||Array.isArray(t)?[]:Object.keys(t).filter(e=>e!==`defaults`).map(e=>e)}function jp(e,t){return!t||t.length===0?!0:t.some(t=>{let n=Math.min(e.length,t.length);for(let r=0;r<n;r+=1)if(e[r]!==t[r])return!1;return!0})}function Mp(e){let t=Ap(e.raw),n=e.excludedChannelIds?.size?t.filter(t=>!e.excludedChannelIds?.has(t)):t;if(!e.touchedPaths||e.touchedPaths.length===0)return n;let r=new Set;for(let t of e.touchedPaths){let[e,i]=t;if(e===`channels`){if(!i)return n;i!==`defaults`&&r.add(i)}}return r.size===0?[]:n.filter(e=>r.has(e))}function Np(e,t,n){let r=Mp({raw:e,touchedPaths:t,excludedChannelIds:n}),i=[],a=[];for(let e of r){let t=ul(e)?.legacyConfigRules;if(Array.isArray(t)){i.push(...t);continue}let n=_e(e);if(n?.doctor?.legacyConfigRules?.length){i.push(...n.doctor.legacyConfigRules);continue}n||a.push(e)}a.length>0&&i.push(...Yn({pluginIds:a}));let o=new Set;return i.filter(e=>{if(!jp(e.path,t))return!1;let n=`${e.path.join(`.`)}::${e.message}`;return o.has(n)?!1:(o.add(n),!0)})}function Pp(e,t){let n=e;for(let e of t){if(!n||typeof n!=`object`)return;n=n[e]}return n}function Fp(e){let t=new Set;for(let n of e){let[e,r]=n.path;e!==`channels`||typeof r!=`string`||r===`defaults`||t.add(r)}return t.size>0?t:void 0}function Ip(e,t,n=[],r){if(!e||typeof e!=`object`)return[];let i=e,a=t&&typeof t==`object`?t:i,o=[],s=Fp(n);for(let t of[...Tu,...Np(e,r,s),...n]){let e=Pp(i,t.path);if(e!==void 0&&(!t.match||t.match(e,i))){if(t.requireSourceLiteral){let e=Pp(a,t.path);if(e===void 0||t.match&&!t.match(e,a))continue}o.push({path:t.path.join(`.`),message:t.message})}}return o}function Lp(e){let t=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return;let t=e,n=hi(t.safeBinProfiles);t.safeBinProfiles=Object.keys(n).length>0?n:void 0;let r=sa(t.safeBinTrustedDirs);t.safeBinTrustedDirs=r.length>0?r:void 0};t(e.tools?.exec);let n=Array.isArray(e.agents?.list)?e.agents.list:[];for(let e of n)t(e?.tools?.exec)}const Rp=/^~(?=$|[\\/])/,zp=/(dir|path|paths|file|root|workspace)$/i,Bp=new Set([`paths`,`pathPrepend`]);function Vp(e,t){return!Rp.test(t.trim())||!e?t:zp.test(e)||Bp.has(e)?p(t):t}function Hp(e,t){if(typeof t==`string`)return Vp(e,t);if(Array.isArray(t)){let n=!!(e&&Bp.has(e));return t.map(t=>typeof t==`string`?n?Vp(e,t):t:Array.isArray(t)||m(t)?Hp(void 0,t):t)}if(!m(t))return t;for(let[e,n]of Object.entries(t)){let r=Hp(e,n);r!==n&&(t[e]=r)}return t}function Up(e){return!e||typeof e!=`object`||Hp(void 0,e),e}const Wp={load:{includeCompactionDefaults:!0,includeContextPruningDefaults:!0,includeLoggingDefaults:!0,normalizePaths:!0},missing:{includeCompactionDefaults:!0,includeContextPruningDefaults:!0,includeLoggingDefaults:!1,normalizePaths:!1},snapshot:{includeCompactionDefaults:!1,includeContextPruningDefaults:!1,includeLoggingDefaults:!0,normalizePaths:!0}};function Gp(e){return e}function Kp(e){return e}function qp(e,t){let n=Wp[t],r=Xu(e);return n.includeLoggingDefaults&&(r=td(r)),r=Zu(r),r=ed(r),n.includeContextPruningDefaults&&(r=rd(r)),n.includeCompactionDefaults&&(r=id(r)),r=$u(r),r=Qu(r),n.normalizePaths&&Up(r),Lp(r),Kp(r)}let Jp={};function Yp(e,t){if(!m(e)||!m(t))return t;let n={...e};for(let[r,i]of Object.entries(t))i===void 0||l(r)||(n[r]=Yp(e[r],i));return n}function Xp(e){return!Jp||Object.keys(Jp).length===0?e:Yp(e,Jp)}const Zp=[`OPENCLAW_GATEWAY_TOKEN`,`OPENCLAW_GATEWAY_PASSWORD`];function Qp(e){return[...new Set([...Oa({env:e}),...Se({env:e}),...Zp])]}const $p=[{pluginId:`bluebubbles`,channelId:`bluebubbles`,label:`BlueBubbles`,description:`iMessage via the BlueBubbles mac app + REST API.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},actions:{type:`object`,properties:{reactions:{default:!0,type:`boolean`},edit:{default:!0,type:`boolean`},unsend:{default:!0,type:`boolean`},reply:{default:!0,type:`boolean`},sendWithEffect:{default:!0,type:`boolean`},renameGroup:{default:!0,type:`boolean`},setGroupIcon:{default:!0,type:`boolean`},addParticipant:{default:!0,type:`boolean`},removeParticipant:{default:!0,type:`boolean`},leaveGroup:{default:!0,type:`boolean`},sendAttachment:{default:!0,type:`boolean`}},required:[`reactions`,`edit`,`unsend`,`reply`,`sendWithEffect`,`renameGroup`,`setGroupIcon`,`addParticipant`,`removeParticipant`,`leaveGroup`,`sendAttachment`],additionalProperties:!1},serverUrl:{type:`string`},password:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},webhookPath:{type:`string`},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},enrichGroupParticipantsFromContacts:{default:!0,type:`boolean`},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},sendTimeoutMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},mediaMaxMb:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},mediaLocalRoots:{type:`array`,items:{type:`string`}},sendReadReceipts:{type:`boolean`},network:{type:`object`,properties:{dangerouslyAllowPrivateNetwork:{type:`boolean`}},additionalProperties:!1},catchup:{type:`object`,properties:{enabled:{type:`boolean`},maxAgeMinutes:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},perRunLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},firstRunLookbackMinutes:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxFailureRetries:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991}},additionalProperties:!1},blockStreaming:{type:`boolean`},groups:{type:`object`,properties:{},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},systemPrompt:{type:`string`}},additionalProperties:!1}},coalesceSameSenderDms:{type:`boolean`},accounts:{type:`object`,properties:{},additionalProperties:{type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},actions:{type:`object`,properties:{reactions:{default:!0,type:`boolean`},edit:{default:!0,type:`boolean`},unsend:{default:!0,type:`boolean`},reply:{default:!0,type:`boolean`},sendWithEffect:{default:!0,type:`boolean`},renameGroup:{default:!0,type:`boolean`},setGroupIcon:{default:!0,type:`boolean`},addParticipant:{default:!0,type:`boolean`},removeParticipant:{default:!0,type:`boolean`},leaveGroup:{default:!0,type:`boolean`},sendAttachment:{default:!0,type:`boolean`}},required:[`reactions`,`edit`,`unsend`,`reply`,`sendWithEffect`,`renameGroup`,`setGroupIcon`,`addParticipant`,`removeParticipant`,`leaveGroup`,`sendAttachment`],additionalProperties:!1},serverUrl:{type:`string`},password:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},webhookPath:{type:`string`},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},enrichGroupParticipantsFromContacts:{default:!0,type:`boolean`},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},sendTimeoutMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},mediaMaxMb:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},mediaLocalRoots:{type:`array`,items:{type:`string`}},sendReadReceipts:{type:`boolean`},network:{type:`object`,properties:{dangerouslyAllowPrivateNetwork:{type:`boolean`}},additionalProperties:!1},catchup:{type:`object`,properties:{enabled:{type:`boolean`},maxAgeMinutes:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},perRunLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},firstRunLookbackMinutes:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxFailureRetries:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991}},additionalProperties:!1},blockStreaming:{type:`boolean`},groups:{type:`object`,properties:{},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},systemPrompt:{type:`string`}},additionalProperties:!1}},coalesceSameSenderDms:{type:`boolean`}},required:[`enrichGroupParticipantsFromContacts`],additionalProperties:!1}},defaultAccount:{type:`string`}},required:[`enrichGroupParticipantsFromContacts`],additionalProperties:!1},uiHints:{"":{label:`BlueBubbles`,help:`BlueBubbles channel provider configuration used for Apple messaging bridge integrations. Keep DM policy aligned with your trusted sender model in shared deployments.`},dmPolicy:{label:`BlueBubbles DM Policy`,help:`Direct message access control ("pairing" recommended). "open" requires channels.bluebubbles.allowFrom=["*"].`}}},{pluginId:`discord`,channelId:`discord`,label:`Discord`,description:`very well supported right now.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},capabilities:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},commands:{type:`object`,properties:{native:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},nativeSkills:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]}},additionalProperties:!1},configWrites:{type:`boolean`},token:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},proxy:{type:`string`},allowBots:{anyOf:[{type:`boolean`},{type:`string`,const:`mentions`}]},dangerouslyAllowNameMatching:{type:`boolean`},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},streaming:{type:`object`,properties:{mode:{type:`string`,enum:[`off`,`partial`,`block`,`progress`]},chunkMode:{type:`string`,enum:[`length`,`newline`]},preview:{type:`object`,properties:{chunk:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},breakPreference:{anyOf:[{type:`string`,const:`paragraph`},{type:`string`,const:`newline`},{type:`string`,const:`sentence`}]}},additionalProperties:!1},toolProgress:{type:`boolean`}},additionalProperties:!1},block:{type:`object`,properties:{enabled:{type:`boolean`},coalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},additionalProperties:!1}},additionalProperties:!1},maxLinesPerMessage:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},mediaMaxMb:{type:`number`,exclusiveMinimum:0},retry:{type:`object`,properties:{attempts:{type:`integer`,minimum:1,maximum:9007199254740991},minDelayMs:{type:`integer`,minimum:0,maximum:9007199254740991},maxDelayMs:{type:`integer`,minimum:0,maximum:9007199254740991},jitter:{type:`number`,minimum:0,maximum:1}},additionalProperties:!1},actions:{type:`object`,properties:{reactions:{type:`boolean`},stickers:{type:`boolean`},emojiUploads:{type:`boolean`},stickerUploads:{type:`boolean`},polls:{type:`boolean`},permissions:{type:`boolean`},messages:{type:`boolean`},threads:{type:`boolean`},pins:{type:`boolean`},search:{type:`boolean`},memberInfo:{type:`boolean`},roleInfo:{type:`boolean`},roles:{type:`boolean`},channelInfo:{type:`boolean`},voiceStatus:{type:`boolean`},events:{type:`boolean`},moderation:{type:`boolean`},channels:{type:`boolean`},presence:{type:`boolean`}},additionalProperties:!1},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},thread:{type:`object`,properties:{inheritParent:{type:`boolean`}},additionalProperties:!1},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{type:`string`}},defaultTo:{type:`string`},dm:{type:`object`,properties:{enabled:{type:`boolean`},policy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{type:`string`}},groupEnabled:{type:`boolean`},groupChannels:{type:`array`,items:{type:`string`}}},additionalProperties:!1},guilds:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{slug:{type:`string`},requireMention:{type:`boolean`},ignoreOtherMentions:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},reactionNotifications:{type:`string`,enum:[`off`,`own`,`all`,`allowlist`]},users:{type:`array`,items:{type:`string`}},roles:{type:`array`,items:{type:`string`}},channels:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},ignoreOtherMentions:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},users:{type:`array`,items:{type:`string`}},roles:{type:`array`,items:{type:`string`}},systemPrompt:{type:`string`},includeThreadStarter:{type:`boolean`},autoThread:{type:`boolean`},autoThreadName:{type:`string`,enum:[`message`,`generated`]},autoArchiveDuration:{anyOf:[{type:`string`,enum:[`60`,`1440`,`4320`,`10080`]},{type:`number`,const:60},{type:`number`,const:1440},{type:`number`,const:4320},{type:`number`,const:10080}]}},additionalProperties:!1}}},additionalProperties:!1}},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},execApprovals:{type:`object`,properties:{enabled:{type:`boolean`},approvers:{type:`array`,items:{type:`string`}},agentFilter:{type:`array`,items:{type:`string`}},sessionFilter:{type:`array`,items:{type:`string`}},cleanupAfterResolve:{type:`boolean`},target:{type:`string`,enum:[`dm`,`channel`,`both`]}},additionalProperties:!1},agentComponents:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},ui:{type:`object`,properties:{components:{type:`object`,properties:{accentColor:{type:`string`,pattern:`^#?[0-9a-fA-F]{6}$`}},additionalProperties:!1}},additionalProperties:!1},slashCommand:{type:`object`,properties:{ephemeral:{type:`boolean`}},additionalProperties:!1},threadBindings:{type:`object`,properties:{enabled:{type:`boolean`},idleHours:{type:`number`,minimum:0},maxAgeHours:{type:`number`,minimum:0},spawnSubagentSessions:{type:`boolean`},spawnAcpSessions:{type:`boolean`}},additionalProperties:!1},intents:{type:`object`,properties:{presence:{type:`boolean`},guildMembers:{type:`boolean`}},additionalProperties:!1},voice:{type:`object`,properties:{enabled:{type:`boolean`},autoJoin:{type:`array`,items:{type:`object`,properties:{guildId:{type:`string`,minLength:1},channelId:{type:`string`,minLength:1}},required:[`guildId`,`channelId`],additionalProperties:!1}},daveEncryption:{type:`boolean`},decryptionFailureTolerance:{type:`integer`,minimum:0,maximum:9007199254740991},tts:{type:`object`,properties:{auto:{type:`string`,enum:[`off`,`always`,`inbound`,`tagged`]},enabled:{type:`boolean`},mode:{type:`string`,enum:[`final`,`all`]},provider:{type:`string`,minLength:1},summaryModel:{type:`string`},modelOverrides:{type:`object`,properties:{enabled:{type:`boolean`},allowText:{type:`boolean`},allowProvider:{type:`boolean`},allowVoice:{type:`boolean`},allowModelId:{type:`boolean`},allowVoiceSettings:{type:`boolean`},allowNormalization:{type:`boolean`},allowSeed:{type:`boolean`}},additionalProperties:!1},providers:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{apiKey:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]}},additionalProperties:{anyOf:[{type:`string`},{type:`number`},{type:`boolean`},{type:`null`},{type:`array`,items:{}},{type:`object`,propertyNames:{type:`string`},additionalProperties:{}}]}}},prefsPath:{type:`string`},maxTextLength:{type:`integer`,minimum:1,maximum:9007199254740991},timeoutMs:{type:`integer`,minimum:1e3,maximum:12e4}},additionalProperties:!1}},additionalProperties:!1},pluralkit:{type:`object`,properties:{enabled:{type:`boolean`},token:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]}},additionalProperties:!1},responsePrefix:{type:`string`},ackReaction:{type:`string`},ackReactionScope:{type:`string`,enum:[`group-mentions`,`group-all`,`direct`,`all`,`off`,`none`]},activity:{type:`string`},status:{type:`string`,enum:[`online`,`dnd`,`idle`,`invisible`]},autoPresence:{type:`object`,properties:{enabled:{type:`boolean`},intervalMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},minUpdateIntervalMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},healthyText:{type:`string`},degradedText:{type:`string`},exhaustedText:{type:`string`}},additionalProperties:!1},activityType:{anyOf:[{type:`number`,const:0},{type:`number`,const:1},{type:`number`,const:2},{type:`number`,const:3},{type:`number`,const:4},{type:`number`,const:5}]},activityUrl:{type:`string`,format:`uri`},inboundWorker:{type:`object`,properties:{runTimeoutMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},eventQueue:{type:`object`,properties:{listenerTimeout:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxQueueSize:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxConcurrency:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991}},additionalProperties:!1},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{name:{type:`string`},capabilities:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},commands:{type:`object`,properties:{native:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},nativeSkills:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]}},additionalProperties:!1},configWrites:{type:`boolean`},token:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},proxy:{type:`string`},allowBots:{anyOf:[{type:`boolean`},{type:`string`,const:`mentions`}]},dangerouslyAllowNameMatching:{type:`boolean`},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},streaming:{type:`object`,properties:{mode:{type:`string`,enum:[`off`,`partial`,`block`,`progress`]},chunkMode:{type:`string`,enum:[`length`,`newline`]},preview:{type:`object`,properties:{chunk:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},breakPreference:{anyOf:[{type:`string`,const:`paragraph`},{type:`string`,const:`newline`},{type:`string`,const:`sentence`}]}},additionalProperties:!1},toolProgress:{type:`boolean`}},additionalProperties:!1},block:{type:`object`,properties:{enabled:{type:`boolean`},coalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},additionalProperties:!1}},additionalProperties:!1},maxLinesPerMessage:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},mediaMaxMb:{type:`number`,exclusiveMinimum:0},retry:{type:`object`,properties:{attempts:{type:`integer`,minimum:1,maximum:9007199254740991},minDelayMs:{type:`integer`,minimum:0,maximum:9007199254740991},maxDelayMs:{type:`integer`,minimum:0,maximum:9007199254740991},jitter:{type:`number`,minimum:0,maximum:1}},additionalProperties:!1},actions:{type:`object`,properties:{reactions:{type:`boolean`},stickers:{type:`boolean`},emojiUploads:{type:`boolean`},stickerUploads:{type:`boolean`},polls:{type:`boolean`},permissions:{type:`boolean`},messages:{type:`boolean`},threads:{type:`boolean`},pins:{type:`boolean`},search:{type:`boolean`},memberInfo:{type:`boolean`},roleInfo:{type:`boolean`},roles:{type:`boolean`},channelInfo:{type:`boolean`},voiceStatus:{type:`boolean`},events:{type:`boolean`},moderation:{type:`boolean`},channels:{type:`boolean`},presence:{type:`boolean`}},additionalProperties:!1},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},thread:{type:`object`,properties:{inheritParent:{type:`boolean`}},additionalProperties:!1},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{type:`string`}},defaultTo:{type:`string`},dm:{type:`object`,properties:{enabled:{type:`boolean`},policy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{type:`string`}},groupEnabled:{type:`boolean`},groupChannels:{type:`array`,items:{type:`string`}}},additionalProperties:!1},guilds:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{slug:{type:`string`},requireMention:{type:`boolean`},ignoreOtherMentions:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},reactionNotifications:{type:`string`,enum:[`off`,`own`,`all`,`allowlist`]},users:{type:`array`,items:{type:`string`}},roles:{type:`array`,items:{type:`string`}},channels:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},ignoreOtherMentions:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},users:{type:`array`,items:{type:`string`}},roles:{type:`array`,items:{type:`string`}},systemPrompt:{type:`string`},includeThreadStarter:{type:`boolean`},autoThread:{type:`boolean`},autoThreadName:{type:`string`,enum:[`message`,`generated`]},autoArchiveDuration:{anyOf:[{type:`string`,enum:[`60`,`1440`,`4320`,`10080`]},{type:`number`,const:60},{type:`number`,const:1440},{type:`number`,const:4320},{type:`number`,const:10080}]}},additionalProperties:!1}}},additionalProperties:!1}},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},execApprovals:{type:`object`,properties:{enabled:{type:`boolean`},approvers:{type:`array`,items:{type:`string`}},agentFilter:{type:`array`,items:{type:`string`}},sessionFilter:{type:`array`,items:{type:`string`}},cleanupAfterResolve:{type:`boolean`},target:{type:`string`,enum:[`dm`,`channel`,`both`]}},additionalProperties:!1},agentComponents:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},ui:{type:`object`,properties:{components:{type:`object`,properties:{accentColor:{type:`string`,pattern:`^#?[0-9a-fA-F]{6}$`}},additionalProperties:!1}},additionalProperties:!1},slashCommand:{type:`object`,properties:{ephemeral:{type:`boolean`}},additionalProperties:!1},threadBindings:{type:`object`,properties:{enabled:{type:`boolean`},idleHours:{type:`number`,minimum:0},maxAgeHours:{type:`number`,minimum:0},spawnSubagentSessions:{type:`boolean`},spawnAcpSessions:{type:`boolean`}},additionalProperties:!1},intents:{type:`object`,properties:{presence:{type:`boolean`},guildMembers:{type:`boolean`}},additionalProperties:!1},voice:{type:`object`,properties:{enabled:{type:`boolean`},autoJoin:{type:`array`,items:{type:`object`,properties:{guildId:{type:`string`,minLength:1},channelId:{type:`string`,minLength:1}},required:[`guildId`,`channelId`],additionalProperties:!1}},daveEncryption:{type:`boolean`},decryptionFailureTolerance:{type:`integer`,minimum:0,maximum:9007199254740991},tts:{type:`object`,properties:{auto:{type:`string`,enum:[`off`,`always`,`inbound`,`tagged`]},enabled:{type:`boolean`},mode:{type:`string`,enum:[`final`,`all`]},provider:{type:`string`,minLength:1},summaryModel:{type:`string`},modelOverrides:{type:`object`,properties:{enabled:{type:`boolean`},allowText:{type:`boolean`},allowProvider:{type:`boolean`},allowVoice:{type:`boolean`},allowModelId:{type:`boolean`},allowVoiceSettings:{type:`boolean`},allowNormalization:{type:`boolean`},allowSeed:{type:`boolean`}},additionalProperties:!1},providers:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{apiKey:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]}},additionalProperties:{anyOf:[{type:`string`},{type:`number`},{type:`boolean`},{type:`null`},{type:`array`,items:{}},{type:`object`,propertyNames:{type:`string`},additionalProperties:{}}]}}},prefsPath:{type:`string`},maxTextLength:{type:`integer`,minimum:1,maximum:9007199254740991},timeoutMs:{type:`integer`,minimum:1e3,maximum:12e4}},additionalProperties:!1}},additionalProperties:!1},pluralkit:{type:`object`,properties:{enabled:{type:`boolean`},token:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]}},additionalProperties:!1},responsePrefix:{type:`string`},ackReaction:{type:`string`},ackReactionScope:{type:`string`,enum:[`group-mentions`,`group-all`,`direct`,`all`,`off`,`none`]},activity:{type:`string`},status:{type:`string`,enum:[`online`,`dnd`,`idle`,`invisible`]},autoPresence:{type:`object`,properties:{enabled:{type:`boolean`},intervalMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},minUpdateIntervalMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},healthyText:{type:`string`},degradedText:{type:`string`},exhaustedText:{type:`string`}},additionalProperties:!1},activityType:{anyOf:[{type:`number`,const:0},{type:`number`,const:1},{type:`number`,const:2},{type:`number`,const:3},{type:`number`,const:4},{type:`number`,const:5}]},activityUrl:{type:`string`,format:`uri`},inboundWorker:{type:`object`,properties:{runTimeoutMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},eventQueue:{type:`object`,properties:{listenerTimeout:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxQueueSize:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxConcurrency:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991}},additionalProperties:!1}},required:[`groupPolicy`],additionalProperties:!1}},defaultAccount:{type:`string`}},required:[`groupPolicy`],additionalProperties:!1},uiHints:{"":{label:`Discord`,help:`Discord channel provider configuration for bot auth, retry policy, streaming, thread bindings, and optional voice capabilities. Keep privileged intents and advanced features disabled unless needed.`},dmPolicy:{label:`Discord DM Policy`,help:`Direct message access control ("pairing" recommended). "open" requires channels.discord.allowFrom=["*"].`},"dm.policy":{label:`Discord DM Policy`,help:`Direct message access control ("pairing" recommended). "open" requires channels.discord.allowFrom=["*"] (legacy: channels.discord.dm.allowFrom).`},configWrites:{label:`Discord Config Writes`,help:`Allow Discord to write config in response to channel events/commands (default: true).`},proxy:{label:`Discord Proxy URL`,help:`Proxy URL for Discord gateway + API requests (app-id lookup and allowlist resolution). Set per account via channels.discord.accounts.<id>.proxy.`},"commands.native":{label:`Discord Native Commands`,help:`Override native commands for Discord (bool or "auto").`},"commands.nativeSkills":{label:`Discord Native Skill Commands`,help:`Override native skill commands for Discord (bool or "auto").`},streaming:{label:`Discord Streaming Mode`,help:`Unified Discord stream preview mode: "off" | "partial" | "block" | "progress". "progress" maps to "partial" on Discord. Legacy boolean/streamMode keys are auto-mapped.`},"streaming.mode":{label:`Discord Streaming Mode`,help:`Canonical Discord preview mode: "off" | "partial" | "block" | "progress". "progress" maps to "partial" on Discord.`},"streaming.chunkMode":{label:`Discord Chunk Mode`,help:`Chunking mode for outbound Discord text delivery: "length" (default) or "newline".`},"streaming.block.enabled":{label:`Discord Block Streaming Enabled`,help:`Enable chunked block-style Discord preview delivery when channels.discord.streaming.mode="block".`},"streaming.block.coalesce":{label:`Discord Block Streaming Coalesce`,help:`Merge streamed Discord block replies before final delivery.`},"streaming.preview.chunk.minChars":{label:`Discord Draft Chunk Min Chars`,help:`Minimum chars before emitting a Discord stream preview update when channels.discord.streaming.mode="block" (default: 200).`},"streaming.preview.chunk.maxChars":{label:`Discord Draft Chunk Max Chars`,help:`Target max size for a Discord stream preview chunk when channels.discord.streaming.mode="block" (default: 800; clamped to channels.discord.textChunkLimit).`},"streaming.preview.chunk.breakPreference":{label:`Discord Draft Chunk Break Preference`,help:`Preferred breakpoints for Discord draft chunks (paragraph | newline | sentence). Default: paragraph.`},"streaming.preview.toolProgress":{label:`Discord Draft Tool Progress`,help:`Show tool/progress activity in the live draft preview message (default: true). Set false to keep tool updates as separate messages.`},"retry.attempts":{label:`Discord Retry Attempts`,help:`Max retry attempts for outbound Discord API calls (default: 3).`},"retry.minDelayMs":{label:`Discord Retry Min Delay (ms)`,help:`Minimum retry delay in ms for Discord outbound calls.`},"retry.maxDelayMs":{label:`Discord Retry Max Delay (ms)`,help:`Maximum retry delay cap in ms for Discord outbound calls.`},"retry.jitter":{label:`Discord Retry Jitter`,help:`Jitter factor (0-1) applied to Discord retry delays.`},maxLinesPerMessage:{label:`Discord Max Lines Per Message`,help:`Soft max line count per Discord message (default: 17).`},"thread.inheritParent":{label:`Discord Thread Parent Inheritance`,help:`If true, Discord thread sessions inherit the parent channel transcript (default: false).`},"inboundWorker.runTimeoutMs":{label:`Discord Inbound Worker Timeout (ms)`,help:`Optional queued Discord inbound worker timeout in ms. This is separate from Carbon listener timeouts; defaults to 1800000 and can be disabled with 0. Set per account via channels.discord.accounts.<id>.inboundWorker.runTimeoutMs.`},"eventQueue.listenerTimeout":{label:`Discord EventQueue Listener Timeout (ms)`,help:`Canonical Discord listener timeout control in ms for gateway normalization/enqueue handlers. Default is 120000 in OpenClaw; set per account via channels.discord.accounts.<id>.eventQueue.listenerTimeout.`},"eventQueue.maxQueueSize":{label:`Discord EventQueue Max Queue Size`,help:`Optional Discord EventQueue capacity override (max queued events before backpressure). Set per account via channels.discord.accounts.<id>.eventQueue.maxQueueSize.`},"eventQueue.maxConcurrency":{label:`Discord EventQueue Max Concurrency`,help:`Optional Discord EventQueue concurrency override (max concurrent handler executions). Set per account via channels.discord.accounts.<id>.eventQueue.maxConcurrency.`},"threadBindings.enabled":{label:`Discord Thread Binding Enabled`,help:`Enable Discord thread binding features (/focus, bound-thread routing/delivery, and thread-bound subagent sessions). Overrides session.threadBindings.enabled when set.`},"threadBindings.idleHours":{label:`Discord Thread Binding Idle Timeout (hours)`,help:`Inactivity window in hours for Discord thread-bound sessions (/focus and spawned thread sessions). Set 0 to disable idle auto-unfocus (default: 24). Overrides session.threadBindings.idleHours when set.`},"threadBindings.maxAgeHours":{label:`Discord Thread Binding Max Age (hours)`,help:`Optional hard max age in hours for Discord thread-bound sessions. Set 0 to disable hard cap (default: 0). Overrides session.threadBindings.maxAgeHours when set.`},"threadBindings.spawnSubagentSessions":{label:`Discord Thread-Bound Subagent Spawn`,help:`Allow subagent spawns with thread=true to auto-create and bind Discord threads (default: false; opt-in). Set true to enable thread-bound subagent spawns for this account/channel.`},"threadBindings.spawnAcpSessions":{label:`Discord Thread-Bound ACP Spawn`,help:`Allow /acp spawn to auto-create and bind Discord threads for ACP sessions (default: false; opt-in). Set true to enable thread-bound ACP spawns for this account/channel.`},"ui.components.accentColor":{label:`Discord Component Accent Color`,help:`Accent color for Discord component containers (hex). Set per account via channels.discord.accounts.<id>.ui.components.accentColor.`},"intents.presence":{label:`Discord Presence Intent`,help:`Enable the Guild Presences privileged intent. Must also be enabled in the Discord Developer Portal. Allows tracking user activities (e.g. Spotify). Default: false.`},"intents.guildMembers":{label:`Discord Guild Members Intent`,help:`Enable the Guild Members privileged intent. Must also be enabled in the Discord Developer Portal. Default: false.`},"voice.enabled":{label:`Discord Voice Enabled`,help:`Enable Discord voice channel conversations (default: true). Omit channels.discord.voice to keep voice support disabled for the account.`},"voice.autoJoin":{label:`Discord Voice Auto-Join`,help:`Voice channels to auto-join on startup (list of guildId/channelId entries).`},"voice.daveEncryption":{label:`Discord Voice DAVE Encryption`,help:`Toggle DAVE end-to-end encryption for Discord voice joins (default: true in @discordjs/voice; Discord may require this).`},"voice.decryptionFailureTolerance":{label:`Discord Voice Decrypt Failure Tolerance`,help:`Consecutive decrypt failures before DAVE attempts session recovery (passed to @discordjs/voice; default: 24).`},"voice.tts":{label:`Discord Voice Text-to-Speech`,help:`Optional TTS overrides for Discord voice playback (merged with messages.tts).`},"pluralkit.enabled":{label:`Discord PluralKit Enabled`,help:`Resolve PluralKit proxied messages and treat system members as distinct senders.`},"pluralkit.token":{label:`Discord PluralKit Token`,help:`Optional PluralKit token for resolving private systems or members.`},activity:{label:`Discord Presence Activity`,help:`Discord presence activity text (defaults to custom status).`},status:{label:`Discord Presence Status`,help:`Discord presence status (online, dnd, idle, invisible).`},"autoPresence.enabled":{label:`Discord Auto Presence Enabled`,help:`Enable automatic Discord bot presence updates based on runtime/model availability signals. When enabled: healthy=>online, degraded/unknown=>idle, exhausted/unavailable=>dnd.`},"autoPresence.intervalMs":{label:`Discord Auto Presence Check Interval (ms)`,help:`How often to evaluate Discord auto-presence state in milliseconds (default: 30000).`},"autoPresence.minUpdateIntervalMs":{label:`Discord Auto Presence Min Update Interval (ms)`,help:`Minimum time between actual Discord presence update calls in milliseconds (default: 15000). Prevents status spam on noisy state changes.`},"autoPresence.healthyText":{label:`Discord Auto Presence Healthy Text`,help:`Optional custom status text while runtime is healthy (online). If omitted, falls back to static channels.discord.activity when set.`},"autoPresence.degradedText":{label:`Discord Auto Presence Degraded Text`,help:`Optional custom status text while runtime/model availability is degraded or unknown (idle).`},"autoPresence.exhaustedText":{label:`Discord Auto Presence Exhausted Text`,help:`Optional custom status text while runtime detects exhausted/unavailable model quota (dnd). Supports {reason} template placeholder.`},activityType:{label:`Discord Presence Activity Type`,help:`Discord presence activity type (0=Playing,1=Streaming,2=Listening,3=Watching,4=Custom,5=Competing).`},activityUrl:{label:`Discord Presence Activity URL`,help:`Discord presence streaming URL (required for activityType=1).`},allowBots:{label:`Discord Allow Bot Messages`,help:`Allow bot-authored messages to trigger Discord replies (default: false). Set "mentions" to only accept bot messages that mention the bot.`},token:{label:`Discord Bot Token`,help:`Discord bot token used for gateway and REST API authentication for this provider account. Keep this secret out of committed config and rotate immediately after any leak.`,sensitive:!0}},unsupportedSecretRefSurfacePatterns:[`channels.discord.accounts.*.threadBindings.webhookToken`,`channels.discord.threadBindings.webhookToken`]},{pluginId:`feishu`,channelId:`feishu`,label:`Feishu`,description:`飞书/Lark enterprise messaging with doc/wiki/drive tools.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{enabled:{type:`boolean`},defaultAccount:{type:`string`},appId:{type:`string`},appSecret:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},encryptKey:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},verificationToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},domain:{default:`feishu`,anyOf:[{type:`string`,enum:[`feishu`,`lark`]},{type:`string`,format:`uri`,pattern:`^https:\\/\\/.*`}]},connectionMode:{default:`websocket`,type:`string`,enum:[`websocket`,`webhook`]},webhookPath:{default:`/feishu/events`,type:`string`},webhookHost:{type:`string`},webhookPort:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},capabilities:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{mode:{type:`string`,enum:[`native`,`escape`,`strip`]},tableMode:{type:`string`,enum:[`native`,`ascii`,`simple`]}},additionalProperties:!1},configWrites:{type:`boolean`},dmPolicy:{default:`pairing`,type:`string`,enum:[`open`,`pairing`,`allowlist`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,anyOf:[{type:`string`,enum:[`open`,`allowlist`,`disabled`]},{}]},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupSenderAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},requireMention:{type:`boolean`},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`},groupSessionScope:{type:`string`,enum:[`group`,`group_sender`,`group_topic`,`group_topic_sender`]},topicSessionMode:{type:`string`,enum:[`disabled`,`enabled`]},replyInThread:{type:`string`,enum:[`disabled`,`enabled`]}},additionalProperties:!1}},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},systemPrompt:{type:`string`}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreamingCoalesce:{type:`object`,properties:{enabled:{type:`boolean`},minDelayMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxDelayMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991}},additionalProperties:!1},mediaMaxMb:{type:`number`,exclusiveMinimum:0},httpTimeoutMs:{type:`integer`,exclusiveMinimum:0,maximum:3e5},heartbeat:{type:`object`,properties:{visibility:{type:`string`,enum:[`visible`,`hidden`]},intervalMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991}},additionalProperties:!1},renderMode:{type:`string`,enum:[`auto`,`raw`,`card`]},streaming:{type:`boolean`},tools:{type:`object`,properties:{doc:{type:`boolean`},chat:{type:`boolean`},wiki:{type:`boolean`},drive:{type:`boolean`},perm:{type:`boolean`},scopes:{type:`boolean`}},additionalProperties:!1},actions:{type:`object`,properties:{reactions:{type:`boolean`}},additionalProperties:!1},replyInThread:{type:`string`,enum:[`disabled`,`enabled`]},reactionNotifications:{default:`own`,type:`string`,enum:[`off`,`own`,`all`]},typingIndicator:{default:!0,type:`boolean`},resolveSenderNames:{default:!0,type:`boolean`},groupSessionScope:{type:`string`,enum:[`group`,`group_sender`,`group_topic`,`group_topic_sender`]},topicSessionMode:{type:`string`,enum:[`disabled`,`enabled`]},dynamicAgentCreation:{type:`object`,properties:{enabled:{type:`boolean`},workspaceTemplate:{type:`string`},agentDirTemplate:{type:`string`},maxAgents:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991}},additionalProperties:!1},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},name:{type:`string`},appId:{type:`string`},appSecret:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},encryptKey:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},verificationToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},domain:{anyOf:[{type:`string`,enum:[`feishu`,`lark`]},{type:`string`,format:`uri`,pattern:`^https:\\/\\/.*`}]},connectionMode:{type:`string`,enum:[`websocket`,`webhook`]},webhookPath:{type:`string`},webhookHost:{type:`string`},webhookPort:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},capabilities:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{mode:{type:`string`,enum:[`native`,`escape`,`strip`]},tableMode:{type:`string`,enum:[`native`,`ascii`,`simple`]}},additionalProperties:!1},configWrites:{type:`boolean`},dmPolicy:{type:`string`,enum:[`open`,`pairing`,`allowlist`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{anyOf:[{type:`string`,enum:[`open`,`allowlist`,`disabled`]},{}]},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupSenderAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},requireMention:{type:`boolean`},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`},groupSessionScope:{type:`string`,enum:[`group`,`group_sender`,`group_topic`,`group_topic_sender`]},topicSessionMode:{type:`string`,enum:[`disabled`,`enabled`]},replyInThread:{type:`string`,enum:[`disabled`,`enabled`]}},additionalProperties:!1}},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},systemPrompt:{type:`string`}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreamingCoalesce:{type:`object`,properties:{enabled:{type:`boolean`},minDelayMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxDelayMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991}},additionalProperties:!1},mediaMaxMb:{type:`number`,exclusiveMinimum:0},httpTimeoutMs:{type:`integer`,exclusiveMinimum:0,maximum:3e5},heartbeat:{type:`object`,properties:{visibility:{type:`string`,enum:[`visible`,`hidden`]},intervalMs:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991}},additionalProperties:!1},renderMode:{type:`string`,enum:[`auto`,`raw`,`card`]},streaming:{type:`boolean`},tools:{type:`object`,properties:{doc:{type:`boolean`},chat:{type:`boolean`},wiki:{type:`boolean`},drive:{type:`boolean`},perm:{type:`boolean`},scopes:{type:`boolean`}},additionalProperties:!1},actions:{type:`object`,properties:{reactions:{type:`boolean`}},additionalProperties:!1},replyInThread:{type:`string`,enum:[`disabled`,`enabled`]},reactionNotifications:{type:`string`,enum:[`off`,`own`,`all`]},typingIndicator:{type:`boolean`},resolveSenderNames:{type:`boolean`},groupSessionScope:{type:`string`,enum:[`group`,`group_sender`,`group_topic`,`group_topic_sender`]},topicSessionMode:{type:`string`,enum:[`disabled`,`enabled`]}},additionalProperties:!1}}},required:[`domain`,`connectionMode`,`webhookPath`,`dmPolicy`,`groupPolicy`,`reactionNotifications`,`typingIndicator`,`resolveSenderNames`],additionalProperties:!1}},{pluginId:`googlechat`,channelId:`googlechat`,label:`Google Chat`,description:`Google Workspace Chat app with HTTP webhook.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},capabilities:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},configWrites:{type:`boolean`},allowBots:{type:`boolean`},dangerouslyAllowNameMatching:{type:`boolean`},requireMention:{type:`boolean`},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},requireMention:{type:`boolean`},users:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`}},additionalProperties:!1}},defaultTo:{type:`string`},serviceAccount:{anyOf:[{type:`string`},{type:`object`,propertyNames:{type:`string`},additionalProperties:{}},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},serviceAccountRef:{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]},serviceAccountFile:{type:`string`},audienceType:{type:`string`,enum:[`app-url`,`project-number`]},audience:{type:`string`},appPrincipal:{type:`string`},webhookPath:{type:`string`},webhookUrl:{type:`string`},botUser:{type:`string`},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},mediaMaxMb:{type:`number`,exclusiveMinimum:0},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},actions:{type:`object`,properties:{reactions:{type:`boolean`}},additionalProperties:!1},dm:{type:`object`,properties:{enabled:{type:`boolean`},policy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}}},required:[`policy`],additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},typingIndicator:{type:`string`,enum:[`none`,`message`,`reaction`]},responsePrefix:{type:`string`},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{name:{type:`string`},capabilities:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},configWrites:{type:`boolean`},allowBots:{type:`boolean`},dangerouslyAllowNameMatching:{type:`boolean`},requireMention:{type:`boolean`},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},requireMention:{type:`boolean`},users:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`}},additionalProperties:!1}},defaultTo:{type:`string`},serviceAccount:{anyOf:[{type:`string`},{type:`object`,propertyNames:{type:`string`},additionalProperties:{}},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},serviceAccountRef:{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]},serviceAccountFile:{type:`string`},audienceType:{type:`string`,enum:[`app-url`,`project-number`]},audience:{type:`string`},appPrincipal:{type:`string`},webhookPath:{type:`string`},webhookUrl:{type:`string`},botUser:{type:`string`},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},mediaMaxMb:{type:`number`,exclusiveMinimum:0},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},actions:{type:`object`,properties:{reactions:{type:`boolean`}},additionalProperties:!1},dm:{type:`object`,properties:{enabled:{type:`boolean`},policy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}}},required:[`policy`],additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},typingIndicator:{type:`string`,enum:[`none`,`message`,`reaction`]},responsePrefix:{type:`string`}},required:[`groupPolicy`],additionalProperties:!1}},defaultAccount:{type:`string`}},required:[`groupPolicy`],additionalProperties:!1}},{pluginId:`imessage`,channelId:`imessage`,label:`iMessage`,description:`this is still a work in progress.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},capabilities:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},configWrites:{type:`boolean`},cliPath:{type:`string`},dbPath:{type:`string`},remoteHost:{type:`string`},service:{anyOf:[{type:`string`,const:`imessage`},{type:`string`,const:`sms`},{type:`string`,const:`auto`}]},region:{type:`string`},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},defaultTo:{type:`string`},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},includeAttachments:{type:`boolean`},attachmentRoots:{type:`array`,items:{type:`string`}},remoteAttachmentRoots:{type:`array`,items:{type:`string`}},mediaMaxMb:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}}},additionalProperties:!1}},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},responsePrefix:{type:`string`},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{name:{type:`string`},capabilities:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},configWrites:{type:`boolean`},cliPath:{type:`string`},dbPath:{type:`string`},remoteHost:{type:`string`},service:{anyOf:[{type:`string`,const:`imessage`},{type:`string`,const:`sms`},{type:`string`,const:`auto`}]},region:{type:`string`},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},defaultTo:{type:`string`},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},includeAttachments:{type:`boolean`},attachmentRoots:{type:`array`,items:{type:`string`}},remoteAttachmentRoots:{type:`array`,items:{type:`string`}},mediaMaxMb:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}}},additionalProperties:!1}},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},responsePrefix:{type:`string`}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1}},defaultAccount:{type:`string`}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1},uiHints:{"":{label:`iMessage`,help:`iMessage channel provider configuration for CLI integration and DM access policy handling. Use explicit CLI paths when runtime environments have non-standard binary locations.`},dmPolicy:{label:`iMessage DM Policy`,help:`Direct message access control ("pairing" recommended). "open" requires channels.imessage.allowFrom=["*"].`},configWrites:{label:`iMessage Config Writes`,help:`Allow iMessage to write config in response to channel events/commands (default: true).`},cliPath:{label:`iMessage CLI Path`,help:`Filesystem path to the iMessage bridge CLI binary used for send/receive operations. Set explicitly when the binary is not on PATH in service runtime environments.`}}},{pluginId:`irc`,channelId:`irc`,label:`IRC`,description:`classic IRC networks with DM/channel routing and pairing controls.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},dangerouslyAllowNameMatching:{type:`boolean`},host:{type:`string`},port:{type:`integer`,minimum:1,maximum:65535},tls:{type:`boolean`},nick:{type:`string`},username:{type:`string`},realname:{type:`string`},password:{type:`string`},passwordFile:{type:`string`},nickserv:{type:`object`,properties:{enabled:{type:`boolean`},service:{type:`string`},password:{type:`string`},passwordFile:{type:`string`},register:{type:`boolean`},registerEmail:{type:`string`}},additionalProperties:!1},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`}},additionalProperties:!1}},channels:{type:`array`,items:{type:`string`}},mentionPatterns:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},responsePrefix:{type:`string`},mediaMaxMb:{type:`number`,exclusiveMinimum:0},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},dangerouslyAllowNameMatching:{type:`boolean`},host:{type:`string`},port:{type:`integer`,minimum:1,maximum:65535},tls:{type:`boolean`},nick:{type:`string`},username:{type:`string`},realname:{type:`string`},password:{type:`string`},passwordFile:{type:`string`},nickserv:{type:`object`,properties:{enabled:{type:`boolean`},service:{type:`string`},password:{type:`string`},passwordFile:{type:`string`},register:{type:`boolean`},registerEmail:{type:`string`}},additionalProperties:!1},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`}},additionalProperties:!1}},channels:{type:`array`,items:{type:`string`}},mentionPatterns:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},responsePrefix:{type:`string`},mediaMaxMb:{type:`number`,exclusiveMinimum:0}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1}},defaultAccount:{type:`string`}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1},uiHints:{"":{label:`IRC`,help:`IRC channel provider configuration and compatibility settings for classic IRC transport workflows. Use this section when bridging legacy chat infrastructure into OpenClaw.`},dmPolicy:{label:`IRC DM Policy`,help:`Direct message access control ("pairing" recommended). "open" requires channels.irc.allowFrom=["*"].`},"nickserv.enabled":{label:`IRC NickServ Enabled`,help:`Enable NickServ identify/register after connect (defaults to enabled when password is configured).`},"nickserv.service":{label:`IRC NickServ Service`,help:`NickServ service nick (default: NickServ).`},"nickserv.password":{label:`IRC NickServ Password`,help:`NickServ password used for IDENTIFY/REGISTER (sensitive).`},"nickserv.passwordFile":{label:`IRC NickServ Password File`,help:`Optional file path containing NickServ password.`},"nickserv.register":{label:`IRC NickServ Register`,help:`If true, send NickServ REGISTER on every connect. Use once for initial registration, then disable.`},"nickserv.registerEmail":{label:`IRC NickServ Register Email`,help:`Email used with NickServ REGISTER (required when register=true).`},configWrites:{label:`IRC Config Writes`,help:`Allow IRC to write config in response to channel events/commands (default: true).`}}},{pluginId:`line`,channelId:`line`,label:`LINE`,description:`LINE Messaging API webhook bot.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{enabled:{type:`boolean`},channelAccessToken:{type:`string`},channelSecret:{type:`string`},tokenFile:{type:`string`},secretFile:{type:`string`},name:{type:`string`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},dmPolicy:{default:`pairing`,type:`string`,enum:[`open`,`allowlist`,`pairing`,`disabled`]},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`allowlist`,`disabled`]},responsePrefix:{type:`string`},mediaMaxMb:{type:`number`},webhookPath:{type:`string`},threadBindings:{type:`object`,properties:{enabled:{type:`boolean`},idleHours:{type:`number`},maxAgeHours:{type:`number`},spawnSubagentSessions:{type:`boolean`},spawnAcpSessions:{type:`boolean`}},additionalProperties:!1},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},channelAccessToken:{type:`string`},channelSecret:{type:`string`},tokenFile:{type:`string`},secretFile:{type:`string`},name:{type:`string`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},dmPolicy:{default:`pairing`,type:`string`,enum:[`open`,`allowlist`,`pairing`,`disabled`]},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`allowlist`,`disabled`]},responsePrefix:{type:`string`},mediaMaxMb:{type:`number`},webhookPath:{type:`string`},threadBindings:{type:`object`,properties:{enabled:{type:`boolean`},idleHours:{type:`number`},maxAgeHours:{type:`number`},spawnSubagentSessions:{type:`boolean`},spawnAcpSessions:{type:`boolean`}},additionalProperties:!1},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},requireMention:{type:`boolean`},systemPrompt:{type:`string`},skills:{type:`array`,items:{type:`string`}}},additionalProperties:!1}}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1}},defaultAccount:{type:`string`},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},requireMention:{type:`boolean`},systemPrompt:{type:`string`},skills:{type:`array`,items:{type:`string`}}},additionalProperties:!1}}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1}},{pluginId:`matrix`,channelId:`matrix`,label:`Matrix`,description:`open protocol; install the plugin to enable.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},defaultAccount:{type:`string`},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{}},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},homeserver:{type:`string`},network:{type:`object`,properties:{dangerouslyAllowPrivateNetwork:{type:`boolean`}},additionalProperties:!1},proxy:{type:`string`},userId:{type:`string`},accessToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},password:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},deviceId:{type:`string`},deviceName:{type:`string`},avatarUrl:{type:`string`},initialSyncLimit:{type:`number`},encryption:{type:`boolean`},allowlistOnly:{type:`boolean`},allowBots:{anyOf:[{type:`boolean`},{type:`string`,const:`mentions`}]},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},blockStreaming:{type:`boolean`},streaming:{anyOf:[{type:`string`,enum:[`partial`,`quiet`,`off`]},{type:`boolean`}]},replyToMode:{type:`string`,enum:[`off`,`first`,`all`,`batched`]},threadReplies:{type:`string`,enum:[`off`,`inbound`,`always`]},textChunkLimit:{type:`number`},chunkMode:{type:`string`,enum:[`length`,`newline`]},responsePrefix:{type:`string`},ackReaction:{type:`string`},ackReactionScope:{type:`string`,enum:[`group-mentions`,`group-all`,`direct`,`all`,`none`,`off`]},reactionNotifications:{type:`string`,enum:[`off`,`own`]},threadBindings:{type:`object`,properties:{enabled:{type:`boolean`},idleHours:{type:`number`,minimum:0},maxAgeHours:{type:`number`,minimum:0},spawnSubagentSessions:{type:`boolean`},spawnAcpSessions:{type:`boolean`}},additionalProperties:!1},startupVerification:{type:`string`,enum:[`off`,`if-unverified`]},startupVerificationCooldownHours:{type:`number`},mediaMaxMb:{type:`number`},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},autoJoin:{type:`string`,enum:[`always`,`allowlist`,`off`]},autoJoinAllowlist:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},dm:{type:`object`,properties:{enabled:{type:`boolean`},policy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},sessionScope:{type:`string`,enum:[`per-user`,`per-room`]},threadReplies:{type:`string`,enum:[`off`,`inbound`,`always`]}},additionalProperties:!1},execApprovals:{type:`object`,properties:{enabled:{type:`boolean`},approvers:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},agentFilter:{type:`array`,items:{type:`string`}},sessionFilter:{type:`array`,items:{type:`string`}},target:{type:`string`,enum:[`dm`,`channel`,`both`]}},additionalProperties:!1},groups:{type:`object`,properties:{},additionalProperties:{type:`object`,properties:{account:{type:`string`},enabled:{type:`boolean`},requireMention:{type:`boolean`},allowBots:{anyOf:[{type:`boolean`},{type:`string`,const:`mentions`}]},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},autoReply:{type:`boolean`},users:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},skills:{type:`array`,items:{type:`string`}},systemPrompt:{type:`string`}},additionalProperties:!1}},rooms:{type:`object`,properties:{},additionalProperties:{type:`object`,properties:{account:{type:`string`},enabled:{type:`boolean`},requireMention:{type:`boolean`},allowBots:{anyOf:[{type:`boolean`},{type:`string`,const:`mentions`}]},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},autoReply:{type:`boolean`},users:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},skills:{type:`array`,items:{type:`string`}},systemPrompt:{type:`string`}},additionalProperties:!1}},actions:{type:`object`,properties:{reactions:{type:`boolean`},messages:{type:`boolean`},pins:{type:`boolean`},profile:{type:`boolean`},memberInfo:{type:`boolean`},channelInfo:{type:`boolean`},verification:{type:`boolean`}},additionalProperties:!1}},additionalProperties:!1}},{pluginId:`mattermost`,channelId:`mattermost`,label:`Mattermost`,description:`self-hosted Slack-style chat; install the plugin to enable.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},capabilities:{type:`array`,items:{type:`string`}},dangerouslyAllowNameMatching:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},configWrites:{type:`boolean`},botToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},baseUrl:{type:`string`},chatmode:{type:`string`,enum:[`oncall`,`onmessage`,`onchar`]},oncharPrefixes:{type:`array`,items:{type:`string`}},requireMention:{type:`boolean`},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},replyToMode:{type:`string`,enum:[`off`,`first`,`all`,`batched`]},responsePrefix:{type:`string`},actions:{type:`object`,properties:{reactions:{type:`boolean`}},additionalProperties:!1},commands:{type:`object`,properties:{native:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},nativeSkills:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},callbackPath:{type:`string`},callbackUrl:{type:`string`}},additionalProperties:!1},interactions:{type:`object`,properties:{callbackBaseUrl:{type:`string`},allowedSourceIps:{type:`array`,items:{type:`string`}}},additionalProperties:!1},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`}},additionalProperties:!1}},network:{type:`object`,properties:{dangerouslyAllowPrivateNetwork:{type:`boolean`}},additionalProperties:!1},dmChannelRetry:{type:`object`,properties:{maxRetries:{type:`integer`,minimum:0,maximum:10},initialDelayMs:{type:`integer`,minimum:100,maximum:6e4},maxDelayMs:{type:`integer`,minimum:1e3,maximum:6e4},timeoutMs:{type:`integer`,minimum:5e3,maximum:12e4}},additionalProperties:!1},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{name:{type:`string`},capabilities:{type:`array`,items:{type:`string`}},dangerouslyAllowNameMatching:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},configWrites:{type:`boolean`},botToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},baseUrl:{type:`string`},chatmode:{type:`string`,enum:[`oncall`,`onmessage`,`onchar`]},oncharPrefixes:{type:`array`,items:{type:`string`}},requireMention:{type:`boolean`},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},replyToMode:{type:`string`,enum:[`off`,`first`,`all`,`batched`]},responsePrefix:{type:`string`},actions:{type:`object`,properties:{reactions:{type:`boolean`}},additionalProperties:!1},commands:{type:`object`,properties:{native:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},nativeSkills:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},callbackPath:{type:`string`},callbackUrl:{type:`string`}},additionalProperties:!1},interactions:{type:`object`,properties:{callbackBaseUrl:{type:`string`},allowedSourceIps:{type:`array`,items:{type:`string`}}},additionalProperties:!1},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`}},additionalProperties:!1}},network:{type:`object`,properties:{dangerouslyAllowPrivateNetwork:{type:`boolean`}},additionalProperties:!1},dmChannelRetry:{type:`object`,properties:{maxRetries:{type:`integer`,minimum:0,maximum:10},initialDelayMs:{type:`integer`,minimum:100,maximum:6e4},maxDelayMs:{type:`integer`,minimum:1e3,maximum:6e4},timeoutMs:{type:`integer`,minimum:5e3,maximum:12e4}},additionalProperties:!1}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1}},defaultAccount:{type:`string`}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1}},{pluginId:`msteams`,channelId:`msteams`,label:`Microsoft Teams`,description:`Teams SDK; enterprise support.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{enabled:{type:`boolean`},capabilities:{type:`array`,items:{type:`string`}},dangerouslyAllowNameMatching:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},configWrites:{type:`boolean`},appId:{type:`string`},appPassword:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},tenantId:{type:`string`},authType:{type:`string`,enum:[`secret`,`federated`]},certificatePath:{type:`string`},certificateThumbprint:{type:`string`},useManagedIdentity:{type:`boolean`},managedIdentityClientId:{type:`string`},webhook:{type:`object`,properties:{port:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},path:{type:`string`}},additionalProperties:!1},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{type:`string`}},defaultTo:{type:`string`},groupAllowFrom:{type:`array`,items:{type:`string`}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},typingIndicator:{type:`boolean`},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},mediaAllowHosts:{type:`array`,items:{type:`string`}},mediaAuthAllowHosts:{type:`array`,items:{type:`string`}},requireMention:{type:`boolean`},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},replyStyle:{type:`string`,enum:[`thread`,`top-level`]},teams:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},replyStyle:{type:`string`,enum:[`thread`,`top-level`]},channels:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},replyStyle:{type:`string`,enum:[`thread`,`top-level`]}},additionalProperties:!1}}},additionalProperties:!1}},mediaMaxMb:{type:`number`,exclusiveMinimum:0},sharePointSiteId:{type:`string`},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},responsePrefix:{type:`string`},welcomeCard:{type:`boolean`},promptStarters:{type:`array`,items:{type:`string`}},groupWelcomeCard:{type:`boolean`},feedbackEnabled:{type:`boolean`},feedbackReflection:{type:`boolean`},feedbackReflectionCooldownMs:{type:`integer`,minimum:0,maximum:9007199254740991},delegatedAuth:{type:`object`,properties:{enabled:{type:`boolean`},scopes:{type:`array`,items:{type:`string`}}},additionalProperties:!1},sso:{type:`object`,properties:{enabled:{type:`boolean`},connectionName:{type:`string`}},additionalProperties:!1}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1},uiHints:{"":{label:`MS Teams`,help:`Microsoft Teams channel provider configuration and provider-specific policy toggles. Use this section to isolate Teams behavior from other enterprise chat providers.`},configWrites:{label:`MS Teams Config Writes`,help:`Allow Microsoft Teams to write config in response to channel events/commands (default: true).`}}},{pluginId:`nextcloud-talk`,channelId:`nextcloud-talk`,label:`Nextcloud Talk`,description:`Self-hosted chat via Nextcloud Talk webhook bots.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},baseUrl:{type:`string`},botSecret:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},botSecretFile:{type:`string`},apiUser:{type:`string`},apiPassword:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},apiPasswordFile:{type:`string`},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},webhookPort:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},webhookHost:{type:`string`},webhookPath:{type:`string`},webhookPublicUrl:{type:`string`},allowFrom:{type:`array`,items:{type:`string`}},groupAllowFrom:{type:`array`,items:{type:`string`}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},rooms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{type:`string`}},systemPrompt:{type:`string`}},additionalProperties:!1}},network:{type:`object`,properties:{dangerouslyAllowPrivateNetwork:{type:`boolean`}},additionalProperties:!1},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},responsePrefix:{type:`string`},mediaMaxMb:{type:`number`,exclusiveMinimum:0},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},baseUrl:{type:`string`},botSecret:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},botSecretFile:{type:`string`},apiUser:{type:`string`},apiPassword:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},apiPasswordFile:{type:`string`},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},webhookPort:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},webhookHost:{type:`string`},webhookPath:{type:`string`},webhookPublicUrl:{type:`string`},allowFrom:{type:`array`,items:{type:`string`}},groupAllowFrom:{type:`array`,items:{type:`string`}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},rooms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{type:`string`}},systemPrompt:{type:`string`}},additionalProperties:!1}},network:{type:`object`,properties:{dangerouslyAllowPrivateNetwork:{type:`boolean`}},additionalProperties:!1},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},responsePrefix:{type:`string`},mediaMaxMb:{type:`number`,exclusiveMinimum:0}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1}},defaultAccount:{type:`string`}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1}},{pluginId:`nostr`,channelId:`nostr`,label:`Nostr`,description:`Decentralized protocol; encrypted DMs via NIP-04.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},defaultAccount:{type:`string`},enabled:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},privateKey:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},relays:{type:`array`,items:{type:`string`}},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},profile:{type:`object`,properties:{name:{type:`string`,maxLength:256},displayName:{type:`string`,maxLength:256},about:{type:`string`,maxLength:2e3},picture:{type:`string`,format:`uri`},banner:{type:`string`,format:`uri`},website:{type:`string`,format:`uri`},nip05:{type:`string`},lud16:{type:`string`}},additionalProperties:!1}},additionalProperties:!1}},{pluginId:`qa-channel`,channelId:`qa-channel`,label:`QA Channel`,description:`Synthetic Slack-class transport for automated OpenClaw QA scenarios.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},baseUrl:{type:`string`,format:`uri`},botUserId:{type:`string`},botDisplayName:{type:`string`},pollTimeoutMs:{type:`integer`,minimum:100,maximum:3e4},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},defaultTo:{type:`string`},actions:{type:`object`,properties:{messages:{type:`boolean`},reactions:{type:`boolean`},search:{type:`boolean`},threads:{type:`boolean`}},additionalProperties:!1},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},baseUrl:{type:`string`,format:`uri`},botUserId:{type:`string`},botDisplayName:{type:`string`},pollTimeoutMs:{type:`integer`,minimum:100,maximum:3e4},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},defaultTo:{type:`string`},actions:{type:`object`,properties:{messages:{type:`boolean`},reactions:{type:`boolean`},search:{type:`boolean`},threads:{type:`boolean`}},additionalProperties:!1}},additionalProperties:!1}},defaultAccount:{type:`string`}},additionalProperties:!1}},{pluginId:`qqbot`,channelId:`qqbot`,label:`QQ Bot`,description:`connect to QQ via official QQ Bot API with group chat and direct message support.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{enabled:{type:`boolean`},name:{type:`string`},appId:{type:`string`},clientSecret:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},clientSecretFile:{type:`string`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},dmPolicy:{type:`string`,enum:[`open`,`allowlist`,`disabled`]},groupPolicy:{type:`string`,enum:[`open`,`allowlist`,`disabled`]},systemPrompt:{type:`string`},markdownSupport:{type:`boolean`},voiceDirectUploadFormats:{type:`array`,items:{type:`string`}},audioFormatPolicy:{type:`object`,properties:{sttDirectFormats:{type:`array`,items:{type:`string`}},uploadDirectFormats:{type:`array`,items:{type:`string`}},transcodeEnabled:{type:`boolean`}},additionalProperties:!1},urlDirectUpload:{type:`boolean`},upgradeUrl:{type:`string`},upgradeMode:{type:`string`,enum:[`doc`,`hot-reload`]},streaming:{anyOf:[{type:`boolean`},{type:`object`,properties:{mode:{default:`partial`,type:`string`,enum:[`off`,`partial`]}},required:[`mode`],additionalProperties:{}}]},execApprovals:{type:`object`,properties:{enabled:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},approvers:{type:`array`,items:{type:`string`}},agentFilter:{type:`array`,items:{type:`string`}},sessionFilter:{type:`array`,items:{type:`string`}},target:{type:`string`,enum:[`dm`,`channel`,`both`]}},additionalProperties:!1},stt:{type:`object`,properties:{enabled:{type:`boolean`},provider:{type:`string`},baseUrl:{type:`string`},apiKey:{type:`string`},model:{type:`string`}},additionalProperties:!1},accounts:{type:`object`,properties:{},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},name:{type:`string`},appId:{type:`string`},clientSecret:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},clientSecretFile:{type:`string`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},dmPolicy:{type:`string`,enum:[`open`,`allowlist`,`disabled`]},groupPolicy:{type:`string`,enum:[`open`,`allowlist`,`disabled`]},systemPrompt:{type:`string`},markdownSupport:{type:`boolean`},voiceDirectUploadFormats:{type:`array`,items:{type:`string`}},audioFormatPolicy:{type:`object`,properties:{sttDirectFormats:{type:`array`,items:{type:`string`}},uploadDirectFormats:{type:`array`,items:{type:`string`}},transcodeEnabled:{type:`boolean`}},additionalProperties:!1},urlDirectUpload:{type:`boolean`},upgradeUrl:{type:`string`},upgradeMode:{type:`string`,enum:[`doc`,`hot-reload`]},streaming:{anyOf:[{type:`boolean`},{type:`object`,properties:{mode:{default:`partial`,type:`string`,enum:[`off`,`partial`]}},required:[`mode`],additionalProperties:{}}]},execApprovals:{type:`object`,properties:{enabled:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},approvers:{type:`array`,items:{type:`string`}},agentFilter:{type:`array`,items:{type:`string`}},sessionFilter:{type:`array`,items:{type:`string`}},target:{type:`string`,enum:[`dm`,`channel`,`both`]}},additionalProperties:!1}},additionalProperties:{}}},defaultAccount:{type:`string`}},additionalProperties:{}}},{pluginId:`signal`,channelId:`signal`,label:`Signal`,description:`signal-cli linked device; more setup (David Reagans: "Hop on Discord.").`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},capabilities:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},configWrites:{type:`boolean`},account:{type:`string`},accountUuid:{type:`string`},httpUrl:{type:`string`},httpHost:{type:`string`},httpPort:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},cliPath:{type:`string`},autoStart:{type:`boolean`},startupTimeoutMs:{type:`integer`,minimum:1e3,maximum:12e4},receiveMode:{anyOf:[{type:`string`,const:`on-start`},{type:`string`,const:`manual`}]},ignoreAttachments:{type:`boolean`},ignoreStories:{type:`boolean`},sendReadReceipts:{type:`boolean`},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},defaultTo:{type:`string`},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},ingest:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}}},additionalProperties:!1}},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},mediaMaxMb:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},reactionNotifications:{type:`string`,enum:[`off`,`own`,`all`,`allowlist`]},reactionAllowlist:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},actions:{type:`object`,properties:{reactions:{type:`boolean`}},additionalProperties:!1},reactionLevel:{type:`string`,enum:[`off`,`ack`,`minimal`,`extensive`]},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},responsePrefix:{type:`string`},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{name:{type:`string`},capabilities:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},configWrites:{type:`boolean`},account:{type:`string`},accountUuid:{type:`string`},httpUrl:{type:`string`},httpHost:{type:`string`},httpPort:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},cliPath:{type:`string`},autoStart:{type:`boolean`},startupTimeoutMs:{type:`integer`,minimum:1e3,maximum:12e4},receiveMode:{anyOf:[{type:`string`,const:`on-start`},{type:`string`,const:`manual`}]},ignoreAttachments:{type:`boolean`},ignoreStories:{type:`boolean`},sendReadReceipts:{type:`boolean`},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},defaultTo:{type:`string`},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},ingest:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}}},additionalProperties:!1}},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},mediaMaxMb:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},reactionNotifications:{type:`string`,enum:[`off`,`own`,`all`,`allowlist`]},reactionAllowlist:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},actions:{type:`object`,properties:{reactions:{type:`boolean`}},additionalProperties:!1},reactionLevel:{type:`string`,enum:[`off`,`ack`,`minimal`,`extensive`]},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},responsePrefix:{type:`string`}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1}},defaultAccount:{type:`string`}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1},uiHints:{"":{label:`Signal`,help:`Signal channel provider configuration including account identity and DM policy behavior. Keep account mapping explicit so routing remains stable across multi-device setups.`},dmPolicy:{label:`Signal DM Policy`,help:`Direct message access control ("pairing" recommended). "open" requires channels.signal.allowFrom=["*"].`},configWrites:{label:`Signal Config Writes`,help:`Allow Signal to write config in response to channel events/commands (default: true).`},account:{label:`Signal Account`,help:`Signal account identifier (phone/number handle) used to bind this channel config to a specific Signal identity. Keep this aligned with your linked device/session state.`}}},{pluginId:`slack`,channelId:`slack`,label:`Slack`,description:`supported (Socket Mode).`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},mode:{default:`socket`,type:`string`,enum:[`socket`,`http`]},signingSecret:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},webhookPath:{default:`/slack/events`,type:`string`},capabilities:{anyOf:[{type:`array`,items:{type:`string`}},{type:`object`,properties:{interactiveReplies:{type:`boolean`}},additionalProperties:!1}]},execApprovals:{type:`object`,properties:{enabled:{type:`boolean`},approvers:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},agentFilter:{type:`array`,items:{type:`string`}},sessionFilter:{type:`array`,items:{type:`string`}},target:{type:`string`,enum:[`dm`,`channel`,`both`]}},additionalProperties:!1},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},commands:{type:`object`,properties:{native:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},nativeSkills:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]}},additionalProperties:!1},configWrites:{type:`boolean`},botToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},appToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},userToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},userTokenReadOnly:{default:!0,type:`boolean`},allowBots:{type:`boolean`},dangerouslyAllowNameMatching:{type:`boolean`},requireMention:{type:`boolean`},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},streaming:{type:`object`,properties:{mode:{type:`string`,enum:[`off`,`partial`,`block`,`progress`]},chunkMode:{type:`string`,enum:[`length`,`newline`]},preview:{type:`object`,properties:{chunk:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},breakPreference:{anyOf:[{type:`string`,const:`paragraph`},{type:`string`,const:`newline`},{type:`string`,const:`sentence`}]}},additionalProperties:!1},toolProgress:{type:`boolean`}},additionalProperties:!1},block:{type:`object`,properties:{enabled:{type:`boolean`},coalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},additionalProperties:!1},nativeTransport:{type:`boolean`}},additionalProperties:!1},mediaMaxMb:{type:`number`,exclusiveMinimum:0},reactionNotifications:{type:`string`,enum:[`off`,`own`,`all`,`allowlist`]},reactionAllowlist:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},replyToModeByChatType:{type:`object`,properties:{direct:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},group:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},channel:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]}},additionalProperties:!1},thread:{type:`object`,properties:{historyScope:{type:`string`,enum:[`thread`,`channel`]},inheritParent:{type:`boolean`},initialHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},requireExplicitMention:{type:`boolean`}},additionalProperties:!1},actions:{type:`object`,properties:{reactions:{type:`boolean`},messages:{type:`boolean`},pins:{type:`boolean`},search:{type:`boolean`},permissions:{type:`boolean`},memberInfo:{type:`boolean`},channelInfo:{type:`boolean`},emojiList:{type:`boolean`}},additionalProperties:!1},slashCommand:{type:`object`,properties:{enabled:{type:`boolean`},name:{type:`string`},sessionPrefix:{type:`string`},ephemeral:{type:`boolean`}},additionalProperties:!1},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},defaultTo:{type:`string`},dm:{type:`object`,properties:{enabled:{type:`boolean`},policy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupEnabled:{type:`boolean`},groupChannels:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]}},additionalProperties:!1},channels:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},allowBots:{type:`boolean`},users:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},skills:{type:`array`,items:{type:`string`}},systemPrompt:{type:`string`}},additionalProperties:!1}},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},responsePrefix:{type:`string`},ackReaction:{type:`string`},typingReaction:{type:`string`},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{name:{type:`string`},mode:{type:`string`,enum:[`socket`,`http`]},signingSecret:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},webhookPath:{type:`string`},capabilities:{anyOf:[{type:`array`,items:{type:`string`}},{type:`object`,properties:{interactiveReplies:{type:`boolean`}},additionalProperties:!1}]},execApprovals:{type:`object`,properties:{enabled:{type:`boolean`},approvers:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},agentFilter:{type:`array`,items:{type:`string`}},sessionFilter:{type:`array`,items:{type:`string`}},target:{type:`string`,enum:[`dm`,`channel`,`both`]}},additionalProperties:!1},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},commands:{type:`object`,properties:{native:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},nativeSkills:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]}},additionalProperties:!1},configWrites:{type:`boolean`},botToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},appToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},userToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},userTokenReadOnly:{default:!0,type:`boolean`},allowBots:{type:`boolean`},dangerouslyAllowNameMatching:{type:`boolean`},requireMention:{type:`boolean`},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},streaming:{type:`object`,properties:{mode:{type:`string`,enum:[`off`,`partial`,`block`,`progress`]},chunkMode:{type:`string`,enum:[`length`,`newline`]},preview:{type:`object`,properties:{chunk:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},breakPreference:{anyOf:[{type:`string`,const:`paragraph`},{type:`string`,const:`newline`},{type:`string`,const:`sentence`}]}},additionalProperties:!1},toolProgress:{type:`boolean`}},additionalProperties:!1},block:{type:`object`,properties:{enabled:{type:`boolean`},coalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},additionalProperties:!1},nativeTransport:{type:`boolean`}},additionalProperties:!1},mediaMaxMb:{type:`number`,exclusiveMinimum:0},reactionNotifications:{type:`string`,enum:[`off`,`own`,`all`,`allowlist`]},reactionAllowlist:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},replyToModeByChatType:{type:`object`,properties:{direct:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},group:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},channel:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]}},additionalProperties:!1},thread:{type:`object`,properties:{historyScope:{type:`string`,enum:[`thread`,`channel`]},inheritParent:{type:`boolean`},initialHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},requireExplicitMention:{type:`boolean`}},additionalProperties:!1},actions:{type:`object`,properties:{reactions:{type:`boolean`},messages:{type:`boolean`},pins:{type:`boolean`},search:{type:`boolean`},permissions:{type:`boolean`},memberInfo:{type:`boolean`},channelInfo:{type:`boolean`},emojiList:{type:`boolean`}},additionalProperties:!1},slashCommand:{type:`object`,properties:{enabled:{type:`boolean`},name:{type:`string`},sessionPrefix:{type:`string`},ephemeral:{type:`boolean`}},additionalProperties:!1},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},defaultTo:{type:`string`},dm:{type:`object`,properties:{enabled:{type:`boolean`},policy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupEnabled:{type:`boolean`},groupChannels:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]}},additionalProperties:!1},channels:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},allowBots:{type:`boolean`},users:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},skills:{type:`array`,items:{type:`string`}},systemPrompt:{type:`string`}},additionalProperties:!1}},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},responsePrefix:{type:`string`},ackReaction:{type:`string`},typingReaction:{type:`string`}},required:[`userTokenReadOnly`],additionalProperties:!1}},defaultAccount:{type:`string`}},required:[`mode`,`webhookPath`,`userTokenReadOnly`,`groupPolicy`],additionalProperties:!1},uiHints:{"":{label:`Slack`,help:`Slack channel provider configuration for bot/app tokens, streaming behavior, and DM policy controls. Keep token handling and thread behavior explicit to avoid noisy workspace interactions.`},"dm.policy":{label:`Slack DM Policy`,help:`Direct message access control ("pairing" recommended). "open" requires channels.slack.allowFrom=["*"] (legacy: channels.slack.dm.allowFrom).`},dmPolicy:{label:`Slack DM Policy`,help:`Direct message access control ("pairing" recommended). "open" requires channels.slack.allowFrom=["*"].`},configWrites:{label:`Slack Config Writes`,help:`Allow Slack to write config in response to channel events/commands (default: true).`},"commands.native":{label:`Slack Native Commands`,help:`Override native commands for Slack (bool or "auto").`},"commands.nativeSkills":{label:`Slack Native Skill Commands`,help:`Override native skill commands for Slack (bool or "auto").`},allowBots:{label:`Slack Allow Bot Messages`,help:`Allow bot-authored messages to trigger Slack replies (default: false).`},botToken:{label:`Slack Bot Token`,help:`Slack bot token used for standard chat actions in the configured workspace. Keep this credential scoped and rotate if workspace app permissions change.`},appToken:{label:`Slack App Token`,help:`Slack app-level token used for Socket Mode connections and event transport when enabled. Use least-privilege app scopes and store this token as a secret.`},userToken:{label:`Slack User Token`,help:`Optional Slack user token for workflows requiring user-context API access beyond bot permissions. Use sparingly and audit scopes because this token can carry broader authority.`},userTokenReadOnly:{label:`Slack User Token Read Only`,help:`When true, treat configured Slack user token usage as read-only helper behavior where possible. Keep enabled if you only need supplemental reads without user-context writes.`},"capabilities.interactiveReplies":{label:`Slack Interactive Replies`,help:"Enable agent-authored Slack interactive reply directives (`[[slack_buttons: ...]]`, `[[slack_select: ...]]`). Default: false."},execApprovals:{label:`Slack Exec Approvals`,help:`Slack-native exec approval routing and approver authorization. When unset, OpenClaw auto-enables DM-first native approvals if approvers can be resolved for this workspace account.`},"execApprovals.enabled":{label:`Slack Exec Approvals Enabled`,help:`Controls Slack native exec approvals for this account: unset or "auto" enables DM-first native approvals when approvers can be resolved, true forces native approvals on, and false disables them.`},"execApprovals.approvers":{label:`Slack Exec Approval Approvers`,help:"Slack user IDs allowed to approve exec requests for this workspace account. Use Slack user IDs or user targets such as `U123`, `user:U123`, or `<@U123>`. If you leave this unset, OpenClaw falls back to commands.ownerAllowFrom when possible."},"execApprovals.agentFilter":{label:`Slack Exec Approval Agent Filter`,help:'Optional allowlist of agent IDs eligible for Slack exec approvals, for example `["main", "ops-agent"]`. Use this to keep approval prompts scoped to the agents you actually operate from Slack.'},"execApprovals.sessionFilter":{label:`Slack Exec Approval Session Filter`,help:`Optional session-key filters matched as substring or regex-style patterns before Slack approval routing is used. Use narrow patterns so Slack approvals only appear for intended sessions.`},"execApprovals.target":{label:`Slack Exec Approval Target`,help:`Controls where Slack approval prompts are sent: "dm" sends to approver DMs (default), "channel" sends to the originating Slack chat/thread, and "both" sends to both. Channel delivery exposes the command text to the chat, so only use it in trusted channels.`},streaming:{label:`Slack Streaming Mode`,help:`Unified Slack stream preview mode: "off" | "partial" | "block" | "progress". Legacy boolean/streamMode keys are auto-mapped.`},"streaming.mode":{label:`Slack Streaming Mode`,help:`Canonical Slack preview mode: "off" | "partial" | "block" | "progress".`},"streaming.chunkMode":{label:`Slack Chunk Mode`,help:`Chunking mode for outbound Slack text delivery: "length" (default) or "newline".`},"streaming.block.enabled":{label:`Slack Block Streaming Enabled`,help:`Enable chunked block-style Slack preview delivery when channels.slack.streaming.mode="block".`},"streaming.block.coalesce":{label:`Slack Block Streaming Coalesce`,help:`Merge streamed Slack block replies before final delivery.`},"streaming.nativeTransport":{label:`Slack Native Streaming`,help:`Enable native Slack text streaming (chat.startStream/chat.appendStream/chat.stopStream) when channels.slack.streaming.mode is partial (default: true). Requires a reply thread target; top-level DMs stay on the non-thread fallback path.`},"streaming.preview.toolProgress":{label:`Slack Draft Tool Progress`,help:`Show tool/progress activity in the live draft preview message (default: true). Set false to keep tool updates as separate messages.`},"thread.historyScope":{label:`Slack Thread History Scope`,help:`Scope for Slack thread history context ("thread" isolates per thread; "channel" reuses channel history).`},"thread.inheritParent":{label:`Slack Thread Parent Inheritance`,help:`If true, Slack thread sessions inherit the parent channel transcript (default: false).`},"thread.initialHistoryLimit":{label:`Slack Thread Initial History Limit`,help:`Maximum number of existing Slack thread messages to fetch when starting a new thread session (default: 20, set to 0 to disable).`},"thread.requireExplicitMention":{label:`Slack Thread Require Explicit Mention`,help:`If true, require an explicit @mention even inside threads where the bot has participated. Suppresses implicit thread mention behavior so the bot only responds to explicit @bot mentions in threads (default: false).`}}},{pluginId:`synology-chat`,channelId:`synology-chat`,label:`Synology Chat`,description:`Connect your Synology NAS Chat to OpenClaw with full agent capabilities.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{dangerouslyAllowNameMatching:{type:`boolean`},dangerouslyAllowInheritedWebhookPath:{type:`boolean`}},additionalProperties:{}}},{pluginId:`telegram`,channelId:`telegram`,label:`Telegram`,description:`simplest way to get started — register a bot with @BotFather and get going.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},capabilities:{anyOf:[{type:`array`,items:{type:`string`}},{type:`object`,properties:{inlineButtons:{type:`string`,enum:[`off`,`dm`,`group`,`all`,`allowlist`]}},additionalProperties:!1}]},execApprovals:{type:`object`,properties:{enabled:{type:`boolean`},approvers:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},agentFilter:{type:`array`,items:{type:`string`}},sessionFilter:{type:`array`,items:{type:`string`}},target:{type:`string`,enum:[`dm`,`channel`,`both`]}},additionalProperties:!1},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},commands:{type:`object`,properties:{native:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},nativeSkills:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]}},additionalProperties:!1},customCommands:{type:`array`,items:{type:`object`,properties:{command:{type:`string`},description:{type:`string`}},required:[`command`,`description`],additionalProperties:!1}},configWrites:{type:`boolean`},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},botToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},tokenFile:{type:`string`},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},ingest:{type:`boolean`},disableAudioPreflight:{type:`boolean`},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`},topics:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},ingest:{type:`boolean`},disableAudioPreflight:{type:`boolean`},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`},agentId:{type:`string`},errorPolicy:{type:`string`,enum:[`always`,`once`,`silent`]},errorCooldownMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},errorPolicy:{type:`string`,enum:[`always`,`once`,`silent`]},errorCooldownMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},defaultTo:{anyOf:[{type:`string`},{type:`number`}]},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},direct:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`},topics:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},ingest:{type:`boolean`},disableAudioPreflight:{type:`boolean`},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`},agentId:{type:`string`},errorPolicy:{type:`string`,enum:[`always`,`once`,`silent`]},errorCooldownMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},errorPolicy:{type:`string`,enum:[`always`,`once`,`silent`]},errorCooldownMs:{type:`integer`,minimum:0,maximum:9007199254740991},requireTopic:{type:`boolean`},autoTopicLabel:{anyOf:[{type:`boolean`},{type:`object`,properties:{enabled:{type:`boolean`},prompt:{type:`string`}},additionalProperties:!1}]}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},streaming:{type:`object`,properties:{mode:{type:`string`,enum:[`off`,`partial`,`block`,`progress`]},chunkMode:{type:`string`,enum:[`length`,`newline`]},preview:{type:`object`,properties:{chunk:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},breakPreference:{anyOf:[{type:`string`,const:`paragraph`},{type:`string`,const:`newline`},{type:`string`,const:`sentence`}]}},additionalProperties:!1},toolProgress:{type:`boolean`}},additionalProperties:!1},block:{type:`object`,properties:{enabled:{type:`boolean`},coalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},additionalProperties:!1}},additionalProperties:!1},mediaMaxMb:{type:`number`,exclusiveMinimum:0},timeoutSeconds:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},pollingStallThresholdMs:{type:`integer`,minimum:3e4,maximum:6e5},retry:{type:`object`,properties:{attempts:{type:`integer`,minimum:1,maximum:9007199254740991},minDelayMs:{type:`integer`,minimum:0,maximum:9007199254740991},maxDelayMs:{type:`integer`,minimum:0,maximum:9007199254740991},jitter:{type:`number`,minimum:0,maximum:1}},additionalProperties:!1},network:{type:`object`,properties:{autoSelectFamily:{type:`boolean`},dnsResultOrder:{type:`string`,enum:[`ipv4first`,`verbatim`]},dangerouslyAllowPrivateNetwork:{description:`Dangerous opt-in for trusted Telegram fake-IP or transparent-proxy environments where api.telegram.org resolves to private/internal/special-use addresses during media downloads.`,type:`boolean`}},additionalProperties:!1},proxy:{type:`string`},webhookUrl:{description:`Public HTTPS webhook URL registered with Telegram for inbound updates. This must be internet-reachable and requires channels.telegram.webhookSecret.`,type:`string`},webhookSecret:{description:`Secret token sent to Telegram during webhook registration and verified on inbound webhook requests. Telegram returns this value for verification; this is not the gateway auth token and not the bot token.`,anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},webhookPath:{description:`Local webhook route path served by the gateway listener. Defaults to /telegram-webhook.`,type:`string`},webhookHost:{description:`Local bind host for the webhook listener. Defaults to 127.0.0.1; keep loopback unless you intentionally expose direct ingress.`,type:`string`},webhookPort:{description:`Local bind port for the webhook listener. Defaults to 8787; set to 0 to let the OS assign an ephemeral port.`,type:`integer`,minimum:0,maximum:9007199254740991},webhookCertPath:{description:`Path to the self-signed certificate (PEM) to upload to Telegram during webhook registration. Required for self-signed certs (direct IP or no domain).`,type:`string`},actions:{type:`object`,properties:{reactions:{type:`boolean`},sendMessage:{type:`boolean`},poll:{type:`boolean`},deleteMessage:{type:`boolean`},editMessage:{type:`boolean`},sticker:{type:`boolean`},createForumTopic:{type:`boolean`},editForumTopic:{type:`boolean`}},additionalProperties:!1},threadBindings:{type:`object`,properties:{enabled:{type:`boolean`},idleHours:{type:`number`,minimum:0},maxAgeHours:{type:`number`,minimum:0},spawnSubagentSessions:{type:`boolean`},spawnAcpSessions:{type:`boolean`}},additionalProperties:!1},reactionNotifications:{type:`string`,enum:[`off`,`own`,`all`]},reactionLevel:{type:`string`,enum:[`off`,`ack`,`minimal`,`extensive`]},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},linkPreview:{type:`boolean`},silentErrorReplies:{type:`boolean`},responsePrefix:{type:`string`},ackReaction:{type:`string`},errorPolicy:{type:`string`,enum:[`always`,`once`,`silent`]},errorCooldownMs:{type:`integer`,minimum:0,maximum:9007199254740991},apiRoot:{type:`string`,format:`uri`},trustedLocalFileRoots:{description:`Trusted local filesystem roots for self-hosted Telegram Bot API absolute file_path values. Only absolute paths under these roots are read directly; all other absolute paths are rejected.`,type:`array`,items:{type:`string`}},autoTopicLabel:{anyOf:[{type:`boolean`},{type:`object`,properties:{enabled:{type:`boolean`},prompt:{type:`string`}},additionalProperties:!1}]},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{name:{type:`string`},capabilities:{anyOf:[{type:`array`,items:{type:`string`}},{type:`object`,properties:{inlineButtons:{type:`string`,enum:[`off`,`dm`,`group`,`all`,`allowlist`]}},additionalProperties:!1}]},execApprovals:{type:`object`,properties:{enabled:{type:`boolean`},approvers:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},agentFilter:{type:`array`,items:{type:`string`}},sessionFilter:{type:`array`,items:{type:`string`}},target:{type:`string`,enum:[`dm`,`channel`,`both`]}},additionalProperties:!1},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},enabled:{type:`boolean`},commands:{type:`object`,properties:{native:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},nativeSkills:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]}},additionalProperties:!1},customCommands:{type:`array`,items:{type:`object`,properties:{command:{type:`string`},description:{type:`string`}},required:[`command`,`description`],additionalProperties:!1}},configWrites:{type:`boolean`},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},botToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},tokenFile:{type:`string`},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},ingest:{type:`boolean`},disableAudioPreflight:{type:`boolean`},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`},topics:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},ingest:{type:`boolean`},disableAudioPreflight:{type:`boolean`},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`},agentId:{type:`string`},errorPolicy:{type:`string`,enum:[`always`,`once`,`silent`]},errorCooldownMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},errorPolicy:{type:`string`,enum:[`always`,`once`,`silent`]},errorCooldownMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},defaultTo:{anyOf:[{type:`string`},{type:`number`}]},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},direct:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`},topics:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},ingest:{type:`boolean`},disableAudioPreflight:{type:`boolean`},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},skills:{type:`array`,items:{type:`string`}},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},systemPrompt:{type:`string`},agentId:{type:`string`},errorPolicy:{type:`string`,enum:[`always`,`once`,`silent`]},errorCooldownMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},errorPolicy:{type:`string`,enum:[`always`,`once`,`silent`]},errorCooldownMs:{type:`integer`,minimum:0,maximum:9007199254740991},requireTopic:{type:`boolean`},autoTopicLabel:{anyOf:[{type:`boolean`},{type:`object`,properties:{enabled:{type:`boolean`},prompt:{type:`string`}},additionalProperties:!1}]}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},streaming:{type:`object`,properties:{mode:{type:`string`,enum:[`off`,`partial`,`block`,`progress`]},chunkMode:{type:`string`,enum:[`length`,`newline`]},preview:{type:`object`,properties:{chunk:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},breakPreference:{anyOf:[{type:`string`,const:`paragraph`},{type:`string`,const:`newline`},{type:`string`,const:`sentence`}]}},additionalProperties:!1},toolProgress:{type:`boolean`}},additionalProperties:!1},block:{type:`object`,properties:{enabled:{type:`boolean`},coalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},additionalProperties:!1}},additionalProperties:!1},mediaMaxMb:{type:`number`,exclusiveMinimum:0},timeoutSeconds:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},pollingStallThresholdMs:{type:`integer`,minimum:3e4,maximum:6e5},retry:{type:`object`,properties:{attempts:{type:`integer`,minimum:1,maximum:9007199254740991},minDelayMs:{type:`integer`,minimum:0,maximum:9007199254740991},maxDelayMs:{type:`integer`,minimum:0,maximum:9007199254740991},jitter:{type:`number`,minimum:0,maximum:1}},additionalProperties:!1},network:{type:`object`,properties:{autoSelectFamily:{type:`boolean`},dnsResultOrder:{type:`string`,enum:[`ipv4first`,`verbatim`]},dangerouslyAllowPrivateNetwork:{description:`Dangerous opt-in for trusted Telegram fake-IP or transparent-proxy environments where api.telegram.org resolves to private/internal/special-use addresses during media downloads.`,type:`boolean`}},additionalProperties:!1},proxy:{type:`string`},webhookUrl:{description:`Public HTTPS webhook URL registered with Telegram for inbound updates. This must be internet-reachable and requires channels.telegram.webhookSecret.`,type:`string`},webhookSecret:{description:`Secret token sent to Telegram during webhook registration and verified on inbound webhook requests. Telegram returns this value for verification; this is not the gateway auth token and not the bot token.`,anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},webhookPath:{description:`Local webhook route path served by the gateway listener. Defaults to /telegram-webhook.`,type:`string`},webhookHost:{description:`Local bind host for the webhook listener. Defaults to 127.0.0.1; keep loopback unless you intentionally expose direct ingress.`,type:`string`},webhookPort:{description:`Local bind port for the webhook listener. Defaults to 8787; set to 0 to let the OS assign an ephemeral port.`,type:`integer`,minimum:0,maximum:9007199254740991},webhookCertPath:{description:`Path to the self-signed certificate (PEM) to upload to Telegram during webhook registration. Required for self-signed certs (direct IP or no domain).`,type:`string`},actions:{type:`object`,properties:{reactions:{type:`boolean`},sendMessage:{type:`boolean`},poll:{type:`boolean`},deleteMessage:{type:`boolean`},editMessage:{type:`boolean`},sticker:{type:`boolean`},createForumTopic:{type:`boolean`},editForumTopic:{type:`boolean`}},additionalProperties:!1},threadBindings:{type:`object`,properties:{enabled:{type:`boolean`},idleHours:{type:`number`,minimum:0},maxAgeHours:{type:`number`,minimum:0},spawnSubagentSessions:{type:`boolean`},spawnAcpSessions:{type:`boolean`}},additionalProperties:!1},reactionNotifications:{type:`string`,enum:[`off`,`own`,`all`]},reactionLevel:{type:`string`,enum:[`off`,`ack`,`minimal`,`extensive`]},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},linkPreview:{type:`boolean`},silentErrorReplies:{type:`boolean`},responsePrefix:{type:`string`},ackReaction:{type:`string`},errorPolicy:{type:`string`,enum:[`always`,`once`,`silent`]},errorCooldownMs:{type:`integer`,minimum:0,maximum:9007199254740991},apiRoot:{type:`string`,format:`uri`},trustedLocalFileRoots:{description:`Trusted local filesystem roots for self-hosted Telegram Bot API absolute file_path values. Only absolute paths under these roots are read directly; all other absolute paths are rejected.`,type:`array`,items:{type:`string`}},autoTopicLabel:{anyOf:[{type:`boolean`},{type:`object`,properties:{enabled:{type:`boolean`},prompt:{type:`string`}},additionalProperties:!1}]}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1}},defaultAccount:{type:`string`}},required:[`dmPolicy`,`groupPolicy`],additionalProperties:!1},uiHints:{"":{label:`Telegram`,help:`Telegram channel provider configuration including auth tokens, retry behavior, and message rendering controls. Use this section to tune bot behavior for Telegram-specific API semantics.`},customCommands:{label:`Telegram Custom Commands`,help:`Additional Telegram bot menu commands (merged with native; conflicts ignored).`},botToken:{label:`Telegram Bot Token`,help:`Telegram bot token used to authenticate Bot API requests for this account/provider config. Use secret/env substitution and rotate tokens if exposure is suspected.`},dmPolicy:{label:`Telegram DM Policy`,help:`Direct message access control ("pairing" recommended). "open" requires channels.telegram.allowFrom=["*"].`},configWrites:{label:`Telegram Config Writes`,help:`Allow Telegram to write config in response to channel events/commands (default: true).`},"commands.native":{label:`Telegram Native Commands`,help:`Override native commands for Telegram (bool or "auto").`},"commands.nativeSkills":{label:`Telegram Native Skill Commands`,help:`Override native skill commands for Telegram (bool or "auto").`},streaming:{label:`Telegram Streaming Mode`,help:`Unified Telegram stream preview mode: "off" | "partial" | "block" | "progress" (default: "partial"). "progress" maps to "partial" on Telegram. Legacy boolean/streamMode keys are auto-mapped.`},"streaming.mode":{label:`Telegram Streaming Mode`,help:`Canonical Telegram preview mode: "off" | "partial" | "block" | "progress" (default: "partial"). "progress" maps to "partial" on Telegram.`},"streaming.chunkMode":{label:`Telegram Chunk Mode`,help:`Chunking mode for outbound Telegram text delivery: "length" (default) or "newline".`},"streaming.block.enabled":{label:`Telegram Block Streaming Enabled`,help:`Enable chunked block-style Telegram preview delivery when channels.telegram.streaming.mode="block".`},"streaming.block.coalesce":{label:`Telegram Block Streaming Coalesce`,help:`Merge streamed Telegram block replies before sending final delivery.`},"streaming.preview.chunk.minChars":{label:`Telegram Draft Chunk Min Chars`,help:`Minimum chars before emitting a Telegram block preview chunk when channels.telegram.streaming.mode="block".`},"streaming.preview.chunk.maxChars":{label:`Telegram Draft Chunk Max Chars`,help:`Target max size for a Telegram block preview chunk when channels.telegram.streaming.mode="block".`},"streaming.preview.chunk.breakPreference":{label:`Telegram Draft Chunk Break Preference`,help:`Preferred breakpoints for Telegram draft chunks (paragraph | newline | sentence).`},"streaming.preview.toolProgress":{label:`Telegram Draft Tool Progress`,help:`Show tool/progress activity in the live draft preview message (default: true). Set false to keep tool updates as separate messages.`},"retry.attempts":{label:`Telegram Retry Attempts`,help:`Max retry attempts for outbound Telegram API calls (default: 3).`},"retry.minDelayMs":{label:`Telegram Retry Min Delay (ms)`,help:`Minimum retry delay in ms for Telegram outbound calls.`},"retry.maxDelayMs":{label:`Telegram Retry Max Delay (ms)`,help:`Maximum retry delay cap in ms for Telegram outbound calls.`},"retry.jitter":{label:`Telegram Retry Jitter`,help:`Jitter factor (0-1) applied to Telegram retry delays.`},"network.autoSelectFamily":{label:`Telegram autoSelectFamily`,help:`Override Node autoSelectFamily for Telegram (true=enable, false=disable).`},"network.dangerouslyAllowPrivateNetwork":{label:`Telegram Dangerously Allow Private Network`,help:`Dangerous opt-in for trusted fake-IP or transparent-proxy environments where Telegram media downloads resolve api.telegram.org to private/internal/special-use addresses.`},timeoutSeconds:{label:`Telegram API Timeout (seconds)`,help:`Max seconds before Telegram API requests are aborted (default: 500 per grammY).`},pollingStallThresholdMs:{label:`Telegram Polling Stall Threshold (ms)`,help:`Milliseconds without completed Telegram getUpdates liveness before the polling watchdog restarts the polling runner. Default: 120000.`},silentErrorReplies:{label:`Telegram Silent Error Replies`,help:`When true, Telegram bot replies marked as errors are sent silently (no notification sound). Default: false.`},apiRoot:{label:`Telegram API Root URL`,help:`Custom Telegram Bot API root URL. Use for self-hosted Bot API servers (https://github.com/tdlib/telegram-bot-api) or reverse proxies in regions where api.telegram.org is blocked.`},trustedLocalFileRoots:{label:`Telegram Trusted Local File Roots`,help:`Trusted local filesystem roots for self-hosted Telegram Bot API absolute file_path values. Only absolute paths inside these roots are read directly; all other absolute paths are rejected.`},autoTopicLabel:{label:`Telegram Auto Topic Label`,help:`Auto-rename DM forum topics on first message using LLM. Default: true. Set to false to disable, or use object form { enabled: true, prompt: '...' } for custom prompt.`},"autoTopicLabel.enabled":{label:`Telegram Auto Topic Label Enabled`,help:`Whether auto topic labeling is enabled. Default: true.`},"autoTopicLabel.prompt":{label:`Telegram Auto Topic Label Prompt`,help:`Custom prompt for LLM-based topic naming. The user message is appended after the prompt.`},"capabilities.inlineButtons":{label:`Telegram Inline Buttons`,help:`Enable Telegram inline button components for supported command and interaction surfaces. Disable if your deployment needs plain-text-only compatibility behavior.`},execApprovals:{label:`Telegram Exec Approvals`,help:`Telegram-native exec approval routing and approver authorization. When unset, OpenClaw auto-enables DM-first native approvals if approvers can be resolved for the selected bot account.`},"execApprovals.enabled":{label:`Telegram Exec Approvals Enabled`,help:`Controls Telegram native exec approvals for this account: unset or "auto" enables DM-first native approvals when approvers can be resolved, true forces native approvals on, and false disables them.`},"execApprovals.approvers":{label:`Telegram Exec Approval Approvers`,help:`Telegram user IDs allowed to approve exec requests for this bot account. Use numeric Telegram user IDs. If you leave this unset, OpenClaw falls back to numeric owner IDs inferred from channels.telegram.allowFrom and direct-message defaultTo when possible.`},"execApprovals.agentFilter":{label:`Telegram Exec Approval Agent Filter`,help:'Optional allowlist of agent IDs eligible for Telegram exec approvals, for example `["main", "ops-agent"]`. Use this to keep approval prompts scoped to the agents you actually operate from Telegram.'},"execApprovals.sessionFilter":{label:`Telegram Exec Approval Session Filter`,help:`Optional session-key filters matched as substring or regex-style patterns before Telegram approval routing is used. Use narrow patterns so Telegram approvals only appear for intended sessions.`},"execApprovals.target":{label:`Telegram Exec Approval Target`,help:`Controls where Telegram approval prompts are sent: "dm" sends to approver DMs (default), "channel" sends to the originating Telegram chat/topic, and "both" sends to both. Channel delivery exposes the command text to the chat, so only use it in trusted groups/topics.`},"threadBindings.enabled":{label:`Telegram Thread Binding Enabled`,help:`Enable Telegram conversation binding features (/focus, /unfocus, /agents, and /session idle|max-age). Overrides session.threadBindings.enabled when set.`},"threadBindings.idleHours":{label:`Telegram Thread Binding Idle Timeout (hours)`,help:`Inactivity window in hours for Telegram bound sessions. Set 0 to disable idle auto-unfocus (default: 24). Overrides session.threadBindings.idleHours when set.`},"threadBindings.maxAgeHours":{label:`Telegram Thread Binding Max Age (hours)`,help:`Optional hard max age in hours for Telegram bound sessions. Set 0 to disable hard cap (default: 0). Overrides session.threadBindings.maxAgeHours when set.`},"threadBindings.spawnSubagentSessions":{label:`Telegram Thread-Bound Subagent Spawn`,help:`Allow subagent spawns with thread=true to auto-bind Telegram current conversations when supported.`},"threadBindings.spawnAcpSessions":{label:`Telegram Thread-Bound ACP Spawn`,help:`Allow ACP spawns with thread=true to auto-bind Telegram current conversations when supported.`}}},{pluginId:`tlon`,channelId:`tlon`,label:`Tlon`,description:`decentralized messaging on Urbit; install the plugin to enable.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},ship:{type:`string`,minLength:1},url:{type:`string`},code:{type:`string`},network:{type:`object`,properties:{dangerouslyAllowPrivateNetwork:{type:`boolean`}},additionalProperties:!1},groupChannels:{type:`array`,items:{type:`string`,minLength:1}},dmAllowlist:{type:`array`,items:{type:`string`,minLength:1}},autoDiscoverChannels:{type:`boolean`},showModelSignature:{type:`boolean`},responsePrefix:{type:`string`},autoAcceptDmInvites:{type:`boolean`},autoAcceptGroupInvites:{type:`boolean`},ownerShip:{type:`string`,minLength:1},authorization:{type:`object`,properties:{channelRules:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{mode:{type:`string`,enum:[`restricted`,`open`]},allowedShips:{type:`array`,items:{type:`string`,minLength:1}}},additionalProperties:!1}}},additionalProperties:!1},defaultAuthorizedShips:{type:`array`,items:{type:`string`,minLength:1}},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},ship:{type:`string`,minLength:1},url:{type:`string`},code:{type:`string`},network:{type:`object`,properties:{dangerouslyAllowPrivateNetwork:{type:`boolean`}},additionalProperties:!1},groupChannels:{type:`array`,items:{type:`string`,minLength:1}},dmAllowlist:{type:`array`,items:{type:`string`,minLength:1}},autoDiscoverChannels:{type:`boolean`},showModelSignature:{type:`boolean`},responsePrefix:{type:`string`},autoAcceptDmInvites:{type:`boolean`},autoAcceptGroupInvites:{type:`boolean`},ownerShip:{type:`string`,minLength:1}},additionalProperties:!1}}},additionalProperties:!1}},{pluginId:`twitch`,channelId:`twitch`,label:`Twitch`,description:`Twitch chat integration`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,anyOf:[{allOf:[{type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1}},additionalProperties:!1},{type:`object`,properties:{username:{type:`string`},accessToken:{type:`string`},clientId:{type:`string`},channel:{type:`string`,minLength:1},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{type:`string`}},allowedRoles:{type:`array`,items:{type:`string`,enum:[`moderator`,`owner`,`vip`,`subscriber`,`all`]}},requireMention:{type:`boolean`},responsePrefix:{type:`string`},clientSecret:{type:`string`},refreshToken:{type:`string`},expiresIn:{anyOf:[{type:`number`},{type:`null`}]},obtainmentTimestamp:{type:`number`}},required:[`username`,`accessToken`,`channel`],additionalProperties:!1}]},{allOf:[{type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1}},additionalProperties:!1},{type:`object`,properties:{accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{username:{type:`string`},accessToken:{type:`string`},clientId:{type:`string`},channel:{type:`string`,minLength:1},enabled:{type:`boolean`},allowFrom:{type:`array`,items:{type:`string`}},allowedRoles:{type:`array`,items:{type:`string`,enum:[`moderator`,`owner`,`vip`,`subscriber`,`all`]}},requireMention:{type:`boolean`},responsePrefix:{type:`string`},clientSecret:{type:`string`},refreshToken:{type:`string`},expiresIn:{anyOf:[{type:`number`},{type:`null`}]},obtainmentTimestamp:{type:`number`}},required:[`username`,`accessToken`,`channel`],additionalProperties:!1}}},required:[`accounts`],additionalProperties:!1}]}]}},{pluginId:`whatsapp`,channelId:`whatsapp`,label:`WhatsApp`,description:`works with your own number; recommend a separate phone + eSIM.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{enabled:{type:`boolean`},capabilities:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},configWrites:{type:`boolean`},sendReadReceipts:{type:`boolean`},messagePrefix:{type:`string`},responsePrefix:{type:`string`},dmPolicy:{default:`pairing`,type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},selfChatMode:{type:`boolean`},allowFrom:{type:`array`,items:{type:`string`}},defaultTo:{type:`string`},groupAllowFrom:{type:`array`,items:{type:`string`}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},systemPrompt:{type:`string`}},additionalProperties:!1}},direct:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{systemPrompt:{type:`string`}},additionalProperties:!1}},ackReaction:{type:`object`,properties:{emoji:{type:`string`},direct:{default:!0,type:`boolean`},group:{default:`mentions`,type:`string`,enum:[`always`,`mentions`,`never`]}},required:[`direct`,`group`],additionalProperties:!1},reactionLevel:{type:`string`,enum:[`off`,`ack`,`minimal`,`extensive`]},debounceMs:{default:0,type:`integer`,minimum:0,maximum:9007199254740991},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},accounts:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},capabilities:{type:`array`,items:{type:`string`}},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},configWrites:{type:`boolean`},sendReadReceipts:{type:`boolean`},messagePrefix:{type:`string`},responsePrefix:{type:`string`},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},selfChatMode:{type:`boolean`},allowFrom:{type:`array`,items:{type:`string`}},defaultTo:{type:`string`},groupAllowFrom:{type:`array`,items:{type:`string`}},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},contextVisibility:{type:`string`,enum:[`all`,`allowlist`,`allowlist_quote`]},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dmHistoryLimit:{type:`integer`,minimum:0,maximum:9007199254740991},dms:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1}},textChunkLimit:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},chunkMode:{type:`string`,enum:[`length`,`newline`]},blockStreaming:{type:`boolean`},blockStreamingCoalesce:{type:`object`,properties:{minChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},maxChars:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},idleMs:{type:`integer`,minimum:0,maximum:9007199254740991}},additionalProperties:!1},groups:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1},toolsBySender:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},systemPrompt:{type:`string`}},additionalProperties:!1}},direct:{type:`object`,propertyNames:{type:`string`},additionalProperties:{type:`object`,properties:{systemPrompt:{type:`string`}},additionalProperties:!1}},ackReaction:{type:`object`,properties:{emoji:{type:`string`},direct:{default:!0,type:`boolean`},group:{default:`mentions`,type:`string`,enum:[`always`,`mentions`,`never`]}},required:[`direct`,`group`],additionalProperties:!1},reactionLevel:{type:`string`,enum:[`off`,`ack`,`minimal`,`extensive`]},debounceMs:{type:`integer`,minimum:0,maximum:9007199254740991},replyToMode:{anyOf:[{type:`string`,const:`off`},{type:`string`,const:`first`},{type:`string`,const:`all`},{type:`string`,const:`batched`}]},heartbeat:{type:`object`,properties:{showOk:{type:`boolean`},showAlerts:{type:`boolean`},useIndicator:{type:`boolean`}},additionalProperties:!1},healthMonitor:{type:`object`,properties:{enabled:{type:`boolean`}},additionalProperties:!1},name:{type:`string`},authDir:{type:`string`},mediaMaxMb:{type:`integer`,exclusiveMinimum:0,maximum:9007199254740991}},additionalProperties:!1}},defaultAccount:{type:`string`},mediaMaxMb:{default:50,type:`integer`,exclusiveMinimum:0,maximum:9007199254740991},actions:{type:`object`,properties:{reactions:{type:`boolean`},sendMessage:{type:`boolean`},polls:{type:`boolean`}},additionalProperties:!1}},required:[`dmPolicy`,`groupPolicy`,`debounceMs`,`mediaMaxMb`],additionalProperties:!1},uiHints:{"":{label:`WhatsApp`,help:`WhatsApp channel provider configuration for access policy and message batching behavior. Use this section to tune responsiveness and direct-message routing safety for WhatsApp chats.`},dmPolicy:{label:`WhatsApp DM Policy`,help:`Direct message access control ("pairing" recommended). "open" requires channels.whatsapp.allowFrom=["*"].`},selfChatMode:{label:`WhatsApp Self-Phone Mode`,help:`Same-phone setup (bot uses your personal WhatsApp number).`},debounceMs:{label:`WhatsApp Message Debounce (ms)`,help:`Debounce window (ms) for batching rapid consecutive messages from the same sender (0 to disable).`},configWrites:{label:`WhatsApp Config Writes`,help:`Allow WhatsApp to write config in response to channel events/commands (default: true).`}},unsupportedSecretRefSurfacePatterns:[`channels.whatsapp.accounts.*.creds.json`,`channels.whatsapp.creds.json`]},{pluginId:`zalo`,channelId:`zalo`,label:`Zalo`,description:`Vietnam-focused messaging platform with Bot API.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},botToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},tokenFile:{type:`string`},webhookUrl:{type:`string`},webhookSecret:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},webhookPath:{type:`string`},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},mediaMaxMb:{type:`number`},proxy:{type:`string`},responsePrefix:{type:`string`},accounts:{type:`object`,properties:{},additionalProperties:{type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},botToken:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},tokenFile:{type:`string`},webhookUrl:{type:`string`},webhookSecret:{anyOf:[{type:`string`},{oneOf:[{type:`object`,properties:{source:{type:`string`,const:`env`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`,pattern:`^[A-Z][A-Z0-9_]{0,127}$`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`file`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1},{type:`object`,properties:{source:{type:`string`,const:`exec`},provider:{type:`string`,pattern:`^[a-z][a-z0-9_-]{0,63}$`},id:{type:`string`}},required:[`source`,`provider`,`id`],additionalProperties:!1}]}]},webhookPath:{type:`string`},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{type:`string`,enum:[`open`,`disabled`,`allowlist`]},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},mediaMaxMb:{type:`number`},proxy:{type:`string`},responsePrefix:{type:`string`}},additionalProperties:!1}},defaultAccount:{type:`string`}},additionalProperties:!1}},{pluginId:`zalouser`,channelId:`zalouser`,label:`Zalo Personal`,description:`Zalo personal account via QR code login.`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},profile:{type:`string`},dangerouslyAllowNameMatching:{type:`boolean`},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},groups:{type:`object`,properties:{},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},additionalProperties:!1}},messagePrefix:{type:`string`},responsePrefix:{type:`string`},accounts:{type:`object`,properties:{},additionalProperties:{type:`object`,properties:{name:{type:`string`},enabled:{type:`boolean`},markdown:{type:`object`,properties:{tables:{type:`string`,enum:[`off`,`bullets`,`code`,`block`]}},additionalProperties:!1},profile:{type:`string`},dangerouslyAllowNameMatching:{type:`boolean`},dmPolicy:{type:`string`,enum:[`pairing`,`allowlist`,`open`,`disabled`]},allowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},historyLimit:{type:`integer`,minimum:0,maximum:9007199254740991},groupAllowFrom:{type:`array`,items:{anyOf:[{type:`string`},{type:`number`}]}},groupPolicy:{default:`allowlist`,type:`string`,enum:[`open`,`disabled`,`allowlist`]},groups:{type:`object`,properties:{},additionalProperties:{type:`object`,properties:{enabled:{type:`boolean`},requireMention:{type:`boolean`},tools:{type:`object`,properties:{allow:{type:`array`,items:{type:`string`}},alsoAllow:{type:`array`,items:{type:`string`}},deny:{type:`array`,items:{type:`string`}}},additionalProperties:!1}},additionalProperties:!1}},messagePrefix:{type:`string`},responsePrefix:{type:`string`}},required:[`groupPolicy`],additionalProperties:!1}},defaultAccount:{type:`string`}},required:[`groupPolicy`],additionalProperties:!1}}],em=[`commands.ownerDisplaySecret`,`hooks.token`,`hooks.gmail.pushToken`,`hooks.mappings[].sessionKey`,`auth-profiles.oauth.*`],tm=[`commands.ownerDisplaySecret`,`hooks.token`,`hooks.gmail.pushToken`,`hooks.mappings[].sessionKey`],nm=[...new Set($p.flatMap(e=>`unsupportedSecretRefSurfacePatterns`in e?e.unsupportedSecretRefSurfacePatterns??[]:[]))];[...em,...nm];const rm=[...tm,...nm],im=new Map;function am(e){let t=im.get(e);if(t)return t;let n=e.split(`.`).filter(e=>e.length>0).map(e=>e===`*`?{kind:`wildcard`}:e.endsWith(`[]`)?{kind:`array`,key:e.slice(0,-2)}:{kind:`key`,key:e});return im.set(e,n),n}function om(e){if(e.tokenIndex>=e.tokens.length){e.candidates.push({path:e.pathSegments.join(`.`),value:e.current});return}let t=e.tokens[e.tokenIndex];if(t){if(t.kind===`wildcard`){if(Array.isArray(e.current)){for(let[t,n]of e.current.entries())om({...e,current:n,tokenIndex:e.tokenIndex+1,pathSegments:[...e.pathSegments,String(t)]});return}if(!h(e.current))return;for(let[t,n]of Object.entries(e.current))om({...e,current:n,tokenIndex:e.tokenIndex+1,pathSegments:[...e.pathSegments,t]});return}if(h(e.current)){if(t.kind===`array`){if(!Object.hasOwn(e.current,t.key))return;let n=e.current[t.key];if(!Array.isArray(n))return;for(let[r,i]of n.entries())om({...e,current:i,tokenIndex:e.tokenIndex+1,pathSegments:[...e.pathSegments,t.key,String(r)]});return}Object.hasOwn(e.current,t.key)&&om({...e,current:e.current[t.key],tokenIndex:e.tokenIndex+1,pathSegments:[...e.pathSegments,t.key]})}}}function sm(e){if(!h(e))return[];let t=[];for(let n of rm)om({current:e,tokens:am(n),tokenIndex:0,pathSegments:[],candidates:t});return t}const cm={config:0,workspace:1,global:2,bundled:3};function lm(e){let t=new Map;for(let n of e.plugins){let e=cm[n.origin]??2**53-1,r=n.channelCatalogMeta?.label,i=n.channelCatalogMeta?.blurb;for(let a of n.channels){let n=t.get(a);(!n||e<=n.originRank)&&t.set(a,{id:a,label:r??n?.label,description:i??n?.description,configSchema:n?.configSchema,configUiHints:n?.configUiHints,originRank:e})}for(let[a,o]of Object.entries(n.channelConfigs??{})){let n=t.get(a);n&&n.originRank<e&&(n.configSchema!==void 0||n.configUiHints!==void 0)||t.set(a,{id:a,label:o.label??r??n?.label,description:o.description??i??n?.description,configSchema:o.schema,configUiHints:o.uiHints,originRank:e})}}return[...t.values()].toSorted((e,t)=>e.id.localeCompare(t.id)).map(({originRank:e,...t})=>t)}const um=new Set([`google-antigravity-auth`,`google-gemini-cli-auth`]),dm=/expected one of ((?:"[^"]+"(?:\|"?[^"]+"?)*)+)/i,fm=new Map($p.map(e=>[e.channelId,e.schema]));function pm(e){return!e||typeof e!=`object`?null:e}function mm(e){return Array.isArray(e)?e.filter(e=>{let t=typeof e;return t===`string`||t===`number`}):[]}function hm(e){return e.join(`.`)}function gm(e){return e&&typeof e==`object`?e:null}function _m(e,t){let n=gm(e);for(let e of t){if(!n)return null;if(typeof e==`number`){let t=n.items;if(Array.isArray(t)){n=gm(t[e]??t[0]);continue}n=gm(t);continue}let t=gm(n.properties);n=t&&gm(t[e])||gm(n.additionalProperties)}return n}function vm(e){let t=gm(e);if(!t)return{values:[],incomplete:!1,hasValues:!1};if(Object.prototype.hasOwnProperty.call(t,`const`))return{values:[t.const],incomplete:!1,hasValues:!0};if(Array.isArray(t.enum))return{values:t.enum,incomplete:!1,hasValues:t.enum.length>0};let n=t.type;if(n===`boolean`||Array.isArray(n)&&n.includes(`boolean`))return{values:[!0,!1],incomplete:!1,hasValues:!0};let r=Array.isArray(t.anyOf)?t.anyOf:Array.isArray(t.oneOf)?t.oneOf:null;if(!r)return{values:[],incomplete:!1,hasValues:!1};let i=[];for(let e of r){let t=vm(e);if(t.incomplete||!t.hasValues)return{values:[],incomplete:!0,hasValues:!1};i.push(...t.values)}return{values:i,incomplete:!1,hasValues:i.length>0}}function ym(e){if(e[0]!==`channels`||typeof e[1]!=`string`)return{values:[],incomplete:!1,hasValues:!1};let t=fm.get(e[1]);if(!t)return{values:[],incomplete:!1,hasValues:!1};let n=_m(t,e.slice(2));return n?vm(n):{values:[],incomplete:!1,hasValues:!1}}function bm(e){let t=(typeof e.message==`string`?e.message:``).match(dm);if(t?.[1]){let e=[...t[1].matchAll(/"([^"]+)"/g)].map(e=>e[1]);return{values:e,incomplete:!1,hasValues:e.length>0}}return ym(mm(e.path))}function xm(e){let t=pm(e);if(!t)return{values:[],incomplete:!1,hasValues:!1};let n=typeof t.code==`string`?t.code:``;if(n===`invalid_value`){let e=t.values;return Array.isArray(e)?{values:e,incomplete:!1,hasValues:e.length>0}:{values:[],incomplete:!0,hasValues:!1}}if(n===`invalid_type`)return(typeof t.expected==`string`?t.expected:``)===`boolean`?{values:[!0,!1],incomplete:!1,hasValues:!0}:{values:[],incomplete:!0,hasValues:!1};if(n===`custom`)return bm(t);if(n!==`invalid_union`)return{values:[],incomplete:!1,hasValues:!1};let r=t.errors;if(!Array.isArray(r)||r.length===0)return{values:[],incomplete:!0,hasValues:!1};let i=[];for(let e of r){if(!Array.isArray(e)||e.length===0)return{values:[],incomplete:!0,hasValues:!1};let t=Sm(e);if(t.incomplete||!t.hasValues)return{values:[],incomplete:!0,hasValues:!1};i.push(...t.values)}return{values:i,incomplete:!1,hasValues:i.length>0}}function Sm(e){let t=[],n=!1;for(let r of e){let e=xm(r);if(e.incomplete)return{values:[],incomplete:!0,hasValues:!1};e.hasValues&&(n=!0,t.push(...e.values))}return{values:t,incomplete:!1,hasValues:n}}function Cm(e){let t=xm(e);return t.incomplete||!t.hasValues?[]:t.values}function wm(e){return e[0]===`bindings`&&typeof e[1]==`number`}function Tm(e){let t=mm(e.path);return t.length!==1||t[0]!==`type`||e.code!==`invalid_value`||!Array.isArray(e.values)?!1:e.values.includes(`route`)}function Em(e,t){if(!wm(mm(e.path))||!Array.isArray(e.errors))return null;let n=null,r=!1,i=-1,a=!1;for(let t of e.errors){if(!Array.isArray(t))continue;let e=t.map(e=>pm(e)).filter(Boolean);if(e.length===0)continue;if(e.some(e=>Tm(e))){a=!0;continue}let o=null,s=!1,c=-1;for(let t of e){let e=typeof t.code==`string`?t.code:``,n=mm(t.path).length,r=e===`unrecognized_keys`;(n>c||n===c&&r&&!s)&&(o=t,s=r,c=n)}if(o){if(n)return null;n=o,r=s,i=c}}if(!a||!n||i===0&&!r)return null;let o=hm(mm(n.path));return{path:t&&o?`${t}.${o}`:t||o,message:typeof n.message==`string`?n.message:`Invalid input`}}function Dm(e){return!e||typeof e!=`object`||Array.isArray(e)?!1:Ae(e)!==null}function Om(e){return[`SecretRef objects are not supported at ${e}.`,`This credential is runtime-mutable or runtime-managed and must stay a plain string value.`,'Use a plain string (env template strings like "${MY_VAR}" are allowed).',`See https://docs.openclaw.ai/reference/secretref-credential-surface.`].join(` `)}function km(e,t,n){Dm(n)&&e.push({path:t,message:Om(t)})}function Am(e){let t=[];for(let n of sm(e))km(t,n.path,n.value);return t}function jm(e){let{issue:t,policyIssue:n}=e;if(t.path===n.path)return/expected string, received object/i.test(t.message);if(!t.path||!n.path||!n.path.startsWith(`${t.path}.`))return!1;let r=n.path.slice(t.path.length+1).split(`.`)[0];if(!r||!/Unrecognized key/i.test(t.message))return!1;let i=[...t.message.matchAll(/"([^"]+)"/g)].map(e=>e[1]);return i.length===0?!1:i.length===1&&i[0]===r}function Mm(e,t){if(e.length===0)return t;let n=t.filter(t=>!e.some(e=>jm({issue:t,policyIssue:e})));return[...e,...n]}function Nm(e){return Am(e)}function Pm(e){let t=pm(e),n=hm(mm(t?.path)),r=typeof t?.message==`string`?t.message:`Invalid input`,i=tt(Cm(e));if(t&&typeof t.code==`string`&&t.code===`invalid_union`&&!i){let e=Em(t,n);if(e)return e}return i?{path:n,message:Qe(r,i),allowedValues:i.values,allowedValuesHiddenCount:i.hiddenCount}:{path:n,message:r}}function Fm(e,t){let n=I.resolve(t);return Ra(n,I.resolve(n,e))}function Im(e){let t=e.agents?.list;if(!Array.isArray(t)||t.length===0)return[];let n=[];for(let[r,i]of t.entries()){if(!i||typeof i!=`object`)continue;let t=i.identity?.avatar;if(typeof t!=`string`)continue;let a=t.trim();if(a&&!(Pa(a)||Fa(a))){if(a.startsWith(`~`)){n.push({path:`agents.list.${r}.identity.avatar`,message:`identity.avatar must be a workspace-relative path, http(s) URL, or data URI.`});continue}if(Ia(a)&&!La(a)){n.push({path:`agents.list.${r}.identity.avatar`,message:`identity.avatar must be a workspace-relative path, http(s) URL, or data URI.`});continue}Fm(a,Xe(e,i.id??Ze(e)))||n.push({path:`agents.list.${r}.identity.avatar`,message:`identity.avatar must stay within the agent workspace.`})}}return n}function Lm(e){let t=e.gateway?.tailscale?.mode??`off`;if(t!==`serve`&&t!==`funnel`)return[];let n=e.gateway?.bind??`loopback`;if(n===`loopback`)return[];let r=e.gateway?.customBindHost;return n===`custom`&&yn(r)&&xn(r)?[]:[{path:`gateway.bind`,message:`gateway.bind must resolve to loopback when gateway.tailscale.mode=${t} (use gateway.bind="loopback" or gateway.bind="custom" with gateway.customBindHost="127.0.0.1")`}]}function Rm(e,t){let n=Nm(e),r=Ip(e,e,Yn({pluginIds:t?.touchedPaths?Gn({raw:e,touchedPaths:t.touchedPaths}):Wn(e)}),t?.touchedPaths);if(r.length>0)return{ok:!1,issues:r.map(e=>({path:e.path,message:e.message}))};let i=ol.safeParse(e);if(!i.success)return{ok:!1,issues:Mm(n,i.error.issues.map(e=>Pm(e)))};if(n.length>0)return{ok:!1,issues:n};let a=i.data,o=Qd(a);if(o.length>0)return{ok:!1,issues:[{path:`agents.list`,message:$d(o)}]};let s=Im(a);if(s.length>0)return{ok:!1,issues:s};let c=Lm(a);return c.length>0?{ok:!1,issues:c}:{ok:!0,config:a}}function zm(e){let t=Rm(e);return t.ok?{ok:!0,config:qp(t.config,`snapshot`)}:t}function Bm(e,t){return Hm(e,{applyDefaults:!0,env:t?.env})}function Vm(e,t){return Hm(e,{applyDefaults:!1,env:t?.env})}function Hm(e,t){let n=t.applyDefaults?zm(e):Rm(e);if(!n.ok)return{ok:!1,issues:n.issues,warnings:[]};let r=n.config,a=[],o=[],s=h(e)&&Object.prototype.hasOwnProperty.call(e,`plugins`),c=(e,t)=>{let n=`plugins.entries.${e}.config`;return!t||t===`<root>`?n:`${n}.${t}`},l=null,u,d=null,f=!1,p=()=>{if(f)return d??new Set;f=!0;let e=r.plugins?.allow;if(!Array.isArray(e)||e.length===0)return d=new Set,d;let n=Xe(r,Ze(r)),i=new Set(P({config:r,workspaceDir:n??void 0,env:t.env}).diagnostics.filter(e=>e.message.includes(`duplicate plugin id detected`)).map(e=>e.pluginId).filter(e=>typeof e==`string`&&e!==``));return d=new Set(He({contract:`webSearchProviders`,origin:`bundled`,config:r,workspaceDir:n??void 0,env:t.env}).filter(e=>!i.has(e))),d},m=()=>{if(u!==void 0)return u??r;let e=r.plugins?.allow;return!Array.isArray(e)||e.length===0?(u=r,r):(u=De({config:r,pluginIds:[...p()]}),u??r)},g=()=>{if(l)return l;let e=m(),n=P({config:e,workspaceDir:Xe(e,Ze(e))??void 0,env:t.env});for(let e of n.diagnostics){let t=e.pluginId?`plugins.entries.${e.pluginId}`:`plugins`;!e.pluginId&&e.message.includes(`plugin path not found`)&&(t=`plugins.load.paths`);let n=`${e.pluginId?`plugin ${e.pluginId}`:`plugin`}: ${e.message}`;e.level===`error`?a.push({path:t,message:n}):o.push({path:t,message:n})}return l={registry:n},l},y=()=>{let e=g();return e.knownIds||=new Set(e.registry.plugins.map(e=>e.id)),e.knownIds},ee=()=>{let e=g();return e.overriddenPluginIds||=new Set(e.registry.diagnostics.filter(e=>e.message.includes(`duplicate plugin id detected`)).map(e=>e.pluginId).filter(e=>typeof e==`string`&&e!==``)),e.overriddenPluginIds},te=()=>{let e=g();return e.normalizedPlugins||=fe(m().plugins),e.normalizedPlugins},ne=()=>{let e=g();if(!e.channelSchemas){e.channelSchemas=new Map($p.map(e=>[e.channelId,{schema:e.schema}]));for(let t of lm(e.registry)){let n=e.channelSchemas.get(t.id);if(t.configSchema){e.channelSchemas.set(t.id,{schema:t.configSchema});continue}n||e.channelSchemas.set(t.id,{})}}return e.channelSchemas},b=r,re=!1,ie=!1,ae=!1,x=(e,t)=>{re||=(b={...b,channels:{...b.channels}},!0),b.channels[e]=t},S=(e,t)=>{ie||=(b={...b,plugins:{...b.plugins}},!0),ae||=(b.plugins={...b.plugins,entries:{...b.plugins?.entries}},!0);let n=b.plugins?.entries?.[e];b.plugins.entries[e]={...n,config:t}},oe=new Set([`defaults`,`modelByChannel`,...v]);if(r.channels&&h(r.channels))for(let e of Object.keys(r.channels)){let t=e.trim();if(!t)continue;if(!oe.has(t)){let{registry:e}=g();for(let t of e.plugins)for(let e of t.channels)oe.add(e)}if(!oe.has(t)){a.push({path:`channels.${t}`,message:`unknown channel id: ${t}`});continue}let n=ne().get(t)?.schema;if(!n)continue;let i=rt({schema:n,cacheKey:`channel:${t}`,value:r.channels[t],applyDefaults:!0});if(!i.ok){for(let e of i.errors)a.push({path:e.path===`<root>`?`channels.${t}`:`channels.${t}.${e.path}`,message:`invalid config: ${e.message}`,allowedValues:e.allowedValues,allowedValuesHiddenCount:e.allowedValuesHiddenCount});continue}x(t,i.value)}let C=new Set;for(let e of v)C.add(i(e));let w=(e,t)=>{if(typeof e!=`string`)return;let n=e.trim();if(!n){a.push({path:t,message:`heartbeat target must not be empty`});return}let r=i(n);if(!(r===`last`||r===`none`)&&!_(n)){if(!C.has(r)){let{registry:e}=g();for(let t of e.plugins)for(let e of t.channels){let t=e.trim();t&&C.add(i(t))}}C.has(r)||a.push({path:t,message:`unknown heartbeat target: ${e}`})}};if(w(r.agents?.defaults?.heartbeat?.target,`agents.defaults.heartbeat.target`),Array.isArray(r.agents?.list))for(let[e,t]of r.agents.list.entries())w(t?.heartbeat?.target,`agents.list.${e}.heartbeat.target`);if(!s)return a.length>0?{ok:!1,issues:a,warnings:o}:{ok:!0,config:b,warnings:o};let{registry:se}=g(),T=y(),ce=te(),le=m(),ue=(e,t,n)=>{if(um.has(t)){o.push({path:e,message:`plugin removed: ${t} (stale config entry ignored; remove it from plugins config)`});return}if(n?.warnOnly){o.push({path:e,message:`plugin not found: ${t} (stale config entry ignored; remove it from plugins config)`});return}a.push({path:e,message:`plugin not found: ${t}`})},de=r.plugins,E=de?.entries;if(E&&h(E))for(let e of Object.keys(E))T.has(e)||ue(`plugins.entries.${e}`,e,{warnOnly:!0});let me=de?.allow??[];for(let e of me)if(!(typeof e!=`string`||!e.trim())&&!T.has(e)){let t=ka({command:e,registry:se});t?.pluginId&&T.has(t.pluginId)?o.push({path:`plugins.allow`,message:`"${e}" is not a plugin — it is a command provided by the "${t.pluginId}" plugin. Use "${t.pluginId}" in plugins.allow instead.`}):ue(`plugins.allow`,e,{warnOnly:!0})}let D=de?.deny??[];for(let e of D)typeof e!=`string`||!e.trim()||T.has(e)||ue(`plugins.deny`,e);let he=de?.slots,ge=he!==void 0&&Object.prototype.hasOwnProperty.call(he,`memory`),_e=ce.slots.memory;ge&&typeof _e==`string`&&_e.trim()&&!T.has(_e)&&ue(`plugins.slots.memory`,_e);let O=null,ve=new Set;for(let e of se.plugins){let n=e.id;if(ve.has(n))continue;ve.add(n);let r=ce.entries[n],i=!!r?.config,s=je({id:n,origin:e.origin,config:ce,rootConfig:le}),l=s.activated,u=s.reason;if(l){let t=pe({id:n,kind:e.kind,slot:_e,selectedId:O});t.enabled||(l=!1,u=t.reason),t.selected&&Be(e.kind,`memory`)&&(O=n)}let d=i||t.applyDefaults&&l;if(l||i)if(e.configSchema){let t=rt({schema:e.configSchema,cacheKey:e.schemaCacheKey??e.manifestPath??n,value:r?.config??{},applyDefaults:!0});if(t.ok)d&&S(n,t.value);else for(let e of t.errors)a.push({path:c(n,e.path),message:`invalid config: ${e.message}`,allowedValues:e.allowedValues,allowedValuesHiddenCount:e.allowedValuesHiddenCount})}else e.format===`bundle`||a.push({path:`plugins.entries.${n}`,message:`plugin schema missing for ${n}`});let f=p().has(n)&&!ee().has(n);!l&&i&&!f&&o.push({path:`plugins.entries.${n}`,message:`plugin disabled (${u??`disabled`}) but config is present`})}return a.length>0?{ok:!1,issues:a,warnings:o}:{ok:!0,config:b,warnings:o}}const Um=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/;function Wm(e){if(!e)return null;let t=sl(e.trim()).match(Um);if(!t)return null;let[,n,r,i,a]=t,o=a&&/^[0-9]+$/.test(a)?Number.parseInt(a,10):null;return{major:Number.parseInt(n,10),minor:Number.parseInt(r,10),patch:Number.parseInt(i,10),revision:o,prerelease:a&&o==null?a.split(`.`).filter(Boolean):null}}function Gm(e,t){let n=Wm(e),r=Wm(t);return!n||!r||n.prerelease?.length||r.prerelease?.length?!1:n.major===r.major&&n.minor===r.minor&&n.patch===r.patch}function Km(e,t){let n=Wm(e),r=Wm(t);if(!n||!r)return null;if(n.major!==r.major)return n.major<r.major?-1:1;if(n.minor!==r.minor)return n.minor<r.minor?-1:1;if(n.patch!==r.patch)return n.patch<r.patch?-1:1;let i=Jm(n),a=Jm(r);return i===a?n.revision!=null&&r.revision!=null&&n.revision!==r.revision?n.revision<r.revision?-1:1:n.prerelease||r.prerelease?cl(n.prerelease,r.prerelease):0:i<a?-1:1}function qm(e,t){let n=Wm(e),r=Wm(t);if(n&&r&&n.major===r.major&&n.minor===r.minor&&n.patch===r.patch&&r.revision!=null||Gm(e,t))return!1;let i=Km(e,t);return i!==null&&i<0}function Jm(e){return e.prerelease?.length?0:e.revision==null?1:2}const Ym=new Set;function Z(e){return ft.createHash(`sha256`).update(e??``).digest(`hex`)}async function Xm(e){if(process.platform===`win32`)return;let t=s(e.env,e.homedir),n=I.dirname(e.configPath);if(I.resolve(n)===I.resolve(t))try{if(!((await e.fsModule.promises.stat(n)).mode&63))return;await e.fsModule.promises.chmod(n,448)}catch{}}function Zm(e){if(typeof e.hash==`string`){let t=e.hash.trim();if(t)return t}return typeof e.raw==`string`?Z(e.raw):null}function Q(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:e}function Qm(e){if(!h(e))return!1;let t=e.meta;return h(t)}function $m(e){if(!h(e))return null;let t=e.gateway;if(!h(t)||typeof t.mode!=`string`)return null;let n=t.mode.trim();return n.length>0?n:null}function eh(e,t,n){if(typeof e==`string`){Yt(e)&&n.set(t,e);return}if(Array.isArray(e)){e.forEach((e,r)=>{eh(e,`${t}[${r}]`,n)});return}if(h(e))for(let[r,i]of Object.entries(e))eh(i,t?`${t}.${r}`:r,n)}function th(e,t){return I.join(s(e,t),`logs`,`config-health.json`)}function nh(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function rh(e){return typeof e==`bigint`?e.toString():typeof e==`number`&&Number.isFinite(e)?String(e):null}function ih(e){return{dev:rh(e?.dev??null),ino:rh(e?.ino??null),mode:nh(e?e.mode&511:null),nlink:nh(e?.nlink??null),uid:nh(e?.uid??null),gid:nh(e?.gid??null)}}function ah(e){let t=[];return e.existsBefore?(typeof e.previousBytes==`number`&&typeof e.nextBytes==`number`&&e.previousBytes>=512&&e.nextBytes<Math.floor(e.previousBytes*.5)&&t.push(`size-drop:${e.previousBytes}->${e.nextBytes}`),e.hasMetaBefore||t.push(`missing-meta-before-write`),e.gatewayModeBefore&&!e.gatewayModeAfter&&t.push(`gateway-mode-removed`),t):t}function oh(e){return e.filter(e=>e.startsWith(`size-drop:`)||e===`gateway-mode-removed`)}async function sh(e){try{let t=th(e.env,e.homedir),n=await e.fs.promises.readFile(t,`utf-8`),r=JSON.parse(n);return h(r)?r:{}}catch{return{}}}function ch(e){try{let t=th(e.env,e.homedir),n=e.fs.readFileSync(t,`utf-8`),r=JSON.parse(n);return h(r)?r:{}}catch{return{}}}async function lh(e,t){try{let n=th(e.env,e.homedir);await e.fs.promises.mkdir(I.dirname(n),{recursive:!0,mode:448}),await e.fs.promises.writeFile(n,`${JSON.stringify(t,null,2)}\n`,{encoding:`utf-8`,mode:384})}catch{}}function uh(e,t){try{let n=th(e.env,e.homedir);e.fs.mkdirSync(I.dirname(n),{recursive:!0,mode:448}),e.fs.writeFileSync(n,`${JSON.stringify(t,null,2)}\n`,{encoding:`utf-8`,mode:384})}catch{}}function dh(e,t){let n=e.entries;if(!n||!h(n))return{};let r=n[t];return r&&h(r)?r:{}}function fh(e,t,n){return{...e,entries:{...e.entries,[t]:n}}}function ph(e){if(!h(e))return!1;let t=Object.keys(e);if(t.length!==1||t[0]!==`update`)return!1;let n=e.update;return h(n)?Object.keys(n).length===1&&typeof n.channel==`string`:!1}function mh(e){let t=[],n=e.lastKnownGood;return n?(n.bytes>=512&&e.bytes<Math.floor(n.bytes*.5)&&t.push(`size-drop-vs-last-good:${n.bytes}->${e.bytes}`),n.hasMeta&&!e.hasMeta&&t.push(`missing-meta-vs-last-good`),n.gatewayMode&&!e.gatewayMode&&t.push(`gateway-mode-missing-vs-last-good`),n.gatewayMode&&ph(e.parsed)&&t.push(`update-channel-only-root`),t):t}async function hh(e,t){try{let n=await e.fs.promises.readFile(t,`utf-8`),r=await e.fs.promises.stat(t).catch(()=>null),i=kh(n,e.json5),a=i.ok?i.parsed:{};return{hash:Z(n),bytes:Buffer.byteLength(n,`utf-8`),mtimeMs:r?.mtimeMs??null,ctimeMs:r?.ctimeMs??null,...ih(r),hasMeta:Qm(a),gatewayMode:$m(a),observedAt:new Date().toISOString()}}catch{return null}}function gh(e,t){try{let n=e.fs.readFileSync(t,`utf-8`),r=e.fs.statSync(t,{throwIfNoEntry:!1})??null,i=kh(n,e.json5),a=i.ok?i.parsed:{};return{hash:Z(n),bytes:Buffer.byteLength(n,`utf-8`),mtimeMs:r?.mtimeMs??null,ctimeMs:r?.ctimeMs??null,...ih(r),hasMeta:Qm(a),gatewayMode:$m(a),observedAt:new Date().toISOString()}}catch{return null}}function _h(e){return e.replaceAll(`:`,`-`).replaceAll(`.`,`-`)}async function vh(e){let t=`${e.configPath}.clobbered.${_h(e.observedAt)}`;try{return await e.deps.fs.promises.writeFile(t,e.raw,{encoding:`utf-8`,mode:384,flag:`wx`}),t}catch{return null}}function yh(e){let t=`${e.configPath}.clobbered.${_h(e.observedAt)}`;try{return e.deps.fs.writeFileSync(t,e.raw,{encoding:`utf-8`,mode:384,flag:`wx`}),t}catch{return null}}function bh(e,t){return e?e.hash===t.hash&&e.bytes===t.bytes&&e.mtimeMs===t.mtimeMs&&e.ctimeMs===t.ctimeMs&&e.dev===t.dev&&e.ino===t.ino&&e.mode===t.mode&&e.nlink===t.nlink&&e.uid===t.uid&&e.gid===t.gid&&e.hasMeta===t.hasMeta&&e.gatewayMode===t.gatewayMode:!1}async function xh(e,t){if(!t.exists||typeof t.raw!=`string`)return;let n=await e.fs.promises.stat(t.path).catch(()=>null),r=new Date().toISOString(),i={hash:Zm(t)??Z(t.raw),bytes:Buffer.byteLength(t.raw,`utf-8`),mtimeMs:n?.mtimeMs??null,ctimeMs:n?.ctimeMs??null,...ih(n),hasMeta:Qm(t.parsed),gatewayMode:$m(t.resolved),observedAt:r},a=await sh(e),o=dh(a,t.path),s=o.lastKnownGood??await hh(e,`${t.path}.bak`)??void 0,c=mh({bytes:i.bytes,hasMeta:i.hasMeta,gatewayMode:i.gatewayMode,parsed:t.parsed,lastKnownGood:s});if(c.length===0){if(t.valid){let n={...o,lastKnownGood:i,lastObservedSuspiciousSignature:null};(!bh(o.lastKnownGood,i)||o.lastObservedSuspiciousSignature!==null)&&(a=fh(a,t.path,n),await lh(e,a))}return}let l=`${i.hash}:${c.join(`,`)}`;if(o.lastObservedSuspiciousSignature===l)return;let u=(s?.hash?s:null)??await hh(e,`${t.path}.bak`),d=await vh({deps:e,configPath:t.path,raw:t.raw,observedAt:r});e.logger.warn(`Config observe anomaly: ${t.path} (${c.join(`, `)})`),await gf({fs:e.fs,env:e.env,homedir:e.homedir,record:{ts:r,source:`config-io`,event:`config.observe`,phase:`read`,configPath:t.path,pid:process.pid,ppid:process.ppid,cwd:process.cwd(),argv:process.argv.slice(0,8),execArgv:process.execArgv.slice(0,8),exists:!0,valid:t.valid,hash:i.hash,bytes:i.bytes,mtimeMs:i.mtimeMs,ctimeMs:i.ctimeMs,dev:i.dev,ino:i.ino,mode:i.mode,nlink:i.nlink,uid:i.uid,gid:i.gid,hasMeta:i.hasMeta,gatewayMode:i.gatewayMode,suspicious:c,lastKnownGoodHash:o.lastKnownGood?.hash??null,lastKnownGoodBytes:o.lastKnownGood?.bytes??null,lastKnownGoodMtimeMs:o.lastKnownGood?.mtimeMs??null,lastKnownGoodCtimeMs:o.lastKnownGood?.ctimeMs??null,lastKnownGoodDev:o.lastKnownGood?.dev??null,lastKnownGoodIno:o.lastKnownGood?.ino??null,lastKnownGoodMode:o.lastKnownGood?.mode??null,lastKnownGoodNlink:o.lastKnownGood?.nlink??null,lastKnownGoodUid:o.lastKnownGood?.uid??null,lastKnownGoodGid:o.lastKnownGood?.gid??null,lastKnownGoodGatewayMode:o.lastKnownGood?.gatewayMode??null,backupHash:u?.hash??null,backupBytes:u?.bytes??null,backupMtimeMs:u?.mtimeMs??null,backupCtimeMs:u?.ctimeMs??null,backupDev:u?.dev??null,backupIno:u?.ino??null,backupMode:u?.mode??null,backupNlink:u?.nlink??null,backupUid:u?.uid??null,backupGid:u?.gid??null,backupGatewayMode:u?.gatewayMode??null,clobberedPath:d,restoredFromBackup:!1,restoredBackupPath:null}}),a=fh(a,t.path,{...o,lastObservedSuspiciousSignature:l}),await lh(e,a)}function Sh(e,t){if(!t.exists||typeof t.raw!=`string`)return;let n=e.fs.statSync(t.path,{throwIfNoEntry:!1})??null,r=new Date().toISOString(),i={hash:Zm(t)??Z(t.raw),bytes:Buffer.byteLength(t.raw,`utf-8`),mtimeMs:n?.mtimeMs??null,ctimeMs:n?.ctimeMs??null,...ih(n),hasMeta:Qm(t.parsed),gatewayMode:$m(t.resolved),observedAt:r},a=ch(e),o=dh(a,t.path),s=o.lastKnownGood??gh(e,`${t.path}.bak`)??void 0,c=mh({bytes:i.bytes,hasMeta:i.hasMeta,gatewayMode:i.gatewayMode,parsed:t.parsed,lastKnownGood:s});if(c.length===0){if(t.valid){let n={...o,lastKnownGood:i,lastObservedSuspiciousSignature:null};(!bh(o.lastKnownGood,i)||o.lastObservedSuspiciousSignature!==null)&&(a=fh(a,t.path,n),uh(e,a))}return}let l=`${i.hash}:${c.join(`,`)}`;if(o.lastObservedSuspiciousSignature===l)return;let u=(s?.hash?s:null)??gh(e,`${t.path}.bak`),d=yh({deps:e,configPath:t.path,raw:t.raw,observedAt:r});e.logger.warn(`Config observe anomaly: ${t.path} (${c.join(`, `)})`),_f({fs:e.fs,env:e.env,homedir:e.homedir,record:{ts:r,source:`config-io`,event:`config.observe`,phase:`read`,configPath:t.path,pid:process.pid,ppid:process.ppid,cwd:process.cwd(),argv:process.argv.slice(0,8),execArgv:process.execArgv.slice(0,8),exists:!0,valid:t.valid,hash:i.hash,bytes:i.bytes,mtimeMs:i.mtimeMs,ctimeMs:i.ctimeMs,dev:i.dev,ino:i.ino,mode:i.mode,nlink:i.nlink,uid:i.uid,gid:i.gid,hasMeta:i.hasMeta,gatewayMode:i.gatewayMode,suspicious:c,lastKnownGoodHash:o.lastKnownGood?.hash??null,lastKnownGoodBytes:o.lastKnownGood?.bytes??null,lastKnownGoodMtimeMs:o.lastKnownGood?.mtimeMs??null,lastKnownGoodCtimeMs:o.lastKnownGood?.ctimeMs??null,lastKnownGoodDev:o.lastKnownGood?.dev??null,lastKnownGoodIno:o.lastKnownGood?.ino??null,lastKnownGoodMode:o.lastKnownGood?.mode??null,lastKnownGoodNlink:o.lastKnownGood?.nlink??null,lastKnownGoodUid:o.lastKnownGood?.uid??null,lastKnownGoodGid:o.lastKnownGood?.gid??null,lastKnownGoodGatewayMode:o.lastKnownGood?.gatewayMode??null,backupHash:u?.hash??null,backupBytes:u?.bytes??null,backupMtimeMs:u?.mtimeMs??null,backupCtimeMs:u?.ctimeMs??null,backupDev:u?.dev??null,backupIno:u?.ino??null,backupMode:u?.mode??null,backupNlink:u?.nlink??null,backupUid:u?.uid??null,backupGid:u?.gid??null,backupGatewayMode:u?.gatewayMode??null,clobberedPath:d,restoredFromBackup:!1,restoredBackupPath:null}}),a=fh(a,t.path,{...o,lastObservedSuspiciousSignature:l}),uh(e,a)}function Ch(e,t){if(!e||typeof e!=`object`)return;let n=e.gateway;!n||typeof n!=`object`||`token`in n&&t.warn(`Config uses "gateway.token". This key is ignored; use "gateway.auth.token" instead.`)}function wh(e){let t=new Date().toISOString();return{...e,meta:{...e.meta,lastTouchedVersion:Ie,lastTouchedAt:t}}}function Th(e,t){let n=e.meta?.lastTouchedVersion;n&&qm(Ie,n)&&t.warn(`Config was last written by a newer OpenClaw (${n}); current version is ${Ie}.`)}function Eh(e){return e.configPath?e.configPath:c(e.env,s(e.env,e.homedir))}function Dh(e={}){return{fs:e.fs??F,json5:e.json5??Xr.default,env:e.env??process.env,homedir:e.homedir??(()=>r(e.env??process.env,ut.homedir)),configPath:e.configPath??``,logger:e.logger??console}}function Oh(e){e===process.env&&Jr({quiet:!0})}function kh(e,t=Xr.default){try{return{ok:!0,parsed:t.parse(e)}}catch(e){return{ok:!1,error:String(e)}}}function Ah(e,t=Xr.default){if(/^\s*(?:\{|\[)/.test(e))return null;let n=0;for(;n<e.length;){let r=e.indexOf(`
6
+ `,n),i=r===-1?e.length:r+1,a=e.slice(n,i);if(/^\s*(?:\{|\[)/.test(a)){let r=e.slice(n),i=kh(r,t);return i.ok?{raw:r,parsed:i.parsed}:null}n=i}return null}async function jh(e){let t=new Date().toISOString(),n=await vh({deps:e.deps,configPath:e.configPath,raw:e.originalRaw,observedAt:t});await e.deps.fs.promises.writeFile(e.configPath,e.recoveredRaw,{encoding:`utf-8`,mode:384}),await e.deps.fs.promises.chmod?.(e.configPath,384).catch(()=>{}),e.deps.logger.warn(`Config auto-stripped non-JSON prefix: ${e.configPath}`+(n?` (original saved as ${n})`:``))}async function Mh(e){if(!e.snapshot.exists||e.snapshot.valid||typeof e.snapshot.raw!=`string`)return!1;let t=Ah(e.snapshot.raw,e.deps.json5);if(!t)return!1;let n;try{n=Nh(t.parsed,e.configPath,e.deps)}catch{return!1}return Bm(Fh(Ph(n,e.deps.env).resolvedConfigRaw,t.parsed).effectiveConfigRaw,{env:e.deps.env}).ok?(await jh({deps:e.deps,configPath:e.configPath,originalRaw:e.snapshot.raw,recoveredRaw:t.raw}),!0):!1}function Nh(e,t,n){return ii(e,t,{readFile:e=>n.fs.readFileSync(e,`utf-8`),readFileWithGuards:({includePath:e,resolvedPath:t,rootRealDir:r})=>ni({includePath:e,resolvedPath:t,rootRealDir:r,ioFs:n.fs}),parseJson:e=>n.json5.parse(e)})}function Ph(e,t){e&&typeof e==`object`&&`env`in e&&nn(e,t);let n=[];return{resolvedConfigRaw:Zt(e,t,{onMissing:e=>n.push(e)}),envSnapshotForRestore:{...t},envWarnings:n}}function Fh(e,t){let n=Ip(e,t,Yn({pluginIds:Wn(e)}));return!e||typeof e!=`object`?{effectiveConfigRaw:e,sourceLegacyIssues:n}:{effectiveConfigRaw:Td(e).next??e,sourceLegacyIssues:n}}function $(e){let t=Gp(e.sourceConfig),n=Kp(e.runtimeConfig);return{path:e.path,exists:e.exists,raw:e.raw,parsed:e.parsed,sourceConfig:t,resolved:t,valid:e.valid,runtimeConfig:n,config:n,hash:e.hash,issues:e.issues,warnings:e.warnings,legacyIssues:e.legacyIssues}}async function Ih(e,t){return await xh(e,t.snapshot),t}function Lh(e={}){let t=Dh(e),n=Eh(t);function r(e){return Sh(t,e),e}function i(e){let r=Qd(e,{env:t.env,homedir:t.homedir});if(r.length>0)throw new Jd(r);nn(e,t.env),(Wd(t.env)||e.env?.shellEnv?.enabled===!0)&&!Gd(t.env)&&Ud({enabled:!0,env:t.env,expectedKeys:Qp(t.env),logger:t.logger,timeoutMs:e.env?.shellEnv?.timeoutMs??Kd(t.env)});let i=Rh.get(n),a=On(e,()=>i??ft.randomBytes(32).toString(`hex`));return Xp(np({config:a.config,configPath:n,generatedSecret:a.generatedSecret,logger:t.logger,state:{pendingByPath:Rh,persistInFlight:zh,persistWarned:Bh},persistConfig:(e,t)=>m(e,t)}))}function a(){try{if(Oh(t.env),!t.fs.existsSync(n))return Wd(t.env)&&!Gd(t.env)&&Ud({enabled:!0,env:t.env,expectedKeys:Qp(t.env),logger:t.logger,timeoutMs:Kd(t.env)}),{};let e=t.fs.readFileSync(n,`utf-8`),a=$f({deps:t,configPath:n,raw:e,parsed:t.json5.parse(e)}),o=a.raw,s=a.parsed,c=Z(o),l=Ph(Nh(s,n,t),t.env),u=l.resolvedConfigRaw,d=Fh(u,s),f=d.effectiveConfigRaw;for(let e of l.envWarnings)t.logger.warn(`Config (${n}): missing env var "${e.varName}" at ${e.configPath} - feature using this value will be unavailable`);if(Ch(f,t.logger),typeof f!=`object`||!f)return r({...$({path:n,exists:!0,raw:o,parsed:s,sourceConfig:{},valid:!0,runtimeConfig:{},hash:c,issues:[],warnings:[],legacyIssues:d.sourceLegacyIssues})}),{};let p=Qd(f,{env:t.env,homedir:t.homedir});if(p.length>0)throw new Jd(p);let m=Bm(f,{env:t.env});if(m.ok||(r({...$({path:n,exists:!0,raw:o,parsed:s,sourceConfig:Q(f),valid:!1,runtimeConfig:Q(f),hash:c,issues:m.issues,warnings:m.warnings,legacyIssues:d.sourceLegacyIssues})}),Sf({configPath:n,issues:m.issues,logger:t.logger,loggedConfigPaths:Ym})),m.warnings.length>0){let e=m.warnings.map(e=>`- ${Ye(e.path||`<root>`)}: ${Ye(e.message)}`).join(`
7
+ `);t.logger.warn(`Config warnings:\n${e}`)}Th(m.config,t.logger);let h=qp(m.config,`load`);return r({...$({path:n,exists:!0,raw:o,parsed:s,sourceConfig:Q(f),valid:!0,runtimeConfig:h,hash:c,issues:[],warnings:m.warnings,legacyIssues:d.sourceLegacyIssues})}),i(h)}catch(e){throw e instanceof Jd?(t.logger.error(e.message),e):(e?.code===`INVALID_CONFIG`||t.logger.error(`Failed to read config at ${n}`,e),e)}}async function o(){if(Oh(t.env),!t.fs.existsSync(n))return await Ih(t,{snapshot:$({path:n,exists:!1,raw:null,parsed:{},sourceConfig:{},valid:!0,runtimeConfig:{},hash:Z(null),issues:[],warnings:[],legacyIssues:[]})});let e=null,r={},i={},a=Z(null);try{let o=t.fs.readFileSync(n,`utf-8`),s=Z(o);e=o,a=s;let c=kh(o,t.json5);if(!c.ok)return await Ih(t,{snapshot:$({path:n,exists:!0,raw:o,parsed:{},sourceConfig:{},valid:!1,runtimeConfig:{},hash:s,issues:[{path:``,message:`JSON5 parse failed: ${c.error}`}],warnings:[],legacyIssues:[]})});r=c.parsed,i=Q(c.parsed);let l=await Qf({deps:t,configPath:n,raw:o,parsed:c.parsed}),u=l.raw,d=l.parsed,f=Z(u);e=u,r=d,i=Q(d),a=f;let p;try{p=Nh(d,n,t)}catch(e){let r=e instanceof B?e.message:`Include resolution failed: ${String(e)}`;return await Ih(t,{snapshot:$({path:n,exists:!0,raw:u,parsed:d,sourceConfig:Q(d),valid:!1,runtimeConfig:Q(d),hash:f,issues:[{path:``,message:r}],warnings:[],legacyIssues:[]})})}let m=Ph(p,t.env),h=m.envWarnings.map(e=>({path:e.configPath,message:`Missing env var "${e.varName}" - feature using this value will be unavailable`})),g=m.resolvedConfigRaw,_=Fh(g,d),v=_.effectiveConfigRaw;i=Q(v);let y=Bm(v,{env:t.env});if(!y.ok)return await Ih(t,{snapshot:$({path:n,exists:!0,raw:u,parsed:d,sourceConfig:Q(v),valid:!1,runtimeConfig:Q(v),hash:f,issues:y.issues,warnings:[...y.warnings,...h],legacyIssues:_.sourceLegacyIssues})});Th(y.config,t.logger);let ee=qp(y.config,`snapshot`);return await Ih(t,{snapshot:$({path:n,exists:!0,raw:u,parsed:d,sourceConfig:Q(v),valid:!0,runtimeConfig:ee,hash:f,issues:[],warnings:[...y.warnings,...h],legacyIssues:_.sourceLegacyIssues}),envSnapshotForRestore:m.envSnapshotForRestore})}catch(o){let s=o,c;if(s?.code===`EACCES`){let e=process.getuid?.(),r=typeof e==`number`?String(e):`$(id -u)`;c=[`read failed: ${String(o)}`,``,`Config file is not readable by the current process. If running in a container`,`or 1-click deployment, fix ownership with:`,` chown ${r} "${n}"`,`Then restart the gateway.`].join(`
8
+ `),t.logger.error(c)}else c=`read failed: ${String(o)}`;return await Ih(t,{snapshot:$({path:n,exists:!0,raw:e,parsed:r,sourceConfig:i,valid:!1,runtimeConfig:i,hash:a,issues:[{path:``,message:c}],warnings:[],legacyIssues:[]})})}}async function s(){return(await o()).snapshot}async function c(e){return await ep({deps:t,snapshot:e,logger:t.logger})}async function l(e){return await tp({deps:t,snapshot:e.snapshot,reason:e.reason})}async function u(e){return await Mh({deps:t,configPath:n,snapshot:e})}async function d(){let e=await o();return{snapshot:e.snapshot,writeOptions:{envSnapshotForRestore:e.envSnapshotForRestore,expectedConfigPath:n}}}async function f(){let e=await o();return e.snapshot.valid?i(qp(e.snapshot.sourceConfig,`load`)):e.snapshot.config}async function p(){if(Oh(t.env),!t.fs.existsSync(n))return{};try{let e=t.fs.readFileSync(n,`utf-8`),r=kh(e,t.json5);if(!r.ok)return{};let i=await Qf({deps:t,configPath:n,raw:e,parsed:r.parsed}),a;try{a=Nh(i.parsed,n,t)}catch{return Q(i.parsed)}return Q(Fh(Ph(a,t.env).resolvedConfigRaw,i.parsed).effectiveConfigRaw)}catch{return{}}}async function m(e,r={}){let i=e,a=r.baseSnapshot??(await o()).snapshot,s=null,c=null;if(a.valid&&a.exists){i=mp({runtimeConfig:a.config,sourceConfig:a.resolved,nextConfig:e,rootAuthoredConfig:a.parsed});try{let r=ii(a.parsed,n,{readFile:e=>t.fs.readFileSync(e,`utf-8`),readFileWithGuards:({includePath:e,resolvedPath:n,rootRealDir:r})=>ni({includePath:e,resolvedPath:n,rootRealDir:r,ioFs:t.fs}),parseJson:e=>t.json5.parse(e)}),i=new Map;eh(r,``,i),i.size>0&&(s=i,c=new Set,Ep(a.config,e,``,c))}catch{s=null}}let l=Vm(i,{env:t.env});if(!l.ok){let e=l.issues[0],t=e?.path?e.path:`<root>`,n=e?.message??`invalid`;throw Error(vp(t,n))}if(l.warnings.length>0){let e=l.warnings.map(e=>`- ${e.path}: ${e.message}`).join(`
9
+ `);t.logger.warn(`Config warnings:\n${e}`)}let u=i;try{if(t.fs.existsSync(n)){let e=kh(await t.fs.promises.readFile(n,`utf-8`),t.json5);if(e.ok){let n=r.envSnapshotForRestore??t.env;u=cf(u,e.parsed,n)}}}catch{}let d=I.dirname(n);await t.fs.promises.mkdir(d,{recursive:!0,mode:448}),await Xm({configPath:n,env:t.env,homedir:t.homedir,fsModule:t.fs});let f=s&&c?kp(u,``,s,c):u;if(r.unsetPaths?.length)for(let e of r.unsetPaths){if(!Array.isArray(e)||e.length===0)continue;let t=Tp(f,e);t.changed&&(f=t.next)}let p=wh(f),m=JSON.stringify(p,null,2).trimEnd().concat(`
10
+ `),h=Z(m),g=Zm(a),_=c?.size,v=typeof a.raw==`string`?Buffer.byteLength(a.raw,`utf-8`):null,y=Buffer.byteLength(m,`utf-8`),ee=a.exists?await t.fs.promises.stat(n).catch(()=>null):null,te=Qm(a.parsed),ne=Qm(p),b=$m(a.resolved),re=$m(p),ie=ah({existsBefore:a.exists,previousBytes:v,nextBytes:y,hasMetaBefore:te,gatewayModeBefore:b,gatewayModeAfter:re}),ae=()=>{if(!a.exists)return;let e=t.env.VITEST===`true`,r=t.env.OPENCLAW_TEST_CONFIG_OVERWRITE_LOG===`1`;e&&!r||t.logger.warn(ff({configPath:n,previousHash:g??null,nextHash:h,changedPathCount:_}))},x=()=>{if(ie.length===0)return;let e=t.env.VITEST===`true`,r=t.env.OPENCLAW_TEST_CONFIG_WRITE_ANOMALY_LOG===`1`;e&&!r||t.logger.warn(`Config write anomaly: ${n} (${ie.join(`, `)})`)},S=ih(ee),oe=pf({configPath:n,env:t.env,existsBefore:a.exists,previousHash:g??null,nextHash:h,previousBytes:v,nextBytes:y,previousMetadata:S,changedPathCount:_,hasMetaBefore:te,hasMetaAfter:ne,gatewayModeBefore:b,gatewayModeAfter:re,suspicious:ie}),C=async(e,n,r)=>{await gf({fs:t.fs,env:t.env,homedir:t.homedir,record:mf({base:oe,result:e,err:n,nextMetadata:ih(r??null)})})},w=oh(ie);if(w.length>0&&r.allowDestructiveWrite!==!0){let e=`${n}.rejected.${_h(new Date().toISOString())}`;await t.fs.promises.writeFile(e,m,{encoding:`utf-8`,mode:384,flag:`wx`}).catch(()=>{});let r=`Config write rejected: ${n} (${w.join(`, `)}). Rejected payload saved to ${e}.`,i=Object.assign(Error(r),{code:`CONFIG_WRITE_REJECTED`,rejectedPath:e,reasons:w});throw t.logger.warn(r),await C(`rejected`,i),i}let se=I.join(d,`${I.basename(n)}.${process.pid}.${ft.randomUUID()}.tmp`);try{await t.fs.promises.writeFile(se,m,{encoding:`utf-8`,mode:384}),t.fs.existsSync(n)&&await rf(n,t.fs.promises);try{await t.fs.promises.rename(se,n)}catch(e){let r=e.code;if(r===`EPERM`||r===`EEXIST`)return await t.fs.promises.copyFile(se,n),await t.fs.promises.chmod(n,384).catch(()=>{}),await t.fs.promises.unlink(se).catch(()=>{}),ae(),x(),await C(`copy-fallback`,void 0,await t.fs.promises.stat(n).catch(()=>null)),{persistedHash:h,persistedConfig:p};throw await t.fs.promises.unlink(se).catch(()=>{}),e}return ae(),x(),await C(`rename`,void 0,await t.fs.promises.stat(n).catch(()=>null)),{persistedHash:h,persistedConfig:p}}catch(e){throw await C(`failed`,e),e}}return{configPath:n,loadConfig:a,readBestEffortConfig:f,readSourceConfigBestEffort:p,readConfigFileSnapshot:s,readConfigFileSnapshotForWrite:d,promoteConfigSnapshotToLastKnownGood:c,recoverConfigFromLastKnownGood:l,recoverConfigFromJsonRootSuffix:u,writeConfigFile:m}}const Rh=new Map,zh=new Set,Bh=new Set;function Vh(e){let t=e.runtimeSnapshot,n=e.candidate;for(let e of Object.keys(t)){if(!Object.hasOwn(n,e))return!1;let r=t[e],i=n[e];if((Array.isArray(r)?`array`:r===null?`null`:typeof r)!=(Array.isArray(i)?`array`:i===null?`null`:typeof i))return!1}return!0}function Hh(e){let t=it(),n=et();return!t||!n?e:e===t?n:Vh({runtimeSnapshot:t,candidate:e})?Q(Je(Q(op(n,t)),ap(t,e))):e}function Uh(){return nt(()=>Lh().loadConfig())}export{_n as C,_t as D,Lt as E,gt as O,gn as S,Yt as T,fn as _,Ba as a,Sn as b,_a as c,Lr as d,Ir as f,yn as g,Cn as h,Mu as i,Yr as l,wn as m,Uh as n,Oa as o,En as p,Hh as r,wa as s,qd as t,Dr as u,bn as v,tn as w,vn as x,xn as y};