@whoz-oss/coday-client 0.0.0-workstream-forge.246 → 0.0.0-workstream-forge.248

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 (68) hide show
  1. package/browser/{chunk-C1C0RiZa.js → chunk-3EDXMS-4.js} +1 -1
  2. package/browser/chunk-7iOKe3sk.js +1 -0
  3. package/browser/chunk-ABpRMh2B.js +1 -0
  4. package/browser/chunk-B0fXA2NX.js +2 -0
  5. package/browser/chunk-BABBgQ8U.js +1 -0
  6. package/browser/chunk-BNa9R5xr.js +1 -0
  7. package/browser/{chunk-Dyr7sRIs.js → chunk-BOeKfMLQ.js} +1 -1
  8. package/browser/{chunk-DO-ovLg3.js → chunk-Be6W3TsR.js} +1 -1
  9. package/browser/chunk-BlzNw99t.js +1 -0
  10. package/browser/{chunk-DT2PdsWA.js → chunk-BmOgwWdt.js} +1 -1
  11. package/browser/chunk-BoNn3F1p.js +1 -0
  12. package/browser/{chunk-COuqiVBt.js → chunk-Br_8ZFLi.js} +1 -1
  13. package/browser/{chunk-ujBeU4_3.js → chunk-BuxuH9BP.js} +1 -1
  14. package/browser/chunk-BvuZQAQ0.js +1 -0
  15. package/browser/{chunk-HBNTqJMB.js → chunk-Bw1EhndU.js} +1 -1
  16. package/browser/chunk-BzbDU55N.js +1 -0
  17. package/browser/{chunk-BZl7Iiay.js → chunk-C6QCrOzn.js} +1 -1
  18. package/browser/{chunk-BOu7cjfB.js → chunk-CF-LwfxF.js} +1 -1
  19. package/browser/chunk-CI4MRoOv.js +1 -0
  20. package/browser/{chunk-Cbx6LzEu.js → chunk-CKZuDwRH.js} +1 -1
  21. package/browser/chunk-CQ560xmp.js +1 -0
  22. package/browser/{chunk-DY9-csXz.js → chunk-CQks4NEB.js} +1 -1
  23. package/browser/chunk-CTDoIA2m.js +1 -0
  24. package/browser/{chunk-JvVR12Id.js → chunk-Co0vItak.js} +1 -1
  25. package/browser/chunk-CpV2kJbn.js +1 -0
  26. package/browser/chunk-CxzpsCxW.js +1 -0
  27. package/browser/{chunk-BXjaHG4X.js → chunk-CzE55g5c.js} +1 -1
  28. package/browser/chunk-D6Jj7Ejx.js +1 -0
  29. package/browser/{chunk-s9o_sIbq.js → chunk-D9-ZBfAY.js} +1 -1
  30. package/browser/{chunk-BOAakMd1.js → chunk-DFex7bTN.js} +1 -1
  31. package/browser/{chunk-Bb4ZghwW.js → chunk-DQDO93fa.js} +1 -1
  32. package/browser/chunk-DSG-j5Fi.js +1 -0
  33. package/browser/{chunk-DRRpPNnR.js → chunk-DindqaXv.js} +1 -1
  34. package/browser/{chunk-Bjb4ofPZ.js → chunk-DlzuAZs2.js} +1 -1
  35. package/browser/{chunk-oRtfYKfO.js → chunk-DvFBWfOh.js} +1 -1
  36. package/browser/{chunk-Dq6TitFH.js → chunk-DwBnbZ_M.js} +1 -1
  37. package/browser/{chunk-Blm_gDNW.js → chunk-DxEJ-WRR.js} +1 -1
  38. package/browser/{chunk-X1BEhfE5.js → chunk-H1lHRH9T.js} +1 -1
  39. package/browser/{chunk-CuO_LCF5.js → chunk-IobJmS5n.js} +1 -1
  40. package/browser/{chunk-DHe0DwEl.js → chunk-QzulhNzo.js} +1 -1
  41. package/browser/chunk-TCTz0Z6I.js +1 -0
  42. package/browser/{chunk-DE6sgNNV.js → chunk-TODRaWW4.js} +1 -1
  43. package/browser/{chunk-Bm9jTMyL.js → chunk-bs29fJzo.js} +1 -1
  44. package/browser/{chunk-BzRZcbeu.js → chunk-e4ml3919.js} +1 -1
  45. package/browser/chunk-isv7OUlX.js +2 -0
  46. package/browser/chunk-qAO_WS2x.js +674 -0
  47. package/browser/index.html +1 -1
  48. package/browser/{main-C57PASRG.js → main-VSQLTBR6.js} +15 -15
  49. package/package.json +1 -1
  50. package/browser/chunk-2rx1a3bg.js +0 -1
  51. package/browser/chunk-44iNe1uu.js +0 -1
  52. package/browser/chunk-6fEcW1af.js +0 -1
  53. package/browser/chunk-BRf--TAM.js +0 -1
  54. package/browser/chunk-BXEuZdL_.js +0 -1
  55. package/browser/chunk-BgUbG3v4.js +0 -2
  56. package/browser/chunk-Boa1rtr3.js +0 -1
  57. package/browser/chunk-C7-dVBzk.js +0 -1
  58. package/browser/chunk-CIVLU6Kt.js +0 -1
  59. package/browser/chunk-CjYCW_MM.js +0 -1
  60. package/browser/chunk-D-1TnBnZ.js +0 -1
  61. package/browser/chunk-D0tfduku.js +0 -1
  62. package/browser/chunk-DOAcv-0n.js +0 -1
  63. package/browser/chunk-DmcssVrC.js +0 -1
  64. package/browser/chunk-Ds02yuKZ.js +0 -1
  65. package/browser/chunk-HNE4DSTY.js +0 -2
  66. package/browser/chunk-TdvCGQY1.js +0 -674
  67. package/browser/chunk-eYQBIph9.js +0 -1
  68. package/browser/chunk-yXcf610a.js +0 -1
