@whoz-oss/coday-client 0.118.2 → 0.120.0
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.
- package/browser/chunk-25MTCGSQ.js +1 -0
- package/browser/chunk-4VDSG7R6.js +11 -0
- package/browser/{chunk-FZVCANBC.js → chunk-5NIZ3ZYP.js} +1 -1
- package/browser/{chunk-6PWH64OF.js → chunk-665PXQXJ.js} +1 -1
- package/browser/{chunk-L72BYLQX.js → chunk-75YBV3AO.js} +1 -1
- package/browser/{chunk-QJ5RZT2C.js → chunk-7AQBJ5TI.js} +1 -1
- package/browser/{chunk-ORNGVCRW.js → chunk-7TOE3DRW.js} +1 -1
- package/browser/chunk-AY5OKKHN.js +1 -0
- package/browser/{chunk-3QJA3PD3.js → chunk-BIJXZ7JD.js} +1 -1
- package/browser/chunk-BJWCFY2A.js +1 -0
- package/browser/chunk-BYBGUR45.js +1 -0
- package/browser/chunk-CNPJ5XEL.js +1 -0
- package/browser/{chunk-JCQFYRAF.js → chunk-DCHGOWKI.js} +1 -1
- package/browser/chunk-ENCPEUR3.js +1 -0
- package/browser/chunk-F7YZBZT4.js +1 -0
- package/browser/chunk-GUVOZD4J.js +1 -0
- package/browser/{chunk-H72Z2LX3.js → chunk-HNL4PUVG.js} +1 -1
- package/browser/{chunk-NSSFL3WG.js → chunk-ITOHO7HS.js} +1 -1
- package/browser/chunk-JBCOCIPY.js +1 -0
- package/browser/chunk-JDOIYNG7.js +1 -0
- package/browser/chunk-JSIAY7XX.js +1 -0
- package/browser/chunk-K4ZGQGPW.js +1 -0
- package/browser/chunk-N7MEOGQ5.js +1 -0
- package/browser/{chunk-6F5GPHWV.js → chunk-PKJOCTNH.js} +1 -1
- package/browser/{chunk-6WUBJOTP.js → chunk-PSC2HZRN.js} +1 -1
- package/browser/chunk-PXA63SBZ.js +1 -0
- package/browser/{chunk-55ETGHKC.js → chunk-QCHIMPFZ.js} +1 -1
- package/browser/chunk-QMHQ4NWQ.js +2 -0
- package/browser/{chunk-TRUXCA4C.js → chunk-QU3UZZE4.js} +2 -2
- package/browser/{chunk-5MXEOOQM.js → chunk-S2O6N5YR.js} +1 -1
- package/browser/{chunk-ISPDD5IG.js → chunk-S43E5ZUR.js} +1 -1
- package/browser/{chunk-H5JAF7XP.js → chunk-SOIUR4KR.js} +1 -1
- package/browser/{chunk-VVZKXHDD.js → chunk-SQBLNCXA.js} +1 -1
- package/browser/{chunk-AE24ERN3.js → chunk-U3HXU6IS.js} +1 -1
- package/browser/{chunk-OUZFS4TC.js → chunk-UAD6TAO5.js} +1 -1
- package/browser/chunk-VWFPTABT.js +1 -0
- package/browser/{chunk-HGEXTRZ7.js → chunk-XYUTAO2Y.js} +1 -1
- package/browser/chunk-YJVSFPKB.js +1 -0
- package/browser/index.html +2 -2
- package/browser/{main-HAHNWM6R.js → main-2VS5AL3N.js} +2 -2
- package/browser/{styles-7E3CGANH.css → styles-HC545BYS.css} +1 -1
- package/package.json +1 -1
- package/browser/chunk-23NDPEFI.js +0 -1
- package/browser/chunk-2DVVHRX4.js +0 -1
- package/browser/chunk-4NNLWDVJ.js +0 -10
- package/browser/chunk-4SMKZ2HA.js +0 -1
- package/browser/chunk-5JA4YMVL.js +0 -1
- package/browser/chunk-6XQBGSR4.js +0 -1
- package/browser/chunk-AE2AQO4B.js +0 -2
- package/browser/chunk-AWTXRCO7.js +0 -1
- package/browser/chunk-B2QVH3K3.js +0 -1
- package/browser/chunk-C74ZFHFW.js +0 -1
- package/browser/chunk-FMBLR6NH.js +0 -1
- package/browser/chunk-JROTC4FL.js +0 -1
- package/browser/chunk-SPAN622B.js +0 -1
- package/browser/chunk-STNEVMCX.js +0 -2
- package/browser/chunk-W6CHMIAC.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as Q}from"./chunk-4NNLWDVJ.js";import{a as K}from"./chunk-2DVVHRX4.js";import{$a as D,Ea as R,Qa as N,Qb as k,Sa as g,T as b,Ta as h,Wa as A,X as E,Xa as F,Y as S,Ya as T,Za as i,_a as r,da as I,ga as v,gb as M,ha as P,ib as y,kb as p,ob as q,oc as $,pb as V,qb as z,rc as L,ua as l,wb as w,yb as d,zb as C}from"./chunk-TRUXCA4C.js";var G=["composerInput"],H=(o,t)=>t.kind==="message"?t.event.id:t.kind==="tool"?t.call.requestId:"streaming";function U(o,t){o&1&&(i(0,"div",3)(1,"p"),d(2,"No messages yet."),r()())}function Y(o,t){if(o&1&&(i(0,"div",14)(1,"span",15),d(2),r(),i(3,"p",16),d(4),r()()),o&2){let e=p().$implicit,n=p(2);w("case-chat__message--user",e.event.actor.role==="USER")("case-chat__message--agent",e.event.actor.role==="AGENT"),l(2),C(e.event.actor.displayName),l(2),C(n.extractText(e.event))}}function J(o,t){if(o&1&&(i(0,"div",12)(1,"span",15),d(2),r(),i(3,"p",16),d(4),r()()),o&2){let e=p().$implicit,n=p(2);l(2),C(n.agentDisplayName()),l(2),C(e.text)}}function Z(o,t){o&1&&d(0," \u23F3 ")}function W(o,t){o&1&&d(0," \u2705 ")}function X(o,t){o&1&&d(0," \u274C ")}function ee(o,t){if(o&1&&(i(0,"div",23)(1,"span",24),d(2,"Payload"),r(),i(3,"pre"),d(4),r()()),o&2){let e=p(3).$implicit;l(4),C(e.call.args)}}function te(o,t){o&1&&(i(0,"pre"),d(1),r()),o&2&&(l(),C(t))}function ne(o,t){o&1&&(i(0,"span",25),d(1,"Running\u2026"),r())}function oe(o,t){o&1&&(i(0,"span",26),d(1,"No output"),r())}function ae(o,t){if(o&1&&(i(0,"div",22),g(1,ee,5,1,"div",23),i(2,"div",23)(3,"span",24),d(4,"Output"),r(),g(5,te,2,1,"pre")(6,ne,2,0,"span",25)(7,oe,2,0,"span",26),r()()),o&2){let e,n=p(2).$implicit,a=p(2);l(),h(n.call.args?1:-1),l(4),h((e=a.extractToolOutput(n.call))?5:n.call.response?7:6,e)}}function ie(o,t){if(o&1){let e=M();i(0,"div",17)(1,"button",18),y("click",function(){E(e);let a=p().$implicit,m=p(2);return S(m.toggleToolCall(a.call.requestId))}),i(2,"span",19),g(3,Z,1,0)(4,W,1,0)(5,X,1,0),r(),i(6,"span",20),d(7),r(),i(8,"span",21),d(9),r()(),g(10,ae,8,2,"div",22),r()}if(o&2){let e=p().$implicit,n=p(2);w("case-chat__tool-call--pending",!e.call.response)("case-chat__tool-call--success",(e.call.response==null?null:e.call.response.success)===!0)("case-chat__tool-call--error",(e.call.response==null?null:e.call.response.success)===!1),l(),N("aria-expanded",n.isToolCallExpanded(e.call.requestId)),l(2),h(e.call.response?e.call.response.success?4:5:3),l(4),C(e.call.toolName),l(2),C(n.isToolCallExpanded(e.call.requestId)?"\u25BC":"\u25B6"),l(),h(n.isToolCallExpanded(e.call.requestId)?10:-1)}}function se(o,t){if(o&1&&g(0,Y,5,6,"div",11)(1,J,5,2,"div",12)(2,ie,11,11,"div",13),o&2){let e=t.$implicit;h(e.kind==="message"?0:e.kind==="streaming"?1:2)}}function re(o,t){if(o&1&&A(0,se,3,1,null,null,H),o&2){let e=p();F(e.timeline())}}function le(o,t){o&1&&(i(0,"div",4),D(1,"span",27)(2,"span",27)(3,"span",27),r())}function ce(o,t){if(o&1){let e=M();i(0,"ds-icon-button",28),y("action",function(){E(e);let a=p();return S(a.interrupt())}),r()}}function de(o,t){if(o&1){let e=M();i(0,"ds-icon-button",29),y("action",function(){E(e);let a=p();return S(a.submit())}),r()}if(o&2){let e=p();T("disabled",!e.canSend)}}var j=class o{route=b(L);http=b($);zone=b(I);config=b(K);caseId=this.route.snapshot.params.caseId;namespaceId=this.route.snapshot.params.namespaceId;agentDisplayName=k(()=>{let t=this.events();for(let e=t.length-1;e>=0;e--){let n=t[e];if(n){if(n.type==="AgentRunningEvent"||n.type==="AgentSelectedEvent"||n.type==="AgentFinishedEvent"){let a=n.agentName;if(a&&a.trim().length>0)return a}if(n.type==="MessageEvent"){let a=n;if(a.actor?.role==="AGENT"&&a.actor.displayName)return a.actor.displayName}}}return"Assistant"});eventSource=null;composerInput;events=v([]);inputValue=v("");isRunning=v(!1);isTerminal=v(!1);streamingText=v("");collapsedTools=v(new Set);constructor(){P(()=>{this.isRunning()||this.isTerminal()||queueMicrotask(()=>this.composerInput?.nativeElement.focus())})}timeline=k(()=>{let t=this.events(),e=this.streamingText(),n=new Map;for(let c of t)if(c.type==="ToolRequestEvent"){let _=c,s=_.toolRequestId??c.id,f=n.get(s);n.set(s,{requestId:s,toolName:_.toolName??"unknown",args:_.args??null,response:f?.response})}else if(c.type==="ToolResponseEvent"){let _=c,s=_.toolRequestId??c.id,f=n.get(s);n.set(s,{requestId:s,toolName:f?.toolName??_.toolName??"unknown",args:f?.args??null,response:_})}let a=[],m=new Set;for(let c of t)if(c.type==="MessageEvent")a.push({kind:"message",event:c});else if(c.type==="ToolRequestEvent"||c.type==="ToolResponseEvent"){let s=c.toolRequestId??c.id;m.has(s)||(m.add(s),a.push({kind:"tool",call:n.get(s)}))}return e.trim().length>0&&a.push({kind:"streaming",text:e}),a});get canSend(){return!!this.inputValue().trim()&&!this.isRunning()&&!this.isTerminal()}ngOnInit(){this.connectSse()}ngOnDestroy(){this.eventSource?.close()}connectSse(){let t=`${this.config.basePath}/api/cases/${this.caseId}/events`;console.log("[AgentOS SSE] connecting",{url:t,basePath:this.config.basePath,caseId:this.caseId,namespaceId:this.namespaceId,now:new Date().toISOString()}),this.eventSource=this.zone.runOutsideAngular(()=>new EventSource(t));let e=a=>{let m=performance.now(),c=a.type,_=a.data;console.log("[AgentOS SSE] frame received",{sseEventName:c,dataLength:_?.length??0,dataPreview:_?.slice(0,120),receivedAtMs:m});try{let s=JSON.parse(_);this.zone.run(()=>{let f=this.events().length;this.events.update(u=>u.some(x=>x.id===s.id)?u:[...u,s]);let B=this.events().length;if(console.log("[AgentOS SSE] event processed",{sseEventName:c,eventType:s.type,eventId:s.id,beforeLen:f,afterLen:B,running:this.isRunning(),terminal:this.isTerminal()}),s.type==="TextChunkEvent"){let u=s.chunk;u&&this.streamingText.update(x=>x+u);return}if(s.type==="CaseStatusEvent"){let u=s.status,x=u==="KILLED"||u==="ERROR";if(this.isTerminal.set(x),x)this.isRunning.set(!1),this.eventSource?.close(),this.eventSource=null;else{let O=u==="RUNNING";this.isRunning.set(O),O||this.streamingText.set("")}return}if(s.type==="AgentFinishedEvent"){this.isRunning.set(!1),this.streamingText.set("");return}})}catch(s){console.warn("[AgentOS SSE] failed to parse event data",{sseEventName:c,error:s,dataPreview:_?.slice(0,500)})}},n=["MessageEvent","CaseStatusEvent","AgentSelectedEvent","AgentRunningEvent","AgentFinishedEvent","ThinkingEvent","TextChunkEvent","ToolRequestEvent","ToolResponseEvent"];for(let a of n)console.log("[AgentOS SSE] addEventListener",a),this.eventSource.addEventListener(a,e);this.eventSource.onopen=()=>{console.log("[AgentOS SSE] connection open",{readyState:this.eventSource?.readyState,at:new Date().toISOString()})},this.eventSource.onmessage=a=>{console.log("[AgentOS SSE] onmessage (unnamed event) received",{dataLength:a.data?.length??0,dataPreview:a.data?.slice(0,120)})},this.eventSource.onerror=a=>{console.warn("[AgentOS SSE] connection error",{err:a,readyState:this.eventSource?.readyState,at:new Date().toISOString()}),this.zone.run(()=>{this.isRunning.set(!1)})}}onInput(t){this.inputValue.set(t.target.value)}onKeydown(t){t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.submit())}submit(){if(!this.canSend)return;let t=this.inputValue().trim();this.inputValue.set(""),this.isRunning.set(!0),this.streamingText.set(""),this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/messages`,{content:t,userId:"default-user"}).subscribe({error:e=>{console.error("[CaseChat] Failed to send message",e),this.isRunning.set(!1)}})}interrupt(){this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/interrupt`,{}).subscribe({error:t=>console.error("[CaseChat] Failed to interrupt case",t)})}kill(){this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/kill`,{}).subscribe({error:t=>console.error("[CaseChat] Failed to kill case",t)})}extractText(t){return t.content?.filter(e=>"content"in e).map(e=>e.content).join("")??""}extractToolOutput(t){if(!t.response)return null;let e=t.response.output;return e?e.content??null:null}toggleToolCall(t){this.collapsedTools.update(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})}isToolCallExpanded(t){return this.collapsedTools().has(t)}_namespaceId=this.namespaceId;static \u0275fac=function(e){return new(e||o)};static \u0275cmp=R({type:o,selectors:[["agentos-case-chat"]],viewQuery:function(e,n){if(e&1&&q(G,5),e&2){let a;V(a=z())&&(n.composerInput=a.first)}},decls:12,vars:6,consts:[["composerInput",""],[1,"case-chat"],[1,"case-chat__messages"],[1,"case-chat__empty"],[1,"case-chat__thinking"],[1,"case-chat__composer"],["placeholder","Reply\u2026","rows","3",1,"case-chat__input",3,"input","keydown","value","disabled"],[1,"case-chat__actions"],["icon","stop","variant","danger","title","Interrupt"],["icon","send","variant","primary","title","Send (Enter)",3,"disabled"],["icon","cancel","variant","danger","title","Kill",3,"action","disabled"],[1,"case-chat__message",3,"case-chat__message--user","case-chat__message--agent"],[1,"case-chat__message","case-chat__message--agent","case-chat__message--streaming"],[1,"case-chat__tool-call",3,"case-chat__tool-call--pending","case-chat__tool-call--success","case-chat__tool-call--error"],[1,"case-chat__message"],[1,"case-chat__message-author"],[1,"case-chat__message-text"],[1,"case-chat__tool-call"],["type","button",1,"case-chat__tool-call-header",3,"click"],[1,"case-chat__tool-call-icon"],[1,"case-chat__tool-call-name"],[1,"case-chat__tool-call-chevron"],[1,"case-chat__tool-call-output"],[1,"case-chat__tool-call-section"],[1,"case-chat__tool-call-label"],[1,"case-chat__tool-call-pending"],[1,"case-chat__tool-call-empty"],[1,"thinking-dot"],["icon","stop","variant","danger","title","Interrupt",3,"action"],["icon","send","variant","primary","title","Send (Enter)",3,"action","disabled"]],template:function(e,n){e&1&&(i(0,"div",1)(1,"div",2),g(2,U,3,0,"div",3)(3,re,2,0),g(4,le,4,0,"div",4),r(),i(5,"div",5)(6,"textarea",6,0),y("input",function(m){return n.onInput(m)})("keydown",function(m){return n.onKeydown(m)}),r(),i(8,"div",7),g(9,ce,1,0,"ds-icon-button",8)(10,de,1,1,"ds-icon-button",9),i(11,"ds-icon-button",10),y("action",function(){return n.kill()}),r()()()()),e&2&&(l(2),h(n.timeline().length===0?2:3),l(2),h(n.isRunning()?4:-1),l(2),T("value",n.inputValue())("disabled",n.isRunning()||n.isTerminal()),l(3),h(n.isRunning()?9:10),l(2),T("disabled",n.isTerminal()))},dependencies:[Q],styles:['.case-chat[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-width:800px;margin:0 auto;padding:1.5rem;gap:1rem}.case-chat__messages[_ngcontent-%COMP%]{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:.75rem;padding-bottom:.5rem}.case-chat__empty[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex:1}.case-chat__empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.case-chat__tool-calls[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;margin-top:.25rem}.case-chat__tool-call[_ngcontent-%COMP%]{border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--glass-bg, rgba(255, 255, 255, .72));font-size:.8rem;overflow:hidden;transition:border-color .2s ease}.case-chat__tool-call--pending[_ngcontent-%COMP%]{border-color:var(--color-warning, #f5a623);opacity:.8}.case-chat__tool-call--success[_ngcontent-%COMP%]{border-color:var(--color-success, #34c759)}.case-chat__tool-call--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.case-chat__tool-call-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.4rem;width:100%;padding:.4rem .6rem;background:transparent;border:none;cursor:pointer;text-align:left;color:var(--color-text, #1d1d1f);font-family:inherit;font-size:.8rem}.case-chat__tool-call-header[_ngcontent-%COMP%]:hover{background:#0000000a}.case-chat__tool-call-icon[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem}.case-chat__tool-call-name[_ngcontent-%COMP%]{font-weight:600;font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);color:var(--color-primary, #0071e3);flex-shrink:0}.case-chat__tool-call-args[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.case-chat__tool-call-chevron[_ngcontent-%COMP%]{flex-shrink:0;font-size:.6rem;color:var(--color-text-secondary, #6e6e73);margin-left:auto}.case-chat__tool-call-output[_ngcontent-%COMP%]{border-top:1px solid var(--color-border, rgba(0, 0, 0, .08));display:flex;flex-direction:column}.case-chat__tool-call-section[_ngcontent-%COMP%]{padding:.4rem .6rem .5rem}.case-chat__tool-call-section[_ngcontent-%COMP%] + .case-chat__tool-call-section[_ngcontent-%COMP%]{border-top:1px solid var(--color-border, rgba(0, 0, 0, .06))}.case-chat__tool-call-section[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:.25rem 0 0;white-space:pre-wrap;word-break:break-all;font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);font-size:.75rem;color:var(--color-text, #1d1d1f);max-height:200px;overflow-y:auto}.case-chat__tool-call-label[_ngcontent-%COMP%]{display:block;font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-secondary, #6e6e73)}.case-chat__tool-call-pending[_ngcontent-%COMP%], .case-chat__tool-call-empty[_ngcontent-%COMP%]{display:block;margin-top:.25rem;color:var(--color-text-secondary, #6e6e73);font-style:italic;font-size:.75rem}.case-chat__thinking[_ngcontent-%COMP%]{display:flex;gap:.3rem;padding:.75rem 1rem;align-self:flex-start}.case-chat__message--streaming[_ngcontent-%COMP%]{opacity:.95}.case-chat__composer[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:16px;padding:.5rem .5rem .5rem 1rem}.case-chat__input[_ngcontent-%COMP%]{flex:1;resize:none;padding:.5rem 0;border:none;background:transparent;color:var(--color-text, #1d1d1f);font-size:.95rem;font-family:inherit;line-height:1.5;outline:none;min-height:40px}.case-chat__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.case-chat__input[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.case-chat__actions[_ngcontent-%COMP%]{display:flex;align-items:center;flex-shrink:0}.thinking-dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background:var(--color-text-secondary, #6e6e73);animation:_ngcontent-%COMP%_thinking-bounce 1.2s ease-in-out infinite}.thinking-dot[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.thinking-dot[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_thinking-bounce{0%,80%,to{transform:translateY(0);opacity:.4}40%{transform:translateY(-6px);opacity:1}}']})};export{j as a};
|
|
1
|
+
import{u as Q}from"./chunk-4VDSG7R6.js";import{a as K}from"./chunk-K4ZGQGPW.js";import{$a as D,Ea as R,Qa as N,Qb as k,Sa as g,T as b,Ta as h,Wa as A,X as E,Xa as F,Y as S,Ya as T,Za as i,_a as r,da as I,ga as v,gb as M,ha as P,ib as y,kb as p,ob as q,oc as $,pb as V,qb as z,rc as L,ua as l,wb as w,yb as d,zb as C}from"./chunk-QU3UZZE4.js";var G=["composerInput"],H=(o,t)=>t.kind==="message"?t.event.id:t.kind==="tool"?t.call.requestId:"streaming";function U(o,t){o&1&&(i(0,"div",3)(1,"p"),d(2,"No messages yet."),r()())}function Y(o,t){if(o&1&&(i(0,"div",14)(1,"span",15),d(2),r(),i(3,"p",16),d(4),r()()),o&2){let e=p().$implicit,n=p(2);w("case-chat__message--user",e.event.actor.role==="USER")("case-chat__message--agent",e.event.actor.role==="AGENT"),l(2),C(e.event.actor.displayName),l(2),C(n.extractText(e.event))}}function J(o,t){if(o&1&&(i(0,"div",12)(1,"span",15),d(2),r(),i(3,"p",16),d(4),r()()),o&2){let e=p().$implicit,n=p(2);l(2),C(n.agentDisplayName()),l(2),C(e.text)}}function Z(o,t){o&1&&d(0," \u23F3 ")}function W(o,t){o&1&&d(0," \u2705 ")}function X(o,t){o&1&&d(0," \u274C ")}function ee(o,t){if(o&1&&(i(0,"div",23)(1,"span",24),d(2,"Payload"),r(),i(3,"pre"),d(4),r()()),o&2){let e=p(3).$implicit;l(4),C(e.call.args)}}function te(o,t){o&1&&(i(0,"pre"),d(1),r()),o&2&&(l(),C(t))}function ne(o,t){o&1&&(i(0,"span",25),d(1,"Running\u2026"),r())}function oe(o,t){o&1&&(i(0,"span",26),d(1,"No output"),r())}function ae(o,t){if(o&1&&(i(0,"div",22),g(1,ee,5,1,"div",23),i(2,"div",23)(3,"span",24),d(4,"Output"),r(),g(5,te,2,1,"pre")(6,ne,2,0,"span",25)(7,oe,2,0,"span",26),r()()),o&2){let e,n=p(2).$implicit,a=p(2);l(),h(n.call.args?1:-1),l(4),h((e=a.extractToolOutput(n.call))?5:n.call.response?7:6,e)}}function ie(o,t){if(o&1){let e=M();i(0,"div",17)(1,"button",18),y("click",function(){E(e);let a=p().$implicit,m=p(2);return S(m.toggleToolCall(a.call.requestId))}),i(2,"span",19),g(3,Z,1,0)(4,W,1,0)(5,X,1,0),r(),i(6,"span",20),d(7),r(),i(8,"span",21),d(9),r()(),g(10,ae,8,2,"div",22),r()}if(o&2){let e=p().$implicit,n=p(2);w("case-chat__tool-call--pending",!e.call.response)("case-chat__tool-call--success",(e.call.response==null?null:e.call.response.success)===!0)("case-chat__tool-call--error",(e.call.response==null?null:e.call.response.success)===!1),l(),N("aria-expanded",n.isToolCallExpanded(e.call.requestId)),l(2),h(e.call.response?e.call.response.success?4:5:3),l(4),C(e.call.toolName),l(2),C(n.isToolCallExpanded(e.call.requestId)?"\u25BC":"\u25B6"),l(),h(n.isToolCallExpanded(e.call.requestId)?10:-1)}}function se(o,t){if(o&1&&g(0,Y,5,6,"div",11)(1,J,5,2,"div",12)(2,ie,11,11,"div",13),o&2){let e=t.$implicit;h(e.kind==="message"?0:e.kind==="streaming"?1:2)}}function re(o,t){if(o&1&&A(0,se,3,1,null,null,H),o&2){let e=p();F(e.timeline())}}function le(o,t){o&1&&(i(0,"div",4),D(1,"span",27)(2,"span",27)(3,"span",27),r())}function ce(o,t){if(o&1){let e=M();i(0,"ds-icon-button",28),y("action",function(){E(e);let a=p();return S(a.interrupt())}),r()}}function de(o,t){if(o&1){let e=M();i(0,"ds-icon-button",29),y("action",function(){E(e);let a=p();return S(a.submit())}),r()}if(o&2){let e=p();T("disabled",!e.canSend)}}var j=class o{route=b(L);http=b($);zone=b(I);config=b(K);caseId=this.route.snapshot.params.caseId;namespaceId=this.route.snapshot.params.namespaceId;agentDisplayName=k(()=>{let t=this.events();for(let e=t.length-1;e>=0;e--){let n=t[e];if(n){if(n.type==="AgentRunningEvent"||n.type==="AgentSelectedEvent"||n.type==="AgentFinishedEvent"){let a=n.agentName;if(a&&a.trim().length>0)return a}if(n.type==="MessageEvent"){let a=n;if(a.actor?.role==="AGENT"&&a.actor.displayName)return a.actor.displayName}}}return"Assistant"});eventSource=null;composerInput;events=v([]);inputValue=v("");isRunning=v(!1);isTerminal=v(!1);streamingText=v("");collapsedTools=v(new Set);constructor(){P(()=>{this.isRunning()||this.isTerminal()||queueMicrotask(()=>this.composerInput?.nativeElement.focus())})}timeline=k(()=>{let t=this.events(),e=this.streamingText(),n=new Map;for(let c of t)if(c.type==="ToolRequestEvent"){let _=c,s=_.toolRequestId??c.id,f=n.get(s);n.set(s,{requestId:s,toolName:_.toolName??"unknown",args:_.args??null,response:f?.response})}else if(c.type==="ToolResponseEvent"){let _=c,s=_.toolRequestId??c.id,f=n.get(s);n.set(s,{requestId:s,toolName:f?.toolName??_.toolName??"unknown",args:f?.args??null,response:_})}let a=[],m=new Set;for(let c of t)if(c.type==="MessageEvent")a.push({kind:"message",event:c});else if(c.type==="ToolRequestEvent"||c.type==="ToolResponseEvent"){let s=c.toolRequestId??c.id;m.has(s)||(m.add(s),a.push({kind:"tool",call:n.get(s)}))}return e.trim().length>0&&a.push({kind:"streaming",text:e}),a});get canSend(){return!!this.inputValue().trim()&&!this.isRunning()&&!this.isTerminal()}ngOnInit(){this.connectSse()}ngOnDestroy(){this.eventSource?.close()}connectSse(){let t=`${this.config.basePath}/api/cases/${this.caseId}/events`;console.log("[AgentOS SSE] connecting",{url:t,basePath:this.config.basePath,caseId:this.caseId,namespaceId:this.namespaceId,now:new Date().toISOString()}),this.eventSource=this.zone.runOutsideAngular(()=>new EventSource(t));let e=a=>{let m=performance.now(),c=a.type,_=a.data;console.log("[AgentOS SSE] frame received",{sseEventName:c,dataLength:_?.length??0,dataPreview:_?.slice(0,120),receivedAtMs:m});try{let s=JSON.parse(_);this.zone.run(()=>{let f=this.events().length;this.events.update(u=>u.some(x=>x.id===s.id)?u:[...u,s]);let B=this.events().length;if(console.log("[AgentOS SSE] event processed",{sseEventName:c,eventType:s.type,eventId:s.id,beforeLen:f,afterLen:B,running:this.isRunning(),terminal:this.isTerminal()}),s.type==="TextChunkEvent"){let u=s.chunk;u&&this.streamingText.update(x=>x+u);return}if(s.type==="CaseStatusEvent"){let u=s.status,x=u==="KILLED"||u==="ERROR";if(this.isTerminal.set(x),x)this.isRunning.set(!1),this.eventSource?.close(),this.eventSource=null;else{let O=u==="RUNNING";this.isRunning.set(O),O||this.streamingText.set("")}return}if(s.type==="AgentFinishedEvent"){this.isRunning.set(!1),this.streamingText.set("");return}})}catch(s){console.warn("[AgentOS SSE] failed to parse event data",{sseEventName:c,error:s,dataPreview:_?.slice(0,500)})}},n=["MessageEvent","CaseStatusEvent","AgentSelectedEvent","AgentRunningEvent","AgentFinishedEvent","ThinkingEvent","TextChunkEvent","ToolRequestEvent","ToolResponseEvent"];for(let a of n)console.log("[AgentOS SSE] addEventListener",a),this.eventSource.addEventListener(a,e);this.eventSource.onopen=()=>{console.log("[AgentOS SSE] connection open",{readyState:this.eventSource?.readyState,at:new Date().toISOString()})},this.eventSource.onmessage=a=>{console.log("[AgentOS SSE] onmessage (unnamed event) received",{dataLength:a.data?.length??0,dataPreview:a.data?.slice(0,120)})},this.eventSource.onerror=a=>{console.warn("[AgentOS SSE] connection error",{err:a,readyState:this.eventSource?.readyState,at:new Date().toISOString()}),this.zone.run(()=>{this.isRunning.set(!1)})}}onInput(t){this.inputValue.set(t.target.value)}onKeydown(t){t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.submit())}submit(){if(!this.canSend)return;let t=this.inputValue().trim();this.inputValue.set(""),this.isRunning.set(!0),this.streamingText.set(""),this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/messages`,{content:t,userId:"default-user"}).subscribe({error:e=>{console.error("[CaseChat] Failed to send message",e),this.isRunning.set(!1)}})}interrupt(){this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/interrupt`,{}).subscribe({error:t=>console.error("[CaseChat] Failed to interrupt case",t)})}kill(){this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/kill`,{}).subscribe({error:t=>console.error("[CaseChat] Failed to kill case",t)})}extractText(t){return t.content?.filter(e=>"content"in e).map(e=>e.content).join("")??""}extractToolOutput(t){if(!t.response)return null;let e=t.response.output;return e?e.content??null:null}toggleToolCall(t){this.collapsedTools.update(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})}isToolCallExpanded(t){return this.collapsedTools().has(t)}_namespaceId=this.namespaceId;static \u0275fac=function(e){return new(e||o)};static \u0275cmp=R({type:o,selectors:[["agentos-case-chat"]],viewQuery:function(e,n){if(e&1&&q(G,5),e&2){let a;V(a=z())&&(n.composerInput=a.first)}},decls:12,vars:6,consts:[["composerInput",""],[1,"case-chat"],[1,"case-chat__messages"],[1,"case-chat__empty"],[1,"case-chat__thinking"],[1,"case-chat__composer"],["placeholder","Reply\u2026","rows","3",1,"case-chat__input",3,"input","keydown","value","disabled"],[1,"case-chat__actions"],["icon","stop","variant","danger","title","Interrupt"],["icon","send","variant","primary","title","Send (Enter)",3,"disabled"],["icon","cancel","variant","danger","title","Kill",3,"action","disabled"],[1,"case-chat__message",3,"case-chat__message--user","case-chat__message--agent"],[1,"case-chat__message","case-chat__message--agent","case-chat__message--streaming"],[1,"case-chat__tool-call",3,"case-chat__tool-call--pending","case-chat__tool-call--success","case-chat__tool-call--error"],[1,"case-chat__message"],[1,"case-chat__message-author"],[1,"case-chat__message-text"],[1,"case-chat__tool-call"],["type","button",1,"case-chat__tool-call-header",3,"click"],[1,"case-chat__tool-call-icon"],[1,"case-chat__tool-call-name"],[1,"case-chat__tool-call-chevron"],[1,"case-chat__tool-call-output"],[1,"case-chat__tool-call-section"],[1,"case-chat__tool-call-label"],[1,"case-chat__tool-call-pending"],[1,"case-chat__tool-call-empty"],[1,"thinking-dot"],["icon","stop","variant","danger","title","Interrupt",3,"action"],["icon","send","variant","primary","title","Send (Enter)",3,"action","disabled"]],template:function(e,n){e&1&&(i(0,"div",1)(1,"div",2),g(2,U,3,0,"div",3)(3,re,2,0),g(4,le,4,0,"div",4),r(),i(5,"div",5)(6,"textarea",6,0),y("input",function(m){return n.onInput(m)})("keydown",function(m){return n.onKeydown(m)}),r(),i(8,"div",7),g(9,ce,1,0,"ds-icon-button",8)(10,de,1,1,"ds-icon-button",9),i(11,"ds-icon-button",10),y("action",function(){return n.kill()}),r()()()()),e&2&&(l(2),h(n.timeline().length===0?2:3),l(2),h(n.isRunning()?4:-1),l(2),T("value",n.inputValue())("disabled",n.isRunning()||n.isTerminal()),l(3),h(n.isRunning()?9:10),l(2),T("disabled",n.isTerminal()))},dependencies:[Q],styles:['.case-chat[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-width:800px;margin:0 auto;padding:1.5rem;gap:1rem}.case-chat__messages[_ngcontent-%COMP%]{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:.75rem;padding-bottom:.5rem}.case-chat__empty[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex:1}.case-chat__empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.case-chat__tool-calls[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;margin-top:.25rem}.case-chat__tool-call[_ngcontent-%COMP%]{border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--glass-bg, rgba(255, 255, 255, .72));font-size:.8rem;overflow:hidden;transition:border-color .2s ease}.case-chat__tool-call--pending[_ngcontent-%COMP%]{border-color:var(--color-warning, #f5a623);opacity:.8}.case-chat__tool-call--success[_ngcontent-%COMP%]{border-color:var(--color-success, #34c759)}.case-chat__tool-call--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.case-chat__tool-call-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.4rem;width:100%;padding:.4rem .6rem;background:transparent;border:none;cursor:pointer;text-align:left;color:var(--color-text, #1d1d1f);font-family:inherit;font-size:.8rem}.case-chat__tool-call-header[_ngcontent-%COMP%]:hover{background:#0000000a}.case-chat__tool-call-icon[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem}.case-chat__tool-call-name[_ngcontent-%COMP%]{font-weight:600;font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);color:var(--color-primary, #0071e3);flex-shrink:0}.case-chat__tool-call-args[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.case-chat__tool-call-chevron[_ngcontent-%COMP%]{flex-shrink:0;font-size:.6rem;color:var(--color-text-secondary, #6e6e73);margin-left:auto}.case-chat__tool-call-output[_ngcontent-%COMP%]{border-top:1px solid var(--color-border, rgba(0, 0, 0, .08));display:flex;flex-direction:column}.case-chat__tool-call-section[_ngcontent-%COMP%]{padding:.4rem .6rem .5rem}.case-chat__tool-call-section[_ngcontent-%COMP%] + .case-chat__tool-call-section[_ngcontent-%COMP%]{border-top:1px solid var(--color-border, rgba(0, 0, 0, .06))}.case-chat__tool-call-section[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:.25rem 0 0;white-space:pre-wrap;word-break:break-all;font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);font-size:.75rem;color:var(--color-text, #1d1d1f);max-height:200px;overflow-y:auto}.case-chat__tool-call-label[_ngcontent-%COMP%]{display:block;font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-secondary, #6e6e73)}.case-chat__tool-call-pending[_ngcontent-%COMP%], .case-chat__tool-call-empty[_ngcontent-%COMP%]{display:block;margin-top:.25rem;color:var(--color-text-secondary, #6e6e73);font-style:italic;font-size:.75rem}.case-chat__thinking[_ngcontent-%COMP%]{display:flex;gap:.3rem;padding:.75rem 1rem;align-self:flex-start}.case-chat__message--streaming[_ngcontent-%COMP%]{opacity:.95}.case-chat__composer[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:16px;padding:.5rem .5rem .5rem 1rem}.case-chat__input[_ngcontent-%COMP%]{flex:1;resize:none;padding:.5rem 0;border:none;background:transparent;color:var(--color-text, #1d1d1f);font-size:.95rem;font-family:inherit;line-height:1.5;outline:none;min-height:40px}.case-chat__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.case-chat__input[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.case-chat__actions[_ngcontent-%COMP%]{display:flex;align-items:center;flex-shrink:0}.thinking-dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background:var(--color-text-secondary, #6e6e73);animation:_ngcontent-%COMP%_thinking-bounce 1.2s ease-in-out infinite}.thinking-dot[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.thinking-dot[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_thinking-bounce{0%,80%,to{transform:translateY(0);opacity:.4}40%{transform:translateY(-6px);opacity:1}}']})};export{j as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as Q}from"./chunk-4VDSG7R6.js";import"./chunk-S2O6N5YR.js";import{D as H,c as B,e as u,g as L,h as j,i as G,l as C,n as J,s as A,u as $,v as q,w as K,x as U}from"./chunk-U3HXU6IS.js";import{e as R,f as z}from"./chunk-K4ZGQGPW.js";import{a as M,b as I}from"./chunk-SQBLNCXA.js";import{$a as h,Ab as V,Ea as P,Qb as D,Ra as T,Sa as b,T as c,Ta as y,Wa as w,X as f,Xa as E,Y as _,Ya as s,Za as i,_a as o,a as S,b as O,ba as k,ga as d,gb as v,ib as p,kb as g,rc as F,tc as N,ua as l,yb as r,zb as x}from"./chunk-QU3UZZE4.js";function Y(a,t){a&1&&(i(0,"p",5),r(1,"Loading\u2026"),o())}function Z(a,t){if(a&1&&(i(0,"option",13),r(1),o()),a&2){let e=t.$implicit;s("value",e.type),l(),x(e.displayName)}}function ee(a,t){if(a&1){let e=v();i(0,"div",18)(1,"ds-json-schema-form",22),p("valueChange",function(m){f(e);let X=g(2);return _(X.onParamsChange(m))}),o()()}if(a&2){let e=g(2);l(),s("schema",t)("value",e.initialParams())}}function te(a,t){if(a&1){let e=v();i(0,"form",7),p("ngSubmit",function(){f(e);let m=g();return _(m.submit())}),i(1,"div",8)(2,"label",9),r(3,"Type "),i(4,"span",10),r(5,"*"),o()(),i(6,"select",11)(7,"option",12),r(8,"Select type"),o(),w(9,Z,2,2,"option",13,T().trackByType,!0),o()(),i(11,"div",8)(12,"label",14),r(13,"Name "),i(14,"span",10),r(15,"*"),o()(),h(16,"input",15),o(),i(17,"div",8)(18,"label",16),r(19,"Description"),o(),h(20,"textarea",17),o(),b(21,ee,2,2,"div",18),i(22,"div",19)(23,"button",20),r(24),o(),i(25,"button",21),p("click",function(){f(e);let m=g();return _(m.cancel())}),r(26,"Cancel"),o()()()}if(a&2){let e,n=g();s("formGroup",n.form),l(6),s("formControl",n.typeControl),l(3),E(n.integrationTypes()),l(7),s("formControl",n.nameControl),l(4),s("formControl",n.descriptionControl),l(),y((e=n.schema())?21:-1,e),l(2),s("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),l(),V(" ",n.isEditMode()?"Save changes":"Create"," ")}}var W=class a{route=c(F);router=c(N);destroyRef=c(k);integrationConfigController=c(R);integrationTypeController=c(z);namespaceId=this.route.snapshot.params.namespaceId;form=new G({name:new C("",{nonNullable:!0,validators:[u.required,u.minLength(1)]}),description:new C(null),type:new C("",{nonNullable:!0,validators:[u.required]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}isEditMode=d(!1);isSubmitting=d(!1);isLoading=d(!1);paramsValue=d(null);initialParams=d(null);integrationTypes=I(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=I(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=D(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});existingConfig=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("integrationId");t&&(this.isEditMode.set(!0),this.loadConfig(t))}loadConfig(t){this.isLoading.set(!0),this.integrationConfigController.getByIdIntegrationConfig(t).pipe(M(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.typeControl.setValue(e.integrationType),this.initialParams.set(e.parameters),this.paramsValue.set(e.parameters),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}onParamsChange(t){this.paramsValue.set(t)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;this.isSubmitting.set(!0),(this.isEditMode()?this.integrationConfigController.updateIntegrationConfig(this.existingConfig.id??"",O(S({},this.existingConfig),{name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,integrationType:this.typeControl.value,parameters:this.paramsValue()})):this.integrationConfigController.createIntegrationConfig({name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,integrationType:this.typeControl.value,namespaceId:this.namespaceId,parameters:this.paramsValue()})).pipe(M(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(t,e){return e.type}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=P({type:a,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],[3,"valueChange","schema","value"]],template:function(e,n){e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),p("click",function(){return n.cancel()}),i(3,"span",3),r(4,"\u2190"),o(),r(5," Integrations "),o(),i(6,"h1",4),r(7),o()(),b(8,Y,2,0,"p",5)(9,te,27,7,"form",6),o()),e&2&&(l(7),x(n.isEditMode()?"Edit integration":"New integration"),l(),y(n.isLoading()?8:9))},dependencies:[H,J,K,U,B,q,L,j,A,$,Q],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:10px;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));background:var(--glass-bg, rgba(255, 255, 255, .5));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{W as IntegrationFormComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as K,_ as j,u as L}from"./chunk-4VDSG7R6.js";import"./chunk-S2O6N5YR.js";import"./chunk-U3HXU6IS.js";import{b as z,c as F}from"./chunk-K4ZGQGPW.js";import{a as x}from"./chunk-SQBLNCXA.js";import{Ab as T,Ea as g,Hb as E,J as k,Ka as S,Kb as O,Lb as V,Ob as q,Sa as b,T as d,Ta as C,X as c,Y as p,Ya as u,Za as a,_a as r,ba as D,ca as P,ec as B,ga as N,gb as f,h as I,ib as s,kb as l,p as w,q as A,rc as $,tc as y,ua as _,ub as R,yb as m,zb as h}from"./chunk-QU3UZZE4.js";function H(o,i){if(o&1){let e=f();a(0,"span",7),m(1,"Delete?"),r(),a(2,"ds-icon-button",8),s("action",function(){c(e);let t=l();return p(t.onDeleteConfirmed())}),r(),a(3,"ds-icon-button",9),s("action",function(){c(e);let t=l();return p(t.onDeleteCancelled())}),r()}}function J(o,i){if(o&1){let e=f();a(0,"ds-kebab-menu",10),s("itemSelected",function(t){c(e);let M=l();return p(M.onMenuAction(t))}),r()}if(o&2){let e=l();u("items",e.menuItems)}}var v=class o{router=d(y);model;namespaceId;deleteRequested=new P;pendingDelete=N(!1);menuItems=[{key:"edit",label:"Edit model",icon:"edit"},{key:"delete",label:"Delete model",icon:"delete",variant:"danger"}];get displayTitle(){return this.model.alias??this.model.apiModelName}onMenuAction(i){switch(i){case"edit":this.router.navigate(["/agentos",this.namespaceId,"ai-models",this.model.id,"edit"]);break;case"delete":this.pendingDelete.set(!0);break}}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.model)}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=g({type:o,selectors:[["agentos-ai-model-item"]],inputs:{model:"model",namespaceId:"namespaceId"},outputs:{deleteRequested:"deleteRequested"},decls:12,vars:4,consts:[["role","listitem",1,"ai-model-item"],[1,"ai-model-item__body"],[1,"ai-model-item__name"],[1,"ai-model-item__api-name"],[1,"ai-model-item__params"],[1,"ai-model-item__actions"],[3,"items"],[1,"ai-model-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"div",1)(2,"span",2),m(3),r(),a(4,"span",3),m(5),r(),a(6,"span",4)(7,"span"),m(8),r()()(),a(9,"div",5),b(10,H,4,0)(11,J,1,1,"ds-kebab-menu",6),r()()),e&2&&(_(3),h(n.displayTitle),_(2),h(n.model.apiModelName),_(3),T("priority: ",n.model.priority),_(2),C(n.pendingDelete()?10:11))},dependencies:[j,L],styles:[".ai-model-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.ai-model-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-model-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__api-name[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary, #6e6e73);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__params[_ngcontent-%COMP%]{display:flex;gap:.75rem;font-size:.75rem;color:var(--color-text-secondary, #6e6e73)}.ai-model-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover .ai-model-item__actions[_ngcontent-%COMP%], .ai-model-item[_ngcontent-%COMP%]:focus-within .ai-model-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-model-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error, #ff3b30);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};var Q=()=>[];function X(o,i){if(o&1){let e=f();a(0,"agentos-ai-model-item",4),s("deleteRequested",function(t){c(e);let M=l(2);return p(M.deleteModel(t))}),r()}if(o&2){let e=l(2);u("model",i)("namespaceId",e.namespaceId)}}function Y(o,i){if(o&1&&b(0,X,1,2,"agentos-ai-model-item",3),o&2){let e,n=i.$implicit,t=l();C((e=t.resolveModel(n.id))?0:-1,e)}}var U=class o{route=d($);router=d(y);destroyRef=d(D);aiModelController=d(z);aiProviderController=d(F);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new I(void 0);data$=this.refresh$.pipe(k(()=>A([this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),this.aiProviderController.listByParentAiProvider(this.namespaceId)])));modelItems$=this.data$.pipe(w(([i,e])=>{let n=new Map(e.map(t=>[t.id??"",t.name]));return i.map(t=>({id:t.id??"",name:t.alias??t.apiModelName,description:t.apiModelName,groupKey:t.aiProviderId,groupLabel:n.get(t.aiProviderId)??t.aiProviderId}))}));modelsById=new Map;constructor(){this.data$.pipe(x(this.destroyRef)).subscribe(([i])=>{this.modelsById=new Map(i.map(e=>[e.id??"",e]))})}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"])}deleteModel(i){this.aiModelController.deleteAiModel(i.id??"").pipe(x(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveModel(i){return this.modelsById.get(i)??null}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=g({type:o,selectors:[["agentos-namespace-ai-models"]],decls:6,vars:6,consts:[["aiModelItemTpl",""],["title","AI models","emptyMessage","No AI models configured yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"namespace-ai-models__back",3,"click"],[3,"model","namespaceId"],[3,"deleteRequested","model","namespaceId"]],template:function(e,n){if(e&1&&(a(0,"ds-entity-list",1),O(1,"async"),s("createRequested",function(){return n.openCreateForm()}),a(2,"button",2),s("click",function(){return n.goBack()}),m(3,"\u2190 Namespaces"),r()(),S(4,Y,1,1,"ng-template",null,0,q)),e&2){let t=R(5);u("items",V(1,3,n.modelItems$)??E(5,Q))("showCreate",!0)("itemTemplate",t)}},dependencies:[K,v,B],styles:[".namespace-ai-models__back[_ngcontent-%COMP%]{background:none;border:none;padding:.25rem 0;cursor:pointer;font-size:.85rem;color:var(--color-primary, #007aff);font-family:inherit;white-space:nowrap;flex-shrink:0}.namespace-ai-models__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};export{U as NamespaceAiModelsComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as O,_ as A}from"./chunk-4VDSG7R6.js";import{g as D}from"./chunk-K4ZGQGPW.js";import{a as N}from"./chunk-SQBLNCXA.js";import{Ea as f,Hb as T,J as w,Ka as M,Kb as P,Lb as S,Ob as L,Sa as v,T as g,Ta as C,X as c,Y as p,Ya as u,Za as r,_a as m,ba as q,ca as d,ec as E,gb as I,h as x,ib as l,kb as o,p as R,tc as V,ua as _,ub as k,yb as b,zb as h}from"./chunk-QU3UZZE4.js";function K(s,e){if(s&1&&(r(0,"span",3),b(1),m()),s&2){let t=o();_(),h(t.namespace.description)}}var y=class s{namespace;selected=new d;editRequested=new d;integrationsRequested=new d;aiProvidersRequested=new d;aiModelsRequested=new d;deleteRequested=new d;menuItems=[{key:"edit",label:"Edit namespace",icon:"edit"},{key:"integrations",label:"Manage integrations",icon:"settings"},{key:"ai-providers",label:"AI Providers",icon:"smart_toy"},{key:"ai-models",label:"AI models",icon:"model_training"},{key:"delete",label:"Delete namespace",icon:"delete",variant:"danger"}];onSelect(){this.selected.emit(this.namespace)}onMenuAction(e){switch(e){case"edit":this.editRequested.emit(this.namespace);break;case"integrations":this.integrationsRequested.emit(this.namespace);break;case"ai-providers":this.aiProvidersRequested.emit(this.namespace);break;case"ai-models":this.aiModelsRequested.emit(this.namespace);break;case"delete":confirm(`Delete namespace "${this.namespace.name}"?`)&&this.deleteRequested.emit(this.namespace);break}}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=f({type:s,selectors:[["agentos-namespace-item"]],inputs:{namespace:"namespace"},outputs:{selected:"selected",editRequested:"editRequested",integrationsRequested:"integrationsRequested",aiProvidersRequested:"aiProvidersRequested",aiModelsRequested:"aiModelsRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem",1,"namespace-item"],["type","button",1,"namespace-item__body",3,"click"],[1,"namespace-item__name"],[1,"namespace-item__desc"],[1,"namespace-item__actions"],[3,"itemSelected","items"]],template:function(t,a){t&1&&(r(0,"div",0)(1,"button",1),l("click",function(){return a.onSelect()}),r(2,"span",2),b(3),m(),v(4,K,2,1,"span",3),m(),r(5,"div",4)(6,"ds-kebab-menu",5),l("itemSelected",function(i){return a.onMenuAction(i)}),m()()()),t&2&&(_(3),h(a.namespace.name),_(),C(a.namespace.description?4:-1),_(2),u("items",a.menuItems))},dependencies:[A],styles:[".namespace-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.875rem 1.25rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.namespace-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.namespace-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;background:none;border:none;padding:0;cursor:pointer;text-align:left;min-width:0}.namespace-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__desc[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.namespace-item[_ngcontent-%COMP%]:hover .namespace-item__actions[_ngcontent-%COMP%], .namespace-item[_ngcontent-%COMP%]:focus-within .namespace-item__actions[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})};var j=()=>[];function z(s,e){if(s&1){let t=I();r(0,"agentos-namespace-item",3),l("selected",function(n){c(t);let i=o(2);return p(i.navigateToCases(n.id??""))})("editRequested",function(n){c(t);let i=o(2);return p(i.navigateToEdit(n))})("deleteRequested",function(n){c(t);let i=o(2);return p(i.deleteNamespace(n))})("integrationsRequested",function(n){c(t);let i=o(2);return p(i.openIntegrations(n))})("aiProvidersRequested",function(n){c(t);let i=o(2);return p(i.openAiProviders(n))})("aiModelsRequested",function(n){c(t);let i=o(2);return p(i.openAiModels(n))}),m()}s&2&&u("namespace",e)}function U(s,e){if(s&1&&v(0,z,1,1,"agentos-namespace-item",2),s&2){let t,a=e.$implicit,n=o();C((t=n.resolveNamespace(a.id))?0:-1,t)}}var $=class s{router=g(V);namespaceController=g(D);destroyRef=g(q);refresh$=new x(void 0);namespaces$=this.refresh$.pipe(w(()=>this.namespaceController.listAllNamespace()));namespaceItems$=this.namespaces$.pipe(R(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.description}))));namespacesById=new Map;constructor(){this.namespaces$.pipe(N(this.destroyRef)).subscribe(e=>{this.namespacesById=new Map(e.map(t=>[t.id??"",t]))})}navigateToCases(e){this.router.navigate(["/agentos",e,"cases"])}navigateToCreate(){this.router.navigate(["/agentos/namespaces/new"])}navigateToEdit(e){this.router.navigate(["/agentos/namespaces",e.id??"","edit"])}openIntegrations(e){this.router.navigate(["/agentos",e.id,"integrations"])}openAiProviders(e){this.router.navigate(["/agentos",e.id,"ai-providers"])}openAiModels(e){this.router.navigate(["/agentos",e.id,"ai-models"])}deleteNamespace(e){this.namespaceController.deleteNamespace(e.id??"").pipe(N(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveNamespace(e){return this.namespacesById.get(e)??null}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=f({type:s,selectors:[["agentos-namespace-list"]],decls:4,vars:6,consts:[["namespaceItemTpl",""],["title","Namespaces","emptyMessage","No namespaces yet. Create one to get started.","cardMinWidth","400px",3,"itemSelected","createRequested","items","showCreate","itemTemplate"],[3,"namespace"],[3,"selected","editRequested","deleteRequested","integrationsRequested","aiProvidersRequested","aiModelsRequested","namespace"]],template:function(t,a){if(t&1&&(r(0,"ds-entity-list",1),P(1,"async"),l("itemSelected",function(i){return a.navigateToCases(i)})("createRequested",function(){return a.navigateToCreate()}),m(),M(2,U,1,1,"ng-template",null,0,L)),t&2){let n=k(3);u("items",S(1,3,a.namespaceItems$)??T(5,j))("showCreate",!0)("itemTemplate",n)}},dependencies:[y,O,E],encapsulation:2})};export{y as a,$ as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as D,b as ct,c as lt,
|
|
1
|
+
import{a as D,b as ct,c as lt,d as E,e as dt,l as mt,o as ht,q as ut,t as ft}from"./chunk-4VDSG7R6.js";import{E as it,G as M,N as st,P as ot,R as rt,e as tt,m as et,q as nt,s as at}from"./chunk-S2O6N5YR.js";import{$ as u,$a as G,Ab as w,Ea as y,Fa as H,Ga as b,Ja as Z,K as O,Ka as Q,P,Q as j,Qa as U,R as v,Sa as W,T as o,Ta as X,X as F,Xb as Y,Y as N,Za as k,_a as _,a as d,aa as L,da as z,g as c,gb as K,ib as A,ka as V,kb as x,l as I,ob as $,pb as B,qb as S,ua as f,wa as g,wb as J,xa as q,yb as C}from"./chunk-QU3UZZE4.js";function vt(a,l){if(a&1){let t=K();k(0,"div",1)(1,"button",2),A("click",function(){F(t);let n=x();return N(n.action())}),C(2),_()()}if(a&2){let t=x();f(2),w(" ",t.data.action," ")}}var gt=["label"];function yt(a,l){}var At=Math.pow(2,31)-1,p=class{_overlayRef;instance;containerInstance;_afterDismissed=new c;_afterOpened=new c;_onAction=new c;_durationTimeoutId;_dismissedByAction=!1;constructor(l,t){this._overlayRef=t,this.containerInstance=l,l._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(l){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(l,At))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},_t=new v("MatSnackBarData"),m=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},xt=(()=>{class a{static \u0275fac=function(e){return new(e||a)};static \u0275dir=b({type:a,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return a})(),Bt=(()=>{class a{static \u0275fac=function(e){return new(e||a)};static \u0275dir=b({type:a,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return a})(),St=(()=>{class a{static \u0275fac=function(e){return new(e||a)};static \u0275dir=b({type:a,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return a})(),pt=(()=>{class a{snackBarRef=o(p);data=o(_t);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(e,n){e&1&&(k(0,"div",0),C(1),_(),W(2,vt,3,1,"div",1)),e&2&&(f(),w(" ",n.data.message,`
|
|
2
2
|
`),f(),X(n.hasAction?2:-1))},dependencies:[ot,xt,Bt,St],styles:[`.mat-mdc-simple-snack-bar{display:flex}.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-label{max-height:50vh;overflow:auto}
|
|
3
3
|
`],encapsulation:2,changeDetection:0})}return a})(),R="_mat-snack-bar-enter",T="_mat-snack-bar-exit",Ct=(()=>{class a extends lt{_ngZone=o(z);_elementRef=o(V);_changeDetectorRef=o(Y);_platform=o(tt);_animationsDisabled=M();snackBarConfig=o(m);_document=o(L);_trackedModals=new Set;_enterFallback;_exitFallback;_injector=o(u);_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new c;_onExit=new c;_onEnter=new c;_animationState="void";_live;_label;_role;_liveElementId=o(at).getId("mat-snack-bar-container-live-");constructor(){super();let t=this.snackBarConfig;t.politeness==="assertive"&&!t.announcementMessage?this._live="assertive":t.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(t){this._assertNotAttached();let e=this._portalOutlet.attachComponentPortal(t);return this._afterPortalAttached(),e}attachTemplatePortal(t){this._assertNotAttached();let e=this._portalOutlet.attachTemplatePortal(t);return this._afterPortalAttached(),e}attachDomPortal=t=>{this._assertNotAttached();let e=this._portalOutlet.attachDomPortal(t);return this._afterPortalAttached(),e};onAnimationEnd(t){t===T?this._completeExit():t===R&&(clearTimeout(this._enterFallback),this._ngZone.run(()=>{this._onEnter.next(),this._onEnter.complete()}))}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce(),this._animationsDisabled?g(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(R)))},{injector:this._injector}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(R)},200)))}exit(){return this._destroyed?I(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?g(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(T)))},{injector:this._injector}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(T),200))}),this._onExit)}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){clearTimeout(this._exitFallback),queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let t=this._elementRef.nativeElement,e=this.snackBarConfig.panelClass;e&&(Array.isArray(e)?e.forEach(s=>t.classList.add(s)):t.classList.add(e)),this._exposeToModals();let n=this._label.nativeElement,i="mdc-snackbar__label";n.classList.toggle(i,!n.querySelector(`.${i}`))}_exposeToModals(){let t=this._liveElementId,e=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let n=0;n<e.length;n++){let i=e[n],s=i.getAttribute("aria-owns");this._trackedModals.add(i),s?s.indexOf(t)===-1&&i.setAttribute("aria-owns",s+" "+t):i.setAttribute("aria-owns",t)}}_clearFromModals(){this._trackedModals.forEach(t=>{let e=t.getAttribute("aria-owns");if(e){let n=e.replace(this._liveElementId,"").trim();n.length>0?t.setAttribute("aria-owns",n):t.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{if(this._destroyed)return;let t=this._elementRef.nativeElement,e=t.querySelector("[aria-hidden]"),n=t.querySelector("[aria-live]");if(e&&n){let i=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&e.contains(document.activeElement)&&(i=document.activeElement),e.removeAttribute("aria-hidden"),n.appendChild(e),i?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=y({type:a,selectors:[["mat-snack-bar-container"]],viewQuery:function(e,n){if(e&1&&$(E,7)(gt,7),e&2){let i;B(i=S())&&(n._portalOutlet=i.first),B(i=S())&&(n._label=i.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(e,n){e&1&&A("animationend",function(s){return n.onAnimationEnd(s.animationName)})("animationcancel",function(s){return n.onAnimationEnd(s.animationName)}),e&2&&J("mat-snack-bar-container-enter",n._animationState==="visible")("mat-snack-bar-container-exit",n._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!n._animationsDisabled)},features:[Z],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(e,n){e&1&&(k(0,"div",1)(1,"div",2,0)(3,"div",3),Q(4,yt,0,0,"ng-template",4),_(),G(5,"div"),_()()),e&2&&(f(5),U("aria-live",n._live)("role",n._role)("id",n._liveElementId))},dependencies:[E],styles:[`@keyframes _mat-snack-bar-enter{from{transform:scale(0.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _mat-snack-bar-exit{from{opacity:1}to{opacity:0}}.mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-snack-bar-container-animations-enabled{opacity:0}.mat-snack-bar-container-animations-enabled.mat-snack-bar-fallback-visible{opacity:1}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-enter{animation:_mat-snack-bar-enter 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-exit{animation:_mat-snack-bar-exit 75ms cubic-bezier(0.4, 0, 1, 1) forwards}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mat-snack-bar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-snack-bar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-snack-bar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mat-snack-bar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mat-snack-bar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mat-snack-bar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mat-snack-bar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-button-text-state-layer-color: currentColor;--mat-button-text-ripple-color: currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}
|
|
4
4
|
`],encapsulation:2})}return a})(),wt=new v("mat-snack-bar-default-options",{providedIn:"root",factory:()=>new m}),Mt=(()=>{class a{_live=o(nt);_injector=o(u);_breakpointObserver=o(et);_parentSnackBar=o(a,{optional:!0,skipSelf:!0});_defaultConfig=o(wt);_animationsDisabled=M();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=pt;snackBarContainerComponent=Ct;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let t=this._parentSnackBar;return t?t._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(t){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=t:this._snackBarRefAtThisLevel=t}constructor(){}openFromComponent(t,e){return this._attach(t,e)}openFromTemplate(t,e){return this._attach(t,e)}open(t,e="",n){let i=d(d({},this._defaultConfig),n);return i.data={message:t,action:e},i.announcementMessage===t&&(i.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,i)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(t,e){let n=e&&e.viewContainerRef&&e.viewContainerRef.injector,i=u.create({parent:n||this._injector,providers:[{provide:m,useValue:e}]}),s=new D(this.snackBarContainerComponent,e.viewContainerRef,i),r=t.attach(s);return r.instance.snackBarConfig=e,r.instance}_attach(t,e){let n=d(d(d({},new m),this._defaultConfig),e),i=this._createOverlay(n),s=this._attachSnackBarContainer(i,n),r=new p(s,i);if(t instanceof q){let h=new ct(t,null,{$implicit:n.data,snackBarRef:r});r.instance=s.attachTemplatePortal(h)}else{let h=this._createInjector(n,r),bt=new D(t,void 0,h),kt=s.attachComponentPortal(bt);r.instance=kt.instance}return this._breakpointObserver.observe(it.HandsetPortrait).pipe(O(i.detachments())).subscribe(h=>{i.overlayElement.classList.toggle(this.handsetCssClass,h.matches)}),n.announcementMessage&&s._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(r,n),this._openedSnackBarRef=r,this._openedSnackBarRef}_animateSnackBar(t,e){t.afterDismissed().subscribe(()=>{this._openedSnackBarRef==t&&(this._openedSnackBarRef=null),e.announcementMessage&&this._live.clear()}),e.duration&&e.duration>0&&t.afterOpened().subscribe(()=>t._dismissAfter(e.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{t.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):t.containerInstance.enter()}_createOverlay(t){let e=new mt;e.direction=t.direction;let n=ht(this._injector),i=t.direction==="rtl",s=t.horizontalPosition==="left"||t.horizontalPosition==="start"&&!i||t.horizontalPosition==="end"&&i,r=!s&&t.horizontalPosition!=="center";return s?n.left("0"):r?n.right("0"):n.centerHorizontally(),t.verticalPosition==="top"?n.top("0"):n.bottom("0"),e.positionStrategy=n,e.disableAnimations=this._animationsDisabled,ut(this._injector,e)}_createInjector(t,e){let n=t&&t.viewContainerRef&&t.viewContainerRef.injector;return u.create({parent:n||this._injector,providers:[{provide:p,useValue:e},{provide:_t,useValue:t.data}]})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=P({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var Xt=(()=>{class a{static \u0275fac=function(e){return new(e||a)};static \u0275mod=H({type:a});static \u0275inj=j({providers:[Mt],imports:[ft,dt,rt,pt,st]})}return a})();export{Mt as a,Xt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as I}from"./chunk-
|
|
1
|
+
import{a as I}from"./chunk-SOIUR4KR.js";import{h as w}from"./chunk-K4ZGQGPW.js";import{a as D}from"./chunk-SQBLNCXA.js";import{$a as c,Ea as l,Sa as d,T as a,Ta as m,Ya as y,Za as o,_a as i,ab as C,ba as b,bb as v,cb as p,ga as h,ib as x,kb as P,sc as M,tc as S,ua as s,wb as k,yb as u,zb as O}from"./chunk-QU3UZZE4.js";function U(e,n){e&1&&p(0,"span",1)}function H(e,n){e&1&&p(0,"span",2)}function N(e,n){e&1&&p(0,"span",3)}var g=class e{pluginService=a(w);online=h(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=l({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(t,r){if(t&1&&(C(0,"div",0),d(1,U,1,0,"span",1)(2,H,1,0,"span",2)(3,N,1,0,"span",3),v()),t&2){let _;s(),m((_=r.online())===!0?1:_===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};function j(e,n){if(e&1&&(o(0,"span",6),u(1),i()),e&2){let t=P();s(),O(t.userInitials)}}function R(e,n){e&1&&(o(0,"span",7),u(1,"\u25EF"),i())}var f=class e{router=a(S);userState=a(I);destroyRef=a(b);currentUser=this.userState.currentUser;ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(D(this.destroyRef)).subscribe()}get userInitials(){let n=this.currentUser();if(!n)return"";let t=n.firstname?.[0]??"",r=n.lastname?.[0]??"";return(t+r).toUpperCase()||n.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=l({type:e,selectors:[["agentos-header"]],decls:10,vars:4,consts:[[1,"header"],[1,"header__brand"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"]],template:function(t,r){t&1&&(o(0,"header",0)(1,"div",1),c(2,"img",2),o(3,"span",3),u(4,"Coday"),i()(),o(5,"nav",4),c(6,"agentos-backend-status"),o(7,"button",5),x("click",function(){return r.toggleProfile()}),d(8,j,2,1,"span",6)(9,R,2,0,"span",7),i()()()),t&2&&(s(7),k("header__user-btn--active",r.isOnProfilePage),y("title",r.isOnProfilePage?"Back":"My profile"),s(),m(r.userInitials?8:9))},dependencies:[g],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__logo-img[_ngcontent-%COMP%]{width:24px;height:24px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;letter-spacing:-.02em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};var B=class e{static \u0275fac=function(t){return new(t||e)};static \u0275cmp=l({type:e,selectors:[["agentos-layout"]],decls:4,vars:0,consts:[[1,"layout"],[1,"layout__content"]],template:function(t,r){t&1&&(o(0,"div",0),c(1,"agentos-header"),o(2,"main",1),c(3,"router-outlet"),i()())},dependencies:[M,f],styles:[".layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100vh}.layout__content[_ngcontent-%COMP%]{flex:1;overflow-y:auto}"]})};export{g as a,f as b,B as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-QCHIMPFZ.js";import"./chunk-QU3UZZE4.js";export{a as AgentosShellComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ke}from"./chunk-BIJXZ7JD.js";import{b as te}from"./chunk-HNL4PUVG.js";import{b as We}from"./chunk-7TOE3DRW.js";import{a as ne,b as ie,d as oe,e as re,f as ae,g as le,h as se}from"./chunk-UAD6TAO5.js";import{K as be,M as xe,N as ve,Q as Ae,R as we,S as Se,T as Ee,U as Pe,V as De,W as Oe,X as Ie,Y as Fe,Z as Te,x as ye}from"./chunk-4VDSG7R6.js";import{L as O,P as ee,R as I,S as T,T as k}from"./chunk-S2O6N5YR.js";import{b as F}from"./chunk-75YBV3AO.js";import{A as Ce,C as Me,c as de,g as me,m as ce,o as ge,p as pe,w as ue,x as _e,y as fe,z as he}from"./chunk-U3HXU6IS.js";import"./chunk-SQBLNCXA.js";import{$a as q,Ab as B,Bb as Z,Cb as u,Db as _,Ea as E,Eb as f,Hb as K,Ib as J,Ka as W,Ob as Q,P as N,Qa as U,Qb as X,Sa as M,T as h,Ta as y,Ua as L,Va as z,Wa as P,X as g,Xa as D,Y as p,Ya as C,Za as i,_a as o,db as H,eb as G,f as j,ga as S,gb as b,ib as c,kb as m,oc as Y,tc as $,ua as d,ub as R,wb as A,yb as l,zb as x}from"./chunk-QU3UZZE4.js";var v=class s{http=h(Y);projectState=h(F);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${encodeURIComponent(t)}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new j(n=>{let r=new FileReader;r.onload=()=>{let a=r.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:a,mimeType:e.type},{params:{location:t}}).subscribe(n)},r.onerror=()=>n.error(r.error),r.readAsDataURL(e)})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=N({token:s,factory:s.\u0275fac,providedIn:"root"})};function Ne(s,t){s&1&&(i(0,"p",15),l(1,"No integrations defined \u2014 agent will have access to all tools."),o())}function Ue(s,t){if(s&1){let e=b();i(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),l(3,"Integration"),o(),i(4,"input",23),f("ngModelChange",function(r){let a=g(e).$implicit;return _(a.integration,r)||(a.integration=r),p(r)}),o()(),i(5,"mat-form-field",24)(6,"mat-label"),l(7,"Tools (comma-separated)"),o(),i(8,"input",25),f("ngModelChange",function(r){let a=g(e).$implicit;return _(a.tools,r)||(a.tools=r),p(r)}),o()(),i(9,"button",26),c("click",function(){let r=g(e).$index,a=m();return p(a.removeIntegrationRow(r))}),i(10,"mat-icon"),l(11,"delete"),o()()()}if(s&2){let e=t.$implicit;d(4),u("ngModel",e.integration),d(4),u("ngModel",e.tools)}}function ze(s,t){if(s&1&&(i(0,"p",30),l(1),o()),s&2){let e=m(2);d(),x(e.docUploadError)}}function qe(s,t){s&1&&(i(0,"p",15),l(1,"No mandatory documents defined."),o())}function He(s,t){if(s&1&&q(0,"option",35),s&2){let e=t.$implicit;C("value","documents/"+e)}}function Ge(s,t){if(s&1){let e=b();i(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),l(3,"Document path"),o(),i(4,"input",33),f("ngModelChange",function(r){let a=g(e).$index,V=m(2);return _(V.mandatoryDocs[a],r)||(V.mandatoryDocs[a]=r),p(r)}),o(),i(5,"datalist",34),P(6,He,1,1,"option",35,z),o()(),i(8,"button",26),c("click",function(){let r=g(e).$index,a=m(2);return p(a.removeDocRow(r))}),i(9,"mat-icon"),l(10,"delete"),o()()()}if(s&2){let e=t.$index,n=m(2);d(4),u("ngModel",n.mandatoryDocs[e]),U("list","docs-list-"+e),d(),C("id","docs-list-"+e),d(),D(n.availableDocuments)}}function Ze(s,t){if(s&1){let e=b();i(0,"div",6)(1,"span"),l(2,"Mandatory Documents"),o(),i(3,"button",27),c("click",function(){g(e);let r=m();return p(r.addDocRow())}),i(4,"mat-icon"),l(5,"add"),o()(),i(6,"label",28)(7,"mat-icon"),l(8,"upload_file"),o(),i(9,"input",29),c("change",function(r){g(e);let a=m();return p(a.onDocFileSelected(r))}),o()()(),M(10,ze,2,1,"p",30),M(11,qe,2,0,"p",15),P(12,Ge,11,3,"div",31,L)}if(s&2){let e=m();d(6),A("uploading",e.isUploadingDoc),d(3),C("disabled",e.isUploadingDoc),d(),y(e.docUploadError?10:-1),d(),y(e.mandatoryDocs.length===0?11:-1),d(),D(e.mandatoryDocs)}}function Ke(s,t){s&1&&(i(0,"p",15),l(1,"\u{1F4A1} Documents can be added after the agent is created."),o())}function Je(s,t){if(s&1){let e=b();i(0,"div",6),l(1,"Save to"),o(),i(2,"div",36)(3,"label",37)(4,"input",38),f("ngModelChange",function(r){g(e);let a=m();return _(a.location,r)||(a.location=r),p(r)}),o(),i(5,"div",39)(6,"div",40)(7,"span",41),l(8,"\u{1F464}"),o(),i(9,"span",42),l(10,"Project config"),o()(),i(11,"p",43),l(12),o()()(),i(13,"label",37)(14,"input",44),f("ngModelChange",function(r){g(e);let a=m();return _(a.location,r)||(a.location=r),p(r)}),o(),i(15,"div",39)(16,"div",40)(17,"span",41),l(18,"\u{1F4E6}"),o(),i(19,"span",42),l(20,"Colocated"),o()(),i(21,"p",43),l(22,"Next to coday.yaml in ./agents/ (committable)"),o()()()(),i(23,"p",15),l(24,"Storage location is permanent and cannot be changed after creation."),o()}if(s&2){let e=m();d(3),A("selected",e.location==="project"),d(),u("ngModel",e.location),d(8),Z("~/.coday/projects/","{","name","}","/agents/ (not committed)"),d(),A("selected",e.location==="colocated"),d(),u("ngModel",e.location)}}function Qe(s,t){if(s&1&&(i(0,"div",17)(1,"span",6),l(2,"Storage Location"),o(),i(3,"span",45),l(4),o(),i(5,"p",15),l(6,"Cannot be changed after creation."),o()()),s&2){let e=m();d(3),A("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),d(),B(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ")}}function Xe(s,t){if(s&1&&(i(0,"div",18)(1,"mat-icon"),l(2,"error"),o(),i(3,"span"),l(4),o()()),s&2){let e=m();d(4),x(e.errorMessage)}}var w=class s{agentCrudApi=h(v);agentApi=h(ke);dialogRef=h(ne);data=h(ie);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=!1;docUploadError="";location="project";isSaving=!1;errorMessage="";isEditMode=!1;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,n])=>({integration:e,tools:n?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments()}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]})}addDocRow(){this.mandatoryDocs.push("")}removeDocRow(t){this.mandatoryDocs.splice(t,1)}onDocFileSelected(t){let e=t.target,n=e.files?.[0];n&&(this.isUploadingDoc=!0,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,n).subscribe({next:r=>{this.isUploadingDoc=!1,this.mandatoryDocs.push(r.relativePath),this.loadAvailableDocuments(),e.value=""},error:r=>{this.isUploadingDoc=!1,this.docUploadError=r?.error?.error??r?.message??"Upload failed",e.value=""}}))}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""})}removeIntegrationRow(t){this.integrationRows.splice(t,1)}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",!1;if(!this.description.trim())return this.errorMessage="Description is required",!1;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",!1;return!0}buildDefinition(){let t=this.mandatoryDocs.map(n=>n.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(n=>n.integration.trim()).map(n=>[n.integration.trim(),n.tools.split(",").map(r=>r.trim()).filter(Boolean)])):void 0;return{name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=!0,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=!1,this.agentApi.clearAllCache(),this.dialogRef.close(!0)},error:n=>{this.isSaving=!1,this.errorMessage=n?.error?.error||n?.message||"Failed to save agent"}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=E({type:s,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,n){e&1&&(i(0,"h2",0),l(1),o(),i(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),l(6,"Name"),o(),i(7,"input",3),f("ngModelChange",function(a){return _(n.name,a)||(n.name=a),a}),o(),i(8,"mat-hint"),l(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),o()(),i(10,"mat-form-field",2)(11,"mat-label"),l(12,"Description"),o(),i(13,"textarea",4),f("ngModelChange",function(a){return _(n.description,a)||(n.description=a),a}),o()(),i(14,"mat-form-field",2)(15,"mat-label"),l(16,"Instructions"),o(),i(17,"textarea",5),f("ngModelChange",function(a){return _(n.instructions,a)||(n.instructions=a),a}),o(),i(18,"mat-hint"),l(19,"System prompt / instructions sent to the AI model"),o()(),i(20,"div",6),l(21,"AI Configuration"),o(),i(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),l(25,"AI Provider"),o(),i(26,"input",9),f("ngModelChange",function(a){return _(n.aiProvider,a)||(n.aiProvider=a),a}),o()(),i(27,"mat-form-field",8)(28,"mat-label"),l(29,"Model Name"),o(),i(30,"input",10),f("ngModelChange",function(a){return _(n.modelName,a)||(n.modelName=a),a}),o()()(),i(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),l(34,"Temperature"),o(),i(35,"input",11),f("ngModelChange",function(a){return _(n.temperature,a)||(n.temperature=a),a}),o(),i(36,"mat-hint"),l(37,"Leave empty for model default"),o()(),i(38,"mat-form-field",8)(39,"mat-label"),l(40,"Max Output Tokens"),o(),i(41,"input",12),f("ngModelChange",function(a){return _(n.maxOutputTokens,a)||(n.maxOutputTokens=a),a}),o(),i(42,"mat-hint"),l(43,"Leave empty for model default"),o()()(),i(44,"mat-form-field",2)(45,"mat-label"),l(46,"OpenAI Assistant ID"),o(),i(47,"input",13),f("ngModelChange",function(a){return _(n.openaiAssistantId,a)||(n.openaiAssistantId=a),a}),o(),i(48,"mat-hint"),l(49,"If set, forces aiProvider to openai"),o()(),i(50,"div",6)(51,"span"),l(52,"Integrations"),o(),i(53,"button",14),c("click",function(){return n.addIntegrationRow()}),i(54,"mat-icon"),l(55,"add"),o()()(),M(56,Ne,2,0,"p",15),P(57,Ue,12,2,"div",16,L),M(59,Ze,14,5)(60,Ke,2,0,"p",15),M(61,Je,25,8),M(62,Qe,7,5,"div",17),M(63,Xe,5,1,"div",18),o()(),i(64,"mat-dialog-actions",19)(65,"button",20),c("click",function(){return n.cancel()}),l(66,"Cancel"),o(),i(67,"button",21),c("click",function(){return n.save()}),l(68),o()()),e&2&&(d(),x(n.isEditMode?"Edit Agent":"Create Agent"),d(6),u("ngModel",n.name),C("readonly",n.isEditMode),d(6),u("ngModel",n.description),d(4),u("ngModel",n.instructions),d(9),u("ngModel",n.aiProvider),d(4),u("ngModel",n.modelName),d(5),u("ngModel",n.temperature),d(6),u("ngModel",n.maxOutputTokens),d(6),u("ngModel",n.openaiAssistantId),d(9),y(n.integrationRows.length===0?56:-1),d(),D(n.integrationRows),d(2),y(n.isEditMode?59:60),d(2),y(n.isEditMode?-1:61),d(),y(n.isEditMode?62:-1),d(),y(n.errorMessage?63:-1),d(2),C("disabled",n.isSaving),d(2),C("disabled",n.isSaving),d(),B(" ",n.isSaving?"Saving...":"Save"," "))},dependencies:[Me,ue,_e,de,ge,pe,me,Ce,he,fe,ce,se,re,le,ae,I,ee,O,Ee,Se,Ae,xe,ve,we,k,T,We,te],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media(max-width:768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media(max-width:768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};var Ye=()=>[],$e=s=>({id:s});function et(s,t){if(s&1&&(i(0,"div",5),l(1),o()),s&2){let e=m();d(),x(e.errorMessage())}}function tt(s,t){if(s&1){let e=b();i(0,"ds-entity-card",7),c("selected",function(r){g(e);let a=m();return p(a.onEdit(r))}),H(1,8),i(2,"button",9),c("click",function(r){return r.stopPropagation()}),i(3,"mat-icon"),l(4,"more_vert"),o()(),G(),o()}if(s&2){let e=t.$implicit;m();let n=R(9);C("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??K(6,Ye)),d(2),C("matMenuTriggerFor",n)("matMenuTriggerData",J(7,$e,e.id))}}function nt(s,t){if(s&1){let e=b();i(0,"button",10),c("click",function(){let r=g(e).id,a=m();return p(a.onEdit(r))}),i(1,"mat-icon"),l(2,"edit"),o(),l(3," Edit "),o(),i(4,"button",11),c("click",function(){let r=g(e).id,a=m();return p(a.onDelete(r))}),i(5,"mat-icon"),l(6,"delete"),o(),l(7," Delete "),o()}}var Re=class s{agentCrudApi=h(v);projectState=h(F);dialog=h(oe);router=h($);agents=S([]);isLoading=S(!1);errorMessage=S(null);agentItems=X(()=>this.agents().map(t=>({id:t.name,name:t.name,description:t.description,badges:this.buildBadges(t),groupKey:t.source,groupLabel:t.source==="project"?"Project (~/.coday/)":"Colocated (next to coday.yaml)"})));ngOnInit(){this.loadAgents()}loadAgents(){this.isLoading.set(!0),this.errorMessage.set(null),this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents.set(t),this.isLoading.set(!1)},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to load agents"),this.isLoading.set(!1)}})}onBack(){let t=this.projectState.getSelectedProjectId();this.router.navigate(t?["project",t]:["/"])}onCreate(){this.dialog.open(w,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents()})}onEdit(t){this.agentCrudApi.getAgent(t).subscribe({next:e=>{this.dialog.open(w,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(r=>{r&&this.loadAgents()})},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load agent")})}onDelete(t){confirm(`Are you sure you want to delete agent "${t}"?`)&&this.agentCrudApi.deleteAgent(t).subscribe({next:()=>this.loadAgents(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete agent")})}buildBadges(t){return[t.source==="project"?{label:"project",variant:"info"}:{label:"colocated",variant:"success"}]}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=E({type:s,selectors:[["app-agent-list"]],decls:11,vars:4,consts:[["agentCard",""],["cardMenu","matMenu"],[1,"agent-list-page"],["title","Agents","cardMinWidth","260px","contentMaxWidth","1400px","searchPlaceholder","Filter agents\u2026","emptyMessage","No file-based agents found.",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],[1,"agent-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item","",1,"agent-list__delete-item",3,"click"]],template:function(e,n){if(e&1&&(i(0,"div",2)(1,"ds-entity-list",3),c("createRequested",function(){return n.onCreate()}),i(2,"button",4),c("click",function(){return n.onBack()}),i(3,"mat-icon"),l(4,"chevron_left"),o()()(),M(5,et,2,1,"div",5),o(),W(6,tt,5,9,"ng-template",null,0,Q),i(8,"mat-menu",null,1),W(10,nt,8,0,"ng-template",6),o()),e&2){let r=R(7);d(),C("items",n.agentItems())("showCreate",!0)("itemTemplate",r),d(4),y(n.errorMessage()?5:-1)}},dependencies:[Pe,be,ye,I,O,k,T,Te,Ie,De,Oe,Fe],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.agent-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.agent-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"]})};export{Re as AgentListComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as a}from"./chunk-GUVOZD4J.js";import"./chunk-4VDSG7R6.js";import"./chunk-S2O6N5YR.js";import"./chunk-U3HXU6IS.js";import"./chunk-K4ZGQGPW.js";import"./chunk-SQBLNCXA.js";import"./chunk-QU3UZZE4.js";export{a as NamespaceListComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as v,R as _,S as H,T as O,U as D,a as b,b as u,da as G,f as F,lc as L,mc as h,oc as j}from"./chunk-QU3UZZE4.js";var y=class{apiKeys;username;password;accessToken;basePath;withCredentials;encoder;encodeParam;credentials;constructor({accessToken:f,apiKeys:n,basePath:a,credentials:s,encodeParam:o,encoder:t,password:e,username:c,withCredentials:l}={}){n&&(this.apiKeys=n),c!==void 0&&(this.username=c),e!==void 0&&(this.password=e),f!==void 0&&(this.accessToken=f),a!==void 0&&(this.basePath=a),l!==void 0&&(this.withCredentials=l),t&&(this.encoder=t),this.encodeParam=o??(r=>this.defaultEncodeParam(r)),this.credentials=s??{}}selectHeaderContentType(f){if(f.length===0)return;let n=f.find(a=>this.isJsonMime(a));return n===void 0?f[0]:n}selectHeaderAccept(f){if(f.length===0)return;let n=f.find(a=>this.isJsonMime(a));return n===void 0?f[0]:n}isJsonMime(f){let n=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return f!==null&&(n.test(f)||f.toLowerCase()==="application/json-patch+json")}lookupCredential(f){let n=this.credentials[f];return typeof n=="function"?n():n}addCredentialToHeaders(f,n,a,s){let o=this.lookupCredential(f);return o?a.set(n,(s??"")+o):a}addCredentialToQuery(f,n,a){let s=this.lookupCredential(f);return s?a.set(n,s):a}defaultEncodeParam(f){let n=f.dataFormat==="date-time"&&f.value instanceof Date?f.value.toISOString():f.value;return encodeURIComponent(String(n))}};var A=new _("basePath");var V=class{encodeKey(f){return encodeURIComponent(f)}encodeValue(f){return encodeURIComponent(f)}decodeKey(f){return decodeURIComponent(f)}decodeValue(f){return decodeURIComponent(f)}};var m=class{basePath="http://localhost:8124";defaultHeaders=new L;configuration;encoder;constructor(f,n){if(this.configuration=n||new y,typeof this.configuration.basePath!="string"){let a=Array.isArray(f)?f[0]:void 0;a!=null&&(f=a),typeof f!="string"&&(f=this.basePath),this.configuration.basePath=f}this.encoder=this.configuration.encoder||new V}canConsumeForm(f){return f.indexOf("multipart/form-data")!==-1}addToHttpParams(f,n,a,s=!1){return typeof n=="object"&&!(n instanceof Date)?this.addToHttpParamsRecursive(f,n,s?a:void 0,s):this.addToHttpParamsRecursive(f,n,a)}addToHttpParamsRecursive(f,n,a,s=!1){if(n==null)return f;if(typeof n=="object"){if(a!=null)return s?Object.keys(n).reduce((o,t)=>o.append(`${a}[${t}]`,n[t]),f):f.append(a,JSON.stringify(n));if(Array.isArray(n))n.forEach(o=>f=this.addToHttpParamsRecursive(f,o,a));else if(n instanceof Date)if(a!=null)f=f.append(a,n.toISOString());else throw Error("key may not be null if value is Date");else Object.keys(n).forEach(o=>{let t=a?`${a}.${o}`:o;f=this.addToHttpParamsRecursive(f,n[o],t)});return f}else if(a!=null)return f.append(a,n);throw Error("key may not be null if value is not object or array")}};var R=class C extends m{constructor(n,a,s){super(a,s);this.httpClient=n}createAiModel(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter aiModel was null or undefined when calling createAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/ai-models",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}deleteAiModel(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdAiModel(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdsAiModel(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/ai-models/by-ids",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}listByNamespaceIdAiModel(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling listByNamespaceIdAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/by-namespaceId/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}listByParentAiModel(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}updateAiModel(n,a,s="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAiModel.");if(a==null)throw new Error("Required parameter aiModel was null or undefined when calling updateAiModel.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new h,r=t?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let x=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${x}`,u(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:s,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(H(j),H(A,8),H(y,8))};static \u0275prov=v({token:C,factory:C.\u0275fac,providedIn:"root"})};var E=class C extends m{constructor(n,a,s){super(a,s);this.httpClient=n}createAiProvider(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter aiProvider was null or undefined when calling createAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/ai-providers",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}deleteAiProvider(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdAiProvider(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdsAiProvider(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/ai-providers/by-ids",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}listByNamespaceIdAiProvider(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling listByNamespaceIdAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/by-namespaceId/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}listByParentAiProvider(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}listByUserIdAiProvider(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter userId was null or undefined when calling listByUserIdAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/by-userId/${this.configuration.encodeParam({name:"userId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}updateAiProvider(n,a,s="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAiProvider.");if(a==null)throw new Error("Required parameter aiProvider was null or undefined when calling updateAiProvider.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new h,r=t?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let x=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${x}`,u(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:s,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(H(j),H(A,8),H(y,8))};static \u0275prov=v({token:C,factory:C.\u0275fac,providedIn:"root"})};var M=class C extends m{constructor(n,a,s){super(a,s);this.httpClient=n}addMessageCase(n,a,s="body",o=!1,t){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling addMessageCase.");if(a==null)throw new Error("Required parameter addMessageRequest was null or undefined when calling addMessageCase.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new h,r=t?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let x=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/messages`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("post",`${g}${x}`,u(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:s,transferCache:r,reportProgress:o}))}createCase(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter _case was null or undefined when calling createCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/cases",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}deleteCase(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdCase(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdsCase(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/cases/by-ids",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}interruptCase(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling interruptCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/interrupt`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("post",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}killCase(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling killCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/kill`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("post",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}listByParentCase(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}updateCase(n,a,s="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateCase.");if(a==null)throw new Error("Required parameter _case was null or undefined when calling updateCase.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new h,r=t?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let x=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${x}`,u(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:s,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(H(j),H(A,8),H(y,8))};static \u0275prov=v({token:C,factory:C.\u0275fac,providedIn:"root"})};var $=class C extends m{constructor(n,a,s){super(a,s);this.httpClient=n}createIntegrationConfig(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter integrationConfig was null or undefined when calling createIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/integration-configs",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}deleteIntegrationConfig(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdIntegrationConfig(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdsIntegrationConfig(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/integration-configs/by-ids",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}listByParentIntegrationConfig(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-configs/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}updateIntegrationConfig(n,a,s="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateIntegrationConfig.");if(a==null)throw new Error("Required parameter integrationConfig was null or undefined when calling updateIntegrationConfig.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new h,r=t?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let x=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${x}`,u(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:s,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(H(j),H(A,8),H(y,8))};static \u0275prov=v({token:C,factory:C.\u0275fac,providedIn:"root"})};var B=class C extends m{constructor(n,a,s){super(a,s);this.httpClient=n}getTypeIntegrationType(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter type was null or undefined when calling getTypeIntegrationType.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-types/${this.configuration.encodeParam({name:"type",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}listTypesIntegrationType(n="body",a=!1,s){let o=this.defaultHeaders,t=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=s?.context??new h,c=s?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/integration-types",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${r}`,u(b({context:e,responseType:l},i?{withCredentials:i}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}static \u0275fac=function(a){return new(a||C)(H(j),H(A,8),H(y,8))};static \u0275prov=v({token:C,factory:C.\u0275fac,providedIn:"root"})};var q=class C extends m{constructor(n,a,s){super(a,s);this.httpClient=n}createNamespace(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter namespace was null or undefined when calling createNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/namespaces",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}deleteNamespace(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdNamespace(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdsNamespace(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/namespaces/by-ids",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}listAllNamespace(n="body",a=!1,s){let o=this.defaultHeaders,t=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=s?.context??new h,c=s?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/namespaces",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${r}`,u(b({context:e,responseType:l},i?{withCredentials:i}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}listByParentNamespace(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/namespaces/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}updateNamespace(n,a,s="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateNamespace.");if(a==null)throw new Error("Required parameter namespace was null or undefined when calling updateNamespace.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new h,r=t?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let x=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${x}`,u(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:s,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(H(j),H(A,8),H(y,8))};static \u0275prov=v({token:C,factory:C.\u0275fac,providedIn:"root"})};var k=(a=>(a.OpenAI="OpenAI",a.Anthropic="Anthropic",a.Gemini="Gemini",a))(k||{});var S=class C extends m{constructor(n,a,s){super(a,s);this.httpClient=n}getByIdCaseEventRest(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdsCaseEventRest(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/case-events/by-ids",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}listByCaseCaseEventRest(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling listByCaseCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/case-events/by-parentId/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}static \u0275fac=function(a){return new(a||C)(H(j),H(A,8),H(y,8))};static \u0275prov=v({token:C,factory:C.\u0275fac,providedIn:"root"})};var N=class C extends m{constructor(n,a,s){super(a,s);this.httpClient=n}debugAllPlugins(n="body",a=!1,s){let o=this.defaultHeaders,t=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=s?.context??new h,c=s?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins/debug",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${r}`,u(b({context:e,responseType:l},i?{withCredentials:i}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}debugPlugin(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling debugPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/debug`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getAllPlugins(n="body",a=!1,s){let o=this.defaultHeaders,t=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=s?.context??new h,c=s?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${r}`,u(b({context:e,responseType:l},i?{withCredentials:i}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}getPlugin(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling getPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}reloadAllAgentsPlugin(n="body",a=!1,s){let o=this.defaultHeaders,t=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=s?.context??new h,c=s?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins/reload-agents",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${r}`,u(b({context:e,responseType:l},i?{withCredentials:i}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}reloadPlugin(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling reloadPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/reload`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("post",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}startPlugin(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling startPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/start`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("post",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}stopPlugin(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling stopPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/stop`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("post",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}unloadPlugin(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling unloadPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}uploadPlugin(n="body",a=!1,s){let o=this.defaultHeaders,t=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=s?.context??new h,c=s?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins/upload",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${r}`,u(b({context:e,responseType:l},i?{withCredentials:i}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}static \u0275fac=function(a){return new(a||C)(H(j),H(A,8),H(y,8))};static \u0275prov=v({token:C,factory:C.\u0275fac,providedIn:"root"})};var U=class C extends m{constructor(n,a,s){super(a,s);this.httpClient=n}streamEventsCaseEventSse(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling streamEventsCaseEventSse.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["text/event-stream"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/events`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}static \u0275fac=function(a){return new(a||C)(H(j),H(A,8),H(y,8))};static \u0275prov=v({token:C,factory:C.\u0275fac,providedIn:"root"})};var J=class C extends m{constructor(n,a,s){super(a,s);this.httpClient=n}createUser(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter user was null or undefined when calling createUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/users",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}deleteUser(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdUser(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getByIdsUser(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let p="/api/users/by-ids",{basePath:x,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${x}${p}`,u(b({context:c,body:n,responseType:i},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}getMeUser(n="body",a=!1,s){let o=this.defaultHeaders,t=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=s?.context??new h,c=s?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/users/me",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${r}`,u(b({context:e,responseType:l},i?{withCredentials:i}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}listAllUser(n="body",a=!1,s){let o=this.defaultHeaders,t=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=s?.context??new h,c=s?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/users",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${r}`,u(b({context:e,responseType:l},i?{withCredentials:i}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}listByParentUser(n,a="body",s=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new h,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/users/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${i}${d}`,u(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:s}))}updateUser(n,a,s="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateUser.");if(a==null)throw new Error("Required parameter user was null or undefined when calling updateUser.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new h,r=t?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let x=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${x}`,u(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:s,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(H(j),H(A,8),H(y,8))};static \u0275prov=v({token:C,factory:C.\u0275fac,providedIn:"root"})};function Dn(C){return D([typeof C=="string"?{provide:A,useValue:C}:{provide:y,useValue:new y(b({},C))}])}var W=class C{config=O(y);zone=O(G);connect(f){let n=`${this.config.basePath}/api/cases/${f}/events`;return new F(a=>{let s=this.zone.runOutsideAngular(()=>new EventSource(n));return s.onmessage=o=>{try{let t=JSON.parse(o.data);this.zone.run(()=>a.next(t))}catch(t){this.zone.run(()=>a.error(new Error(`Failed to parse SSE event: ${t}`)))}},s.onerror=o=>{s.readyState===EventSource.CLOSED?this.zone.run(()=>a.complete()):this.zone.run(()=>a.error(new Error(`SSE connection error for case ${f}`))),s.close()},()=>s.close()})}static \u0275fac=function(n){return new(n||C)};static \u0275prov=v({token:C,factory:C.\u0275fac,providedIn:"root"})};export{y as a,R as b,E as c,M as d,$ as e,B as f,q as g,N as h,J as i,k as j,Dn as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as G,c as F,e as v,g as V,h as I,i as z,l as _,n as L,s as R,u as B}from"./chunk-U3HXU6IS.js";import{g as D}from"./chunk-K4ZGQGPW.js";import{a as C}from"./chunk-SQBLNCXA.js";import{$a as f,Ab as O,Ea as N,Sa as M,T as c,Ta as P,X as b,Y as h,Ya as m,Za as n,_a as t,a as p,b as x,ba as y,ga as d,gb as S,ib as u,kb as g,rc as E,tc as w,ua as a,yb as o,zb as k}from"./chunk-QU3UZZE4.js";function A(i,r){i&1&&(n(0,"p",5),o(1,"Loading\u2026"),t())}function $(i,r){if(i&1){let e=S();n(0,"form",7),u("ngSubmit",function(){b(e);let l=g();return h(l.submit())}),n(1,"div",8)(2,"label",9),o(3,"Name "),n(4,"span",10),o(5,"*"),t()(),f(6,"input",11),t(),n(7,"div",8)(8,"label",12),o(9,"Description"),t(),f(10,"input",13),t(),n(11,"div",8)(12,"label",14),o(13,"Config path"),t(),f(14,"input",15),t(),n(15,"div",16)(16,"button",17),o(17),t(),n(18,"button",18),u("click",function(){b(e);let l=g();return h(l.cancel())}),o(19,"Cancel"),t()()()}if(i&2){let e=g();m("formGroup",e.form),a(6),m("formControl",e.nameControl),a(4),m("formControl",e.descriptionControl),a(4),m("formControl",e.configPathControl),a(2),m("disabled",e.nameControl.invalid||e.isSubmitting()),a(),O(" ",e.isEditMode()?"Save changes":"Create"," ")}}var T=class i{route=c(E);router=c(w);namespaceController=c(D);destroyRef=c(y);form=new z({name:new _("",{nonNullable:!0,validators:[v.required,v.minLength(1)]}),description:new _("",{nonNullable:!0}),configPath:new _("",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}isEditMode=d(!1);isSubmitting=d(!1);isLoading=d(!1);existingNamespace=null;ngOnInit(){let r=this.route.snapshot.paramMap.get("namespaceId");r&&(this.isEditMode.set(!0),this.loadNamespace(r))}loadNamespace(r){this.isLoading.set(!0),this.namespaceController.getByIdNamespace(r).pipe(C(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}submit(){if(this.nameControl.invalid||this.isSubmitting())return;this.isSubmitting.set(!0),(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",x(p({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0})):this.namespaceController.createNamespace(p(p({name:this.nameControl.value.trim()},this.descriptionControl.value.trim()?{description:this.descriptionControl.value.trim()}:{}),this.configPathControl.value.trim()?{configPath:this.configPathControl.value.trim()}:{}))).pipe(C(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos/namespaces"])}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=N({type:i,selectors:[["agentos-namespace-form"]],decls:10,vars:2,consts:[[1,"namespace-form"],[1,"namespace-form__header"],["type","button","title","Back to namespaces",1,"namespace-form__back",3,"click"],[1,"namespace-form__back-icon"],[1,"namespace-form__title"],[1,"namespace-form__loading"],[1,"namespace-form__form",3,"formGroup"],[1,"namespace-form__form",3,"ngSubmit","formGroup"],[1,"namespace-form__field"],["for","ns-name",1,"namespace-form__label"],["aria-hidden","true"],["id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-description",1,"namespace-form__label"],["id","ns-description","type","text","placeholder","Optional description","autocomplete","off",1,"namespace-form__input",3,"formControl"],["for","ns-config-path",1,"namespace-form__label"],["id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",1,"namespace-form__input",3,"formControl"],[1,"namespace-form__actions"],["type","submit",1,"namespace-form__btn","namespace-form__btn--primary",3,"disabled"],["type","button",1,"namespace-form__btn",3,"click"]],template:function(e,s){e&1&&(n(0,"div",0)(1,"header",1)(2,"button",2),u("click",function(){return s.cancel()}),n(3,"span",3),o(4,"\u2190"),t(),o(5," Namespaces "),t(),n(6,"h1",4),o(7),t()(),M(8,A,2,0,"p",5)(9,$,20,6,"form",6),t()),e&2&&(a(7),k(s.isEditMode()?"Edit namespace":"New namespace"),a(),P(s.isLoading()?8:9))},dependencies:[G,L,F,V,I,R,B],styles:[".namespace-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.namespace-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.namespace-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.namespace-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.namespace-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.namespace-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.namespace-form__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.namespace-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.namespace-form__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.namespace-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.namespace-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.namespace-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.namespace-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.namespace-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.namespace-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{T as NamespaceFormComponent};
|