@whoz-oss/coday-client 0.0.0-workstream-forge.101 → 0.0.0-workstream-forge.103

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 (80) hide show
  1. package/browser/{chunk-spR5H-6W.js → chunk-0qQNoiHi.js} +1 -1
  2. package/browser/chunk-0slBMBEx.js +2 -0
  3. package/browser/{chunk-CGFcBWlS.js → chunk-5o3A2D6K.js} +1 -1
  4. package/browser/chunk-8xL9cvJi.js +1 -0
  5. package/browser/{chunk-Cy8V5YYe.js → chunk-B0_k8iKD.js} +1 -1
  6. package/browser/{chunk-ClmFjies.js → chunk-B4nne5HM.js} +1 -1
  7. package/browser/{chunk-DUTgv2ie.js → chunk-B9NmLoGR.js} +1 -1
  8. package/browser/{chunk-DQuNupfJ.js → chunk-BEFLkzpu.js} +1 -1
  9. package/browser/{chunk-BDClIjt_.js → chunk-BFtMOKWe.js} +1 -1
  10. package/browser/{chunk-j9VL-NZi.js → chunk-BFvwhqT6.js} +1 -1
  11. package/browser/chunk-BI-ubEAj.js +1 -0
  12. package/browser/chunk-BK3tvHpt.js +1 -0
  13. package/browser/chunk-BP3CtfbP.js +10 -0
  14. package/browser/{chunk-Dp3xB5xu.js → chunk-BPZ-hHsY.js} +1 -1
  15. package/browser/{chunk-PljuvLnA.js → chunk-BWqlsKzp.js} +1 -1
  16. package/browser/{chunk-Bb97Kx1k.js → chunk-BXOyFUSM.js} +1 -1
  17. package/browser/{chunk-BLaIJYTj.js → chunk-BcIqR0in.js} +1 -1
  18. package/browser/{chunk-PT1nxNHL.js → chunk-Bf-AddkM.js} +1 -1
  19. package/browser/{chunk-ZZzKEzSY.js → chunk-BlfMMzTk.js} +1 -1
  20. package/browser/{chunk-CTRtr19h.js → chunk-BlmB24JH.js} +1 -1
  21. package/browser/{chunk-aMjpfW4c.js → chunk-BumyvORV.js} +1 -1
  22. package/browser/{chunk-CeL5OSae.js → chunk-BwXIT1gF.js} +1 -1
  23. package/browser/{chunk-yRRB8B0R.js → chunk-Bzrv-i-W.js} +1 -1
  24. package/browser/{chunk-BNygw8cy.js → chunk-C0gHgnAQ.js} +1 -1
  25. package/browser/{chunk-BhOBAGu0.js → chunk-C4k6y6XR.js} +1 -1
  26. package/browser/{chunk-DyVTJvil.js → chunk-C7_zwtj9.js} +1 -1
  27. package/browser/{chunk-CopZgdKm.js → chunk-C8LUgzN3.js} +1 -1
  28. package/browser/{chunk-Du4XO3B9.js → chunk-C8WJeJjZ.js} +1 -1
  29. package/browser/chunk-CDLYTItS.js +1 -0
  30. package/browser/{chunk-DsvZ07ov.js → chunk-CNVa9tsp.js} +1 -1
  31. package/browser/{chunk-D-FNlEoa.js → chunk-Ccwk-uJV.js} +1 -1
  32. package/browser/{chunk-8j0zbcE8.js → chunk-CnkFFdqE.js} +1 -1
  33. package/browser/{chunk-BvCaRkbC.js → chunk-CphEbYri.js} +1 -1
  34. package/browser/{chunk-Bk4wk-Q1.js → chunk-CxrwyLWx.js} +1 -1
  35. package/browser/{chunk-D8veTI-Z.js → chunk-D-NNZ2LO.js} +1 -1
  36. package/browser/{chunk-C6CIcqIe.js → chunk-D04ajec4.js} +1 -1
  37. package/browser/{chunk-BD9QyJ_D.js → chunk-D609BtYh.js} +1 -1
  38. package/browser/{chunk-pBppBdvD.js → chunk-D94yoR5A.js} +1 -1
  39. package/browser/{chunk-DsBVpg5c.js → chunk-DChOQtmB.js} +1 -1
  40. package/browser/{chunk-DEcr5XTR.js → chunk-DD4DdLB6.js} +1 -1
  41. package/browser/{chunk-Cpofe53u.js → chunk-DFt0LZFh.js} +1 -1
  42. package/browser/{chunk-BuJ0a-jT.js → chunk-DJfFcHnA.js} +1 -1
  43. package/browser/{chunk-CyLUngtV.js → chunk-DMhNtPHF.js} +1 -1
  44. package/browser/{chunk-ChNYRuIU.js → chunk-DQMMb16A.js} +1 -1
  45. package/browser/{chunk-CXyYyXX9.js → chunk-DVHYcXYs.js} +1 -1
  46. package/browser/{chunk-BxKTxblc.js → chunk-DVMf_H2U.js} +1 -1
  47. package/browser/{chunk-DW5_PM92.js → chunk-DXEBrlZc.js} +1 -1
  48. package/browser/{chunk-BxlhPj4a.js → chunk-DaDMuEWZ.js} +1 -1
  49. package/browser/{chunk-CkzIzWyC.js → chunk-DhZmCU_j.js} +1 -1
  50. package/browser/{chunk-DI7OUCqm.js → chunk-Dhsl0085.js} +1 -1
  51. package/browser/{chunk-BAJj5ySw.js → chunk-DpJ3RNb5.js} +1 -1
  52. package/browser/{chunk-CKhMv1Ug.js → chunk-Dpy2zqhW.js} +1 -1
  53. package/browser/{chunk-B4NACXvL.js → chunk-DvlQgxuL.js} +1 -1
  54. package/browser/{chunk-ClEsObVj.js → chunk-FKXJs61S.js} +1 -1
  55. package/browser/{chunk--t7R2FQ4.js → chunk-FU8h2xDE.js} +1 -1
  56. package/browser/{chunk-D1duEHtM.js → chunk-HvxvIsr4.js} +1 -1
  57. package/browser/{chunk-C-qaxhzV.js → chunk-MaZyEbJu.js} +1 -1
  58. package/browser/{chunk-B6YuGUPU.js → chunk-PSqadSHt.js} +1 -1
  59. package/browser/{chunk-CvmyFGzy.js → chunk-TguGBWlz.js} +1 -1
  60. package/browser/{chunk-T7g1MoTP.js → chunk-YCTcFWTH.js} +1 -1
  61. package/browser/{chunk-B0ec6QE2.js → chunk-a9e-P6Xx.js} +1 -1
  62. package/browser/{chunk-Bo7GcoVn.js → chunk-enGymwZv.js} +1 -1
  63. package/browser/{chunk-C2xbdglQ.js → chunk-ev1isNKt.js} +1 -1
  64. package/browser/{chunk-CIHz2nkf.js → chunk-khw3h2Ii.js} +1 -1
  65. package/browser/{chunk-BNS4nii-.js → chunk-khxJvCBa.js} +1 -1
  66. package/browser/{chunk-CrU3BQQS.js → chunk-oKmcPv7u.js} +1 -1
  67. package/browser/{chunk-CTEyKNKm.js → chunk-q46LDcDN.js} +1 -1
  68. package/browser/{chunk-DjIEzaIJ.js → chunk-qRssQMi-.js} +1 -1
  69. package/browser/{chunk-mLUorSK3.js → chunk-rezzGMSa.js} +1 -1
  70. package/browser/{chunk-CFyEUO4f.js → chunk-vf-t0Tvp.js} +1 -1
  71. package/browser/{chunk-C_etNNrs.js → chunk-yvfx9Fz8.js} +1 -1
  72. package/browser/index.html +1 -1
  73. package/browser/{main-DB5EJGYC.js → main-PRYHWWFC.js} +13 -13
  74. package/package.json +1 -1
  75. package/browser/chunk-1I02Q6MC.js +0 -2
  76. package/browser/chunk-BCkdBoJT.js +0 -1
  77. package/browser/chunk-CVM23KJ3.js +0 -11
  78. package/browser/chunk-DxHp0kqe.js +0 -1
  79. package/browser/chunk-Gb2w1W4p.js +0 -1
  80. package/browser/chunk-fU4sX2V7.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whoz-oss/coday-client",
