@anvia/studio 0.7.13 → 0.7.16

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 (57) hide show
  1. package/dist/index.d.ts +13 -1
  2. package/dist/index.js +43 -7
  3. package/dist/index.js.map +1 -1
  4. package/dist/ui/assets/agents-page-nyn87qWN.js +2 -0
  5. package/dist/ui/assets/agents-page-nyn87qWN.js.map +1 -0
  6. package/dist/ui/assets/anvia.png +0 -0
  7. package/dist/ui/assets/evals-page-CrS8Nw5a.js +2 -0
  8. package/dist/ui/assets/{evals-page-eIWZ_vsI.js.map → evals-page-CrS8Nw5a.js.map} +1 -1
  9. package/dist/ui/assets/index-D5lHtsjb.js +154 -0
  10. package/dist/ui/assets/index-D5lHtsjb.js.map +1 -0
  11. package/dist/ui/assets/index-Dl647xDC.css +1 -0
  12. package/dist/ui/assets/knowledge-page-bW8GeV7O.js +2 -0
  13. package/dist/ui/assets/knowledge-page-bW8GeV7O.js.map +1 -0
  14. package/dist/ui/assets/logo.png +0 -0
  15. package/dist/ui/assets/mcps-page-CQV4bt_B.js +2 -0
  16. package/dist/ui/assets/mcps-page-CQV4bt_B.js.map +1 -0
  17. package/dist/ui/assets/memory-page-BCS0r7-V.js +2 -0
  18. package/dist/ui/assets/memory-page-BCS0r7-V.js.map +1 -0
  19. package/dist/ui/assets/pipelines-page-COYYrCkj.js +8 -0
  20. package/dist/ui/assets/pipelines-page-COYYrCkj.js.map +1 -0
  21. package/dist/ui/assets/{renderers-CIC1VVRv.js → renderers-m-gqGocU.js} +2 -2
  22. package/dist/ui/assets/{renderers-CIC1VVRv.js.map → renderers-m-gqGocU.js.map} +1 -1
  23. package/dist/ui/assets/{sessions-page-UdXui_Zk.js → sessions-page-DozrArmB.js} +2 -2
  24. package/dist/ui/assets/{sessions-page-UdXui_Zk.js.map → sessions-page-DozrArmB.js.map} +1 -1
  25. package/dist/ui/assets/status-page-BLRlLRKt.js +2 -0
  26. package/dist/ui/assets/status-page-BLRlLRKt.js.map +1 -0
  27. package/dist/ui/assets/tool-runner-BB55tqKT.js +2 -0
  28. package/dist/ui/assets/tool-runner-BB55tqKT.js.map +1 -0
  29. package/dist/ui/assets/tools-page-JpNgNaFG.js +2 -0
  30. package/dist/ui/assets/tools-page-JpNgNaFG.js.map +1 -0
  31. package/dist/ui/assets/trace-browser-41yNH-qC.js +10 -0
  32. package/dist/ui/assets/{trace-browser-Dk7nD7KO.js.map → trace-browser-41yNH-qC.js.map} +1 -1
  33. package/dist/ui/assets/transcript-item-DGNb8jMo.js +3 -0
  34. package/dist/ui/assets/transcript-item-DGNb8jMo.js.map +1 -0
  35. package/dist/ui/index.html +12 -7
  36. package/package.json +4 -4
  37. package/dist/ui/assets/agents-page-B8Tw2e11.js +0 -2
  38. package/dist/ui/assets/agents-page-B8Tw2e11.js.map +0 -1
  39. package/dist/ui/assets/evals-page-eIWZ_vsI.js +0 -2
  40. package/dist/ui/assets/index-C3lio5tU.css +0 -1
  41. package/dist/ui/assets/index-CC5mjRie.js +0 -154
  42. package/dist/ui/assets/index-CC5mjRie.js.map +0 -1
  43. package/dist/ui/assets/knowledge-page-C6WkzIFh.js +0 -2
  44. package/dist/ui/assets/knowledge-page-C6WkzIFh.js.map +0 -1
  45. package/dist/ui/assets/mcps-page-BJ4m_GoP.js +0 -2
  46. package/dist/ui/assets/mcps-page-BJ4m_GoP.js.map +0 -1
  47. package/dist/ui/assets/memory-page-BuerJ-04.js +0 -2
  48. package/dist/ui/assets/memory-page-BuerJ-04.js.map +0 -1
  49. package/dist/ui/assets/pipelines-page-Dx0uB0Dm.js +0 -8
  50. package/dist/ui/assets/pipelines-page-Dx0uB0Dm.js.map +0 -1
  51. package/dist/ui/assets/status-page-DC5pVW4o.js +0 -2
  52. package/dist/ui/assets/status-page-DC5pVW4o.js.map +0 -1
  53. package/dist/ui/assets/tools-page-ByKfOqk3.js +0 -2
  54. package/dist/ui/assets/tools-page-ByKfOqk3.js.map +0 -1
  55. package/dist/ui/assets/trace-browser-Dk7nD7KO.js +0 -10
  56. package/dist/ui/assets/transcript-item-DbtXMj-E.js +0 -3
  57. package/dist/ui/assets/transcript-item-DbtXMj-E.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{i as e,r as t,s as n}from"./utils-BN2yP0LH.js";import{m as r}from"./format-C9HPGfkW.js";import{t as i}from"./RefreshIcon-B3w42HZJ.js";import{M as a,N as o}from"./index-CC5mjRie.js";import{t as s}from"./badge-BH7gz3tB.js";import{n as c,t as l}from"./renderers-CIC1VVRv.js";var u=n(e(),1);function d(e){return e.flatMap(e=>e.sources.map((t,n)=>({key:`${e.agentId}:${m(t,n)}`,agentId:e.agentId,agentName:e.agentName??e.agentId,source:p(t,n)})))}var f=[{id:`static-context`,label:`Static Context`},{id:`dynamic-context`,label:`Dynamic Context`},{id:`dynamic-tools`,label:`Dynamic Tools`},{id:`retrieval-log`,label:`Retrieval Log`}];function p(e,t){return e.sourceId===void 0?{...e,sourceId:h(e,t)}:e}function m(e,t=0){return e.sourceId??h(e,t)}function h(e,t){switch(e.kind){case`static_context`:return`static-context`;case`dynamic_context`:return`dynamic-context-${e.registrationIndex??t}`;case`dynamic_tools`:return`dynamic-tools-${e.registrationIndex??t}`}}function g(e,t){return e.filter(e=>e.kind===t).reduce((e,t)=>e+(t.itemCount??t.count),0)}function _(e){switch(e){case`static_context`:return`Static context`;case`dynamic_context`:return`Dynamic context`;case`dynamic_tools`:return`Dynamic tools`}}function v(e){switch(e){case`static-context`:return`static_context`;case`dynamic-context`:return`dynamic_context`;case`dynamic-tools`:return`dynamic_tools`;case`retrieval-log`:return}}function y(e){return f.find(t=>t.id===e)?.label??`Knowledge`}function b(e,t,n){let r=v(e);if(r===void 0)return`${n} entries`;let i=t.filter(e=>e.source.kind===r),a=g(i.map(e=>e.source),r);return`${i.length} sources / ${a} items`}function x(e){switch(e){case`static_context`:return`Static context`;case`dynamic_context`:return`Dynamic context`;case`dynamic_tool`:return`Dynamic tool`}}var S=t();function C(e){let t=e.state;return(0,S.jsxs)(`section`,{className:`grid min-h-0 grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-xl border border-border/80 bg-card/55`,children:[(0,S.jsx)(`div`,{className:`border-b border-border/80 px-4 py-3`,children:(0,S.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`h2`,{className:`m-0 truncate text-sm font-semibold text-foreground`,children:e.source?.source.label??`Knowledge items`}),(0,S.jsx)(`p`,{className:`m-0 mt-1 truncate text-xs text-muted-foreground`,children:e.source===void 0?`No source selected`:`${e.source.agentId} / ${m(e.source.source)}`})]}),t?.totalCount===void 0?null:(0,S.jsxs)(s,{children:[t.totalCount,` total`]})]})}),(0,S.jsx)(`div`,{className:`min-h-0 overflow-auto`,children:(0,S.jsxs)(`div`,{className:`p-4`,children:[e.source===void 0?(0,S.jsx)(F,{text:`No knowledge source selected`}):null,t?.loading===!0&&t.items.length===0?(0,S.jsx)(F,{text:`Loading items`}):null,t?.error===void 0?null:(0,S.jsx)(F,{text:t.error}),t?.inspectable===!1?(0,S.jsx)(F,{text:t.message??`This source does not expose browseable chunks.`}):null,t?.inspectable!==!1&&t?.loading===!1&&t.items.length===0?(0,S.jsx)(F,{text:`No items in this source`}):null,(0,S.jsx)(`div`,{className:`grid gap-3`,children:t?.items.map(t=>(0,S.jsx)(w,{item:t,source:e.source},`${t.kind}:${t.id}`))})]})}),(0,S.jsxs)(`div`,{className:`flex min-h-12 items-center justify-between gap-3 bg-muted/10 px-4 py-2`,children:[(0,S.jsx)(`span`,{className:` text-xs text-muted-foreground`,children:t===void 0?`0 loaded`:`${t.items.length} loaded`}),(0,S.jsx)(o,{className:`h-8 min-h-8`,type:`button`,variant:`secondary`,disabled:t?.loading===!0||t?.nextCursor===void 0,onClick:e.onLoadMore,children:`Load more`})]})]})}function w(e){return e.item.kind===`dynamic_tool`?(0,S.jsx)(T,{item:e.item,source:e.source}):(0,S.jsxs)(`article`,{className:`grid gap-3 rounded-xl border border-border/80 bg-background/55 p-4`,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`div`,{className:`truncate text-xs font-semibold text-foreground`,children:e.item.toolName??e.item.id}),(0,S.jsx)(`div`,{className:`mt-1 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:x(e.item.kind)})]}),e.item.parameterKeys===void 0||e.item.parameterKeys.length===0?null:(0,S.jsxs)(s,{children:[e.item.parameterKeys.length,` params`]})]}),e.item.description===void 0||e.item.description.length===0?null:(0,S.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground [overflow-wrap:anywhere]`,children:e.item.description}),e.item.text===void 0?null:(0,S.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-sm leading-6 text-foreground [overflow-wrap:anywhere]`,children:e.item.text}),e.item.document===void 0?null:(0,S.jsx)(P,{title:`Document`,value:e.item.document}),e.item.metadata===void 0?null:(0,S.jsx)(P,{title:`Metadata`,value:e.item.metadata}),e.item.parameterKeys===void 0||e.item.parameterKeys.length===0?null:(0,S.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.item.parameterKeys.map(e=>(0,S.jsx)(s,{children:e},e))})]})}function T(e){let t=O(e.item),n=k(e.item),r=t.description??e.item.description,i=r!==void 0&&r.length>0,a=i||n.length>0;return(0,S.jsxs)(`article`,{className:`grid gap-5 rounded-2xl border border-border/80 bg-background/55 p-5`,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-4`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`h3`,{className:`m-0 truncate text-base font-semibold text-foreground`,children:t.name??e.item.toolName??e.item.id}),(0,S.jsx)(`div`,{className:`mt-1 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:`Dynamic tool`})]}),(0,S.jsxs)(s,{children:[n.length,` params`]})]}),i?(0,S.jsx)(`p`,{className:`m-0 max-w-4xl text-sm leading-6 text-muted-foreground [overflow-wrap:anywhere]`,children:r}):null,a||e.item.text===void 0?null:(0,S.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-sm leading-6 text-foreground [overflow-wrap:anywhere]`,children:e.item.text}),(0,S.jsx)(E,{parameters:n}),(0,S.jsx)(D,{item:e.item,source:e.source}),e.item.document===void 0?null:(0,S.jsx)(j,{title:`Raw definition`,value:e.item.document}),e.item.metadata===void 0?null:(0,S.jsx)(j,{title:`Metadata`,value:e.item.metadata})]})}function E(e){return(0,S.jsxs)(`section`,{className:`grid gap-3 border-t border-border/70 pt-4`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsx)(`h4`,{className:`m-0 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:`Parameters`}),(0,S.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:e.parameters.length===0?`No parameters`:`${e.parameters.length} defined`})]}),e.parameters.length===0?(0,S.jsx)(`div`,{className:`rounded-xl border border-dashed border-border/80 px-4 py-3 text-sm text-muted-foreground`,children:`This tool does not declare input parameters.`}):(0,S.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border/80 bg-card/35`,children:(0,S.jsx)(`div`,{className:`overflow-x-auto`,children:(0,S.jsxs)(`table`,{className:`w-full min-w-full border-separate border-spacing-0 text-left`,children:[(0,S.jsx)(`thead`,{className:`bg-muted/20`,children:(0,S.jsxs)(`tr`,{children:[(0,S.jsx)(`th`,{className:`border-b border-border/80 px-4 py-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:`Name`}),(0,S.jsx)(`th`,{className:`border-b border-border/80 px-4 py-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:`Type`}),(0,S.jsx)(`th`,{className:`border-b border-border/80 px-4 py-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:`Required`}),(0,S.jsx)(`th`,{className:`border-b border-border/80 px-4 py-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:`Description`})]})}),(0,S.jsx)(`tbody`,{children:e.parameters.map(e=>(0,S.jsxs)(`tr`,{children:[(0,S.jsx)(`td`,{className:`border-b border-border/70 px-4 py-3 text-sm font-semibold leading-6 text-foreground [overflow-wrap:anywhere]`,children:e.name}),(0,S.jsx)(`td`,{className:`border-b border-border/70 px-4 py-3 text-sm leading-6 text-muted-foreground [overflow-wrap:anywhere]`,children:e.type}),(0,S.jsx)(`td`,{className:`border-b border-border/70 px-4 py-3 text-sm leading-6 text-muted-foreground`,children:e.required?`Yes`:`No`}),(0,S.jsx)(`td`,{className:`border-b border-border/70 px-4 py-3 text-sm leading-6 text-muted-foreground [overflow-wrap:anywhere]`,children:e.description??`No description`})]},e.name))})]})})})]})}function D(e){let t=[{label:`Agent`,value:e.source?.agentName??e.source?.agentId},{label:`Source`,value:e.source===void 0?void 0:`${e.source.source.label??_(e.source.source.kind)} / ${m(e.source.source)}`},{label:`Item ID`,value:e.item.id}].filter(e=>e.value!==void 0);return t.length===0?null:(0,S.jsxs)(`section`,{className:`grid gap-3 border-t border-border/70 pt-4`,children:[(0,S.jsx)(`h4`,{className:`m-0 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:`Source`}),(0,S.jsx)(`dl`,{className:`grid gap-2 sm:grid-cols-3`,children:t.map(e=>(0,S.jsxs)(`div`,{className:`min-w-0 rounded-xl border border-border/70 bg-card/25 p-3`,children:[(0,S.jsx)(`dt`,{className:`text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:e.label}),(0,S.jsx)(`dd`,{className:`m-0 mt-1 truncate text-sm font-medium text-foreground`,children:e.value})]},e.label))})]})}function O(e){let t=r(e.document)?e.document:void 0,n=r(t?.definition)?t.definition:void 0;return{name:typeof n?.name==`string`?n.name:typeof t?.toolName==`string`?t.toolName:e.toolName,description:typeof n?.description==`string`?n.description:e.description,parameters:n?.parameters}}function k(e){let t=O(e),n=r(t.parameters)?t.parameters:void 0,i=r(n?.properties)?n.properties:void 0,a=new Set(Array.isArray(n?.required)?n.required.filter(e=>typeof e==`string`):[]);return i===void 0?(e.parameterKeys??[]).map(e=>({name:e,type:`unknown`,required:!1,description:void 0})):Object.entries(i).map(([e,t])=>{let n=r(t)?t:{};return{name:e,type:A(n.type),required:a.has(e),description:typeof n.description==`string`?n.description:void 0}})}function A(e){if(typeof e==`string`)return e;if(Array.isArray(e)){let t=e.filter(e=>typeof e==`string`);return t.length===0?`unknown`:t.join(` / `)}return`unknown`}function j(e){let t=M(e.value);return(0,S.jsxs)(`details`,{className:`group rounded-xl border border-border/80 bg-card/30`,children:[(0,S.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground marker:hidden`,children:[(0,S.jsx)(`span`,{children:e.title}),(0,S.jsx)(`span`,{className:`text-xs normal-case tracking-normal text-muted-foreground group-open:hidden`,children:`Show`}),(0,S.jsx)(`span`,{className:`hidden text-xs normal-case tracking-normal text-muted-foreground group-open:inline`,children:`Hide`})]}),(0,S.jsx)(`div`,{className:`border-t border-border/70`,children:(0,S.jsx)(`pre`,{className:`m-0 max-h-96 overflow-auto p-4 font-mono text-xs leading-5 text-foreground`,children:(0,S.jsx)(`code`,{children:(0,S.jsx)(l,{text:t})})})})]})}function M(e){try{return JSON.stringify(e,null,2)}catch{return JSON.stringify(String(e),null,2)}}function N(e){return(0,S.jsxs)(`section`,{className:`grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden rounded-xl border border-border/80 bg-card/55`,children:[(0,S.jsx)(`div`,{className:`border-b border-border/80 px-4 py-3`,children:(0,S.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`h2`,{className:`m-0 truncate text-sm font-semibold text-foreground`,children:`Retrieval log`}),(0,S.jsx)(`p`,{className:`m-0 mt-1 truncate text-xs text-muted-foreground`,children:`traces / retrieval-evidence`})]}),(0,S.jsxs)(s,{children:[e.evidence.length,` entries`]})]})}),(0,S.jsxs)(`div`,{className:`min-h-0 overflow-auto p-4`,children:[e.evidence.length===0?(0,S.jsx)(F,{text:`No retrieval evidence captured yet`}):null,(0,S.jsx)(`div`,{className:`grid gap-3`,children:e.evidence.map(t=>(0,S.jsxs)(`article`,{className:`grid gap-3 rounded-xl border border-border/80 bg-background/45 p-3`,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:t.observationName}),(0,S.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Turn `,t.turn]})]}),(0,S.jsx)(o,{className:`h-auto min-h-0 rounded-lg border border-border bg-muted px-2 py-1 text-xs text-muted-foreground`,type:`button`,variant:`ghost`,onClick:()=>e.onOpenTrace(t.traceId),children:`Trace`})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,S.jsxs)(s,{children:[t.documentCount,` docs`]}),(0,S.jsxs)(s,{children:[t.toolCount,` tools`]})]}),t.query===void 0?null:(0,S.jsxs)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,S.jsx)(`span`,{className:` text-xs font-semibold uppercase tracking-[0.14em] text-foreground`,children:`Query`}),` `,t.query]}),t.documents.slice(0,2).map(e=>(0,S.jsxs)(`p`,{className:`m-0 text-xs leading-5 text-muted-foreground [overflow-wrap:anywhere]`,children:[(0,S.jsx)(`span`,{className:` text-foreground`,children:e.id??`document`}),` `,e.text??``]},`${e.id??`doc`}:${e.text??``}`)),t.tools.length===0?null:(0,S.jsxs)(`p`,{className:`m-0 text-xs leading-5 text-muted-foreground`,children:[`Tools: `,t.tools.join(`, `)]})]},`${t.traceId}:${t.observationId}`))})]})]})}function P(e){return(0,S.jsxs)(`div`,{className:`grid gap-2 border-t border-border/70 pt-3`,children:[(0,S.jsx)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:e.title}),(0,S.jsx)(c,{value:e.value})]})}function F(e){return(0,S.jsx)(`div`,{className:`rounded-lg border border-dashed border-border px-4 py-3 text-sm font-medium text-muted-foreground`,children:e.text})}function I(e){let[t,n]=(0,u.useState)(``),[r,s]=(0,u.useState)(),c=e.summary?.agents??[],l=e.summary?.evidence??[],f=(0,u.useMemo)(()=>d(c),[c]),p=v(e.activeTab),h=(0,u.useMemo)(()=>p===void 0?[]:f.filter(e=>e.source.kind===p),[p,f]),g=h.find(e=>e.key===t)??h[0];(0,u.useEffect)(()=>{if(h.length===0){n(``);return}h.some(e=>e.key===t)||n((h.find(e=>e.source.inspectable===!0&&(e.source.itemCount??0)>0)??h.find(e=>e.source.inspectable===!0)??h[0])?.key??``)},[t,h]);let _=(0,u.useCallback)(async(e,t)=>{let n=e.key;s(r=>({key:n,loading:!0,inspectable:r?.key===n?r.inspectable:e.source.inspectable===!0,items:t.append&&r?.key===n?r.items:[],...t.append&&r?.key===n&&r.nextCursor!==void 0?{nextCursor:r.nextCursor}:{},...r?.key===n&&r.totalCount!==void 0?{totalCount:r.totalCount}:{}}));try{let r=new URLSearchParams({agentId:e.agentId,sourceId:m(e.source),limit:`50`});t.cursor!==void 0&&r.set(`cursor`,t.cursor);let i=await fetch(`/knowledge/items?${r.toString()}`);if(!i.ok)throw Error(`Knowledge items failed with HTTP ${i.status}`);let a=await i.json();s(e=>e?.key===n?{key:n,loading:!1,inspectable:a.inspectable,items:t.append?[...e.items,...a.items]:a.items,...a.nextCursor===void 0?{}:{nextCursor:a.nextCursor},...a.totalCount===void 0?{}:{totalCount:a.totalCount},...a.message===void 0?{}:{message:a.message}}:e)}catch(e){s(t=>t?.key===n?{key:n,loading:!1,inspectable:t.inspectable,items:t.items,error:e instanceof Error?e.message:String(e)}:t)}},[]);return(0,u.useEffect)(()=>{if(!e.enabled||g===void 0){s(void 0);return}_(g,{append:!1})},[_,e.enabled,g]),(0,S.jsxs)(`section`,{className:`grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55`,children:[(0,S.jsx)(`header`,{className:`bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur`,children:(0,S.jsxs)(`div`,{className:`grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1`,children:[(0,S.jsxs)(`div`,{className:`grid min-w-0 gap-2`,children:[(0,S.jsx)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.24em] text-foreground`,children:`Agent context`}),(0,S.jsx)(`h1`,{className:`m-0 text-2xl font-semibold leading-none tracking-tight text-foreground`,children:`Knowledge`}),(0,S.jsx)(`p`,{className:`m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground`,children:`Browse configured context, dynamic chunks, and retrieval evidence.`})]}),(0,S.jsxs)(o,{className:`h-8 min-h-8 gap-2`,type:`button`,variant:`secondary`,disabled:!e.enabled,onClick:e.onRefresh,children:[(0,S.jsx)(a,{icon:i,"aria-hidden":`true`}),`Refresh`]})]})}),(0,S.jsxs)(`div`,{className:`grid min-h-0 grid-rows-[auto_minmax(0,1fr)] gap-4 overflow-hidden pb-6 pl-0 pr-6 pt-0`,children:[(0,S.jsx)(L,{activeTab:e.activeTab,sources:f,evidenceCount:l.length,onSelectTab:e.onSelectTab}),e.activeTab===`retrieval-log`?(0,S.jsx)(N,{evidence:l,onOpenTrace:e.onOpenTrace}):(0,S.jsx)(R,{sources:h,selectedKey:g?.key??``,loading:e.loading,activeTab:e.activeTab,onSelect:n,children:(0,S.jsx)(C,{source:g,state:r,onLoadMore:()=>{g!==void 0&&_(g,r?.nextCursor===void 0?{append:!0}:{append:!0,cursor:r.nextCursor})}})})]})]})}function L(e){return(0,S.jsx)(`nav`,{className:`flex min-w-0 gap-7 overflow-x-auto border-b border-border/80`,"aria-label":`Knowledge sections`,children:f.map(t=>{let n=e.activeTab===t.id;return(0,S.jsxs)(`button`,{className:[`flex min-h-10 shrink-0 items-center gap-2 border-b px-0 pb-2 pt-1 text-left transition duration-200 hover:text-foreground focus-visible:outline-none`,n?`border-foreground/45 text-foreground`:`border-transparent text-muted-foreground hover:border-border`].join(` `),type:`button`,"aria-current":n?`page`:void 0,onClick:()=>e.onSelectTab(t.id),children:[(0,S.jsx)(`span`,{className:`text-sm font-semibold`,children:t.label}),(0,S.jsx)(`span`,{className:` text-xs text-muted-foreground`,children:b(t.id,e.sources,e.evidenceCount)})]},t.id)})})}function R(e){let t=e.sources.length!==1||e.loading;return(0,S.jsxs)(`div`,{className:[`grid min-h-0 gap-3 overflow-hidden`,t?`grid-rows-[auto_minmax(0,1fr)]`:`grid-rows-[minmax(0,1fr)]`].join(` `),children:[t?(0,S.jsx)(`div`,{className:`min-w-0 overflow-x-auto rounded-xl border border-border/80 bg-card/55`,children:(0,S.jsxs)(`div`,{className:`flex min-h-11 min-w-max items-center gap-2 px-3`,children:[(0,S.jsx)(`span`,{className:`mr-2 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:y(e.activeTab)}),e.loading&&e.sources.length===0?(0,S.jsx)(`span`,{className:` text-xs text-muted-foreground`,children:`Loading sources`}):null,!e.loading&&e.sources.length===0?(0,S.jsx)(`span`,{className:` text-xs text-muted-foreground`,children:`No knowledge sources`}):null,e.sources.map(t=>(0,S.jsxs)(`button`,{className:[`flex h-7 items-center gap-2 rounded-lg border border-border/80 bg-background/45 px-2.5 text-xs font-semibold text-muted-foreground transition duration-200 hover:border-border/80 hover:bg-muted/45 hover:text-foreground focus-visible:border-ring focus-visible:outline-none`,e.selectedKey===t.key?`border-border/80 bg-muted/45 text-foreground`:``].join(` `),type:`button`,onClick:()=>e.onSelect(t.key),children:[(0,S.jsx)(`span`,{children:t.source.label??_(t.source.kind)}),t.source.itemCount===void 0?null:(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:t.source.itemCount})]},t.key))]})}):null,e.children]})}export{I as KnowledgePage};
