@whoz-oss/coday-client 0.0.0-workstream-forge.159 → 0.0.0-workstream-forge.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/browser/{chunk-CcHF3ZPx.js → chunk-3WTfpQBB.js} +1 -1
  2. package/browser/chunk-6I6iGMI5.js +1 -0
  3. package/browser/{chunk-Cc_OXK2g.js → chunk-B-2JHDoj.js} +1 -1
  4. package/browser/chunk-BRsEbvq8.js +1 -0
  5. package/browser/{chunk-DHgv1cy0.js → chunk-BU-llEzO.js} +1 -1
  6. package/browser/chunk-BW8fM0ue.js +1 -0
  7. package/browser/{chunk-C6l-ubPp.js → chunk-B_xyOXZs.js} +1 -1
  8. package/browser/{chunk-DWxo88Hh.js → chunk-BgXa8VvY.js} +1 -1
  9. package/browser/{chunk-BKPUzOao.js → chunk-BkbZAmXX.js} +1 -1
  10. package/browser/{chunk-BHB3p2wV.js → chunk-Bqm3Baon.js} +1 -1
  11. package/browser/{chunk-Ft41O2oO.js → chunk-BuBFIFse.js} +1 -1
  12. package/browser/{chunk-BnPmoh3z.js → chunk-BvtDVbRn.js} +1 -1
  13. package/browser/{chunk-BLas18US.js → chunk-C-CSiiPO.js} +1 -1
  14. package/browser/{chunk-6lzxK4MR.js → chunk-C2Ysz4lE.js} +1 -1
  15. package/browser/{chunk-Cta1xCgm.js → chunk-CW_HgUJv.js} +1 -1
  16. package/browser/{chunk-Cm-B0Bk2.js → chunk-CZJC16qo.js} +1 -1
  17. package/browser/{chunk-kgmv2Up_.js → chunk-CpMZ7Npg.js} +1 -1
  18. package/browser/{chunk-giF-MCzQ.js → chunk-Cs6CLQoM.js} +1 -1
  19. package/browser/chunk-CyaG7zAT.js +2 -0
  20. package/browser/chunk-D2HLDbQg.js +1 -0
  21. package/browser/{chunk-GZDFcyNO.js → chunk-D2s9ksqW.js} +1 -1
  22. package/browser/{chunk-CNj1cQTl.js → chunk-D4yRqSei.js} +1 -1
  23. package/browser/{chunk-Db9YjUfz.js → chunk-DBXVlo1t.js} +1 -1
  24. package/browser/{chunk-CGcYoQNb.js → chunk-DS5OuYg2.js} +1 -1
  25. package/browser/chunk-D_SLwB5o.js +1 -0
  26. package/browser/{chunk-nYdCEVqA.js → chunk-DaoRhmfh.js} +1 -1
  27. package/browser/{chunk-BtPUYR0A.js → chunk-DbMNQNwa.js} +1 -1
  28. package/browser/chunk-Dge-j7OI.js +1 -0
  29. package/browser/{chunk-CD-gr1_W.js → chunk-DksUPXSW.js} +1 -1
  30. package/browser/{chunk-CgKiDm6z.js → chunk-DmcUxfMI.js} +1 -1
  31. package/browser/{chunk-CYIDbqSE.js → chunk-DrZAIHqG.js} +1 -1
  32. package/browser/{chunk-Cw7AdCyF.js → chunk-DrzCxadB.js} +1 -1
  33. package/browser/{chunk-BQRV2aXM.js → chunk-DsW6-MGu.js} +1 -1
  34. package/browser/chunk-Rokta00i.js +1 -0
  35. package/browser/chunk-Xo4jxdGx.js +2 -0
  36. package/browser/chunk-fLWaVOVo.js +1027 -0
  37. package/browser/{chunk-BP4bg_R6.js → chunk-gpCPAAXl.js} +1 -1
  38. package/browser/{chunk-D2ibs68b.js → chunk-hJmMWaWI.js} +1 -1
  39. package/browser/chunk-i6V9cgAY.js +1 -0
  40. package/browser/{chunk-PgOtzhjh.js → chunk-llAhFIMA.js} +1 -1
  41. package/browser/{chunk-CdClH7mi.js → chunk-lwErdMBY.js} +1 -1
  42. package/browser/{chunk-DuzRIIcw.js → chunk-sNekP8KG.js} +1 -1
  43. package/browser/chunk-vtj56A7g.js +1 -0
  44. package/browser/chunk-xZ2GmpSF.js +2 -0
  45. package/browser/chunk-yUomgNv9.js +1 -0
  46. package/browser/index.html +1 -1
  47. package/browser/{main-3WVIQAKF.js → main-OQRNUTKI.js} +13 -13
  48. package/package.json +1 -1
  49. package/browser/chunk-BN5SgIBg.js +0 -1027
  50. package/browser/chunk-CFyS8cBR.js +0 -1
  51. package/browser/chunk-CRkvWY5s.js +0 -1
  52. package/browser/chunk-Cgri6mja.js +0 -1
  53. package/browser/chunk-Cp__Ucb0.js +0 -2
  54. package/browser/chunk-CwR1is0O.js +0 -1
  55. package/browser/chunk-DRPc0mfI.js +0 -2
  56. package/browser/chunk-DVFj7gx9.js +0 -1
  57. package/browser/chunk-DZgJFN1U.js +0 -1
  58. package/browser/chunk-Dx61Sbit.js +0 -1
  59. package/browser/chunk-LrMK9YKu.js +0 -1
  60. package/browser/chunk-PLFrDqWd.js +0 -1
  61. package/browser/chunk-fnvTjcS-.js +0 -1
  62. package/browser/chunk-oG_KGFYC.js +0 -2
