@knoflows/engine 0.1.0 → 0.1.1-alpha.1
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.
- package/dist/engine.js +19 -19
- package/dist/migrations/20260921193000_local_repo_remote/migration.sql +3 -0
- package/dist/migrations/20260921193000_local_repo_remote/snapshot.json +1378 -0
- package/package.json +1 -1
- package/static/assets/i18n/en.json +14 -0
- package/static/assets/i18n/es.json +14 -0
- package/static/{chunk-BRZ5T52h.js → chunk-1s-6iZs8.js} +1 -1
- package/static/{chunk-DSgUAlqN.js → chunk-8INlEe9b.js} +1 -1
- package/static/chunk-96ta9Sdz.js +1 -0
- package/static/{chunk-7NTQwN96.js → chunk-9I0-e_3z.js} +1 -1
- package/static/{chunk-BcQQgpKh.js → chunk-B3UE2A3I.js} +1 -1
- package/static/chunk-BDDp2BQi.js +1 -0
- package/static/{chunk-Dx92ksvP.js → chunk-BJVGVLQp.js} +1 -1
- package/static/{chunk-VXZaUyyE.js → chunk-BZBN-IEB.js} +1 -1
- package/static/{chunk-CRGkNzel.js → chunk-Bayax3su.js} +2 -2
- package/static/chunk-BbtIjpMQ.js +5 -0
- package/static/{chunk-BCHj6l85.js → chunk-BgIY3xBH.js} +1 -1
- package/static/{chunk-CPNxRF7A.js → chunk-BrckDrlX.js} +1 -1
- package/static/{chunk-CuwZV6XG.js → chunk-Ce3aSFve.js} +1 -1
- package/static/{chunk-DvWh-Q5D.js → chunk-CepRGzVJ.js} +1 -1
- package/static/{chunk-DEF7Ge5B.js → chunk-CqhV23s2.js} +1 -1
- package/static/{chunk-C9PkSfMb.js → chunk-CsJt5dbK.js} +1 -1
- package/static/{chunk-BrP_q6LZ.js → chunk-CtFtOXy4.js} +1 -1
- package/static/{chunk-BIdwV0jx.js → chunk-CuBg4N16.js} +1 -1
- package/static/chunk-D-L7yklF.js +1 -0
- package/static/{chunk-ZqQUQSE8.js → chunk-DDkLmxql.js} +1 -1
- package/static/{chunk-DAONFRT8.js → chunk-DF1Zujdm.js} +1 -1
- package/static/{chunk-Dg-4XevL.js → chunk-DFHhTmIq.js} +1 -1
- package/static/{chunk-Bv1r1Ly-.js → chunk-DKjiFhsx.js} +1 -1
- package/static/{chunk-hpn_m1ZC.js → chunk-DP75g4hD.js} +1 -1
- package/static/chunk-DX21GXyA.js +1 -0
- package/static/{chunk-Ysn4Fbgj.js → chunk-DaP135hJ.js} +1 -1
- package/static/{chunk-B_R_vsLt.js → chunk-Dgi_aaUY.js} +1 -1
- package/static/{chunk-DVJ9L-aC.js → chunk-DiKEYJdn.js} +1 -1
- package/static/{chunk-DHC_yfIa.js → chunk-Dl_fBMXY.js} +1 -1
- package/static/{chunk-Cvoe3MtC.js → chunk-Dqjhd0t8.js} +1 -1
- package/static/{chunk-CV-FUe_H.js → chunk-DuhskOh7.js} +1 -1
- package/static/{chunk-5xJXPFlv.js → chunk-DvI50p6W.js} +1 -1
- package/static/chunk-Ou4ZHVyl.js +1 -0
- package/static/{chunk-D3JZ8ur5.js → chunk-XJrnAloK.js} +3 -3
- package/static/{chunk-CLM-K-Vg.js → chunk-djGmnQaE.js} +1 -1
- package/static/{chunk-CZoPJsBm.js → chunk-lQWDKNhr.js} +1 -1
- package/static/chunk-rTfgntJ9.js +1 -0
- package/static/{chunk-xeQj_hSF.js → chunk-wWwVqMLO.js} +1 -1
- package/static/{chunk-DyiDg8XX.js → chunk-wqJvNV4X.js} +1 -1
- package/static/{chunk-BIL86kgf.js → chunk-wu6SvZ0s.js} +1 -1
- package/static/index.html +1 -1
- package/static/{main-SI5AKDMC.js → main-Q5LNROCU.js} +1 -1
- package/static/chunk--WRMKpmO.js +0 -5
- package/static/chunk-BaYdwXIA.js +0 -1
- package/static/chunk-C3Xml1YG.js +0 -1
- package/static/chunk-DDhSFoAE.js +0 -1
- package/static/chunk-DaO-gpzS.js +0 -1
- package/static/chunk-pi-mtheN.js +0 -1
package/package.json
CHANGED
|
@@ -55,12 +55,18 @@
|
|
|
55
55
|
"local-repos.column.localPath": "Repository path",
|
|
56
56
|
"local-repos.column.worktreeBasePath": "Worktree base",
|
|
57
57
|
"local-repos.column.defaultBranch": "Default branch",
|
|
58
|
+
"local-repos.column.remoteRepo": "Remote repository",
|
|
58
59
|
"local-repos.column.actions": "Actions",
|
|
59
60
|
"local-repos.form.name": "Name",
|
|
60
61
|
"local-repos.form.localPath": "Repository path",
|
|
61
62
|
"local-repos.form.worktreeBasePath": "Worktree base path (optional)",
|
|
62
63
|
"local-repos.form.worktreeBaseHint": "Defaults to a sibling folder next to the repository. Do not nest worktrees inside the repo itself.",
|
|
63
64
|
"local-repos.form.defaultBranch": "Default branch (optional)",
|
|
65
|
+
"local-repos.form.remoteInstance": "Remote provider instance (optional)",
|
|
66
|
+
"local-repos.form.remoteInstancePlaceholder": "Not linked",
|
|
67
|
+
"local-repos.form.remoteIdentifier": "Remote repository",
|
|
68
|
+
"local-repos.form.remoteIdentifierPlaceholder": "Choose a known repository",
|
|
69
|
+
"local-repos.form.remoteHint": "Link this checkout to a specific provider instance's remote repo so workflows can resolve it from a pull request.",
|
|
64
70
|
"local-repos.loadFailed": "Failed to load local repositories",
|
|
65
71
|
"local-repos.saveFailed": "Failed to save local repository",
|
|
66
72
|
"local-repos.deleteFailed": "Failed to delete local repository",
|
|
@@ -362,6 +368,10 @@
|
|
|
362
368
|
"step-list.createWorktree.newBranch": "New branch",
|
|
363
369
|
"step-list.createWorktree.existingBranch": "Existing branch",
|
|
364
370
|
"step-list.createWorktree.repoPath": "Repository path",
|
|
371
|
+
"step-list.createWorktree.repoSource": "Repository",
|
|
372
|
+
"step-list.createWorktree.repoPathPick": "Choose a local path",
|
|
373
|
+
"step-list.createWorktree.resolveFromPr": "Resolve automatically from PR",
|
|
374
|
+
"step-list.createWorktree.resolveFromPrHint": "At run time, uses the registered local repository that matches this pull request's remote repo. Link one under Manage → Local Repositories.",
|
|
365
375
|
"step-list.createWorktree.catalogPlaceholder": "Choose from catalog",
|
|
366
376
|
"step-list.createWorktree.browseManually": "Or browse manually",
|
|
367
377
|
"step-list.createWorktree.baseBranch": "Base branch",
|
|
@@ -465,6 +475,8 @@
|
|
|
465
475
|
"settings.bitbucket.baseUrl": "Bitbucket base URL",
|
|
466
476
|
"settings.bitbucket.email": "Bitbucket email",
|
|
467
477
|
"settings.bitbucket.workspace": "Bitbucket workspace",
|
|
478
|
+
"settings.bitbucket.knownRepoSlugs": "Known repositories",
|
|
479
|
+
"settings.bitbucket.knownRepoSlugsHint": "Remote repo slugs commonly queried for pull requests. Separate from local checkouts on Manage → Repositories.",
|
|
468
480
|
"settings.apiKey.label": "API key",
|
|
469
481
|
"settings.apiKey.configured": "Configured ✓",
|
|
470
482
|
"settings.apiKey.notConfigured": "Not configured",
|
|
@@ -563,6 +575,8 @@
|
|
|
563
575
|
"views.editor.template": "Template",
|
|
564
576
|
"views.editor.pickTemplate": "Choose a query template, or switch to raw JSON",
|
|
565
577
|
"views.editor.missingParam": "{{label}} is required",
|
|
578
|
+
"views.editor.useAllKnownRepos": "Use all known repositories",
|
|
579
|
+
"views.editor.knownReposOverLimit": "You have {{count}} known repos; select up to {{limit}}",
|
|
566
580
|
"views.editor.resolveFailed": "Failed to resolve query template",
|
|
567
581
|
"views.editor.invalidJson": "Query must be a JSON object",
|
|
568
582
|
"views.editor.validation": "Validation",
|
|
@@ -55,12 +55,18 @@
|
|
|
55
55
|
"local-repos.column.localPath": "Ruta del repositorio",
|
|
56
56
|
"local-repos.column.worktreeBasePath": "Base de worktrees",
|
|
57
57
|
"local-repos.column.defaultBranch": "Rama por defecto",
|
|
58
|
+
"local-repos.column.remoteRepo": "Repositorio remoto",
|
|
58
59
|
"local-repos.column.actions": "Acciones",
|
|
59
60
|
"local-repos.form.name": "Nombre",
|
|
60
61
|
"local-repos.form.localPath": "Ruta del repositorio",
|
|
61
62
|
"local-repos.form.worktreeBasePath": "Ruta base de worktrees (opcional)",
|
|
62
63
|
"local-repos.form.worktreeBaseHint": "Por defecto es una carpeta hermana junto al repositorio. No anides worktrees dentro del propio repo.",
|
|
63
64
|
"local-repos.form.defaultBranch": "Rama por defecto (opcional)",
|
|
65
|
+
"local-repos.form.remoteInstance": "Instancia de proveedor remoto (opcional)",
|
|
66
|
+
"local-repos.form.remoteInstancePlaceholder": "Sin vincular",
|
|
67
|
+
"local-repos.form.remoteIdentifier": "Repositorio remoto",
|
|
68
|
+
"local-repos.form.remoteIdentifierPlaceholder": "Elige un repositorio conocido",
|
|
69
|
+
"local-repos.form.remoteHint": "Vincula esta copia local a un repositorio remoto de una instancia concreta para que los flujos puedan resolverlo desde un pull request.",
|
|
64
70
|
"local-repos.loadFailed": "No se pudieron cargar los repositorios locales",
|
|
65
71
|
"local-repos.saveFailed": "No se pudo guardar el repositorio local",
|
|
66
72
|
"local-repos.deleteFailed": "No se pudo eliminar el repositorio local",
|
|
@@ -362,6 +368,10 @@
|
|
|
362
368
|
"step-list.createWorktree.newBranch": "Rama nueva",
|
|
363
369
|
"step-list.createWorktree.existingBranch": "Rama existente",
|
|
364
370
|
"step-list.createWorktree.repoPath": "Ruta del repositorio",
|
|
371
|
+
"step-list.createWorktree.repoSource": "Repositorio",
|
|
372
|
+
"step-list.createWorktree.repoPathPick": "Elegir una ruta local",
|
|
373
|
+
"step-list.createWorktree.resolveFromPr": "Resolver automáticamente desde el PR",
|
|
374
|
+
"step-list.createWorktree.resolveFromPrHint": "En tiempo de ejecución usa el repositorio local registrado que coincida con el remoto de este pull request. Vincula uno en Gestionar → Repositorios.",
|
|
365
375
|
"step-list.createWorktree.catalogPlaceholder": "Elegir del catálogo",
|
|
366
376
|
"step-list.createWorktree.browseManually": "O examinar manualmente",
|
|
367
377
|
"step-list.createWorktree.baseBranch": "Rama base",
|
|
@@ -465,6 +475,8 @@
|
|
|
465
475
|
"settings.bitbucket.baseUrl": "URL base de Bitbucket",
|
|
466
476
|
"settings.bitbucket.email": "Correo de Bitbucket",
|
|
467
477
|
"settings.bitbucket.workspace": "Espacio de trabajo de Bitbucket",
|
|
478
|
+
"settings.bitbucket.knownRepoSlugs": "Repositorios conocidos",
|
|
479
|
+
"settings.bitbucket.knownRepoSlugsHint": "Slugs remotos que sueles consultar para pull requests. Independiente de las copias locales en Gestionar → Repositorios.",
|
|
468
480
|
"settings.apiKey.label": "Clave de API",
|
|
469
481
|
"settings.apiKey.configured": "Configurada ✓",
|
|
470
482
|
"settings.apiKey.notConfigured": "No configurada",
|
|
@@ -563,6 +575,8 @@
|
|
|
563
575
|
"views.editor.template": "Plantilla",
|
|
564
576
|
"views.editor.pickTemplate": "Elige una plantilla de consulta, o pasa a JSON en crudo",
|
|
565
577
|
"views.editor.missingParam": "{{label}} es obligatorio",
|
|
578
|
+
"views.editor.useAllKnownRepos": "Usar todos los repositorios conocidos",
|
|
579
|
+
"views.editor.knownReposOverLimit": "Tienes {{count}} repositorios conocidos; selecciona como máximo {{limit}}",
|
|
566
580
|
"views.editor.resolveFailed": "No se pudo resolver la plantilla de consulta",
|
|
567
581
|
"views.editor.invalidJson": "La consulta debe ser un objeto JSON",
|
|
568
582
|
"views.editor.validation": "Validación",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {w as we}from'./chunk-
|
|
1
|
+
import {w as we}from'./chunk-Ce3aSFve.js';import {A as At}from'./chunk-Dgi_aaUY.js';import {a as ae,l as le}from'./chunk-CepRGzVJ.js';import'./chunk-DP75g4hD.js';import'./chunk-8INlEe9b.js';import {C,a as C1,b6 as U,$,V as Ve,b as at$1,q as qo,U as Uw,u as ue,r as r$1,aW as Ng,aY as Dg,c as bi,Z as ZE,d as $8,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,J as Jc,o as gI,M as MD,I as Iw,P as Pw,L as Lh,p as Fw,H as HD,G as FD,m as mh,w as lh,z as rl,O as Fu,Q as ju,n as uh,E as Aw}from'./main-Q5LNROCU.js';import {b}from'./chunk-BJVGVLQp.js';import {G as Gn,u as un}from'./chunk-DaP135hJ.js';import'./chunk-wu6SvZ0s.js';import {U as U$1}from'./chunk-DKjiFhsx.js';import'./chunk-DF1Zujdm.js';import'./chunk-djGmnQaE.js';var et=i=>["/batches",i];function it(i,r){i&1&&(_i(0,"p",1),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function nt(i,r){if(i&1&&(_i(0,"p",2),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function ot(i,r){i&1&&(_i(0,"a",10),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(lh("routerLink",Aw(4,et,r)),gI(),rl(" ",Fw(2,2,"views.detail.openBatch")," "));}function at(i,r){if(i&1&&(uh(0,"nz-alert",9),_D(1,ot,3,6,"a",10)),i&2){let t,e=HD(2);lh("nzMessage",e.confirmation()),gI(),MD((t=e.confirmationBatchId())?1:-1,t);}}function lt(i,r){i&1&&(_i(0,"p",11),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),rl(" ",Fw(2,1,"views.detail.noBulkWorkflows")," "));}function rt(i,r){if(i&1&&(_i(0,"p",14),Iw(1),Jc()),i&2){let t=HD(4);gI(),Lh(t.launchError());}}function st(i,r){if(i&1){let t=FD();_i(0,"p",12),Iw(1),Jc(),_i(2,"app-workflow-input-form",13),mh("valuesChange",function(n){Fu(t);let s=HD(3);return ju(s.setInputValues(n))}),Jc(),_D(3,rt,2,1,"p",14),_i(4,"div",15)(5,"button",16),mh("click",function(){Fu(t);let n=HD(3);return ju(n.launch())}),Iw(6),Pw(7,"transloco"),Jc(),_i(8,"button",17),mh("click",function(){Fu(t);let n=HD(3);return ju(n.cancelLaunch())}),Iw(9),Pw(10,"transloco"),Jc()();}if(i&2){let t=r,e=HD(3);gI(),Lh(t.name),gI(),lh("fields",t.inputSchema)("values",e.inputValues()),gI(),MD(e.launchError()?3:-1),gI(2),lh("nzLoading",e.launching())("disabled",e.launching()),gI(),rl(" ",Fw(7,8,e.launching()?"views.detail.launching":"views.detail.launch")," "),gI(3),rl(" ",Fw(10,10,"views.detail.cancelLaunch")," ");}}function ct(i,r){if(i&1&&(_i(0,"section",6)(1,"h2"),Iw(2),Pw(3,"transloco"),Jc(),_D(4,lt,3,3,"p",11)(5,st,11,12),Jc()),i&2){let t,e=HD(2);gI(2),rl(" ",Fw(3,2,r==="view"?"views.detail.launchViewTitle":"views.detail.launchSelectedTitle")," "),gI(2),MD(e.canBulkLaunch()?(t=e.boundWorkflow())?5:-1:4,t);}}function dt(i,r){i&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"views.detail.emptySubjects")));}function ut(i,r){if(i&1){let t=FD();_i(0,"app-runnable-items-table",18),mh("rowAction",function(n){Fu(t);let s=HD(2);return ju(s.onRowAction(n))})("bulkAction",function(n){Fu(t);let s=HD(2);return ju(s.onBulkAction(n))}),Jc();}if(i&2){let t=HD(2);lh("rows",t.rows())("selectable",true)("showRowAction",t.showRowAction());}}function pt(i,r){if(i&1){let t=FD();_i(0,"header",3)(1,"h1",4),Iw(2),Jc(),_i(3,"button",5),mh("click",function(){Fu(t);let n=HD();return ju(n.beginLaunch("view"))}),Iw(4),Pw(5,"transloco"),Jc()(),_D(6,at,2,2),_D(7,ct,6,4,"section",6),_D(8,dt,3,3,"p",7)(9,ut,1,3,"app-runnable-items-table",8);}if(i&2){let t,e=HD();gI(2),Lh(r.name),gI(),lh("disabled",!e.canBulkLaunch()),gI(),rl(" ",Fw(5,6,"views.detail.runOnAll")," "),gI(2),MD(e.confirmation()?6:-1),gI(),MD((t=e.launchMode())?7:-1,t),gI(),MD(e.subjects().length===0?8:9);}}var zt=(()=>{class i{constructor(){this.route=C(C1),this.viewsApi=C(U),this.workflowsApi=C(b),this.batchesApi=C(U$1),this.jobsApi=C($),this.startJob=C(At),this.transloco=C(Ve),this.destroyRef=C(at$1),this.view=qo(null),this.subjects=qo([]),this.workflows=qo([]),this.latestBySubject=qo({}),this.loading=qo(true),this.loadError=qo(null),this.selectedIds=qo([]),this.launchMode=qo(null),this.inputValues=qo({}),this.launching=qo(false),this.launchError=qo(null),this.confirmation=qo(null),this.confirmationBatchId=qo(null),this.boundWorkflow=Uw(()=>{let t=this.view();return t?this.workflows().find(e=>e.id===t.workflowId)??null:null}),this.canBulkLaunch=Uw(()=>this.boundWorkflow()!=null),this.showRowAction=Uw(()=>this.boundWorkflow()?.subjectHandling==="per-subject"),this.rows=Uw(()=>{let t=this.latestBySubject();return this.subjects().map(e=>({id:e.id,primaryLabel:e.title,subtitle:this.subjectDetails(e),latestJob:t[e.id]??null}))}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("views.detail.loadFailed"));return}this.load(e);});}subjectDetails(t){if(t.subjectType==="ticket")return [t.status,t.assignee].filter(Boolean).join(" \xB7 ");if(t.subjectType==="pull_request"){let e=`${t.sourceBranch} \u2192 ${t.targetBranch}`;return t.author?`${t.author} \xB7 ${e}`:e}return t.url??""}onBulkAction(t){this.selectedIds.set(t),this.beginLaunch("manual");}onRowAction(t){let e=this.view();e&&this.startJob.start({workflowId:e.workflowId,subjectId:t});}beginLaunch(t){t==="manual"&&this.selectedIds().length===0||(this.launchError.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),this.launchMode.set(t),this.inputValues.set(ae(this.boundWorkflow()?.inputSchema??[])));}cancelLaunch(){this.launchMode.set(null),this.launchError.set(null);}setInputValues(t){this.inputValues.set(t);}launch(){let t=this.view(),e=this.boundWorkflow(),n=this.launchMode();if(!t||!e||!n)return;let s=n==="view"?{mode:"view",viewId:t.id}:{mode:"manual",subjectType:t.subjectType,subjectIds:[...this.selectedIds()]};this.launching.set(true),this.launchError.set(null),this.batchesApi.launch({workflowId:e.id,selection:s,triggeredBy:n==="view"?"view_bulk":"multiselect",inputValues:r$1({},this.inputValues())}).pipe(ue(this.destroyRef)).subscribe({next:w=>{this.launching.set(false),this.confirmation.set(this.confirmationMessage(w)),this.confirmationBatchId.set(w.kind==="batch"?w.batch.id:null),this.launchMode.set(null),this.refreshLatest(t.workflowId,this.subjects().map(tt=>tt.id));},error:w=>{this.launching.set(false),this.launchError.set(this.errorMessage(w,this.transloco.translate("views.detail.launchFailed")));}});}confirmationMessage(t){return t.kind==="batch"?this.transloco.translate("views.detail.confirmation.batch",{id:t.batch.id,count:t.batch.jobIds.length}):this.transloco.translate("views.detail.confirmation.job",{id:t.job.id})}load(t){this.loading.set(true),this.loadError.set(null),this.selectedIds.set([]),this.launchMode.set(null),this.confirmation.set(null),this.confirmationBatchId.set(null),Ng({view:this.viewsApi.get(t),subjects:this.viewsApi.getSubjects(t),workflows:this.workflowsApi.list()}).pipe(ue(this.destroyRef)).subscribe({next:({view:e,subjects:n,workflows:s})=>{this.view.set(e),this.subjects.set(n),this.workflows.set(s),this.loading.set(false),this.refreshLatest(e.workflowId,n.map(w=>w.id));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("views.detail.loadFailed")));}});}refreshLatest(t,e){(e.length===0?Dg({}):this.jobsApi.latestBySubject(t,e)).pipe(ue(this.destroyRef)).subscribe({next:s=>this.latestBySubject.set(s),error:()=>this.latestBySubject.set({})});}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-view-detail"]],decls:4,vars:1,consts:[["data-testid","view-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["data-testid","view-name"],["nz-button","","nzType","primary","type","button","data-testid","run-on-all",3,"click","disabled"],["data-testid","launch-panel",1,"launch-panel"],["data-testid","empty-subjects",1,"muted"],[3,"rows","selectable","showRowAction"],["data-testid","launch-confirmation","nzType","success",3,"nzMessage"],["nz-button","","nzType","link","data-testid","open-batch",3,"routerLink"],["data-testid","no-bulk-workflows",1,"muted"],["data-testid","launch-workflow",1,"muted"],[3,"valuesChange","fields","values"],["data-testid","launch-error",1,"error"],[1,"launch-actions"],["nz-button","","nzType","primary","type","button","data-testid","launch-submit",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","launch-cancel",3,"click"],[3,"rowAction","bulkAction","rows","selectable","showRowAction"]],template:function(e,n){if(e&1&&(_i(0,"main",0),_D(1,it,3,3,"p",1)(2,nt,2,1,"p",2)(3,pt,10,8),Jc()),e&2){let s;gI(),MD(n.loading()?1:n.loadError()?2:(s=n.view())?3:-1,s);}},dependencies:[$8,v3,Gn,un,pf,bd,sp,fp,le,we,Kt],styles:[".detail-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:center}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;min-width:14rem}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.launch-panel[_ngcontent-%COMP%]{padding:1rem;border:1px solid #d6d3d1;background:#ffffffb3}.launch-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.launch-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;margin-top:.5rem}.muted[_ngcontent-%COMP%]{color:#78716c}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{white-space:nowrap}[_nghost-%COMP%] .ant-table-tbody>tr>td{white-space:normal;vertical-align:top}"]});}}return i})();export{zt as ViewDetailComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,b4 as N2,aV as ix,b5 as cx,i as ie}from'./main-
|
|
1
|
+
import {C,b4 as N2,aV as ix,b5 as cx,i as ie}from'./main-Q5LNROCU.js';var f=(()=>{class r{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/local-repositories`;}list(){return this.http.get(this.baseUrl).pipe(cx())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}create(t){return this.http.post(this.baseUrl,t).pipe(cx())}update(t,i){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(t)}`,i).pipe(cx())}delete(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}static{this.\u0275fac=function(i){return new(i||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {C,b4 as N2,aV as ix,b5 as cx,ba as Se,i as ie}from'./main-Q5LNROCU.js';var f=(()=>{class i{constructor(){this.http=C(N2),this.apiBase=ix.apiBaseUrl;}getSettings(){return this.http.get(`${this.apiBase}/settings`).pipe(cx())}updateSettings(t){return this.http.patch(`${this.apiBase}/settings`,t).pipe(cx())}listProviderInstances(){return this.http.get(`${this.apiBase}/provider-instances`).pipe(cx())}createProviderInstance(t){return this.http.post(`${this.apiBase}/provider-instances`,t).pipe(cx())}updateProviderInstance(t,r){return this.http.patch(`${this.apiBase}/provider-instances/${encodeURIComponent(t)}`,r).pipe(cx())}deleteProviderInstance(t){return this.http.delete(`${this.apiBase}/provider-instances/${encodeURIComponent(t)}`).pipe(cx())}testProviderConnection(t){return this.http.post(`${this.apiBase}/provider-instances/${encodeURIComponent(t)}/test-connection`,{}).pipe(cx())}getProviderStatus(){return this.http.get(`${this.apiBase}/providers/status`).pipe(cx())}setSecret(t,r){return this.http.post(`${this.apiBase}/secrets/${encodeURIComponent(t)}`,{value:r},{responseType:"text"}).pipe(Se(()=>{}),cx())}static{this.\u0275fac=function(r){return new(r||i)};}static{this.\u0275prov=ie({token:i,factory:i.\u0275fac,providedIn:"root"});}}return i})();export{f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {U}from'./chunk-
|
|
1
|
+
import {U}from'./chunk-DKjiFhsx.js';import {f}from'./chunk-lQWDKNhr.js';import {L as Lt}from'./chunk-wqJvNV4X.js';import {y,S}from'./chunk-DuhskOh7.js';import {W,I}from'./chunk-DvI50p6W.js';import'./chunk-XJrnAloK.js';import'./chunk-DF1Zujdm.js';import'./chunk-djGmnQaE.js';import {C,a as C1,$,V as Ve,b as at$1,S as p,q as qo,u as ue,T as id,W as qw,c as bi,Z as ZE,d as $8,X as M5,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,l as _D,J as Jc,o as gI,M as MD,I as Iw,P as Pw,L as Lh,p as Fw,H as HD,n as uh,w as lh,az as jw,E as Aw,G as FD,m as mh,z as rl,O as Fu,Q as ju}from'./main-Q5LNROCU.js';var Z=i=>({count:i});function tt(i,p){i&1&&(_i(0,"p",1),Iw(1),Pw(2,"transloco"),Jc()),i&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function et(i,p){if(i&1&&(_i(0,"p",2),Iw(1),Jc()),i&2){let t=HD();gI(),Lh(t.loadError());}}function it(i,p){if(i&1){let t=FD();_i(0,"button",15),mh("click",function(){Fu(t);let u=HD(2);return ju(u.cancelBatch())}),Iw(1),Pw(2,"transloco"),Jc();}if(i&2){let t=HD(2);lh("disabled",t.cancelling()),gI(),rl(" ",Fw(2,2,t.cancelling()?"batches.detail.cancelling":"batches.detail.cancel")," ");}}function nt(i,p){if(i&1&&(_i(0,"p",12),Iw(1),Jc()),i&2){let t=HD(2);gI(),Lh(t.actionError());}}function at(i,p){if(i&1&&(_i(0,"header",3)(1,"div")(2,"a",4),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"h1",5),Iw(6),Jc(),_i(7,"p",6)(8,"nz-tag",7),Iw(9),Pw(10,"transloco"),Jc(),_i(11,"span",8),Iw(12),Jc(),Iw(13," \xB7 "),_i(14,"span",9),Iw(15),Pw(16,"transloco"),Jc(),Iw(17," \xB7 "),_i(18,"span",10),Iw(19),Pw(20,"transloco"),Jc()()(),_D(21,it,3,4,"button",11),Jc(),_D(22,nt,2,1,"p",12),_i(23,"section",13)(24,"h2"),Iw(25),Pw(26,"transloco"),Jc(),uh(27,"app-job-status-table",14),Jc()),i&2){let t=p,e=HD();gI(3),Lh(Fw(4,12,"batches.detail.backHint")),gI(3),Lh(t.id),gI(2),lh("nzColor",e.batchStatusTagColor(t.status,e.theme.theme()))("ngClass",e.batchStatusTagClass(t.status,e.theme.theme())),gI(),Lh(Fw(10,14,e.statusKey(t.status))),gI(3),Lh(t.workflowId),gI(3),Lh(jw(16,16,"batches.detail.subjectCount",Aw(23,Z,t.resolvedSubjects.length))),gI(4),Lh(Fw(20,19,e.triggeredByKey(t.triggeredBy))),gI(2),MD(t.status==="running"?21:-1),gI(),MD(e.actionError()?22:-1),gI(3),Lh(Fw(26,21,"batches.detail.membersHeading")),gI(2),lh("jobs",e.memberJobs());}}var ot=3e3;function v(i){return i!=="running"}var Dt=(()=>{class i{constructor(){this.route=C(C1),this.batchesApi=C(U),this.jobsApi=C($),this.eventsService=C(f),this.transloco=C(Ve),this.destroyRef=C(at$1),this.theme=C(p),this.batchStatusTagClass=y,this.batchStatusTagColor=S,this.batch=qo(null),this.memberJobs=qo([]),this.loading=qo(true),this.loadError=qo(null),this.polling=qo(false),this.cancelling=qo(false),this.actionError=qo(null),this.eventStream=qo(null),this.pollHandle=null,this.batchId=null,this.destroyRef.onDestroy(()=>{this.stopPolling(),this.closeStream();}),this.route.paramMap.pipe(ue(this.destroyRef)).subscribe(t=>{let e=t.get("id");if(!e){this.loading.set(false),this.loadError.set(this.transloco.translate("batches.detail.loadFailed"));return}this.load(e);}),id(()=>{let t=this.eventStream();if(!t)return;let e=t.latest();e&&(e.type!=="batch_completed"&&e.type!=="batch_cancelled"||e.batchId===this.batchId&&qw(()=>{this.refreshBatch(),this.refreshMembers(),this.stopPolling(),this.closeStream();}));});}statusKey(t){return `batches.status.${t}`}triggeredByKey(t){return `batches.triggeredBy.${t}`}isPolling(){return this.polling()}cancelBatch(){let t=this.batch();!t||t.status!=="running"||this.cancelling()||(this.actionError.set(null),this.cancelling.set(true),this.batchesApi.cancel(t.id).subscribe({next:e=>{this.cancelling.set(false),this.batch.set(e),this.refreshMembers(),v(e.status)&&(this.stopPolling(),this.closeStream());},error:e=>{this.cancelling.set(false),this.actionError.set(this.errorMessage(e,this.transloco.translate("batches.errors.cancelFailed")));}}));}load(t){this.batchId=t,this.loading.set(true),this.loadError.set(null),this.stopPolling(),this.closeStream(),this.batchesApi.get(t).pipe(ue(this.destroyRef)).subscribe({next:e=>{this.batch.set(e),this.loading.set(false),this.refreshMembers(),v(e.status)||(this.startPolling(),this.eventStream.set(this.eventsService.connect({batchId:t})));},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("batches.detail.loadFailed")));}});}refreshBatch(){let t=this.batchId;t&&this.batchesApi.get(t).subscribe({next:e=>{this.batch.set(e),v(e.status)&&this.stopPolling();},error:()=>{}});}refreshMembers(){let t=this.batchId;t&&this.jobsApi.list({batchId:t}).subscribe({next:e=>this.memberJobs.set(e),error:()=>{}});}startPolling(){this.pollHandle==null&&(this.polling.set(true),this.pollHandle=setInterval(()=>{let t=this.batch();if(!t||v(t.status)){this.stopPolling();return}this.refreshMembers();},ot));}stopPolling(){this.pollHandle!=null&&(clearInterval(this.pollHandle),this.pollHandle=null),this.polling.set(false);}closeStream(){let t=this.eventStream();t&&(t.close(),this.eventStream.set(null));}errorMessage(t,e){return t instanceof bi||t instanceof Error?t.message:e}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=ZE({type:i,selectors:[["app-batch-detail"]],decls:4,vars:1,consts:[["data-testid","batch-detail",1,"detail-page"],["data-testid","loading"],["data-testid","load-error",1,"error"],[1,"header"],["routerLink","/views"],["data-testid","batch-id"],[1,"meta"],["data-testid","batch-status",3,"nzColor","ngClass"],["data-testid","batch-workflow"],["data-testid","batch-subjects"],["data-testid","batch-triggered-by"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"disabled"],["data-testid","action-error",1,"error"],["data-testid","batch-members",1,"members"],[3,"jobs"],["nz-button","","nzDanger","","type","button","data-testid","cancel-batch",3,"click","disabled"]],template:function(e,u){if(e&1&&(_i(0,"main",0),_D(1,tt,3,3,"p",1)(2,et,2,1,"p",2)(3,at,28,25),Jc()),e&2){let C;gI(),MD(u.loading()?1:u.loadError()?2:(C=u.batch())?3:-1,C);}},dependencies:[$8,M5,v3,pf,bd,sp,fp,W,I,Lt,Kt],styles:[".detail-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:.25rem 0 0;font-size:1.35rem;word-break:break-all}.meta[_ngcontent-%COMP%]{margin:.35rem 0 0;color:#57534e;display:flex;flex-wrap:wrap;gap:.35rem;align-items:center}.members[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.1rem}.error[_ngcontent-%COMP%]{color:#9f1239}"]});}}return i})();export{Dt as BatchDetailComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f}from'./chunk-
|
|
1
|
+
import {f}from'./chunk-8INlEe9b.js';import {x,h,w}from'./chunk-DuhskOh7.js';import {W,I}from'./chunk-DvI50p6W.js';import'./chunk-XJrnAloK.js';import {L as Lt,u as ut,p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-DF1Zujdm.js';import'./chunk-djGmnQaE.js';import {Z as ZE,n as uh,C,$,V as Ve,b as at,S as p,q as qo,U as Uw,u as ue$1,aW as Ng,c as bi,d as $8,X as M5,v as v3,Y as pf,a0 as bd,a1 as sp,a2 as fp,K as Kt,j as _i,I as Iw,P as Pw,J as Jc,m as mh,l as _D,o as gI,L as Lh,p as Fw,w as lh,z as rl,M as MD,H as HD,x as xD,B as AD,G as FD,D as ch,E as Aw,O as Fu,Q as ju}from'./main-Q5LNROCU.js';var pe=t=>["/jobs",t],ce=(t,d)=>d.id;function me(t,d){t&1&&(_i(0,"p",3),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function he(t,d){if(t&1&&(_i(0,"p",4),Iw(1),Jc()),t&2){let e=HD();gI(),Lh(e.loadError());}}function ue(t,d){if(t&1&&(_i(0,"p",5),Iw(1),Jc()),t&2){let e=HD(2);gI(),Lh(e.actionError());}}function fe(t,d){t&1&&(_i(0,"p",6),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"worktrees.activeWarning")));}function ge(t,d){t&1&&(_i(0,"p",7),Iw(1),Pw(2,"transloco"),Jc()),t&2&&(gI(),Lh(Fw(2,1,"worktrees.emptyState")));}function Ce(t,d){if(t&1){let e=FD();_i(0,"tr")(1,"td")(2,"label",9),mh("nzCheckedChange",function(l){let b=Fu(e).$implicit,le=HD(3);return ju(le.toggleSelected(b.id,l))}),Jc()(),_i(3,"td")(4,"a",10),Iw(5),Jc()(),_i(6,"td"),Iw(7),Jc(),_i(8,"td"),Iw(9),Jc(),_i(10,"td",11),Iw(11),Jc(),_i(12,"td")(13,"nz-tag",12),Iw(14),Pw(15,"transloco"),Jc()(),_i(16,"td"),Iw(17),Jc()();}if(t&2){let e=d.$implicit,i=HD(3);ch("data-testid","worktree-row-"+e.id),gI(2),lh("nzChecked",i.isSelected(e.id)),ch("data-testid","worktree-select-"+e.id),gI(2),lh("routerLink",Aw(16,pe,e.id)),ch("data-testid","worktree-job-"+e.id),gI(),Lh(e.id),gI(2),Lh(i.repoName(e)),gI(2),Lh(e.branch??"\u2014"),gI(2),Lh(e.worktreePath),gI(2),lh("nzColor",i.jobStatusTagColor(e.status,i.theme.theme()))("ngClass",i.jobStatusTagClass(e.status,i.theme.theme())),ch("data-testid","worktree-status-"+e.id),gI(),Lh(Fw(15,14,i.statusKey(e.status))),gI(3),Lh(e.createdAt);}}function xe(t,d){if(t&1&&(_i(0,"nz-table",8)(1,"thead")(2,"tr"),uh(3,"th"),_i(4,"th"),Iw(5),Pw(6,"transloco"),Jc(),_i(7,"th"),Iw(8),Pw(9,"transloco"),Jc(),_i(10,"th"),Iw(11),Pw(12,"transloco"),Jc(),_i(13,"th"),Iw(14),Pw(15,"transloco"),Jc(),_i(16,"th"),Iw(17),Pw(18,"transloco"),Jc(),_i(19,"th"),Iw(20),Pw(21,"transloco"),Jc()()(),_i(22,"tbody"),xD(23,Ce,18,18,"tr",null,ce),Jc()()),t&2){let e=HD(2);lh("nzData",e.jobs())("nzShowPagination",false),gI(5),Lh(Fw(6,8,"worktrees.column.job")),gI(3),Lh(Fw(9,10,"worktrees.column.repository")),gI(3),Lh(Fw(12,12,"worktrees.column.branch")),gI(3),Lh(Fw(15,14,"worktrees.column.path")),gI(3),Lh(Fw(18,16,"worktrees.column.status")),gI(3),Lh(Fw(21,18,"worktrees.column.created")),gI(3),AD(e.jobs());}}function be(t,d){if(t&1&&(_D(0,ue,2,1,"p",5),_D(1,fe,3,3,"p",6),_D(2,ge,3,3,"p",7)(3,xe,25,20,"nz-table",8)),t&2){let e=HD();MD(e.actionError()?0:-1),gI(),MD(e.selectedHasActive()?1:-1),gI(),MD(e.jobs().length===0?2:3);}}var se=(()=>{class t{constructor(){this.jobsApi=C($),this.reposApi=C(f),this.transloco=C(Ve),this.destroyRef=C(at),this.theme=C(p),this.jobStatusTagClass=x,this.jobStatusTagColor=h,this.jobs=qo([]),this.repos=qo([]),this.selectedIds=qo([]),this.loading=qo(true),this.loadError=qo(null),this.actionError=qo(null),this.deleting=qo(false),this.selectedHasActive=Uw(()=>this.selectedJobs().some(e=>!w(e.status))),this.selectedJobs=Uw(()=>{let e=new Set(this.selectedIds());return this.jobs().filter(i=>e.has(i.id))}),this.reload();}statusKey(e){return `jobs.status.${e}`}repoName(e){return this.repos().find(l=>_e(e,l))?.name??"\u2014"}isSelected(e){return this.selectedIds().includes(e)}toggleSelected(e,i){this.selectedIds.update(l=>i?l.includes(e)?l:[...l,e]:l.filter(b=>b!==e)),this.actionError.set(null);}deleteSelected(){if(!(this.deleting()||this.selectedIds().length===0)){if(this.selectedHasActive()){this.actionError.set(this.transloco.translate("worktrees.activeWarning"));return}this.deleting.set(true),this.actionError.set(null),this.jobsApi.deleteWorktrees(this.selectedIds()).pipe(ue$1(this.destroyRef)).subscribe({next:()=>{this.deleting.set(false),this.selectedIds.set([]),this.reload();},error:e=>{this.deleting.set(false),this.actionError.set(this.errorMessage(e,this.transloco.translate("worktrees.deleteFailed")));}});}}reload(){this.loading.set(true),this.loadError.set(null),Ng({jobs:this.jobsApi.list({liveWorktree:true}),repos:this.reposApi.list()}).pipe(ue$1(this.destroyRef)).subscribe({next:({jobs:e,repos:i})=>{this.jobs.set(e),this.repos.set(i),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("worktrees.loadFailed")));}});}errorMessage(e,i){return e instanceof bi||e instanceof Error?e.message:i}static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-worktree-list"]],decls:11,vars:8,consts:[["data-testid","worktrees-manage",1,"list-page"],[1,"header"],["nz-button","","nzDanger","","type","button","data-testid","delete-worktrees",3,"click","disabled"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","action-error",1,"error"],["data-testid","active-warning",1,"warn"],["data-testid","empty-state",1,"empty"],["data-testid","worktree-table",3,"nzData","nzShowPagination"],["nz-checkbox","",3,"nzCheckedChange","nzChecked"],[3,"routerLink"],[1,"path-cell"],[3,"nzColor","ngClass"]],template:function(i,l){i&1&&(_i(0,"div",0)(1,"header",1)(2,"h1"),Iw(3),Pw(4,"transloco"),Jc(),_i(5,"button",2),mh("click",function(){return l.deleteSelected()}),Iw(6),Pw(7,"transloco"),Jc()(),_D(8,me,3,3,"p",3)(9,he,2,1,"p",4)(10,be,4,3),Jc()),i&2&&(gI(3),Lh(Fw(4,4,"worktrees.title")),gI(2),lh("disabled",l.deleting()||l.selectedIds().length===0),gI(),rl(" ",Fw(7,6,"worktrees.deleteSelected")," "),gI(2),MD(l.loading()?8:l.loadError()?9:10));},dependencies:[$8,M5,v3,pf,bd,sp,fp,Lt,ut,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.empty[_ngcontent-%COMP%]{text-align:center;padding:2.5rem 1rem;border:1px dashed #d6d3d1;background:#fff9}.error[_ngcontent-%COMP%]{color:#9f1239}.warn[_ngcontent-%COMP%]{color:#92400e}.path-cell[_ngcontent-%COMP%]{overflow-wrap:anywhere;word-break:break-word}"]});}}return t})();function _e(t,d){let e=(t.worktreePath??"").replaceAll("\\","/"),i=d.localPath.replaceAll("\\","/").replace(/\/+$/,""),l=(d.worktreeBasePath??ke(i)).replaceAll("\\","/");return e.startsWith(l)||e.startsWith(i)}function ke(t){let d=t.split("/"),e=d.pop()??"repo";return `${d.join("/")}/${e}-worktrees`}var qe=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)};}static{this.\u0275cmp=ZE({type:t,selectors:[["app-worktrees-manage"]],decls:1,vars:0,template:function(i,l){i&1&&uh(0,"app-worktree-list");},dependencies:[se],encapsulation:2});}}return t})();export{qe as WorktreesManageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {w,P,d,K,N,_,D,M,q,V,B}from'./chunk-DX21GXyA.js';import {H as He}from'./chunk-DP75g4hD.js';import {f}from'./chunk-96ta9Sdz.js';import {_ as _n,C as Cn}from'./chunk-BrckDrlX.js';import {G as Gn,u as un}from'./chunk-DaP135hJ.js';import {a as ai,z}from'./chunk-wu6SvZ0s.js';import {W,I}from'./chunk-DvI50p6W.js';import {P as P_,I as I_,t as tm}from'./chunk-XJrnAloK.js';import {p as pc,a as as,d as dc,K as Kl,c as cc,J as Ji,l as ls}from'./chunk-DF1Zujdm.js';import'./chunk-djGmnQaE.js';import {C,b as at,V as Ve,q as qo,U as Uw,aW as Ng,u as ue,s,r as r$1,b9 as Nl,ba as Se,aX as es,aY as Dg,c as bi,Z as ZE,d as $8,e as al,bb as er,bc as Jc,f as rl,bd as Nc,g as $i,Y as pf,a0 as bd,a1 as sp,a2 as fp,h as ex,F as Fm,A as Am,K as Kt$1,j as _i,I as Iw,P as Pw,J as Jc$1,m as mh,l as _D,o as gI,L as Lh,p as Fw,z as rl$1,M as MD,a7 as KE,a8 as fu,aA as mT,be as E3,bf as _r,aa as oe,a9 as Z0,bg as Ci,aB as yT,ab as Oe,bh as Bt$1,aq as el,bi as cl,a3 as Ah,a4 as Th,as as st,at as Ee,ai as ly,av as K0,n as uh,al as Sh,w as lh,D as ch,bj as Nw,bk as St,bl as wo,ax as Eh,an as WD,ao as GD,H as HD,x as xD,B as AD,G as FD,k as iE,y as aE,aM as Yl,aw as rh,N as ND,aJ as tl,aK as nl,O as Fu,Q as ju}from'./main-Q5LNROCU.js';var wt=["switchElement"];function Tt(n,m){n&1&&uh(0,"nz-icon",3);}function It(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzCheckedChildren);}}function kt(n,m){if(n&1&&rh(0,It,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzCheckedChildren);}}function Nt(n,m){if(n&1&&(tl(0),Iw(1),nl()),n&2){let e=HD(2);gI(),Lh(e.nzUnCheckedChildren);}}function Dt(n,m){if(n&1&&rh(0,Nt,2,1,"ng-container",6),n&2){let e=HD();lh("nzStringTemplateOutlet",e.nzUnCheckedChildren);}}var Vt="switch",X=(()=>{let n,m=[],e=[];return class q{static{let i=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;n=[Yl()],mT(null,null,n,{kind:"field",name:"nzSize",static:false,private:false,access:{has:s=>"nzSize"in s,get:s=>s.nzSize,set:(s,S)=>{s.nzSize=S;}},metadata:i},m,e),i&&Object.defineProperty(this,Symbol.metadata,{enumerable:true,configurable:true,writable:true,value:i});}_nzModuleName=Vt;nzConfigService=C(E3);el=C(_r).nativeElement;ngZone=C(oe);cdr=C(Z0);focusMonitor=C(Ci);destroyRef=C(at);isChecked=false;onChange=()=>{};onTouched=()=>{};switchElement;nzLoading=false;nzDisabled=false;nzControl=false;nzCheckedChildren=null;nzUnCheckedChildren=null;nzSize=yT(this,m,"default");nzId=(yT(this,e),null);dir=C(Oe).valueSignal;isNzDisableFirstChange=true;size=qo(this.nzSize);formSize=C(Bt$1,{optional:true});finalSize=Uw(()=>this.formSize?.()||this.size());updateValue(i){this.isChecked!==i&&(this.isChecked=i,this.onChange(this.isChecked));}focus(){this.focusMonitor.focusVia(this.switchElement.nativeElement,"keyboard");}blur(){this.switchElement.nativeElement.blur();}constructor(){this.destroyRef.onDestroy(()=>{this.focusMonitor.stopMonitoring(this.switchElement.nativeElement);});}ngOnChanges(i){let{nzSize:s}=i;s&&this.size.set(s.currentValue);}ngOnInit(){el(this.el,"click").pipe(ue(this.destroyRef)).subscribe(i=>{i.preventDefault(),!(this.nzControl||this.nzDisabled||this.nzLoading)&&this.ngZone.run(()=>{this.updateValue(!this.isChecked),this.cdr.markForCheck();});}),el(this.switchElement.nativeElement,"keydown").pipe(ue(this.destroyRef)).subscribe(i=>{if(this.nzControl||this.nzDisabled||this.nzLoading)return;let{keyCode:s}=i;s!==37&&s!==39&&s!==32&&s!==13||(i.preventDefault(),this.ngZone.run(()=>{s===37?this.updateValue(false):s===39?this.updateValue(true):(s===32||s===13)&&this.updateValue(!this.isChecked),this.cdr.markForCheck();}));});}ngAfterViewInit(){this.focusMonitor.monitor(this.switchElement.nativeElement,true).pipe(ue(this.destroyRef)).subscribe(i=>{i||Promise.resolve().then(()=>this.onTouched());});}writeValue(i){this.isChecked=i,this.cdr.markForCheck();}registerOnChange(i){this.onChange=i;}registerOnTouched(i){this.onTouched=i;}setDisabledState(i){this.nzDisabled=this.isNzDisableFirstChange&&this.nzDisabled||i,this.isNzDisableFirstChange=false,this.cdr.markForCheck();}static \u0275fac=function(s){return new(s||q)};static \u0275cmp=ZE({type:q,selectors:[["nz-switch"]],viewQuery:function(s,S){if(s&1&&Eh(wt,7),s&2){let j;WD(j=GD())&&(S.switchElement=j.first);}},inputs:{nzLoading:[2,"nzLoading","nzLoading",K0],nzDisabled:[2,"nzDisabled","nzDisabled",K0],nzControl:[2,"nzControl","nzControl",K0],nzCheckedChildren:"nzCheckedChildren",nzUnCheckedChildren:"nzUnCheckedChildren",nzSize:"nzSize",nzId:"nzId"},exportAs:["nzSwitch"],features:[Nw([{provide:St,useExisting:wo(()=>q),multi:true}]),ly],decls:8,vars:15,consts:[["switchElement",""],["nz-wave","","type","button",1,"ant-switch",3,"disabled","nzWaveExtraNode"],[1,"ant-switch-handle"],["nzType","loading",1,"ant-switch-loading-icon"],[1,"ant-switch-inner"],[1,"ant-click-animating-node"],[4,"nzStringTemplateOutlet"]],template:function(s,S){s&1&&(_i(0,"button",1,0)(2,"span",2),_D(3,Tt,1,0,"nz-icon",3),Jc$1(),_i(4,"span",4),_D(5,kt,1,1,"ng-container")(6,Dt,1,1,"ng-container"),Jc$1(),uh(7,"div",5),Jc$1()),s&2&&(Sh("ant-switch-checked",S.isChecked)("ant-switch-loading",S.nzLoading)("ant-switch-disabled",S.nzDisabled)("ant-switch-small",S.finalSize()==="small")("ant-switch-rtl",S.dir()==="rtl"),lh("disabled",S.nzDisabled)("nzWaveExtraNode",true),ch("id",S.nzId),gI(3),MD(S.nzLoading?3:-1),gI(2),MD(S.isChecked?5:6));},dependencies:[cl,fp,Ah,Th,st,Ee],encapsulation:2})}})(),xt=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=KE({type:n});static \u0275inj=fu({imports:[X]})}return n})();var ee=(n,m)=>m.id,Pt=(n,m)=>m.key;function Rt(n,m){n&1&&(_i(0,"div",4),uh(1,"nz-alert",9),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),lh("nzMessage",Fw(2,1,"settings.restartRequired.message")));}function At(n,m){n&1&&(_i(0,"p",5),Iw(1),Pw(2,"transloco"),Jc$1()),n&2&&(gI(),Lh(Fw(2,1,"common.loading")));}function Bt(n,m){if(n&1&&(_i(0,"p",6),Iw(1),Jc$1()),n&2){let e=HD();gI(),Lh(e.loadError());}}function Ft(n,m){if(n&1&&(_i(0,"nz-tag",11),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=HD().$implicit;ch("data-testid",e.id+"-default-chip"),gI(),Lh(Fw(2,2,"settings.defaultAgent.label"));}}function Lt(n,m){if(n&1&&(_i(0,"nz-tag",17),Iw(1),Pw(2,"transloco"),Jc$1()),n&2){let e=m,t=HD(2).$implicit,i=HD(2);lh("nzColor",i.testResultTone(e)),ch("title",e.message??"")("data-testid",t.id+"-test-result"),gI(),rl$1(" ",Fw(2,4,i.testResultLabelKey(e))," ");}}function Kt(n,m){if(n&1){let e=FD();_i(0,"span",13)(1,"button",16),mh("click",function(){Fu(e);let i=HD().$implicit,s=HD(2);return ju(s.testSavedConnection(i))}),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Lt,3,6,"nz-tag",17),Jc$1();}if(n&2){let e,t=HD().$implicit,i=HD(2);gI(),lh("nzLoading",i.listTestState(t.id)?.running===true)("disabled",i.listTestState(t.id)?.running===true),ch("data-testid",t.id+"-test-connection"),gI(),rl$1(" ",Fw(3,5,"settings.testConnection")," "),gI(2),MD((e=i.listTestState(t.id)?.result)?4:-1,e);}}function $t(n,m){if(n&1){let e=FD();_i(0,"tr")(1,"td",10)(2,"span"),Iw(3),Jc$1(),_D(4,Ft,3,4,"nz-tag",11),Jc$1(),_i(5,"td")(6,"nz-tag"),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"td"),Iw(10),Jc$1(),_i(11,"td",12),_D(12,Kt,5,7,"span",13),_i(13,"button",14),mh("click",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.openEdit(i))}),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"button",15),Pw(17,"transloco"),Pw(18,"transloco"),Pw(19,"transloco"),mh("nzOnConfirm",function(){let i=Fu(e).$implicit,s=HD(2);return ju(s.removeInstance(i.id))}),Iw(20),Pw(21,"transloco"),Jc$1()()();}if(n&2){let e=m.$implicit,t=HD(2);ch("data-testid","instance-"+e.id),gI(),ch("data-testid",e.id+"-name"),gI(2),Lh(e.displayName),gI(),MD(t.isDefaultAgent(e)?4:-1),gI(2),ch("data-testid",e.id+"-type"),gI(),Lh(Fw(8,16,t.typeLabelKey(e))),gI(2),ch("data-testid",e.id+"-expires"),gI(),rl$1(" ",e.expiresOn??""," "),gI(2),MD(t.supportsTestConnection(e.type)?12:-1),gI(),ch("data-testid",e.id+"-edit"),gI(),rl$1(" ",Fw(15,18,"settings.edit")," "),gI(2),lh("nzPopconfirmTitle",Fw(17,20,"settings.deleteConfirm"))("nzOkText",Fw(18,22,"settings.delete"))("nzCancelText",Fw(19,24,"common.cancel")),ch("data-testid",e.id+"-delete"),gI(4),rl$1(" ",Fw(21,26,"settings.delete")," ");}}function qt(n,m){if(n&1&&(_i(0,"nz-table",7)(1,"thead")(2,"tr")(3,"th"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"th"),Iw(7),Pw(8,"transloco"),Jc$1(),_i(9,"th"),Iw(10),Pw(11,"transloco"),Jc$1(),_i(12,"th"),Iw(13),Pw(14,"transloco"),Jc$1()()(),_i(15,"tbody"),xD(16,$t,22,28,"tr",null,ee),Jc$1()()),n&2){let e=HD();lh("nzData",e.instances())("nzFrontPagination",false)("nzShowPagination",false),gI(4),Lh(Fw(5,7,"settings.column.displayName")),gI(3),Lh(Fw(8,9,"settings.column.type")),gI(3),Lh(Fw(11,11,"settings.column.expiresOn")),gI(3),Lh(Fw(14,13,"settings.column.actions")),gI(3),AD(e.instances());}}function jt(n,m){if(n&1&&(_i(0,"li"),Iw(1),Jc$1()),n&2){let e=m.$implicit;gI(),Lh(e);}}function Ut(n,m){if(n&1&&(_i(0,"section",19)(1,"h3"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"ul"),xD(5,jt,2,1,"li",null,ND),Jc$1()()),n&2){let e=HD(2);gI(2),Lh(Fw(3,1,"settings.validation")),gI(3),AD(e.validationErrors());}}function Wt(n,m){if(n&1&&(_i(0,"p",20),Iw(1),Jc$1()),n&2){let e=HD(2);gI(),Lh(e.secretSaveError());}}function Zt(n,m){if(n&1&&(uh(0,"nz-option",27),Pw(1,"transloco")),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",Fw(1,2,e.labelKey));}}function Ht(n,m){if(n&1){let e=FD();_i(0,"label",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"input",37),mh("ngModelChange",function(i){let s=Fu(e).$implicit,S=HD(2);return ju(S.setDraftConfig(s.key,i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=m.$implicit,t=HD(2);gI(2),Lh(Fw(3,3,e.labelKey)),gI(2),lh("ngModel",t.configValue(t.draft().config,e.key)),ch("data-testid","provider-config-"+e.key),aE();}}function Qt(n,m){if(n&1){let e=FD();_i(0,"div",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"nz-select",38),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setKnownRepoSlugs(i))}),Jc$1(),iE(),_i(5,"p",25),Iw(6),Pw(7,"transloco"),Jc$1()();}if(n&2){let e=HD(2);gI(2),Lh(Fw(3,3,"settings.bitbucket.knownRepoSlugs")),gI(2),lh("ngModel",e.draft().knownRepoSlugs),aE(),gI(2),Lh(Fw(7,5,"settings.bitbucket.knownRepoSlugsHint"));}}function Gt(n,m){if(n&1){let e=FD();_i(0,"button",39),mh("click",function(){Fu(e);let i=HD(2);return ju(i.fetchModels())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.fetchingModels())("disabled",!e.canFetchModels()),gI(),rl$1(" ",Fw(2,3,"settings.model.fetch")," ");}}function Jt(n,m){if(n&1){let e=FD();_i(0,"button",40),mh("click",function(){Fu(e);let i=HD(2);return ju(i.testDraftConnection())}),Iw(1),Pw(2,"transloco"),Jc$1();}if(n&2){let e=HD(2);lh("nzLoading",e.modalTestRunning())("disabled",!e.canTestConnection()),gI(),rl$1(" ",Fw(2,3,"settings.testConnection")," ");}}function Yt(n,m){if(n&1&&(_i(0,"p",42),Iw(1),Jc$1()),n&2){let e=HD();Sh("warning",e.identityMismatch)("error",!e.success),gI(),rl$1(" ",e.message," ");}}function Xt(n,m){if(n&1&&(_i(0,"div",32)(1,"nz-tag",17),Iw(2),Pw(3,"transloco"),Jc$1(),_D(4,Yt,2,5,"p",41),Jc$1()),n&2){let e=m,t=HD(2);gI(),lh("nzColor",t.testResultTone(e)),gI(),rl$1(" ",Fw(3,3,t.testResultLabelKey(e))," "),gI(2),MD(e.message?4:-1);}}function ei(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=HD(3);lh("nzValue",e.configValue(e.draft().config,"model"))("nzLabel",e.configValue(e.draft().config,"model"));}}function ti(n,m){if(n&1&&uh(0,"nz-option",27),n&2){let e=m.$implicit;lh("nzValue",e.id)("nzLabel",e.displayName);}}function ii(n,m){if(n&1&&(_i(0,"p",44),Iw(1),Jc$1()),n&2){let e=HD(3);gI(),Lh(e.modelsError());}}function ni(n,m){if(n&1){let e=FD();_i(0,"div",21)(1,"span"),Iw(2),Pw(3,"transloco"),Jc$1(),_i(4,"nz-select",43),Pw(5,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDraftConfig("model",i??""))}),_D(6,ei,1,2,"nz-option",27),xD(7,ti,1,2,"nz-option",27,ee),Jc$1(),iE(),_D(9,ii,2,1,"p",44),_i(10,"p",25),Iw(11),Pw(12,"transloco"),Jc$1()(),_i(13,"label",21)(14,"span"),Iw(15),Pw(16,"transloco"),Jc$1(),_i(17,"input",45),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setMaxConcurrent(i))}),Jc$1(),iE(),_i(18,"p",25),Iw(19),Pw(20,"transloco"),Jc$1()(),_i(21,"label",46)(22,"span"),Iw(23),Pw(24,"transloco"),Jc$1(),_i(25,"nz-switch",47),mh("ngModelChange",function(i){Fu(e);let s=HD(2);return ju(s.setDefaultAgentDraft(i))}),Jc$1(),iE(),Jc$1();}if(n&2){let e=HD(2);gI(2),Lh(Fw(3,11,"settings.model.label")),gI(2),lh("nzPlaceHolder",Fw(5,13,"settings.model.placeholder"))("ngModel",e.configValue(e.draft().config,"model")),aE(),gI(2),MD(e.selectedModelMissingFromList()?6:-1),gI(),AD(e.availableModels()),gI(2),MD(e.modelsError()?9:-1),gI(2),Lh(Fw(12,15,"settings.model.hint")),gI(4),Lh(Fw(16,17,"settings.maxConcurrent.label")),gI(2),lh("ngModel",e.draft().maxConcurrent),aE(),gI(2),Lh(Fw(20,19,"settings.maxConcurrent.hint")),gI(4),Lh(Fw(24,21,"settings.defaultAgent.toggle")),gI(2),lh("ngModel",e.draft().defaultAgent),aE();}}function oi(n,m){if(n&1){let e=FD();_i(0,"div",8)(1,"div",18)(2,"h2"),Iw(3),Pw(4,"transloco"),Jc$1(),_D(5,Ut,7,3,"section",19),_D(6,Wt,2,1,"p",20),_i(7,"label",21)(8,"span"),Iw(9),Pw(10,"transloco"),Jc$1(),_i(11,"input",22),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onDisplayNameChange(i))}),Jc$1(),iE(),Jc$1(),_i(12,"label",23)(13,"span"),Iw(14),Pw(15,"transloco"),Jc$1(),_i(16,"input",24),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onIdChange(i))}),Jc$1(),iE(),_i(17,"p",25),Iw(18),Pw(19,"transloco"),Jc$1()(),_i(20,"div",21)(21,"span"),Iw(22),Pw(23,"transloco"),Jc$1(),_i(24,"nz-select",26),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.onTypeChange(i))}),xD(25,Zt,2,4,"nz-option",27,ee),Jc$1(),iE(),Jc$1(),xD(27,Ht,5,5,"label",21,Pt),_D(29,Qt,8,7,"div",21),_i(30,"label",21)(31,"span"),Iw(32),Pw(33,"transloco"),Jc$1(),_i(34,"div",28)(35,"input",29),Pw(36,"transloco"),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setSecretValue(i))}),Jc$1(),iE(),_D(37,Gt,3,5,"button",30),_D(38,Jt,3,5,"button",31),Jc$1(),_D(39,Xt,5,5,"div",32),Jc$1(),_D(40,ni,26,23),_i(41,"label",21)(42,"span"),Iw(43),Pw(44,"transloco"),Jc$1(),_i(45,"input",33),mh("ngModelChange",function(i){Fu(e);let s=HD();return ju(s.setExpiresOn(i))}),Jc$1(),iE(),_i(46,"p",25),Iw(47),Pw(48,"transloco"),Jc$1()(),_i(49,"div",34)(50,"button",35),mh("click",function(){Fu(e);let i=HD();return ju(i.closeModal())}),Iw(51),Pw(52,"transloco"),Jc$1(),_i(53,"button",36),mh("click",function(){Fu(e);let i=HD();return ju(i.saveModal())}),Iw(54),Pw(55,"transloco"),Jc$1()()()();}if(n&2){let e,t=HD();gI(3),rl$1(" ",Fw(4,24,t.draft().originalId?"settings.editProvider":"settings.addProvider")," "),gI(2),MD(t.validationErrors().length>0?5:-1),gI(),MD(t.secretSaveError()?6:-1),gI(3),Lh(Fw(10,26,"settings.displayName")),gI(2),lh("ngModel",t.draft().displayName),aE(),gI(3),Lh(Fw(15,28,"settings.instanceId")),gI(2),lh("ngModel",t.draft().id),aE(),gI(2),Lh(Fw(19,30,"settings.instanceIdHint")),gI(4),Lh(Fw(23,32,"settings.type.label")),gI(2),lh("ngModel",t.draft().optionId),aE(),gI(),AD(t.typeOptions),gI(2),AD(t.configFields(t.draft().type)),gI(2),MD(t.draft().type==="bitbucket"?29:-1),gI(3),Lh(Fw(33,34,"settings.apiKey.label")),gI(3),lh("ngModel",t.draft().secretValue)("placeholder",Fw(36,36,t.draft().originalId?"settings.apiKey.placeholderEdit":"settings.apiKey.placeholderCreate")),aE(),gI(2),MD(t.draft().kind==="agent"?37:-1),gI(),MD(t.supportsTestConnection(t.draft().type)?38:-1),gI(),MD((e=t.modalTestResult())?39:-1,e),gI(),MD(t.draft().kind==="agent"?40:-1),gI(3),Lh(Fw(44,38,"settings.expiresOn.label")),gI(2),lh("ngModel",t.draft().expiresOn),aE(),gI(2),Lh(Fw(48,40,"settings.expiresOn.hint")),gI(4),rl$1(" ",Fw(52,42,"common.cancel")," "),gI(2),lh("nzLoading",t.saving()),gI(),rl$1(" ",Fw(55,44,"common.save")," ");}}var en=(()=>{class n{constructor(){this.api=C(f),this.providersApi=C(w),this.message=C(He),this.destroyRef=C(at),this.transloco=C(Ve),this.loaded=qo({providerInstances:[]}),this.status=qo([]),this.draft=qo(P()),this.loading=qo(true),this.saving=qo(false),this.loadError=qo(null),this.validationErrors=qo([]),this.secretSaveError=qo(null),this.restartRequired=qo(false),this.modalOpen=qo(false),this.availableModels=qo([]),this.fetchingModels=qo(false),this.modelsError=qo(null),this.listTests=qo({}),this.modalTestRunning=qo(false),this.modalTestResult=qo(null),this.instances=Uw(()=>this.loaded().providerInstances??[]),this.typeOptions=d,this.configFields=K,this.typeLabelKey=N,this.isAgent=P_,this.supportsTestConnection=I_,Ng({settings:this.api.getSettings(),status:this.api.getProviderStatus()}).pipe(ue(this.destroyRef)).subscribe({next:({settings:e,status:t})=>{this.applySettings(e,false),this.status.set(t),this.loading.set(false);},error:e=>{this.loading.set(false),this.loadError.set(this.errorMessage(e,this.transloco.translate("settings.loadFailed")));}});}configValue(e,t){let i=e[t];return typeof i=="string"?i:""}isDefaultAgent(e){return P_(e)&&this.loaded().defaultAgentInstanceId===e.id}selectedModelMissingFromList(){let e=this.configValue(this.draft().config,"model");return e?!this.availableModels().some(t=>t.id===e):false}canFetchModels(){let e=this.draft();return e.kind==="agent"&&(e.secretValue.trim().length>0||e.originalId!=null)}canTestConnection(){let e=this.draft();return I_(e.type)&&(e.secretValue.trim().length>0||e.originalId!=null)}listTestState(e){return this.listTests()[e]}testResultTone(e){return e.identityMismatch?"warning":e.success?"success":"error"}testResultLabelKey(e){return e.identityMismatch?"settings.testConnection.mismatch":e.success?"settings.testConnection.connected":"settings.testConnection.failed"}openCreate(){this.resetModal(P());}openEdit(e){this.resetModal(_(e,this.isDefaultAgent(e)));}closeModal(){this.modalOpen.set(false);}onDisplayNameChange(e){this.draft.update(t=>D(t,e,this.existingIds(t)));}onIdChange(e){this.draft.update(t=>M(t,e));}onTypeChange(e){this.availableModels.set([]),this.modelsError.set(null),this.modalTestResult.set(null),this.draft.update(t=>{let i=q(t,e);return i.kind!=="agent"||t.kind==="agent"?i:s(r$1({},i),{defaultAgent:this.shouldDefaultNewAgent(t)})});}setDraftConfig(e,t){this.draft.update(i=>s(r$1({},i),{config:s(r$1({},i.config),{[e]:t})}));}setSecretValue(e){this.draft.update(t=>s(r$1({},t),{secretValue:e}));}setExpiresOn(e){this.draft.update(t=>s(r$1({},t),{expiresOn:e}));}setKnownRepoSlugs(e){this.draft.update(t=>s(r$1({},t),{knownRepoSlugs:Array.isArray(e)?e:[]}));}setDefaultAgentDraft(e){this.draft.update(t=>s(r$1({},t),{defaultAgent:e}));}setMaxConcurrent(e){let t=typeof e=="number"?e:Number(e),i=Number.isFinite(t)&&t>=1?Math.floor(t):1;this.draft.update(s$1=>s(r$1({},s$1),{maxConcurrent:i}));}fetchModels(){let e=this.draft();if(e.kind!=="agent"||!this.canFetchModels())return;let t=e.secretValue.trim();this.fetchingModels.set(true),this.modelsError.set(null),this.providersApi.previewModels(t?{type:e.type,apiKey:t}:{type:e.type,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.availableModels.set(i),this.fetchingModels.set(false);},error:i=>{this.fetchingModels.set(false),this.modelsError.set(this.errorMessage(i,this.transloco.translate("settings.model.fetchFailed")));}});}testSavedConnection(e){I_(e.type)&&(this.listTests()[e.id]?.running||(this.listTests.update(t=>s(r$1({},t),{[e.id]:{running:true,result:t[e.id]?.result}})),this.api.testProviderConnection(e.id).pipe(ue(this.destroyRef)).subscribe({next:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:t}}));},error:t=>{this.listTests.update(i=>s(r$1({},i),{[e.id]:{running:false,result:{success:false,message:this.errorMessage(t,this.transloco.translate("settings.testConnection.failed"))}}}));}})));}testDraftConnection(){let e=this.draft();if(!this.canTestConnection()||this.modalTestRunning())return;let t=e.secretValue.trim();this.modalTestRunning.set(true),this.modalTestResult.set(null),this.providersApi.testConnection(t?{type:e.type,config:e.config,apiKey:t}:{type:e.type,config:e.config,instanceId:e.originalId}).pipe(ue(this.destroyRef)).subscribe({next:i=>{this.modalTestRunning.set(false),this.modalTestResult.set(i);},error:i=>{this.modalTestRunning.set(false),this.modalTestResult.set({success:false,message:this.errorMessage(i,this.transloco.translate("settings.testConnection.failed"))});}});}saveModal(){let e=this.draft();if(this.validationErrors.set([]),this.secretSaveError.set(null),!e.displayName.trim()){this.validationErrors.set([this.transloco.translate("settings.displayNameRequired")]);return}if(e.originalId==null&&!e.secretValue.trim()){this.validationErrors.set([this.transloco.translate("settings.apiKey.required")]);return}let t=tm.safeParse(V(e));if(!t.success){this.validationErrors.set(B(t.error));return}this.saving.set(true);let i=t.data,s$1=i.kind==="agent"?{defaultAgent:e.defaultAgent}:{};(e.originalId==null?this.api.createProviderInstance(r$1(r$1({},i),s$1)):this.api.updateProviderInstance(e.originalId,r$1(r$1({displayName:i.displayName,config:i.config,secretKey:i.secretKey,expiresOn:i.expiresOn??null},i.kind==="agent"?{maxConcurrent:i.maxConcurrent}:{}),s$1))).pipe(Nl(D=>{this.applySettings(D.settings,D.restartRequired);let P=e.secretValue.trim();return P?this.api.setSecret(i.secretKey,P).pipe(Se(()=>({kind:"ok"})),es(vt=>Dg({kind:"secret-failed",err:vt}))):Dg({kind:"ok"})}),ue(this.destroyRef)).subscribe({next:D=>{if(this.saving.set(false),D.kind==="secret-failed"){this.draft.update(P=>s(r$1({},P),{originalId:i.id,id:i.id,idAutoSync:false,secretKey:i.secretKey})),this.secretSaveError.set(this.errorMessage(D.err,this.transloco.translate("settings.apiKey.setFailedAfterSave"))),this.refreshStatus();return}this.modalOpen.set(false),this.refreshStatus();},error:D=>{this.saving.set(false),this.message.error(this.errorMessage(D,this.transloco.translate("settings.saveFailed")));}});}removeInstance(e){this.api.deleteProviderInstance(e).subscribe({next:t=>this.applySettings(t.settings,t.restartRequired),error:t=>{this.message.error(this.errorMessage(t,this.transloco.translate("settings.saveFailed")));}});}resetModal(e){this.validationErrors.set([]),this.secretSaveError.set(null),this.availableModels.set([]),this.modelsError.set(null),this.fetchingModels.set(false),this.modalTestRunning.set(false),this.modalTestResult.set(null),this.draft.set(e),this.modalOpen.set(true);}shouldDefaultNewAgent(e){return e.originalId&&e.originalId===this.loaded().defaultAgentInstanceId?true:!this.loaded().defaultAgentInstanceId}existingIds(e){return this.instances().map(t=>t.id).filter(t=>t!==e.originalId)}applySettings(e,t){let i=e.providerInstances??[];this.loaded.set(r$1({providerInstances:i},e.defaultAgentInstanceId?{defaultAgentInstanceId:e.defaultAgentInstanceId}:{})),t&&this.restartRequired.set(true);}refreshStatus(){this.api.getProviderStatus().subscribe({next:e=>this.status.set(e),error:()=>{}});}errorMessage(e,t){return e instanceof bi||e instanceof Error?e.message:t}static{this.\u0275fac=function(t){return new(t||n)};}static{this.\u0275cmp=ZE({type:n,selectors:[["app-settings"]],decls:17,vars:12,consts:[["data-testid","settings-page",1,"settings"],[1,"header"],[1,"lede"],["nz-button","","nzType","primary","type","button","data-testid","add-provider",3,"click"],["data-testid","restart-required-banner"],["data-testid","loading"],["data-testid","load-error",1,"error"],["data-testid","provider-instances",3,"nzData","nzFrontPagination","nzShowPagination"],["data-testid","provider-modal",1,"modal-backdrop"],["nzType","warning","nzShowIcon","","nzBanner","",3,"nzMessage"],[1,"name-cell"],["nzColor","blue"],[1,"actions"],[1,"test-connection"],["nz-button","","nzType","link","type","button",3,"click"],["nz-button","","nzType","link","nzDanger","","type","button","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle","nzOkText","nzCancelText"],["nz-button","","nzType","link","type","button",3,"click","nzLoading","disabled"],[3,"nzColor"],["role","dialog",1,"modal-panel"],["data-testid","validation-errors",1,"errors"],["data-testid","secret-save-error",1,"error"],[1,"field"],["nz-input","","data-testid","provider-display-name",3,"ngModelChange","ngModel"],[1,"field","field-id"],["nz-input","","data-testid","provider-id",3,"ngModelChange","ngModel"],[1,"hint"],["data-testid","provider-type",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"api-key-row"],["nz-input","","type","password","autocomplete","off","data-testid","provider-api-key",3,"ngModelChange","ngModel","placeholder"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"nzLoading","disabled"],["data-testid","provider-test-result",1,"test-result-row"],["nz-input","","type","date","data-testid","provider-expires-on",3,"ngModelChange","ngModel"],[1,"modal-actions"],["nz-button","","type","button","data-testid","provider-cancel",3,"click"],["nz-button","","nzType","primary","type","button","data-testid","provider-save",3,"click","nzLoading"],["nz-input","",3,"ngModelChange","ngModel"],["nzMode","tags","data-testid","provider-config-knownRepoSlugs",3,"ngModelChange","ngModel"],["nz-button","","type","button","data-testid","provider-fetch-models",3,"click","nzLoading","disabled"],["nz-button","","type","button","data-testid","provider-test-connection",3,"click","nzLoading","disabled"],["data-testid","provider-test-result-message",1,"test-result-message",3,"warning","error"],["data-testid","provider-test-result-message",1,"test-result-message"],["data-testid","provider-model","nzAllowClear","",3,"ngModelChange","nzPlaceHolder","ngModel"],["data-testid","provider-models-error",1,"error"],["nz-input","","type","number","min","1","step","1","data-testid","provider-max-concurrent",3,"ngModelChange","ngModel"],[1,"field","field-switch"],["data-testid","provider-default-agent",3,"ngModelChange","ngModel"]],template:function(t,i){t&1&&(_i(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),Iw(4),Pw(5,"transloco"),Jc$1(),_i(6,"p",2),Iw(7),Pw(8,"transloco"),Jc$1()(),_i(9,"button",3),mh("click",function(){return i.openCreate()}),Iw(10),Pw(11,"transloco"),Jc$1()(),_D(12,Rt,3,3,"div",4),_D(13,At,3,3,"p",5)(14,Bt,2,1,"p",6)(15,qt,18,15,"nz-table",7),_D(16,oi,56,46,"div",8),Jc$1()),t&2&&(gI(4),Lh(Fw(5,6,"settings.title")),gI(3),Lh(Fw(8,8,"settings.lede")),gI(3),rl$1(" ",Fw(11,10,"settings.addProvider")," "),gI(2),MD(i.restartRequired()?12:-1),gI(),MD(i.loading()?13:i.loadError()?14:15),gI(3),MD(i.modalOpen()?16:-1));},dependencies:[$8,al,er,Jc,rl,Nc,$i,Gn,un,pf,bd,sp,fp,ai,z,_n,Cn,ex,Fm,Am,xt,X,pc,as,dc,Kl,cc,Ji,ls,W,I,Kt$1],styles:[".settings[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0}.field[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.85rem;color:#57534e}.field-id[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{font-family:ui-monospace,Consolas,monospace;font-size:.85rem;color:#57534e}.hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:#78716c}.errors[_ngcontent-%COMP%]{border:1px solid #fecdd3;background:#fff1f2;padding:.75rem 1rem}.errors[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1rem}.error[_ngcontent-%COMP%]{color:#9f1239}.actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.15rem .25rem}.test-connection[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem}.api-key-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.api-key-row[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1;min-width:10rem}.test-result-row[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.4rem .6rem;margin-top:.45rem}.test-result-message[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:#57534e;flex:1;min-width:12rem}.test-result-message.warning[_ngcontent-%COMP%]{color:#b45309}.test-result-message.error[_ngcontent-%COMP%]{color:#9f1239}.field-switch[_ngcontent-%COMP%]{flex-direction:row;align-items:center;justify-content:space-between}.field[_ngcontent-%COMP%] nz-select[_ngcontent-%COMP%]{width:100%}.modal-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:4rem 1rem 2rem;background:#1c191759}.modal-panel[_ngcontent-%COMP%]{width:min(32rem,100%);max-height:calc(100vh - 6rem);overflow:auto;background:#fff;border-radius:.5rem;padding:1.25rem 1.5rem 1.5rem;box-shadow:0 10px 30px #1c19172e}.modal-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1.15rem}.modal-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}"]});}}return n})();export{en as ProvidersManageComponent,en as SettingsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,b4 as N2,aV as ix,b_ as u,b5 as cx,i as ie}from'./main-
|
|
1
|
+
import {C,b4 as N2,aV as ix,b_ as u,b5 as cx,i as ie}from'./main-Q5LNROCU.js';var b=(()=>{class r{constructor(){this.http=C(N2),this.baseUrl=`${ix.apiBaseUrl}/workflows`;}list(t){return this.http.get(this.baseUrl,{params:u(t)}).pipe(cx())}get(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}create(t){return this.http.post(this.baseUrl,t).pipe(cx())}update(t,i){return this.http.patch(`${this.baseUrl}/${encodeURIComponent(t)}`,i).pipe(cx())}delete(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`).pipe(cx())}exportDefinition(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/export`).pipe(cx())}importDefinition(t){return this.http.post(`${this.baseUrl}/import`,t).pipe(cx())}getInstructions(){return this.http.get(`${this.baseUrl}/instructions`,{responseType:"text"}).pipe(cx())}static{this.\u0275fac=function(i){return new(i||r)};}static{this.\u0275prov=ie({token:r,factory:r.\u0275fac,providedIn:"root"});}}return r})();export{b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Z as ZE,K as Kt,bm as Xc,I as Iw,P as Pw,bn as el,o as gI,L as Lh,p as Fw}from'./main-
|
|
1
|
+
import {Z as ZE,K as Kt,bm as Xc,I as Iw,P as Pw,bn as el,o as gI,L as Lh,p as Fw}from'./main-Q5LNROCU.js';var x=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)};}static{this.\u0275cmp=ZE({type:e,selectors:[["app-preferences-manage"]],decls:9,vars:6,consts:[["data-testid","preferences-manage",1,"list-page"],[1,"header"],[1,"lede"]],template:function(t,l){t&1&&(Xc(0,"main",0)(1,"header",1)(2,"div")(3,"h1"),Iw(4),Pw(5,"transloco"),el(),Xc(6,"p",2),Iw(7),Pw(8,"transloco"),el()()()()),t&2&&(gI(4),Lh(Fw(5,2,"manage.preferences.title")),gI(3),Lh(Fw(8,4,"manage.preferences.body")));},dependencies:[Kt],styles:[".list-page[_ngcontent-%COMP%]{padding:1.25rem 1.5rem 3rem;display:flex;flex-direction:column;gap:1rem}.lede[_ngcontent-%COMP%]{margin:.25rem 0 0;color:#57534e}"]});}}return e})();export{x as PreferencesManageComponent};
|