@whoz-oss/coday-client 0.0.0-workstream-forge.231 → 0.0.0-workstream-forge.233

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 (85) hide show
  1. package/browser/chunk-BEtE9u4S.js +1 -0
  2. package/browser/chunk-BHFL0zBW.js +1 -0
  3. package/browser/{chunk-CbFj_KVb.js → chunk-BL4O5z35.js} +1 -1
  4. package/browser/chunk-BRhYc841.js +2 -0
  5. package/browser/chunk-BSCoGKQH.js +1 -0
  6. package/browser/chunk-BSwOttIr.js +1 -0
  7. package/browser/chunk-BTyI5T9m.js +1 -0
  8. package/browser/chunk-BUAyDXTF.js +1 -0
  9. package/browser/{chunk-DXfFvlbW.js → chunk-BeFHuscX.js} +1 -1
  10. package/browser/chunk-BhiMaXTc.js +1 -0
  11. package/browser/chunk-BmWGkbfS.js +1 -0
  12. package/browser/chunk-BvB8BwW-.js +1 -0
  13. package/browser/chunk-BxyJxLnM.js +1 -0
  14. package/browser/chunk-By1CBVie.js +1 -0
  15. package/browser/chunk-ByIZOfZp.js +1 -0
  16. package/browser/chunk-CGIofH1S.js +1 -0
  17. package/browser/{chunk-DsLxDKjQ.js → chunk-CW0Xz9Gc.js} +1 -1
  18. package/browser/chunk-CXeXS2-8.js +1 -0
  19. package/browser/chunk-CkYlNhz9.js +1 -0
  20. package/browser/chunk-Cs_kiN3M.js +1 -0
  21. package/browser/chunk-D-GH6Vwh.js +1 -0
  22. package/browser/{chunk-DSPqMM_J.js → chunk-D25q4NMm.js} +1 -1
  23. package/browser/chunk-D4MihuHS.js +1 -0
  24. package/browser/chunk-D4Ru-LHQ.js +1 -0
  25. package/browser/chunk-D73N8VqQ.js +1 -0
  26. package/browser/chunk-D98SYWQ_.js +1 -0
  27. package/browser/{chunk-DuTuhgB1.js → chunk-DAJa9g45.js} +1 -1
  28. package/browser/chunk-DDqlkc9R.js +1 -0
  29. package/browser/chunk-DFBrAyo5.js +1 -0
  30. package/browser/chunk-DKNVANEr.js +1 -0
  31. package/browser/{chunk-D7Bi0wQe.js → chunk-DLa-RTUD.js} +1 -1
  32. package/browser/chunk-DPJF32r4.js +1 -0
  33. package/browser/{chunk-BTVosZlm.js → chunk-DPZEV56F.js} +1 -1
  34. package/browser/chunk-DQpYayn2.js +2 -0
  35. package/browser/chunk-DU2T72t1.js +674 -0
  36. package/browser/chunk-Df9nff1i.js +1 -0
  37. package/browser/{chunk-BdcXD8r2.js → chunk-DgP8Uad-.js} +1 -1
  38. package/browser/{chunk-Bx0NEc6t.js → chunk-Dje4hFK9.js} +1 -1
  39. package/browser/chunk-DofPUUm1.js +1 -0
  40. package/browser/chunk-DrUGsskB.js +1 -0
  41. package/browser/chunk-DrtsXIGf.js +1 -0
  42. package/browser/chunk-SfXGcx_u.js +2 -0
  43. package/browser/chunk-ZSYVOgwG.js +1 -0
  44. package/browser/chunk-k4Z-nQ9G.js +1 -0
  45. package/browser/{chunk-C3aDeufh.js → chunk-oglfMLBg.js} +1 -1
  46. package/browser/chunk-vbsIYZk_.js +1 -0
  47. package/browser/index.html +1 -1
  48. package/browser/{main-KD2BFLOW.js → main-WGM2SCAZ.js} +17 -17
  49. package/package.json +1 -1
  50. package/browser/chunk-8QzmmZxx.js +0 -1
  51. package/browser/chunk-B8lQiYrl.js +0 -1
  52. package/browser/chunk-BGFq838P.js +0 -1
  53. package/browser/chunk-BN-jkVWq.js +0 -1
  54. package/browser/chunk-BT9ydLH6.js +0 -2
  55. package/browser/chunk-BbtGMMKD.js +0 -1
  56. package/browser/chunk-Bk7l5aey.js +0 -1
  57. package/browser/chunk-BvO6WgcN.js +0 -2
  58. package/browser/chunk-BzzohX58.js +0 -1
  59. package/browser/chunk-C-w4ff8o.js +0 -1
  60. package/browser/chunk-C5dMauIn.js +0 -1
  61. package/browser/chunk-C9lZl1M2.js +0 -1
  62. package/browser/chunk-CGAwBErw.js +0 -1
  63. package/browser/chunk-CSjIaAEl.js +0 -1
  64. package/browser/chunk-CUJ0vffn.js +0 -1
  65. package/browser/chunk-Cba4he8B.js +0 -1
  66. package/browser/chunk-CirZuytZ.js +0 -1
  67. package/browser/chunk-CwQOg_Cf.js +0 -1
  68. package/browser/chunk-CyO4h_4p.js +0 -1
  69. package/browser/chunk-DDSOLg4o.js +0 -1
  70. package/browser/chunk-DQGrYB02.js +0 -2
  71. package/browser/chunk-D_dXBade.js +0 -1
  72. package/browser/chunk-Df8Mmk0a.js +0 -1
  73. package/browser/chunk-Dj8n77fK.js +0 -1
  74. package/browser/chunk-DkzlrId2.js +0 -1
  75. package/browser/chunk-DlvXf54E.js +0 -674
  76. package/browser/chunk-DwBZ8Z_r.js +0 -1
  77. package/browser/chunk-E46_f3PR.js +0 -1
  78. package/browser/chunk-FXeGxG1k.js +0 -1
  79. package/browser/chunk-Py6Xwfdb.js +0 -1
  80. package/browser/chunk-Rpwj_4-b.js +0 -1
  81. package/browser/chunk-_1v9c4EP.js +0 -1
  82. package/browser/chunk-jPo9er7c.js +0 -1
  83. package/browser/chunk-lAoLPd_T.js +0 -1
  84. package/browser/chunk-qPqD_h5H.js +0 -1
  85. package/browser/chunk-tOJzhNQY.js +0 -1
