@undefineds.co/xpod 0.3.74 → 0.3.75

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 (86) hide show
  1. package/dist/api/container/common.js +1 -7
  2. package/dist/runtime/css-process.js +0 -1
  3. package/package.json +1 -1
  4. package/static/auth-callback/assets/{AiConfigContext-DNfRNaZQ.js → AiConfigContext-BvBdu_A3.js} +1 -1
  5. package/static/auth-callback/assets/{AiConfigPage-BBiTOm3o.js → AiConfigPage-BpDw4jco.js} +1 -1
  6. package/static/auth-callback/assets/{DocumentProcessingPanel-BzpEwqKT.js → DocumentProcessingPanel-BmZ_jzRr.js} +1 -1
  7. package/static/auth-callback/assets/{IndexLifecyclePanel-CvXMwooQ.js → IndexLifecyclePanel-BfQBjN4z.js} +1 -1
  8. package/static/auth-callback/assets/{IndexSubjectPanel-CayA221L.js → IndexSubjectPanel-BlsnatPt.js} +1 -1
  9. package/static/auth-callback/assets/{ModelAssignmentsPanel-Iew2QgtR.js → ModelAssignmentsPanel-KA6Mdndz.js} +1 -1
  10. package/static/auth-callback/assets/{ModelsPage-CTJKAUA3.js → ModelsPage-C7jymyIY.js} +1 -1
  11. package/static/auth-callback/assets/{NetworkPage--8ZCjIHB.js → NetworkPage-k2ShktNm.js} +1 -1
  12. package/static/auth-callback/assets/{PaneListHeader-BT-OGKL7.js → PaneListHeader-mLMe_dvU.js} +1 -1
  13. package/static/auth-callback/assets/{SearchIndexingPanel-CFjjk1-C.js → SearchIndexingPanel-CqV9um_t.js} +1 -1
  14. package/static/auth-callback/assets/{StatusSubjectPanel-DAN5Ej9q.js → StatusSubjectPanel-BgMBTbr2.js} +1 -1
  15. package/static/auth-callback/assets/{StatusWorkspace-CEgmKJcX.js → StatusWorkspace-zbSyhdG2.js} +1 -1
  16. package/static/auth-callback/assets/{SystemSettingsPage-Bk0TB4RU.js → SystemSettingsPage-CtW79nW6.js} +1 -1
  17. package/static/auth-callback/assets/{SystemSettingsSubjectPanel-CKl8ukiz.js → SystemSettingsSubjectPanel-ZOPKYUtZ.js} +1 -1
  18. package/static/auth-callback/assets/{activity-BOtct9Ie.js → activity-BQ-CQE3O.js} +1 -1
  19. package/static/auth-callback/assets/{auth-callback-ai6OMe6C.js → auth-callback-Htr_CB_g.js} +3 -3
  20. package/static/auth-callback/assets/{badge-DGSg5wio.js → badge-D5SGTJeO.js} +1 -1
  21. package/static/auth-callback/assets/{download-4eVPmxQ_.js → download-DK183Ldo.js} +1 -1
  22. package/static/auth-callback/assets/{external-link-BlD92fAM.js → external-link-LDHy_4bn.js} +1 -1
  23. package/static/auth-callback/assets/{index-7ppych8q.js → index-2WmlePQ9.js} +1 -1
  24. package/static/auth-callback/assets/{index-FrugCRsJ.js → index-BWrvgHqK.js} +1 -1
  25. package/static/auth-callback/assets/{index-browser-dwpJ2mdT.js → index-browser-DUd4E4-x.js} +1 -1
  26. package/static/auth-callback/assets/{key-round-BFOQbNNp.js → key-round-ibX79Kr-.js} +1 -1
  27. package/static/auth-callback/assets/{rotate-ccw-BySVgaAP.js → rotate-ccw-B2_VMaiX.js} +1 -1
  28. package/static/auth-callback/assets/{skeleton-CgcxPTqc.js → skeleton-F4nrpycc.js} +1 -1
  29. package/static/auth-callback/assets/{waypoints-DM902DhB.js → waypoints-DImIq93f.js} +1 -1
  30. package/static/auth-callback/assets/{workspace-layout-DlZlN49Q.js → workspace-layout-IVCSYU21.js} +1 -1
  31. package/static/auth-callback/auth-callback.html +1 -1
  32. package/static/dashboard/assets/{AiConfigContext-VnWI7bOR.js → AiConfigContext-cjjfYTo9.js} +1 -1
  33. package/static/dashboard/assets/{AiConfigPage-Dn3oxXcA.js → AiConfigPage-CO0DSD_j.js} +1 -1
  34. package/static/dashboard/assets/{DocumentProcessingPanel-CAF1uLi3.js → DocumentProcessingPanel-DMGnH8Oj.js} +1 -1
  35. package/static/dashboard/assets/{IndexLifecyclePanel-D9zVZwu8.js → IndexLifecyclePanel-DSkIOCL5.js} +1 -1
  36. package/static/dashboard/assets/{IndexSubjectPanel-_JCGwJmO.js → IndexSubjectPanel-qWN_DbAp.js} +1 -1
  37. package/static/dashboard/assets/{ModelAssignmentsPanel-DtlxQxFa.js → ModelAssignmentsPanel-DCf83uM3.js} +1 -1
  38. package/static/dashboard/assets/{ModelsPage-CCNTpXM5.js → ModelsPage-CMnvSrl5.js} +1 -1
  39. package/static/dashboard/assets/{NetworkPage-BAKv9unq.js → NetworkPage-C8Gkwclb.js} +1 -1
  40. package/static/dashboard/assets/{PaneListHeader-Dr1jq2Ii.js → PaneListHeader-BtU_8cDK.js} +1 -1
  41. package/static/dashboard/assets/{SearchIndexingPanel-BW0pPrQB.js → SearchIndexingPanel-DEn12pNU.js} +1 -1
  42. package/static/dashboard/assets/{StatusSubjectPanel-c9iebk4M.js → StatusSubjectPanel-B1_ILg2d.js} +1 -1
  43. package/static/dashboard/assets/{StatusWorkspace-KZ7zrrmB.js → StatusWorkspace-BG6nMNCo.js} +1 -1
  44. package/static/dashboard/assets/{SystemSettingsPage-fVSfJMi9.js → SystemSettingsPage-BnWYIXaM.js} +1 -1
  45. package/static/dashboard/assets/{SystemSettingsSubjectPanel-DUSxcVT8.js → SystemSettingsSubjectPanel-C_mYVPWb.js} +1 -1
  46. package/static/dashboard/assets/{activity-Dg4XxJA8.js → activity-DYJ7PdRl.js} +1 -1
  47. package/static/dashboard/assets/{badge-OHMG7sYk.js → badge-BIaZco1P.js} +1 -1
  48. package/static/dashboard/assets/{dashboard-UuQZ5g0B.js → dashboard-Dl40_MEa.js} +2 -2
  49. package/static/dashboard/assets/{download-CkbQhuL2.js → download-By16k9VK.js} +1 -1
  50. package/static/dashboard/assets/{external-link-C15frgwD.js → external-link-B92xOG_d.js} +1 -1
  51. package/static/dashboard/assets/{index-BiU8tNWd.js → index-BajZpJ48.js} +1 -1
  52. package/static/dashboard/assets/{index-JUkJUI4K.js → index-wsVPom_x.js} +1 -1
  53. package/static/dashboard/assets/{key-round-BVREfX5D.js → key-round-Clo5FOwA.js} +1 -1
  54. package/static/dashboard/assets/{rotate-ccw-cPEquKE_.js → rotate-ccw-smWSfi1L.js} +1 -1
  55. package/static/dashboard/assets/{skeleton-BPM2LdA5.js → skeleton-BrTaGeJw.js} +1 -1
  56. package/static/dashboard/assets/{waypoints-Cd3kODMk.js → waypoints-DGPQInE7.js} +1 -1
  57. package/static/dashboard/assets/{workspace-layout-BP3gLLXb.js → workspace-layout-CPU4XRmb.js} +1 -1
  58. package/static/dashboard/dashboard.html +1 -1
  59. package/static/settings/assets/{AiConfigContext-B-D3riwG.js → AiConfigContext-CT29_OyW.js} +1 -1
  60. package/static/settings/assets/{AiConfigPage-CAYT-CgT.js → AiConfigPage-WIE95S28.js} +1 -1
  61. package/static/settings/assets/{DocumentProcessingPanel-D__vS86O.js → DocumentProcessingPanel-KG8Sq999.js} +1 -1
  62. package/static/settings/assets/{IndexLifecyclePanel-CuYEAG62.js → IndexLifecyclePanel-iKvtHDXY.js} +1 -1
  63. package/static/settings/assets/{IndexSubjectPanel-Do71gQQC.js → IndexSubjectPanel-BQdSCkk4.js} +1 -1
  64. package/static/settings/assets/{ModelAssignmentsPanel-Cn3kSze7.js → ModelAssignmentsPanel-P8QcVB0F.js} +1 -1
  65. package/static/settings/assets/{ModelsPage-BKO0ARYt.js → ModelsPage-UZkZGqor.js} +1 -1
  66. package/static/settings/assets/{NetworkPage-XPYrdyVd.js → NetworkPage-Dcpcvg15.js} +1 -1
  67. package/static/settings/assets/{PaneListHeader-BAiQcCss.js → PaneListHeader--gHtZws5.js} +1 -1
  68. package/static/settings/assets/{SearchIndexingPanel-Bx3Fco0x.js → SearchIndexingPanel-DdgJSJYQ.js} +1 -1
  69. package/static/settings/assets/{StatusSubjectPanel-BzKzXmSL.js → StatusSubjectPanel-UOxp_XVL.js} +1 -1
  70. package/static/settings/assets/{StatusWorkspace-NjLpo9xp.js → StatusWorkspace-CPNXuD12.js} +1 -1
  71. package/static/settings/assets/{SystemSettingsPage-CclI_Lpv.js → SystemSettingsPage-B6ySeVPw.js} +1 -1
  72. package/static/settings/assets/{SystemSettingsSubjectPanel-CMnSE-8N.js → SystemSettingsSubjectPanel-I7zWmpiI.js} +1 -1
  73. package/static/settings/assets/{activity-DYpNPFzG.js → activity-CFhmzahP.js} +1 -1
  74. package/static/settings/assets/{badge-C7Vhmg28.js → badge-BBdUc5B-.js} +1 -1
  75. package/static/settings/assets/{download-DdXcAiwj.js → download-WJE9-yxQ.js} +1 -1
  76. package/static/settings/assets/{external-link-D7thdQae.js → external-link-RKoYyCp_.js} +1 -1
  77. package/static/settings/assets/{index-CwBKvDQZ.js → index-Bq2o0Bif.js} +1 -1
  78. package/static/settings/assets/{index-BnYbrf5s.js → index-DvxneI5O.js} +1 -1
  79. package/static/settings/assets/{index-browser-DYzi1DO1.js → index-browser-Qmo6EsFT.js} +1 -1
  80. package/static/settings/assets/{key-round-BXErodZA.js → key-round-r-D9sQUK.js} +1 -1
  81. package/static/settings/assets/{rotate-ccw-DPyOBmDD.js → rotate-ccw-D3IIhbPH.js} +1 -1
  82. package/static/settings/assets/{settings-BGpEf8nx.js → settings-D8oDBXWg.js} +3 -3
  83. package/static/settings/assets/{skeleton-S9l3JIr9.js → skeleton-DrL4RQuw.js} +1 -1
  84. package/static/settings/assets/{waypoints-C5By7zWc.js → waypoints-C5sRhpJw.js} +1 -1
  85. package/static/settings/assets/{workspace-layout-Bb6RVAEx.js → workspace-layout-B4ALmWsM.js} +1 -1
  86. package/static/settings/settings.html +1 -1