@@ -1 +0,0 @@
1
- import {f,y,p as pt,T as Te,g as gn,q as qt,m as md,C as Co,M as Mo,H as Ht,F as Fn,U as Ut,a as po,h as ho,Z as Zr,A as An,O as On,b as hn,c as fn,u as un,d as cn,e as at,i as sn}from'./chunk-TdvCGQY1.js';import {g,W,q as F,H as J,I as we,r as rT,$ as $i,O as Of,K as U,L as w,N as x,v as vw,E as Es,f as fg,j as jw,a as hl,P as dg,b as BE,c as Bw,x as xC,Y as Yw,Q as vg,R as MI,U as Uw,t as eC,S as xI,l as lg,k as $w,s as Dl,F as Fg,u as pf,w as hf}from'./main-C57PASRG.js';var de=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function me(i){return de.test(i)}function ie(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||me(e)?null:{absolutePath:true}}}var ce=(i,t)=>t.value;function ue(i,t){i&1&&(Es(0,"p",2),xC(1,"Loading\u2026"),hl());}function he(i,t){if(i&1&&(Es(0,"option",23),xC(1),hl()),i&2){let e=t.$implicit;dg("value",e.value),BE(),Fg(e.label);}}function pe(i,t){if(i&1){let e=Yw();Es(0,"form",4),vg("ngSubmit",function(){pf(e);let p=eC();return hf(p.submit())}),Es(1,"ds-form-field",5),fg(2,"input",6),MI(),hl(),Es(3,"ds-form-field",7),fg(4,"textarea",8),MI(),hl(),Es(5,"ds-form-field",9),fg(6,"input",10),MI(),hl(),Es(7,"ds-form-field",11),fg(8,"input",12),MI(),hl(),Es(9,"ds-form-field",13),fg(10,"input",14),MI(),hl(),Es(11,"ds-form-field",15),fg(12,"input",16),MI(),hl(),Es(13,"ds-form-field",17),fg(14,"input",18),MI(),hl(),Es(15,"ds-form-field",19)(16,"input",20),vg("input",function(p){pf(e);let se=eC();return hf(se.onMaxToolRoundsInput(p))}),hl(),MI(),hl(),Es(17,"ds-form-field",21)(18,"select",22),Uw(19,he,2,2,"option",23,ce),hl(),MI(),hl(),Es(21,"ds-form-actions")(22,"button",24),xC(23),hl(),Es(24,"button",25),vg("click",function(){pf(e);let p=eC();return hf(p.cancel())}),xC(25,"Cancel"),hl()()();}if(i&2){let e=eC();dg("formGroup",e.form),BE(2),dg("formControl",e.nameControl),xI(),BE(2),dg("formControl",e.descriptionControl),xI(),BE(2),dg("formControl",e.externalIdControl),xI(),BE(2),dg("formControl",e.defaultAgentNameControl),xI(),BE(2),dg("formControl",e.configPathControl),xI(),BE(),dg("hint",e.sharedExchangePathHint())("error",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid&&(e.sharedExchangePathControl.dirty||e.sharedExchangePathControl.touched)?"Enter an absolute path (e.g. /home/me/Coday or C:\\Coday), or leave the field empty.":null),BE(),dg("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),lg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),xI(),BE(),dg("hint",e.runCostThresholdHint()),BE(),dg("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),xI(),BE(),dg("error",e.maxToolRoundsUnparsable()||e.maxToolRoundsControl.invalid&&(e.maxToolRoundsControl.dirty||e.maxToolRoundsControl.touched)?"Enter a whole number of at least 1, or leave the field empty.":null),BE(),dg("formControl",e.maxToolRoundsControl),lg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),xI(),BE(2),dg("formControl",e.adminCaseListingControl),xI(),BE(),$w(e.adminCaseListingOptions),BE(3),dg("disabled",e.form.invalid||e.isSubmitting()),BE(),Dl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var fe=1,ge=2147483647,Ce=[{value:"",label:"Default"},{value:"OWN",label:"Their own cases"},{value:"SWITCH",label:"Their own, with a switch to see all"},{value:"ALL",label:"All cases of the namespace"}],le=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(we);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=rT(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=rT(()=>this.canEditSharedExchangePath()?"Absolute path of a folder on the server that holds the files shared by the namespace. Leave empty for the default location.":"Only a super-admin can change this folder.");runCostThresholdPlaceholder=rT(()=>{let t=this.usageConfiguration.runCostThreshold();return this.usageConfiguration.enabled()?t===null?"No platform limit":`Platform default: ${t}`:"Optional maximum cost per run (e.g. 0.50)"});runCostThresholdHint=rT(()=>{let t="Leave empty to inherit the platform default",e=this.usageConfiguration.runCostThreshold();switch(this.usageConfiguration.state()){case "enabled":return e===null?`${t}: no limit.`:`${t} (${e}).`;case "disabled":return `${t}. Cost limits are inactive while usage tracking is disabled.`;default:return `${t}.`}});form=new pt({name:new Te("",{nonNullable:true,validators:[gn.required,gn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ie(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[gn.min(fe),gn.max(ge),gn.pattern(/^\d+$/)]}),adminCaseListing:new Te("",{nonNullable:true})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get configPathControl(){return this.form.controls.configPath}get sharedExchangePathControl(){return this.form.controls.sharedExchangePath}get externalIdControl(){return this.form.controls.externalId}get defaultAgentNameControl(){return this.form.controls.defaultAgentName}get runCostThresholdControl(){return this.form.controls.runCostThreshold}get maxToolRoundsControl(){return this.form.controls.maxToolRounds}get adminCaseListingControl(){return this.form.controls.adminCaseListing}adminCaseListingOptions=Ce;maxToolRoundsUnparsable=$i(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=$i(false);isSubmitting=$i(false);isLoading=$i(false);existingNamespace=null;constructor(){Of(()=>{this.canEditSharedExchangePath(),this.sharedExchangePathControl.updateValueAndValidity();});}ngOnInit(){this.userState.currentUser()||this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({error:()=>{}});let t=this.route.snapshot.paramMap.get("namespaceId")??this.route.parent?.snapshot.paramMap.get("namespaceId");t&&(this.isEditMode.set(true),this.loadNamespace(t));}loadNamespace(t){this.isLoading.set(true),this.namespaceController.getByIdNamespace(t).pipe(U(this.destroyRef)).subscribe({next:e=>{this.existingNamespace=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??""),this.configPathControl.setValue(e.configPath??""),this.sharedExchangePathControl.setValue(e.sharedExchangePath??""),this.externalIdControl.setValue(e.externalId??""),this.defaultAgentNameControl.setValue(e.defaultAgentName??""),this.runCostThresholdControl.setValue(e.runCostThreshold??null),this.maxToolRoundsControl.setValue(e.maxToolRounds??null),this.adminCaseListingControl.setValue(e.adminCaseListing??""),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}submit(){if(this.form.invalid||this.maxToolRoundsUnparsable()||this.isSubmitting())return;this.isSubmitting.set(true);let t=w(x(w({},this.existingNamespace),{name:this.nameControl.value.trim(),description:this.descriptionControl.value.trim()||void 0,configPath:this.configPathControl.value.trim()||void 0,externalId:this.externalIdControl.value.trim()||void 0,defaultAgentName:this.defaultAgentNameControl.value.trim()||void 0,runCostThreshold:this.runCostThresholdControl.value??void 0,maxToolRounds:this.maxToolRoundsControl.value??void 0,adminCaseListing:this.adminCaseListingControl.value||void 0}),this.canEditSharedExchangePath()?{sharedExchangePath:this.sharedExchangePathPayload()}:{});(this.isEditMode()?this.namespaceController.updateNamespace(this.existingNamespace.id??"",t):this.namespaceController.createNamespace(t)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(false)});}sharedExchangePathPayload(){return this.sharedExchangePathControl.value.trim()||(this.existingNamespace?.sharedExchangePath?"":void 0)}cancel(){this.navigateBack();}navigateBack(){this.router.navigate(["/agentos/namespaces"]);}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=vw({type:i,selectors:[["agentos-namespace-form"]],decls:4,vars:3,consts:[[3,"framed"],[3,"title"],[1,"ds-hint"],[1,"ds-form",3,"formGroup"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Name","controlId","ns-name","required",""],["dsControl","","id","ns-name","type","text","placeholder","Namespace name","autocomplete","off",3,"formControl"],["label","Description","controlId","ns-description"],["dsControl","","id","ns-description","rows","4","placeholder","Optional description",3,"formControl"],["label","External ID","controlId","ns-external-id"],["dsControl","","id","ns-external-id","type","text","placeholder","Optional federation ID from an external system","autocomplete","off",3,"formControl"],["label","Default agent","controlId","ns-default-agent"],["dsControl","","id","ns-default-agent","type","text","placeholder","Logical name of the default agent (e.g. coday)","autocomplete","off",3,"formControl"],["label","Config path","controlId","ns-config-path"],["dsControl","","id","ns-config-path","type","text","placeholder","Optional path to base configuration directory","autocomplete","off",3,"formControl"],["label","Shared files folder","controlId","ns-shared-exchange-path","hintId","ns-shared-exchange-path-hint","errorId","ns-shared-exchange-path-error",3,"hint","error"],["dsControl","","id","ns-shared-exchange-path","type","text","placeholder","Default location managed by AgentOS","aria-describedby","ns-shared-exchange-path-hint","autocomplete","off",3,"readOnly","formControl"],["label","Run cost threshold","controlId","ns-run-cost-threshold","hintId","ns-run-cost-threshold-hint",3,"hint"],["dsControl","","id","ns-run-cost-threshold","type","number","min","0","step","0.01","aria-describedby","ns-run-cost-threshold-hint",3,"placeholder","formControl"],["label","Maximum tool rounds","controlId","ns-max-tool-rounds","hintId","ns-max-tool-rounds-hint","errorId","ns-max-tool-rounds-error","hint","Most tool rounds one agent run may take. Leave empty to inherit the server default. A change applies from the next agent run.",3,"error"],["dsControl","","id","ns-max-tool-rounds","type","number","min","1","step","1","placeholder","Server default","aria-describedby","ns-max-tool-rounds-hint",3,"input","formControl"],["label","Cases visible to admins","controlId","ns-admin-case-listing","hintId","ns-admin-case-listing-hint","hint","Choose which conversations the admins of this namespace see in their list. Members always see only their own."],["dsControl","","id","ns-admin-case-listing","aria-describedby","ns-admin-case-listing-hint",3,"formControl"],[3,"value"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Es(0,"ds-page",0),fg(1,"ds-section-header",1),jw(2,ue,2,0,"p",2)(3,pe,26,20,"form",3),hl()),e&2&&(dg("framed",!u.isEditMode()),BE(),dg("title",u.isEditMode()?"Edit namespace":"New namespace"),BE(),Bw(u.isLoading()?2:3));},dependencies:[qt,md,Co,Mo,Ht,Fn,Ut,po,ho,Zr,An,On,hn,fn,un,cn,at,sn],encapsulation:2})};export{Ce as ADMIN_CASE_LISTING_OPTIONS,le as NamespaceFormComponent};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-1nyEsjkY.js';import {o}from'./chunk-C1C0RiZa.js';import {I as s,b as hn,c as fn,r as rn,D as pn,e as at,n as ln,l as Fo,J as Pi,K as On}from'./chunk-TdvCGQY1.js';import {g,W,q as F,I as we,$ as $i,r as rT,K as U,ac as by,a2 as ha,aa as br,v as vw,au as $t,E as Es,Q as vg,x as xC,a as hl,j as jw,b as BE,c as Bw,t as eC,P as dg,Y as Yw,f as fg,av as YC,F as Fg,s as Dl,aw as KC,U as Uw,k as $w,ao as Hw,u as pf,w as hf,ax as YD}from'./main-C57PASRG.js';var Y=(e,t)=>t.name+t.grant;function Z(e,t){if(e&1&&(Es(0,"a",2),xC(1,"Edit skill \u2192"),hl()),e&2){let n=eC();dg("routerLink",n.editRoute());}}function ee(e,t){e&1&&(Es(0,"ds-tag",3),xC(1,"Platform level"),hl());}function te(e,t){e&1&&(Es(0,"p",4),xC(1,"Loading\u2026"),hl());}function ne(e,t){e&1&&(Es(0,"ds-notice"),xC(1,"Failed to load skill."),hl());}function ie(e,t){if(e&1&&(Es(0,"dt"),xC(1,"Created by"),hl(),Es(2,"dd"),xC(3),hl()),e&2){let n=eC(2);BE(3),Fg(n.createdBy);}}function oe(e,t){if(e&1&&(Es(0,"dt"),xC(1,"Last updated"),hl(),Es(2,"dd"),xC(3),hl()),e&2){let n=eC(2);BE(3),Fg(n.updatedOn);}}function ae(e,t){if(e&1&&(jw(0,ie,4,1),jw(1,oe,4,1)),e&2){let n=eC();Bw(n.createdBy?0:-1),BE(),Bw(n.updatedOn?1:-1);}}function le(e,t){e&1&&(Es(0,"p",4),xC(1," A platform skill is offered to every namespace. Open it from a namespace to see which of its agents use it. "),hl());}function se(e,t){e&1&&(Es(0,"p",4),xC(1,"Loading\u2026"),hl());}function re(e,t){e&1&&(Es(0,"ds-notice"),xC(1," The agent configs could not be read, so it is unknown whether any agent uses this skill. "),hl());}function de(e,t){e&1&&(Es(0,"p",4),xC(1,"No agent references this skill."),hl());}function ce(e,t){e&1&&(Es(0,"ds-tag",15),xC(1,"platform agent"),hl());}function me(e,t){e&1&&(Es(0,"ds-tag",15),xC(1,"via *"),hl());}function pe(e,t){if(e&1&&(Es(0,"li",13)(1,"span",14),xC(2),hl(),jw(3,ce,2,0,"ds-tag",15),jw(4,me,2,0,"ds-tag",15),hl()),e&2){let n=t.$implicit;BE(2),Fg(n.name),BE(),Bw(n.platform?3:-1),BE(),Bw(n.grant==="all"?4:-1);}}function ue(e,t){if(e&1&&(Es(0,"ul",12),Uw(1,pe,5,3,"li",13,Y),hl(),Es(3,"p",4),xC(4," An agent listed "),Es(5,"code"),xC(6,"via *"),hl(),xC(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. "),hl()),e&2){let n=eC(2);BE(),$w(n.consumers());}}function _e(e,t){e&1&&(Es(0,"p",4),xC(1,"No resources bundled with this skill."),hl());}function ge(e,t){if(e&1){let n=Yw();Es(0,"li")(1,"ds-disclosure",16),vg("toggled",function(){let r=pf(n).$implicit,g=eC(3);return hf(g.toggleResource(r))}),Es(2,"pre",17),xC(3),hl()()();}if(e&2){let n=t.$implicit,o=eC(3);BE(),dg("heading",n)("open",o.isResourceExpanded(n)),BE(2),Fg(o.resourceContent(n));}}function Ce(e,t){if(e&1&&(Es(0,"ul",12),Uw(1,ge,4,3,"li",null,Hw),hl()),e&2){let n=eC(2);BE(),$w(n.resourcePaths());}}function fe(e,t){if(e&1){let n=Yw();Es(0,"ds-card",5)(1,"dl",6)(2,"dt"),xC(3,"Name"),hl(),Es(4,"dd",7),xC(5),hl(),Es(6,"dt"),xC(7,"Description"),hl(),Es(8,"dd"),xC(9),hl(),Es(10,"dt"),xC(11,"Scope"),hl(),Es(12,"dd"),xC(13),hl(),Es(14,"dt"),xC(15,"Storage"),hl(),Es(16,"dd")(17,"ds-tag",8),xC(18),hl()(),jw(19,ae,2,2),hl()(),Es(20,"ds-card",9),jw(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),hl(),Es(26,"ds-card")(27,"ds-disclosure",10),vg("toggled",function(){pf(n);let r=eC();return hf(r.toggleBody())}),fg(28,"div",11),YC(29,"agentosMarkdown"),hl()(),Es(30,"ds-card",9),jw(31,_e,2,0,"p",4)(32,Ce,3,0,"ul",12),hl();}if(e&2){let n=t,o=eC();BE(5),Fg(n.name),BE(4),Fg(n.description),BE(4),Fg(n.namespaceId?"Namespace":"Platform"),BE(4),dg("variant",o.isFilesystemBacked()?"outline":"neutral"),BE(),Dl(" ",o.isFilesystemBacked()?"SKILL.md file (read-only)":"Database"," "),BE(),Bw(o.isFilesystemBacked()?-1:19),BE(),dg("heading","Used by"+(!o.isPlatformMode&&!o.consumersLoading()&&!o.consumersUnavailable()?" ("+o.consumers().length+")":"")),BE(),Bw(o.isPlatformMode?21:o.consumersLoading()?22:o.consumersUnavailable()?23:o.consumers().length===0?24:25),BE(6),dg("open",!o.bodyCollapsed()),BE(),dg("innerHTML",KC(29,12,n.body),YD),BE(2),dg("heading","Resources ("+o.resourcePaths().length+")"),BE(),Bw(o.resourcePaths().length===0?31:32);}}var X=class e{route=g(W);router=g(F);destroyRef=g(we);skillState=g(o);agentState=g(s);namespaceId=this.route.snapshot.params.namespaceId;skillId=this.route.snapshot.params.skillId;isPlatformMode=!this.namespaceId;isLoading=$i(true);hasError=$i(false);skill=$i(null);bodyCollapsed=$i(false);expandedResources=$i(new Set);resourcePaths=rT(()=>Object.keys(this.skill()?.resources??{}).sort());isFilesystemBacked=rT(()=>this.skill()?.readOnly===true);consumers=$i([]);consumersUnavailable=$i(false);consumersLoading=$i(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),by({namespace:this.agentState.listByNamespace(this.namespaceId),platform:this.agentState.listPlatform().pipe(ha(()=>br([])))}).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=vw({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&&(Es(0,"ds-page")(1,"ds-section-header",0)(2,"button",1),vg("click",function(){return o.back()}),xC(3,"\u2190 Skills"),hl(),jw(4,Z,2,1,"a",2),jw(5,ee,2,0,"ds-tag",3),hl(),jw(6,te,2,0,"p",4)(7,ne,2,0,"ds-notice")(8,fe,33,14),hl()),n&2){let r;BE(4),Bw(o.skill()&&!o.isFilesystemBacked()?4:-1),BE(),Bw(o.isPlatformMode?5:-1),BE(),Bw(o.isLoading()?6:o.hasError()?7:(r=o.skill())?8:-1,r);}},dependencies:[$t,hn,fn,rn,pn,at,ln,Fo,Pi,On],encapsulation:2})};export{X as SkillInspectComponent};