@whoz-oss/coday-client 0.0.0-workstream-forge.211 → 0.0.0-workstream-forge.212

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 (59) hide show
  1. package/browser/{chunk-Bgj7etoF.js → chunk-5qL050Ho.js} +1 -1
  2. package/browser/{chunk-DLtoJJ3j.js → chunk-9Zl9QvzC.js} +1 -1
  3. package/browser/chunk-AnKIcEBN.js +1 -0
  4. package/browser/chunk-BFEhDfVx.js +1 -0
  5. package/browser/{chunk-CQT1eqdW.js → chunk-BH__37CH.js} +1 -1
  6. package/browser/{chunk-rP5WjBf2.js → chunk-Bak9VHah.js} +1 -1
  7. package/browser/chunk-BccNSUmW.js +670 -0
  8. package/browser/{chunk-CZNE2XZK.js → chunk-BpT1O8M6.js} +1 -1
  9. package/browser/{chunk-DW84esaE.js → chunk-BpgBeyW9.js} +1 -1
  10. package/browser/{chunk-Diq931dD.js → chunk-Bu4zvbpm.js} +1 -1
  11. package/browser/{chunk-DSmFVc83.js → chunk-BuRCnaZA.js} +1 -1
  12. package/browser/{chunk-D3XznT9-.js → chunk-C-SY3Ro7.js} +1 -1
  13. package/browser/chunk-C0y7XDru.js +1 -0
  14. package/browser/{chunk-BlRU9rA1.js → chunk-CAffA-D6.js} +1 -1
  15. package/browser/{chunk-9_JaYfBs.js → chunk-CBqaaBGz.js} +1 -1
  16. package/browser/{chunk-BBei7vTg.js → chunk-CD3Vm5te.js} +1 -1
  17. package/browser/{chunk-0A3EV5Qa.js → chunk-CEOSCmN-.js} +1 -1
  18. package/browser/{chunk-BdVXBBBm.js → chunk-CFGszwMS.js} +1 -1
  19. package/browser/{chunk-DUim4ySH.js → chunk-CTIdnihi.js} +1 -1
  20. package/browser/{chunk-C3WpozGo.js → chunk-CUKpNLw9.js} +1 -1
  21. package/browser/{chunk-DZkRn2UR.js → chunk-CVNb6p67.js} +1 -1
  22. package/browser/{chunk-Co3FCW9R.js → chunk-Cbj0V2B1.js} +1 -1
  23. package/browser/{chunk-pcl3mIh5.js → chunk-Ce9hfXfk.js} +1 -1
  24. package/browser/chunk-CfMD0s4T.js +1 -0
  25. package/browser/{chunk-Dnckog_U.js → chunk-ChjWUj9t.js} +1 -1
  26. package/browser/{chunk-OlzJhOCd.js → chunk-CjNb_wWT.js} +1 -1
  27. package/browser/{chunk-BDsTbnmt.js → chunk-D-ael7oB.js} +1 -1
  28. package/browser/chunk-D0OE_PLu.js +1 -0
  29. package/browser/{chunk-DxbqqO1S.js → chunk-DADphpSr.js} +1 -1
  30. package/browser/{chunk-BQCKGYAC.js → chunk-DKhw46F8.js} +1 -1
  31. package/browser/{chunk-DZEnTWtn.js → chunk-DQNLL8O1.js} +1 -1
  32. package/browser/{chunk-BHXmm37y.js → chunk-DQm78HQP.js} +1 -1
  33. package/browser/{chunk-B_jBYavt.js → chunk-DW3xiZN9.js} +1 -1
  34. package/browser/chunk-DWa_DQgR.js +1 -0
  35. package/browser/{chunk-B_EkBaXA.js → chunk-Dn6XURLl.js} +1 -1
  36. package/browser/{chunk-CdaGyV2I.js → chunk-Duiw2-ff.js} +1 -1
  37. package/browser/{chunk-B1XV2KD8.js → chunk-FLi7fckk.js} +1 -1
  38. package/browser/{chunk-DIL9uf68.js → chunk-J-LjgLCi.js} +1 -1
  39. package/browser/{chunk-DPW4rxcC.js → chunk-MXFO2CUR.js} +1 -1
  40. package/browser/{chunk-Y8J9Yj-X.js → chunk-Y2mFCBc5.js} +1 -1
  41. package/browser/{chunk-B04OiezY.js → chunk-_aUfX5al.js} +1 -1
  42. package/browser/chunk-jn4zemij.js +1 -0
  43. package/browser/chunk-nJvzsHku.js +1 -0
  44. package/browser/{chunk-C6vLjLOh.js → chunk-naW0S1QB.js} +1 -1
  45. package/browser/{chunk-NWfxg9Dl.js → chunk-rAOFDmJ6.js} +1 -1
  46. package/browser/{chunk-DYHzKfHK.js → chunk-xDsKpz8K.js} +1 -1
  47. package/browser/index.html +1 -1
  48. package/browser/main-QSOO7H67.js +1253 -0
  49. package/package.json +1 -1
  50. package/browser/chunk-Bx4icy54.js +0 -1
  51. package/browser/chunk-CGu7hdyG.js +0 -1
  52. package/browser/chunk-CY321iA6.js +0 -1
  53. package/browser/chunk-Co_j5PnK.js +0 -1
  54. package/browser/chunk-Cy2rBPs3.js +0 -670
  55. package/browser/chunk-DTLIV6p0.js +0 -1
  56. package/browser/chunk-KAFiAUfR.js +0 -1
  57. package/browser/chunk-QiZaw9O5.js +0 -1
  58. package/browser/chunk-mHGOIIOh.js +0 -1
  59. package/browser/main-NORZ3O7H.js +0 -1253
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whoz-oss/coday-client",
3
- "version": "0.0.0-workstream-forge.211",
3
+ "version": "0.0.0-workstream-forge.212",
4
4
  "repository": "https://github.com/whoz-oss/coday",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- import {y,p as pt,T as Te,a as fn,U as Ut,n as nd,l as bo,x as xo,L as Lt,G as Gt,m as mo,b as po,A as An,v as va,c as pn,h as hn,d as cn,e as dn,o as on,g as at,i as an,q as sn,j as ko}from'./chunk-Cy2rBPs3.js';import {g,I as Ie,W,J,U as Ui,E as U,m as mw,D as Ds,l as lg,R as mg,P as Pw,a as pl,T as SI,M as MC,j as jE,Q as ug,L as Lw,Y as MI,v as vl,a4 as je,a5 as yd,a6 as x,X as Xw,q as qw,O as Og,a7 as On,r as df,s as ff,i as Vw,H as Hw}from'./main-NORZ3O7H.js';var I=class e{api=g(je);isLoading=Ui(false);result=Ui(null);errorMessage=Ui(null);invoke(t,n,o,l){return this.isLoading.set(true),this.result.set(null),this.errorMessage.set(null),this.api.invoke({namespaceId:t,userId:n||void 0,toolName:o,payload:l||void 0}).pipe(yd({next:v=>{this.result.set(v),this.isLoading.set(false);},error:v=>{this.errorMessage.set(le(v)),this.isLoading.set(false);}}))}reset(){this.result.set(null),this.errorMessage.set(null);}static \u0275fac=function(n){return new(n||e)};static \u0275prov=x({token:e,factory:e.\u0275fac,providedIn:"root"})};function le(e){if(e instanceof On){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 de=(e,t)=>t.id;function me(e,t){e&1&&(Ds(0,"p",14),MC(1,"Loading namespaces\u2026"),pl());}function pe(e,t){if(e&1&&(Ds(0,"option",17),MC(1),pl()),e&2){let n=t.$implicit;ug("value",n.id),jE(),Og(n.name);}}function ce(e,t){if(e&1&&(Ds(0,"select",15)(1,"option",16),MC(2,"Select a namespace"),pl(),Vw(3,pe,2,2,"option",17,de),pl(),SI()),e&2){let n=Xw(2);MI(),jE(3),Hw(n.namespaces());}}function ue(e,t){if(e&1&&Pw(0,me,2,0,"p",14)(1,ce,5,0,"select",15),e&2){let n=Xw();Lw(n.namespacesLoading()?0:1);}}function fe(e,t){if(e&1&&lg(0,"input",3),e&2){let n=Xw();ug("value",n.namespaceName()??n.namespaceId);}}function ge(e,t){if(e&1){let n=qw();Ds(0,"button",18),mg("click",function(){df(n);let l=Xw();return ff(l.reset())}),MC(1,"Clear result"),pl();}}function ve(e,t){e&1&&(Ds(0,"ds-card",12)(1,"pre",19),MC(2),pl()()),e&2&&(jE(2),Og(t));}function ye(e,t){e&1&&(Ds(0,"span",21),MC(1,"Metadata"),pl(),Ds(2,"pre",19),MC(3),pl()),e&2&&(jE(3),Og(t));}function Ce(e,t){if(e&1&&(Ds(0,"dt"),MC(1,"Type"),pl(),Ds(2,"dd",23),MC(3),pl()),e&2){let n=Xw(2);jE(3),Og(n.errorType);}}function _e(e,t){if(e&1&&(Ds(0,"dt"),MC(1,"Message"),pl(),Ds(2,"dd"),MC(3),pl()),e&2){let n=Xw(2);jE(3),Og(n.errorMessage);}}function be(e,t){if(e&1&&(Ds(0,"span",21),MC(1,"Tool error details"),pl(),Ds(2,"dl",22),Pw(3,Ce,4,1),Pw(4,_e,4,1),pl()),e&2){let n=Xw();jE(3),Lw(n.errorType?3:-1),jE(),Lw(n.errorMessage?4:-1);}}function he(e,t){if(e&1&&(Ds(0,"ds-card",13)(1,"div")(2,"ds-tag",20),MC(3),pl()(),Ds(4,"span",21),MC(5,"Output"),pl(),Ds(6,"pre",19),MC(7),pl(),Pw(8,ye,4,1),Ds(9,"span",21),MC(10,"Structured output"),pl(),Ds(11,"pre",19),MC(12),pl(),Pw(13,be,5,2),pl()),e&2){let n,o=t,l=Xw();ug("heading","Result \u2014 "+o.toolName),jE(2),ug("variant",o.success?"accent":"outline"),jE(),Og(o.success?"Success":"Tool error"),jE(4),Og(o.output),jE(),Lw((n=l.formatMetadata(o.metadata))?8:-1,n),jE(4),Og(l.formatStructuredOutput(o.structuredOutput)??"null"),jE(),Lw(o.errorType||o.errorMessage?13:-1);}}var re=class e{destroyRef=g(Ie);route=g(W);namespaceController=g(J);userState=g(y);state=g(I);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;namespaces=Ui([]);namespacesLoading=Ui(true);namespaceName=Ui(null);form=new pt({namespaceId:new Te("",{nonNullable:true,validators:[fn.required]}),userId:new Te("",{nonNullable:true}),toolName:new Te("",{nonNullable:true,validators:[fn.required]}),payload:new Te("",{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:n=>{n.id&&this.form.controls.userId.patchValue(n.id);}}),this.isPlatformMode?this.namespaceController.listAllNamespace().pipe(U(this.destroyRef)).subscribe({next:n=>{this.namespaces.set(n.map(o=>({id:o.id,name:o.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:n=>this.namespaceName.set(n.name),error:()=>this.namespaceName.set(this.namespaceId)}));}submit(){if(this.form.invalid||this.state.isLoading())return;let{namespaceId:t,userId:n,toolName:o,payload:l}=this.form.getRawValue();this.state.invoke(t,n.trim()||void 0,o.trim(),l.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(n){return new(n||e)};static \u0275cmp=mw({type:e,selectors:[["agentos-tool-invoke"]],decls:18,vars:8,consts:[["title","Tool invoke",3,"description"],[1,"ds-form",3,"ngSubmit","formGroup"],["label","Namespace","controlId","ti-namespace","required",""],["dsControl","","id","ti-namespace","type","text","readonly","",3,"value"],["label","User ID","labelHint","optional","controlId","ti-user"],["dsControl","","id","ti-user","type","text","formControlName","userId","placeholder","UUID of the user \u2014 adds user-scoped overlay layers","autocomplete","off"],["label","Tool name","controlId","ti-tool","required","","hint","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."],["dsControl","","mono","","id","ti-tool","type","text","formControlName","toolName","placeholder","e.g. MY_FILES__listFiles","autocomplete","off","spellcheck","false"],["label","Payload","labelHint","optional","controlId","ti-payload"],["dsControl","","mono","","id","ti-payload","formControlName","payload","rows","6","placeholder",'JSON arguments for the tool, e.g. {"path": "/some/dir"} \u2014 leave empty for tools with no input.',"spellcheck","false"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button"],["heading","Error"],[3,"heading"],[1,"ds-hint"],["dsControl","","id","ti-namespace","formControlName","namespaceId"],["value","","disabled",""],[3,"value"],["dsButton","","type","button",3,"click"],[1,"ds-pre"],[3,"variant"],[1,"ds-micro"],["dsDefinitionList",""],[1,"ds-mono"]],template:function(n,o){if(n&1&&(Ds(0,"ds-page"),lg(1,"ds-section-header",0),Ds(2,"form",1),mg("ngSubmit",function(){return o.submit()}),Ds(3,"ds-form-field",2),Pw(4,ue,2,1)(5,fe,1,1,"input",3),pl(),Ds(6,"ds-form-field",4),lg(7,"input",5),SI(),pl(),Ds(8,"ds-form-field",6),lg(9,"input",7),SI(),pl(),Ds(10,"ds-form-field",8),lg(11,"textarea",9),SI(),pl(),Ds(12,"ds-form-actions")(13,"button",10),MC(14),pl(),Pw(15,ge,2,0,"button",11),pl()(),Pw(16,ve,3,1,"ds-card",12),Pw(17,he,14,7,"ds-card",13),pl()),n&2){let l,v;jE(),ug("description",o.isPlatformMode?"Execute any registered tool directly \u2014 bypasses the normal agent-run pipeline. Restricted to super-admins.":"Execute a registered tool directly in this namespace \u2014 bypasses the normal agent-run pipeline."),jE(),ug("formGroup",o.form),jE(2),Lw(o.isPlatformMode?4:5),jE(3),MI(),jE(2),MI(),jE(2),MI(),jE(2),ug("disabled",o.form.invalid||o.state.isLoading()),jE(),vl(" ",o.state.isLoading()?"Running\u2026":"Run tool"," "),jE(),Lw(o.state.result()||o.state.errorMessage()?15:-1),jE(),Lw((l=o.state.errorMessage())?16:-1,l),jE(),Lw((v=o.state.result())?17:-1,v);}},dependencies:[Ut,nd,bo,xo,Lt,Gt,mo,po,An,va,pn,hn,cn,dn,on,at,an,sn,ko],encapsulation:2})};export{re as ToolInvokeComponent};
@@ -1 +0,0 @@
1
- import {y}from'./chunk-Cy2rBPs3.js';import {g,aB as ie,aC as T,aa as Cr,a1 as fa,ad as ne,a2 as da,aD as Uy,a6 as x}from'./main-NORZ3O7H.js';var v=class i{userState=g(y);membership=g(ie);currentUser$=T(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return Cr(false);let t=this.cache.get(e);if(t)return t;let s=this.currentUser$.pipe(fa(a=>a?a.isAdmin?Cr(true):this.membership.getMembersNamespaceMembership(e).pipe(ne(d=>d.some(n=>n.id===a.id&&n.role==="ADMIN")),da(()=>Cr(false))):Cr(false)),Uy({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 {f,a4 as id,n as nd,L as Lt,m as mo,b as po,a5 as so,a6 as da,a7 as ra,c as pn,h as hn,d as cn,C as mn,g as at,i as an,I as Io,a8 as f$1}from'./chunk-Cy2rBPs3.js';import {g,W,aM as Y,U as Ui,ab as ue$1,o as Af,m as mw,aN as pb,D as Ds,l as lg,P as Pw,a as pl,j as jE,L as Lw,ak as md,a1 as fa,a3 as nn,ac as Ty,a2 as da$1,M as MC,q as qw,R as mg,aO as Bg,T as SI,X as Xw,aP as jg,Y as MI,i as Vw,H as Hw,aQ as UC,aR as HC,O as Og,f as cg,av as $C,aw as GC,as as kg,v as vl,aS as WC,r as df,s as ff,aT as kC}from'./main-NORZ3O7H.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),MC(1,"Loading usage settings\u2026"),pl());}function fe(e,a){if(e&1){let t=qw();Ds(0,"ds-notice"),MC(1,"Could not load usage settings. Please try again."),pl(),Ds(2,"div")(3,"button",3),mg("click",function(){df(t);let s=Xw();return ff(s.configuration.retry())}),MC(4,"Retry usage settings"),pl()();}}function ye(e,a){e&1&&(Ds(0,"p",2),MC(1,"Usage tracking is disabled."),pl());}function be(e,a){e&1&&(Ds(0,"ds-notice"),MC(1),pl()),e&2&&(jE(),Og(a));}function xe(e,a){e&1&&(Ds(0,"p",2),MC(1,"Loading usage\u2026"),pl());}function he(e,a){e&1&&(Ds(0,"p",12),MC(1,"No recorded usage for this period."),pl());}function Se(e,a){if(e&1&&(Ds(0,"p",10),MC(1),pl()),e&2){let t=Xw().$implicit;jE(),vl("",t.aggregate.unknownCostCount," record(s) with unknown cost");}}function we(e,a){if(e&1&&(Ds(0,"tr",16)(1,"td",18),MC(2),pl(),Ds(3,"td",19),MC(4),$C(5,"number"),pl(),Ds(6,"td",20),MC(7),$C(8,"number"),$C(9,"number"),pl(),Ds(10,"td",21),MC(11),$C(12,"number"),$C(13,"number"),pl(),Ds(14,"td",22),MC(15),$C(16,"agentosCost"),Pw(17,Se,2,1,"p",10),pl()()),e&2){let t=a.$implicit;jE(2),Og(t.key),jE(2),Og(GC(5,8,t.aggregate.totalTokens)),jE(3),kg(" ",GC(8,10,t.aggregate.inputTokens)," / ",GC(9,12,t.aggregate.outputTokens)," "),jE(4),kg(" ",GC(12,14,t.aggregate.cacheReadTokens)," / ",GC(13,16,t.aggregate.cacheWriteTokens)," "),jE(4),vl(" ",WC(16,18,t.aggregate.cost,t.aggregate.unknownCostCount)," "),jE(2),Lw(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),MC(5,"Name"),pl(),Ds(6,"th",17),MC(7,"Tokens"),pl(),Ds(8,"th",17),MC(9,"Input / output"),pl(),Ds(10,"th",17),MC(11,"Cache read / write"),pl(),Ds(12,"th",17),MC(13,"Estimated cost"),pl()()(),Ds(14,"tbody",15),Vw(15,we,18,21,"tr",16,_e),pl()()()),e&2){let t=Xw().$implicit;jE(),cg("aria-label","Usage "+t.title.toLowerCase()),jE(14),Hw(t.rows);}}function Ne(e,a){if(e&1&&(Ds(0,"h3",11),MC(1),pl(),Pw(2,he,2,0,"p",12)(3,ve,17,1,"div",13)),e&2){let t=a.$implicit;jE(),Og(t.title),jE(),Lw(t.rows.length===0?2:3);}}function Te(e,a){if(e&1&&(Vw(0,Ne,4,2,null,null,ue),Ds(2,"p",10),MC(3," Unpriced usage is kept separate from known costs. Active agent runs appear here after they finish. "),pl()),e&2){let t=Xw(2);Hw(UC(4,ge,HC(0,ce,t.agents()),HC(2,pe,t.models())));}}function Ee(e,a){if(e&1){let t=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(t);let s=Xw();return ff(s.load())}),Ds(1,"ds-form-field",5)(2,"input",6),Bg("ngModelChange",function(s){df(t);let m=Xw();return kC(m.from,s)||(m.from=s),ff(s)}),pl(),SI(),pl(),Ds(3,"ds-form-field",7)(4,"input",8),Bg("ngModelChange",function(s){df(t);let m=Xw();return kC(m.to,s)||(m.to=s),ff(s)}),pl(),SI(),pl(),Ds(5,"button",9),MC(6,"Refresh"),pl()(),Pw(7,be,2,1,"ds-notice"),Pw(8,xe,2,0,"p",2)(9,Te,4,7);}if(e&2){let t,r=Xw();jE(2),jg("ngModel",r.from),MI(),jE(2),jg("ngModel",r.to),MI(),jE(3),Lw((t=r.error())?7:-1,t),jE(),Lw(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 ue$1;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=mw({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),Pw(2,Ce,2,0,"p",2)(3,fe,5,0)(4,ye,2,0,"p",2)(5,Ee,10,4),pl()),t&2&&(jE(2),Lw(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,pb,f$1],encapsulation:2})};export{me as NamespaceUsageComponent};
@@ -1 +0,0 @@
1
- import {f,y,p as pt,T as Te,a as fn,U as Ut,n as nd,L as Lt,k as kn,m as mo,b as po,$ as $r,V as Vn,A as An,c as pn,h as hn,d as cn,e as dn,g as at,i as an}from'./chunk-Cy2rBPs3.js';import {g,W,F,J,I as Ie,K as KC,U as Ui,o as Af,E as U,G as w,N as x,m as mw,D as Ds,l as lg,P as Pw,a as pl,Q as ug,j as jE,L as Lw,M as MC,q as qw,R as mg,T as SI,X as Xw,Y as MI,f as cg,v as vl,r as df,s as ff}from'./main-NORZ3O7H.js';var ne=/^(\/|[A-Za-z]:[\\/]|\\\\)/;function re(i){return ne.test(i)}function ee(i=()=>true){return t=>{let e=(t.value??"").trim();return !i()||e===""||re(e)?null:{absolutePath:true}}}function ae(i,t){i&1&&(Ds(0,"p",2),MC(1,"Loading\u2026"),pl());}function ie(i,t){if(i&1){let e=qw();Ds(0,"form",4),mg("ngSubmit",function(){df(e);let p=Xw();return ff(p.submit())}),Ds(1,"ds-form-field",5),lg(2,"input",6),SI(),pl(),Ds(3,"ds-form-field",7),lg(4,"textarea",8),SI(),pl(),Ds(5,"ds-form-field",9),lg(6,"input",10),SI(),pl(),Ds(7,"ds-form-field",11),lg(8,"input",12),SI(),pl(),Ds(9,"ds-form-field",13),lg(10,"input",14),SI(),pl(),Ds(11,"ds-form-field",15),lg(12,"input",16),SI(),pl(),Ds(13,"ds-form-field",17),lg(14,"input",18),SI(),pl(),Ds(15,"ds-form-field",19)(16,"input",20),mg("input",function(p){df(e);let oe=Xw();return ff(oe.onMaxToolRoundsInput(p))}),pl(),SI(),pl(),Ds(17,"ds-form-actions")(18,"button",21),MC(19),pl(),Ds(20,"button",22),mg("click",function(){df(e);let p=Xw();return ff(p.cancel())}),MC(21,"Cancel"),pl()()();}if(i&2){let e=Xw();ug("formGroup",e.form),jE(2),ug("formControl",e.nameControl),MI(),jE(2),ug("formControl",e.descriptionControl),MI(),jE(2),ug("formControl",e.externalIdControl),MI(),jE(2),ug("formControl",e.defaultAgentNameControl),MI(),jE(2),ug("formControl",e.configPathControl),MI(),jE(),ug("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),jE(),ug("readOnly",!e.canEditSharedExchangePath())("formControl",e.sharedExchangePathControl),cg("aria-invalid",e.canEditSharedExchangePath()&&e.sharedExchangePathControl.invalid),MI(),jE(),ug("hint",e.runCostThresholdHint()),jE(),ug("placeholder",e.runCostThresholdPlaceholder())("formControl",e.runCostThresholdControl),MI(),jE(),ug("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),jE(),ug("formControl",e.maxToolRoundsControl),cg("aria-invalid",e.maxToolRoundsControl.invalid||e.maxToolRoundsUnparsable()),MI(),jE(2),ug("disabled",e.form.invalid||e.isSubmitting()),jE(),vl(" ",e.isEditMode()?"Save changes":"Create"," ");}}var le=1,se=2147483647,te=class i{route=g(W);router=g(F);namespaceController=g(J);destroyRef=g(Ie);usageConfiguration=g(f);userState=g(y);canEditSharedExchangePath=KC(()=>this.userState.currentUser()?.isAdmin===true);sharedExchangePathHint=KC(()=>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=KC(()=>{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=KC(()=>{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:[fn.required,fn.minLength(1)]}),description:new Te("",{nonNullable:true}),configPath:new Te("",{nonNullable:true}),sharedExchangePath:new Te("",{nonNullable:true,validators:[ee(()=>this.canEditSharedExchangePath())]}),externalId:new Te("",{nonNullable:true}),defaultAgentName:new Te("",{nonNullable:true}),runCostThreshold:new Te(null),maxToolRounds:new Te(null,{validators:[fn.min(le),fn.max(se),fn.pattern(/^\d+$/)]})});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}maxToolRoundsUnparsable=Ui(false);onMaxToolRoundsInput(t){this.maxToolRoundsUnparsable.set(t.target.validity.badInput);}isEditMode=Ui(false);isSubmitting=Ui(false);isLoading=Ui(false);existingNamespace=null;constructor(){Af(()=>{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.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}),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=mw({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"],["dsButton","","variant","primary","type","submit",3,"disabled"],["dsButton","","type","button",3,"click"]],template:function(e,u){e&1&&(Ds(0,"ds-page",0),lg(1,"ds-section-header",1),Pw(2,ae,2,0,"p",2)(3,ie,22,19,"form",3),pl()),e&2&&(ug("framed",!u.isEditMode()),jE(),ug("title",u.isEditMode()?"Edit namespace":"New namespace"),jE(),Lw(u.isLoading()?2:3));},dependencies:[Ut,nd,Lt,kn,mo,po,$r,Vn,An,pn,hn,cn,dn,at,an],encapsulation:2})};export{te as NamespaceFormComponent};