@@ -1 +0,0 @@
1
- import {a1 as fa,a2 as da,aa as Tr,aD as $y}from'./main-KD2BFLOW.js';function i(t,o,p){return t.pipe(fa(()=>o().pipe(da(()=>Tr(p)))),$y({bufferSize:1,refCount:true}))}export{i};
@@ -1 +0,0 @@
1
- import {f,a6 as id,n as nd,L as Lt,m as mo,c as po,a7 as so,a8 as da,a9 as ra,d as pn,h as hn,e as cn,C as mn,i as at,j as an,I as Io,aa as f$1}from'./chunk-DlvXf54E.js';import {g,W,aM as Y,U as Ui,ab as le,q as Af,y as yw,aN as hb,D as Ds,l as lg,L as Lw,p as pl,a as BE,j as jw,ak as md,a1 as fa,a3 as nn,ac as Ty,a2 as da$1,N as NC,Z as Zw,Q as mg,aO as Bg,_ as _I,J as Jw,aP as jg,R as NI,H as Hw,m as Uw,aQ as $C,aR as UC,O as Og,k as cg,av as zC,aw as WC,as as kg,v as vl,aS as qC,r as df,s as ff,aT as FC}from'./main-KD2BFLOW.js';var ce=e=>({title:"By agent",rows:e}),pe=e=>({title:"By model",rows:e}),ge=(e,a)=>[e,a],ue=(e,a)=>a.title,_e=(e,a)=>a.key;function Ce(e,a){e&1&&(Ds(0,"p",2),NC(1,"Loading usage settings\u2026"),pl());}function fe(e,a){if(e&1){let t=Zw();Ds(0,"ds-notice"),NC(1,"Could not load usage settings. Please try again."),pl(),Ds(2,"div")(3,"button",3),mg("click",function(){df(t);let s=Jw();return ff(s.configuration.retry())}),NC(4,"Retry usage settings"),pl()();}}function ye(e,a){e&1&&(Ds(0,"p",2),NC(1,"Usage tracking is disabled."),pl());}function be(e,a){e&1&&(Ds(0,"ds-notice"),NC(1),pl()),e&2&&(BE(),Og(a));}function xe(e,a){e&1&&(Ds(0,"p",2),NC(1,"Loading usage\u2026"),pl());}function he(e,a){e&1&&(Ds(0,"p",12),NC(1,"No recorded usage for this period."),pl());}function Se(e,a){if(e&1&&(Ds(0,"p",10),NC(1),pl()),e&2){let t=Jw().$implicit;BE(),vl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Ds(0,"tr",16)(1,"td",18),NC(2),pl(),Ds(3,"td",19),NC(4),zC(5,"number"),pl(),Ds(6,"td",20),NC(7),zC(8,"number"),zC(9,"number"),pl(),Ds(10,"td",21),NC(11),zC(12,"number"),zC(13,"number"),pl(),Ds(14,"td",22),NC(15),zC(16,"agentosCost"),Lw(17,Se,2,1,"p",10),pl()()),e&2){let t=a.$implicit;BE(2),Og(t.key),BE(2),Og(WC(5,8,t.aggregate.totalTokens)),BE(3),kg(" ",WC(8,10,t.aggregate.inputTokens)," / ",WC(9,12,t.aggregate.outputTokens)," "),BE(4),kg(" ",WC(12,14,t.aggregate.cacheReadTokens)," / ",WC(13,16,t.aggregate.cacheWriteTokens)," "),BE(4),vl(" ",qC(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),BE(2),jw(t.aggregate.unknownCostCount>0?17:-1);}}function ve(e,a){if(e&1&&(Ds(0,"div",13)(1,"table",14)(2,"thead",15)(3,"tr",16)(4,"th",17),NC(5,"Name"),pl(),Ds(6,"th",17),NC(7,"Tokens"),pl(),Ds(8,"th",17),NC(9,"Input / output"),pl(),Ds(10,"th",17),NC(11,"Cache read / write"),pl(),Ds(12,"th",17),NC(13,"Estimated cost"),pl()()(),Ds(14,"tbody",15),Hw(15,we,18,21,"tr",16,_e),pl()()()),e&2){let t=Jw().$implicit;BE(),cg("aria-label","Usage "+t.title.toLowerCase()),BE(14),Uw(t.rows);}}function Ne(e,a){if(e&1&&(Ds(0,"h3",11),NC(1),pl(),Lw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;BE(),Og(t.title),BE(),jw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&(Hw(0,Ne,4,2,null,null,ue),Ds(2,"p",10),NC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),pl()),e&2){let t=Jw(2);Uw($C(4,ge,UC(0,ce,t.agents()),UC(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=Zw();Ds(0,"form",4),mg("ngSubmit",function(){df(t);let s=Jw();return ff(s.load())}),Ds(1,"ds-form-field",5)(2,"input",6),Bg("ngModelChange",function(s){df(t);let m=Jw();return FC(m.from,s)||(m.from=s),ff(s)}),pl(),_I(),pl(),Ds(3,"ds-form-field",7)(4,"input",8),Bg("ngModelChange",function(s){df(t);let m=Jw();return FC(m.to,s)||(m.to=s),ff(s)}),pl(),_I(),pl(),Ds(5,"button",9),NC(6,"Refresh"),pl()(),Lw(7,be,2,1,"ds-notice"),Lw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=Jw();BE(2),jg("ngModel",r.from),NI(),BE(2),jg("ngModel",r.to),NI(),BE(3),jw((t=r.error())?7:-1,t),BE(),jw(r.loading()?8:r.error()?-1:9);}}var me=class e{route=g(W);api=g(Y);configuration=g(f);namespaceId=this.route.snapshot.params.namespaceId;agents=Ui([]);models=Ui([]);error=Ui(null);loading=Ui(false);from=new Date(Date.now()-30*864e5).toISOString().slice(0,10);to=new Date().toISOString().slice(0,10);refresh=new le;constructor(){Af(a=>{if(!this.configuration.enabled())return;let t=this.refresh.pipe(md(void 0),fa(()=>{this.error.set(null),this.agents.set([]),this.models.set([]);let r=new Date(`${this.from}T00:00:00.000Z`),s=new Date(`${this.to}T23:59:59.999Z`);return !Number.isFinite(r.getTime())||!Number.isFinite(s.getTime())||r>s?(this.error.set("Select a valid date range."),this.loading.set(false),nn):(this.loading.set(true),Ty({agents:this.api.aggregateByAgentUsageRecord(this.namespaceId,r.toISOString(),s.toISOString()),models:this.api.aggregateByModelUsageRecord(this.namespaceId,r.toISOString(),s.toISOString())}).pipe(da$1(m=>(this.loading.set(false),this.error.set(m.status===403?"Namespace admin permission is required to view this report.":"Could not load usage. Please try again."),nn))))})).subscribe(({agents:r,models:s})=>{this.agents.set(r),this.models.set(s),this.loading.set(false);});a(()=>t.unsubscribe());});}load(){this.configuration.enabled()&&this.refresh.next();}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=yw({type:e,selectors:[["agentos-namespace-usage"]],decls:6,vars:1,consts:[["full",""],["title","Usage and costs","description","Recorded LLM usage across this namespace. Costs are estimates in the platform currency."],["role","status",1,"settings-table__status"],["dsButton","","type","button",3,"click"],[1,"ds-inline","ds-inline--wrap","ds-inline--end",3,"ngSubmit"],["label","From (UTC)","controlId","usage-from"],["dsControl","","id","usage-from","type","date","name","from","required","",3,"ngModelChange","ngModel"],["label","To (UTC)","controlId","usage-to"],["dsControl","","id","usage-to","type","date","name","to","required","",3,"ngModelChange","ngModel"],["dsButton","","variant","primary","type","submit"],[1,"ds-hint"],[1,"ds-micro"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table"],["role","rowgroup"],["role","row"],["role","columnheader"],["role","cell","data-label","Name","data-title","",1,"settings-table__name"],["role","cell","data-label","Tokens"],["role","cell","data-label","Input / output"],["role","cell","data-label","Cache read / write"],["role","cell","data-label","Estimated cost"]],template:function(t,r){t&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Lw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),pl()),t&2&&(BE(2),jw(r.configuration.state()==="loading"?2:r.configuration.state()==="error"?3:r.configuration.state()==="disabled"?4:5));},dependencies:[id,nd,Lt,mo,po,so,da,ra,pn,hn,cn,mn,at,an,Io,hb,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
@@ -1 +0,0 @@
1
- import {y}from'./chunk-DlvXf54E.js';import {g,aB as se,aC as T,aa as Tr,a1 as fa,ad as ne,a2 as da,aD as $y,a6 as x}from'./main-KD2BFLOW.js';var v=class i{userState=g(y);membership=g(se);currentUser$=T(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return Tr(false);let t=this.cache.get(e);if(t)return t;let s=this.currentUser$.pipe(fa(a=>a?a.isAdmin?Tr(true):this.membership.getMembersNamespaceMembership(e).pipe(ne(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),da(()=>Tr(false))):Tr(false)),$y({bufferSize:1,refCount:false}));return this.cache.set(e,s),s}static \u0275fac=function(t){return new(t||i)};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v};
@@ -1 +0,0 @@
1
- import {v}from'./chunk-CyO4h_4p.js';import {I}from'./chunk-D7Bi0wQe.js';import {O}from'./chunk-Bx0NEc6t.js';import {g,W,F,I as Ie$1,a8 as _,a9 as F$1,aa as Tr,U as Ui,ab as le,X as XC,a1 as fa,G as U,q as Af,ac as Ty,y as yw,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,j as jw,a2 as da,ad as ne,Z as Zw,H as Hw,ae as Fw,_ as _I,l as lg,J as Jw,m as Uw,R as NI,v as vl,O as Og,r as df,s as ff}from'./main-KD2BFLOW.js';import {p as pt,T as Te$1,a as fn,d as pn,h as hn,e as cn,r as ln,g as dn,o as on,i as at,j as an,t as rn,U as Ut,n as nd,b as bo,x as xo,L as Lt,u as vn,G as Gt,w as pa,m as mo,c as po,V as Vn,A as An,W as Wt}from'./chunk-DlvXf54E.js';import'./chunk-CirZuytZ.js';var be=(i,e)=>e.value;function _e(i,e){i&1&&(Ds(0,"p",2),NC(1,"Loading\u2026"),pl());}function xe(i,e){if(i&1&&(Ds(0,"label",6),lg(1,"input",22),_I(),NC(2),pl()),i&2){let t=e.$implicit,n=Jw(2);BE(),ug("value",t.value)("formControl",n.scopeControl)("disabled",t.value==="namespace"&&!n.isAdmin()),NI(),BE(),vl(" ",t.label," ");}}function Ie(i,e){if(i&1&&(Ds(0,"option",10),NC(1),pl()),i&2){let t=e.$implicit;ug("value",t.type),BE(),Og(t.displayName);}}function Ne(i,e){if(i&1&&(Ds(0,"option",10),NC(1),pl()),i&2){let t=e.$implicit;ug("value",t.value),BE(),Og(t.label);}}function Ae(i,e){if(i&1&&(Ds(0,"div",18)(1,"label",6),lg(2,"input",23),_I(),NC(3," Grant automatically "),pl(),Ds(4,"p",2),NC(5),pl()()),i&2){let t=Jw(2);BE(2),ug("formControl",t.autoGrantControl),NI(),BE(3),vl(" Give this integration to ",t.autoGrantReach(),", without each agent having to declare it. An agent can still opt out by mapping this configuration to an empty tool list. ");}}function Ee(i,e){if(i&1){let t=Zw();Ds(0,"ds-card")(1,"ds-json-schema-form",24),mg("valueChange",function(a){df(t);let p=Jw(2);return ff(p.onParamsChange(a))}),pl()();}if(i&2){let t=Jw(2);BE(),ug("schema",e)("value",t.initialParams());}}function Fe(i,e){if(i&1){let t=Zw();Ds(0,"button",25),mg("click",function(){df(t);let a=Jw(2);return ff(a.exportYaml())}),NC(1),pl();}if(i&2){let t=Jw(2);ug("disabled",t.isExporting()),BE(),vl(" ",t.isExporting()?"Exporting\u2026":"Export as YAML"," ");}}function Te(i,e){if(i&1){let t=Zw();Ds(0,"form",4),mg("ngSubmit",function(){df(t);let a=Jw();return ff(a.submit())}),Ds(1,"ds-fieldset",5),Hw(2,xe,3,4,"label",6,Fw().trackByScope,true),pl(),Ds(4,"ds-form-field",7)(5,"select",8)(6,"option",9),NC(7,"Select type"),pl(),Hw(8,Ie,2,2,"option",10,Fw().trackByType,true),pl(),_I(),pl(),Ds(10,"ds-form-field",11),lg(11,"input",12),_I(),pl(),Ds(12,"ds-form-field",13),lg(13,"textarea",14),_I(),pl(),Ds(14,"ds-form-field",15)(15,"select",16)(16,"option",17),NC(17,"None"),pl(),Hw(18,Ne,2,2,"option",10,be),pl(),_I(),pl(),Lw(20,Ae,6,2,"div",18),Lw(21,Ee,2,2,"ds-card"),Ds(22,"ds-form-actions")(23,"button",19),NC(24),pl(),Lw(25,Fe,2,2,"button",20),Ds(26,"button",21),mg("click",function(){df(t);let a=Jw();return ff(a.cancel())}),NC(27,"Cancel"),pl()()();}if(i&2){let t,n=Jw();ug("formGroup",n.form),BE(),ug("disabled",n.isEditMode()),BE(),Uw(n.scopeOptions),BE(3),ug("formControl",n.typeControl),NI(),BE(3),Uw(n.integrationTypes()),BE(3),ug("formControl",n.nameControl),NI(),BE(2),ug("formControl",n.descriptionControl),NI(),BE(2),ug("formControl",n.authSettingNameControl),NI(),BE(),ug("ngValue",null),BE(2),Uw(n.authSettingOptions()),BE(2),jw(n.isAutoGrantable()?20:-1),BE(),jw((t=n.schema())?21:-1,t),BE(2),ug("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),BE(),vl(" ",n.isEditMode()?"Save changes":"Create"," "),BE(),jw(n.isEditMode()?25:-1);}}var Ve=new Set(["platform","namespace","userOnNs","userGlobal"]),w=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ve=class i{route=g(W);router=g(F);destroyRef=g(Ie$1);state=g(O);integrationTypeController=g(_);authSettingState=g(I);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=F$1(this.isPlatformMode?Tr(true):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new pt({name:new Te$1("",{nonNullable:true,validators:[fn.required,fn.minLength(1)]}),description:new Te$1(null),type:new Te$1("",{nonNullable:true,validators:[fn.required]}),scope:new Te$1("namespace",{nonNullable:true}),autoGrant:new Te$1(false,{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}get autoGrantControl(){return this.form.controls.autoGrant}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);isExporting=Ui(false);scopeOptions=[{value:"platform",label:w.platform},{value:"namespace",label:w.namespace},{value:"userOnNs",label:w.userOnNs},{value:"userGlobal",label:w.userGlobal}];authSettingNameControl=new Te$1(null);loadedAuthSettings=Ui([]);authSettingsLoaded=Ui(false);savedAuthSettingName=Ui(null);authSettingsScope$=new le;authSettingOptions=XC(()=>{let e=this.loadedAuthSettings(),t=this.savedAuthSettingName();return !t||!this.authSettingsLoaded()||e.some(n=>n.value===t)?e:[...e,{value:t,label:`${t} (not found)`}]});paramsValue=Ui(null);initialParams=Ui(null);integrationTypes=F$1(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=F$1(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});scopeValue=F$1(this.form.controls.scope.valueChanges,{initialValue:this.form.controls.scope.value});schema=XC(()=>{let e=this.selectedType();return e?this.integrationTypes().find(n=>n.type===e)?.configSchema??null:null});isAutoGrantable=XC(()=>{let e=this.selectedType();return e?this.integrationTypes().find(t=>t.type===e)?.autoGrantable??false:false});autoGrantReach=XC(()=>{switch(this.scopeValue()){case "platform":return "every agent of this environment";case "namespace":return "every agent of this namespace";default:return "your own runs"}});existingConfig=null;constructor(){this.authSettingsScope$.pipe(fa(e=>this.loadAuthSettingLayers(e)),U(this.destroyRef)).subscribe(e=>{this.loadedAuthSettings.set(this.toAuthSettingOptions(e)),this.authSettingsLoaded.set(true);}),Af(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs");});}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let e=this.route.snapshot.paramMap,t=this.route.snapshot.queryParamMap,n=e.get("integrationId");if(n){this.isEditMode.set(true),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable(),this.loadAuthSettingsForScope("platform");return}let a=this.parseScope(t.get("scope"));this.scopeControl.setValue(a),this.loadAuthSettingsForScope(a),this.scopeControl.valueChanges.pipe(U(this.destroyRef)).subscribe(D=>{this.loadAuthSettingsForScope(D);});let p=t.get("template");p&&this.hydrateFromTemplate(p);}parseScope(e){return e&&Ve.has(e)?e:"namespace"}deriveScopeFromConfig(e){return !e.userId&&!e.namespaceId?"platform":e.userId?e.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(e){this.isLoading.set(true),this.state.getById(e).pipe(U(this.destroyRef)).subscribe({next:t=>{this.existingConfig=t;let n=this.deriveScopeFromConfig(t);this.scopeControl.setValue(n),this.applyConfigToForm(t),this.loadAuthSettingsForScope(n),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),console.warn(`[IntegrationForm] Could not load config '${e}' \u2014 navigating back`),this.navigateBack();}});}hydrateFromTemplate(e){this.isLoading.set(true),this.state.getById(e).pipe(U(this.destroyRef)).subscribe({next:t=>{this.applyConfigToForm(t),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});},error:t=>{console.warn(`[IntegrationForm] Could not hydrate from template ${e}:`,t),this.isLoading.set(false),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:true});}});}applyConfigToForm(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.authSettingNameControl.setValue(e.authSettingName??null),this.savedAuthSettingName.set(e.authSettingName??null),this.autoGrantControl.setValue(e.autoGrant??false);}loadAuthSettingsForScope(e){this.authSettingsLoaded.set(false),this.authSettingsScope$.next(e);}loadAuthSettingLayers(e){let t=(p,D)=>D.pipe(da(()=>Tr([])),ne(Se=>({label:p,settings:Se}))),n=t("platform",this.authSettingState.loadPlatformSettings()),a=t("mine",this.authSettingState.loadUserSettings("global"));return e==="platform"||e==="userGlobal"?Ty([a,n]):Ty([t("mine",this.authSettingState.loadUserSettings(this.namespaceId)),t("namespace",this.authSettingState.loadNamespaceSettings(this.namespaceId)),a,n])}toAuthSettingOptions(e){let t=new Map;for(let{label:n,settings:a}of e)for(let{name:p}of a)p&&t.set(p,(t.get(p)??new Set).add(n));return [...t.entries()].sort(([n],[a])=>n.localeCompare(a)).map(([n,a])=>({value:n,label:`${n} (${[...a].join(", ")})`}))}onParamsChange(e){this.paramsValue.set(e);}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(true);let e=this.descriptionControl.value?.trim(),t={name:this.nameControl.value.trim(),description:e||null,integrationType:this.typeControl.value,parameters:this.paramsValue(),authSettingName:this.authSettingNameControl.value||null,autoGrant:this.isAutoGrantable()&&this.autoGrantControl.value},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,t,n,this.existingConfig):this.state.create(t,n,this.namespaceId??null)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}exportYaml(){let e=this.existingConfig?.id;!e||this.isExporting()||(this.isExporting.set(true),this.state.exportAsYaml(e).pipe(U(this.destroyRef)).subscribe({next:t=>{let n=new Blob([t],{type:"application/yaml"}),a=URL.createObjectURL(n),p=document.createElement("a");p.href=a,p.download=`${this.existingConfig?.name??"integration"}.yaml`,p.click(),URL.revokeObjectURL(a),this.isExporting.set(false);},error:()=>this.isExporting.set(false)}));}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"]);}trackByType(e,t){return t.type}trackByScope(e,t){return t.value}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-integration-form"]],decls:6,vars:2,consts:[[3,"title"],["dsButton","","variant","ghost","type","button","title","Back to integrations",3,"click"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["legend","Scope",3,"disabled"],["dsCheck",""],["label","Type","controlId","integration-type","required",""],["dsControl","","id","integration-type",3,"formControl"],["value","","disabled",""],[3,"value"],["label","Name","controlId","integration-name","required",""],["dsControl","","id","integration-name","type","text","placeholder","Integration name","autocomplete","off",3,"formControl"],["label","Description","controlId","integration-description"],["dsControl","","id","integration-description","placeholder","Optional description","rows","3",3,"formControl"],["label","Auth Setting","controlId","integration-auth-setting","hint","Only the name is saved. It is resolved at run time for the user running the case, the most specific layer winning (user on this namespace > namespace > user > platform), so a shared integration can rely on each user's own auth setting of that name."],["dsControl","","id","integration-auth-setting",3,"formControl"],[3,"ngValue"],[1,"ds-stack","ds-stack--sm"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"disabled"],["dsButton","","type","button",3,"click"],["type","radio",3,"value","formControl","disabled"],["type","checkbox",3,"formControl"],[3,"valueChange","schema","value"],["dsButton","","type","button",3,"click","disabled"]],template:function(t,n){t&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return n.cancel()}),NC(3," \u2190 Integrations "),pl()(),Lw(4,_e,2,0,"p",2)(5,Te,28,12,"form",3),pl()),t&2&&(BE(),ug("title",n.isEditMode()?"Edit integration":"New integration"),BE(3),jw(n.isLoading()?4:5));},dependencies:[pn,hn,cn,ln,dn,on,at,an,rn,Ut,nd,bo,xo,Lt,vn,Gt,pa,mo,po,Vn,An,Wt],encapsulation:2})};export{ve as IntegrationFormComponent};
@@ -1,2 +0,0 @@
1
- import {I}from'./chunk-D7Bi0wQe.js';import {g,W,aW as L,I as Ie,U as Ui,X as XC,aX as Be,ac as Ty,G as U,a2 as da,aa as Tr,y as yw,D as Ds,l as lg,L as Lw,p as pl,Q as mg,a as BE,j as jw,P as ug,N as NC,Z as Zw,_ as _I,H as Hw,J as Jw,R as NI,m as Uw,v as vl,as as kg,r as df,s as ff,O as Og}from'./main-KD2BFLOW.js';import {a6 as id,b as bo,x as xo,L as Lt,u as vn,G as Gt,m as mo,a8 as da$1,ac as Ni,d as pn,h as hn,e as cn,r as ln,g as dn,C as mn,i as at,j as an,t as rn}from'./chunk-DlvXf54E.js';import'./chunk-CirZuytZ.js';var oe=(i,t)=>t.id;function ae(i,t){i&1&&(Ds(0,"p",1),NC(1,"Loading\u2026"),pl());}function se(i,t){if(i&1&&(Ds(0,"ds-notice"),NC(1),pl()),i&2){let e=Jw(2);BE(),Og(e.errorMessage());}}function re(i,t){if(i&1){let e=Zw();Ds(0,"div")(1,"button",23),mg("click",function(){df(e);let s=Jw(2);return ff(s.retryLoad())}),NC(2,"Retry loading"),pl()();}}function ce(i,t){if(i&1&&(lg(0,"br"),NC(1)),i&2){let e=Jw(3);BE(),vl("",e.association()?.checkoutFailureReason," ");}}function de(i,t){if(i&1&&(Ds(0,"ds-notice",3),NC(1),Lw(2,ce,2,1),pl()),i&2){let e=Jw(2);ug("tone",e.checkoutStatus()===e.CheckoutStatus.FAILED?"error":e.checkoutStatus()===e.CheckoutStatus.READY?"success":"neutral"),BE(),vl(" Repository: ",e.checkoutStatus()," "),BE(),jw(e.association()?.checkoutFailureReason?2:-1);}}function le(i,t){if(i&1&&(Ds(0,"option",12),NC(1),pl()),i&2){let e=t.$implicit,c=Jw(2);ug("value",e.id),BE(),kg("",e.name," (",c.authTypeLabel(e.authType),")");}}function me(i,t){i&1&&(Ds(0,"p",13),NC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),pl());}function pe(i,t){if(i&1){let e=Zw();Ds(0,"button",24),mg("click",function(){df(e);let s=Jw(2);return ff(s.remove())}),NC(1," Remove association "),pl();}if(i&2){let e=Jw(2);ug("disabled",!e.associationLoaded()||e.isSaving());}}function ue(i,t){if(i&1){let e=Zw();Lw(0,se,2,1,"ds-notice"),Lw(1,re,3,0,"div"),Lw(2,de,3,3,"ds-notice",3),Ds(3,"ds-fieldset",4)(4,"ds-form-field",5)(5,"input",6),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.repositoryUrl.set(s))}),pl(),_I(),pl(),Ds(6,"ds-form-field",7)(7,"input",8),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.mainBranch.set(s))}),pl(),_I(),pl(),Ds(8,"ds-form-field",9)(9,"select",10),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.serviceAuthSettingId.set(s))}),Ds(10,"option",11),NC(11,"Select an auth setting\u2026"),pl(),Hw(12,le,2,3,"option",12,oe),pl(),_I(),Lw(14,me,2,0,"p",13),pl()(),Ds(15,"ds-fieldset",14)(16,"div",15)(17,"label",16)(18,"input",17),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.autoWorktree.set(s))}),pl(),_I(),NC(19," Offer a worktree to every new top-level case "),pl(),Ds(20,"p",18),NC(21," The creator checks the box when creating the case; it is unchecked by default, and a case created without it has no Git. Applies to cases created from now on: turning this on later never equips existing cases, and turning it off never removes a worktree already created. "),pl()(),Ds(22,"ds-form-field",19)(23,"input",20),mg("ngModelChange",function(s){df(e);let u=Jw();return ff(u.setupCommand.set(s))}),pl(),_I(),Ds(24,"p",13),NC(25," Runs on the server, as the service user, in each new worktree. It executes code from the branch \u2014 prefer a command that disables lifecycle scripts. "),pl()()(),Ds(26,"ds-form-actions")(27,"button",21),mg("click",function(){df(e);let s=Jw();return ff(s.save())}),NC(28),pl(),Lw(29,pe,2,1,"button",22),pl();}if(i&2){let e=Jw();jw(e.errorMessage()?0:-1),BE(),jw(e.associationLoaded()?-1:1),BE(),jw(e.isAssociated()&&e.checkoutStatus()?2:-1),BE(),ug("disabled",!e.associationLoaded()||e.isSaving()),BE(2),ug("ngModel",e.repositoryUrl()),NI(),BE(2),ug("ngModel",e.mainBranch()),NI(),BE(2),ug("ngModel",e.serviceAuthSettingId()),NI(),BE(3),Uw(e.eligibleAuthSettings()),BE(2),jw(e.eligibleAuthSettings().length===0?14:-1),BE(),ug("disabled",!e.associationLoaded()||e.isSaving()),BE(3),ug("ngModel",e.autoWorktree()),NI(),BE(5),ug("ngModel",e.setupCommand()),NI(),BE(4),ug("disabled",!e.canSave()),BE(),vl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),BE(),jw(e.isAssociated()?29:-1);}}var ge=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],he={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},ne=class i{route=g(W);gitApi=g(L);authSettingState=g(I);destroyRef=g(Ie);isLoading=Ui(true);isSaving=Ui(false);confirmingRemove=Ui(false);associationLoaded=Ui(false);errorMessage=Ui(null);association=Ui(null);authSettings=Ui([]);repositoryUrl=Ui("");mainBranch=Ui("main");serviceAuthSettingId=Ui("");autoWorktree=Ui(false);setupCommand=Ui("");namespaceId="";isAssociated=XC(()=>this.association()?.associated===true);eligibleAuthSettings=XC(()=>this.authSettings().filter(t=>ge.includes(t.authType)));authTypeLabel(t){return he[t??""]??t??"unknown"}canSave=XC(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=XC(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Be;ngOnInit(){this.namespaceId=this.route.snapshot.paramMap.get("namespaceId")??"",this.load();}retryLoad(){this.isLoading()||this.isSaving()||this.load();}load(){this.isLoading.set(true),this.associationLoaded.set(false),this.errorMessage.set(null),Ty({association:this.gitApi.getAssociationNamespaceGit(this.namespaceId),authSettings:this.authSettingState.loadNamespaceSettings(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({association:t,authSettings:e})=>{this.authSettings.set(e??[]),this.acceptAssociation(t),this.isLoading.set(false);},error:t=>{console.error("Failed to load the Git repository settings",t),this.errorMessage.set(this.messageOf(t)),this.isLoading.set(false);}});}acceptAssociation(t){this.association.set(t);let e=t?.associated===false||t?.associated===true&&typeof t.repositoryUrl=="string"&&typeof t.mainBranch=="string"&&typeof t.serviceAuthSettingId=="string"&&typeof t.autoWorktreeForRootCases=="boolean"&&(t.setupCommand==null||typeof t.setupCommand=="string");this.associationLoaded.set(e),e?this.applyToForm(t):this.errorMessage.set("The repository settings could not be loaded completely. Retry before making changes.");}applyToForm(t){this.repositoryUrl.set(t.repositoryUrl??""),this.mainBranch.set(t.mainBranch??"main"),this.serviceAuthSettingId.set(t.serviceAuthSettingId??""),this.autoWorktree.set(t.autoWorktreeForRootCases??false),this.setupCommand.set(t.setupCommand??"");}save(){this.canSave()&&(this.isSaving.set(true),this.errorMessage.set(null),this.gitApi.setAssociationNamespaceGit(this.namespaceId,{repositoryUrl:this.repositoryUrl().trim(),mainBranch:this.mainBranch().trim()||void 0,serviceAuthSettingId:this.serviceAuthSettingId(),autoWorktreeForRootCases:this.autoWorktree(),setupCommand:this.setupCommand().trim()||void 0}).pipe(U(this.destroyRef),da(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Tr(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||this.confirmingRemove.set(true);}confirmRemove(){this.confirmingRemove.set(false),!(!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated())&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),da(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),Tr(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=yw({type:i,selectors:[["agentos-namespace-git"]],decls:5,vars:2,consts:[["title","Git repository","description","Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, the new-case form offers a worktree, and a case created with one gets a repo/ directory shared by its sub-cases. Namespace files remain shared documents outside Git. Agents create branches and pull requests in their workflows."],[1,"ds-hint"],["title","Remove the repository association?","message","Existing workspaces keep their worktree.","confirmLabel","Remove","cancelLabel","Cancel",3,"confirmed","cancelled","open"],[3,"tone"],["legend","Repository",3,"disabled"],["label","Repository URL","controlId","git-url","hint","HTTPS only, without credentials in the URL."],["dsControl","","id","git-url","type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",3,"ngModelChange","ngModel"],["label","Main branch","controlId","git-branch","hint","New worktrees start at this branch\u2019s commit, without creating a branch."],["dsControl","","id","git-branch","type","text","placeholder","main","name","mainBranch",3,"ngModelChange","ngModel"],["label","Service account","controlId","git-auth","hint","Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case."],["dsControl","","id","git-auth","name","serviceAuthSettingId",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"ds-hint","ds-hint--warning"],["legend","Automation",3,"disabled"],[1,"ds-stack","ds-stack--sm"],["dsCheck",""],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],[1,"ds-hint","ds-indent"],["label","Setup command (optional)","controlId","git-setup"],["dsControl","","mono","","id","git-setup","type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",3,"ngModelChange","ngModel"],["id","git-save","dsButton","","variant","primary","type","button",3,"click","disabled"],["id","git-remove","dsButton","","variant","danger","type","button",3,"disabled"],["id","git-retry","dsButton","","type","button",3,"click"],["id","git-remove","dsButton","","variant","danger","type","button",3,"click","disabled"]],template:function(e,c){e&1&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Lw(2,ae,2,0,"p",1)(3,ue,30,14),pl(),Ds(4,"ds-confirm-dialog",2),mg("confirmed",function(){return c.confirmRemove()})("cancelled",function(){return c.confirmingRemove.set(false)}),pl()),e&2&&(BE(2),jw(c.isLoading()?2:3),BE(2),ug("open",c.confirmingRemove()));},dependencies:[id,bo,xo,Lt,vn,Gt,mo,da$1,Ni,pn,hn,cn,ln,dn,mn,at,an,rn],encapsulation:2})};
2
- export{ne as NamespaceGitComponent};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-CbFj_KVb.js';import {J as s,d as pn,h as hn,o as on,C as mn,i as at,q as sn,l as ko,K as Oi,M as On}from'./chunk-DlvXf54E.js';import {g,W,F,I as Ie,U as Ui,X as XC,G as U,ac as Ty,a2 as da,aa as Tr,y as yw,au as $t,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,j as jw,J as Jw,P as ug,Z as Zw,l as lg,av as zC,O as Og,v as vl,aw as WC,H as Hw,m as Uw,ao as Vw,r as df,s as ff,ax as YD}from'./main-KD2BFLOW.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Ds(0,"a",2),NC(1,"Edit skill \u2192"),pl()),e&2){let n=Jw();ug("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Ds(0,"ds-tag",3),NC(1,"Platform level"),pl());}function te(e,t){e&1&&(Ds(0,"p",4),NC(1,"Loading\u2026"),pl());}function ne(e,t){e&1&&(Ds(0,"ds-notice"),NC(1,"Failed to load skill."),pl());}function ie(e,t){if(e&1&&(Ds(0,"dt"),NC(1,"Created by"),pl(),Ds(2,"dd"),NC(3),pl()),e&2){let n=Jw(2);BE(3),Og(n.createdBy);}}function oe(e,t){if(e&1&&(Ds(0,"dt"),NC(1,"Last updated"),pl(),Ds(2,"dd"),NC(3),pl()),e&2){let n=Jw(2);BE(3),Og(n.updatedOn);}}function ae(e,t){if(e&1&&(Lw(0,ie,4,1),Lw(1,oe,4,1)),e&2){let n=Jw();jw(n.createdBy?0:-1),BE(),jw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Ds(0,"p",4),NC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),pl());}function se(e,t){e&1&&(Ds(0,"p",4),NC(1,"Loading\u2026"),pl());}function re(e,t){e&1&&(Ds(0,"ds-notice"),NC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),pl());}function de(e,t){e&1&&(Ds(0,"p",4),NC(1,"No agent references this skill."),pl());}function ce(e,t){e&1&&(Ds(0,"ds-tag",15),NC(1,"platform agent"),pl());}function me(e,t){e&1&&(Ds(0,"ds-tag",15),NC(1,"via *"),pl());}function pe(e,t){if(e&1&&(Ds(0,"li",13)(1,"span",14),NC(2),pl(),Lw(3,ce,2,0,"ds-tag",15),Lw(4,me,2,0,"ds-tag",15),pl()),e&2){let n=t.$implicit;BE(2),Og(n.name),BE(),jw(n.platform?3:-1),BE(),jw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Ds(0,"ul",12),Hw(1,pe,5,3,"li",13,Y),pl(),Ds(3,"p",4),NC(4," An agent listed "),Ds(5,"code"),NC(6,"via *"),pl(),NC(7," takes the whole catalogue and keeps working without this skill. The others name it, so deleting the skill leaves their selector resolving to nothing. "),pl()),e&2){let n=Jw(2);BE(),Uw(n.consumers());}}function _e(e,t){e&1&&(Ds(0,"p",4),NC(1,"No resources bundled with this skill."),pl());}function ge(e,t){if(e&1){let n=Zw();Ds(0,"li")(1,"ds-disclosure",16),mg("toggled",function(){let r=df(n).$implicit,g=Jw(3);return ff(g.toggleResource(r))}),Ds(2,"pre",17),NC(3),pl()()();}if(e&2){let n=t.$implicit,o=Jw(3);BE(),ug("heading",n)("open",o.isResourceExpanded(n)),BE(2),Og(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Ds(0,"ul",12),Hw(1,ge,4,3,"li",null,Vw),pl()),e&2){let n=Jw(2);BE(),Uw(n.resourcePaths());}}function fe(e,t){if(e&1){let n=Zw();Ds(0,"ds-card",5)(1,"dl",6)(2,"dt"),NC(3,"Name"),pl(),Ds(4,"dd",7),NC(5),pl(),Ds(6,"dt"),NC(7,"Description"),pl(),Ds(8,"dd"),NC(9),pl(),Ds(10,"dt"),NC(11,"Scope"),pl(),Ds(12,"dd"),NC(13),pl(),Ds(14,"dt"),NC(15,"Storage"),pl(),Ds(16,"dd")(17,"ds-tag",8),NC(18),pl()(),Lw(19,ae,2,2),pl()(),Ds(20,"ds-card",9),Lw(21,le,2,0,"p",4)(22,se,2,0,"p",4)(23,re,2,0,"ds-notice")(24,de,2,0,"p",4)(25,ue,8,0),pl(),Ds(26,"ds-card")(27,"ds-disclosure",10),mg("toggled",function(){df(n);let r=Jw();return ff(r.toggleBody())}),lg(28,"div",11),zC(29,"agentosMarkdown"),pl()(),Ds(30,"ds-card",9),Lw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),pl();}if(e&2){let n=t,o=Jw();BE(5),Og(n.name),BE(4),Og(n.description),BE(4),Og(n.namespaceId?"Namespace":"Platform"),BE(4),ug("variant",o.isFilesystemBacked()?"outline":"neutral"),BE(),vl(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),BE(),jw(o.isFilesystemBacked()?-1:19),BE(),ug("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),BE(),jw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),BE(6),ug("open",!o.bodyCollapsed()),BE(),ug("innerHTML",WC(29,12,n.body),YD),BE(2),ug("heading","Resources ("+o.resourcePaths().length+")"),BE(),jw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=Ui(true);hasError=Ui(false);skill=Ui(null);bodyCollapsed=Ui(false);expandedResources=Ui(new Set);resourcePaths=XC(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=XC(()=>this.skill()?.readOnly===true);consumers=Ui([]);consumersUnavailable=Ui(false);consumersLoading=Ui(false);ngOnInit(){this.skillState.getById(this.skillId).pipe(U(this.destroyRef)).subscribe({next:t=>{this.skill.set(t),this.isLoading.set(false),this.loadConsumers(t.name);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}loadConsumers(t){this.namespaceId&&(this.consumersLoading.set(true),Ty({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(da(()=>Tr([])))}).pipe(U(this.destroyRef)).subscribe({next:({namespace:n,platform:o})=>{let r=[...this.toConsumers(n,t,false),...this.toConsumers(o,t,true)];this.consumers.set([...r.filter(g=>g.grant==="named"),...r.filter(g=>g.grant==="all")]),this.consumersLoading.set(false);},error:()=>{this.consumersUnavailable.set(true),this.consumersLoading.set(false);}}));}toConsumers(t,n,o){return t.map(r=>({config:r,grant:a(r.skillSelectors,n)})).filter(r=>r.grant!=="none").map(({config:r,grant:g})=>({name:r.name,grant:g,platform:o}))}toggleBody(){this.bodyCollapsed.update(t=>!t);}toggleResource(t){this.expandedResources.update(n=>{let o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o});}isResourceExpanded(t){return this.expandedResources().has(t)}resourceContent(t){return this.skill()?.resources?.[t]??""}editRoute(){return this.isPlatformMode?["/agentos","admin","skills",this.skillId,"edit"]:["/agentos",this.namespaceId,"skills",this.skillId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","skills"]):this.router.navigate(["/agentos",this.namespaceId,"skills"]);}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=yw({type:e,selectors:[["agentos-skill-inspect"]],decls:9,vars:3,consts:[["title","Skill"],["dsButton","","variant","ghost","type","button","title","Back to skills",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],["headerMeta","","variant","outline"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[3,"variant"],[3,"heading"],["heading","Body",3,"toggled","open"],[1,"ds-pre","ds-pre--prose","ds-prose",3,"innerHTML"],[1,"ds-list"],[1,"ds-inline","ds-inline--wrap"],[1,"ds-strong"],["variant","neutral"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-pre"]],template:function(n,o){if(n&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return o.back()}),NC(3,"\u2190 Skills"),pl(),Lw(4,Z,2,1,"a",2),Lw(5,ee,2,0,"ds-tag",3),pl(),Lw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),pl()),n&2){let r;BE(4),jw(o.skill()&&!o.isFilesystemBacked()?4:-1),BE(),jw(o.isPlatformMode?5:-1),BE(),jw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,pn,hn,on,mn,at,sn,ko,Oi,On],encapsulation:2})};export{X as SkillInspectComponent};
@@ -1 +0,0 @@
1
- import {c}from'./chunk-DXfFvlbW.js';import {z as k,O as O$1,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-DlvXf54E.js';import {g,W,F,I as Ie,U as Ui,ac as Ty,a2 as da,aa as Tr,G as U,M as x,K as w,ai as Ne,al as De,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,Z as Zw,r as df,s as ff,k as cg}from'./main-KD2BFLOW.js';var J=(n,t)=>t.key;function O(n,t){if(n&1&&(Ds(0,"p",3),NC(1),pl()),n&2){let e=Jw();BE(),Og(e.deletion.error());}}function Y(n,t){n&1&&(Ds(0,"p",4),NC(1,"Loading scheduled prompts\u2026"),pl());}function z(n,t){n&1&&(Ds(0,"p",5),NC(1,"No scheduled prompts available."),pl());}function G(n,t){n&1&&(Ds(0,"p",4),NC(1,"No scheduled prompts match the current filter."),pl());}function Q(n,t){if(n&1&&(Ds(0,"span",14),NC(1),pl()),n&2){let e=Jw().$implicit;BE(),Og(e.prompt.description);}}function X(n,t){n&1&&(Ds(0,"ds-tag",20),NC(1,"Read-only"),pl());}function Z(n,t){if(n&1){let e=Zw();Ds(0,"button",25),mg("click",function(){df(e);let l=Jw(2).$implicit,p=Jw(2);return ff(p.toggle(l))}),NC(1),pl(),Ds(2,"button",25),mg("click",function(){df(e);let l=Jw(2).$implicit,p=Jw(2);return ff(p.edit(l))}),NC(3," Edit "),pl();}if(n&2){let e=Jw(2).$implicit;BE(),Og(e.prompt.enabled?"Disable":"Enable"),BE(),cg("aria-label","Edit "+e.prompt.name);}}function ee(n,t){if(n&1){let e=Zw();Lw(0,Z,4,2),Ds(1,"agentos-row-delete-action",24),mg("deleteRequested",function(){df(e);let l=Jw().$implicit,p=Jw(2);return ff(p.deletion.request(l.key))})("deleteConfirmed",function(){df(e);let l=Jw().$implicit,p=Jw(2);return ff(p.confirmDelete(l))})("deleteCancelled",function(){df(e);let l=Jw(3);return ff(l.deletion.cancel())}),pl();}if(n&2){let e=Jw().$implicit,i=Jw(2);jw(i.deletion.confirmingId()!==e.key?0:-1),BE(),ug("rowKey",e.key)("rowLabel",e.prompt.name)("state",i.deletion);}}function te(n,t){n&1&&(Ds(0,"button",23),NC(1,"Inherited"),pl());}function ne(n,t){if(n&1&&(Ds(0,"tr",9)(1,"td",12)(2,"span",13),NC(3),pl(),Lw(4,Q,2,1,"span",14),pl(),Ds(5,"td",15),NC(6),pl(),Ds(7,"td",16)(8,"ds-tag",17),NC(9),pl()(),Ds(10,"td",18)(11,"div",19)(12,"ds-tag",17),NC(13),pl(),Lw(14,X,2,0,"ds-tag",20),pl()(),Ds(15,"td",21)(16,"div",22),Lw(17,ee,2,4)(18,te,2,0,"button",23),pl()()()),n&2){let e=t.$implicit,i=Jw(2);BE(3),Og(e.prompt.name),BE(),jw(e.prompt.description?4:-1),BE(2),Og(i.scheduleLabel(e.prompt)),BE(2),ug("variant",e.prompt.enabled?"accent":"outline"),BE(),Og(e.prompt.enabled?"Enabled":"Disabled"),BE(3),ug("variant",e.scope==="platform"?"neutral":"accent"),BE(),Og(e.scope==="platform"?"Platform":"Namespace"),BE(),jw(e.scope==="platform"?14:-1),BE(3),jw(e.scope==="namespace"?17:18);}}function ie(n,t){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Schedule"),pl(),Ds(8,"th",10),NC(9,"Status"),pl(),Ds(10,"th",10),NC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),NC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Hw(16,ne,19,9,"tr",9,J),pl()()()),n&2){let e=Jw();BE(16),Uw(e.rowFilter.filteredRows());}}var H=class n{route=g(W);router=g(F);destroyRef=g(Ie);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;rows=Ui([]);isLoading=Ui(true);deletion=k();rowFilter=O$1(this.rows,t=>[t.prompt.name,t.prompt.description,this.scheduleLabel(t.prompt),t.prompt.enabled?"Enabled":"Disabled",t.scope].filter(Boolean).join(" "));constructor(){Ty({platform:this.state.listPlatform().pipe(da(()=>Tr([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe({next:({platform:t,namespace:e})=>{this.rows.set([...t.map((i,l)=>({key:`platform:${i.id??l}`,prompt:i,scope:"platform"})),...e.map((i,l)=>({key:`namespace:${i.id??l}`,prompt:i,scope:"namespace"}))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}edit(t){t.scope==="platform"||!t.prompt.id||this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts",t.prompt.id,"edit"]);}toggle(t){if(t.scope==="platform")return;(t.prompt.enabled?this.state.disable(t.prompt.id??""):this.state.enable(t.prompt.id??"")).pipe(U(this.destroyRef)).subscribe(i=>this.rows.update(l=>l.map(p=>p.key===t.key?x(w({},p),{prompt:i}):p)));}confirmDelete(t){t.scope==="platform"||!t.prompt.id||this.deletion.execute(t.key,{request$:this.state.delete(t.prompt.id).pipe(U(this.destroyRef)),onSuccess:()=>this.rows.update(e=>e.filter(i=>i.key!==t.key)),errorMessage:`Deleting "${t.prompt.name}" failed. Try again.`});}scheduleLabel(t){let e=t.recurrence,i=e.unit===Ne.WEEK?"week":"month",l=e.unit===Ne.WEEK&&e.days?.length?` (${e.days.map(p=>De[p]??p).join(", ")})`:"";return `Every ${i}${l} at ${e.timeUtc} UTC`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=yw({type:n,selectors:[["agentos-scheduled-prompt-list"]],decls:9,vars:3,consts:[["title","Scheduled prompts","description","Scheduled prompts for this namespace, including schedules inherited from the platform."],["label","Filter scheduled prompts","placeholder","Filter scheduled prompts\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Scheduled prompts"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Schedule"],["role","cell","data-label","Status"],[3,"variant"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],["variant","outline"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["type","button","disabled",""],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"],["type","button",3,"click"]],template:function(e,i){e&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(p){return i.rowFilter.query.set(p)}),pl(),Ds(2,"button",2),mg("click",function(){return i.openCreateForm()}),NC(3,"New scheduled prompt"),pl()(),Lw(4,O,2,1,"p",3),Lw(5,Y,2,0,"p",4)(6,z,2,0,"p",5)(7,G,2,0,"p",4)(8,ie,18,0,"div",6)),e&2&&(BE(),ug("query",i.rowFilter.query()),BE(3),jw(i.deletion.error()?4:-1),BE(),jw(i.isLoading()?5:i.rows().length===0?6:i.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{H as ScheduledPromptListComponent};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-CbFj_KVb.js';import {J as s,z as k,O,i as at,h as hn,I as Io,l as ko,P,B as P$1}from'./chunk-DlvXf54E.js';import {g,W,F,I as Ie,$ as Cr,U as Ui,a1 as fa,ac as Ty,a2 as da,aa as Tr,ad as ne$1,G as U,y as yw,D as Ds,Q as mg,p as pl,N as NC,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,H as Hw,m as Uw,v as vl,as as kg,Z as Zw,r as df,s as ff,k as cg}from'./main-KD2BFLOW.js';var Y=(n,e)=>e.key;function Z(n,e){if(n&1&&(Ds(0,"p",3),NC(1),pl()),n&2){let t=Jw();BE(),Og(t.deletion.error());}}function ee(n,e){n&1&&(Ds(0,"p",4),NC(1,"Loading skills\u2026"),pl());}function te(n,e){n&1&&(Ds(0,"p",5),NC(1," No skills defined yet. Add one above, or drop a SKILL.md under the namespace config path. "),pl());}function ne(n,e){n&1&&(Ds(0,"p",4),NC(1,"No skills match the current filter."),pl());}function ie(n,e){if(n&1&&(Ds(0,"span",14),NC(1),pl()),n&2){let t=Jw().$implicit;BE(),kg(" named by ",t.namedByAgents," ",t.namedByAgents===1?"agent":"agents"," ");}}function ae(n,e){n&1&&(Ds(0,"ds-tag",20),NC(1,"Read-only"),pl());}function oe(n,e){n&1&&(Ds(0,"ds-tag",21),NC(1,"SKILL.md"),pl());}function le(n,e){if(n&1){let t=Zw();Ds(0,"button",25),mg("click",function(){df(t);let d=Jw(2).$implicit,c=Jw(2);return ff(c.edit(d))}),NC(1,"Edit"),pl();}if(n&2){let t=Jw(2).$implicit;cg("aria-label","Edit "+t.skill.name);}}function re(n,e){if(n&1){let t=Zw();Ds(0,"button",25),mg("click",function(){df(t);let d=Jw().$implicit,c=Jw(2);return ff(c.inspect(d))}),NC(1," View "),pl(),Lw(2,le,2,1,"button",26);}if(n&2){let t=Jw().$implicit,a=Jw(2);cg("aria-label","View "+t.skill.name),BE(2),jw(a.isMutable(t)?2:-1);}}function se(n,e){if(n&1){let t=Zw();Ds(0,"agentos-row-delete-action",27),mg("deleteRequested",function(){df(t);let d=Jw().$implicit,c=Jw(2);return ff(c.requestDelete(d))})("deleteConfirmed",function(){df(t);let d=Jw().$implicit,c=Jw(2);return ff(c.confirmDelete(d))})("deleteCancelled",function(){df(t);let d=Jw(3);return ff(d.deletion.cancel())}),pl();}if(n&2){let t=Jw().$implicit,a=Jw(2);ug("rowKey",t.key)("rowLabel",t.skill.name)("state",a.deletion);}}function ce(n,e){if(n&1&&(Ds(0,"tr",9)(1,"td",12)(2,"span",13),NC(3),pl(),Lw(4,ie,2,2,"span",14),pl(),Ds(5,"td",15),NC(6),pl(),Ds(7,"td",16),NC(8),pl(),Ds(9,"td",17)(10,"div",18)(11,"ds-tag",19),NC(12),pl(),Lw(13,ae,2,0,"ds-tag",20),Lw(14,oe,2,0,"ds-tag",21),pl()(),Ds(15,"td",22)(16,"div",23),Lw(17,re,3,2),Lw(18,se,1,3,"agentos-row-delete-action",24),pl()()()),n&2){let t=e.$implicit,a=Jw(2);BE(3),Og(t.skill.name),BE(),jw(t.namedByAgents>0?4:-1),BE(2),vl(" ",t.skill.description||"\u2014"," "),BE(2),Og(a.resourceCount(t.skill)),BE(3),ug("variant",t.scope==="platform"?"neutral":"accent"),BE(),Og(t.scope==="platform"?"Platform":"Namespace"),BE(),jw(t.scope==="platform"?13:-1),BE(),jw(t.skill.readOnly?14:-1),BE(3),jw(a.deletion.confirmingId()!==t.key?17:-1),BE(),jw(a.isMutable(t)?18:-1);}}function de(n,e){if(n&1&&(Ds(0,"div",6)(1,"table",7)(2,"thead",8)(3,"tr",9)(4,"th",10),NC(5,"Name"),pl(),Ds(6,"th",10),NC(7,"Description"),pl(),Ds(8,"th",10),NC(9,"Resources"),pl(),Ds(10,"th",10),NC(11,"Scope"),pl(),Ds(12,"th",10)(13,"span",11),NC(14,"Actions"),pl()()()(),Ds(15,"tbody",8),Hw(16,ce,19,10,"tr",9,Y),pl()()()),n&2){let t=Jw();BE(16),Uw(t.rowFilter.filteredRows());}}var Q=class n{route=g(W);router=g(F);destroyRef=g(Ie);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Cr(void 0);isLoading=Ui(true);deletion=k();rows=Ui([]);rowFilter=O(this.rows,e=>[e.skill.name,e.skill.description,e.scope].filter(Boolean).join(" "));constructor(){this.refresh$.pipe(fa(()=>(this.isLoading.set(true),Ty({platform:this.skillState.listPlatform().pipe(da(()=>Tr([]))),namespace:this.skillState.listByNamespace(this.namespaceId),agents:Ty({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(da(()=>Tr([])))}).pipe(ne$1(({namespace:e,platform:t})=>[...e,...t]),da(()=>Tr([])))}))),U(this.destroyRef)).subscribe({next:({platform:e,namespace:t,agents:a$1})=>{let d=(c,_,W)=>({key:`${_}:${c.id??W}`,skill:c,scope:_,namedByAgents:a$1.filter(X=>a(X.skillSelectors,c.name)==="named").length});this.rows.set([...e.map((c,_)=>d(c,"platform",_)),...t.map((c,_)=>d(c,"namespace",_))]),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}resourceCount(e){return Object.keys(e.resources??{}).length}isMutable(e){return e.scope==="namespace"&&e.skill.readOnly!==true&&!!e.skill.id}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"skills","new"]);}inspect(e){e.skill.id&&this.router.navigate(e.scope==="platform"?["/agentos","admin","skills",e.skill.id,"inspect"]:["/agentos",this.namespaceId,"skills",e.skill.id,"inspect"]);}edit(e){!this.isMutable(e)||!e.skill.id||this.router.navigate(["/agentos",this.namespaceId,"skills",e.skill.id,"edit"]);}requestDelete(e){this.deletion.request(e.key);}confirmDelete(e){if(!this.isMutable(e)||!e.skill.id)return;let t=e.namedByAgents;this.deletion.execute(e.key,{request$:this.skillState.delete(e.skill.id).pipe(U(this.destroyRef)),onSuccess:()=>this.refresh$.next(),errorMessage:a=>a.status===400?`"${e.skill.name}" is defined by a SKILL.md file and cannot be deleted through the API.`:`Deleting "${e.skill.name}" failed.${t>0?` ${t} agent(s) still name it.`:""}`});}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=yw({type:n,selectors:[["agentos-namespace-skills"]],decls:9,vars:3,consts:[["title","Skills","description","Skills available in this namespace, including skills inherited from the platform."],["label","Filter skills","placeholder","Filter skills\u2026",3,"queryChange","query"],["dsButton","","variant","primary","type","button",3,"click"],["role","alert",1,"settings-table__error"],["role","status",1,"settings-table__status"],[1,"settings-table__status"],[1,"settings-table__wrap"],["dsTable","","role","table","aria-label","Skills"],["role","rowgroup"],["role","row"],["role","columnheader"],[1,"sr-only"],["role","cell","data-label","Name","data-title",""],[1,"settings-table__name","settings-table__stacked"],[1,"settings-table__secondary","settings-table__stacked"],["role","cell","data-label","Description",1,"settings-table__secondary"],["role","cell","data-label","Resources"],["role","cell","data-label","Scope"],[1,"settings-table__tags"],[3,"variant"],["variant","outline"],["variant","neutral"],["role","cell","data-label","Actions","data-actions",""],[1,"settings-table__actions"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"rowKey","rowLabel","state"],["type","button",3,"click"],["type","button"],["deleteClass","settings-table__delete","confirmLabelClass","settings-table__confirm-label",3,"deleteRequested","deleteConfirmed","deleteCancelled","rowKey","rowLabel","state"]],template:function(t,a){t&1&&(Ds(0,"ds-section-header",0)(1,"agentos-table-filter",1),mg("queryChange",function(c){return a.rowFilter.query.set(c)}),pl(),Ds(2,"button",2),mg("click",function(){return a.openCreateForm()}),NC(3,"New skill"),pl()(),Lw(4,Z,2,1,"p",3),Lw(5,ee,2,0,"p",4)(6,te,2,0,"p",5)(7,ne,2,0,"p",4)(8,de,18,0,"div",6)),t&2&&(BE(),ug("query",a.rowFilter.query()),BE(3),jw(a.deletion.error()?4:-1),BE(),jw(a.isLoading()?5:a.rows().length===0?6:a.rowFilter.filteredRows().length===0?7:8));},dependencies:[at,hn,Io,ko,P,P$1],encapsulation:2})};export{Q as NamespaceSkillsComponent};
@@ -1 +0,0 @@
1
- import {d as pn,h as hn,o as on,C as mn,i as at,q as sn,K as Oi,M as On}from'./chunk-DlvXf54E.js';import {g,W as W$1,F,I as Ie,ag as U,U as Ui,X as XC,G as U$1,y as yw,au as $t,D as Ds,Q as mg,N as NC,p as pl,L as Lw,a as BE,P as ug,j as jw,J as Jw,O as Og,S as Sg,v as vl,H as Hw,m as Uw,Z as Zw,l as lg,av as zC,aw as WC,r as df,s as ff,ax as YD}from'./main-KD2BFLOW.js';var j=(t,n)=>n.id,z=(t,n)=>n.name;function q(t,n){t&1&&(Ds(0,"p",3),NC(1,"Loading\u2026"),pl());}function Q(t,n){t&1&&(Ds(0,"ds-notice"),NC(1,"Failed to load agent definition."),pl());}function W(t,n){if(t&1&&(Ds(0,"dt"),NC(1,"User context"),pl(),Ds(2,"dd",6),NC(3),pl()),t&2){let e=Jw();BE(3),Og(e.userId);}}function X(t,n){if(t&1){let e=Zw();Ds(0,"ds-card")(1,"ds-disclosure",12),mg("toggled",function(){df(e);let m=Jw(2);return ff(m.toggleSystemPrompt())}),Ds(2,"pre",13),NC(3),pl()()();}if(t&2){let e=Jw(),r=Jw();BE(),ug("open",!r.systemPromptCollapsed()),BE(2),Og(e.systemPrompt);}}function Y(t,n){if(t&1){let e=Zw();Ds(0,"ds-card")(1,"ds-disclosure",14),mg("toggled",function(){df(e);let m=Jw(2);return ff(m.toggleInstructions())}),Ds(2,"pre",13),NC(3),pl()()();}if(t&2){let e=Jw(),r=Jw();BE(),ug("open",!r.instructionsCollapsed()),BE(2),Og(e.instructions);}}function Z(t,n){t&1&&(Ds(0,"p",3),NC(1," This agent declares no skill, so it gets no skill tools. Attach skills from the edit form. "),pl());}function ee(t,n){t&1&&(Ds(0,"span",17),NC(1,"platform"),pl());}function te(t,n){t&1&&(Ds(0,"span",17),NC(1,"SKILL.md"),pl());}function ne(t,n){if(t&1&&(Ds(0,"li",15)(1,"span")(2,"span",16),NC(3),pl(),Lw(4,ee,2,0,"span",17),Lw(5,te,2,0,"span",17),pl(),Ds(6,"p",3),NC(7),pl()()),t&2){let e=n.$implicit;BE(3),Og(e.name),BE(),jw(e.namespaceId?-1:4),BE(),jw(e.readOnly?5:-1),BE(2),Og(e.description);}}function ie(t,n){if(t&1&&(Ds(0,"ul",11),Hw(1,ne,8,4,"li",15,j),pl()),t&2){let e=Jw(2);BE(),Uw(e.resolvedSkills());}}function oe(t,n){t&1&&(Ds(0,"p",3),NC(1,"No tools available for this agent."),pl());}function ae(t,n){if(t&1&&(lg(0,"div",19),zC(1,"agentosMarkdown")),t&2){let e=Jw().$implicit;ug("innerHTML",WC(1,1,e.description),YD);}}function de(t,n){if(t&1){let e=Zw();Ds(0,"li")(1,"ds-disclosure",18),mg("toggled",function(){let m=df(e).$implicit,U=Jw(3);return ff(U.toggleTool(m))}),Lw(2,ae,2,3,"div",19),Ds(3,"pre",20),NC(4),pl()()();}if(t&2){let e=n.$implicit,r=Jw(3);BE(),ug("heading",e.name)("open",r.isToolExpanded(e)),BE(),jw(e.description?2:-1),BE(2),Og(r.formatSchema(e.inputSchema));}}function re(t,n){if(t&1&&(Ds(0,"ul",11),Hw(1,de,5,4,"li",null,z),pl()),t&2){let e=Jw();BE(),Uw(e.tools);}}function se(t,n){if(t&1&&(Ds(0,"ds-card",4)(1,"dl",5)(2,"dt"),NC(3,"Name"),pl(),Ds(4,"dd"),NC(5),pl(),Ds(6,"dt"),NC(7,"Resolved model"),pl(),Ds(8,"dd",6),NC(9),pl(),Ds(10,"dt"),NC(11,"Provider"),pl(),Ds(12,"dd"),NC(13),pl(),Ds(14,"dt",7),NC(15,"Execution mode"),pl(),Ds(16,"dd",8)(17,"span",9),NC(18),pl()(),Lw(19,W,4,1),pl()(),Lw(20,X,4,2,"ds-card"),Lw(21,Y,4,2,"ds-card"),Ds(22,"ds-card",10),Lw(23,Z,2,0,"p",3)(24,ie,3,0,"ul",11),pl(),Ds(25,"ds-card",10),Lw(26,oe,2,0,"p",3)(27,re,3,0,"ul",11),pl()),t&2){let e=n,r=Jw();BE(5),Og(e.name),BE(4),Og(e.resolvedModelApiName),BE(4),Og(e.resolvedProviderName),BE(4),Sg("agent-config-inspect__badge--active",e.executionMode!=="SIMPLE"),BE(),vl(" ",e.executionMode," "),BE(),jw(e.userId?19:-1),BE(),jw(e.systemPrompt?20:-1),BE(),jw(e.instructions?21:-1),BE(),ug("heading","Skills ("+r.resolvedSkills().length+")"),BE(),jw(r.resolvedSkills().length===0?23:24),BE(2),ug("heading","Tools ("+e.tools.length+")"),BE(),jw(e.tools.length===0?26:27);}}var K=class t{route=g(W$1);router=g(F);destroyRef=g(Ie);agentConfigController=g(U);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Ui(true);hasError=Ui(false);definition=Ui(null);expandedTools=Ui(new Set);resolvedSkills=XC(()=>this.definition()?.skills??[]);systemPromptCollapsed=Ui(true);instructionsCollapsed=Ui(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:n=>{this.definition.set(n),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}toggleTool(n){this.expandedTools.update(e=>{let r=new Set(e);return r.has(n.name)?r.delete(n.name):r.add(n.name),r});}isToolExpanded(n){return this.expandedTools().has(n.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(n=>!n);}toggleInstructions(){this.instructionsCollapsed.update(n=>!n);}formatSchema(n){try{return JSON.stringify(JSON.parse(n),null,2)}catch(e){return n}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"]);}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=yw({type:t,selectors:[["agentos-agent-config-inspect"]],decls:9,vars:2,consts:[["title","Agent definition"],["dsButton","","variant","ghost","type","button","title","Back to agent configs",3,"click"],["headerMeta","",1,"ds-link",3,"routerLink"],[1,"ds-hint"],["heading","General"],["dsDefinitionList",""],[1,"ds-mono"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__badge"],[3,"heading"],[1,"ds-list"],["heading","System Prompt",3,"toggled","open"],[1,"ds-pre","ds-pre--prose"],["heading","Instructions",3,"toggled","open"],[1,"ds-stack","ds-stack--sm"],[1,"ds-strong"],[1,"ds-meta"],["bordered","","mono","",3,"toggled","heading","open"],[1,"ds-prose","ds-hint",3,"innerHTML"],[1,"ds-pre"]],template:function(e,r){if(e&1&&(Ds(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),mg("click",function(){return r.back()}),NC(3," \u2190 Agent configs "),pl(),Ds(4,"a",2),NC(5,"Edit config \u2192"),pl()(),Lw(6,q,2,0,"p",3)(7,Q,2,0,"ds-notice")(8,se,28,13),pl()),e&2){let m;BE(4),ug("routerLink",r.editRoute()),BE(2),jw(r.isLoading()?6:r.hasError()?7:(m=r.definition())?8:-1,m);}},dependencies:[$t,pn,hn,on,mn,at,sn,Oi,On],encapsulation:2})};export{K as AgentConfigInspectComponent};