ltcai 9.9.0 → 9.9.2

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 (104) hide show
  1. package/README.md +41 -35
  2. package/bin/ltcai.js +1 -1
  3. package/desktop/electron/main.cjs +1 -1
  4. package/docs/CHANGELOG.md +83 -0
  5. package/docs/CI_AND_RELEASE_GATES.md +1 -1
  6. package/docs/COMMUNITY_AND_PLUGINS.md +1 -1
  7. package/docs/DEVELOPMENT.md +1 -1
  8. package/docs/LEGACY_COMPATIBILITY.md +48 -49
  9. package/docs/ONBOARDING.md +1 -1
  10. package/docs/OPERATIONS.md +1 -1
  11. package/docs/TRUST_MODEL.md +1 -1
  12. package/docs/WHY_LATTICE.md +1 -1
  13. package/docs/kg-schema.md +6 -6
  14. package/lattice_brain/__init__.py +1 -1
  15. package/lattice_brain/graph/schema.py +1 -1
  16. package/lattice_brain/runtime/multi_agent.py +1 -1
  17. package/latticeai/__init__.py +1 -1
  18. package/latticeai/api/chat.py +3 -0
  19. package/latticeai/api/chat_agent_http.py +2 -1
  20. package/latticeai/api/chat_intents.py +130 -7
  21. package/latticeai/app_factory.py +1 -0
  22. package/latticeai/core/agent.py +114 -2
  23. package/latticeai/core/file_generation.py +58 -0
  24. package/latticeai/core/legacy_compatibility.py +71 -47
  25. package/latticeai/core/marketplace.py +1 -1
  26. package/latticeai/core/workspace_os.py +1 -1
  27. package/latticeai/services/app_context.py +3 -0
  28. package/latticeai/services/architecture_readiness.py +1 -1
  29. package/latticeai/services/product_readiness.py +7 -2
  30. package/latticeai/services/tool_dispatch.py +36 -0
  31. package/latticeai/tools/__init__.py +1 -1
  32. package/latticeai/tools/knowledge.py +1 -1
  33. package/package.json +6 -16
  34. package/scripts/check_current_release_docs.mjs +20 -1
  35. package/scripts/check_legacy_debt.mjs +91 -0
  36. package/scripts/prune_release_evidence.mjs +38 -0
  37. package/scripts/wheel_smoke.py +22 -6
  38. package/src-tauri/Cargo.lock +1 -1
  39. package/src-tauri/Cargo.toml +1 -1
  40. package/src-tauri/src/main.rs +12 -12
  41. package/src-tauri/tauri.conf.json +1 -13
  42. package/static/app/asset-manifest.json +27 -27
  43. package/static/app/assets/Act-Cx_gZNbE.js +1 -0
  44. package/static/app/assets/{Brain-Cgkh0Hpn.js → Brain-BnGbytHa.js} +2 -2
  45. package/static/app/assets/BrainHome-CRUMJL93.js +2 -0
  46. package/static/app/assets/BrainSignals-BP8-Qh2g.js +1 -0
  47. package/static/app/assets/Capture-CAKnLcb0.js +1 -0
  48. package/static/app/assets/CommandPalette-BoUTXBfm.js +1 -0
  49. package/static/app/assets/Library-PcfVUco6.js +1 -0
  50. package/static/app/assets/LivingBrain-C3VbogVo.js +1 -0
  51. package/static/app/assets/ProductFlow-BLau7c7N.js +1 -0
  52. package/static/app/assets/ReviewCard-CX5RqRqx.js +1 -0
  53. package/static/app/assets/System-DRHc_6Su.js +1 -0
  54. package/static/app/assets/bot-DZkDdh-A.js +1 -0
  55. package/static/app/assets/cpu-DyvsDBbj.js +1 -0
  56. package/static/app/assets/download-C7yxYHvz.js +1 -0
  57. package/static/app/assets/folder-open-CffoIr9t.js +1 -0
  58. package/static/app/assets/hard-drive-C1oojrHb.js +1 -0
  59. package/static/app/assets/{index-BjaXCeOZ.js → index-BS_3aN1n.js} +3 -3
  60. package/static/app/assets/index-DU78Kogz.css +2 -0
  61. package/static/app/assets/input-B_U7zvbR.js +1 -0
  62. package/static/app/assets/navigation-xG-gyjbe.js +1 -0
  63. package/static/app/assets/network-BF13HJJF.js +1 -0
  64. package/static/app/assets/primitives-DsuKh3M8.js +1 -0
  65. package/static/app/assets/sunrise-CIP2ELJ1.js +1 -0
  66. package/static/app/assets/textarea-DsDL4ET8.js +1 -0
  67. package/static/app/assets/utils-Dh-Dwtkb.js +7 -0
  68. package/static/app/index.html +4 -4
  69. package/static/sw.js +1 -1
  70. package/auto_setup.py +0 -21
  71. package/kg_schema.py +0 -13
  72. package/knowledge_graph.py +0 -51
  73. package/knowledge_graph_api.py +0 -24
  74. package/llm_router.py +0 -20
  75. package/local_knowledge_api.py +0 -16
  76. package/ltcai_cli.py +0 -21
  77. package/mcp_registry.py +0 -20
  78. package/p_reinforce.py +0 -16
  79. package/setup_wizard.py +0 -16
  80. package/static/app/assets/Act-CfOPUKPs.js +0 -2
  81. package/static/app/assets/BrainHome-D8e3wQiW.js +0 -3
  82. package/static/app/assets/BrainSignals-BjRBA18L.js +0 -1
  83. package/static/app/assets/Capture-CQQYQ1Ga.js +0 -1
  84. package/static/app/assets/CommandPalette-pss56Mg4.js +0 -1
  85. package/static/app/assets/Library-CoI3xYJk.js +0 -1
  86. package/static/app/assets/LivingBrain-CaU_hCxQ.js +0 -1
  87. package/static/app/assets/ProductFlow-Db-1O71-.js +0 -1
  88. package/static/app/assets/System-Dfocn0zN.js +0 -1
  89. package/static/app/assets/bot-Bp2x1i6F.js +0 -1
  90. package/static/app/assets/circle-check-CyGal42W.js +0 -1
  91. package/static/app/assets/cpu-DQFk82hG.js +0 -1
  92. package/static/app/assets/download-C70gKQVi.js +0 -1
  93. package/static/app/assets/folder-open-DNGytsVw.js +0 -1
  94. package/static/app/assets/hard-drive-CYo_bEl4.js +0 -1
  95. package/static/app/assets/i18n-BBMJshCW.js +0 -7
  96. package/static/app/assets/index-BqRcLZR3.css +0 -2
  97. package/static/app/assets/input-ChWD-Fsh.js +0 -1
  98. package/static/app/assets/navigation-D9D9_FPC.js +0 -1
  99. package/static/app/assets/network-DzLDGmtV.js +0 -1
  100. package/static/app/assets/primitives-CmaSAyGG.js +0 -1
  101. package/static/app/assets/sparkles-DXiaM1NS.js +0 -1
  102. package/static/app/assets/textarea-CV43-o79.js +0 -1
  103. package/telegram_bot.py +0 -16
  104. package/tools/__init__.py +0 -29