2
- //# sourceMappingURL=knowledge-page-C6WkzIFh.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"knowledge-page-C6WkzIFh.js","names":[],"sources":["../../../src/ui/app/modules/knowledge/knowledge-model.ts","../../../src/ui/app/modules/knowledge/knowledge-panels.tsx","../../../src/ui/app/modules/knowledge/knowledge-page.tsx"],"sourcesContent":["import type {\n StudioAgentKnowledgeConfig,\n StudioKnowledgeItem,\n StudioKnowledgeSourceKind,\n StudioKnowledgeSourceSummary,\n} from \"../../../../types\";\nimport type { KnowledgeTab } from \"../shared/types\";\n\nexport const itemLimit = 50;\n\nexport type KnowledgeSourceRef = {\n key: string;\n agentId: string;\n agentName: string;\n source: StudioKnowledgeSourceSummary;\n};\n\nexport type ItemState = {\n key: string;\n loading: boolean;\n items: StudioKnowledgeItem[];\n nextCursor?: string;\n totalCount?: number;\n inspectable: boolean;\n message?: string;\n error?: string;\n};\n\nexport function flattenSources(agents: StudioAgentKnowledgeConfig[]): KnowledgeSourceRef[] {\n return agents.flatMap((agent) =>\n agent.sources.map((source, index) => ({\n key: `${agent.agentId}:${sourceId(source, index)}`,\n agentId: agent.agentId,\n agentName: agent.agentName ?? agent.agentId,\n source: withSourceId(source, index),\n })),\n );\n}\n\nexport const knowledgeTabs: Array<{ id: KnowledgeTab; label: string }> = [\n { id: \"static-context\", label: \"Static Context\" },\n { id: \"dynamic-context\", label: \"Dynamic Context\" },\n { id: \"dynamic-tools\", label: \"Dynamic Tools\" },\n { id: \"retrieval-log\", label: \"Retrieval Log\" },\n];\n\nfunction withSourceId(\n source: StudioKnowledgeSourceSummary,\n index: number,\n): StudioKnowledgeSourceSummary {\n return source.sourceId === undefined\n ? { ...source, sourceId: fallbackSourceId(source, index) }\n : source;\n}\n\nexport function sourceId(source: StudioKnowledgeSourceSummary, index = 0): string {\n return source.sourceId ?? fallbackSourceId(source, index);\n}\n\nfunction fallbackSourceId(source: StudioKnowledgeSourceSummary, index: number): string {\n switch (source.kind) {\n case \"static_context\":\n return \"static-context\";\n case \"dynamic_context\":\n return `dynamic-context-${source.registrationIndex ?? index}`;\n case \"dynamic_tools\":\n return `dynamic-tools-${source.registrationIndex ?? index}`;\n }\n}\n\nfunction sumKind(sources: StudioKnowledgeSourceSummary[], kind: StudioKnowledgeSourceKind): number {\n return sources\n .filter((source) => source.kind === kind)\n .reduce((total, source) => total + (source.itemCount ?? source.count), 0);\n}\n\nexport function sourceLabel(kind: StudioKnowledgeSourceKind): string {\n switch (kind) {\n case \"static_context\":\n return \"Static context\";\n case \"dynamic_context\":\n return \"Dynamic context\";\n case \"dynamic_tools\":\n return \"Dynamic tools\";\n }\n}\n\nexport function sourceKindForTab(tab: KnowledgeTab): StudioKnowledgeSourceKind | undefined {\n switch (tab) {\n case \"static-context\":\n return \"static_context\";\n case \"dynamic-context\":\n return \"dynamic_context\";\n case \"dynamic-tools\":\n return \"dynamic_tools\";\n case \"retrieval-log\":\n return undefined;\n }\n}\n\nexport function tabLabel(tab: KnowledgeTab): string {\n return knowledgeTabs.find((item) => item.id === tab)?.label ?? \"Knowledge\";\n}\n\nexport function tabCountLabel(\n tab: KnowledgeTab,\n sources: KnowledgeSourceRef[],\n evidenceCount: number,\n): string {\n const sourceKind = sourceKindForTab(tab);\n if (sourceKind === undefined) {\n return `${evidenceCount} entries`;\n }\n const tabSources = sources.filter((source) => source.source.kind === sourceKind);\n const itemCount = sumKind(\n tabSources.map((source) => source.source),\n sourceKind,\n );\n return `${tabSources.length} sources / ${itemCount} items`;\n}\n\nexport function itemKindLabel(kind: StudioKnowledgeItem[\"kind\"]): string {\n switch (kind) {\n case \"static_context\":\n return \"Static context\";\n case \"dynamic_context\":\n return \"Dynamic context\";\n case \"dynamic_tool\":\n return \"Dynamic tool\";\n }\n}\n","import type { StudioKnowledgeItem, StudioKnowledgeSummary } from \"../../../../types\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { isRecord } from \"../shared/object\";\nimport { JsonSyntax, JsonValueView } from \"../shared/renderers\";\nimport {\n type ItemState,\n itemKindLabel,\n type KnowledgeSourceRef,\n sourceId,\n sourceLabel,\n} from \"./knowledge-model\";\n\nexport function ItemBrowser(props: {\n source: KnowledgeSourceRef | undefined;\n state: ItemState | undefined;\n onLoadMore: () => void;\n}) {\n const state = props.state;\n return (\n <section className=\"grid min-h-0 grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-xl border border-border/80 bg-card/55\">\n <div className=\"border-b border-border/80 px-4 py-3\">\n <div className=\"flex min-w-0 items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <h2 className=\"m-0 truncate text-sm font-semibold text-foreground\">\n {props.source?.source.label ?? \"Knowledge items\"}\n </h2>\n <p className=\"m-0 mt-1 truncate text-xs text-muted-foreground\">\n {props.source === undefined\n ? \"No source selected\"\n : `${props.source.agentId} / ${sourceId(props.source.source)}`}\n </p>\n </div>\n {state?.totalCount === undefined ? null : <Badge>{state.totalCount} total</Badge>}\n </div>\n </div>\n <div className=\"min-h-0 overflow-auto\">\n <div className=\"p-4\">\n {props.source === undefined ? <MutedRow text=\"No knowledge source selected\" /> : null}\n {state?.loading === true && state.items.length === 0 ? (\n <MutedRow text=\"Loading items\" />\n ) : null}\n {state?.error === undefined ? null : <MutedRow text={state.error} />}\n {state?.inspectable === false ? (\n <MutedRow text={state.message ?? \"This source does not expose browseable chunks.\"} />\n ) : null}\n {state?.inspectable !== false && state?.loading === false && state.items.length === 0 ? (\n <MutedRow text=\"No items in this source\" />\n ) : null}\n <div className=\"grid gap-3\">\n {state?.items.map((item) => (\n <KnowledgeItemCard\n item={item}\n key={`${item.kind}:${item.id}`}\n source={props.source}\n />\n ))}\n </div>\n </div>\n </div>\n <div className=\"flex min-h-12 items-center justify-between gap-3 bg-muted/10 px-4 py-2\">\n <span className=\" text-xs text-muted-foreground\">\n {state === undefined ? \"0 loaded\" : `${state.items.length} loaded`}\n </span>\n <Button\n className=\"h-8 min-h-8\"\n type=\"button\"\n variant=\"secondary\"\n disabled={state?.loading === true || state?.nextCursor === undefined}\n onClick={props.onLoadMore}\n >\n Load more\n </Button>\n </div>\n </section>\n );\n}\n\nfunction KnowledgeItemCard(props: {\n item: StudioKnowledgeItem;\n source: KnowledgeSourceRef | undefined;\n}) {\n if (props.item.kind === \"dynamic_tool\") {\n return <DynamicToolCard item={props.item} source={props.source} />;\n }\n\n return (\n <article className=\"grid gap-3 rounded-xl border border-border/80 bg-background/55 p-4\">\n <div className=\"flex min-w-0 items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"truncate text-xs font-semibold text-foreground\">\n {props.item.toolName ?? props.item.id}\n </div>\n <div className=\"mt-1 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground\">\n {itemKindLabel(props.item.kind)}\n </div>\n </div>\n {props.item.parameterKeys === undefined || props.item.parameterKeys.length === 0 ? null : (\n <Badge>{props.item.parameterKeys.length} params</Badge>\n )}\n </div>\n {props.item.description === undefined || props.item.description.length === 0 ? null : (\n <p className=\"m-0 text-sm leading-6 text-muted-foreground [overflow-wrap:anywhere]\">\n {props.item.description}\n </p>\n )}\n {props.item.text === undefined ? null : (\n <p className=\"m-0 whitespace-pre-wrap text-sm leading-6 text-foreground [overflow-wrap:anywhere]\">\n {props.item.text}\n </p>\n )}\n {props.item.document === undefined ? null : (\n <JsonBlock title=\"Document\" value={props.item.document} />\n )}\n {props.item.metadata === undefined ? null : (\n <JsonBlock title=\"Metadata\" value={props.item.metadata} />\n )}\n {props.item.parameterKeys === undefined || props.item.parameterKeys.length === 0 ? null : (\n <div className=\"flex flex-wrap gap-2\">\n {props.item.parameterKeys.map((key) => (\n <Badge key={key}>{key}</Badge>\n ))}\n </div>\n )}\n </article>\n );\n}\n\ntype DynamicToolParameter = {\n name: string;\n type: string;\n required: boolean;\n description: string | undefined;\n};\n\nfunction DynamicToolCard(props: {\n item: StudioKnowledgeItem;\n source: KnowledgeSourceRef | undefined;\n}) {\n const definition = dynamicToolDefinition(props.item);\n const parameters = dynamicToolParameters(props.item);\n const description = definition.description ?? props.item.description;\n const hasDescription = description !== undefined && description.length > 0;\n const hasStructuredBody = hasDescription || parameters.length > 0;\n\n return (\n <article className=\"grid gap-5 rounded-2xl border border-border/80 bg-background/55 p-5\">\n <div className=\"flex min-w-0 items-start justify-between gap-4\">\n <div className=\"min-w-0\">\n <h3 className=\"m-0 truncate text-base font-semibold text-foreground\">\n {definition.name ?? props.item.toolName ?? props.item.id}\n </h3>\n <div className=\"mt-1 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground\">\n Dynamic tool\n </div>\n </div>\n <Badge>{parameters.length} params</Badge>\n </div>\n\n {!hasDescription ? null : (\n <p className=\"m-0 max-w-4xl text-sm leading-6 text-muted-foreground [overflow-wrap:anywhere]\">\n {description}\n </p>\n )}\n\n {hasStructuredBody || props.item.text === undefined ? null : (\n <p className=\"m-0 whitespace-pre-wrap text-sm leading-6 text-foreground [overflow-wrap:anywhere]\">\n {props.item.text}\n </p>\n )}\n\n <DynamicToolParameters parameters={parameters} />\n\n <DynamicToolSourceDetails item={props.item} source={props.source} />\n\n {props.item.document === undefined ? null : (\n <JsonDetails title=\"Raw definition\" value={props.item.document} />\n )}\n\n {props.item.metadata === undefined ? null : (\n <JsonDetails title=\"Metadata\" value={props.item.metadata} />\n )}\n </article>\n );\n}\n\nfunction DynamicToolParameters(props: { parameters: DynamicToolParameter[] }) {\n return (\n <section className=\"grid gap-3 border-t border-border/70 pt-4\">\n <div className=\"flex items-center justify-between gap-3\">\n <h4 className=\"m-0 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground\">\n Parameters\n </h4>\n <span className=\"text-xs font-medium text-muted-foreground\">\n {props.parameters.length === 0 ? \"No parameters\" : `${props.parameters.length} defined`}\n </span>\n </div>\n {props.parameters.length === 0 ? (\n <div className=\"rounded-xl border border-dashed border-border/80 px-4 py-3 text-sm text-muted-foreground\">\n This tool does not declare input parameters.\n </div>\n ) : (\n <div className=\"overflow-hidden rounded-xl border border-border/80 bg-card/35\">\n <div className=\"overflow-x-auto\">\n <table className=\"w-full min-w-full border-separate border-spacing-0 text-left\">\n <thead className=\"bg-muted/20\">\n <tr>\n <th className=\"border-b border-border/80 px-4 py-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground\">\n Name\n </th>\n <th className=\"border-b border-border/80 px-4 py-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground\">\n Type\n </th>\n <th className=\"border-b border-border/80 px-4 py-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground\">\n Required\n </th>\n <th className=\"border-b border-border/80 px-4 py-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground\">\n Description\n </th>\n </tr>\n </thead>\n <tbody>\n {props.parameters.map((parameter) => (\n <tr key={parameter.name}>\n <td className=\"border-b border-border/70 px-4 py-3 text-sm font-semibold leading-6 text-foreground [overflow-wrap:anywhere]\">\n {parameter.name}\n </td>\n <td className=\"border-b border-border/70 px-4 py-3 text-sm leading-6 text-muted-foreground [overflow-wrap:anywhere]\">\n {parameter.type}\n </td>\n <td className=\"border-b border-border/70 px-4 py-3 text-sm leading-6 text-muted-foreground\">\n {parameter.required ? \"Yes\" : \"No\"}\n </td>\n <td className=\"border-b border-border/70 px-4 py-3 text-sm leading-6 text-muted-foreground [overflow-wrap:anywhere]\">\n {parameter.description ?? \"No description\"}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n )}\n </section>\n );\n}\n\nfunction DynamicToolSourceDetails(props: {\n item: StudioKnowledgeItem;\n source: KnowledgeSourceRef | undefined;\n}) {\n const details = [\n { label: \"Agent\", value: props.source?.agentName ?? props.source?.agentId },\n {\n label: \"Source\",\n value:\n props.source === undefined\n ? undefined\n : `${props.source.source.label ?? sourceLabel(props.source.source.kind)} / ${sourceId(\n props.source.source,\n )}`,\n },\n { label: \"Item ID\", value: props.item.id },\n ].filter((item): item is { label: string; value: string } => item.value !== undefined);\n\n if (details.length === 0) {\n return null;\n }\n\n return (\n <section className=\"grid gap-3 border-t border-border/70 pt-4\">\n <h4 className=\"m-0 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground\">\n Source\n </h4>\n <dl className=\"grid gap-2 sm:grid-cols-3\">\n {details.map((detail) => (\n <div\n className=\"min-w-0 rounded-xl border border-border/70 bg-card/25 p-3\"\n key={detail.label}\n >\n <dt className=\"text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground\">\n {detail.label}\n </dt>\n <dd className=\"m-0 mt-1 truncate text-sm font-medium text-foreground\">\n {detail.value}\n </dd>\n </div>\n ))}\n </dl>\n </section>\n );\n}\n\nfunction dynamicToolDefinition(item: StudioKnowledgeItem): {\n name: string | undefined;\n description: string | undefined;\n parameters: unknown;\n} {\n const document = isRecord(item.document) ? item.document : undefined;\n const definition = isRecord(document?.definition) ? document.definition : undefined;\n const name =\n typeof definition?.name === \"string\"\n ? definition.name\n : typeof document?.toolName === \"string\"\n ? document.toolName\n : item.toolName;\n const description =\n typeof definition?.description === \"string\" ? definition.description : item.description;\n\n return {\n name,\n description,\n parameters: definition?.parameters,\n };\n}\n\nfunction dynamicToolParameters(item: StudioKnowledgeItem): DynamicToolParameter[] {\n const definition = dynamicToolDefinition(item);\n const schema = isRecord(definition.parameters) ? definition.parameters : undefined;\n const properties = isRecord(schema?.properties) ? schema.properties : undefined;\n const required = new Set(\n Array.isArray(schema?.required)\n ? schema.required.filter((value): value is string => typeof value === \"string\")\n : [],\n );\n\n if (properties === undefined) {\n return (item.parameterKeys ?? []).map((name) => ({\n name,\n type: \"unknown\",\n required: false,\n description: undefined,\n }));\n }\n\n return Object.entries(properties).map(([name, value]) => {\n const property = isRecord(value) ? value : {};\n return {\n name,\n type: schemaTypeLabel(property.type),\n required: required.has(name),\n description: typeof property.description === \"string\" ? property.description : undefined,\n };\n });\n}\n\nfunction schemaTypeLabel(value: unknown): string {\n if (typeof value === \"string\") {\n return value;\n }\n if (Array.isArray(value)) {\n const labels = value.filter((item): item is string => typeof item === \"string\");\n return labels.length === 0 ? \"unknown\" : labels.join(\" / \");\n }\n return \"unknown\";\n}\n\nfunction JsonDetails(props: { title: string; value: unknown }) {\n const display = jsonDisplay(props.value);\n\n return (\n <details className=\"group rounded-xl border border-border/80 bg-card/30\">\n <summary className=\"flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground marker:hidden\">\n <span>{props.title}</span>\n <span className=\"text-xs normal-case tracking-normal text-muted-foreground group-open:hidden\">\n Show\n </span>\n <span className=\"hidden text-xs normal-case tracking-normal text-muted-foreground group-open:inline\">\n Hide\n </span>\n </summary>\n <div className=\"border-t border-border/70\">\n <pre className=\"m-0 max-h-96 overflow-auto p-4 font-mono text-xs leading-5 text-foreground\">\n <code>\n <JsonSyntax text={display} />\n </code>\n </pre>\n </div>\n </details>\n );\n}\n\nfunction jsonDisplay(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return JSON.stringify(String(value), null, 2);\n }\n}\n\nexport function RetrievalLogPanel(props: {\n evidence: NonNullable<StudioKnowledgeSummary[\"evidence\"]>;\n onOpenTrace: (traceId: string) => void;\n}) {\n return (\n <section className=\"grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden rounded-xl border border-border/80 bg-card/55\">\n <div className=\"border-b border-border/80 px-4 py-3\">\n <div className=\"flex min-w-0 items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <h2 className=\"m-0 truncate text-sm font-semibold text-foreground\">Retrieval log</h2>\n <p className=\"m-0 mt-1 truncate text-xs text-muted-foreground\">\n traces / retrieval-evidence\n </p>\n </div>\n <Badge>{props.evidence.length} entries</Badge>\n </div>\n </div>\n <div className=\"min-h-0 overflow-auto p-4\">\n {props.evidence.length === 0 ? (\n <MutedRow text=\"No retrieval evidence captured yet\" />\n ) : null}\n <div className=\"grid gap-3\">\n {props.evidence.map((item) => (\n <article\n className=\"grid gap-3 rounded-xl border border-border/80 bg-background/45 p-3\"\n key={`${item.traceId}:${item.observationId}`}\n >\n <div className=\"flex min-w-0 items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-semibold text-foreground\">\n {item.observationName}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">Turn {item.turn}</div>\n </div>\n <Button\n className=\"h-auto min-h-0 rounded-lg border border-border bg-muted px-2 py-1 text-xs text-muted-foreground\"\n type=\"button\"\n variant=\"ghost\"\n onClick={() => props.onOpenTrace(item.traceId)}\n >\n Trace\n </Button>\n </div>\n <div className=\"flex flex-wrap gap-2\">\n <Badge>{item.documentCount} docs</Badge>\n <Badge>{item.toolCount} tools</Badge>\n </div>\n {item.query === undefined ? null : (\n <p className=\"m-0 text-sm leading-6 text-muted-foreground [overflow-wrap:anywhere]\">\n <span className=\" text-xs font-semibold uppercase tracking-[0.14em] text-foreground\">\n Query\n </span>{\" \"}\n {item.query}\n </p>\n )}\n {item.documents.slice(0, 2).map((document) => (\n <p\n className=\"m-0 text-xs leading-5 text-muted-foreground [overflow-wrap:anywhere]\"\n key={`${document.id ?? \"doc\"}:${document.text ?? \"\"}`}\n >\n <span className=\" text-foreground\">{document.id ?? \"document\"}</span>{\" \"}\n {document.text ?? \"\"}\n </p>\n ))}\n {item.tools.length === 0 ? null : (\n <p className=\"m-0 text-xs leading-5 text-muted-foreground\">\n Tools: {item.tools.join(\", \")}\n </p>\n )}\n </article>\n ))}\n </div>\n </div>\n </section>\n );\n}\n\nfunction JsonBlock(props: { title: string; value: unknown }) {\n return (\n <div className=\"grid gap-2 border-t border-border/70 pt-3\">\n <div className=\" text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground\">\n {props.title}\n </div>\n <JsonValueView value={props.value} />\n </div>\n );\n}\n\nexport function EmptyState(props: { title: string; text: string }) {\n return (\n <section className=\"grid h-full place-items-center p-8\">\n <div className=\"grid max-w-sm gap-2 text-center\">\n <h1 className=\"m-0 text-base font-semibold text-foreground\">{props.title}</h1>\n <p className=\"m-0 text-sm font-medium leading-6 text-muted-foreground\">{props.text}</p>\n </div>\n </section>\n );\n}\n\nfunction MutedRow(props: { text: string }) {\n return (\n <div className=\"rounded-lg border border-dashed border-border px-4 py-3 text-sm font-medium text-muted-foreground\">\n {props.text}\n </div>\n );\n}\n","import { RefreshIcon } from \"@hugeicons/core-free-icons\";\nimport { type ReactNode, useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { StudioKnowledgeItemsPage, StudioKnowledgeSummary } from \"../../../../types\";\nimport { Button } from \"../../components/ui/button\";\nimport { StudioIcon } from \"../../components/ui/icon\";\nimport type { KnowledgeTab } from \"../shared/types\";\nimport {\n flattenSources,\n type ItemState,\n itemLimit,\n type KnowledgeSourceRef,\n knowledgeTabs,\n sourceId,\n sourceKindForTab,\n sourceLabel,\n tabCountLabel,\n tabLabel,\n} from \"./knowledge-model\";\nimport { ItemBrowser, RetrievalLogPanel } from \"./knowledge-panels\";\n\nexport function KnowledgePage(props: {\n activeTab: KnowledgeTab;\n enabled: boolean;\n summary: StudioKnowledgeSummary | undefined;\n loading: boolean;\n onOpenTrace: (traceId: string) => void;\n onRefresh: () => void;\n onSelectTab: (tab: KnowledgeTab) => void;\n}) {\n const [selectedKey, setSelectedKey] = useState(\"\");\n const [itemState, setItemState] = useState<ItemState | undefined>();\n\n const agents = props.summary?.agents ?? [];\n const evidence = props.summary?.evidence ?? [];\n const sources = useMemo(() => flattenSources(agents), [agents]);\n const activeSourceKind = sourceKindForTab(props.activeTab);\n const visibleSources = useMemo(\n () =>\n activeSourceKind === undefined\n ? []\n : sources.filter((source) => source.source.kind === activeSourceKind),\n [activeSourceKind, sources],\n );\n const selectedSource =\n visibleSources.find((source) => source.key === selectedKey) ?? visibleSources[0];\n\n useEffect(() => {\n if (visibleSources.length === 0) {\n setSelectedKey(\"\");\n return;\n }\n if (visibleSources.some((source) => source.key === selectedKey)) {\n return;\n }\n const next =\n visibleSources.find(\n (source) => source.source.inspectable === true && (source.source.itemCount ?? 0) > 0,\n ) ??\n visibleSources.find((source) => source.source.inspectable === true) ??\n visibleSources[0];\n setSelectedKey(next?.key ?? \"\");\n }, [selectedKey, visibleSources]);\n\n const loadItems = useCallback(\n async (source: KnowledgeSourceRef, options: { append: boolean; cursor?: string }) => {\n const sourceKey = source.key;\n setItemState((current) => ({\n key: sourceKey,\n loading: true,\n inspectable:\n current?.key === sourceKey ? current.inspectable : source.source.inspectable === true,\n items: options.append && current?.key === sourceKey ? current.items : [],\n ...(options.append && current?.key === sourceKey && current.nextCursor !== undefined\n ? { nextCursor: current.nextCursor }\n : {}),\n ...(current?.key === sourceKey && current.totalCount !== undefined\n ? { totalCount: current.totalCount }\n : {}),\n }));\n\n try {\n const params = new URLSearchParams({\n agentId: source.agentId,\n sourceId: sourceId(source.source),\n limit: String(itemLimit),\n });\n if (options.cursor !== undefined) {\n params.set(\"cursor\", options.cursor);\n }\n const response = await fetch(`/knowledge/items?${params.toString()}`);\n if (!response.ok) {\n throw new Error(`Knowledge items failed with HTTP ${response.status}`);\n }\n const page = (await response.json()) as StudioKnowledgeItemsPage;\n setItemState((current) => {\n if (current?.key !== sourceKey) {\n return current;\n }\n return {\n key: sourceKey,\n loading: false,\n inspectable: page.inspectable,\n items: options.append ? [...current.items, ...page.items] : page.items,\n ...(page.nextCursor === undefined ? {} : { nextCursor: page.nextCursor }),\n ...(page.totalCount === undefined ? {} : { totalCount: page.totalCount }),\n ...(page.message === undefined ? {} : { message: page.message }),\n };\n });\n } catch (error) {\n setItemState((current) => {\n if (current?.key !== sourceKey) {\n return current;\n }\n return {\n key: sourceKey,\n loading: false,\n inspectable: current.inspectable,\n items: current.items,\n error: error instanceof Error ? error.message : String(error),\n };\n });\n }\n },\n [],\n );\n\n useEffect(() => {\n if (!props.enabled || selectedSource === undefined) {\n setItemState(undefined);\n return;\n }\n void loadItems(selectedSource, { append: false });\n }, [loadItems, props.enabled, selectedSource]);\n\n return (\n <section className=\"grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55\">\n <header className=\"bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur\">\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1\">\n <div className=\"grid min-w-0 gap-2\">\n <div className=\" text-xs font-semibold uppercase tracking-[0.24em] text-foreground\">\n Agent context\n </div>\n <h1 className=\"m-0 text-2xl font-semibold leading-none tracking-tight text-foreground\">\n Knowledge\n </h1>\n <p className=\"m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground\">\n Browse configured context, dynamic chunks, and retrieval evidence.\n </p>\n </div>\n <Button\n className=\"h-8 min-h-8 gap-2\"\n type=\"button\"\n variant=\"secondary\"\n disabled={!props.enabled}\n onClick={props.onRefresh}\n >\n <StudioIcon icon={RefreshIcon} aria-hidden=\"true\" />\n Refresh\n </Button>\n </div>\n </header>\n <div className=\"grid min-h-0 grid-rows-[auto_minmax(0,1fr)] gap-4 overflow-hidden pb-6 pl-0 pr-6 pt-0\">\n <KnowledgeTabs\n activeTab={props.activeTab}\n sources={sources}\n evidenceCount={evidence.length}\n onSelectTab={props.onSelectTab}\n />\n {props.activeTab === \"retrieval-log\" ? (\n <RetrievalLogPanel evidence={evidence} onOpenTrace={props.onOpenTrace} />\n ) : (\n <SourceWorkspace\n sources={visibleSources}\n selectedKey={selectedSource?.key ?? \"\"}\n loading={props.loading}\n activeTab={props.activeTab}\n onSelect={setSelectedKey}\n >\n <ItemBrowser\n source={selectedSource}\n state={itemState}\n onLoadMore={() => {\n if (selectedSource === undefined) {\n return;\n }\n void loadItems(\n selectedSource,\n itemState?.nextCursor === undefined\n ? { append: true }\n : { append: true, cursor: itemState.nextCursor },\n );\n }}\n />\n </SourceWorkspace>\n )}\n </div>\n </section>\n );\n}\n\nfunction KnowledgeTabs(props: {\n activeTab: KnowledgeTab;\n sources: KnowledgeSourceRef[];\n evidenceCount: number;\n onSelectTab: (tab: KnowledgeTab) => void;\n}) {\n return (\n <nav\n className=\"flex min-w-0 gap-7 overflow-x-auto border-b border-border/80\"\n aria-label=\"Knowledge sections\"\n >\n {knowledgeTabs.map((tab) => {\n const active = props.activeTab === tab.id;\n return (\n <button\n className={[\n \"flex min-h-10 shrink-0 items-center gap-2 border-b px-0 pb-2 pt-1 text-left transition duration-200 hover:text-foreground focus-visible:outline-none\",\n active\n ? \"border-foreground/45 text-foreground\"\n : \"border-transparent text-muted-foreground hover:border-border\",\n ].join(\" \")}\n key={tab.id}\n type=\"button\"\n aria-current={active ? \"page\" : undefined}\n onClick={() => props.onSelectTab(tab.id)}\n >\n <span className=\"text-sm font-semibold\">{tab.label}</span>\n <span className=\" text-xs text-muted-foreground\">\n {tabCountLabel(tab.id, props.sources, props.evidenceCount)}\n </span>\n </button>\n );\n })}\n </nav>\n );\n}\n\nfunction SourceWorkspace(props: {\n sources: KnowledgeSourceRef[];\n selectedKey: string;\n loading: boolean;\n activeTab: KnowledgeTab;\n onSelect: (key: string) => void;\n children: ReactNode;\n}) {\n const showSources = props.sources.length !== 1 || props.loading;\n return (\n <div\n className={[\n \"grid min-h-0 gap-3 overflow-hidden\",\n showSources ? \"grid-rows-[auto_minmax(0,1fr)]\" : \"grid-rows-[minmax(0,1fr)]\",\n ].join(\" \")}\n >\n {showSources ? (\n <div className=\"min-w-0 overflow-x-auto rounded-xl border border-border/80 bg-card/55\">\n <div className=\"flex min-h-11 min-w-max items-center gap-2 px-3\">\n <span className=\"mr-2 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground\">\n {tabLabel(props.activeTab)}\n </span>\n {props.loading && props.sources.length === 0 ? (\n <span className=\" text-xs text-muted-foreground\">Loading sources</span>\n ) : null}\n {!props.loading && props.sources.length === 0 ? (\n <span className=\" text-xs text-muted-foreground\">No knowledge sources</span>\n ) : null}\n {props.sources.map((source) => (\n <button\n className={[\n \"flex h-7 items-center gap-2 rounded-lg border border-border/80 bg-background/45 px-2.5 text-xs font-semibold text-muted-foreground transition duration-200 hover:border-border/80 hover:bg-muted/45 hover:text-foreground focus-visible:border-ring focus-visible:outline-none\",\n props.selectedKey === source.key\n ? \"border-border/80 bg-muted/45 text-foreground\"\n : \"\",\n ].join(\" \")}\n key={source.key}\n type=\"button\"\n onClick={() => props.onSelect(source.key)}\n >\n <span>{source.source.label ?? sourceLabel(source.source.kind)}</span>\n {source.source.itemCount === undefined ? null : (\n <span className=\"text-muted-foreground\">{source.source.itemCount}</span>\n )}\n </button>\n ))}\n </div>\n </div>\n ) : null}\n {props.children}\n </div>\n );\n}\n"],"mappings":"sSA4BA,SAAA,EAAA,EAAA,CACE,OAAA,EAAA,QAAA,GAAA,EAAA,QAAA,KAAA,EAAA,KAAA,mGAUF,IAAA,EAAA,oLAOA,SAAA,EAAA,EAAA,EAAA,CAIE,OAAA,EAAA,WAAA,IAAA,GAAA,yBAKF,SAAA,EAAA,EAAA,EAAA,EAAA,CACE,OAAA,EAAA,UAAA,EAAA,EAAA,EAAA,CAGF,SAAA,EAAA,EAAA,EAAA,CACE,OAAA,EAAA,KAAA,0LAUF,SAAA,EAAA,EAAA,EAAA,CACE,OAAA,EAAA,OAAA,GAAA,EAAA,OAAA,EAAA,CAAA,QAAA,EAAA,IAAA,GAAA,EAAA,WAAA,EAAA,OAAA,EAAA,CAKF,SAAA,EAAA,EAAA,CACE,OAAA,EAAA,sIAUF,SAAA,EAAA,EAAA,CACE,OAAA,EAAA,iKAYF,SAAA,EAAA,EAAA,CACE,OAAA,EAAA,KAAA,GAAA,EAAA,KAAA,EAAA,EAAA,OAAA,YAGF,SAAA,EAAA,EAAA,EAAA,EAAA,YAME,GAAA,IAAA,IAAA,GAAA,MAAA,GAAA,EAAA,yEAQA,MAAA,GAAA,EAAA,OAAA,aAAA,EAAA,QAGF,SAAA,EAAA,EAAA,CACE,OAAA,EAAA,8IC7GF,SAAgB,EAAY,EAIzB,CACD,IAAM,EAAQ,EAAM,MACpB,OACE,EAAA,EAAA,MAAC,UAAD,CAAS,UAAU,0HA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,OAAD,CAAM,UAAU,wFACb,EAAS,EAAM,UAAU,CACrB,CAAA,CACN,EAAM,SAAW,EAAM,QAAQ,SAAW,GACzC,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,0CAAiC,kBAAsB,CAAA,CACrE,KACH,CAAC,EAAM,SAAW,EAAM,QAAQ,SAAW,GAC1C,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,0CAAiC,uBAA2B,CAAA,CAC1E,KACH,EAAM,QAAQ,IAAK,IAClB,EAAA,EAAA,MAAC,SAAD,CACE,UAAW,CACT,iRACA,EAAM,cAAgB,EAAO,IACzB,+CACA,GACL,CAAC,KAAK,IAAI,CAEX,KAAK,SACL,YAAe,EAAM,SAAS,EAAO,IAAI,UAT3C,EAWE,EAAA,EAAA,KAAC,OAAD,CAAA,SAAO,EAAO,OAAO,OAAS,EAAY,EAAO,OAAO,KAAK,CAAQ,CAAA,CACpE,EAAO,OAAO,YAAc,IAAA,GAAY,MACvC,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,iCAAyB,EAAO,OAAO,UAAiB,CAAA,CAEnE,EARF,EAAO,IAQL,CACT,CACE,GACF,CAAA,CACJ,KACH,EAAM,SACH"}
@@ -1,2 +0,0 @@
1
- import{r as e}from"./utils-BN2yP0LH.js";import{d as t,f as n,m as r,p as i,u as a}from"./index-CC5mjRie.js";import{t as o}from"./badge-BH7gz3tB.js";import{t as s}from"./renderers-CIC1VVRv.js";var c=e();function l(e){let s=e.agents.find(t=>t.id===e.selectedAgentId)??e.agents[0],l=e.summary?.servers??[],d=l.reduce((e,t)=>e+t.toolCount,0);return(0,c.jsxs)(`section`,{className:`grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55`,"aria-label":`MCPs`,children:[(0,c.jsx)(`header`,{className:`bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur`,children:(0,c.jsxs)(`div`,{className:`grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1`,children:[(0,c.jsxs)(`div`,{className:`grid min-w-0 gap-2`,children:[(0,c.jsx)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.24em] text-foreground`,children:`External context`}),(0,c.jsx)(`h1`,{className:`m-0 text-2xl font-semibold leading-none tracking-tight text-foreground`,children:`MCPs`}),(0,c.jsx)(`p`,{className:`m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground`,children:`MCP servers and remote tools registered on Studio agents, grouped by server.`})]}),(0,c.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 max-md:grid max-md:grid-cols-1`,children:[(0,c.jsxs)(o,{className:`h-9 justify-center border-border/80 bg-card/70 text-muted-foreground`,children:[l.length,` servers / `,d,` tools`]}),e.agents.length>1?(0,c.jsxs)(a,{value:s?.id??``,onValueChange:e.onSelectAgent,children:[(0,c.jsx)(i,{className:`h-9 min-h-9 w-64 rounded-lg border-border bg-card/80 text-xs max-md:w-full`,children:(0,c.jsx)(r,{placeholder:`Agent`})}),(0,c.jsx)(t,{align:`end`,children:e.agents.map(e=>(0,c.jsx)(n,{value:e.id,children:e.name??e.id},e.id))})]}):null]})]})}),(0,c.jsx)(`div`,{className:`min-h-0 overflow-auto pb-6 pl-0 pr-6`,children:(0,c.jsx)(`div`,{className:`grid w-full gap-5`,children:e.enabled?e.loading?(0,c.jsx)(p,{title:`Loading MCPs`,message:`Reading registered MCP metadata.`}):l.length===0?(0,c.jsx)(p,{title:`No MCPs`,message:`The selected agent has no registered MCP tools.`}):l.map(e=>(0,c.jsx)(u,{server:e},e.name)):(0,c.jsx)(p,{title:`MCPs unavailable`,message:`No registered Studio agent exposes MCP tools.`})})})]})}function u(e){return(0,c.jsxs)(`section`,{className:`overflow-hidden rounded-xl border border-border/80 bg-card/55 p-2 shadow-sm`,children:[(0,c.jsxs)(`header`,{className:`grid min-h-14 grid-cols-[minmax(0,1fr)_auto] items-center gap-4 rounded-lg border border-border/60 bg-muted/20 px-4`,children:[(0,c.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,c.jsx)(`h2`,{className:`m-0 truncate text-sm font-semibold text-foreground`,children:e.server.name}),(0,c.jsx)(`span`,{className:`truncate text-xs font-medium text-muted-foreground`,children:e.server.agentId})]}),(0,c.jsxs)(o,{className:`border-border/80 bg-background/50 text-muted-foreground`,children:[e.server.toolCount,` tools`]})]}),(0,c.jsx)(`div`,{className:`mt-1 grid gap-1`,children:e.server.tools.map(e=>(0,c.jsx)(d,{tool:e},`${e.source}:${e.name}`))})]})}function d(e){return(0,c.jsxs)(`article`,{className:`grid grid-cols-[minmax(300px,0.75fr)_minmax(0,1fr)] gap-2 rounded-lg border border-transparent bg-background/25 p-2 transition duration-200 hover:border-border/70 hover:bg-background/35 max-lg:grid-cols-1`,children:[(0,c.jsxs)(`div`,{className:`grid content-start gap-4 rounded-lg bg-card/25 p-3`,children:[(0,c.jsxs)(`div`,{className:`grid gap-1`,children:[(0,c.jsx)(`h3`,{className:`m-0 truncate text-sm font-semibold text-foreground`,children:e.tool.name}),(0,c.jsx)(`span`,{className:` text-xs font-medium text-muted-foreground`,children:e.tool.source})]}),(0,c.jsx)(`p`,{className:`m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground`,children:e.tool.description}),(0,c.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:[(0,c.jsx)(o,{className:m(e.tool.source),children:e.tool.source}),(0,c.jsxs)(o,{className:`border-border/80 bg-transparent text-muted-foreground`,children:[g(e.tool.parameters),` fields`]})]})]}),(0,c.jsx)(f,{value:e.tool.parameters})]})}function f(e){return(0,c.jsxs)(`section`,{className:`grid min-w-0 content-start overflow-hidden rounded-lg bg-background/45`,children:[(0,c.jsxs)(`div`,{className:`flex min-h-9 items-center justify-between gap-3 bg-muted/20 px-4`,children:[(0,c.jsx)(`span`,{className:` text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:`Parameter schema`}),(0,c.jsx)(`span`,{className:` text-xs text-muted-foreground`,children:h(e.value)})]}),(0,c.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,c.jsx)(`pre`,{className:`m-0 max-h-80 min-w-max p-4 text-xs leading-5 text-foreground`,children:(0,c.jsx)(`code`,{children:(0,c.jsx)(s,{text:_(e.value)})})})})]})}function p(e){return(0,c.jsx)(`div`,{className:`grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center`,children:(0,c.jsxs)(`div`,{className:`grid max-w-md gap-2`,children:[(0,c.jsx)(`h2`,{className:`m-0 text-base font-semibold text-foreground`,children:e.title}),(0,c.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:e.message})]})})}function m(e){return e===`dynamic`?`border-border/80 bg-muted/45 text-foreground`:`border-border/80 bg-muted/55 text-muted-foreground`}function h(e){if(typeof e!=`object`||!e||Array.isArray(e))return`value`;let t=e.type;return typeof t==`string`?t:`object`}function g(e){if(typeof e!=`object`||!e||Array.isArray(e))return 0;let t=e.properties;return typeof t==`object`&&t&&!Array.isArray(t)?Object.keys(t).length:0}function _(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}export{l as McpsPage};
2
- //# sourceMappingURL=mcps-page-BJ4m_GoP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcps-page-BJ4m_GoP.js","names":[],"sources":["../../../src/ui/app/modules/mcps/mcps-page.tsx"],"sourcesContent":["import type {\n StudioAgentMcpServerMetadata,\n StudioAgentMcpsSummary,\n StudioAgentMcpToolMetadata,\n StudioConfig,\n} from \"../../../../types\";\nimport { Badge } from \"../../components/ui/badge\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../components/ui/select\";\nimport { JsonSyntax } from \"../shared/renderers\";\n\nexport function McpsPage(props: {\n agents: StudioConfig[\"agents\"];\n selectedAgentId: string;\n summary: StudioAgentMcpsSummary | undefined;\n enabled: boolean;\n loading: boolean;\n onSelectAgent: (agentId: string) => void;\n}) {\n const selectedAgent =\n props.agents.find((agent) => agent.id === props.selectedAgentId) ?? props.agents[0];\n const servers = props.summary?.servers ?? [];\n const toolCount = servers.reduce((total, server) => total + server.toolCount, 0);\n\n return (\n <section\n className=\"grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55\"\n aria-label=\"MCPs\"\n >\n <header className=\"bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur\">\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1\">\n <div className=\"grid min-w-0 gap-2\">\n <div className=\" text-xs font-semibold uppercase tracking-[0.24em] text-foreground\">\n External context\n </div>\n <h1 className=\"m-0 text-2xl font-semibold leading-none tracking-tight text-foreground\">\n MCPs\n </h1>\n <p className=\"m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground\">\n MCP servers and remote tools registered on Studio agents, grouped by server.\n </p>\n </div>\n <div className=\"flex min-w-0 items-center gap-3 max-md:grid max-md:grid-cols-1\">\n <Badge className=\"h-9 justify-center border-border/80 bg-card/70 text-muted-foreground\">\n {servers.length} servers / {toolCount} tools\n </Badge>\n {props.agents.length > 1 ? (\n <Select value={selectedAgent?.id ?? \"\"} onValueChange={props.onSelectAgent}>\n <SelectTrigger className=\"h-9 min-h-9 w-64 rounded-lg border-border bg-card/80 text-xs max-md:w-full\">\n <SelectValue placeholder=\"Agent\" />\n </SelectTrigger>\n <SelectContent align=\"end\">\n {props.agents.map((agent) => (\n <SelectItem value={agent.id} key={agent.id}>\n {agent.name ?? agent.id}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ) : null}\n </div>\n </div>\n </header>\n\n <div className=\"min-h-0 overflow-auto pb-6 pl-0 pr-6\">\n <div className=\"grid w-full gap-5\">\n {!props.enabled ? (\n <EmptyState\n title=\"MCPs unavailable\"\n message=\"No registered Studio agent exposes MCP tools.\"\n />\n ) : props.loading ? (\n <EmptyState title=\"Loading MCPs\" message=\"Reading registered MCP metadata.\" />\n ) : servers.length === 0 ? (\n <EmptyState title=\"No MCPs\" message=\"The selected agent has no registered MCP tools.\" />\n ) : (\n servers.map((server) => <McpServerSection server={server} key={server.name} />)\n )}\n </div>\n </div>\n </section>\n );\n}\n\nfunction McpServerSection(props: { server: StudioAgentMcpServerMetadata }) {\n return (\n <section className=\"overflow-hidden rounded-xl border border-border/80 bg-card/55 p-2 shadow-sm\">\n <header className=\"grid min-h-14 grid-cols-[minmax(0,1fr)_auto] items-center gap-4 rounded-lg border border-border/60 bg-muted/20 px-4\">\n <div className=\"grid min-w-0 gap-1\">\n <h2 className=\"m-0 truncate text-sm font-semibold text-foreground\">\n {props.server.name}\n </h2>\n <span className=\"truncate text-xs font-medium text-muted-foreground\">\n {props.server.agentId}\n </span>\n </div>\n <Badge className=\"border-border/80 bg-background/50 text-muted-foreground\">\n {props.server.toolCount} tools\n </Badge>\n </header>\n <div className=\"mt-1 grid gap-1\">\n {props.server.tools.map((tool) => (\n <McpToolRow tool={tool} key={`${tool.source}:${tool.name}`} />\n ))}\n </div>\n </section>\n );\n}\n\nfunction McpToolRow(props: { tool: StudioAgentMcpToolMetadata }) {\n return (\n <article className=\"grid grid-cols-[minmax(300px,0.75fr)_minmax(0,1fr)] gap-2 rounded-lg border border-transparent bg-background/25 p-2 transition duration-200 hover:border-border/70 hover:bg-background/35 max-lg:grid-cols-1\">\n <div className=\"grid content-start gap-4 rounded-lg bg-card/25 p-3\">\n <div className=\"grid gap-1\">\n <h3 className=\"m-0 truncate text-sm font-semibold text-foreground\">{props.tool.name}</h3>\n <span className=\" text-xs font-medium text-muted-foreground\">{props.tool.source}</span>\n </div>\n <p className=\"m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground\">\n {props.tool.description}\n </p>\n <div className=\"flex min-w-0 flex-wrap gap-2\">\n <Badge className={sourceBadgeClass(props.tool.source)}>{props.tool.source}</Badge>\n <Badge className=\"border-border/80 bg-transparent text-muted-foreground\">\n {schemaPropertyCount(props.tool.parameters)} fields\n </Badge>\n </div>\n </div>\n <SchemaBlock value={props.tool.parameters} />\n </article>\n );\n}\n\nfunction SchemaBlock(props: { value: unknown }) {\n return (\n <section className=\"grid min-w-0 content-start overflow-hidden rounded-lg bg-background/45\">\n <div className=\"flex min-h-9 items-center justify-between gap-3 bg-muted/20 px-4\">\n <span className=\" text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n Parameter schema\n </span>\n <span className=\" text-xs text-muted-foreground\">{schemaType(props.value)}</span>\n </div>\n <div className=\"min-w-0 overflow-x-auto\">\n <pre className=\"m-0 max-h-80 min-w-max p-4 text-xs leading-5 text-foreground\">\n <code>\n <JsonSyntax text={formatSchema(props.value)} />\n </code>\n </pre>\n </div>\n </section>\n );\n}\n\nfunction EmptyState(props: { title: string; message: string }) {\n return (\n <div className=\"grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center\">\n <div className=\"grid max-w-md gap-2\">\n <h2 className=\"m-0 text-base font-semibold text-foreground\">{props.title}</h2>\n <p className=\"m-0 text-sm leading-6 text-muted-foreground\">{props.message}</p>\n </div>\n </div>\n );\n}\n\nfunction sourceBadgeClass(source: \"static\" | \"dynamic\"): string {\n return source === \"dynamic\"\n ? \"border-border/80 bg-muted/45 text-foreground\"\n : \"border-border/80 bg-muted/55 text-muted-foreground\";\n}\n\nfunction schemaType(value: unknown): string {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return \"value\";\n }\n const type = (value as { type?: unknown }).type;\n return typeof type === \"string\" ? type : \"object\";\n}\n\nfunction schemaPropertyCount(value: unknown): number {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return 0;\n }\n const properties = (value as { properties?: unknown }).properties;\n return typeof properties === \"object\" && properties !== null && !Array.isArray(properties)\n ? Object.keys(properties).length\n : 0;\n}\n\nfunction formatSchema(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n"],"mappings":"0MAgBA,SAAgB,EAAS,EAOtB,CACD,IAAM,EACJ,EAAM,OAAO,KAAM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AO,IAAW,UACd,+CACA,qDAGN,SAAS,EAAW,EAAwB,CAC1C,GAAI,OAAO,GAAU,WAAY,GAAkB,MAAM,QAAQ,EAAM,CACrE,MAAO,QAET,IAAM,EAAQ,EAA6B,KAC3C,OAAO,OAAO,GAAS,SAAW,EAAO,SAG3C,SAAS,EAAoB,EAAwB,CACnD,GAAI,OAAO,GAAU,WAAY,GAAkB,MAAM,QAAQ,EAAM,CACrE,MAAO,GAET,IAAM,EAAc,EAAmC,WACvD,OAAO,OAAO,GAAe,UAAY,GAAuB,CAAC,MAAM,QAAQ,EAAW,CACtF,OAAO,KAAK,EAAW,CAAC,OACxB,EAGN,SAAS,EAAa,EAAwB,CAC5C,GAAI,CACF,OAAO,KAAK,UAAU,EAAO,KAAM,EAAE,MAC/B,CACN,OAAO,OAAO,EAAM"}
@@ -1,2 +0,0 @@
1
- import{i as e,r as t,s as n}from"./utils-BN2yP0LH.js";import{o as r}from"./format-C9HPGfkW.js";import{N as i}from"./index-CC5mjRie.js";import{t as a}from"./badge-BH7gz3tB.js";import{t as o}from"./renderers-CIC1VVRv.js";var s=n(e(),1),c=t();function l(e){let[t,n]=(0,s.useState)([]),[o,l]=(0,s.useState)([]),[g,_]=(0,s.useState)(``),[v,y]=(0,s.useState)(``),[b,x]=(0,s.useState)(),[S,C]=(0,s.useState)(),[w,T]=(0,s.useState)(!1),[E,D]=(0,s.useState)(!1),[O,k]=(0,s.useState)(``),A=(0,s.useCallback)(async()=>{if(!e.enabled){n([]),l([]),x(void 0),C(void 0);return}T(!0),k(``);try{let[e,t]=await Promise.all([fetch(`/memory/users?limit=50`),fetch(`/memory/conversations?limit=100`)]);if(!e.ok)throw Error(`Memory users failed with HTTP ${e.status}`);if(!t.ok)throw Error(`Memory conversations failed with HTTP ${t.status}`);let r=await e.json(),i=await t.json();n(r.users),l(i.conversations),y(e=>e||i.conversations[0]?.id||``)}catch(e){k(e instanceof Error?e.message:String(e))}finally{T(!1)}},[e.enabled]);(0,s.useEffect)(()=>{A()},[A]),(0,s.useEffect)(()=>{if(!e.enabled||v.length===0){x(void 0),C(void 0);return}let t=!1;async function n(){D(!0);try{let[e,n]=await Promise.all([fetch(`/memory/conversations/${encodeURIComponent(v)}/messages`),fetch(`/memory/conversations/${encodeURIComponent(v)}/steps`)]);if(!e.ok)throw Error(`Conversation messages failed with HTTP ${e.status}`);if(!n.ok)throw Error(`Conversation steps failed with HTTP ${n.status}`);t||(x(await e.json()),C(await n.json()))}catch(e){t||(k(e instanceof Error?e.message:String(e)),x(void 0),C(void 0))}finally{t||D(!1)}}return n(),()=>{t=!0}},[e.enabled,v]);let j=g.length===0?o:o.filter(e=>e.userId===g),M=o.find(e=>e.id===v)??j[0];return(0,c.jsxs)(`section`,{className:`grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55`,"aria-label":`Memory`,children:[(0,c.jsx)(`header`,{className:`bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur`,children:(0,c.jsxs)(`div`,{className:`grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1`,children:[(0,c.jsxs)(`div`,{className:`grid min-w-0 gap-2`,children:[(0,c.jsx)(`div`,{className:` text-xs font-semibold uppercase tracking-[0.24em] text-foreground`,children:`Conversation store`}),(0,c.jsx)(`h1`,{className:`m-0 text-2xl font-semibold leading-none tracking-tight text-foreground`,children:`Memory`}),(0,c.jsx)(`p`,{className:`m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground`,children:`Stored users, conversations, raw messages, and transcript steps from the Studio session store.`})]}),(0,c.jsx)(i,{className:`h-9 min-h-9 rounded-lg px-3 text-xs`,type:`button`,variant:`secondary`,disabled:w,onClick:()=>void A(),children:`Refresh`})]})}),(0,c.jsx)(`div`,{className:`min-h-0 overflow-auto pb-6 pl-0 pr-6`,children:e.enabled?w&&o.length===0?(0,c.jsx)(m,{title:`Loading memory`,text:`Reading users and conversations.`}):O.length>0&&o.length===0?(0,c.jsx)(m,{title:`Memory error`,text:O}):(0,c.jsxs)(`div`,{className:`grid min-h-0 gap-4 xl:grid-cols-[280px_minmax(320px,0.8fr)_minmax(0,1.2fr)]`,children:[(0,c.jsxs)(`section`,{className:`grid content-start gap-2 rounded-xl border border-border/80 bg-card/45 p-3`,children:[(0,c.jsx)(f,{title:`Users`,value:t.length}),(0,c.jsx)(i,{className:`h-auto min-h-9 justify-start rounded-lg px-3 py-2 text-left text-xs`,type:`button`,variant:g.length===0?`secondary`:`ghost`,onClick:()=>_(``),children:`All users`}),t.map(e=>(0,c.jsxs)(i,{className:`grid h-auto min-h-14 justify-start rounded-lg px-3 py-2 text-left`,type:`button`,variant:g===e.userId?`secondary`:`ghost`,onClick:()=>_(e.userId),children:[(0,c.jsx)(`span`,{className:`min-w-0 truncate text-xs font-semibold`,children:e.userId}),(0,c.jsxs)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:[e.conversationCount,` conversations ·`,` `,r(e.lastInteractionAt)]})]},e.userId))]}),(0,c.jsxs)(`section`,{className:`grid content-start gap-2 rounded-xl border border-border/80 bg-card/45 p-3`,children:[(0,c.jsx)(f,{title:`Conversations`,value:j.length}),j.length===0?(0,c.jsx)(`div`,{className:`rounded-lg border border-dashed border-border/80 bg-background/45 px-3 py-8 text-center text-sm text-muted-foreground`,children:`No conversations.`}):j.map(t=>(0,c.jsx)(u,{conversation:t,agentName:h(e.agents,t.agentId),active:t.id===v,onSelect:()=>y(t.id)},t.id))]}),(0,c.jsx)(`section`,{className:`grid min-h-0 content-start gap-4`,children:M===void 0?(0,c.jsx)(m,{title:`No conversation selected`,text:`Choose a conversation to inspect.`}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`article`,{className:`grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5`,children:[(0,c.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start justify-between gap-3`,children:[(0,c.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,c.jsx)(`h2`,{className:`m-0 min-w-0 truncate text-lg font-semibold text-foreground`,children:M.title??`Untitled conversation`}),(0,c.jsx)(`span`,{className:`min-w-0 break-all text-xs text-muted-foreground`,children:M.id})]}),(0,c.jsx)(a,{className:`border-border/80 bg-muted/45 text-foreground`,children:h(e.agents,M.agentId)})]}),(0,c.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[(0,c.jsx)(p,{label:`user`,value:M.userId}),(0,c.jsx)(p,{label:`messages`,value:M.messageCount}),(0,c.jsx)(p,{label:`updated`,value:r(M.updatedAt)})]})]}),E?(0,c.jsx)(m,{title:`Loading detail`,text:`Reading message and transcript data.`}):(0,c.jsxs)(`div`,{className:`grid gap-4`,children:[(0,c.jsx)(d,{title:`messages`,value:b?.messages??[]}),(0,c.jsx)(d,{title:`steps`,value:S?.steps??[]})]})]})})]}):(0,c.jsx)(m,{title:`Memory unavailable`,text:`This Studio runtime has no session store.`})})]})}function u(e){return(0,c.jsxs)(i,{className:`grid h-auto min-h-20 justify-start gap-2 rounded-lg px-3 py-3 text-left`,type:`button`,variant:e.active?`secondary`:`ghost`,onClick:e.onSelect,children:[(0,c.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,c.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold text-foreground`,children:e.conversation.title??`Untitled conversation`}),(0,c.jsxs)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:[e.agentName,` · `,e.conversation.userId]})]}),(0,c.jsxs)(`span`,{className:` text-xs text-muted-foreground`,children:[e.conversation.messageCount,` messages ·`,` `,r(e.conversation.updatedAt)]})]})}function d(e){let t=Array.isArray(e.value)?e.value.length:void 0;return(0,c.jsxs)(`section`,{className:`grid min-w-0 overflow-hidden rounded-xl border border-border/80 bg-card/45`,children:[(0,c.jsx)(`div`,{className:`flex min-h-10 items-center justify-between gap-3 border-b border-border/80 bg-muted/20 px-4`,children:(0,c.jsx)(f,{title:e.title,...t===void 0?{}:{value:t}})}),(0,c.jsx)(`div`,{className:`min-w-0 overflow-x-auto`,children:(0,c.jsx)(`pre`,{className:`m-0 max-h-96 min-w-max p-4 text-xs leading-5 text-foreground`,children:(0,c.jsx)(`code`,{children:(0,c.jsx)(o,{text:JSON.stringify(e.value,null,2)})})})})]})}function f(e){return(0,c.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,c.jsx)(`h2`,{className:`m-0 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:e.title}),e.value===void 0?null:(0,c.jsx)(`span`,{className:` text-xs font-semibold text-muted-foreground`,children:e.value})]})}function p(e){return(0,c.jsxs)(`div`,{className:`grid min-w-0 gap-1 rounded-lg bg-background/45 px-3 py-2`,children:[(0,c.jsx)(`span`,{className:` text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:e.label}),(0,c.jsx)(`span`,{className:`min-w-0 truncate text-xs text-foreground`,title:String(e.value),children:e.value})]})}function m(e){return(0,c.jsx)(`div`,{className:`grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center`,children:(0,c.jsxs)(`div`,{className:`grid max-w-md gap-2`,children:[(0,c.jsx)(`h2`,{className:`m-0 text-base font-semibold text-foreground`,children:e.title}),(0,c.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:e.text})]})})}function h(e,t){return e.find(e=>e.id===t)?.name??t}export{l as MemoryPage};
2
- //# sourceMappingURL=memory-page-BuerJ-04.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory-page-BuerJ-04.js","names":[],"sources":["../../../src/ui/app/modules/memory/memory-page.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from \"react\";\nimport type {\n StudioConfig,\n StudioMemoryConversationMessages,\n StudioMemoryConversationSteps,\n StudioMemoryConversationSummary,\n StudioMemoryConversationsPage,\n StudioMemoryUsersPage,\n} from \"../../../../types\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { formatRelativeTime } from \"../shared/format\";\nimport { JsonSyntax } from \"../shared/renderers\";\n\nexport function MemoryPage(props: { agents: StudioConfig[\"agents\"]; enabled: boolean }) {\n const [users, setUsers] = useState<StudioMemoryUsersPage[\"users\"]>([]);\n const [conversations, setConversations] = useState<StudioMemoryConversationSummary[]>([]);\n const [selectedUserId, setSelectedUserId] = useState(\"\");\n const [selectedConversationId, setSelectedConversationId] = useState(\"\");\n const [messages, setMessages] = useState<StudioMemoryConversationMessages | undefined>();\n const [steps, setSteps] = useState<StudioMemoryConversationSteps | undefined>();\n const [loading, setLoading] = useState(false);\n const [detailLoading, setDetailLoading] = useState(false);\n const [error, setError] = useState(\"\");\n\n const loadMemory = useCallback(async () => {\n if (!props.enabled) {\n setUsers([]);\n setConversations([]);\n setMessages(undefined);\n setSteps(undefined);\n return;\n }\n setLoading(true);\n setError(\"\");\n try {\n const [usersResponse, conversationsResponse] = await Promise.all([\n fetch(\"/memory/users?limit=50\"),\n fetch(\"/memory/conversations?limit=100\"),\n ]);\n if (!usersResponse.ok) {\n throw new Error(`Memory users failed with HTTP ${usersResponse.status}`);\n }\n if (!conversationsResponse.ok) {\n throw new Error(`Memory conversations failed with HTTP ${conversationsResponse.status}`);\n }\n const usersBody = (await usersResponse.json()) as StudioMemoryUsersPage;\n const conversationsBody =\n (await conversationsResponse.json()) as StudioMemoryConversationsPage;\n setUsers(usersBody.users);\n setConversations(conversationsBody.conversations);\n setSelectedConversationId(\n (current) => current || conversationsBody.conversations[0]?.id || \"\",\n );\n } catch (loadError) {\n setError(loadError instanceof Error ? loadError.message : String(loadError));\n } finally {\n setLoading(false);\n }\n }, [props.enabled]);\n\n useEffect(() => {\n void loadMemory();\n }, [loadMemory]);\n\n useEffect(() => {\n if (!props.enabled || selectedConversationId.length === 0) {\n setMessages(undefined);\n setSteps(undefined);\n return;\n }\n let cancelled = false;\n async function loadDetail() {\n setDetailLoading(true);\n try {\n const [messagesResponse, stepsResponse] = await Promise.all([\n fetch(`/memory/conversations/${encodeURIComponent(selectedConversationId)}/messages`),\n fetch(`/memory/conversations/${encodeURIComponent(selectedConversationId)}/steps`),\n ]);\n if (!messagesResponse.ok) {\n throw new Error(`Conversation messages failed with HTTP ${messagesResponse.status}`);\n }\n if (!stepsResponse.ok) {\n throw new Error(`Conversation steps failed with HTTP ${stepsResponse.status}`);\n }\n if (!cancelled) {\n setMessages((await messagesResponse.json()) as StudioMemoryConversationMessages);\n setSteps((await stepsResponse.json()) as StudioMemoryConversationSteps);\n }\n } catch (loadError) {\n if (!cancelled) {\n setError(loadError instanceof Error ? loadError.message : String(loadError));\n setMessages(undefined);\n setSteps(undefined);\n }\n } finally {\n if (!cancelled) {\n setDetailLoading(false);\n }\n }\n }\n void loadDetail();\n return () => {\n cancelled = true;\n };\n }, [props.enabled, selectedConversationId]);\n\n const visibleConversations =\n selectedUserId.length === 0\n ? conversations\n : conversations.filter((conversation) => conversation.userId === selectedUserId);\n const selectedConversation =\n conversations.find((conversation) => conversation.id === selectedConversationId) ??\n visibleConversations[0];\n\n return (\n <section\n className=\"grid min-h-0 grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/55\"\n aria-label=\"Memory\"\n >\n <header className=\"bg-background/70 pb-5 pl-0 pr-6 pt-0 backdrop-blur\">\n <div className=\"grid w-full grid-cols-[minmax(0,1fr)_auto] items-end gap-4 max-md:grid-cols-1\">\n <div className=\"grid min-w-0 gap-2\">\n <div className=\" text-xs font-semibold uppercase tracking-[0.24em] text-foreground\">\n Conversation store\n </div>\n <h1 className=\"m-0 text-2xl font-semibold leading-none tracking-tight text-foreground\">\n Memory\n </h1>\n <p className=\"m-0 max-w-[62ch] text-sm leading-6 text-muted-foreground\">\n Stored users, conversations, raw messages, and transcript steps from the Studio\n session store.\n </p>\n </div>\n <Button\n className=\"h-9 min-h-9 rounded-lg px-3 text-xs\"\n type=\"button\"\n variant=\"secondary\"\n disabled={loading}\n onClick={() => void loadMemory()}\n >\n Refresh\n </Button>\n </div>\n </header>\n\n <div className=\"min-h-0 overflow-auto pb-6 pl-0 pr-6\">\n {!props.enabled ? (\n <EmptyState title=\"Memory unavailable\" text=\"This Studio runtime has no session store.\" />\n ) : loading && conversations.length === 0 ? (\n <EmptyState title=\"Loading memory\" text=\"Reading users and conversations.\" />\n ) : error.length > 0 && conversations.length === 0 ? (\n <EmptyState title=\"Memory error\" text={error} />\n ) : (\n <div className=\"grid min-h-0 gap-4 xl:grid-cols-[280px_minmax(320px,0.8fr)_minmax(0,1.2fr)]\">\n <section className=\"grid content-start gap-2 rounded-xl border border-border/80 bg-card/45 p-3\">\n <PanelHeader title=\"Users\" value={users.length} />\n <Button\n className=\"h-auto min-h-9 justify-start rounded-lg px-3 py-2 text-left text-xs\"\n type=\"button\"\n variant={selectedUserId.length === 0 ? \"secondary\" : \"ghost\"}\n onClick={() => setSelectedUserId(\"\")}\n >\n All users\n </Button>\n {users.map((user) => (\n <Button\n className=\"grid h-auto min-h-14 justify-start rounded-lg px-3 py-2 text-left\"\n type=\"button\"\n variant={selectedUserId === user.userId ? \"secondary\" : \"ghost\"}\n onClick={() => setSelectedUserId(user.userId)}\n key={user.userId}\n >\n <span className=\"min-w-0 truncate text-xs font-semibold\">{user.userId}</span>\n <span className=\"min-w-0 truncate text-xs text-muted-foreground\">\n {user.conversationCount} conversations ·{\" \"}\n {formatRelativeTime(user.lastInteractionAt)}\n </span>\n </Button>\n ))}\n </section>\n\n <section className=\"grid content-start gap-2 rounded-xl border border-border/80 bg-card/45 p-3\">\n <PanelHeader title=\"Conversations\" value={visibleConversations.length} />\n {visibleConversations.length === 0 ? (\n <div className=\"rounded-lg border border-dashed border-border/80 bg-background/45 px-3 py-8 text-center text-sm text-muted-foreground\">\n No conversations.\n </div>\n ) : (\n visibleConversations.map((conversation) => (\n <ConversationButton\n key={conversation.id}\n conversation={conversation}\n agentName={agentLabel(props.agents, conversation.agentId)}\n active={conversation.id === selectedConversationId}\n onSelect={() => setSelectedConversationId(conversation.id)}\n />\n ))\n )}\n </section>\n\n <section className=\"grid min-h-0 content-start gap-4\">\n {selectedConversation === undefined ? (\n <EmptyState\n title=\"No conversation selected\"\n text=\"Choose a conversation to inspect.\"\n />\n ) : (\n <>\n <article className=\"grid gap-3 rounded-xl border border-border/80 bg-card/45 p-5\">\n <div className=\"flex min-w-0 flex-wrap items-start justify-between gap-3\">\n <div className=\"grid min-w-0 gap-1\">\n <h2 className=\"m-0 min-w-0 truncate text-lg font-semibold text-foreground\">\n {selectedConversation.title ?? \"Untitled conversation\"}\n </h2>\n <span className=\"min-w-0 break-all text-xs text-muted-foreground\">\n {selectedConversation.id}\n </span>\n </div>\n <Badge className=\"border-border/80 bg-muted/45 text-foreground\">\n {agentLabel(props.agents, selectedConversation.agentId)}\n </Badge>\n </div>\n <div className=\"grid gap-2 sm:grid-cols-3\">\n <Fact label=\"user\" value={selectedConversation.userId} />\n <Fact label=\"messages\" value={selectedConversation.messageCount} />\n <Fact\n label=\"updated\"\n value={formatRelativeTime(selectedConversation.updatedAt)}\n />\n </div>\n </article>\n {detailLoading ? (\n <EmptyState\n title=\"Loading detail\"\n text=\"Reading message and transcript data.\"\n />\n ) : (\n <div className=\"grid gap-4\">\n <JsonPanel title=\"messages\" value={messages?.messages ?? []} />\n <JsonPanel title=\"steps\" value={steps?.steps ?? []} />\n </div>\n )}\n </>\n )}\n </section>\n </div>\n )}\n </div>\n </section>\n );\n}\n\nfunction ConversationButton(props: {\n conversation: StudioMemoryConversationSummary;\n agentName: string;\n active: boolean;\n onSelect: () => void;\n}) {\n return (\n <Button\n className=\"grid h-auto min-h-20 justify-start gap-2 rounded-lg px-3 py-3 text-left\"\n type=\"button\"\n variant={props.active ? \"secondary\" : \"ghost\"}\n onClick={props.onSelect}\n >\n <div className=\"grid min-w-0 gap-1\">\n <span className=\"min-w-0 truncate text-sm font-semibold text-foreground\">\n {props.conversation.title ?? \"Untitled conversation\"}\n </span>\n <span className=\"min-w-0 truncate text-xs text-muted-foreground\">\n {props.agentName} · {props.conversation.userId}\n </span>\n </div>\n <span className=\" text-xs text-muted-foreground\">\n {props.conversation.messageCount} messages ·{\" \"}\n {formatRelativeTime(props.conversation.updatedAt)}\n </span>\n </Button>\n );\n}\n\nfunction JsonPanel(props: { title: string; value: unknown }) {\n const count = Array.isArray(props.value) ? props.value.length : undefined;\n return (\n <section className=\"grid min-w-0 overflow-hidden rounded-xl border border-border/80 bg-card/45\">\n <div className=\"flex min-h-10 items-center justify-between gap-3 border-b border-border/80 bg-muted/20 px-4\">\n <PanelHeader title={props.title} {...(count === undefined ? {} : { value: count })} />\n </div>\n <div className=\"min-w-0 overflow-x-auto\">\n <pre className=\"m-0 max-h-96 min-w-max p-4 text-xs leading-5 text-foreground\">\n <code>\n <JsonSyntax text={JSON.stringify(props.value, null, 2)} />\n </code>\n </pre>\n </div>\n </section>\n );\n}\n\nfunction PanelHeader(props: { title: string; value?: number }) {\n return (\n <div className=\"flex min-w-0 items-center justify-between gap-3\">\n <h2 className=\"m-0 text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground\">\n {props.title}\n </h2>\n {props.value === undefined ? null : (\n <span className=\" text-xs font-semibold text-muted-foreground\">{props.value}</span>\n )}\n </div>\n );\n}\n\nfunction Fact(props: { label: string; value: string | number }) {\n return (\n <div className=\"grid min-w-0 gap-1 rounded-lg bg-background/45 px-3 py-2\">\n <span className=\" text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground\">\n {props.label}\n </span>\n <span className=\"min-w-0 truncate text-xs text-foreground\" title={String(props.value)}>\n {props.value}\n </span>\n </div>\n );\n}\n\nfunction EmptyState(props: { title: string; text: string }) {\n return (\n <div className=\"grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center\">\n <div className=\"grid max-w-md gap-2\">\n <h2 className=\"m-0 text-base font-semibold text-foreground\">{props.title}</h2>\n <p className=\"m-0 text-sm leading-6 text-muted-foreground\">{props.text}</p>\n </div>\n </div>\n );\n}\n\nfunction agentLabel(agents: StudioConfig[\"agents\"], agentId: string): string {\n return agents.find((agent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