@@ -1 +1 @@
1
- import {o}from'./chunk-BtPUYR0A.js';import {$,v as vt,a as ve,K as Kn,z as zn,Y as Ye,L as Ln,W as Wn,b as pn,V as Vn}from'./chunk-BN5SgIBg.js';import {p,y as $t,o as It,M as Me,g as ie,U as U$1,J as x,H as w,D as Df,at as pu,$ as $a,K as lc,t as t_,b as bf,d as dT,m as mb,I as Iv,f as fT,_ as _T,N as tv,r as IT,u as uc,L as oS,O as sS,A as Af,j as gT,ah as hT,k as mT,s as ig,v as sg}from'./main-3WVIQAKF.js';function J(n,o){if(n&1&&($a(0,"a",5),t_(1,"View skill \u2192"),bf()),n&2){let e=_T();tv("routerLink",e.inspectRoute());}}function K(n,o){n&1&&($a(0,"span",6),t_(1,"Platform level"),bf());}function Q(n,o){n&1&&($a(0,"p",7),t_(1,"Loading\u2026"),bf());}function W(n,o){n&1&&($a(0,"p",14),t_(1," A valid, non-empty name is required. "),bf());}function X(n,o){if(n&1){let e=IT();$a(0,"li",26)(1,"div",27),uc(2,"input",28),oS(),$a(3,"button",29),lc("click",function(){let s=ig(e).$implicit,H=_T(3);return sg(H.removeResource(s))}),t_(4," \xD7 "),bf()(),uc(5,"textarea",30),oS(),bf();}if(n&2){let e=o.$implicit;mb(2),tv("formControl",e.path),sS(),mb(3),tv("formControl",e.content),sS();}}function Y(n,o){if(n&1&&($a(0,"ul",20),gT(1,X,6,2,"li",26,hT),bf()),n&2){let e=_T(2);mb(),mT(e.resourceRows());}}function ee(n,o){if(n&1&&($a(0,"p",22),t_(1),bf()),n&2){let e=_T(2);mb(),Iv(e.errorMessage());}}function te(n,o){if(n&1){let e=IT();$a(0,"form",9),lc("ngSubmit",function(){ig(e);let s=_T();return sg(s.submit())}),$a(1,"div",10)(2,"label",11),t_(3,"Name"),bf(),uc(4,"input",12),oS(),$a(5,"p",13),t_(6," The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max. "),bf(),dT(7,W,2,0,"p",14),bf(),$a(8,"div",10)(9,"label",15),t_(10,"Description"),bf(),uc(11,"textarea",16),oS(),$a(12,"p",13),t_(13," This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max. "),bf()(),$a(14,"div",10)(15,"label",17),t_(16,"Body"),bf(),uc(17,"textarea",18),oS(),$a(18,"p",13),t_(19," Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill. "),bf()(),$a(20,"div",10)(21,"span",19),t_(22,"Resources"),bf(),$a(23,"p",13),t_(24," Optional files the agent can read with readSkillResource, by relative path. "),bf(),dT(25,Y,3,0,"ul",20),$a(26,"button",21),lc("click",function(){ig(e);let s=_T();return sg(s.addResource())}),t_(27," + Add resource "),bf()(),dT(28,ee,2,1,"p",22),$a(29,"div",23)(30,"button",24),lc("click",function(){ig(e);let s=_T();return sg(s.cancel())}),t_(31,"Cancel"),bf(),$a(32,"button",25),t_(33),bf()()();}if(n&2){let e=_T();tv("formGroup",e.form),mb(4),tv("formControl",e.nameControl),sS(),mb(3),fT(e.nameControl.invalid&&e.nameControl.touched?7:-1),mb(4),tv("formControl",e.descriptionControl),sS(),mb(6),tv("formControl",e.bodyControl),sS(),mb(8),fT(e.resourceRows().length>0?25:-1),mb(3),fT(e.errorMessage()?28:-1),mb(4),tv("disabled",e.form.invalid||e.isSubmitting()),mb(),Af(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save":"Create"," ");}}var U=class n{route=p($t);router=p(It);destroyRef=p(Me);skillState=p(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=ie(false);isLoading=ie(false);isSubmitting=ie(false);errorMessage=ie(null);existingSkill=null;form=new $({name:new vt("",{nonNullable:true,validators:[ve.required,ve.maxLength(100),ve.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new vt("",{nonNullable:true,validators:[ve.required,ve.maxLength(500),ve.pattern(/\S/)]}),body:new vt("",{nonNullable:true,validators:[ve.required,ve.pattern(/\S/)]})});resourceRows=ie([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let o=this.route.snapshot.paramMap.get("skillId");o&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(o).pipe(U$1(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([a,s])=>({path:new vt(a,{nonNullable:true}),content:new vt(s,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(o=>[...o,{path:new vt("",{nonNullable:true}),content:new vt("",{nonNullable:true})}]);}removeResource(o){this.resourceRows.update(e=>e.filter(a=>a!==o));}buildResourcesPayload(){let o=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(o)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let o=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",o):this.skillState.create(o)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:a=>{this.isSubmitting.set(false),a.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):a.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let o=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",o,"inspect"]:["/agentos",this.namespaceId,"skills",o,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Df({type:n,selectors:[["agentos-skill-form"]],decls:12,vars:4,consts:[[1,"skill-form"],[1,"skill-form__header"],["type","button","title","Back to skills",1,"skill-form__back",3,"click"],[1,"skill-form__back-icon"],[1,"skill-form__title"],[1,"skill-form__sibling-link",3,"routerLink"],[1,"skill-form__platform-badge"],[1,"skill-form__loading"],[1,"skill-form__form",3,"formGroup"],[1,"skill-form__form",3,"ngSubmit","formGroup"],[1,"skill-form__field"],["for","skill-name",1,"skill-form__label"],["id","skill-name","type","text","autocomplete","off",1,"skill-form__input",3,"formControl"],[1,"skill-form__field-hint"],["role","alert",1,"skill-form__field-hint","skill-form__field-hint--error"],["for","skill-description",1,"skill-form__label"],["id","skill-description","rows","2",1,"skill-form__input","skill-form__textarea",3,"formControl"],["for","skill-body",1,"skill-form__label"],["id","skill-body","rows","16",1,"skill-form__input","skill-form__textarea","skill-form__textarea--code",3,"formControl"],[1,"skill-form__label"],[1,"skill-form__resource-list"],["type","button",1,"skill-form__resource-btn","skill-form__resource-btn--add",3,"click"],["role","alert",1,"skill-form__error"],[1,"skill-form__actions"],["type","button",1,"skill-form__btn",3,"click"],["type","submit",1,"skill-form__btn","skill-form__btn--primary",3,"disabled"],[1,"skill-form__resource-row"],[1,"skill-form__resource-head"],["type","text","placeholder","e.g. references/checklist.md","autocomplete","off",1,"skill-form__input","skill-form__resource-path",3,"formControl"],["type","button","title","Remove",1,"skill-form__resource-btn","skill-form__resource-btn--danger",3,"click"],["rows","4",1,"skill-form__input","skill-form__textarea","skill-form__textarea--code",3,"formControl"]],template:function(e,a){e&1&&($a(0,"div",0)(1,"header",1)(2,"button",2),lc("click",function(){return a.cancel()}),$a(3,"span",3),t_(4,"\u2190"),bf(),t_(5," Skills "),bf(),$a(6,"h1",4),t_(7),bf(),dT(8,J,2,1,"a",5),dT(9,K,2,0,"span",6),bf(),dT(10,Q,2,0,"p",7)(11,te,34,9,"form",8),bf()),e&2&&(mb(7),Iv(a.isEditMode()?"Edit skill":"New skill"),mb(),fT(a.isEditMode()?8:-1),mb(),fT(a.isPlatformMode?9:-1),mb(),fT(a.isLoading()?10:11));},dependencies:[Kn,zn,Ye,Ln,Wn,pn,Vn,pu],styles:[".skill-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.skill-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.skill-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}.skill-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.skill-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.skill-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.skill-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-form__platform-badge[_ngcontent-%COMP%]{align-self:flex-start;font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.15rem .5rem;border:1px solid var(--color-divider, rgba(0, 0, 0, .12));color:var(--color-neutral-600, #6e6e73)}.skill-form__loading[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.skill-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.skill-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.skill-form__label[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73)}.skill-form__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:.5rem .75rem;border:1px solid var(--color-border, rgba(0, 0, 0, .12));border-radius:0;background:var(--color-surface, #fff);color:var(--color-text, #1d1d1f);font-family:inherit;font-size:.9375rem}.skill-form__input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.skill-form__textarea[_ngcontent-%COMP%]{resize:vertical;line-height:1.5}.skill-form__textarea--code[_ngcontent-%COMP%]{font-family:var(--font-code, monospace);font-size:.8125rem}.skill-form__field-hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73)}.skill-form__field-hint--error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.skill-form__resource-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.75rem}.skill-form__resource-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.skill-form__resource-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.skill-form__resource-path[_ngcontent-%COMP%]{flex:1;font-family:var(--font-code, monospace);font-size:.8125rem}.skill-form__resource-btn[_ngcontent-%COMP%]{align-self:flex-start;background:none;border:1px solid var(--color-border, rgba(0, 0, 0, .12));padding:.3rem .6rem;cursor:pointer;font-family:inherit;font-size:.8125rem;color:var(--color-text, #1d1d1f)}.skill-form__resource-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04))}.skill-form__resource-btn--danger[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30);font-size:1rem;line-height:1;padding:.25rem .5rem}.skill-form__resource-btn--add[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}.skill-form__error[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-error, #ff3b30)}.skill-form__actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.skill-form__btn[_ngcontent-%COMP%]{padding:.5rem 1rem;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text, #1d1d1f)}.skill-form__btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04))}.skill-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.skill-form__btn--primary[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}"]})};export{U as SkillFormComponent};
1
+ import {o}from'./chunk-DbMNQNwa.js';import {$,v as vt,a as ve,K as Kn,z as zn,Y as Ye,L as Ln,W as Wn,b as pn,V as Vn}from'./chunk-fLWaVOVo.js';import {p,$ as $t,g as It,H as Me,s as se,U as U$1,K as x,J as w,a as Ef,at as pu,z as za,L as dc,n as n_,S as Sf,f as fT,y as yb,I as Iv,h as hT,k as MT,O as tv,C as CT,l as lc,N as iS,Q as aS,x as xf,m as mT,ah as pT,d as yT,o as sg,q as ag}from'./main-OQRNUTKI.js';function J(n,o){if(n&1&&(za(0,"a",5),n_(1,"View skill \u2192"),Sf()),n&2){let e=MT();tv("routerLink",e.inspectRoute());}}function K(n,o){n&1&&(za(0,"span",6),n_(1,"Platform level"),Sf());}function Q(n,o){n&1&&(za(0,"p",7),n_(1,"Loading\u2026"),Sf());}function W(n,o){n&1&&(za(0,"p",14),n_(1," A valid, non-empty name is required. "),Sf());}function X(n,o){if(n&1){let e=CT();za(0,"li",26)(1,"div",27),lc(2,"input",28),iS(),za(3,"button",29),dc("click",function(){let s=sg(e).$implicit,H=MT(3);return ag(H.removeResource(s))}),n_(4," \xD7 "),Sf()(),lc(5,"textarea",30),iS(),Sf();}if(n&2){let e=o.$implicit;yb(2),tv("formControl",e.path),aS(),yb(3),tv("formControl",e.content),aS();}}function Y(n,o){if(n&1&&(za(0,"ul",20),mT(1,X,6,2,"li",26,pT),Sf()),n&2){let e=MT(2);yb(),yT(e.resourceRows());}}function ee(n,o){if(n&1&&(za(0,"p",22),n_(1),Sf()),n&2){let e=MT(2);yb(),Iv(e.errorMessage());}}function te(n,o){if(n&1){let e=CT();za(0,"form",9),dc("ngSubmit",function(){sg(e);let s=MT();return ag(s.submit())}),za(1,"div",10)(2,"label",11),n_(3,"Name"),Sf(),lc(4,"input",12),iS(),za(5,"p",13),n_(6," The value an agent's skillSelectors entry must match. Letters, digits, dash, dot, underscore and single spaces; 100 characters max. "),Sf(),fT(7,W,2,0,"p",14),Sf(),za(8,"div",10)(9,"label",15),n_(10,"Description"),Sf(),lc(11,"textarea",16),iS(),za(12,"p",13),n_(13," This is what the agent sees in its skill catalog \u2014 it decides from this line alone whether to read the skill. 500 characters max. "),Sf()(),za(14,"div",10)(15,"label",17),n_(16,"Body"),Sf(),lc(17,"textarea",18),iS(),za(18,"p",13),n_(19," Markdown instructions returned verbatim by the readSkill tool when the agent asks for this skill. "),Sf()(),za(20,"div",10)(21,"span",19),n_(22,"Resources"),Sf(),za(23,"p",13),n_(24," Optional files the agent can read with readSkillResource, by relative path. "),Sf(),fT(25,Y,3,0,"ul",20),za(26,"button",21),dc("click",function(){sg(e);let s=MT();return ag(s.addResource())}),n_(27," + Add resource "),Sf()(),fT(28,ee,2,1,"p",22),za(29,"div",23)(30,"button",24),dc("click",function(){sg(e);let s=MT();return ag(s.cancel())}),n_(31,"Cancel"),Sf(),za(32,"button",25),n_(33),Sf()()();}if(n&2){let e=MT();tv("formGroup",e.form),yb(4),tv("formControl",e.nameControl),aS(),yb(3),hT(e.nameControl.invalid&&e.nameControl.touched?7:-1),yb(4),tv("formControl",e.descriptionControl),aS(),yb(6),tv("formControl",e.bodyControl),aS(),yb(8),hT(e.resourceRows().length>0?25:-1),yb(3),hT(e.errorMessage()?28:-1),yb(4),tv("disabled",e.form.invalid||e.isSubmitting()),yb(),xf(" ",e.isSubmitting()?"Saving\u2026":e.isEditMode()?"Save":"Create"," ");}}var U=class n{route=p($t);router=p(It);destroyRef=p(Me);skillState=p(o);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isEditMode=se(false);isLoading=se(false);isSubmitting=se(false);errorMessage=se(null);existingSkill=null;form=new $({name:new vt("",{nonNullable:true,validators:[ve.required,ve.maxLength(100),ve.pattern(/^[a-zA-Z0-9_.-]+( [a-zA-Z0-9_.-]+)*$/)]}),description:new vt("",{nonNullable:true,validators:[ve.required,ve.maxLength(500),ve.pattern(/\S/)]}),body:new vt("",{nonNullable:true,validators:[ve.required,ve.pattern(/\S/)]})});resourceRows=se([]);get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get bodyControl(){return this.form.controls.body}ngOnInit(){let o=this.route.snapshot.paramMap.get("skillId");o&&(this.isEditMode.set(true),this.isLoading.set(true),this.skillState.getById(o).pipe(U$1(this.destroyRef)).subscribe({next:e=>{if(e.readOnly){this.router.navigate(this.inspectRoute());return}this.existingSkill=e,this.form.patchValue({name:e.name,description:e.description,body:e.body}),this.resourceRows.set(Object.entries(e.resources??{}).map(([a,s])=>({path:new vt(a,{nonNullable:true}),content:new vt(s,{nonNullable:true})}))),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}}));}addResource(){this.resourceRows.update(o=>[...o,{path:new vt("",{nonNullable:true}),content:new vt("",{nonNullable:true})}]);}removeResource(o){this.resourceRows.update(e=>e.filter(a=>a!==o));}buildResourcesPayload(){let o=this.resourceRows().map(e=>[e.path.value.trim(),e.content.value]).filter(([e])=>e.length>0);return Object.fromEntries(o)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let o=x(w({},this.existingSkill??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim(),body:this.bodyControl.value,resources:this.buildResourcesPayload()});(this.isEditMode()?this.skillState.update(this.existingSkill?.id??"",o):this.skillState.create(o)).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:a=>{this.isSubmitting.set(false),a.status===409?this.errorMessage.set(`A skill named "${this.nameControl.value.trim()}" already exists in this scope.`):a.status===400?this.errorMessage.set("The server rejected this skill. A filesystem-backed skill cannot be modified."):this.errorMessage.set("Saving the skill failed.");}});}cancel(){this.navigateBack();}inspectRoute(){let o=this.route.snapshot.paramMap.get("skillId")??"";return this.isPlatformMode?["/agentos","admin","skills",o,"inspect"]:["/agentos",this.namespaceId,"skills",o,"inspect"]}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Ef({type:n,selectors:[["agentos-skill-form"]],decls:12,vars:4,consts:[[1,"skill-form"],[1,"skill-form__header"],["type","button","title","Back to skills",1,"skill-form__back",3,"click"],[1,"skill-form__back-icon"],[1,"skill-form__title"],[1,"skill-form__sibling-link",3,"routerLink"],[1,"skill-form__platform-badge"],[1,"skill-form__loading"],[1,"skill-form__form",3,"formGroup"],[1,"skill-form__form",3,"ngSubmit","formGroup"],[1,"skill-form__field"],["for","skill-name",1,"skill-form__label"],["id","skill-name","type","text","autocomplete","off",1,"skill-form__input",3,"formControl"],[1,"skill-form__field-hint"],["role","alert",1,"skill-form__field-hint","skill-form__field-hint--error"],["for","skill-description",1,"skill-form__label"],["id","skill-description","rows","2",1,"skill-form__input","skill-form__textarea",3,"formControl"],["for","skill-body",1,"skill-form__label"],["id","skill-body","rows","16",1,"skill-form__input","skill-form__textarea","skill-form__textarea--code",3,"formControl"],[1,"skill-form__label"],[1,"skill-form__resource-list"],["type","button",1,"skill-form__resource-btn","skill-form__resource-btn--add",3,"click"],["role","alert",1,"skill-form__error"],[1,"skill-form__actions"],["type","button",1,"skill-form__btn",3,"click"],["type","submit",1,"skill-form__btn","skill-form__btn--primary",3,"disabled"],[1,"skill-form__resource-row"],[1,"skill-form__resource-head"],["type","text","placeholder","e.g. references/checklist.md","autocomplete","off",1,"skill-form__input","skill-form__resource-path",3,"formControl"],["type","button","title","Remove",1,"skill-form__resource-btn","skill-form__resource-btn--danger",3,"click"],["rows","4",1,"skill-form__input","skill-form__textarea","skill-form__textarea--code",3,"formControl"]],template:function(e,a){e&1&&(za(0,"div",0)(1,"header",1)(2,"button",2),dc("click",function(){return a.cancel()}),za(3,"span",3),n_(4,"\u2190"),Sf(),n_(5," Skills "),Sf(),za(6,"h1",4),n_(7),Sf(),fT(8,J,2,1,"a",5),fT(9,K,2,0,"span",6),Sf(),fT(10,Q,2,0,"p",7)(11,te,34,9,"form",8),Sf()),e&2&&(yb(7),Iv(a.isEditMode()?"Edit skill":"New skill"),yb(),hT(a.isEditMode()?8:-1),yb(),hT(a.isPlatformMode?9:-1),yb(),hT(a.isLoading()?10:11));},dependencies:[Kn,zn,Ye,Ln,Wn,pn,Vn,pu],styles:[".skill-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.skill-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.skill-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}.skill-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.skill-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.skill-form__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.skill-form__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.skill-form__platform-badge[_ngcontent-%COMP%]{align-self:flex-start;font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.15rem .5rem;border:1px solid var(--color-divider, rgba(0, 0, 0, .12));color:var(--color-neutral-600, #6e6e73)}.skill-form__loading[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.skill-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.skill-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.skill-form__label[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73)}.skill-form__input[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;padding:.5rem .75rem;border:1px solid var(--color-border, rgba(0, 0, 0, .12));border-radius:0;background:var(--color-surface, #fff);color:var(--color-text, #1d1d1f);font-family:inherit;font-size:.9375rem}.skill-form__input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.skill-form__textarea[_ngcontent-%COMP%]{resize:vertical;line-height:1.5}.skill-form__textarea--code[_ngcontent-%COMP%]{font-family:var(--font-code, monospace);font-size:.8125rem}.skill-form__field-hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73)}.skill-form__field-hint--error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.skill-form__resource-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.75rem}.skill-form__resource-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.skill-form__resource-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.skill-form__resource-path[_ngcontent-%COMP%]{flex:1;font-family:var(--font-code, monospace);font-size:.8125rem}.skill-form__resource-btn[_ngcontent-%COMP%]{align-self:flex-start;background:none;border:1px solid var(--color-border, rgba(0, 0, 0, .12));padding:.3rem .6rem;cursor:pointer;font-family:inherit;font-size:.8125rem;color:var(--color-text, #1d1d1f)}.skill-form__resource-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04))}.skill-form__resource-btn--danger[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30);font-size:1rem;line-height:1;padding:.25rem .5rem}.skill-form__resource-btn--add[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}.skill-form__error[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-error, #ff3b30)}.skill-form__actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.skill-form__btn[_ngcontent-%COMP%]{padding:.5rem 1rem;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text, #1d1d1f)}.skill-form__btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04))}.skill-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.skill-form__btn--primary[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}"]})};export{U as SkillFormComponent};
@@ -0,0 +1 @@
1
+ import {l,$,v as vt,a as ve$1,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,c as bt,L as Ln,W as Wn,V as Vn,y as yn}from'./chunk-fLWaVOVo.js';import {p,H as Me,$ as $t,F as G,s as se$1,U,a as Ef,X as Ae,Y as Le,Z as R,a0 as wr,z as za,n as n_,S as Sf,f as fT,L as dc,l as lc,N as iS,y as yb,h as hT,O as tv,Q as aS,k as MT,x as xf,C as CT,I as Iv,r as gv,o as sg,q as ag,m as mT,d as yT}from'./main-OQRNUTKI.js';var h=class e{api=p(Ae);isLoading=se$1(false);result=se$1(null);errorMessage=se$1(null);invoke(t,o,a,s){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:o||void 0,toolName:a,payload:s||void 0}).pipe(Le({next:f=>{this.result.set(f),this.isLoading.set(false);},error:f=>{this.errorMessage.set(ee(f)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(o){return new(o||e)};static \u0275prov=R({token:e,factory:e.\u0275fac,providedIn:"root"})};function ee(e){if(e instanceof wr){let t=e.error;return t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:typeof t=="string"&&t.trim().length>0?t:e.statusText||`HTTP ${e.status}`}return e instanceof Error?e.message:"Unknown error"}var te=(e,t)=>t.id;function oe(e,t){e&1&&n_(0," Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins. ");}function ne(e,t){e&1&&n_(0," Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline. ");}function ie(e,t){e&1&&(za(0,"p",14),n_(1,"Loading namespaces\u2026"),Sf());}function re(e,t){if(e&1&&(za(0,"option",24),n_(1),Sf()),e&2){let o=t.$implicit;tv("value",o.id),yb(),Iv(o.name);}}function ae(e,t){if(e&1&&(za(0,"select",22)(1,"option",23),n_(2,"Select a namespace"),Sf(),mT(3,re,2,2,"option",24,te),Sf(),iS()),e&2){let o=MT(2);aS(),yb(3),yT(o.namespaces());}}function le(e,t){if(e&1&&fT(0,ie,2,0,"p",14)(1,ae,5,0,"select",22),e&2){let o=MT();hT(o.namespacesLoading()?0:1);}}function se(e,t){if(e&1&&(za(0,"p",8),n_(1),Sf()),e&2){let o=MT();yb(),xf(" ",o.namespaceName()??o.namespaceId," ");}}function de(e,t){e&1&&n_(0," Running\u2026 ");}function ce(e,t){e&1&&n_(0," Run tool ");}function me(e,t){if(e&1){let o=CT();za(0,"button",25),dc("click",function(){sg(o);let s=MT();return ag(s.reset())}),n_(1,"Clear result"),Sf();}}function pe(e,t){e&1&&(za(0,"section",20)(1,"h2",26),n_(2,"Error"),Sf(),za(3,"pre",27),n_(4),Sf()()),e&2&&(yb(4),Iv(t));}function _e(e,t){e&1&&(za(0,"h3",31),n_(1,"Metadata"),Sf(),za(2,"pre",27),n_(3),Sf()),e&2&&(yb(3),Iv(t));}function ue(e,t){if(e&1&&(za(0,"dt",33),n_(1,"Type"),Sf(),za(2,"dd",34),n_(3),Sf()),e&2){let o=MT(2);yb(3),Iv(o.errorType);}}function fe(e,t){if(e&1&&(za(0,"dt",33),n_(1,"Message"),Sf(),za(2,"dd",35),n_(3),Sf()),e&2){let o=MT(2);yb(3),Iv(o.errorMessage);}}function ve(e,t){if(e&1&&(za(0,"h3",31),n_(1,"Tool error details"),Sf(),za(2,"dl",32),fT(3,ue,4,1),fT(4,fe,4,1),Sf()),e&2){let o=MT();yb(3),hT(o.errorType?3:-1),yb(),hT(o.errorMessage?4:-1);}}function ge(e,t){if(e&1&&(za(0,"section",28)(1,"header",29)(2,"h2",26),n_(3),Sf(),za(4,"span",30),n_(5),Sf()(),za(6,"h3",31),n_(7,"Output"),Sf(),za(8,"pre",27),n_(9),Sf(),fT(10,_e,4,1),za(11,"h3",31),n_(12,"Structured output"),Sf(),za(13,"pre",27),n_(14),Sf(),fT(15,ve,5,2),Sf()),e&2){let o,a=t,s=MT();gv("tool-invoke__result--failure",!a.success),yb(3),xf("Result \u2014 ",a.toolName),yb(),gv("tool-invoke__badge--success",a.success)("tool-invoke__badge--failure",!a.success),yb(),xf(" ",a.success?"Success":"Tool error"," "),yb(4),Iv(a.output),yb(),hT((o=s.formatMetadata(a.metadata))?10:-1,o),yb(4),Iv(s.formatStructuredOutput(a.structuredOutput)??"null"),yb(),hT(a.errorType||a.errorMessage?15:-1);}}var X=class e{destroyRef=p(Me);route=p($t);namespaceController=p(G);userState=p(l);state=p(h);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=se$1([]);namespacesLoading=se$1(true);namespaceName=se$1(null);form=new $({namespaceId:new vt("",{nonNullable:true,validators:[ve$1.required]}),userId:new vt("",{nonNullable:true}),toolName:new vt("",{nonNullable:true,validators:[ve$1.required]}),payload:new vt("",{nonNullable:true})});ngOnInit(){let t=this.userState.currentUser()?.id;t?this.form.controls.userId.patchValue(t):this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:o=>{o.id&&this.form.controls.userId.patchValue(o.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:o=>{this.namespaces.set(o.map(a=>({id:a.id,name:a.name}))),this.namespacesLoading.set(false);},error:()=>this.namespacesLoading.set(false)}):(this.form.controls.namespaceId.patchValue(this.namespaceId),this.namespacesLoading.set(false),this.namespaceController.getByIdNamespace(this.namespaceId).pipe(U(this.destroyRef)).subscribe({next:o=>this.namespaceName.set(o.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:o,toolName:a,payload:s}=this.form.getRawValue();this.state.invoke(t,o.trim()||void 0,a.trim(),s.trim()||void 0).pipe(U(this.destroyRef)).subscribe();}reset(){this.state.reset();}formatMetadata(t){return !t||Object.keys(t).length===0?null:JSON.stringify(t,null,2)}formatStructuredOutput(t){return t===void 0?null:JSON.stringify(t,null,2)}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=Ef({type:e,selectors:[["agentos-tool-invoke"]],decls:42,vars:8,consts:[[1,"tool-invoke"],[1,"tool-invoke__header"],[1,"tool-invoke__title"],[1,"tool-invoke__subtitle"],[1,"tool-invoke__form",3,"ngSubmit","formGroup"],[1,"tool-invoke__field"],["for","ti-namespace",1,"tool-invoke__label"],[1,"tool-invoke__required"],["id","ti-namespace",1,"tool-invoke__namespace-static"],["for","ti-user",1,"tool-invoke__label"],[1,"tool-invoke__optional"],["id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off",1,"tool-invoke__input"],["for","ti-tool",1,"tool-invoke__label"],["id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false",1,"tool-invoke__input","tool-invoke__input--mono"],[1,"tool-invoke__hint"],["for","ti-payload",1,"tool-invoke__label"],["id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"}\\nLeave empty for tools with no input.',"spellcheck","false",1,"tool-invoke__textarea","tool-invoke__input--mono"],[1,"tool-invoke__actions"],["type","submit",1,"tool-invoke__submit",3,"disabled"],["type","button",1,"tool-invoke__reset"],[1,"tool-invoke__result","tool-invoke__result--error"],[1,"tool-invoke__result",3,"tool-invoke__result--failure"],["id","ti-namespace","formControlName","namespaceId",1,"tool-invoke__select"],["value","","disabled",""],[3,"value"],["type","button",1,"tool-invoke__reset",3,"click"],[1,"tool-invoke__result-title"],[1,"tool-invoke__output"],[1,"tool-invoke__result"],[1,"tool-invoke__result-header"],[1,"tool-invoke__badge"],[1,"tool-invoke__section-label"],[1,"tool-invoke__dl"],[1,"tool-invoke__dt"],[1,"tool-invoke__dd","tool-invoke__dd--mono"],[1,"tool-invoke__dd"]],template:function(o,a){if(o&1&&(za(0,"div",0)(1,"header",1)(2,"h1",2),n_(3,"Tool invoke"),Sf(),za(4,"p",3),fT(5,oe,1,0)(6,ne,1,0),Sf()(),za(7,"form",4),dc("ngSubmit",function(){return a.submit()}),za(8,"div",5)(9,"label",6),n_(10,"Namespace "),za(11,"span",7),n_(12,"*"),Sf()(),fT(13,le,2,1)(14,se,2,1,"p",8),Sf(),za(15,"div",5)(16,"label",9),n_(17,"User ID "),za(18,"span",10),n_(19,"(optional)"),Sf()(),lc(20,"input",11),iS(),Sf(),za(21,"div",5)(22,"label",12),n_(23,"Tool name "),za(24,"span",7),n_(25,"*"),Sf()(),lc(26,"input",13),iS(),za(27,"p",14),n_(28," Exact tool name as returned by the agent definition inspect page. When not found, the error response lists all available tools for the selected namespace. "),Sf()(),za(29,"div",5)(30,"label",15),n_(31,"Payload "),za(32,"span",10),n_(33,"(optional)"),Sf()(),lc(34,"textarea",16),iS(),Sf(),za(35,"div",17)(36,"button",18),fT(37,de,1,0)(38,ce,1,0),Sf(),fT(39,me,2,0,"button",19),Sf()(),fT(40,pe,5,1,"section",20),fT(41,ge,16,12,"section",21),Sf()),o&2){let s,f;yb(5),hT(a.isPlatformMode?5:6),yb(2),tv("formGroup",a.form),yb(6),hT(a.isPlatformMode?13:14),yb(7),aS(),yb(6),aS(),yb(8),aS(),yb(2),tv("disabled",a.form.invalid||a.state.isLoading()),yb(),hT(a.state.isLoading()?37:38),yb(2),hT(a.state.result()||a.state.errorMessage()?39:-1),yb(),hT((s=a.state.errorMessage())?40:-1,s),yb(),hT((f=a.state.result())?41:-1,f);}},dependencies:[Kn,zn,Zn,Xn,Ye,bt,Ln,Wn,Vn,yn],styles:[".tool-invoke[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.tool-invoke__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.tool-invoke__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.3rem;padding:0;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;font-family:inherit;cursor:pointer;align-self:flex-start}.tool-invoke__back[_ngcontent-%COMP%]:hover{color:var(--color-text, #1d1d1f)}.tool-invoke__namespace-static[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-surface-muted, rgba(0, 0, 0, .04));color:var(--color-text, #1d1d1f);font-size:.9375rem}.tool-invoke__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.tool-invoke__subtitle[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);line-height:1.5}.tool-invoke__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem;padding:1.5rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px}.tool-invoke__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem}.tool-invoke__label[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73)}.tool-invoke__required[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30);margin-left:.1em}.tool-invoke__optional[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.75rem}.tool-invoke__hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.tool-invoke__input[_ngcontent-%COMP%], .tool-invoke__select[_ngcontent-%COMP%], .tool-invoke__textarea[_ngcontent-%COMP%]{padding:.5rem .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-surface, #fff);color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;transition:border-color .15s ease}.tool-invoke__input[_ngcontent-%COMP%]:focus, .tool-invoke__select[_ngcontent-%COMP%]:focus, .tool-invoke__textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.tool-invoke__input--mono[_ngcontent-%COMP%], .tool-invoke__select--mono[_ngcontent-%COMP%], .tool-invoke__textarea--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.tool-invoke__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:120px}.tool-invoke__select[_ngcontent-%COMP%]{cursor:pointer}.tool-invoke__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;padding-top:.25rem}.tool-invoke__submit[_ngcontent-%COMP%]{padding:.55rem 1.25rem;border-radius:8px;border:none;background:var(--color-primary, #007aff);color:#fff;font-size:.9375rem;font-weight:500;font-family:inherit;cursor:pointer;transition:opacity .15s ease}.tool-invoke__submit[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.tool-invoke__submit[_ngcontent-%COMP%]:not(:disabled):hover{opacity:.88}.tool-invoke__reset[_ngcontent-%COMP%]{padding:.55rem 1rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;font-family:inherit;cursor:pointer}.tool-invoke__reset[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.tool-invoke__result[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px}.tool-invoke__result--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30);background:var(--color-error-bg, #fff5f5)}.tool-invoke__result--failure[_ngcontent-%COMP%]{border-color:var(--color-warning, #ff9500);background:var(--color-warning-bg, #fffaf0)}.tool-invoke__result-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.tool-invoke__result-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.tool-invoke__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500}.tool-invoke__badge--success[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.tool-invoke__badge--failure[_ngcontent-%COMP%]{background:var(--color-warning-bg, #fff3cd);color:var(--color-warning, #ff9500)}.tool-invoke__section-label[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);text-transform:uppercase;letter-spacing:.04em}.tool-invoke__output[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:500px;overflow-y:auto}.tool-invoke__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.4rem 1rem;margin:0}.tool-invoke__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:start}.tool-invoke__dd[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text, #1d1d1f);word-break:break-word}.tool-invoke__dd--mono[_ngcontent-%COMP%]{font-family:monospace}"]})};export{X as ToolInvokeComponent};
@@ -0,0 +1,2 @@
1
+ import {v}from'./chunk-Cs6CLQoM.js';import {R,q,J}from'./chunk-DrzCxadB.js';import {p,$ as $t,g as It,H as Me,s as se$1,a2 as F,M as Mi,j as Tg,U,K as x,J as w,a as Ef,z as za,L as dc,n as n_,S as Sf,f as fT,y as yb,I as Iv,h as hT,C as CT,m as mT,a5 as gT,N as iS,l as lc,k as MT,O as tv,Q as aS,d as yT,x as xf,a4 as lT,o as sg,q as ag,G as GT,u as uc}from'./main-OQRNUTKI.js';import {v as vt,a as ve,$,K as Kn,z as zn,Z as Zn,X as Xn,Y as Ye,c as bt,e as fn,L as Ln,W as Wn,b as pn,V as Vn}from'./chunk-fLWaVOVo.js';import'./chunk-BRsEbvq8.js';function se(i,t){i&1&&(za(0,"p",5),n_(1,"Loading\u2026"),Sf());}function ce(i,t){if(i&1&&(za(0,"label",23),lc(1,"input",24),iS(),za(2,"span"),n_(3),Sf()()),i&2){let e=t.$implicit,o=MT(3);yb(),tv("formControl",o.scopeControl)("value",e.value)("disabled",e.value==="namespace"&&!o.isAdmin()),aS(),yb(2),Iv(e.label);}}function de(i,t){if(i&1&&(za(0,"fieldset",8)(1,"legend",22),n_(2,"Configuration scope"),Sf(),mT(3,ce,4,4,"label",23,lT().trackByScope,true),Sf()),i&2){let e=MT(2);tv("disabled",e.isEditMode()),yb(3),yT(e.scopeOptions);}}function ue(i,t){if(i&1&&(za(0,"option",13),n_(1),Sf()),i&2){let e=t.$implicit,o=MT(2);tv("value",e),yb(),Iv(o.authTypeLabel[e]);}}function pe(i,t){i&1&&n_(0," Leave a field unchanged to keep the stored credential. ");}function he(i,t){i&1&&(za(0,"span",11),n_(1,"*"),Sf());}function me(i,t){if(i&1&&(za(0,"p",28),n_(1),Sf()),i&2){let e=MT(2).$implicit;tv("id","as-hint-"+e.key),yb(),Iv(e.hint);}}function ge(i,t){if(i&1&&(lc(0,"input",27),iS(),fT(1,me,2,2,"p",28)),i&2){let e=MT().$implicit;GT("auth-setting-form__input"+(e.secret?" auth-setting-form__input--secret":"")),tv("id","as-cred-"+e.key)("type",e.secret?"password":"text")("placeholder",e.placeholder)("formControl",t)("autocomplete",e.secret?"new-password":"off"),uc("aria-describedby",e.hint?"as-hint-"+e.key:null),aS(),yb(),hT(e.hint?1:-1);}}function Ce(i,t){if(i&1&&(za(0,"div",9)(1,"label",26),n_(2),fT(3,he,2,0,"span",11),Sf(),fT(4,ge,2,9),Sf()),i&2){let e,o=t.$implicit,l=MT(3);yb(),tv("for","as-cred-"+o.key),yb(),xf(" ",o.label," "),yb(),hT(o.required?3:-1),yb(),hT((e=l.controlForField(o.key))?4:-1,e);}}function fe(i,t){if(i&1&&(za(0,"fieldset",18)(1,"legend",22),n_(2,"Credentials"),Sf(),za(3,"p",25),n_(4," Values are stored encrypted and masked on read. "),fT(5,pe,1,0),Sf(),mT(6,Ce,5,4,"div",9,lT().trackByField,true),Sf()),i&2){let e=MT(2);yb(5),hT(e.isEditMode()?5:-1),yb(),yT(e.credentialFields());}}function ye(i,t){if(i&1){let e=CT();za(0,"form",7),dc("ngSubmit",function(){sg(e);let l=MT();return ag(l.submit())}),fT(1,de,5,1,"fieldset",8),za(2,"div",9)(3,"label",10),n_(4,"Auth type "),za(5,"span",11),n_(6,"*"),Sf()(),za(7,"select",12),mT(8,ue,2,2,"option",13,gT),Sf(),iS(),Sf(),za(10,"div",9)(11,"label",14),n_(12,"Name "),za(13,"span",11),n_(14,"*"),Sf()(),lc(15,"input",15),iS(),Sf(),za(16,"div",9)(17,"label",16),n_(18,"Description"),Sf(),lc(19,"input",17),iS(),Sf(),fT(20,fe,8,1,"fieldset",18),za(21,"div",19)(22,"button",20),n_(23),Sf(),za(24,"button",21),dc("click",function(){sg(e);let l=MT();return ag(l.cancel())}),n_(25,"Cancel"),Sf()()();}if(i&2){let e=MT();tv("formGroup",e.form),yb(),hT(e.isPlatformMode?-1:1),yb(6),tv("formControl",e.authTypeControl),aS(),yb(),yT(e.authTypeOptions),yb(7),tv("formControl",e.nameControl),aS(),yb(4),tv("formControl",e.descriptionControl),aS(),yb(),hT(e.credentialFields().length>0?20:-1),yb(2),tv("disabled",e.form.invalid||e.isSubmitting()),yb(),xf(" ",e.isEditMode()?"Save changes":"Create"," ");}}var _e=new Set(["namespace","userOnNs","userGlobal"]),P=Object.freeze({platform:"Platform (read-only)",namespace:"Namespace configuration",userOnNs:"Personal \u2014 this namespace only",userGlobal:"Personal \u2014 all namespaces"}),Se={ApiKeyAuthSetting:[{key:"apiKey",label:"API Key",placeholder:"sk-\u2026",secret:true,required:false}],BasicAuthAuthSetting:[{key:"username",label:"Username",placeholder:"user@example.com",secret:false,required:false},{key:"password",label:"Password",placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",secret:true,required:false}],BearerTokenAuthSetting:[{key:"token",label:"Bearer token",placeholder:"eyJ\u2026",secret:true,required:false}],OAuthDiscoverableAuthSetting:[{key:"discoveryUrl",label:"Discovery URL",placeholder:"https://\u2026/.well-known/openid-configuration",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthCustomAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthRegisteredAuthSetting:[{key:"authorizationUrl",label:"Authorization URL",placeholder:"https://\u2026/authorize",secret:false,required:false},{key:"tokenUrl",label:"Token URL",placeholder:"https://\u2026/token",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Space-separated OAuth scopes to request (e.g. openid profile email). Check your provider's documentation for the exact values.",secret:false,required:false}],OAuthMcpDiscoverableAuthSetting:[{key:"resourceUrl",label:"Resource URL",placeholder:"https://mcp.example.com",hint:"Use the base URL exactly as documented by your provider \u2014 do not append a path suffix. Examples: https://mcp.hubspot.com (HubSpot), https://mcp.atlassian.com/v1/mcp (Atlassian).",secret:false,required:false},{key:"clientId",label:"Client ID",placeholder:"",hint:"Leave empty to let the server register an OAuth client automatically (RFC 7591 dynamic registration). Fill in only if you have a pre-registered client ID from your provider.",secret:false,required:false},{key:"clientSecret",label:"Client secret",placeholder:"",secret:true,required:false},{key:"scopes",label:"Scopes",placeholder:"",hint:"Leave empty in most cases \u2014 the MCP server declares the required scopes itself. Fill in only if your provider explicitly requires client-declared scopes.",secret:false,required:false}]},le=class i{route=p($t);router=p(It);destroyRef=p(Me);state=p(R);namespaceRole=p(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;isAdmin=this.isPlatformMode?se$1(true):F(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:false});authTypeOptions=q;authTypeLabel=J;scopeOptions=[{value:"namespace",label:P.namespace},{value:"userOnNs",label:P.userOnNs},{value:"userGlobal",label:P.userGlobal}];nameControl=new vt("",{nonNullable:true,validators:[ve.required,ve.minLength(1)]});descriptionControl=new vt(null);authTypeControl=new vt("ApiKeyAuthSetting",{nonNullable:true,validators:[ve.required]});scopeControl=new vt("namespace",{nonNullable:true});form=new $({name:this.nameControl,description:this.descriptionControl,authType:this.authTypeControl,scope:this.scopeControl});apiKeyControl=new vt("",{nonNullable:true});usernameControl=new vt("",{nonNullable:true});passwordControl=new vt("",{nonNullable:true});tokenControl=new vt("",{nonNullable:true});discoveryUrlControl=new vt("",{nonNullable:true});authorizationUrlControl=new vt("",{nonNullable:true});tokenUrlControl=new vt("",{nonNullable:true});clientIdControl=new vt("",{nonNullable:true});clientSecretControl=new vt("",{nonNullable:true});scopesControl=new vt("",{nonNullable:true});resourceUrlControl=new vt("",{nonNullable:true});selectedAuthType=F(this.authTypeControl.valueChanges,{initialValue:this.authTypeControl.value});credentialFields=Mi(()=>Se[this.selectedAuthType()]);isEditMode=se$1(false);isSubmitting=se$1(false);isLoading=se$1(false);existingConfig=null;initialCredentials={};constructor(){this.isPlatformMode||Tg(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,o=t.get("authSettingId");if(o){this.isEditMode.set(true),this.scopeControl.disable(),this.authTypeControl.disable(),this.loadConfig(o);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let l=this.parseScope(e.get("scope"));this.scopeControl.setValue(l);let v=e.get("template");v&&this.hydrateFromTemplate(v);}parseScope(t){return t&&_e.has(t)?t:"namespace"}deriveScopeFromConfig(t){return !t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[AuthSettingForm] Could not load auth setting '${t}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(t){this.isLoading.set(true),this.state.getById(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.authTypeControl.setValue(e.authType),this.clearCredentialControls(),this.initialCredentials={},this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:e=>{console.warn(`[AuthSettingForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(t){switch(this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.authTypeControl.setValue(t.authType),this.clearCredentialControls(),this.initialCredentials={},t.authType){case "ApiKeyAuthSetting":{let e=t.apiKey??"";this.apiKeyControl.setValue(e),this.initialCredentials.apiKey=e;break}case "BasicAuthAuthSetting":{let e=t,o=e.username??"",l=e.password??"";this.usernameControl.setValue(o),this.passwordControl.setValue(l),this.initialCredentials.username=o,this.initialCredentials.password=l;break}case "BearerTokenAuthSetting":{let e=t.token??"";this.tokenControl.setValue(e),this.initialCredentials.token=e;break}case "OAuthDiscoverableAuthSetting":{let e=t;this.discoveryUrlControl.setValue(e.discoveryUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.discoveryUrl=e.discoveryUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthCustomAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthRegisteredAuthSetting":{let e=t;this.authorizationUrlControl.setValue(e.authorizationUrl??""),this.tokenUrlControl.setValue(e.tokenUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.authorizationUrl=e.authorizationUrl??"",this.initialCredentials.tokenUrl=e.tokenUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}case "OAuthMcpDiscoverableAuthSetting":{let e=t;this.resourceUrlControl.setValue(e.resourceUrl??""),this.clientIdControl.setValue(e.clientId??""),this.clientSecretControl.setValue(e.clientSecret??""),this.scopesControl.setValue(e.scopes??""),this.initialCredentials.resourceUrl=e.resourceUrl??"",this.initialCredentials.clientId=e.clientId??"",this.initialCredentials.clientSecret=e.clientSecret??"",this.initialCredentials.scopes=e.scopes??"";break}}}clearCredentialControls(){this.apiKeyControl.setValue(""),this.usernameControl.setValue(""),this.passwordControl.setValue(""),this.tokenControl.setValue(""),this.discoveryUrlControl.setValue(""),this.authorizationUrlControl.setValue(""),this.tokenUrlControl.setValue(""),this.clientIdControl.setValue(""),this.clientSecretControl.setValue(""),this.scopesControl.setValue(""),this.resourceUrlControl.setValue("");}credentialValue(t,e){if(!(this.isEditMode()&&e===this.initialCredentials[t]))return e||void 0}submit(){if(this.form.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let t=this.nameControl.value.trim(),e=this.descriptionControl.value?.trim()||void 0,o=this.authTypeControl.value,l=this.form.getRawValue().scope,v=this.isPlatformMode?null:this.namespaceId??null,w=this.buildTypedPayload(o,t,e);(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,w,this.existingConfig):this.state.create(w,l,v)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}buildTypedPayload(t,e,o){let l={name:e,description:o};switch(t){case "ApiKeyAuthSetting":return x(w({},l),{authType:"ApiKeyAuthSetting",apiKey:this.credentialValue("apiKey",this.apiKeyControl.value)});case "BasicAuthAuthSetting":return x(w({},l),{authType:"BasicAuthAuthSetting",username:this.credentialValue("username",this.usernameControl.value),password:this.credentialValue("password",this.passwordControl.value)});case "BearerTokenAuthSetting":return x(w({},l),{authType:"BearerTokenAuthSetting",token:this.credentialValue("token",this.tokenControl.value)});case "OAuthDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthDiscoverableAuthSetting",discoveryUrl:this.credentialValue("discoveryUrl",this.discoveryUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthCustomAuthSetting":return x(w({},l),{authType:"OAuthCustomAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthRegisteredAuthSetting":return x(w({},l),{authType:"OAuthRegisteredAuthSetting",authorizationUrl:this.credentialValue("authorizationUrl",this.authorizationUrlControl.value),tokenUrl:this.credentialValue("tokenUrl",this.tokenUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)});case "OAuthMcpDiscoverableAuthSetting":return x(w({},l),{authType:"OAuthMcpDiscoverableAuthSetting",resourceUrl:this.credentialValue("resourceUrl",this.resourceUrlControl.value),clientId:this.credentialValue("clientId",this.clientIdControl.value),clientSecret:this.credentialValue("clientSecret",this.clientSecretControl.value),scopes:this.credentialValue("scopes",this.scopesControl.value)})}}controlForField(t){return {apiKey:this.apiKeyControl,username:this.usernameControl,password:this.passwordControl,token:this.tokenControl,discoveryUrl:this.discoveryUrlControl,authorizationUrl:this.authorizationUrlControl,tokenUrl:this.tokenUrlControl,clientId:this.clientIdControl,clientSecret:this.clientSecretControl,scopes:this.scopesControl,resourceUrl:this.resourceUrlControl}[t]}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","auth-settings"]):this.router.navigate(["/agentos",this.namespaceId,"auth-settings"]);}trackByScope(t,e){return e.value}trackByField(t,e){return e.key}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=Ef({type:i,selectors:[["agentos-auth-setting-form"]],decls:10,vars:2,consts:[[1,"auth-setting-form"],[1,"auth-setting-form__header"],["type","button","title","Back to auth settings",1,"auth-setting-form__back",3,"click"],[1,"auth-setting-form__back-icon"],[1,"auth-setting-form__title"],[1,"auth-setting-form__loading"],[1,"auth-setting-form__form",3,"formGroup"],[1,"auth-setting-form__form",3,"ngSubmit","formGroup"],[1,"auth-setting-form__scope",3,"disabled"],[1,"auth-setting-form__field"],["for","as-auth-type",1,"auth-setting-form__label"],["aria-hidden","true"],["id","as-auth-type",1,"auth-setting-form__select",3,"formControl"],[3,"value"],["for","as-name",1,"auth-setting-form__label"],["id","as-name","type","text","placeholder","e.g. GitHub OAuth App","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],["for","as-description",1,"auth-setting-form__label"],["id","as-description","type","text","placeholder","Optional \u2014 short description of this auth setting","autocomplete","off",1,"auth-setting-form__input",3,"formControl"],[1,"auth-setting-form__credentials"],[1,"auth-setting-form__actions"],["type","submit",1,"auth-setting-form__btn","auth-setting-form__btn--primary",3,"disabled"],["type","button",1,"auth-setting-form__btn",3,"click"],[1,"auth-setting-form__label"],[1,"auth-setting-form__scope-option"],["type","radio",3,"formControl","value","disabled"],[1,"auth-setting-form__credentials-hint"],[1,"auth-setting-form__label",3,"for"],[3,"id","type","placeholder","formControl","autocomplete"],[1,"auth-setting-form__field-hint",3,"id"]],template:function(e,o){e&1&&(za(0,"div",0)(1,"header",1)(2,"button",2),dc("click",function(){return o.cancel()}),za(3,"span",3),n_(4,"\u2190"),Sf(),n_(5," Auth Settings "),Sf(),za(6,"h1",4),n_(7),Sf()(),fT(8,se,2,0,"p",5)(9,ye,26,8,"form",6),Sf()),e&2&&(yb(7),Iv(o.isEditMode()?"Edit auth setting":"New auth setting"),yb(),hT(o.isLoading()?8:9));},dependencies:[Kn,zn,Zn,Xn,Ye,bt,fn,Ln,Wn,pn,Vn],styles:[".auth-setting-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding:1.5rem;max-width:640px}.auth-setting-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;background:none;border:none;cursor:pointer;color:var(--color-text-secondary);font-size:.85rem;padding:0}.auth-setting-form__back[_ngcontent-%COMP%]:hover{color:var(--color-primary)}.auth-setting-form__back-icon[_ngcontent-%COMP%]{font-size:1rem}.auth-setting-form__title[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:600;color:var(--color-text);margin:0}.auth-setting-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem}.auth-setting-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.auth-setting-form__scope[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem;display:flex;flex-direction:column;gap:.5rem}.auth-setting-form__scope[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__scope-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;font-size:.9rem;color:var(--color-text)}.auth-setting-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.auth-setting-form__field-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);margin:0;line-height:1.4}.auth-setting-form__label[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500;color:var(--color-text-secondary)}.auth-setting-form__input[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;transition:border-color .15s ease;width:100%;box-sizing:border-box}.auth-setting-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__input--secret[_ngcontent-%COMP%]{font-family:monospace;letter-spacing:.05em}.auth-setting-form__select[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem .75rem;background:var(--color-bg-secondary);color:var(--color-text);font-size:.9rem;outline:none;cursor:pointer;transition:border-color .15s ease}.auth-setting-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.auth-setting-form__credentials[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:8px;padding:.75rem 1rem 1rem;display:flex;flex-direction:column;gap:.75rem;margin:0}.auth-setting-form__credentials[_ngcontent-%COMP%] legend[_ngcontent-%COMP%]{padding:0 .25rem}.auth-setting-form__credentials-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);margin:0}.auth-setting-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center;padding-top:.5rem}.auth-setting-form__btn[_ngcontent-%COMP%]{border:1px solid var(--color-border);border-radius:6px;padding:.5rem 1.25rem;cursor:pointer;font-size:.9rem;font-weight:500;background:var(--color-bg-secondary);color:var(--color-text);transition:background .15s ease}.auth-setting-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover)}.auth-setting-form__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.auth-setting-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-on-primary, #fff);border-color:var(--color-primary)}.auth-setting-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, var(--color-primary))}"]})};
2
+ export{le as AuthSettingFormComponent};