3
- "version": "0.0.0-workstream-forge.101",
3
+ "version": "0.0.0-workstream-forge.103",
4
4
  "repository": "https://github.com/whoz-oss/coday",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1,2 +0,0 @@
1
- import {R}from'./chunk-CTEyKNKm.js';import {g,ao as W,F,dv as _,C as Ce,G as Gi,m as mT,dw as Ie,M as By,b as U,a7 as ya,Q as br,e as xw,k as ws,q as Rg,n as GC,o as pl,J as Jw,X as XE,v as eC,a9 as lC,a3 as VI,s as rC,ac as gC,u as bg,a6 as UI,y as oC,a5 as vl,a8 as Yg,z as Ug,b0 as Qg,aa as If,ab as wf}from'./main-DB5EJGYC.js';import'./chunk-CVM23KJ3.js';import {t as ti,Q as Qn,e as ei,Y as Ye,a as wt,A as At,Z as Zn,c as cn}from'./chunk-BLaIJYTj.js';import'./chunk-Gb2w1W4p.js';import'./chunk-CKhMv1Ug.js';import'./chunk-aMjpfW4c.js';import'./chunk-D-FNlEoa.js';var $=(o,t)=>t.id;function J(o,t){o&1&&(ws(0,"p",5),GC(1,"Loading\u2026"),pl());}function Q(o,t){if(o&1&&(ws(0,"p",8),GC(1),pl()),o&2){let e=gC(2);XE(),Yg(e.errorMessage());}}function X(o,t){if(o&1){let e=lC();ws(0,"button",29),Rg("click",function(){If(e);let s=gC(2);return wf(s.retryLoad())}),GC(1,"Retry loading"),pl();}}function Z(o,t){if(o&1&&(ws(0,"span",31),GC(1),pl()),o&2){let e=gC(3);XE(),Yg(e.association()?.checkoutFailureReason);}}function ee(o,t){if(o&1&&(ws(0,"p",30),GC(1),Jw(2,Z,2,1,"span",31),pl()),o&2){let e=gC(2);Ug("namespace-git__status--failed",e.checkoutStatus()===e.CheckoutStatus.FAILED)("namespace-git__status--ready",e.checkoutStatus()===e.CheckoutStatus.READY),XE(),vl(" Repository: ",e.checkoutStatus()," "),XE(),eC(e.association()?.checkoutFailureReason?2:-1);}}function te(o,t){if(o&1&&(ws(0,"option",20),GC(1),pl()),o&2){let e=t.$implicit,l=gC(2);bg("value",e.id),XE(),Qg("",e.name," (",l.authTypeLabel(e.authType),")");}}function ne(o,t){o&1&&(ws(0,"span",21),GC(1," No usable auth setting in this namespace. Create a BEARER_TOKEN one first. "),pl());}function ie(o,t){if(o&1){let e=lC();ws(0,"button",32),Rg("click",function(){If(e);let s=gC(2);return wf(s.remove())}),GC(1," Remove association "),pl();}if(o&2){let e=gC(2);bg("disabled",!e.associationLoaded()||e.isSaving());}}function ae(o,t){if(o&1){let e=lC();ws(0,"div",6)(1,"p",7),GC(2," Associating a repository enables Git workspaces for this namespace. When worktree creation is enabled, every new top-level case 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. "),pl(),Jw(3,Q,2,1,"p",8),Jw(4,X,2,0,"button",9),Jw(5,ee,3,6,"p",10),ws(6,"fieldset",11)(7,"legend",12),GC(8,"Repository"),pl(),ws(9,"label",13)(10,"span",14),GC(11,"Repository URL"),pl(),ws(12,"input",15),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.repositoryUrl.set(s))}),pl(),VI(),ws(13,"span",16),GC(14,"HTTPS only, without credentials in the URL."),pl()(),ws(15,"label",13)(16,"span",14),GC(17,"Main branch"),pl(),ws(18,"input",17),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.mainBranch.set(s))}),pl(),VI(),ws(19,"span",16),GC(20,"New worktrees start at this branch\u2019s commit, without creating a branch."),pl()(),ws(21,"label",13)(22,"span",14),GC(23,"Service account"),pl(),ws(24,"select",18),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.serviceAuthSettingId.set(s))}),ws(25,"option",19),GC(26,"Select an auth setting\u2026"),pl(),rC(27,te,2,3,"option",20,$),pl(),VI(),ws(29,"span",16),GC(30," Shared by the namespace. Every Git operation uses this identity, never the identity of whoever opened the case. "),pl(),Jw(31,ne,2,0,"span",21),pl()(),ws(32,"fieldset",11)(33,"legend",12),GC(34,"Automation"),pl(),ws(35,"label",22)(36,"input",23),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.autoWorktree.set(s))}),pl(),VI(),ws(37,"span"),GC(38,"Create a worktree for every new top-level case"),pl()(),ws(39,"span",16),GC(40," 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(),ws(41,"label",13)(42,"span",14),GC(43,"Setup command (optional)"),pl(),ws(44,"input",24),Rg("ngModelChange",function(s){If(e);let u=gC();return wf(u.setupCommand.set(s))}),pl(),VI(),ws(45,"span",21),GC(46," 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()()(),ws(47,"div",25)(48,"button",26),Rg("click",function(){If(e);let s=gC();return wf(s.save())}),GC(49),pl(),Jw(50,ie,2,1,"button",27),ws(51,"button",28),Rg("click",function(){If(e);let s=gC();return wf(s.cancel())}),GC(52,"Cancel"),pl()()();}if(o&2){let e=gC();XE(3),eC(e.errorMessage()?3:-1),XE(),eC(e.associationLoaded()?-1:4),XE(),eC(e.isAssociated()&&e.checkoutStatus()?5:-1),XE(),bg("disabled",!e.associationLoaded()||e.isSaving()),XE(6),bg("ngModel",e.repositoryUrl()),UI(),XE(6),bg("ngModel",e.mainBranch()),UI(),XE(6),bg("ngModel",e.serviceAuthSettingId()),UI(),XE(3),oC(e.eligibleAuthSettings()),XE(4),eC(e.eligibleAuthSettings().length===0?31:-1),XE(),bg("disabled",!e.associationLoaded()||e.isSaving()),XE(4),bg("ngModel",e.autoWorktree()),UI(),XE(8),bg("ngModel",e.setupCommand()),UI(),XE(4),bg("disabled",!e.canSave()),XE(),vl(" ",e.isSaving()?"Saving\u2026":e.isAssociated()?"Update":"Associate"," "),XE(),eC(e.isAssociated()?50:-1);}}var oe=["BearerTokenAuthSetting","BasicAuthAuthSetting","ApiKeyAuthSetting"],re={BearerTokenAuthSetting:"token",BasicAuthAuthSetting:"basic auth",ApiKeyAuthSetting:"API key"},q=class o{route=g(W);router=g(F);gitApi=g(_);authSettingState=g(R);destroyRef=g(Ce);isLoading=Gi(true);isSaving=Gi(false);associationLoaded=Gi(false);errorMessage=Gi(null);association=Gi(null);authSettings=Gi([]);repositoryUrl=Gi("");mainBranch=Gi("main");serviceAuthSettingId=Gi("");autoWorktree=Gi(false);setupCommand=Gi("");namespaceId="";isAssociated=mT(()=>this.association()?.associated===true);eligibleAuthSettings=mT(()=>this.authSettings().filter(t=>oe.includes(t.authType)));authTypeLabel(t){return re[t??""]??t??"unknown"}canSave=mT(()=>this.associationLoaded()&&!this.isLoading()&&!this.isSaving()&&this.repositoryUrl().trim().length>0&&this.serviceAuthSettingId().length>0);checkoutStatus=mT(()=>this.association()?.checkoutStatus??null);CheckoutStatus=Ie;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),By({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),ya(t=>(console.error("Failed to save the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}remove(){!this.associationLoaded()||this.isLoading()||this.isSaving()||!this.isAssociated()||confirm("Remove the repository association? Existing workspaces keep their worktree.")&&(this.isSaving.set(true),this.gitApi.removeAssociationNamespaceGit(this.namespaceId).pipe(U(this.destroyRef),ya(t=>(console.error("Failed to remove the Git association",t),this.errorMessage.set(this.messageOf(t)),this.isSaving.set(false),br(null)))).subscribe(t=>{t&&this.acceptAssociation(t),this.isSaving.set(false);}));}cancel(){this.router.navigate(["/agentos/namespaces"]);}messageOf(t){return t.error?.message??t.message??"Unexpected error"}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=xw({type:o,selectors:[["agentos-namespace-git"]],decls:10,vars:1,consts:[[1,"namespace-git"],[1,"namespace-git__header"],["type","button","title","Back to namespaces",1,"namespace-git__back",3,"click"],[1,"namespace-git__back-icon"],[1,"namespace-git__title"],[1,"namespace-git__loading"],[1,"namespace-git__body"],[1,"namespace-git__hint"],["role","alert",1,"namespace-git__error"],["type","button",1,"namespace-git__retry"],[1,"namespace-git__status",3,"namespace-git__status--failed","namespace-git__status--ready"],[1,"namespace-git__section",3,"disabled"],[1,"namespace-git__label"],[1,"namespace-git__field"],[1,"namespace-git__field-label"],["type","url","placeholder","https://forge.example/org/project.git","name","repositoryUrl",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__field-hint"],["type","text","placeholder","main","name","mainBranch",1,"namespace-git__input",3,"ngModelChange","ngModel"],["name","serviceAuthSettingId",1,"namespace-git__input",3,"ngModelChange","ngModel"],["value",""],[3,"value"],[1,"namespace-git__field-hint","namespace-git__field-hint--warn"],[1,"namespace-git__checkbox"],["type","checkbox","name","autoWorktree",3,"ngModelChange","ngModel"],["type","text","placeholder","pnpm install --ignore-scripts","name","setupCommand",1,"namespace-git__input",3,"ngModelChange","ngModel"],[1,"namespace-git__actions"],["type","button",1,"namespace-git__save",3,"click","disabled"],["type","button",1,"namespace-git__remove",3,"disabled"],["type","button",1,"namespace-git__cancel",3,"click"],["type","button",1,"namespace-git__retry",3,"click"],[1,"namespace-git__status"],[1,"namespace-git__status-reason"],["type","button",1,"namespace-git__remove",3,"click","disabled"]],template:function(e,l){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return l.cancel()}),ws(3,"span",3),GC(4,"\u2190"),pl(),GC(5," Namespaces "),pl(),ws(6,"h1",4),GC(7,"Git repository"),pl()(),Jw(8,J,2,0,"p",5)(9,ae,53,14,"div",6),pl()),e&2&&(XE(8),eC(l.isLoading()?8:9));},dependencies:[ti,Qn,ei,Ye,wt,At,Zn,cn],styles:[".namespace-git[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.namespace-git__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-git__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.namespace-git__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-git__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem}.namespace-git__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.namespace-git__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__error[_ngcontent-%COMP%]{margin:0;padding:.75rem;border-radius:.375rem;background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c);font-size:.875rem}.namespace-git__status[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:.375rem;background:var(--color-surface-secondary, #f3f4f6);font-size:.875rem;display:flex;flex-direction:column;gap:.25rem}.namespace-git__status--ready[_ngcontent-%COMP%]{background:var(--color-success-bg, #ecfdf5);color:var(--color-success, #047857)}.namespace-git__status--failed[_ngcontent-%COMP%]{background:var(--red-bg, #fef2f2);color:var(--color-error, #b91c1c)}.namespace-git__status-reason[_ngcontent-%COMP%]{font-size:.8125rem;opacity:.9}.namespace-git__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.5rem;padding:1rem;margin:0}.namespace-git__label[_ngcontent-%COMP%]{font-weight:600;font-size:.9375rem;padding:0 .25rem}.namespace-git__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.namespace-git__field-label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500}.namespace-git__field-hint[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6b7280)}.namespace-git__field-hint--warn[_ngcontent-%COMP%]{color:var(--color-warning, #b45309)}.namespace-git__input[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem .625rem;border:1px solid var(--color-border, #e5e7eb);border-radius:.375rem;background:var(--color-surface, #fff);color:inherit}.namespace-git__checkbox[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;cursor:pointer}.namespace-git__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;align-items:center}.namespace-git__save[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%], .namespace-git__remove[_ngcontent-%COMP%], .namespace-git__cancel[_ngcontent-%COMP%]{font-family:inherit;font-size:.875rem;padding:.5rem 1rem;border-radius:.375rem;cursor:pointer;border:1px solid transparent}.namespace-git__save[_ngcontent-%COMP%]:disabled, .namespace-git__retry[_ngcontent-%COMP%]:disabled, .namespace-git__remove[_ngcontent-%COMP%]:disabled, .namespace-git__cancel[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.namespace-git__save[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);color:var(--color-text-on-accent, #fff)}.namespace-git__remove[_ngcontent-%COMP%]{background:none;border-color:var(--color-error, #b91c1c);color:var(--color-error, #b91c1c)}.namespace-git__cancel[_ngcontent-%COMP%], .namespace-git__retry[_ngcontent-%COMP%]{background:none;border-color:var(--color-border, #e5e7eb);color:inherit}"]})};
2
- export{q as NamespaceGitComponent};
@@ -1 +0,0 @@
1
- import {i}from'./chunk-Gb2w1W4p.js';import {l}from'./chunk-CVM23KJ3.js';import {g as g$1,dg as k,aJ as Tr,aD as Ly,bS as Ea,a7 as ya,Q as br,r as re,cE as Dd,bU as Td,w,W as x}from'./main-DB5EJGYC.js';var g="none",N="me",O=class p{nsController=g$1(k);userState=g$1(l);refresh$=new Tr(void 0);namespaceId$=new Tr(null);vm$=Ly([this.namespaceId$,this.refresh$]).pipe(Ea(([e])=>{let r=this.loadPlatformProviders().pipe(ya(()=>br([])));return e?Ly([r,this.loadNamespaceProviders(e).pipe(ya(()=>br([]))),this.loadUserProviders(e).pipe(ya(()=>br([]))),this.loadUserProviders("global").pipe(ya(()=>br([])))]).pipe(re(([i,n,s,t])=>({platform:i,namespace:n,userOnNs:s,userGlobal:t}))):Ly([r,this.loadNamespaceProviders("").pipe(ya(()=>br([]))),this.loadUserProviders("global").pipe(ya(()=>br([])))]).pipe(re(([i,n,s])=>({platform:i,namespace:n,userOnNs:[],userGlobal:s})))}),Dd({bufferSize:1,refCount:true}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e);}refresh(){this.refresh$.next();}loadUserProviders(e){let r=e==="global"?g:e;return this.nsController.listAiProvider(r,N)}userGlobal$=i(this.refresh$,()=>this.loadUserProviders("global"),[]);loadPlatformProviders(){return this.nsController.listAiProvider(g)}loadNamespaceProviders(e){return e?this.nsController.listAiProvider(e):br([])}getById(e,r){return this.nsController.getByIdAiProvider(e)}create(e,r,i){let s=this.userState.currentUser()?.id;if((r==="userOnNs"||r==="userGlobal")&&!s)throw new Error(`Cannot create ${r} provider before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(r==="namespace"){if(i===void 0||i==="")throw new Error("Cannot create namespace-scoped provider without a namespaceId");let S={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,namespaceId:i??void 0};return this.nsController.createAiProvider(S).pipe(Td(()=>this.refresh()))}if(r==="userOnNs"&&!i)throw new Error("Cannot create userOnNs provider without a namespaceId");let t={name:e.name,apiType:e.apiType,description:e.description,baseUrl:e.baseUrl,apiKey:e.apiKey,headers:e.headers??void 0,userId:s,namespaceId:r==="userOnNs"?i:void 0};return this.nsController.createAiProvider(t).pipe(Td(()=>this.refresh()))}update(e,r,i,n){let s=r.apiKey===null?{}:{apiKey:r.apiKey},t=w({name:r.name,apiType:r.apiType,description:r.description,baseUrl:r.baseUrl,headers:r.headers??void 0,namespaceId:n.namespaceId,userId:n.userId},s);return this.nsController.updateAiProvider(e,t).pipe(Td(()=>this.refresh()))}delete(e,r){return this.nsController.deleteAiProvider(e).pipe(Td(()=>this.refresh()))}static \u0275fac=function(r){return new(r||p)};static \u0275prov=x({token:p,factory:p.\u0275fac,providedIn:"root"})};export{O};