@@ -60,13 +60,7 @@ const service_1 = require("../../ai/service");
60
60
  const rdf_1 = require("./rdf");
61
61
  const EdgeNodeCertificateCapabilityBridge_1 = require("../../edge/EdgeNodeCertificateCapabilityBridge");
62
62
  function resolveCssServiceBaseUrl() {
63
- if (process.env.CSS_INTERNAL_URL) {
64
- return process.env.CSS_INTERNAL_URL;
65
- }
66
- if (process.env.CSS_BASE_URL) {
67
- return process.env.CSS_BASE_URL;
68
- }
69
- return 'http://localhost:3000/';
63
+ return `http://127.0.0.1:${process.env.CSS_PORT ?? '3000'}/`;
70
64
  }
71
65
  function resolveHostedPodCssBaseUrl() {
72
66
  return `http://127.0.0.1:${process.env.XPOD_MAIN_PORT ?? '3000'}/`;
@@ -272,7 +272,6 @@ function buildApiChildEnv(options) {
272
272
  API_PORT: options.apiPort.toString(),
273
273
  XPOD_MAIN_PORT: options.mainPort.toString(),
274
274
  CSS_PORT: options.cssPort.toString(),
275
- CSS_INTERNAL_URL: `http://localhost:${options.cssPort}`,
276
275
  CSS_BASE_URL: baseUrl,
277
276
  ...(options.gatewayAdminProxyAuthSecret ? { XPOD_GATEWAY_ADMIN_PROXY_AUTH_SECRET: options.gatewayAdminProxyAuthSecret } : {}),
278
277
  ...(options.rdfIndexPath ? { CSS_RDF_INDEX_PATH: options.rdfIndexPath } : {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@undefineds.co/xpod",
3
- "version": "0.3.74",
3
+ "version": "0.3.75",
4
4
  "description": "Xpod is an extended Community Solid Server, offering rich-feature, production-level Solid Pod and identity management.",
5
5
  "repository": "https://github.com/undefinedsco/xpod",
6
6
  "author": "developer@undefineds.co",
@@ -1 +1 @@
1
- import{u as N,r as n,j as T,h as U}from"./auth-callback-ai6OMe6C.js";import{c as J}from"./ai-connections-Bm52UO7Y.js";async function B(t){return x(t(p("/api/ai/config"),{method:"GET",credentials:"include",headers:{accept:"application/json"}}))}async function F(t,e){return x(t(p("/api/ai/config"),{method:"PATCH",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(e)}))}async function V(t,e){const o=await t(p("/api/ai/config/rebuild"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({target:e})}),r=await o.json().catch(()=>{});if(!o.ok||!r?.job)throw new Error(r?.error??"Index rebuild request failed");return r.job}async function K(t,e){const o=e.capabilities.some(c=>c.toLowerCase()==="embedding"),r=await t(p(o?"/v1/embeddings":"/v1/chat/completions"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(o?{model:e.id,input:"xpod readiness probe"}:{model:e.id,messages:[{role:"user",content:"Reply OK."}],max_tokens:1,stream:!1})});if(!r.ok){const c=await r.json().catch(()=>{}),d=typeof c?.error=="string"?c.error:c?.error?.message;throw new Error(d??"Model readiness probe failed")}await r.arrayBuffer()}function p(t){if(typeof window>"u")throw new Error("AI Config API requires the current browser origin");return new URL(t,window.location.origin).toString()}async function x(t){const e=await t,o=await e.json().catch(()=>{});if(!e.ok||!o?.config||!o.capabilities)throw new Error(o?.error??"AI Config request failed");return o}const E=n.createContext(void 0);function _({children:t}){const e=N(),[o,r]=n.useState(),[c,d]=n.useState(),[b,P]=n.useState([]),[h,g]=n.useState(),[k,w]=n.useState(!0),[y,m]=n.useState(!1),[C,v]=n.useState(!1),[S,l]=n.useState(),[R,I]=n.useState(0),q=!!(e.webId&&e.currentPod);n.useEffect(()=>{if(!e.webId||!e.currentPod)return;let a=!1;return queueMicrotask(()=>{if(a||!e.webId||!e.currentPod)return;w(!0),l(void 0);const i=J({webId:e.webId,podUrl:e.currentPod.podUrl,authenticatedFetch:e.fetch});Promise.all([B(e.fetch),i.listModels().catch(()=>[])]).then(([s,L])=>{a||(r(s.config),d(s.capabilities),g(s.lifecycle),P(X(L)))}).catch(s=>{a||l(s instanceof Error?s.message:String(s))}).finally(()=>{a||w(!1)})}),()=>{a=!0}},[R,e.currentPod,e.fetch,e.webId]);const A=n.useCallback(()=>{I(a=>a+1)},[]),u=n.useCallback(async a=>{m(!0),l(void 0);try{const i=await F(e.fetch,a);r(i.config),d(i.capabilities),g(i.lifecycle)}catch(i){throw l(i instanceof Error?i.message:String(i)),i}finally{m(!1)}},[e.fetch]),f=n.useCallback(async a=>{v(!0),l(void 0);try{const i=await V(e.fetch,a);g(s=>({configurationVersion:s?.configurationVersion,pending:(s?.pending??0)+1,recent:[i,...s?.recent??[]].slice(0,20)}))}catch(i){throw l(i instanceof Error?i.message:String(i)),i}finally{v(!1)}},[e.fetch]),j=n.useCallback(async(a,i)=>{await u(a),await f(i)},[f,u]),M=q?k:!1,O=n.useMemo(()=>({config:o,capabilities:c,lifecycle:h,models:b,loading:M,saving:y,rebuilding:C,error:S,reload:A,save:u,rebuild:f,saveAndRebuild:j}),[c,o,M,S,h,b,f,C,A,u,j,y]);return T.jsx(E.Provider,{value:O,children:t})}function X(t){return t.map(e=>({id:e.id,displayName:e.displayName,owner:e.provider,ref:U(e.provider,e.id),capabilities:e.capabilities??[]}))}function z(t,e){const r={chatModel:["chat"],ocrModel:["ocr"],readerModel:["document-understanding","documentunderstanding"],embeddingModel:["embedding"],indexerModel:["indexing"],rerankerModel:["reranking","reranker"]}[e];return r?t.filter(c=>c.capabilities.some(d=>r.includes(d.toLowerCase()))):t}function D(){const t=n.useContext(E);if(!t)throw new Error("useAiConfig must be used within AiConfigProvider");return t}export{_ as A,z as m,K as t,D as u};
1
+ import{u as N,r as n,j as T,h as U}from"./auth-callback-Htr_CB_g.js";import{c as J}from"./ai-connections-Bm52UO7Y.js";async function B(t){return x(t(p("/api/ai/config"),{method:"GET",credentials:"include",headers:{accept:"application/json"}}))}async function F(t,e){return x(t(p("/api/ai/config"),{method:"PATCH",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(e)}))}async function V(t,e){const o=await t(p("/api/ai/config/rebuild"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({target:e})}),r=await o.json().catch(()=>{});if(!o.ok||!r?.job)throw new Error(r?.error??"Index rebuild request failed");return r.job}async function K(t,e){const o=e.capabilities.some(c=>c.toLowerCase()==="embedding"),r=await t(p(o?"/v1/embeddings":"/v1/chat/completions"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(o?{model:e.id,input:"xpod readiness probe"}:{model:e.id,messages:[{role:"user",content:"Reply OK."}],max_tokens:1,stream:!1})});if(!r.ok){const c=await r.json().catch(()=>{}),d=typeof c?.error=="string"?c.error:c?.error?.message;throw new Error(d??"Model readiness probe failed")}await r.arrayBuffer()}function p(t){if(typeof window>"u")throw new Error("AI Config API requires the current browser origin");return new URL(t,window.location.origin).toString()}async function x(t){const e=await t,o=await e.json().catch(()=>{});if(!e.ok||!o?.config||!o.capabilities)throw new Error(o?.error??"AI Config request failed");return o}const E=n.createContext(void 0);function _({children:t}){const e=N(),[o,r]=n.useState(),[c,d]=n.useState(),[b,P]=n.useState([]),[h,g]=n.useState(),[k,w]=n.useState(!0),[y,m]=n.useState(!1),[C,v]=n.useState(!1),[S,l]=n.useState(),[R,I]=n.useState(0),q=!!(e.webId&&e.currentPod);n.useEffect(()=>{if(!e.webId||!e.currentPod)return;let a=!1;return queueMicrotask(()=>{if(a||!e.webId||!e.currentPod)return;w(!0),l(void 0);const i=J({webId:e.webId,podUrl:e.currentPod.podUrl,authenticatedFetch:e.fetch});Promise.all([B(e.fetch),i.listModels().catch(()=>[])]).then(([s,L])=>{a||(r(s.config),d(s.capabilities),g(s.lifecycle),P(X(L)))}).catch(s=>{a||l(s instanceof Error?s.message:String(s))}).finally(()=>{a||w(!1)})}),()=>{a=!0}},[R,e.currentPod,e.fetch,e.webId]);const A=n.useCallback(()=>{I(a=>a+1)},[]),u=n.useCallback(async a=>{m(!0),l(void 0);try{const i=await F(e.fetch,a);r(i.config),d(i.capabilities),g(i.lifecycle)}catch(i){throw l(i instanceof Error?i.message:String(i)),i}finally{m(!1)}},[e.fetch]),f=n.useCallback(async a=>{v(!0),l(void 0);try{const i=await V(e.fetch,a);g(s=>({configurationVersion:s?.configurationVersion,pending:(s?.pending??0)+1,recent:[i,...s?.recent??[]].slice(0,20)}))}catch(i){throw l(i instanceof Error?i.message:String(i)),i}finally{v(!1)}},[e.fetch]),j=n.useCallback(async(a,i)=>{await u(a),await f(i)},[f,u]),M=q?k:!1,O=n.useMemo(()=>({config:o,capabilities:c,lifecycle:h,models:b,loading:M,saving:y,rebuilding:C,error:S,reload:A,save:u,rebuild:f,saveAndRebuild:j}),[c,o,M,S,h,b,f,C,A,u,j,y]);return T.jsx(E.Provider,{value:O,children:t})}function X(t){return t.map(e=>({id:e.id,displayName:e.displayName,owner:e.provider,ref:U(e.provider,e.id),capabilities:e.capabilities??[]}))}function z(t,e){const r={chatModel:["chat"],ocrModel:["ocr"],readerModel:["document-understanding","documentunderstanding"],embeddingModel:["embedding"],indexerModel:["indexing"],rerankerModel:["reranking","reranker"]}[e];return r?t.filter(c=>c.capabilities.some(d=>r.includes(d.toLowerCase()))):t}function D(){const t=n.useContext(E);if(!t)throw new Error("useAiConfig must be used within AiConfigProvider");return t}export{_ as A,z as m,K as t,D as u};
@@ -1 +1 @@
1
- import{c as d,j as e,k as x,r as p,O as g,N as f,l as y,m as b}from"./auth-callback-ai6OMe6C.js";import{P as v}from"./PaneListHeader-BT-OGKL7.js";import{A as j,u as k}from"./AiConfigContext-DNfRNaZQ.js";import{T as N,u as w}from"./workspace-layout-DlZlN49Q.js";import"./ai-connections-Bm52UO7Y.js";const M=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],C=d("file-search",M);const A=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M7 12H3",key:"13ou7f"}],["path",{d:"M7 19H3",key:"wbqt3n"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14",key:"qth677"}],["path",{d:"M11 10v4h4",key:"172dkj"}]],I=d("list-restart",A);const L=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]],H=d("scan-text",L);const q=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],_=d("sliders-horizontal",q);function o(s,a,t,n,i){return{id:s,label:a,path:t,href:`/ai-config/${t}`,end:!0,description:n,icon:i}}const l=[o("model-assignments","Model Assignments","model-assignments","Choose the model used by each Xpod capability.",_),o("document-processing","Document Processing","document-processing","Control OCR and structured document reading.",H),o("search-indexing","Search & Indexing","search-indexing","Enable FTS, vector retrieval, and backend selection.",C),o("index-lifecycle","Index Lifecycle","index-lifecycle","Control automatic indexing and derived-index rebuilds.",I)];function W(){return e.jsx(j,{children:e.jsx(S,{})})}function S(){const s=x(),{config:a,loading:t,saving:n,error:i,reload:m}=k(),[u,c]=p.useState(!1),h=l.find(r=>s.pathname.endsWith(r.path))??l[0];return e.jsx(N,{mode:"auto",listHeader:e.jsx(v,{title:"AI Config"}),list:e.jsx(T,{}),mainHeader:e.jsx("div",{className:"flex h-full min-w-0 items-center px-4",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"text-sm font-semibold text-foreground",children:["AI Config · ",h.label]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Pod-level AI and derived-index policy"})]})}),main:e.jsxs("section",{className:"min-h-full bg-background",children:[n&&e.jsx("div",{role:"status","aria-live":"polite",className:"border-b border-border px-6 py-2 text-xs text-muted-foreground",children:"Saving AI configuration…"}),i?e.jsx(z,{error:i,showTechnicalDetails:u,onToggleTechnicalDetails:()=>c(r=>!r),onRetry:()=>{c(!1),m()}}):t||!a?e.jsx(P,{}):e.jsx(g,{})]}),className:"min-h-full"})}function z({error:s,showTechnicalDetails:a,onToggleTechnicalDetails:t,onRetry:n}){return e.jsx("div",{className:"mx-auto w-full max-w-4xl p-6",children:e.jsxs("div",{role:"alert","aria-live":"assertive",className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"AI configuration could not be loaded"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Xpod could not read this Pod’s AI settings. Your existing settings were not changed."}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:n,className:"h-9 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground hover:bg-primary/90",children:"Try again"}),e.jsx("button",{type:"button","aria-expanded":a,onClick:t,className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground hover:bg-accent",children:a?"Hide details":"Show details"})]}),a&&e.jsx("p",{className:"mt-3 break-words font-mono text-xs text-muted-foreground",children:s})]})})}function P(){return e.jsxs("div",{role:"status","aria-live":"polite",className:"mx-auto w-full max-w-4xl p-6",children:[e.jsx("div",{className:"h-7 w-52 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"mt-3 h-4 w-80 max-w-full animate-pulse rounded bg-muted"}),e.jsx("div",{className:"mt-6 divide-y divide-border overflow-hidden rounded-xl border border-border",children:Array.from({length:4},(s,a)=>e.jsxs("div",{className:"grid gap-4 p-4 lg:grid-cols-[minmax(220px,1fr)_minmax(320px,440px)]",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 w-28 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"h-3 w-52 animate-pulse rounded bg-muted"})]}),e.jsx("div",{className:"h-10 animate-pulse rounded-md bg-muted"})]},a))}),e.jsx("span",{className:"sr-only",children:"Loading AI configuration…"})]})}function T(){const s=w();return e.jsx("aside",{className:"h-full border-r border-border bg-muted/20 py-2",children:e.jsx("nav",{"aria-label":"AI Config sections","data-list-navigation":!0,children:l.map(a=>{const t=a.icon;return e.jsxs(f,{to:a.path,end:a.end,onClick:()=>s.openMain(),onKeyDown:y,className:({isActive:n})=>b(n,{compact:!1}),children:[e.jsx(t,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-sm font-medium",children:a.label}),e.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-muted-foreground",children:a.description})]})]},a.id)})})})}export{W as default};
1
+ import{c as d,j as e,k as x,r as p,O as g,N as f,l as y,m as b}from"./auth-callback-Htr_CB_g.js";import{P as v}from"./PaneListHeader-mLMe_dvU.js";import{A as j,u as k}from"./AiConfigContext-BvBdu_A3.js";import{T as N,u as w}from"./workspace-layout-IVCSYU21.js";import"./ai-connections-Bm52UO7Y.js";const M=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],C=d("file-search",M);const A=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M7 12H3",key:"13ou7f"}],["path",{d:"M7 19H3",key:"wbqt3n"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14",key:"qth677"}],["path",{d:"M11 10v4h4",key:"172dkj"}]],I=d("list-restart",A);const L=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]],H=d("scan-text",L);const q=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],_=d("sliders-horizontal",q);function o(s,a,t,n,i){return{id:s,label:a,path:t,href:`/ai-config/${t}`,end:!0,description:n,icon:i}}const l=[o("model-assignments","Model Assignments","model-assignments","Choose the model used by each Xpod capability.",_),o("document-processing","Document Processing","document-processing","Control OCR and structured document reading.",H),o("search-indexing","Search & Indexing","search-indexing","Enable FTS, vector retrieval, and backend selection.",C),o("index-lifecycle","Index Lifecycle","index-lifecycle","Control automatic indexing and derived-index rebuilds.",I)];function W(){return e.jsx(j,{children:e.jsx(S,{})})}function S(){const s=x(),{config:a,loading:t,saving:n,error:i,reload:m}=k(),[u,c]=p.useState(!1),h=l.find(r=>s.pathname.endsWith(r.path))??l[0];return e.jsx(N,{mode:"auto",listHeader:e.jsx(v,{title:"AI Config"}),list:e.jsx(T,{}),mainHeader:e.jsx("div",{className:"flex h-full min-w-0 items-center px-4",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h1",{className:"text-sm font-semibold text-foreground",children:["AI Config · ",h.label]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Pod-level AI and derived-index policy"})]})}),main:e.jsxs("section",{className:"min-h-full bg-background",children:[n&&e.jsx("div",{role:"status","aria-live":"polite",className:"border-b border-border px-6 py-2 text-xs text-muted-foreground",children:"Saving AI configuration…"}),i?e.jsx(z,{error:i,showTechnicalDetails:u,onToggleTechnicalDetails:()=>c(r=>!r),onRetry:()=>{c(!1),m()}}):t||!a?e.jsx(P,{}):e.jsx(g,{})]}),className:"min-h-full"})}function z({error:s,showTechnicalDetails:a,onToggleTechnicalDetails:t,onRetry:n}){return e.jsx("div",{className:"mx-auto w-full max-w-4xl p-6",children:e.jsxs("div",{role:"alert","aria-live":"assertive",className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"AI configuration could not be loaded"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Xpod could not read this Pod’s AI settings. Your existing settings were not changed."}),e.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:n,className:"h-9 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground hover:bg-primary/90",children:"Try again"}),e.jsx("button",{type:"button","aria-expanded":a,onClick:t,className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground hover:bg-accent",children:a?"Hide details":"Show details"})]}),a&&e.jsx("p",{className:"mt-3 break-words font-mono text-xs text-muted-foreground",children:s})]})})}function P(){return e.jsxs("div",{role:"status","aria-live":"polite",className:"mx-auto w-full max-w-4xl p-6",children:[e.jsx("div",{className:"h-7 w-52 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"mt-3 h-4 w-80 max-w-full animate-pulse rounded bg-muted"}),e.jsx("div",{className:"mt-6 divide-y divide-border overflow-hidden rounded-xl border border-border",children:Array.from({length:4},(s,a)=>e.jsxs("div",{className:"grid gap-4 p-4 lg:grid-cols-[minmax(220px,1fr)_minmax(320px,440px)]",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 w-28 animate-pulse rounded bg-muted"}),e.jsx("div",{className:"h-3 w-52 animate-pulse rounded bg-muted"})]}),e.jsx("div",{className:"h-10 animate-pulse rounded-md bg-muted"})]},a))}),e.jsx("span",{className:"sr-only",children:"Loading AI configuration…"})]})}function T(){const s=w();return e.jsx("aside",{className:"h-full border-r border-border bg-muted/20 py-2",children:e.jsx("nav",{"aria-label":"AI Config sections","data-list-navigation":!0,children:l.map(a=>{const t=a.icon;return e.jsxs(f,{to:a.path,end:a.end,onClick:()=>s.openMain(),onKeyDown:y,className:({isActive:n})=>b(n,{compact:!1}),children:[e.jsx(t,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-sm font-medium",children:a.label}),e.jsx("span",{className:"mt-0.5 block text-xs leading-4 text-muted-foreground",children:a.description})]})]},a.id)})})})}export{W as default};
@@ -1 +1 @@
1
- import{r as u,j as a}from"./auth-callback-ai6OMe6C.js";import{i as g,A as x}from"./ModelAssignmentsPanel-Iew2QgtR.js";import{u as p}from"./AiConfigContext-DNfRNaZQ.js";import"./ai-connections-Bm52UO7Y.js";function C(){const{config:s,save:o,saving:t}=p(),[e,r]=u.useState(s?.documentProcessing);if(u.useEffect(()=>{let n=!1;return queueMicrotask(()=>{n||r(s?.documentProcessing)}),()=>{n=!0}},[s]),!e)return null;const l=g(e,s?.documentProcessing),b=async n=>{n.preventDefault(),await o({documentProcessing:e})};return a.jsx(x,{title:"Document Processing",description:"Control when Xpod invokes OCR and structured document readers.",onSubmit:b,onRestore:()=>o({documentProcessing:{ocrEnabled:!0,automaticOcr:!0,imageRecognition:!0,pdfRecognition:!0,tableRecognition:!1,processingMode:"auto",ocrFallbackOrder:["ocr","reader","plain-text"],readerPolicy:"auto",readerPriority:"structure-first",maxFileSizeMb:64,maxPages:500,failureFallback:"plain-text"}}),saving:t,dirty:l,children:a.jsxs("div",{className:"space-y-4 rounded-xl border border-border p-4",children:[a.jsx(i,{label:"Enable OCR",description:"Read text from images and scanned documents.",checked:e.ocrEnabled,onChange:n=>r({...e,ocrEnabled:n})}),a.jsx(i,{label:"Automatic OCR",description:"Run OCR when indexed content has no usable text layer.",checked:e.automaticOcr,onChange:n=>r({...e,automaticOcr:n})}),a.jsx(i,{label:"Image recognition",description:"Allow OCR and readers to process image resources.",checked:e.imageRecognition,onChange:n=>r({...e,imageRecognition:n})}),a.jsx(i,{label:"PDF recognition",description:"Process native and scanned PDF resources.",checked:e.pdfRecognition,onChange:n=>r({...e,pdfRecognition:n})}),a.jsx(i,{label:"Table recognition",description:"Preserve detected table structure when the reader supports it.",checked:e.tableRecognition,onChange:n=>r({...e,tableRecognition:n})}),a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:["Processing mode",a.jsxs("select",{name:"processingMode",value:e.processingMode,onChange:n=>r({...e,processingMode:n.target.value}),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm sm:max-w-xs",children:[a.jsx("option",{value:"auto",children:"Auto"}),a.jsx("option",{value:"on-demand",children:"On demand"})]})]}),a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:["OCR fallback order",a.jsx("input",{value:e.ocrFallbackOrder.join(", "),onChange:n=>r({...e,ocrFallbackOrder:n.target.value.split(",").map(c=>c.trim()).filter(c=>["ocr","reader","plain-text"].includes(c))}),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm"})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(d,{label:"Reader policy",value:e.readerPolicy,options:["auto","always","disabled"],onChange:n=>r({...e,readerPolicy:n})}),a.jsx(d,{label:"Reader priority",value:e.readerPriority,options:["structure-first","speed-first"],onChange:n=>r({...e,readerPriority:n})}),a.jsx(m,{label:"Maximum file size (MB)",value:e.maxFileSizeMb,min:1,max:1024,onChange:n=>r({...e,maxFileSizeMb:n})}),a.jsx(m,{label:"Maximum pages",value:e.maxPages,min:1,max:1e4,onChange:n=>r({...e,maxPages:n})}),a.jsx(d,{label:"Failure fallback",value:e.failureFallback,options:["plain-text","skip"],onChange:n=>r({...e,failureFallback:n})})]})]})})}function d({label:s,value:o,options:t,onChange:e}){return a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:[s,a.jsx("select",{value:o,onChange:r=>e(r.target.value),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm",children:t.map(r=>a.jsx("option",{value:r,children:r},r))})]})}function m({label:s,value:o,min:t,max:e,onChange:r}){return a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:[s,a.jsx("input",{type:"number",value:o,min:t,max:e,onChange:l=>r(l.target.valueAsNumber),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm"})]})}function i({label:s,description:o,checked:t,onChange:e}){return a.jsxs("label",{className:"flex items-start justify-between gap-4",children:[a.jsxs("span",{children:[a.jsx("span",{className:"block text-sm font-medium",children:s}),a.jsx("span",{className:"block text-xs text-muted-foreground",children:o})]}),a.jsx("input",{type:"checkbox",checked:t,onChange:r=>e(r.target.checked),className:"mt-1 h-4 w-4 rounded border-input"})]})}export{C as DocumentProcessingPanel};
1
+ import{r as u,j as a}from"./auth-callback-Htr_CB_g.js";import{i as g,A as x}from"./ModelAssignmentsPanel-KA6Mdndz.js";import{u as p}from"./AiConfigContext-BvBdu_A3.js";import"./ai-connections-Bm52UO7Y.js";function C(){const{config:s,save:o,saving:t}=p(),[e,r]=u.useState(s?.documentProcessing);if(u.useEffect(()=>{let n=!1;return queueMicrotask(()=>{n||r(s?.documentProcessing)}),()=>{n=!0}},[s]),!e)return null;const l=g(e,s?.documentProcessing),b=async n=>{n.preventDefault(),await o({documentProcessing:e})};return a.jsx(x,{title:"Document Processing",description:"Control when Xpod invokes OCR and structured document readers.",onSubmit:b,onRestore:()=>o({documentProcessing:{ocrEnabled:!0,automaticOcr:!0,imageRecognition:!0,pdfRecognition:!0,tableRecognition:!1,processingMode:"auto",ocrFallbackOrder:["ocr","reader","plain-text"],readerPolicy:"auto",readerPriority:"structure-first",maxFileSizeMb:64,maxPages:500,failureFallback:"plain-text"}}),saving:t,dirty:l,children:a.jsxs("div",{className:"space-y-4 rounded-xl border border-border p-4",children:[a.jsx(i,{label:"Enable OCR",description:"Read text from images and scanned documents.",checked:e.ocrEnabled,onChange:n=>r({...e,ocrEnabled:n})}),a.jsx(i,{label:"Automatic OCR",description:"Run OCR when indexed content has no usable text layer.",checked:e.automaticOcr,onChange:n=>r({...e,automaticOcr:n})}),a.jsx(i,{label:"Image recognition",description:"Allow OCR and readers to process image resources.",checked:e.imageRecognition,onChange:n=>r({...e,imageRecognition:n})}),a.jsx(i,{label:"PDF recognition",description:"Process native and scanned PDF resources.",checked:e.pdfRecognition,onChange:n=>r({...e,pdfRecognition:n})}),a.jsx(i,{label:"Table recognition",description:"Preserve detected table structure when the reader supports it.",checked:e.tableRecognition,onChange:n=>r({...e,tableRecognition:n})}),a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:["Processing mode",a.jsxs("select",{name:"processingMode",value:e.processingMode,onChange:n=>r({...e,processingMode:n.target.value}),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm sm:max-w-xs",children:[a.jsx("option",{value:"auto",children:"Auto"}),a.jsx("option",{value:"on-demand",children:"On demand"})]})]}),a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:["OCR fallback order",a.jsx("input",{value:e.ocrFallbackOrder.join(", "),onChange:n=>r({...e,ocrFallbackOrder:n.target.value.split(",").map(c=>c.trim()).filter(c=>["ocr","reader","plain-text"].includes(c))}),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm"})]}),a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(d,{label:"Reader policy",value:e.readerPolicy,options:["auto","always","disabled"],onChange:n=>r({...e,readerPolicy:n})}),a.jsx(d,{label:"Reader priority",value:e.readerPriority,options:["structure-first","speed-first"],onChange:n=>r({...e,readerPriority:n})}),a.jsx(m,{label:"Maximum file size (MB)",value:e.maxFileSizeMb,min:1,max:1024,onChange:n=>r({...e,maxFileSizeMb:n})}),a.jsx(m,{label:"Maximum pages",value:e.maxPages,min:1,max:1e4,onChange:n=>r({...e,maxPages:n})}),a.jsx(d,{label:"Failure fallback",value:e.failureFallback,options:["plain-text","skip"],onChange:n=>r({...e,failureFallback:n})})]})]})})}function d({label:s,value:o,options:t,onChange:e}){return a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:[s,a.jsx("select",{value:o,onChange:r=>e(r.target.value),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm",children:t.map(r=>a.jsx("option",{value:r,children:r},r))})]})}function m({label:s,value:o,min:t,max:e,onChange:r}){return a.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:[s,a.jsx("input",{type:"number",value:o,min:t,max:e,onChange:l=>r(l.target.valueAsNumber),className:"block h-10 w-full rounded-md border border-input bg-background px-3 text-sm"})]})}function i({label:s,description:o,checked:t,onChange:e}){return a.jsxs("label",{className:"flex items-start justify-between gap-4",children:[a.jsxs("span",{children:[a.jsx("span",{className:"block text-sm font-medium",children:s}),a.jsx("span",{className:"block text-xs text-muted-foreground",children:o})]}),a.jsx("input",{type:"checkbox",checked:t,onChange:r=>e(r.target.checked),className:"mt-1 h-4 w-4 rounded border-input"})]})}export{C as DocumentProcessingPanel};
@@ -1 +1 @@
1
- import{r as l,j as e}from"./auth-callback-ai6OMe6C.js";import{i as h,A as b}from"./ModelAssignmentsPanel-Iew2QgtR.js";import{u as g}from"./AiConfigContext-DNfRNaZQ.js";import"./ai-connections-Bm52UO7Y.js";function k(){const{config:s,capabilities:i,lifecycle:d,save:n,rebuild:u,saving:m,rebuilding:x}=g(),[r,a]=l.useState(s?.lifecycle);if(l.useEffect(()=>{let t=!1;return queueMicrotask(()=>{t||a(s?.lifecycle)}),()=>{t=!0}},[s]),!r)return null;const f=h(r,s?.lifecycle),p=async t=>{t.preventDefault(),await n({lifecycle:r})};return e.jsxs(b,{title:"Index Lifecycle",description:"Control automatic maintenance and explicitly schedule rebuilds of derived data.",onSubmit:p,onRestore:()=>n({lifecycle:{automaticIndexing:!0,refreshAfterSourceUpdate:!0,removeAfterSourceDeletion:!0}}),saving:m,dirty:f,children:[e.jsxs("div",{className:"divide-y divide-border rounded-xl border border-border",children:[e.jsxs("label",{className:"flex items-start justify-between gap-4 p-4",children:[e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-medium",children:"Automatically index changes"}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:"Index new and updated resources, and remove derived entries after deletion."})]}),e.jsx("input",{name:"automaticIndexing",type:"checkbox",checked:r.automaticIndexing,onChange:t=>a({...r,automaticIndexing:t.target.checked}),className:"mt-1 h-4 w-4 rounded border-input"})]}),e.jsx(c,{label:"Refresh after source updates",checked:r.refreshAfterSourceUpdate,onChange:t=>a({...r,refreshAfterSourceUpdate:t})}),e.jsx(c,{label:"Remove derived entries after source deletion",checked:r.removeAfterSourceDeletion,onChange:t=>a({...r,removeAfterSourceDeletion:t})})]}),e.jsxs("section",{className:"rounded-xl border border-border p-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Rebuild derived indexes"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Rebuild actions never modify authority data in the Pod."}),e.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:["fts","vector","all"].map(t=>e.jsxs("button",{type:"button",disabled:!i?.rebuildTargets?.includes(t)||x,onClick:()=>u(t),className:"h-9 rounded-md border border-input px-3 text-sm font-medium disabled:opacity-50",children:["Rebuild ",t==="all"?"all":t.toUpperCase()]},t))})]}),e.jsxs("section",{className:"rounded-xl border border-border p-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Lifecycle evidence"}),e.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[e.jsx(o,{label:"Configuration version",value:d?.configurationVersion??s?.updatedAt??"Default"}),e.jsx(o,{label:"Pending queue",value:String(d?.pending??0)})]}),e.jsx("div",{className:"mt-4 space-y-2",children:d?.recent.length?d.recent.map(t=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border p-3 text-sm",children:[e.jsxs("span",{children:[t.target.toUpperCase()," · ",t.status]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.progress??0,"% · ",new Date(t.createdAt).toLocaleString()]}),t.error?e.jsx("span",{className:"w-full text-xs text-destructive",children:t.error}):null]},t.id)):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No rebuild jobs have been scheduled."})})]})]})}function c({label:s,checked:i,onChange:d}){return e.jsxs("label",{className:"flex items-start justify-between gap-4 p-4",children:[e.jsx("span",{className:"text-sm font-medium",children:s}),e.jsx("input",{type:"checkbox",checked:i,onChange:n=>d(n.target.checked),className:"mt-1 h-4 w-4 rounded border-input"})]})}function o({label:s,value:i}){return e.jsxs("div",{className:"rounded-md border border-border p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s}),e.jsx("div",{className:"mt-1 text-sm font-medium",children:i})]})}export{k as IndexLifecyclePanel};
1
+ import{r as l,j as e}from"./auth-callback-Htr_CB_g.js";import{i as h,A as b}from"./ModelAssignmentsPanel-KA6Mdndz.js";import{u as g}from"./AiConfigContext-BvBdu_A3.js";import"./ai-connections-Bm52UO7Y.js";function k(){const{config:s,capabilities:i,lifecycle:d,save:n,rebuild:u,saving:m,rebuilding:x}=g(),[r,a]=l.useState(s?.lifecycle);if(l.useEffect(()=>{let t=!1;return queueMicrotask(()=>{t||a(s?.lifecycle)}),()=>{t=!0}},[s]),!r)return null;const f=h(r,s?.lifecycle),p=async t=>{t.preventDefault(),await n({lifecycle:r})};return e.jsxs(b,{title:"Index Lifecycle",description:"Control automatic maintenance and explicitly schedule rebuilds of derived data.",onSubmit:p,onRestore:()=>n({lifecycle:{automaticIndexing:!0,refreshAfterSourceUpdate:!0,removeAfterSourceDeletion:!0}}),saving:m,dirty:f,children:[e.jsxs("div",{className:"divide-y divide-border rounded-xl border border-border",children:[e.jsxs("label",{className:"flex items-start justify-between gap-4 p-4",children:[e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-medium",children:"Automatically index changes"}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:"Index new and updated resources, and remove derived entries after deletion."})]}),e.jsx("input",{name:"automaticIndexing",type:"checkbox",checked:r.automaticIndexing,onChange:t=>a({...r,automaticIndexing:t.target.checked}),className:"mt-1 h-4 w-4 rounded border-input"})]}),e.jsx(c,{label:"Refresh after source updates",checked:r.refreshAfterSourceUpdate,onChange:t=>a({...r,refreshAfterSourceUpdate:t})}),e.jsx(c,{label:"Remove derived entries after source deletion",checked:r.removeAfterSourceDeletion,onChange:t=>a({...r,removeAfterSourceDeletion:t})})]}),e.jsxs("section",{className:"rounded-xl border border-border p-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Rebuild derived indexes"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Rebuild actions never modify authority data in the Pod."}),e.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:["fts","vector","all"].map(t=>e.jsxs("button",{type:"button",disabled:!i?.rebuildTargets?.includes(t)||x,onClick:()=>u(t),className:"h-9 rounded-md border border-input px-3 text-sm font-medium disabled:opacity-50",children:["Rebuild ",t==="all"?"all":t.toUpperCase()]},t))})]}),e.jsxs("section",{className:"rounded-xl border border-border p-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Lifecycle evidence"}),e.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[e.jsx(o,{label:"Configuration version",value:d?.configurationVersion??s?.updatedAt??"Default"}),e.jsx(o,{label:"Pending queue",value:String(d?.pending??0)})]}),e.jsx("div",{className:"mt-4 space-y-2",children:d?.recent.length?d.recent.map(t=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border p-3 text-sm",children:[e.jsxs("span",{children:[t.target.toUpperCase()," · ",t.status]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.progress??0,"% · ",new Date(t.createdAt).toLocaleString()]}),t.error?e.jsx("span",{className:"w-full text-xs text-destructive",children:t.error}):null]},t.id)):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No rebuild jobs have been scheduled."})})]})]})}function c({label:s,checked:i,onChange:d}){return e.jsxs("label",{className:"flex items-start justify-between gap-4 p-4",children:[e.jsx("span",{className:"text-sm font-medium",children:s}),e.jsx("input",{type:"checkbox",checked:i,onChange:n=>d(n.target.checked),className:"mt-1 h-4 w-4 rounded border-input"})]})}function o({label:s,value:i}){return e.jsxs("div",{className:"rounded-md border border-border p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s}),e.jsx("div",{className:"mt-1 text-sm font-medium",children:i})]})}export{k as IndexLifecyclePanel};
@@ -1 +1 @@
1
- import{r as l,j as e,B as g,R as j,C as p,a as y,b,d as S,e as N}from"./auth-callback-ai6OMe6C.js";import{g as C}from"./admin-BU4m6Ko2.js";import{S as m}from"./skeleton-CgcxPTqc.js";function F({kind:r}){const[s,n]=l.useState(null),[d,t]=l.useState(!1),i=l.useCallback(async()=>{t(!0);try{n(await C())}finally{t(!1)}},[]);return l.useEffect(()=>{let c=!0;return Promise.resolve().then(()=>{c&&i()}),()=>{c=!1}},[i]),e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs(g,{type:"button",size:"sm",variant:"outline",onClick:i,disabled:d,children:[e.jsx(j,{className:"mr-2 h-4 w-4"}),"Refresh"]})}),e.jsx("div",{role:"status","aria-live":"polite",className:"sr-only",children:d?"Refreshing index evidence…":s?"Index evidence refreshed.":"Waiting for index evidence."}),e.jsxs(p,{children:[e.jsxs(y,{children:[e.jsx(b,{children:w[r]}),e.jsx(S,{children:"Observed derived-index state; policy changes belong in AI Config."})]}),e.jsx(N,{children:d&&!s?e.jsx(B,{}):R(r,s)})]})]})}const w={overview:"Index Overview",fts:"FTS",vector:"Vector","retrieval-points":"Retrieval Points",cache:"Cache","slow-queries":"Slow Queries",benchmark:"Benchmark"};function R(r,s){if(!s)return e.jsx("p",{className:"text-sm text-muted-foreground",children:"Waiting for runtime evidence."});if(r==="benchmark"){const t=s.benchmarkReports;return e.jsx(a,{values:[["Reports",String(t?.reportCount??0)],["Skipped files",String(t?.skippedFiles??0)],["Errors",String(t?.errors.length??0)]]})}if(!s.available)return e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Unavailable: ",s.reason]});if(r==="overview"){const t=s.stats.lifecycle;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(a,{values:[["Engine",s.engine],["State",v(t?.status)],["Authority data",o(s.stats.factsBytes)],["Derived storage",o(s.stats.derivedBytes)],["Total storage",o(s.stats.totalBytes)],["Generated",f(s.generatedAt)]]}),e.jsx(x,{children:"Derived indexes are rebuildable runtime evidence; Pod RDF remains the authority data."})]})}if(r==="cache"){const t=s.stats.derivedCache;return t?e.jsx(a,{values:[["Cache bytes",o(t.cacheBytes)],["Limit",o(t.maxCacheBytes)],["Pressure",`${Math.round(t.cachePressure*100)}%`],["Evictions",String(t.evictionCount)]]}):e.jsx(u,{})}if(r==="slow-queries"){const t=s.stats.slowQueries;return t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{values:[["Captured",String(t.entryCount)],["Limit",String(t.maxEntries)]]}),t.entries.slice(0,10).map(i=>e.jsxs("div",{className:"rounded-lg border border-border p-3 text-sm",children:[e.jsxs("div",{className:"font-medium",children:[i.runtime.durationMs," ms · ",i.runtime.returnedRows," rows"]}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:i.reasons.join(", ")||i.queryKey})]},`${i.generatedAt}-${i.queryKey}`))]}):e.jsx(u,{})}if(r==="retrieval-points"){const t=s.stats.rdf3x;return t?e.jsx(a,{values:[["State",t.syncedWithFacts?"Synchronized":`${t.refreshLag} versions behind`],["Facts version",String(t.factsDataVersion)],["Retrieval version",String(t.rdf3xFactsDataVersion)],["Pending sources",String(t.pendingSources)]]}):e.jsx(u,{})}const n=s.stats.lifecycle,d=r==="fts"?n?.coldStart?.ownsTextIndex:n?.coldStart?.ownsVectorIndex;if((r==="fts"||r==="vector")&&d){const t=s.stats.pgAcceleration,i=s.stats.rdf3x;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(a,{values:[["State",v(n?.status)],["Ownership","Runtime managed"],["Backend",t?.provider?`${h(t.provider)}${t.version?` ${t.version}`:""}`:n?.driver??"Not reported"],["Freshness",i?i.syncedWithFacts?"Current":`${i.refreshLag} versions behind`:"Not reported"],["Indexes",t?.customIndexes?.map(c=>c.name).join(", ")||"Runtime managed"],["Last ready",f(n?.lastReadyAt)]]}),e.jsxs(x,{children:[r==="fts"?"Text retrieval":"Vector retrieval"," is derived from Pod authority data. Enablement and backend policy are configured in AI Config."]})]})}return e.jsx(u,{})}function a({values:r}){return e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:r.map(([s,n])=>e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s}),e.jsx("div",{className:"mt-1 font-medium",children:n})]},s))})}function B(){return e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","aria-hidden":"true",children:Array.from({length:4},(r,s)=>e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx(m,{className:"h-3 w-20"}),e.jsx(m,{className:"mt-2 h-5 w-28"})]},s))})}function u(){return e.jsx("p",{className:"text-sm text-muted-foreground",children:"This runtime does not report evidence for this index subject."})}function x({children:r}){return e.jsx("p",{className:"text-sm text-muted-foreground",children:r})}function o(r){return r<1024?`${r} B`:r<1024*1024?`${Math.round(r/1024)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}function f(r){return r?new Date(r).toLocaleString():"Not reported"}function v(r){return r?h(r):"Unknown"}function h(r){return r.charAt(0).toUpperCase()+r.slice(1)}export{F as default};
1
+ import{r as l,j as e,B as g,R as j,C as p,a as y,b,d as S,e as N}from"./auth-callback-Htr_CB_g.js";import{g as C}from"./admin-BU4m6Ko2.js";import{S as m}from"./skeleton-F4nrpycc.js";function F({kind:r}){const[s,n]=l.useState(null),[d,t]=l.useState(!1),i=l.useCallback(async()=>{t(!0);try{n(await C())}finally{t(!1)}},[]);return l.useEffect(()=>{let c=!0;return Promise.resolve().then(()=>{c&&i()}),()=>{c=!1}},[i]),e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs(g,{type:"button",size:"sm",variant:"outline",onClick:i,disabled:d,children:[e.jsx(j,{className:"mr-2 h-4 w-4"}),"Refresh"]})}),e.jsx("div",{role:"status","aria-live":"polite",className:"sr-only",children:d?"Refreshing index evidence…":s?"Index evidence refreshed.":"Waiting for index evidence."}),e.jsxs(p,{children:[e.jsxs(y,{children:[e.jsx(b,{children:w[r]}),e.jsx(S,{children:"Observed derived-index state; policy changes belong in AI Config."})]}),e.jsx(N,{children:d&&!s?e.jsx(B,{}):R(r,s)})]})]})}const w={overview:"Index Overview",fts:"FTS",vector:"Vector","retrieval-points":"Retrieval Points",cache:"Cache","slow-queries":"Slow Queries",benchmark:"Benchmark"};function R(r,s){if(!s)return e.jsx("p",{className:"text-sm text-muted-foreground",children:"Waiting for runtime evidence."});if(r==="benchmark"){const t=s.benchmarkReports;return e.jsx(a,{values:[["Reports",String(t?.reportCount??0)],["Skipped files",String(t?.skippedFiles??0)],["Errors",String(t?.errors.length??0)]]})}if(!s.available)return e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Unavailable: ",s.reason]});if(r==="overview"){const t=s.stats.lifecycle;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(a,{values:[["Engine",s.engine],["State",v(t?.status)],["Authority data",o(s.stats.factsBytes)],["Derived storage",o(s.stats.derivedBytes)],["Total storage",o(s.stats.totalBytes)],["Generated",f(s.generatedAt)]]}),e.jsx(x,{children:"Derived indexes are rebuildable runtime evidence; Pod RDF remains the authority data."})]})}if(r==="cache"){const t=s.stats.derivedCache;return t?e.jsx(a,{values:[["Cache bytes",o(t.cacheBytes)],["Limit",o(t.maxCacheBytes)],["Pressure",`${Math.round(t.cachePressure*100)}%`],["Evictions",String(t.evictionCount)]]}):e.jsx(u,{})}if(r==="slow-queries"){const t=s.stats.slowQueries;return t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{values:[["Captured",String(t.entryCount)],["Limit",String(t.maxEntries)]]}),t.entries.slice(0,10).map(i=>e.jsxs("div",{className:"rounded-lg border border-border p-3 text-sm",children:[e.jsxs("div",{className:"font-medium",children:[i.runtime.durationMs," ms · ",i.runtime.returnedRows," rows"]}),e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:i.reasons.join(", ")||i.queryKey})]},`${i.generatedAt}-${i.queryKey}`))]}):e.jsx(u,{})}if(r==="retrieval-points"){const t=s.stats.rdf3x;return t?e.jsx(a,{values:[["State",t.syncedWithFacts?"Synchronized":`${t.refreshLag} versions behind`],["Facts version",String(t.factsDataVersion)],["Retrieval version",String(t.rdf3xFactsDataVersion)],["Pending sources",String(t.pendingSources)]]}):e.jsx(u,{})}const n=s.stats.lifecycle,d=r==="fts"?n?.coldStart?.ownsTextIndex:n?.coldStart?.ownsVectorIndex;if((r==="fts"||r==="vector")&&d){const t=s.stats.pgAcceleration,i=s.stats.rdf3x;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(a,{values:[["State",v(n?.status)],["Ownership","Runtime managed"],["Backend",t?.provider?`${h(t.provider)}${t.version?` ${t.version}`:""}`:n?.driver??"Not reported"],["Freshness",i?i.syncedWithFacts?"Current":`${i.refreshLag} versions behind`:"Not reported"],["Indexes",t?.customIndexes?.map(c=>c.name).join(", ")||"Runtime managed"],["Last ready",f(n?.lastReadyAt)]]}),e.jsxs(x,{children:[r==="fts"?"Text retrieval":"Vector retrieval"," is derived from Pod authority data. Enablement and backend policy are configured in AI Config."]})]})}return e.jsx(u,{})}function a({values:r}){return e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:r.map(([s,n])=>e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s}),e.jsx("div",{className:"mt-1 font-medium",children:n})]},s))})}function B(){return e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","aria-hidden":"true",children:Array.from({length:4},(r,s)=>e.jsxs("div",{className:"rounded-lg border border-border p-3",children:[e.jsx(m,{className:"h-3 w-20"}),e.jsx(m,{className:"mt-2 h-5 w-28"})]},s))})}function u(){return e.jsx("p",{className:"text-sm text-muted-foreground",children:"This runtime does not report evidence for this index subject."})}function x({children:r}){return e.jsx("p",{className:"text-sm text-muted-foreground",children:r})}function o(r){return r<1024?`${r} B`:r<1024*1024?`${Math.round(r/1024)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}function f(r){return r?new Date(r).toLocaleString():"Not reported"}function v(r){return r?h(r):"Unknown"}function h(r){return r.charAt(0).toUpperCase()+r.slice(1)}export{F as default};
@@ -1 +1 @@
1
- import{j as e,u as S,r as g}from"./auth-callback-ai6OMe6C.js";import{m as w,u as C,t as M}from"./AiConfigContext-DNfRNaZQ.js";function A(t,r){return h(t)!==h(r)}function h(t){return Array.isArray(t)?`[${t.map(h).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).filter(([,r])=>r!==void 0).sort(([r],[a])=>r.localeCompare(a)).map(([r,a])=>`${JSON.stringify(r)}:${h(a)}`).join(",")}}`:JSON.stringify(t)}const j=[{label:"General / Chat",name:"chatModel",description:"Used for assistant conversations and general text tasks."},{label:"OCR",name:"ocrModel",description:"Reads text from images and scanned pages."},{label:"Document Reader",name:"readerModel",description:"Extracts structure and content from documents."},{label:"Embedding",name:"embeddingModel",description:"Creates vectors for semantic search."},{label:"Indexer / Summarizer",name:"indexerModel",description:"Prepares and summarizes content for indexes."},{label:"Reranker",name:"rerankerModel",description:"Reorders search results by relevance."}];function k(){const{config:t,models:r,save:a,saving:m}=C(),d=S(),[c,o]=g.useState({}),[x,f]=g.useState(),[i,p]=g.useState({});g.useEffect(()=>{let s=!1;return queueMicrotask(()=>{s||o(t?.models??{})}),()=>{s=!0}},[t]);const b=A(c,t?.models??{}),y=async s=>{s.preventDefault(),await a({models:Object.fromEntries(j.map(({name:l})=>[l,c[l]||null]))})};return e.jsx(N,{title:"Model Assignments",description:"Choose a connected model for each Xpod capability. Unassigned capabilities use the system default.",onSubmit:y,onRestore:()=>a({models:Object.fromEntries(j.map(({name:s})=>[s,null]))}),saving:m,dirty:b,children:e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border",children:j.map(s=>e.jsx(v,{...s,models:r,value:c[s.name],testing:x===s.name,testResult:i[s.name],onChange:l=>o(u=>({...u,[s.name]:l})),onTest:async l=>{f(s.name);try{await M(d.fetch,l),p(u=>({...u,[s.name]:"ready"}))}catch{p(u=>({...u,[s.name]:"failed"}))}finally{f(void 0)}}},s.name))})})}function v({label:t,name:r,description:a,models:m,value:d,testing:c,testResult:o,onChange:x,onTest:f}){const i=m.find(n=>n.ref===d),p=w(m,r),b=i?.capabilities.some(n=>["chat","embedding"].includes(n.toLowerCase()))===!0,l=[i?`Connected · credential ready · ${i.owner}`:d?"Selected model is no longer credential-ready":void 0,o==="ready"?"Probe succeeded":o==="failed"?"Probe failed; review AI Connection health":void 0].filter(Boolean).join(" · "),u=!!(d&&!i)||o==="failed";return e.jsxs("div",{"data-testid":"model-assignment-row",className:"grid gap-3 p-4 lg:grid-cols-[minmax(220px,1fr)_minmax(320px,440px)] lg:items-start",children:[e.jsxs("div",{className:"min-w-0 pt-1",children:[e.jsx("span",{className:"block text-sm font-medium text-foreground",children:t}),e.jsx("span",{className:"mt-0.5 block text-xs leading-5 text-muted-foreground",children:a})]}),e.jsxs("div",{"data-testid":"model-assignment-controls",className:"grid min-w-0 gap-2 sm:grid-cols-[minmax(0,1fr)_4.5rem] sm:items-start",children:[e.jsxs("label",{className:"min-w-0",children:[e.jsxs("span",{className:"sr-only",children:[t," model"]}),e.jsxs("select",{name:r,value:d??"",onChange:n=>x(n.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground",children:[e.jsx("option",{value:"",children:"System default"}),p.map(n=>e.jsxs("option",{value:n.ref,children:[n.displayName??n.id," · ",n.owner]},`${n.owner}:${n.id}`))]})]}),e.jsx("button",{type:"button","aria-label":`Test ${t} model`,disabled:!b||c,title:i?b?"Send a bounded readiness probe":"This model has no bounded probe endpoint":"Select a connected model first",onClick:()=>i&&void f(i),className:"h-10 w-full self-start rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground hover:bg-accent disabled:opacity-50",children:c?"Testing…":"Test"}),l&&e.jsx("span",{role:"status",className:`text-xs sm:col-span-2 ${u?"text-destructive":"text-muted-foreground"}`,children:l})]})]})}function N({title:t,description:r,children:a,onSubmit:m,onRestore:d,footerActions:c,saving:o=!1,dirty:x=!0}){return e.jsxs("form",{onSubmit:m,className:"mx-auto flex w-full max-w-4xl flex-col gap-6 p-6",children:[e.jsxs("header",{children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:t}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm text-muted-foreground",children:r})]}),a,e.jsxs("div",{className:"flex justify-end gap-2 border-t border-border pt-4",children:[e.jsx("span",{role:"status",className:"mr-auto self-center text-xs text-muted-foreground",children:x?"Unsaved changes":"Applied"}),c,e.jsx("button",{type:"button",onClick:d,disabled:o||!d,className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium hover:bg-accent disabled:opacity-50",children:"Restore defaults"}),e.jsx("button",{type:"submit",disabled:o||!m||!x,className:"h-9 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground disabled:opacity-50",children:o?"Saving…":"Save configuration"})]})]})}const E=Object.freeze(Object.defineProperty({__proto__:null,AiConfigForm:N,ModelAssignmentRow:v,ModelAssignmentsPanel:k},Symbol.toStringTag,{value:"Module"}));export{N as A,E as M,A as i};
1
+ import{j as e,u as S,r as g}from"./auth-callback-Htr_CB_g.js";import{m as w,u as C,t as M}from"./AiConfigContext-BvBdu_A3.js";function A(t,r){return h(t)!==h(r)}function h(t){return Array.isArray(t)?`[${t.map(h).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).filter(([,r])=>r!==void 0).sort(([r],[a])=>r.localeCompare(a)).map(([r,a])=>`${JSON.stringify(r)}:${h(a)}`).join(",")}}`:JSON.stringify(t)}const j=[{label:"General / Chat",name:"chatModel",description:"Used for assistant conversations and general text tasks."},{label:"OCR",name:"ocrModel",description:"Reads text from images and scanned pages."},{label:"Document Reader",name:"readerModel",description:"Extracts structure and content from documents."},{label:"Embedding",name:"embeddingModel",description:"Creates vectors for semantic search."},{label:"Indexer / Summarizer",name:"indexerModel",description:"Prepares and summarizes content for indexes."},{label:"Reranker",name:"rerankerModel",description:"Reorders search results by relevance."}];function k(){const{config:t,models:r,save:a,saving:m}=C(),d=S(),[c,o]=g.useState({}),[x,f]=g.useState(),[i,p]=g.useState({});g.useEffect(()=>{let s=!1;return queueMicrotask(()=>{s||o(t?.models??{})}),()=>{s=!0}},[t]);const b=A(c,t?.models??{}),y=async s=>{s.preventDefault(),await a({models:Object.fromEntries(j.map(({name:l})=>[l,c[l]||null]))})};return e.jsx(N,{title:"Model Assignments",description:"Choose a connected model for each Xpod capability. Unassigned capabilities use the system default.",onSubmit:y,onRestore:()=>a({models:Object.fromEntries(j.map(({name:s})=>[s,null]))}),saving:m,dirty:b,children:e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border",children:j.map(s=>e.jsx(v,{...s,models:r,value:c[s.name],testing:x===s.name,testResult:i[s.name],onChange:l=>o(u=>({...u,[s.name]:l})),onTest:async l=>{f(s.name);try{await M(d.fetch,l),p(u=>({...u,[s.name]:"ready"}))}catch{p(u=>({...u,[s.name]:"failed"}))}finally{f(void 0)}}},s.name))})})}function v({label:t,name:r,description:a,models:m,value:d,testing:c,testResult:o,onChange:x,onTest:f}){const i=m.find(n=>n.ref===d),p=w(m,r),b=i?.capabilities.some(n=>["chat","embedding"].includes(n.toLowerCase()))===!0,l=[i?`Connected · credential ready · ${i.owner}`:d?"Selected model is no longer credential-ready":void 0,o==="ready"?"Probe succeeded":o==="failed"?"Probe failed; review AI Connection health":void 0].filter(Boolean).join(" · "),u=!!(d&&!i)||o==="failed";return e.jsxs("div",{"data-testid":"model-assignment-row",className:"grid gap-3 p-4 lg:grid-cols-[minmax(220px,1fr)_minmax(320px,440px)] lg:items-start",children:[e.jsxs("div",{className:"min-w-0 pt-1",children:[e.jsx("span",{className:"block text-sm font-medium text-foreground",children:t}),e.jsx("span",{className:"mt-0.5 block text-xs leading-5 text-muted-foreground",children:a})]}),e.jsxs("div",{"data-testid":"model-assignment-controls",className:"grid min-w-0 gap-2 sm:grid-cols-[minmax(0,1fr)_4.5rem] sm:items-start",children:[e.jsxs("label",{className:"min-w-0",children:[e.jsxs("span",{className:"sr-only",children:[t," model"]}),e.jsxs("select",{name:r,value:d??"",onChange:n=>x(n.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground",children:[e.jsx("option",{value:"",children:"System default"}),p.map(n=>e.jsxs("option",{value:n.ref,children:[n.displayName??n.id," · ",n.owner]},`${n.owner}:${n.id}`))]})]}),e.jsx("button",{type:"button","aria-label":`Test ${t} model`,disabled:!b||c,title:i?b?"Send a bounded readiness probe":"This model has no bounded probe endpoint":"Select a connected model first",onClick:()=>i&&void f(i),className:"h-10 w-full self-start rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground hover:bg-accent disabled:opacity-50",children:c?"Testing…":"Test"}),l&&e.jsx("span",{role:"status",className:`text-xs sm:col-span-2 ${u?"text-destructive":"text-muted-foreground"}`,children:l})]})]})}function N({title:t,description:r,children:a,onSubmit:m,onRestore:d,footerActions:c,saving:o=!1,dirty:x=!0}){return e.jsxs("form",{onSubmit:m,className:"mx-auto flex w-full max-w-4xl flex-col gap-6 p-6",children:[e.jsxs("header",{children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:t}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm text-muted-foreground",children:r})]}),a,e.jsxs("div",{className:"flex justify-end gap-2 border-t border-border pt-4",children:[e.jsx("span",{role:"status",className:"mr-auto self-center text-xs text-muted-foreground",children:x?"Unsaved changes":"Applied"}),c,e.jsx("button",{type:"button",onClick:d,disabled:o||!d,className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium hover:bg-accent disabled:opacity-50",children:"Restore defaults"}),e.jsx("button",{type:"submit",disabled:o||!m||!x,className:"h-9 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground disabled:opacity-50",children:o?"Saving…":"Save configuration"})]})]})}const E=Object.freeze(Object.defineProperty({__proto__:null,AiConfigForm:N,ModelAssignmentRow:v,ModelAssignmentsPanel:k},Symbol.toStringTag,{value:"Module"}));export{N as A,E as M,A as i};