@@ -0,0 +1 @@
1
+ import{_ as e,b as t,m as n,r,v as i}from"./utils-Dh-Dwtkb.js";var a=n(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),o=t(i()),s=e(),c=o.forwardRef(({className:e,...t},n)=>(0,s.jsx)(`input`,{ref:n,className:r(`h-10 w-full rounded-md border border-input bg-background/70 px-3 text-sm outline-none transition placeholder:text-muted-foreground focus:border-ring focus:ring-2 focus:ring-ring/35 disabled:cursor-not-allowed disabled:opacity-50`,e),...t}));c.displayName=`Input`;export{a as n,c as t};
@@ -0,0 +1 @@
1
+ import{_ as e,b as t,v as n}from"./utils-Dh-Dwtkb.js";var r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},i=new class extends r{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},a={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o=new class{#e=a;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function s(e){setTimeout(e,0)}var c=typeof window>`u`||`Deno`in globalThis;function l(){}function u(e,t){return typeof e==`function`?e(t):e}function d(e){return typeof e==`number`&&e>=0&&e!==1/0}function f(e,t){return Math.max(e+(t||0)-Date.now(),0)}function p(e,t){return typeof e==`function`?e(t):e}function m(e,t){return typeof e==`function`?e(t):e}function h(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==_(o,t.options))return!1}else if(!y(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function g(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(v(t.options.mutationKey)!==v(a))return!1}else if(!y(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function _(e,t){return(t?.queryKeyHashFn||v)(e)}function v(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function y(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>y(e[n],t[n])):!1}var b=Object.prototype.hasOwnProperty;function x(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=C(e)&&C(t);if(!r&&!(w(e)&&w(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:b.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=x(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function S(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function C(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!T(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!T(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function T(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return new Promise(t=>{o.setTimeout(t,e)})}function E(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:x(e,t)}function te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ne(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var D=Symbol();function O(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===D?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function k(e,t){return typeof e==`function`?e(...t):!!e}function re(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var A=(()=>{let e=()=>c;return{isServer(){return e()},setIsServer(t){e=t}}})();function j(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ie=s;function ae(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ie,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var M=ae(),N=new class extends r{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function oe(e){return Math.min(1e3*2**e,3e4)}function P(e){return(e??`online`)===`online`?N.isOnline():!0}var F=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function I(e){let t=!1,n=0,r,a=j(),o=()=>a.status!==`pending`,s=t=>{if(!o()){let n=new F(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>i.isFocused()&&(e.networkMode===`always`||N.isOnline())&&e.canRun(),d=()=>P(e.networkMode)&&e.canRun(),f=e=>{o()||(r?.(),a.resolve(e))},p=e=>{o()||(r?.(),a.reject(e))},m=()=>new Promise(t=>{r=e=>{(o()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),h=()=>{if(o())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(o())return;let i=e.retry??(A.isServer()?0:3),a=e.retryDelay??oe,s=typeof a==`function`?a(n,r):a,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ee(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),a)}}var L=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),d(this.gcTime)&&(this.#e=o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(A.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(o.clearTimeout(this.#e),this.#e=void 0)}};function se(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{re(e,()=>t.signal,()=>n=!0)},u=O(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?ne:te;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?ce:R,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:R(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function R(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ce(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var le=class extends L{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=V(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=V(this.options);e.data!==void 0&&(this.setState(B(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=E(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(l).catch(l):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>m(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>p(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!f(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=O(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?se(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=I({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof F&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof F){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...z(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...B(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),M.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function z(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:P(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function B(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function V(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var H=class extends r{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=j(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),W(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof m(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!S(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&K(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||m(this.options.enabled,this.#t)!==m(t.enabled,this.#t)||p(this.options.staleTime,this.#t)!==p(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||m(this.options.enabled,this.#t)!==m(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ue(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l)),t}#g(){this.#b();let e=p(this.options.staleTime,this.#t);if(A.isServer()||this.#r.isStale||!d(e))return;let t=f(this.#r.dataUpdatedAt,e)+1;this.#d=o.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(A.isServer()||m(this.options.enabled,this.#t)===!1||!d(this.#p)||this.#p===0)&&(this.#f=o.setInterval(()=>{(this.options.refetchIntervalInBackground||i.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(o.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(o.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&W(e,t),o=i&&K(e,n,t,r);(a||o)&&(l={...l,...z(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:h}=l;d=l.data;let g=!1;if(t.placeholderData!==void 0&&d===void 0&&h===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,g=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(h=`success`,d=E(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!g)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=E(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),h=`error`);let _=l.fetchStatus===`fetching`,v=h===`pending`,y=h===`error`,b=v&&_,x=d!==void 0,S={status:h,fetchStatus:l.fetchStatus,isPending:v,isSuccess:h===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:q(e,t),refetch:this.refetch,promise:this.#o,isEnabled:m(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=j())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!S(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){M.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function U(e,t){return m(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&m(t.retryOnMount,e)===!1)}function W(e,t){return U(e,t)||e.state.data!==void 0&&G(e,t,t.refetchOnMount)}function G(e,t,n){if(m(t.enabled,e)!==!1&&p(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&q(e,t)}return!1}function K(e,t,n,r){return(e!==t||m(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&q(e,n)}function q(e,t){return m(t.enabled,e)!==!1&&e.isStaleByTime(p(t.staleTime,e))}function ue(e,t){return!S(e.getCurrentResult(),t)}var J=t(n(),1),de=e(),Y=J.createContext(void 0),X=e=>{let t=J.useContext(Y);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},fe=({client:e,children:t})=>(J.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,de.jsx)(Y.Provider,{value:e,children:t})),Z=J.createContext(!1),pe=()=>J.useContext(Z);Z.Provider;function me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var he=J.createContext(me()),ge=()=>J.useContext(he),_e=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?k(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ve=e=>{J.useEffect(()=>{e.clearReset()},[e])},ye=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||k(n,[e.error,r])),be=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},xe=(e,t)=>e.isLoading&&e.isFetching&&!t,Q=(e,t)=>e?.suspense&&t.isPending,$=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Se(e,t,n){let r=pe(),i=ge(),a=X(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,be(o),_e(o,i,s),ve(i);let u=!a.getQueryCache().get(o.queryHash),[d]=J.useState(()=>new t(a,o)),f=d.getOptimisticResult(o),p=!r&&c;if(J.useSyncExternalStore(J.useCallback(e=>{let t=p?d.subscribe(M.batchCalls(e)):l;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),J.useEffect(()=>{d.setOptions(o)},[o,d]),Q(o,f))throw $(o,d,i);if(ye({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,f),o.experimental_prefetchInRender&&!A.isServer()&&xe(f,r)&&(u?$(o,d,i):s?.promise)?.catch(l).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?f:d.trackResult(f)}function Ce(e,t){return Se(e,H,t)}function we(e){window.location.hash=e}function Te(){document.querySelector(`.brain-composer textarea`)?.focus()}export{r as C,i as S,y as _,X as a,k as b,I as c,u as d,v as f,l as g,h,fe as i,N as l,g as m,we as n,le as o,_ as p,Ce as r,L as s,Te as t,M as u,p as v,D as x,S as y};
@@ -0,0 +1 @@
1
+ import{m as e}from"./utils-Dh-Dwtkb.js";var t=e(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{_ as e,a as t,b as n,c as r,h as i,i as a,m as o,p as s,r as c,s as l,t as u,v as d}from"./utils-Dh-Dwtkb.js";import{a as f}from"./navigation-xG-gyjbe.js";import{n as p}from"./input-B_U7zvbR.js";import{i as m,w as h}from"./index-BS_3aN1n.js";var g=o(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),_=o(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),v=o(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),y=o(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),b=n(d()),x=e(),S={default:`border-primary/25 bg-primary/12 text-primary`,success:`border-success/30 bg-success/12 text-success`,warning:`border-warning/30 bg-warning/12 text-warning`,muted:`border-border bg-muted/70 text-muted-foreground`,danger:`border-destructive/30 bg-destructive/12 text-destructive`};function C({className:e,variant:t=`default`,...n}){return(0,x.jsx)(`span`,{className:c(`inline-flex min-h-6 max-w-full items-center whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-semibold leading-none`,S[t],e),...n})}function w({className:e,...t}){return(0,x.jsx)(`section`,{className:c(`premium-surface rounded-lg text-card-foreground`,e),...t})}function T({className:e,...t}){return(0,x.jsx)(`div`,{className:c(`flex flex-col gap-1.5 p-5`,e),...t})}function E({className:e,...t}){return(0,x.jsx)(`h2`,{className:c(`text-base font-semibold tracking-normal`,e),...t})}function D({className:e,...t}){return(0,x.jsx)(`p`,{className:c(`text-sm leading-6 text-muted-foreground`,e),...t})}function O({className:e,...t}){return(0,x.jsx)(`div`,{className:c(`p-5 pt-0`,e),...t})}function k({result:e}){let t=i(e=>e.mode),n=i(e=>e.language);return e?e.source===`live`&&e.ok?(0,x.jsx)(C,{variant:`success`,children:t===`basic`?s(n,`ui.status.ready`):s(n,`ui.status.connected`)}):(0,x.jsx)(C,{variant:`warning`,children:t===`basic`?s(n,`ui.status.needsSetup`):s(n,`ui.status.unavailable`)}):(0,x.jsx)(C,{variant:`muted`,children:s(n,`ui.status.notLoaded`)})}function A({title:e,detail:t}){let n=i(e=>e.language);return(0,x.jsxs)(`div`,{className:`product-empty-state flex min-h-36 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border bg-muted/24 p-6 text-center text-sm text-muted-foreground`,children:[(0,x.jsx)(`div`,{className:`grid h-10 w-10 place-items-center rounded-md border border-border bg-card`,children:(0,x.jsx)(y,{className:`h-5 w-5 text-primary`})}),(0,x.jsx)(`div`,{className:`text-base font-semibold text-foreground`,children:e||s(n,`ui.empty.title`)}),t?(0,x.jsx)(`div`,{className:`max-w-md leading-6`,children:t}):null]})}function j({title:e,description:t,result:n,children:r,className:a}){let o=i(e=>e.mode),l=i(e=>e.language);return(0,x.jsxs)(w,{className:c(`data-panel overflow-hidden`,a),children:[(0,x.jsxs)(T,{className:`flex-row items-start justify-between gap-3`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(E,{children:e}),t?(0,x.jsx)(D,{children:t}):null]}),o===`basic`?null:(0,x.jsx)(k,{result:n})]}),(0,x.jsx)(O,{children:n?.ok?r(n.data):(0,x.jsx)(A,{detail:o===`basic`?s(l,`ui.empty.basicDetail`):n?.error||s(l,`ui.empty.advancedDetail`)})})]})}function M({title:e}){let t=i(e=>e.language);return(0,x.jsxs)(w,{children:[(0,x.jsx)(T,{children:(0,x.jsx)(E,{children:e})}),(0,x.jsx)(O,{children:(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,x.jsx)(_,{className:`h-4 w-4 animate-spin`}),` `,s(t,`ui.loading`)]})})]})}function N({stats:e}){return(0,x.jsx)(`div`,{className:`data-stat-grid grid gap-3 sm:grid-cols-2 xl:grid-cols-4`,children:e.map(e=>(0,x.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/55 p-4`,children:[(0,x.jsx)(`div`,{className:`text-xs uppercase text-muted-foreground`,children:e.label}),(0,x.jsx)(`div`,{className:`mt-2 text-2xl font-semibold leading-tight`,children:typeof e.value==`number`?a(e.value):String(e.value??`-`)}),e.hint?(0,x.jsx)(`div`,{className:`mt-2 text-xs leading-5 text-muted-foreground`,children:e.hint}):null]},e.label))})}function P(e){return e==null||e===``?`-`:typeof e==`number`?Number.isFinite(e)?a(e):`-`:typeof e==`boolean`?e?`Enabled`:`Disabled`:String(e)}var F=/(^id$|_id$|token|secret|passphrase|fingerprint|public_key|private_key|dsn|schema|endpoint|base_url|localhost|127\.0\.0\.1|stack|trace|raw|runtime|engine|module|port|host|api|internal)/i;function I(e){return F.test(e)}function L(e){let t=P(e);return t===`-`||t.includes(`/`)||t.includes(`@`)||/\.[a-z0-9]{2,5}$/i.test(t)?t:r(t.replace(/^agent:/i,``).replace(/^tool:/i,``))}function R(e){for(let t of[`documents`,`sources`,`items`,`agents`,`workflows`,`runs`,`events`,`permissions`,`models`,`peers`,`invitations`,`roles`,`policies`,`hooks`,`tools`,`templates`,`plugins`,`recent_events`]){let n=u(e[t]);if(n.length)return n}return[]}function z({value:e}){let n=i(e=>e.language);if(typeof e==`boolean`)return(0,x.jsx)(C,{variant:e?`success`:`muted`,children:s(n,e?`ui.value.enabled`:`ui.value.disabled`)});if(Array.isArray(e))return e.length?e.every(e=>e===null||[`string`,`number`,`boolean`].includes(typeof e))?(0,x.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,5).map((e,t)=>(0,x.jsx)(C,{variant:`muted`,children:P(e)},`${String(e)}-${t}`)),e.length>5?(0,x.jsxs)(C,{variant:`muted`,children:[`+`,e.length-5]}):null]}):(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:s(n,`ui.value.records`,{count:a(e.length)})}):(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:s(n,`ui.value.none`)});if(t(e)){let t=Object.keys(e);return t.length?(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[t.slice(0,4).map(r).join(`, `),t.length>4?` +${t.length-4}`:``]}):(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:s(n,`ui.value.noFields`)})}let o=P(e);return(0,x.jsx)(`span`,{className:`break-words`,children:o.length>96?l(o,96):o})}function B({data:e,limit:t=8}){let n=i(e=>e.mode),a=i(e=>e.language),o=Object.entries(e||{}).filter(([e])=>n!==`basic`||!I(e)).slice(0,t);return o.length?(0,x.jsx)(`div`,{className:`divide-y divide-border rounded-md border border-border`,children:o.map(([e,t])=>(0,x.jsxs)(`div`,{className:`grid grid-cols-[minmax(9rem,0.5fr)_1fr] gap-3 p-3 text-sm`,children:[(0,x.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:r(e)}),(0,x.jsx)(`span`,{className:`min-w-0 break-words`,children:(0,x.jsx)(z,{value:t})})]},e))}):(0,x.jsx)(A,{title:s(a,`ui.noValues`)})}function V({value:e,titleKey:n=`title`,metaKey:r=`status`,limit:a=8}){let o=i(e=>e.mode),c=i(e=>e.language);return o===`basic`?(0,x.jsx)(H,{value:e,titleKey:n,metaKey:r,limit:a}):Array.isArray(e)?e.length?e.every(e=>t(e))?(0,x.jsx)(W,{items:e,titleKey:n,metaKey:r,limit:a}):(0,x.jsxs)(`div`,{className:`flex flex-wrap gap-1 rounded-md border border-border bg-background p-3`,children:[e.slice(0,a).map((e,t)=>(0,x.jsx)(C,{variant:`muted`,children:P(e)},`${String(e)}-${t}`)),e.length>a?(0,x.jsxs)(C,{variant:`muted`,children:[`+`,e.length-a]}):null]}):(0,x.jsx)(A,{detail:s(c,`ui.empty.listDetail`)}):t(e)?(0,x.jsx)(B,{data:e,limit:a}):(0,x.jsx)(`div`,{className:`rounded-md border border-border bg-background p-3 text-sm`,children:(0,x.jsx)(z,{value:e})})}function H({value:e,titleKey:n=`title`,metaKey:r=`status`,limit:o=6}){let c=i(e=>e.language);if(Array.isArray(e))return e.length?e.every(e=>t(e))?(0,x.jsx)(W,{items:e,titleKey:n,metaKey:r,limit:o}):(0,x.jsxs)(`div`,{className:`flex flex-wrap gap-1 rounded-md border border-border bg-background/55 p-3`,children:[e.slice(0,o).map((e,t)=>(0,x.jsx)(C,{variant:`muted`,children:L(e)},`${String(e)}-${t}`)),e.length>o?(0,x.jsxs)(C,{variant:`muted`,children:[`+`,e.length-o]}):null]}):(0,x.jsx)(A,{detail:s(c,`ui.empty.listDetail`)});if(t(e)){let i=R(e);return i.length?(0,x.jsx)(W,{items:i,titleKey:n,metaKey:r,limit:o}):(0,x.jsx)(B,{data:Object.fromEntries(Object.entries(e).filter(([e])=>!I(e)).map(([e,n])=>[e,Array.isArray(n)?`${a(n.length)} items`:t(n)?`available`:n])),limit:o})}return(0,x.jsx)(`div`,{className:`rounded-md border border-border bg-background/55 p-3 text-sm`,children:L(e)})}function U({result:e,successLabel:t}){let n=i(e=>e.mode),r=i(e=>e.language);return e?e.ok?(0,x.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border bg-background p-3`,children:[(0,x.jsx)(C,{variant:`success`,children:t||s(r,`ui.requestCompleted`)}),n===`basic`?(0,x.jsx)(H,{value:e.data}):(0,x.jsx)(V,{value:e.data})]}):(0,x.jsx)(A,{title:s(r,`ui.requestUnavailable`),detail:e.error||(0,x.jsx)(z,{value:e.data})}):null}function W({items:e,titleKey:t=`title`,metaKey:n=`type`,limit:r=8}){let a=i(e=>e.mode),o=i(e=>e.language),c=u(e).slice(0,r);return c.length?(0,x.jsx)(`div`,{className:`entity-list grid gap-2`,children:c.map((e,r)=>(0,x.jsxs)(`div`,{className:`entity-list-row rounded-lg border border-border bg-background/55 p-3`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,x.jsx)(`div`,{className:`font-medium`,children:a===`basic`?L(e[t]||e.name||e.label||`Item ${r+1}`):String(e[t]||e.name||e.id||`Record ${r+1}`)}),(0,x.jsx)(C,{variant:`muted`,children:a===`basic`?L(e[n]||e.status||e.state||`ready`):String(e[n]||e.status||e.state||`record`)})]}),e.summary||e.description||e.path||e.id&&e[t]!==e.id?(0,x.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:String(e.summary||e.description||e.path||e.id)}):null,a!==`basic`&&e.id&&e[t]!==e.id?(0,x.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:l(e.id,48)}):null]},String(e.id||e.name||r)))}):(0,x.jsx)(A,{detail:s(o,`ui.empty.listDetail`)})}function G({title:e,detail:t,target:n=`advanced`}){let r=i(e=>e.setMode),a=i(e=>e.language);return(0,x.jsx)(w,{children:(0,x.jsxs)(O,{className:`flex flex-col items-start gap-3 p-6`,children:[(0,x.jsx)(`div`,{className:`grid h-10 w-10 place-items-center rounded-md border border-border bg-background/70`,children:(0,x.jsx)(v,{className:`h-5 w-5 text-primary`})}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`text-lg font-semibold`,children:e||s(a,`ui.modeGate.title`)}),(0,x.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-muted-foreground`,children:t||s(a,`ui.modeGate.detail`)})]}),(0,x.jsx)(m,{onClick:()=>r(n),children:n===`admin`?s(a,`ui.modeGate.admin`):s(a,`ui.modeGate.advanced`)})]})})}function K({label:e,successLabel:t,action:n,onSuccess:r,invalidate:a,variant:o=`outline`,disabled:l}){let u=f(),d=i(e=>e.language),v=t||s(d,`ui.done`),[y,S]=b.useState(null),C=h({mutationFn:n,onSuccess:async e=>{S(e.ok?v:e.error||s(d,`ui.status.unavailable`)),e.ok&&(await r?.(e),a&&await Promise.all(a.map(e=>u.invalidateQueries({queryKey:[e]}))))}});return(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsxs)(m,{variant:o,disabled:l||C.isPending,onClick:()=>C.mutate(),children:[C.isPending?(0,x.jsx)(_,{className:`h-4 w-4 animate-spin`}):null,e]}),y?(0,x.jsxs)(`span`,{className:c(`inline-flex items-center gap-1 text-xs`,y===v?`text-success`:`text-warning`),children:[y===v?(0,x.jsx)(p,{className:`h-3.5 w-3.5`}):(0,x.jsx)(g,{className:`h-3.5 w-3.5`}),y]}):null]})}function q({tabs:e,value:t,onChange:n}){let r=b.useRef([]),i=(t,i)=>{let a=(t+i+e.length)%e.length;r.current[a]?.focus(),n(e[a].id)};return(0,x.jsx)(`div`,{className:`product-tabs inline-flex max-w-full flex-wrap gap-1 rounded-lg border border-border bg-muted/28 p-1`,role:`tablist`,children:e.map((a,o)=>(0,x.jsx)(`button`,{ref:e=>{r.current[o]=e},type:`button`,role:`tab`,"aria-selected":t===a.id,tabIndex:t===a.id?0:-1,onClick:()=>n(a.id),onKeyDown:t=>{t.key===`ArrowRight`||t.key===`ArrowDown`?(t.preventDefault(),i(o,1)):t.key===`ArrowLeft`||t.key===`ArrowUp`?(t.preventDefault(),i(o,-1)):t.key===`Home`?(t.preventDefault(),r.current[0]?.focus(),n(e[0].id)):t.key===`End`&&(t.preventDefault(),r.current[e.length-1]?.focus(),n(e[e.length-1].id))},className:c(`h-9 rounded-md px-3.5 text-sm font-semibold transition`,t===a.id?`bg-card text-foreground shadow-sm`:`text-muted-foreground hover:bg-card/60 hover:text-foreground`),children:a.label},a.id))})}export{E as _,B as a,_ as b,U as c,q as d,z as f,T as g,D as h,W as i,N as l,O as m,j as n,M as o,w as p,A as r,G as s,K as t,V as u,C as v,g as x,y};
@@ -0,0 +1 @@
1
+ import{m as e}from"./utils-Dh-Dwtkb.js";var t=e(`sunrise`,[[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`path`,{d:`m4.93 10.93 1.41 1.41`,key:`2a7f42`}],[`path`,{d:`M2 18h2`,key:`j10viu`}],[`path`,{d:`M20 18h2`,key:`wocana`}],[`path`,{d:`m19.07 10.93-1.41 1.41`,key:`15zs5n`}],[`path`,{d:`M22 22H2`,key:`19qnx5`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}],[`path`,{d:`M16 18a4 4 0 0 0-8 0`,key:`1lzouq`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{_ as e,b as t,r as n,v as r}from"./utils-Dh-Dwtkb.js";var i=t(r()),a=e(),o=i.forwardRef(({className:e,...t},r)=>(0,a.jsx)(`textarea`,{ref:r,className:n(`min-h-28 w-full resize-y rounded-md border border-input bg-background/70 px-3 py-3 text-sm leading-6 outline-none transition placeholder:text-muted-foreground focus:border-ring focus:ring-2 focus:ring-ring/35 disabled:cursor-not-allowed disabled:opacity-50`,e),...t}));o.displayName=`Textarea`;export{o as t};